@kong-ui-public/analytics-chart 10.7.2 → 10.7.3
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/style.css +1 -1
- package/dist/types/components/SparklineChart.vue.d.ts +47 -10
- package/dist/types/components/SparklineChart.vue.d.ts.map +1 -1
- package/dist/types/composables/index.d.ts +2 -0
- package/dist/types/composables/index.d.ts.map +1 -1
- package/dist/types/composables/useSparklineSync.d.ts +30 -0
- package/dist/types/composables/useSparklineSync.d.ts.map +1 -0
- package/dist/types/utils/bucketTimestamps.d.ts +2 -2
- package/dist/types/utils/bucketTimestamps.d.ts.map +1 -1
- package/dist/vitals-chart.es.js +5084 -4994
- package/dist/vitals-chart.umd.js +16 -16
- package/package.json +1 -1
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
(function(ot,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons"],d):(ot=typeof globalThis<"u"?globalThis:ot||self,d(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"],ot.KongIcons))})(this,function(ot,d,Fn,Gs){"use strict";var hC=Object.defineProperty;var fC=(ot,d,Fn)=>d in ot?hC(ot,d,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):ot[d]=Fn;var O=(ot,d,Fn)=>fC(ot,typeof d!="symbol"?d+"":d,Fn);var En,Lm;const Fm={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Not all data is shown in the below report. Reports are currently limited to a maximum of {maxReturned} entities.",entityNoName:"no-name",debug:"debug",total:"Total",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}"},csvExport:{dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportAsCsv:"Export as CSV",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"Api product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count"},metricAxisTitles:{request_count:"Request count",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_p99:"Response latency (p99) in {unit}",response_latency_p95:"Response latency (p95) in {unit}",response_latency_p50:"Response latency (p50) in {unit}",upstream_latency_p99:"Upstream latency (p99) in {unit}",upstream_latency_p95:"Upstream latency (p95) in {unit}",upstream_latency_p50:"Upstream latency (p50) in {unit}",kong_latency_p99:"Kong latency (p99) in {unit}",kong_latency_p95:"Kong latency (p95) in {unit}",kong_latency_p50:"Kong latency (p50) in {unit}",response_size_p99:"Response size (p99) in {unit}",response_size_p95:"Response size (p95) in {unit}",response_size_p50:"Response size (p50) in {unit}",request_size_p99:"Request size (p99) in {unit}",request_size_p95:"Request size (p95) in {unit}",request_size_p50:"Request size (p50) in {unit}",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency (p99) in {unit}",RESPONSE_LATENCY_P95:"Response latency (p95) in {unit}",RESPONSE_LATENCY_P50:"Response latency (p50) in {unit}",RESPONSE_SIZE_P99:"Response size (p99) in {unit}",RESPONSE_SIZE_P95:"Response size (p95) in {unit}",RESPONSE_SIZE_P50:"Response size (p50) in {unit}",REQUEST_SIZE_P99:"Request size (p99) in {unit}",REQUEST_SIZE_P95:"Request size (p95) in {unit}",REQUEST_SIZE_P50:"Request size (p50) in {unit}",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99) in {unit}",LatencyP95:"Response latency (p95) in {unit}",LatencyP50:"Response latency (p50) in {unit}",LatencyAverage:"Response latency (avg) in {unit}",UpstreamLatencyP99:"Upstream latency (p99) in {unit}",UpstreamLatencyP95:"Upstream latency (p95) in {unit}",UpstreamLatencyP50:"Upstream latency (p50) in {unit}",UpstreamLatencyAverage:"Upstream latency (avg) in {unit}",KongLatencyP99:"Kong latency (p99) in {unit}",KongLatencyP95:"Kong latency (p95) in {unit}",KongLatencyP50:"Kong latency (p50) in {unit}",KongLatencyAverage:"Kong latency (avg) in {unit}",ResponseSizeP99:"Response size (p99) in {unit}",ResponseSizeP95:"Response size (p95) in {unit}",ResponseSizeP50:"Response size (p50) in {unit}",RequestSizeP99:"Request size (p99) in {unit}",RequestSizeP95:"Request size (p95) in {unit}",RequestSizeP50:"Request size (p50) in {unit}",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)",api:"API"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",daily:"@timestamp per day",weekly:"@timestamp per week"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}},singleValue:{valueError:"Invalid configuration"},new_timerange_label:"Time range",sparkline_no_data:"No data",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel",explore:"Explore"},zoom_time_range:{from:"From",to:"To"}};function zm(){const n=Fn.createI18n("en-us",Fm);return{i18n:n,i18nT:Fn.i18nTComponent(n)}}/*!
|
|
1
|
+
(function(ot,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons"],d):(ot=typeof globalThis<"u"?globalThis:ot||self,d(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"],ot.KongIcons))})(this,function(ot,d,Fn,Ks){"use strict";var yC=Object.defineProperty;var bC=(ot,d,Fn)=>d in ot?yC(ot,d,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):ot[d]=Fn;var E=(ot,d,Fn)=>bC(ot,typeof d!="symbol"?d+"":d,Fn);var En,Fm;const Bm={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Not all data is shown in the below report. Reports are currently limited to a maximum of {maxReturned} entities.",entityNoName:"no-name",debug:"debug",total:"Total",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}"},csvExport:{dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportAsCsv:"Export as CSV",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"Api product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count"},metricAxisTitles:{request_count:"Request count",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_p99:"Response latency (p99) in {unit}",response_latency_p95:"Response latency (p95) in {unit}",response_latency_p50:"Response latency (p50) in {unit}",upstream_latency_p99:"Upstream latency (p99) in {unit}",upstream_latency_p95:"Upstream latency (p95) in {unit}",upstream_latency_p50:"Upstream latency (p50) in {unit}",kong_latency_p99:"Kong latency (p99) in {unit}",kong_latency_p95:"Kong latency (p95) in {unit}",kong_latency_p50:"Kong latency (p50) in {unit}",response_size_p99:"Response size (p99) in {unit}",response_size_p95:"Response size (p95) in {unit}",response_size_p50:"Response size (p50) in {unit}",request_size_p99:"Request size (p99) in {unit}",request_size_p95:"Request size (p95) in {unit}",request_size_p50:"Request size (p50) in {unit}",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency (p99) in {unit}",RESPONSE_LATENCY_P95:"Response latency (p95) in {unit}",RESPONSE_LATENCY_P50:"Response latency (p50) in {unit}",RESPONSE_SIZE_P99:"Response size (p99) in {unit}",RESPONSE_SIZE_P95:"Response size (p95) in {unit}",RESPONSE_SIZE_P50:"Response size (p50) in {unit}",REQUEST_SIZE_P99:"Request size (p99) in {unit}",REQUEST_SIZE_P95:"Request size (p95) in {unit}",REQUEST_SIZE_P50:"Request size (p50) in {unit}",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99) in {unit}",LatencyP95:"Response latency (p95) in {unit}",LatencyP50:"Response latency (p50) in {unit}",LatencyAverage:"Response latency (avg) in {unit}",UpstreamLatencyP99:"Upstream latency (p99) in {unit}",UpstreamLatencyP95:"Upstream latency (p95) in {unit}",UpstreamLatencyP50:"Upstream latency (p50) in {unit}",UpstreamLatencyAverage:"Upstream latency (avg) in {unit}",KongLatencyP99:"Kong latency (p99) in {unit}",KongLatencyP95:"Kong latency (p95) in {unit}",KongLatencyP50:"Kong latency (p50) in {unit}",KongLatencyAverage:"Kong latency (avg) in {unit}",ResponseSizeP99:"Response size (p99) in {unit}",ResponseSizeP95:"Response size (p95) in {unit}",ResponseSizeP50:"Response size (p50) in {unit}",RequestSizeP99:"Request size (p99) in {unit}",RequestSizeP95:"Request size (p95) in {unit}",RequestSizeP50:"Request size (p50) in {unit}",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)",api:"API"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",daily:"@timestamp per day",weekly:"@timestamp per week"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}},singleValue:{valueError:"Invalid configuration"},new_timerange_label:"Time range",sparkline_no_data:"No data",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel",explore:"Explore"},zoom_time_range:{from:"From",to:"To"}};function Hm(){const n=Fn.createI18n("en-us",Bm);return{i18n:n,i18nT:Fn.i18nTComponent(n)}}/*!
|
|
2
2
|
* @kurkle/color v0.3.4
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2024 Jukka Kurkela
|
|
5
5
|
* Released under the MIT License
|
|
6
|
-
*/function Wi(n){return n+.5|0}const gn=(n,t,e)=>Math.max(Math.min(n,e),t);function Vi(n){return gn(Wi(n*2.55),0,255)}function pn(n){return gn(Wi(n*255),0,255)}function Ge(n){return gn(Wi(n/2.55)/100,0,1)}function
|
|
6
|
+
*/function Wi(n){return n+.5|0}const gn=(n,t,e)=>Math.max(Math.min(n,e),t);function Vi(n){return gn(Wi(n*2.55),0,255)}function pn(n){return gn(Wi(n*255),0,255)}function Ge(n){return gn(Wi(n/2.55)/100,0,1)}function yc(n){return gn(Wi(n*100),0,100)}const De={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Po=[..."0123456789ABCDEF"],Wm=n=>Po[n&15],Vm=n=>Po[(n&240)>>4]+Po[n&15],Zs=n=>(n&240)>>4===(n&15),Ym=n=>Zs(n.r)&&Zs(n.g)&&Zs(n.b)&&Zs(n.a);function jm(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&De[n[1]]*17,g:255&De[n[2]]*17,b:255&De[n[3]]*17,a:t===5?De[n[4]]*17:255}:(t===7||t===9)&&(e={r:De[n[1]]<<4|De[n[2]],g:De[n[3]]<<4|De[n[4]],b:De[n[5]]<<4|De[n[6]],a:t===9?De[n[7]]<<4|De[n[8]]:255})),e}const $m=(n,t)=>n<255?t(n):"";function Um(n){var t=Ym(n)?Wm:Vm;return n?"#"+t(n.r)+t(n.g)+t(n.b)+$m(n.a,t):void 0}const qm=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function bc(n,t,e){const i=t*Math.min(e,1-e),s=(r,o=(r+n/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function Xm(n,t,e){const i=(s,r=(s+n/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Gm(n,t,e){const i=bc(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function Km(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function Oo(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),o=Math.min(e,i,s),a=(r+o)/2;let l,c,u;return r!==o&&(u=r-o,c=a>.5?u/(2-r-o):u/(r+o),l=Km(e,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function Eo(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(pn)}function Ao(n,t,e){return Eo(bc,n,t,e)}function Zm(n,t,e){return Eo(Gm,n,t,e)}function Qm(n,t,e){return Eo(Xm,n,t,e)}function _c(n){return(n%360+360)%360}function Jm(n){const t=qm.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Vi(+t[5]):pn(+t[5]));const s=_c(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Zm(s,r,o):t[1]==="hsv"?i=Qm(s,r,o):i=Ao(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function tg(n,t){var e=Oo(n);e[0]=_c(e[0]+t),e=Ao(e),n.r=e[0],n.g=e[1],n.b=e[2]}function eg(n){if(!n)return;const t=Oo(n),e=t[0],i=yc(t[1]),s=yc(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ge(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const xc={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},wc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ng(){const n={},t=Object.keys(wc),e=Object.keys(xc);let i,s,r,o,a;for(i=0;i<t.length;i++){for(o=a=t[i],s=0;s<e.length;s++)r=e[s],a=a.replace(r,xc[r]);r=parseInt(wc[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}let Qs;function ig(n){Qs||(Qs=ng(),Qs.transparent=[0,0,0,0]);const t=Qs[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const sg=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rg(n){const t=sg.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];e=t[8]?Vi(o):gn(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Vi(i):gn(i,0,255)),s=255&(t[4]?Vi(s):gn(s,0,255)),r=255&(t[6]?Vi(r):gn(r,0,255)),{r:i,g:s,b:r,a:e}}}function og(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ge(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Ro=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ui=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function ag(n,t,e){const i=ui(Ge(n.r)),s=ui(Ge(n.g)),r=ui(Ge(n.b));return{r:pn(Ro(i+e*(ui(Ge(t.r))-i))),g:pn(Ro(s+e*(ui(Ge(t.g))-s))),b:pn(Ro(r+e*(ui(Ge(t.b))-r))),a:n.a+e*(t.a-n.a)}}function Js(n,t,e){if(n){let i=Oo(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Ao(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function vc(n,t){return n&&Object.assign(t||{},n)}function Mc(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=pn(n[3]))):(t=vc(n,{r:0,g:0,b:0,a:1}),t.a=pn(t.a)),t}function lg(n){return n.charAt(0)==="r"?rg(n):Jm(n)}class Yi{constructor(t){if(t instanceof Yi)return t;const e=typeof t;let i;e==="object"?i=Mc(t):e==="string"&&(i=jm(t)||ig(t)||lg(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=vc(this._rgb);return t&&(t.a=Ge(t.a)),t}set rgb(t){this._rgb=Mc(t)}rgbString(){return this._valid?og(this._rgb):void 0}hexString(){return this._valid?Um(this._rgb):void 0}hslString(){return this._valid?eg(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=ag(this._rgb,t._rgb,e)),this}clone(){return new Yi(this.rgb)}alpha(t){return this._rgb.a=pn(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Wi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Js(this._rgb,2,t),this}darken(t){return Js(this._rgb,2,-t),this}saturate(t){return Js(this._rgb,1,t),this}desaturate(t){return Js(this._rgb,1,-t),this}rotate(t){return tg(this._rgb,t),this}}/*!
|
|
7
7
|
* Chart.js v4.5.0
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2025 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function Ke(){}const ag=(()=>{let n=0;return()=>n++})();function at(n){return n==null}function kt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function mt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Me(n,t){return Rt(n)?n:t}function lt(n,t){return typeof n>"u"?t:n}const lg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Mc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function St(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Dt(n,t,e,i){let s,r,o;if(kt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(mt(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function Js(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function tr(n){if(kt(n))return n.map(tr);if(mt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=tr(n[e[s]]);return t}return n}function kc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function cg(n,t,e,i){if(!kc(n))return;const s=t[n],r=e[n];mt(s)&&mt(r)?ji(s,r,i):t[n]=tr(r)}function ji(n,t,e){const i=kt(t)?t:[t],s=i.length;if(!mt(n))return n;e=e||{};const r=e.merger||cg;let o;for(let a=0;a<s;++a){if(o=i[a],!mt(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],n,o,e)}return n}function $i(n,t){return ji(n,t,{merger:ug})}function ug(n,t,e){if(!kc(n))return;const i=t[n],s=e[n];mt(i)&&mt(s)?$i(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=tr(s))}const Sc={"":n=>n,x:n=>n.x,y:n=>n.y};function dg(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function hg(n){const t=dg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function yn(n,t){return(Sc[t]||(Sc[t]=hg(t)))(n)}function Ro(n){return n.charAt(0).toUpperCase()+n.slice(1)}const me=n=>typeof n<"u",ge=n=>typeof n=="function",Dc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function fg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ht=Math.PI,Ot=2*ht,mg=Ot+ht,er=Number.POSITIVE_INFINITY,Io=ht/180,Et=ht/2,Te=ht/4,nr=ht*2/3,bn=Math.log10,We=Math.sign;function Ui(n,t,e){return Math.abs(n-t)<e}function Tc(n){const t=Math.round(n);n=Ui(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(bn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function gg(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function pg(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function _n(n){return!pg(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function yg(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Cc(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function $t(n){return n*(ht/180)}function ir(n){return n*(180/ht)}function Pc(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function sr(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*ht&&(r+=Ot),{angle:r,distance:s}}function di(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function bg(n,t){return(n-t+mg)%Ot-ht}function se(n){return(n%Ot+Ot)%Ot}function qi(n,t,e,i){const s=se(n),r=se(t),o=se(e),a=se(r-s),l=se(o-s),c=se(s-r),u=se(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Qt(n,t,e){return Math.max(t,Math.min(e,n))}function _g(n){return Qt(n,-32768,32767)}function Ze(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Lo(n,t,e){e=e||(o=>n[o]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const Qe=(n,t,e,i)=>Lo(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),xg=(n,t,e)=>Lo(n,e,i=>n[i][t]>=e);function wg(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const Oc=["push","pop","shift","splice","unshift"];function vg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Oc.forEach(e=>{const i="_onData"+Ro(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Ec(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Oc.forEach(r=>{delete n[r]}),delete n._chartjs)}function Ac(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Rc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Ic(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Rc.call(window,()=>{i=!1,n.apply(t,e)}))}}function Mg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const No=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,kg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Lc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,vScale:a,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=o.axis,{min:h,max:f,minDefined:m,maxDefined:g}=o.getUserBounds();if(m){if(s=Math.min(Qe(l,u,h).lo,e?i:Qe(t,u,o.getPixelForValue(h)).lo),c){const b=l.slice(0,s+1).reverse().findIndex(x=>!at(x[a.axis]));s-=Math.max(0,b)}s=Qt(s,0,i-1)}if(g){let b=Math.max(Qe(l,o.axis,f,!0).hi+1,e?0:Qe(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(b-1).findIndex(k=>!at(k[a.axis]));b+=Math.max(0,x)}r=Qt(b,s,i)-s}else r=i-s}return{start:s,count:r}}function Nc(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const rr=n=>n===0||n===1,Fc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),zc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/e)+1,Xi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Et)+1,easeOutSine:n=>Math.sin(n*Et),easeInOutSine:n=>-.5*(Math.cos(ht*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>rr(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>rr(n)?n:Fc(n,.075,.3),easeOutElastic:n=>rr(n)?n:zc(n,.075,.3),easeInOutElastic(n){return rr(n)?n:n<.5?.5*Fc(n*2,.1125,.45):.5+.5*zc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Xi.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Xi.easeInBounce(n*2)*.5:Xi.easeOutBounce(n*2-1)*.5+.5};function Fo(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Bc(n){return Fo(n)?n:new Yi(n)}function zo(n){return Fo(n)?n:new Yi(n).saturate(.5).darken(.1).hexString()}const Sg=["x","y","borderWidth","radius","tension"],Dg=["color","borderColor","backgroundColor"];function Tg(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:Dg},numbers:{type:"number",properties:Sg}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Cg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Hc=new Map;function Pg(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Hc.get(e);return i||(i=new Intl.NumberFormat(n,t),Hc.set(e,i)),i}function Gi(n,t,e){return Pg(t,e).format(n)}const Wc={values(n){return kt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=Og(n,e)}const o=bn(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Gi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(bn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Wc.numeric.call(this,n,t,e):""}};function Og(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var or={formatters:Wc};function Eg(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:or.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const zn=Object.create(null),Bo=Object.create(null);function Ki(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Ho(n,t,e){return typeof t=="string"?ji(Ki(n,t),e):ji(Ki(n,""),t)}class Ag{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>zo(s.backgroundColor),this.hoverBorderColor=(i,s)=>zo(s.borderColor),this.hoverColor=(i,s)=>zo(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Ho(this,t,e)}get(t){return Ki(this,t)}describe(t,e){return Ho(Bo,t,e)}override(t,e){return Ho(zn,t,e)}route(t,e,i,s){const r=Ki(this,t),o=Ki(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return mt(l)?Object.assign({},c,l):lt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var At=new Ag({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Tg,Cg,Eg]);function Rg(n){return!n||at(n.size)||at(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ar(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function Ig(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0;const a=e.length;let l,c,u,h,f;for(l=0;l<a;l++)if(h=e[l],h!=null&&!kt(h))o=ar(n,s,r,o,h);else if(kt(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!kt(f)&&(o=ar(n,s,r,o,f));n.restore();const m=r.length/2;if(m>e.length){for(l=0;l<m;l++)delete s[r[l]];r.splice(0,m)}return o}function Bn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Vc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Wo(n,t,e,i){Yc(n,t,e,i,null)}function Yc(n,t,e,i,s){let r,o,a,l,c,u,h,f;const m=t.pointStyle,g=t.rotation,b=t.radius;let x=(g||0)*Io;if(m&&typeof m=="object"&&(r=m.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(b)||b<=0)){switch(n.beginPath(),m){default:s?n.ellipse(e,i,s/2,b,0,0,Ot):n.arc(e,i,b,0,Ot),n.closePath();break;case"triangle":u=s?s/2:b,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*b),x+=nr,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*b),x+=nr,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*b),n.closePath();break;case"rectRounded":c=b*.516,l=b-c,o=Math.cos(x+Te)*l,h=Math.cos(x+Te)*(s?s/2-c:l),a=Math.sin(x+Te)*l,f=Math.sin(x+Te)*(s?s/2-c:l),n.arc(e-h,i-a,c,x-ht,x-Et),n.arc(e+f,i-o,c,x-Et,x),n.arc(e+h,i+a,c,x,x+Et),n.arc(e-f,i+o,c,x+Et,x+ht),n.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*b,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=Te;case"rectRot":h=Math.cos(x)*(s?s/2:b),o=Math.cos(x)*b,a=Math.sin(x)*b,f=Math.sin(x)*(s?s/2:b),n.moveTo(e-h,i-a),n.lineTo(e+f,i-o),n.lineTo(e+h,i+a),n.lineTo(e-f,i+o),n.closePath();break;case"crossRot":x+=Te;case"cross":h=Math.cos(x)*(s?s/2:b),o=Math.cos(x)*b,a=Math.sin(x)*b,f=Math.sin(x)*(s?s/2:b),n.moveTo(e-h,i-a),n.lineTo(e+h,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"star":h=Math.cos(x)*(s?s/2:b),o=Math.cos(x)*b,a=Math.sin(x)*b,f=Math.sin(x)*(s?s/2:b),n.moveTo(e-h,i-a),n.lineTo(e+h,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o),x+=Te,h=Math.cos(x)*(s?s/2:b),o=Math.cos(x)*b,a=Math.sin(x)*b,f=Math.sin(x)*(s?s/2:b),n.moveTo(e-h,i-a),n.lineTo(e+h,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"line":o=s?s/2:Math.cos(x)*b,a=Math.sin(x)*b,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:b),i+Math.sin(x)*b);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Je(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Zi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Qi(n){n.restore()}function Lg(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Ng(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Fg(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),at(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function zg(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function Bg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Hn(n,t,e,i,s,r={}){const o=kt(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,Fg(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&Bg(n,r.backdrop),a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),at(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),zg(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function hi(n,t){const{x:e,y:i,w:s,h:r,radius:o}=t;n.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*ht,ht,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,ht,Et,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Et,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Et,!0),n.lineTo(e+o.topLeft,i)}const Hg=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Wg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Vg(n,t){const e=(""+n).match(Hg);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Yg=n=>+n||0;function Vo(n,t){const e={},i=mt(t),s=i?Object.keys(t):t,r=mt(n)?i?o=>lt(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=Yg(r(o));return e}function jc(n){return Vo(n,{top:"y",right:"x",bottom:"y",left:"x"})}function xn(n){return Vo(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(n){const t=jc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(n,t){n=n||{},t=t||At.font;let e=lt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=lt(n.style,t.style);i&&!(""+i).match(Wg)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:lt(n.family,t.family),lineHeight:Vg(lt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:lt(n.weight,t.weight),string:""};return s.string=Rg(s),s}function Ji(n,t,e,i){let s,r,o;for(s=0,r=n.length;s<r;++s)if(o=n[s],o!==void 0&&o!==void 0)return o}function jg(n,t,e){const{min:i,max:s}=n,r=Mc(t,(s-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function wn(n,t){return Object.assign(Object.create(n),t)}function Yo(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Gc("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Yo([a,...n],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return Uc(a,l,()=>Qg(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return Kc(a).includes(l)},ownKeys(a){return Kc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function fi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:$c(n,i),setContext:r=>fi(n,r,e,i),override:r=>fi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return Uc(r,o,()=>Ug(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function $c(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:ge(e)?e:()=>e,isIndexable:ge(i)?i:()=>i}}const $g=(n,t)=>n?n+Ro(t):t,jo=(n,t)=>mt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Uc(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Ug(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return ge(a)&&o.isScriptable(t)&&(a=qg(t,a,n,e)),kt(a)&&a.length&&(a=Xg(t,a,n,o.isIndexable)),jo(t,a)&&(a=fi(a,s,r&&r[t],o)),a}function qg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(r,o||i);return a.delete(n),jo(n,l)&&(l=$o(s._scopes,s,n,l)),l}function Xg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(mt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const h=$o(c,s,n,u);t.push(fi(h,r,o&&o[n],a))}}return t}function qc(n,t,e){return ge(n)?n(t,e):n}const Gg=(n,t)=>n===!0?t:typeof n=="string"?yn(t,n):void 0;function Kg(n,t,e,i,s){for(const r of t){const o=Gg(e,r);if(o){n.add(o);const a=qc(o._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function $o(n,t,e,i){const s=t._rootScopes,r=qc(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Xc(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Xc(a,o,r,l,i),l===null)?!1:Yo(Array.from(a),[""],s,r,()=>Zg(t,e,i))}function Xc(n,t,e,i,s){for(;e;)e=Kg(n,t,e,i,s);return e}function Zg(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return kt(s)&&mt(e)?e:s||{}}function Qg(n,t,e,i){let s;for(const r of t)if(s=Gc($g(r,n),e),typeof s<"u")return jo(n,s)?$o(e,i,n,s):s}function Gc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Kc(n){let t=n._keys;return t||(t=n._keys=Jg(n._scopes)),t}function Jg(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Zc(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],o[a]={r:s.parse(yn(u,r),c)};return o}const tp=Number.EPSILON||1e-14,mi=(n,t)=>t<n.length&&!n[t].skip&&n[t],Qc=n=>n==="x"?"y":"x";function ep(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=di(r,s),l=di(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,f=i*u;return{previous:{x:r.x-h*(o.x-s.x),y:r.y-h*(o.y-s.y)},next:{x:r.x+f*(o.x-s.x),y:r.y+f*(o.y-s.y)}}}function np(n,t,e){const i=n.length;let s,r,o,a,l,c=mi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=mi(n,u+1),!(!l||!c)){if(Ui(t[u],0,tp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[u]=s*o*t[u],e[u+1]=r*o*t[u])}}function ip(n,t,e="x"){const i=Qc(e),s=n.length;let r,o,a,l=mi(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=mi(n,c+1),!a)continue;const u=a[e],h=a[i];o&&(r=(u-o[e])/3,a[`cp1${e}`]=u-r,a[`cp1${i}`]=h-r*t[c]),l&&(r=(l[e]-u)/3,a[`cp2${e}`]=u+r,a[`cp2${i}`]=h+r*t[c])}}function sp(n,t="x"){const e=Qc(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=mi(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=mi(n,o+1),!!l){if(c){const u=c[t]-l[t];s[o]=u!==0?(c[e]-l[e])/u:0}r[o]=a?c?We(s[o-1])!==We(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}np(n,s,r),ip(n,r,t)}function lr(n,t,e){return Math.max(Math.min(n,e),t)}function rp(n,t){let e,i,s,r,o,a=Je(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&Je(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=lr(s.cp1x,t.left,t.right),s.cp1y=lr(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=lr(s.cp2x,t.left,t.right),s.cp2y=lr(s.cp2y,t.top,t.bottom)))}function op(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")sp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],l=ep(c,a,n[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&rp(n,e)}function Uo(){return typeof window<"u"&&typeof document<"u"}function qo(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function cr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const ur=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function ap(n,t){return ur(n).getPropertyValue(t)}const lp=["top","right","bottom","left"];function Wn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=lp[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const cp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function up(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(cp(s,r,n.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function vn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=ur(e),r=s.boxSizing==="border-box",o=Wn(s,"padding"),a=Wn(s,"border","width"),{x:l,y:c,box:u}=up(n,e),h=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:m,height:g}=t;return r&&(m-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-h)/m*e.width/i),y:Math.round((c-f)/g*e.height/i)}}function dp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&qo(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=ur(r),l=Wn(a,"border","width"),c=Wn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=cr(a.maxWidth,r,"clientWidth"),s=cr(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||er,maxHeight:s||er}}const dr=n=>Math.round(n*10)/10;function hp(n,t,e,i){const s=ur(n),r=Wn(s,"margin"),o=cr(s.maxWidth,n,"clientWidth")||er,a=cr(s.maxHeight,n,"clientHeight")||er,l=dp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=Wn(s,"border","width"),m=Wn(s,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=dr(Math.min(c,o,l.maxWidth)),u=dr(Math.min(u,a,l.maxHeight)),c&&!u&&(u=dr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=dr(Math.floor(u*i))),{width:c,height:u}}function Jc(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const fp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Uo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function tu(n,t){const e=ap(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Vn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function mp(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function gp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=Vn(n,s,e),a=Vn(s,r,e),l=Vn(r,t,e),c=Vn(o,a,e),u=Vn(a,l,e);return Vn(c,u,e)}const pp=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},yp=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function gi(n,t,e){return n?pp(t,e):yp()}function eu(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function nu(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function iu(n){return n==="angle"?{between:qi,compare:bg,normalize:se}:{between:Ze,compare:(t,e)=>t-e,normalize:t=>t}}function su({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function bp(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=iu(i),l=t.length;let{start:c,end:u,loop:h}=n,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&o(a(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:n.style}}function ru(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=iu(i),{start:u,end:h,loop:f,style:m}=bp(n,t,e),g=[];let b=!1,x=null,k,M,T;const v=()=>l(s,T,k)&&a(s,T)!==0,S=()=>a(r,k)===0||l(r,T,k),E=()=>b||v(),P=()=>!b||S();for(let y=u,_=u;y<=h;++y)M=t[y%o],!M.skip&&(k=c(M[i]),k!==T&&(b=l(k,s,r),x===null&&E()&&(x=a(k,s)===0?y:_),x!==null&&P()&&(g.push(su({start:x,end:y,loop:f,count:o,style:m})),x=null),_=y,T=k));return x!==null&&g.push(su({start:x,end:h,loop:f,count:o,style:m})),g}function ou(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=ru(i[s],n.points,t);r.length&&e.push(...r)}return e}function _p(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function xp(n,t,e,i){const s=n.length,r=[];let o=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function wp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=_p(e,s,r,i);if(i===!0)return au(n,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!n._fullLoop&&o===0&&a===s-1;return au(n,xp(e,o,l,c),e,t)}function au(n,t,e,i){return!i||!i.setContext||!e?t:vp(n,t,e,i)}function vp(n,t,e,i){const s=n._chart.getContext(),r=lu(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,h=t[0].start,f=h;function m(g,b,x,k){const M=a?-1:1;if(g!==b){for(g+=l;e[g%l].skip;)g-=M;for(;e[b%l].skip;)b+=M;g%l!==b%l&&(c.push({start:g%l,end:b%l,loop:x,style:k}),u=k,h=b%l)}}for(const g of t){h=a?h:g.start;let b=e[h%l],x;for(f=h+1;f<=g.end;f++){const k=e[f%l];x=lu(i.setContext(wn(s,{type:"segment",p0:b,p1:k,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),Mp(x,u)&&m(h,f-1,g.loop,u),b=k,u=x}h<f-1&&m(h,f-1,g.loop,u)}return c}function lu(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Mp(n,t){if(!t)return!1;const e=[],i=function(s,r){return Fo(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function hr(n,t,e){return n.options.clip?n[e]:t[e]}function kp(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:hr(e,t,"left"),right:hr(e,t,"right"),top:hr(i,t,"top"),bottom:hr(i,t,"bottom")}:t}function cu(n,t){const e=t._clip;if(e.disabled)return!1;const i=kp(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}/*!
|
|
11
|
+
*/function Ke(){}const cg=(()=>{let n=0;return()=>n++})();function at(n){return n==null}function St(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function mt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Me(n,t){return Rt(n)?n:t}function lt(n,t){return typeof n>"u"?t:n}const ug=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Sc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function kt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Dt(n,t,e,i){let s,r,o;if(St(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(mt(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function tr(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function er(n){if(St(n))return n.map(er);if(mt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=er(n[e[s]]);return t}return n}function kc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function dg(n,t,e,i){if(!kc(n))return;const s=t[n],r=e[n];mt(s)&&mt(r)?ji(s,r,i):t[n]=er(r)}function ji(n,t,e){const i=St(t)?t:[t],s=i.length;if(!mt(n))return n;e=e||{};const r=e.merger||dg;let o;for(let a=0;a<s;++a){if(o=i[a],!mt(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],n,o,e)}return n}function $i(n,t){return ji(n,t,{merger:hg})}function hg(n,t,e){if(!kc(n))return;const i=t[n],s=e[n];mt(i)&&mt(s)?$i(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=er(s))}const Dc={"":n=>n,x:n=>n.x,y:n=>n.y};function fg(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function mg(n){const t=fg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function yn(n,t){return(Dc[t]||(Dc[t]=mg(t)))(n)}function Io(n){return n.charAt(0).toUpperCase()+n.slice(1)}const me=n=>typeof n<"u",ge=n=>typeof n=="function",Tc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function gg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ht=Math.PI,Ot=2*ht,pg=Ot+ht,nr=Number.POSITIVE_INFINITY,Lo=ht/180,Et=ht/2,Te=ht/4,ir=ht*2/3,bn=Math.log10,We=Math.sign;function Ui(n,t,e){return Math.abs(n-t)<e}function Cc(n){const t=Math.round(n);n=Ui(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(bn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function yg(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function bg(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function _n(n){return!bg(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function _g(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Pc(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function $t(n){return n*(ht/180)}function sr(n){return n*(180/ht)}function Oc(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function rr(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*ht&&(r+=Ot),{angle:r,distance:s}}function di(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function xg(n,t){return(n-t+pg)%Ot-ht}function se(n){return(n%Ot+Ot)%Ot}function qi(n,t,e,i){const s=se(n),r=se(t),o=se(e),a=se(r-s),l=se(o-s),c=se(s-r),u=se(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Qt(n,t,e){return Math.max(t,Math.min(e,n))}function wg(n){return Qt(n,-32768,32767)}function Ze(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function No(n,t,e){e=e||(o=>n[o]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const Qe=(n,t,e,i)=>No(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),vg=(n,t,e)=>No(n,e,i=>n[i][t]>=e);function Mg(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const Ec=["push","pop","shift","splice","unshift"];function Sg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ec.forEach(e=>{const i="_onData"+Io(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Ac(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Ec.forEach(r=>{delete n[r]}),delete n._chartjs)}function Rc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Ic=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Lc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Ic.call(window,()=>{i=!1,n.apply(t,e)}))}}function kg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Fo=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Dg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Nc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,vScale:a,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=o.axis,{min:h,max:f,minDefined:m,maxDefined:g}=o.getUserBounds();if(m){if(s=Math.min(Qe(l,u,h).lo,e?i:Qe(t,u,o.getPixelForValue(h)).lo),c){const _=l.slice(0,s+1).reverse().findIndex(x=>!at(x[a.axis]));s-=Math.max(0,_)}s=Qt(s,0,i-1)}if(g){let _=Math.max(Qe(l,o.axis,f,!0).hi+1,e?0:Qe(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(_-1).findIndex(M=>!at(M[a.axis]));_+=Math.max(0,x)}r=Qt(_,s,i)-s}else r=i-s}return{start:s,count:r}}function Fc(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const or=n=>n===0||n===1,zc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),Bc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/e)+1,Xi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Et)+1,easeOutSine:n=>Math.sin(n*Et),easeInOutSine:n=>-.5*(Math.cos(ht*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>or(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>or(n)?n:zc(n,.075,.3),easeOutElastic:n=>or(n)?n:Bc(n,.075,.3),easeInOutElastic(n){return or(n)?n:n<.5?.5*zc(n*2,.1125,.45):.5+.5*Bc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Xi.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Xi.easeInBounce(n*2)*.5:Xi.easeOutBounce(n*2-1)*.5+.5};function zo(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Hc(n){return zo(n)?n:new Yi(n)}function Bo(n){return zo(n)?n:new Yi(n).saturate(.5).darken(.1).hexString()}const Tg=["x","y","borderWidth","radius","tension"],Cg=["color","borderColor","backgroundColor"];function Pg(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:Cg},numbers:{type:"number",properties:Tg}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Og(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Wc=new Map;function Eg(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Wc.get(e);return i||(i=new Intl.NumberFormat(n,t),Wc.set(e,i)),i}function Gi(n,t,e){return Eg(t,e).format(n)}const Vc={values(n){return St(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=Ag(n,e)}const o=bn(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Gi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(bn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Vc.numeric.call(this,n,t,e):""}};function Ag(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var ar={formatters:Vc};function Rg(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ar.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const zn=Object.create(null),Ho=Object.create(null);function Ki(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Wo(n,t,e){return typeof t=="string"?ji(Ki(n,t),e):ji(Ki(n,""),t)}class Ig{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Bo(s.backgroundColor),this.hoverBorderColor=(i,s)=>Bo(s.borderColor),this.hoverColor=(i,s)=>Bo(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Wo(this,t,e)}get(t){return Ki(this,t)}describe(t,e){return Wo(Ho,t,e)}override(t,e){return Wo(zn,t,e)}route(t,e,i,s){const r=Ki(this,t),o=Ki(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return mt(l)?Object.assign({},c,l):lt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var At=new Ig({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Pg,Og,Rg]);function Lg(n){return!n||at(n.size)||at(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function lr(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function Ng(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0;const a=e.length;let l,c,u,h,f;for(l=0;l<a;l++)if(h=e[l],h!=null&&!St(h))o=lr(n,s,r,o,h);else if(St(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!St(f)&&(o=lr(n,s,r,o,f));n.restore();const m=r.length/2;if(m>e.length){for(l=0;l<m;l++)delete s[r[l]];r.splice(0,m)}return o}function Bn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Yc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Vo(n,t,e,i){jc(n,t,e,i,null)}function jc(n,t,e,i,s){let r,o,a,l,c,u,h,f;const m=t.pointStyle,g=t.rotation,_=t.radius;let x=(g||0)*Lo;if(m&&typeof m=="object"&&(r=m.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:s?n.ellipse(e,i,s/2,_,0,0,Ot):n.arc(e,i,_,0,Ot),n.closePath();break;case"triangle":u=s?s/2:_,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*_),x+=ir,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*_),x+=ir,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*_),n.closePath();break;case"rectRounded":c=_*.516,l=_-c,o=Math.cos(x+Te)*l,h=Math.cos(x+Te)*(s?s/2-c:l),a=Math.sin(x+Te)*l,f=Math.sin(x+Te)*(s?s/2-c:l),n.arc(e-h,i-a,c,x-ht,x-Et),n.arc(e+f,i-o,c,x-Et,x),n.arc(e+h,i+a,c,x,x+Et),n.arc(e-f,i+o,c,x+Et,x+ht),n.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*_,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=Te;case"rectRot":h=Math.cos(x)*(s?s/2:_),o=Math.cos(x)*_,a=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-a),n.lineTo(e+f,i-o),n.lineTo(e+h,i+a),n.lineTo(e-f,i+o),n.closePath();break;case"crossRot":x+=Te;case"cross":h=Math.cos(x)*(s?s/2:_),o=Math.cos(x)*_,a=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-a),n.lineTo(e+h,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"star":h=Math.cos(x)*(s?s/2:_),o=Math.cos(x)*_,a=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-a),n.lineTo(e+h,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o),x+=Te,h=Math.cos(x)*(s?s/2:_),o=Math.cos(x)*_,a=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-a),n.lineTo(e+h,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"line":o=s?s/2:Math.cos(x)*_,a=Math.sin(x)*_,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:_),i+Math.sin(x)*_);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Je(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Zi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Qi(n){n.restore()}function Fg(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function zg(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Bg(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),at(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Hg(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function Wg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Hn(n,t,e,i,s,r={}){const o=St(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,Bg(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&Wg(n,r.backdrop),a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),at(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),Hg(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function hi(n,t){const{x:e,y:i,w:s,h:r,radius:o}=t;n.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*ht,ht,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,ht,Et,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Et,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Et,!0),n.lineTo(e+o.topLeft,i)}const Vg=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Yg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function jg(n,t){const e=(""+n).match(Vg);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const $g=n=>+n||0;function Yo(n,t){const e={},i=mt(t),s=i?Object.keys(t):t,r=mt(n)?i?o=>lt(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=$g(r(o));return e}function $c(n){return Yo(n,{top:"y",right:"x",bottom:"y",left:"x"})}function xn(n){return Yo(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(n){const t=$c(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(n,t){n=n||{},t=t||At.font;let e=lt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=lt(n.style,t.style);i&&!(""+i).match(Yg)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:lt(n.family,t.family),lineHeight:jg(lt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:lt(n.weight,t.weight),string:""};return s.string=Lg(s),s}function Ji(n,t,e,i){let s,r,o;for(s=0,r=n.length;s<r;++s)if(o=n[s],o!==void 0&&o!==void 0)return o}function Ug(n,t,e){const{min:i,max:s}=n,r=Sc(t,(s-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function wn(n,t){return Object.assign(Object.create(n),t)}function jo(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Kc("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>jo([a,...n],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return qc(a,l,()=>tp(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return Zc(a).includes(l)},ownKeys(a){return Zc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function fi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Uc(n,i),setContext:r=>fi(n,r,e,i),override:r=>fi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return qc(r,o,()=>Xg(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function Uc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:ge(e)?e:()=>e,isIndexable:ge(i)?i:()=>i}}const qg=(n,t)=>n?n+Io(t):t,$o=(n,t)=>mt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function qc(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Xg(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return ge(a)&&o.isScriptable(t)&&(a=Gg(t,a,n,e)),St(a)&&a.length&&(a=Kg(t,a,n,o.isIndexable)),$o(t,a)&&(a=fi(a,s,r&&r[t],o)),a}function Gg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(r,o||i);return a.delete(n),$o(n,l)&&(l=Uo(s._scopes,s,n,l)),l}function Kg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(mt(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const h=Uo(c,s,n,u);t.push(fi(h,r,o&&o[n],a))}}return t}function Xc(n,t,e){return ge(n)?n(t,e):n}const Zg=(n,t)=>n===!0?t:typeof n=="string"?yn(t,n):void 0;function Qg(n,t,e,i,s){for(const r of t){const o=Zg(e,r);if(o){n.add(o);const a=Xc(o._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function Uo(n,t,e,i){const s=t._rootScopes,r=Xc(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Gc(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Gc(a,o,r,l,i),l===null)?!1:jo(Array.from(a),[""],s,r,()=>Jg(t,e,i))}function Gc(n,t,e,i,s){for(;e;)e=Qg(n,t,e,i,s);return e}function Jg(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return St(s)&&mt(e)?e:s||{}}function tp(n,t,e,i){let s;for(const r of t)if(s=Kc(qg(r,n),e),typeof s<"u")return $o(n,s)?Uo(e,i,n,s):s}function Kc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Zc(n){let t=n._keys;return t||(t=n._keys=ep(n._scopes)),t}function ep(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Qc(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],o[a]={r:s.parse(yn(u,r),c)};return o}const np=Number.EPSILON||1e-14,mi=(n,t)=>t<n.length&&!n[t].skip&&n[t],Jc=n=>n==="x"?"y":"x";function ip(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=di(r,s),l=di(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,f=i*u;return{previous:{x:r.x-h*(o.x-s.x),y:r.y-h*(o.y-s.y)},next:{x:r.x+f*(o.x-s.x),y:r.y+f*(o.y-s.y)}}}function sp(n,t,e){const i=n.length;let s,r,o,a,l,c=mi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=mi(n,u+1),!(!l||!c)){if(Ui(t[u],0,np)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[u]=s*o*t[u],e[u+1]=r*o*t[u])}}function rp(n,t,e="x"){const i=Jc(e),s=n.length;let r,o,a,l=mi(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=mi(n,c+1),!a)continue;const u=a[e],h=a[i];o&&(r=(u-o[e])/3,a[`cp1${e}`]=u-r,a[`cp1${i}`]=h-r*t[c]),l&&(r=(l[e]-u)/3,a[`cp2${e}`]=u+r,a[`cp2${i}`]=h+r*t[c])}}function op(n,t="x"){const e=Jc(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=mi(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=mi(n,o+1),!!l){if(c){const u=c[t]-l[t];s[o]=u!==0?(c[e]-l[e])/u:0}r[o]=a?c?We(s[o-1])!==We(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}sp(n,s,r),rp(n,r,t)}function cr(n,t,e){return Math.max(Math.min(n,e),t)}function ap(n,t){let e,i,s,r,o,a=Je(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&Je(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=cr(s.cp1x,t.left,t.right),s.cp1y=cr(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=cr(s.cp2x,t.left,t.right),s.cp2y=cr(s.cp2y,t.top,t.bottom)))}function lp(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")op(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],l=ip(c,a,n[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&ap(n,e)}function qo(){return typeof window<"u"&&typeof document<"u"}function Xo(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ur(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const dr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function cp(n,t){return dr(n).getPropertyValue(t)}const up=["top","right","bottom","left"];function Wn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=up[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const dp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function hp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(dp(s,r,n.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function vn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=dr(e),r=s.boxSizing==="border-box",o=Wn(s,"padding"),a=Wn(s,"border","width"),{x:l,y:c,box:u}=hp(n,e),h=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:m,height:g}=t;return r&&(m-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-h)/m*e.width/i),y:Math.round((c-f)/g*e.height/i)}}function fp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Xo(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=dr(r),l=Wn(a,"border","width"),c=Wn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=ur(a.maxWidth,r,"clientWidth"),s=ur(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||nr,maxHeight:s||nr}}const hr=n=>Math.round(n*10)/10;function mp(n,t,e,i){const s=dr(n),r=Wn(s,"margin"),o=ur(s.maxWidth,n,"clientWidth")||nr,a=ur(s.maxHeight,n,"clientHeight")||nr,l=fp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=Wn(s,"border","width"),m=Wn(s,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=hr(Math.min(c,o,l.maxWidth)),u=hr(Math.min(u,a,l.maxHeight)),c&&!u&&(u=hr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=hr(Math.floor(u*i))),{width:c,height:u}}function tu(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const gp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};qo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function eu(n,t){const e=cp(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Vn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function pp(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function yp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=Vn(n,s,e),a=Vn(s,r,e),l=Vn(r,t,e),c=Vn(o,a,e),u=Vn(a,l,e);return Vn(c,u,e)}const bp=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},_p=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function gi(n,t,e){return n?bp(t,e):_p()}function nu(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function iu(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function su(n){return n==="angle"?{between:qi,compare:xg,normalize:se}:{between:Ze,compare:(t,e)=>t-e,normalize:t=>t}}function ru({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function xp(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=su(i),l=t.length;let{start:c,end:u,loop:h}=n,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&o(a(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:n.style}}function ou(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=su(i),{start:u,end:h,loop:f,style:m}=xp(n,t,e),g=[];let _=!1,x=null,M,v,T;const k=()=>l(s,T,M)&&a(s,T)!==0,C=()=>a(r,M)===0||l(r,T,M),I=()=>_||k(),P=()=>!_||C();for(let y=u,b=u;y<=h;++y)v=t[y%o],!v.skip&&(M=c(v[i]),M!==T&&(_=l(M,s,r),x===null&&I()&&(x=a(M,s)===0?y:b),x!==null&&P()&&(g.push(ru({start:x,end:y,loop:f,count:o,style:m})),x=null),b=y,T=M));return x!==null&&g.push(ru({start:x,end:h,loop:f,count:o,style:m})),g}function au(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=ou(i[s],n.points,t);r.length&&e.push(...r)}return e}function wp(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function vp(n,t,e,i){const s=n.length,r=[];let o=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function Mp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=wp(e,s,r,i);if(i===!0)return lu(n,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!n._fullLoop&&o===0&&a===s-1;return lu(n,vp(e,o,l,c),e,t)}function lu(n,t,e,i){return!i||!i.setContext||!e?t:Sp(n,t,e,i)}function Sp(n,t,e,i){const s=n._chart.getContext(),r=cu(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,h=t[0].start,f=h;function m(g,_,x,M){const v=a?-1:1;if(g!==_){for(g+=l;e[g%l].skip;)g-=v;for(;e[_%l].skip;)_+=v;g%l!==_%l&&(c.push({start:g%l,end:_%l,loop:x,style:M}),u=M,h=_%l)}}for(const g of t){h=a?h:g.start;let _=e[h%l],x;for(f=h+1;f<=g.end;f++){const M=e[f%l];x=cu(i.setContext(wn(s,{type:"segment",p0:_,p1:M,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),kp(x,u)&&m(h,f-1,g.loop,u),_=M,u=x}h<f-1&&m(h,f-1,g.loop,u)}return c}function cu(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function kp(n,t){if(!t)return!1;const e=[],i=function(s,r){return zo(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function fr(n,t,e){return n.options.clip?n[e]:t[e]}function Dp(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:fr(e,t,"left"),right:fr(e,t,"right"),top:fr(i,t,"top"),bottom:fr(i,t,"bottom")}:t}function uu(n,t){const e=t._clip;if(e.disabled)return!1;const i=Dp(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}/*!
|
|
12
12
|
* Chart.js v4.5.0
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2025 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class Sp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Rc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var tn=new Sp;const uu="transparent",Dp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Bc(n||uu),s=i.valid&&Bc(t||uu);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Tp{constructor(t,e,i,s){const r=e[i];s=Ji([t.to,s,r,t.from]);const o=Ji([t.from,r,s]);this._active=!0,this._fn=t.fn||Dp[t.type||typeof o],this._easing=Xi[t.easing]||Xi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ji([t.to,e,s,t.from]),this._from=Ji([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Xo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!mt(t))return;const e=Object.keys(At.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!mt(r))return;const o={};for(const a of e)o[a]=r[a];(kt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=Pp(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Cp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let h=r[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,u,a);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=h=new Tp(f,t,c,u),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return tn.add(this._chart,i),!0}}function Cp(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Pp(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function du(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function Op(n,t,e){if(e===!1)return!1;const i=du(n,e),s=du(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Ep(n){let t,e,i,s;return mt(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function hu(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function fu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(u=!0,i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||We(t)===We(c))&&(t+=c)}return!u&&!i.all?0:t}function Ap(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function Go(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Rp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Ip(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Lp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function mu(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function gu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=Rp(r,o,i),h=t.length;let f;for(let m=0;m<h;++m){const g=t[m],{[l]:b,[c]:x}=g,k=g._stacks||(g._stacks={});f=k[c]=Lp(s,u,b),f[a]=x,f._top=mu(f,o,!0,i.type),f._bottom=mu(f,o,!1,i.type);const M=f._visualValues||(f._visualValues={});M[a]=x}}function Ko(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Np(n,t){return wn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Fp(n,t,e){return wn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ts(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const Zo=n=>n==="reset"||n==="none",pu=(n,t)=>t?n:Object.assign({},n),zp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:hu(e,!0),values:null};class Le{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Go(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ts(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,r=e.xAxisID=lt(i.xAxisID,Ko(t,"x")),o=e.yAxisID=lt(i.yAxisID,Ko(t,"y")),a=e.rAxisID=lt(i.rAxisID,Ko(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ec(this._data,this),t._stacked&&ts(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(mt(e)){const s=this._cachedMeta;this._data=Ap(e,s)}else if(i!==e){if(i){Ec(i,this);const s=this._cachedMeta;ts(s),s._parsed=[]}e&&Object.isExtensible(e)&&vg(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=Go(e.vScale,e),e.stack!==i.stack&&(s=!0,ts(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(gu(this,e._parsed),e._stacked=Go(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{kt(s[t])?f=this.parseArrayData(i,s,t,e):mt(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const m=()=>h[a]===null||c&&h[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}o&&gu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,h=new Array(s);let f,m,g;for(f=0,m=s;f<m;++f)g=f+i,h[f]={[a]:u||r.parse(c[g],g),[l]:o.parse(e[g],g)};return h}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],a[l]={x:r.parse(h[0],u),y:o.parse(h[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=e[f],c[u]={x:r.parse(yn(m,a),f),y:o.parse(yn(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:hu(s,!0),values:e._stacks[t.axis]._visualValues};return fu(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=fu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=zp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Ip(a);let f,m;function g(){m=s[f];const b=m[a.axis];return!Rt(m[t.axis])||u>b||h<b}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(c,t,m,l),r));++f);if(r){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Rt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Ep(lt(this.options.clip,Op(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const h=s[u];h.hidden||(h.active&&c?o.push(h):h.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=Fp(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Np(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&me(i);if(a)return pu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(At.elements[t]),g=()=>this.getContext(i,s,e),b=c.resolveNamedOptions(f,m,g,h);return b.$shared&&(b.$shared=l,r[o]=Object.freeze(pu(b,l))),b}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Xo(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Zo(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){Zo(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Zo(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&ts(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}O(Le,"defaults",{}),O(Le,"datasetElementType",null),O(Le,"dataElementType",null);function Bp(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Ac(i.sort((s,r)=>s-r))}return n._cache.$bar}function Hp(n){const t=n.iScale,e=Bp(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(me(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function Wp(n,t,e,i){const s=e.barThickness;let r,o;return at(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function Vp(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function Yp(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function yu(n,t,e,i){return kt(n)?Yp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function bu(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,h,f;for(c=e,u=e+i;c<u;++c)f=t[c],h={},h[s.axis]=a||s.parse(o[c],c),l.push(yu(f,h,r,c));return l}function Qo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function jp(n,t,e){return n!==0?We(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function $p(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function Up(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=$p(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[_u(u,o,a,l)]=!0,s=c)),r[_u(s,o,a,l)]=!0,n.borderSkipped=r}function _u(n,t,e,i){return i?(n=qp(n,t,e),n=xu(n,e,t)):n=xu(n,t,e),n}function qp(n,t,e){return n===t?e:n===e?t:n}function xu(n,t,e){return n==="start"?t:n==="end"?e:n}function Xp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class es extends Le{parsePrimitiveData(t,e,i,s){return bu(t,e,i,s)}parseArrayData(t,e,i,s){return bu(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,h=[];let f,m,g,b;for(f=i,m=i+s;f<m;++f)b=e[f],g={},g[r.axis]=r.parse(yn(b,c),f),h.push(yu(yn(b,u),g,o,f));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Qo(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s);for(let m=e;m<e+i;m++){const g=this.getParsed(m),b=r||at(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),k=(g._stacks||{})[a.axis],M={horizontal:c,base:b.base,enableBorderRadius:!k||Qo(g._custom)||o===k._top||o===k._bottom,x:c?b.head:x.center,y:c?x.center:b.head,height:c?x.size:Math.abs(b.size),width:c?Math.abs(b.size):x.size};f&&(M.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const T=M.options||t[m].options;Up(M,T,k,o),Xp(M,T,u.ratio),this.updateElement(t[m],m,M,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(at(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[lt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||Hp(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Qo(c);let h=l[e.axis],f=0,m=i?this.applyStack(e,l,i):h,g,b;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&We(h)!==We(c.barEnd)&&(f=0),f+=h);const x=!at(r)&&!u?r:f;let k=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(f+m):g=k,b=g-k,Math.abs(b)<o){b=jp(b,e,a)*o,h===a&&(k-=b/2);const M=e.getPixelForDecimal(0),T=e.getPixelForDecimal(1),v=Math.min(M,T),S=Math.max(M,T);k=Math.max(Math.min(k,S),v),g=k+b,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(k))}if(k===e.getPixelForValue(a)){const M=We(b)*e.getLineWidthForValue(a)/2;k+=M,b-=M}return{size:b,base:k,head:g,center:g+b/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=lt(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?Vp(t,e,s,u*c):Wp(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(lt(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+m;a=h.start+h.chunk*g+h.chunk/2,l=Math.min(o,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}O(es,"id","bar"),O(es,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),O(es,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class fr extends Le{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=lt(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=lt(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,h=a.axis;for(let f=e;f<e+i;f++){const m=t[f],g=!r&&this.getParsed(f),b={},x=b[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(g[u]),k=b[h]=r?a.getBasePixel():a.getPixelForValue(g[h]);b.skip=isNaN(x)||isNaN(k),c&&(b.options=l||this.resolveDataElementOptions(f,m.active?"active":s),r&&(b.options.radius=0)),this.updateElement(m,f,b,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=lt(i&&i._custom,r),s}}O(fr,"id","bubble"),O(fr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),O(fr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Gp(n,t,e){let i=1,s=1,r=0,o=0;if(t<Ot){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),h=Math.cos(l),f=Math.sin(l),m=(T,v,S)=>qi(T,a,l,!0)?1:Math.max(v,v*e,S,S*e),g=(T,v,S)=>qi(T,a,l,!0)?-1:Math.min(v,v*e,S,S*e),b=m(0,c,h),x=m(Et,u,f),k=g(ht,c,h),M=g(ht+Et,u,f);i=(b-k)/2,s=(x-M)/2,r=-(b+k)/2,o=-(x+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class en extends Le{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(mt(i[t])){const{key:l="value"}=this._parsing;r=c=>+yn(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let t=Ot,e=-Ot;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(lg(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:b}=Gp(h,u,l),x=(i.width-o)/f,k=(i.height-o)/m,M=Math.max(Math.min(x,k)/2,0),T=Mc(this.options.radius,M),v=Math.max(T*l,0),S=(T-v)/this._getVisibleDatasetWeightTotal();this.offsetX=g*T,this.offsetY=b*T,s.total=this.calculateTotal(),this.outerRadius=T-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Ot)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,h=(a.top+a.bottom)/2,f=r&&c.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(e,s);let k=this._getRotation(),M;for(M=0;M<e;++M)k+=this._circumference(M,r);for(M=e;M<e+i;++M){const T=this._circumference(M,r),v=t[M],S={x:u+this.offsetX,y:h+this.offsetY,startAngle:k,endAngle:k+T,circumference:T,outerRadius:g,innerRadius:m};x&&(S.options=b||this.resolveDataElementOptions(M,v.active?"active":s)),k+=T,this.updateElement(v,M,S,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ot*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(lt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}O(en,"id","doughnut"),O(en,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),O(en,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),O(en,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ns extends Le{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=Lc(e,s,o);this._drawStart=a,this._drawCount=l,Nc(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),f=o.axis,m=a.axis,{spanGaps:g,segment:b}=this.options,x=_n(g)?g:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||r||s==="none",M=e+i,T=t.length;let v=e>0&&this.getParsed(e-1);for(let S=0;S<T;++S){const E=t[S],P=k?E:{};if(S<e||S>=M){P.skip=!0;continue}const y=this.getParsed(S),_=at(y[m]),C=P[f]=o.getPixelForValue(y[f],S),R=P[m]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,y,l):y[m],S);P.skip=isNaN(C)||isNaN(R)||_,P.stop=S>0&&Math.abs(y[f]-v[f])>x,b&&(P.parsed=y,P.raw=c.data[S]),h&&(P.options=u||this.resolveDataElementOptions(S,E.active?"active":s)),k||this.updateElement(E,S,P,s),v=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}O(ns,"id","line"),O(ns,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(ns,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class is extends Le{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return Zc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*ht;let m=f,g;const b=360/this.countVisibleElements();for(g=0;g<e;++g)m+=this._computeAngle(g,s,b);for(g=e;g<e+i;g++){const x=t[g];let k=m,M=m+this._computeAngle(g,s,b),T=o.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;m=M,r&&(l.animateScale&&(T=0),l.animateRotate&&(k=M=f));const v={x:u,y:h,innerRadius:0,outerRadius:T,startAngle:k,endAngle:M,options:this.resolveDataElementOptions(g,x.active?"active":s)};this.updateElement(x,g,v,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?$t(this.resolveDataElementOptions(t,e).angle||i):0}}O(is,"id","polarArea"),O(is,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),O(is,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Jo extends en{}O(Jo,"id","pie"),O(Jo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class mr extends Le{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Zc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),h=o?r.xCenter:u.x,f=o?r.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,a,m,s)}}}O(mr,"id","radar"),O(mr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),O(mr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class gr extends Le{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=Lc(e,i,s);if(this._drawStart=r,this._drawCount=o,Nc(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=o.axis,g=a.axis,{spanGaps:b,segment:x}=this.options,k=_n(b)?b:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let T=e>0&&this.getParsed(e-1);for(let v=e;v<e+i;++v){const S=t[v],E=this.getParsed(v),P=M?S:{},y=at(E[g]),_=P[m]=o.getPixelForValue(E[m],v),C=P[g]=r||y?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,E,l):E[g],v);P.skip=isNaN(_)||isNaN(C)||y,P.stop=v>0&&Math.abs(E[m]-T[m])>k,x&&(P.parsed=E,P.raw=c.data[v]),f&&(P.options=h||this.resolveDataElementOptions(v,S.active?"active":s)),M||this.updateElement(S,v,P,s),T=E}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}O(gr,"id","scatter"),O(gr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),O(gr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Kp=Object.freeze({__proto__:null,BarController:es,BubbleController:fr,DoughnutController:en,LineController:ns,PieController:Jo,PolarAreaController:is,RadarController:mr,ScatterController:gr});function Yn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ta{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign(ta.prototype,t)}init(){}formats(){return Yn()}parse(){return Yn()}format(){return Yn()}add(){return Yn()}diff(){return Yn()}startOf(){return Yn()}endOf(){return Yn()}}var wu={_date:ta};function Zp(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const c=a._reversePixels?xg:Qe;if(i){if(s._sharedOptions){const u=r[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(r,t,e-h),m=c(r,t,e+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=n,m=f.slice(0,u.lo+1).reverse().findIndex(b=>!at(b[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(b=>!at(b[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:r.length-1}}function ss(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:h,hi:f}=Zp(r[a],t,o,s);for(let m=h;m<=f;++m){const g=u[m];g.skip||i(g,c,m)}}}function Qp(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function ea(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||ss(n,e,t,function(a,l,c){!s&&!Je(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Jp(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:h}=sr(o,{x:t.x,y:t.y});qi(h,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return ss(n,e,t,r),s}function ty(n,t,e,i,s,r){let o=[];const a=Qp(e);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const g=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(g))&&!m)return;const x=a(t,g);x<l?(o=[{element:u,datasetIndex:h,index:f}],l=x):x===l&&o.push({element:u,datasetIndex:h,index:f})}return ss(n,e,t,c),o}function na(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?Jp(n,t,e,s):ty(n,t,e,i,s,r)}function vu(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return ss(n,e,t,(l,c,u)=>{l[o]&&l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var ia={evaluateInteractionItems:ss,modes:{index(n,t,e,i){const s=vn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?ea(n,s,r,i,o):na(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?ea(n,s,r,i,o):na(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return ea(n,s,r,i,o)},nearest(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return na(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=vn(t,n);return vu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=vn(t,n);return vu(n,s,"y",e.intersect,i)}}};const Mu=["left","top","right","bottom"];function rs(n,t){return n.filter(e=>e.pos===t)}function ku(n,t){return n.filter(e=>Mu.indexOf(e.pos)===-1&&e.box.axis===t)}function os(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function ey(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function ny(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Mu.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function iy(n,t){const e=ny(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function sy(n){const t=ey(n),e=os(t.filter(c=>c.box.fullSize),!0),i=os(rs(t,"left"),!0),s=os(rs(t,"right")),r=os(rs(t,"top"),!0),o=os(rs(t,"bottom")),a=ku(t,"x"),l=ku(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:rs(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function Su(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Du(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function ry(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!mt(s)){e.size&&(n[s]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?r.height:r.width),e.size=h.size/h.count,n[s]+=e.size}r.getPadding&&Du(o,r.getPadding());const a=Math.max(0,t.outerWidth-Su(o,n,"left","right")),l=Math.max(0,t.outerHeight-Su(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function oy(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function ay(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function as(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,ay(a.horizontal,t));const{same:h,other:f}=ry(t,e,a,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&as(s,t,e,i)||u}function pr(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Tu(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const h=t.w*u,f=c.size||l.height;me(c.start)&&(o=c.start),l.fullSize?pr(l,s.left,o,e.outerWidth-s.right-s.left,f):pr(l,t.left+c.placed,o,h,f),c.start=o,c.placed+=h,o=l.bottom}else{const h=t.h*u,f=c.size||l.width;me(c.start)&&(r=c.start),l.fullSize?pr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):pr(l,r,t.top+c.placed,f,h),c.start=r,c.placed+=h,r=l.right}}t.x=r,t.y=o}var oe={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=Ut(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=sy(n.boxes),l=a.vertical,c=a.horizontal;Dt(n.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);Du(f,Ut(i));const m=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),g=iy(l.concat(c),h);as(a.fullSize,m,h,g),as(l,m,h,g),as(c,m,h,g)&&as(l,m,h,g),oy(m),Tu(a.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Tu(a.rightAndBottom,m,h,g),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Dt(a.chartArea,b=>{const x=b.box;Object.assign(x,n.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Cu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class ly extends Cu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const yr="$chartjs",cy={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pu=n=>n===null||n==="";function uy(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[yr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Pu(s)){const r=tu(n,"width");r!==void 0&&(n.width=r)}if(Pu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=tu(n,"height");r!==void 0&&(n.height=r)}return n}const Ou=fp?{passive:!0}:!1;function dy(n,t,e){n&&n.addEventListener(t,e,Ou)}function hy(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Ou)}function fy(n,t){const e=cy[n.type]||n.type,{x:i,y:s}=vn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function br(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function my(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||br(a.addedNodes,i),o=o&&!br(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function gy(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||br(a.removedNodes,i),o=o&&!br(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ls=new Map;let Eu=0;function Au(){const n=window.devicePixelRatio;n!==Eu&&(Eu=n,ls.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function py(n,t){ls.size||window.addEventListener("resize",Au),ls.set(n,t)}function yy(n){ls.delete(n),ls.size||window.removeEventListener("resize",Au)}function by(n,t,e){const i=n.canvas,s=i&&qo(i);if(!s)return;const r=Ic((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),py(n,r),o}function sa(n,t,e){e&&e.disconnect(),t==="resize"&&yy(n)}function _y(n,t,e){const i=n.canvas,s=Ic(r=>{n.ctx!==null&&e(fy(r,n))},n);return dy(i,t,s),s}class xy extends Cu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(uy(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[yr])return!1;const i=e[yr].initial;["height","width"].forEach(r=>{const o=i[r];at(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[yr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:my,detach:gy,resize:by}[e]||_y;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:sa,detach:sa,resize:sa}[e]||hy)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return hp(t,e,i,s)}isAttached(t){const e=t&&qo(t);return!!(e&&e.isConnected)}}function wy(n){return!Uo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?ly:xy}class Jt{constructor(){O(this,"x");O(this,"y");O(this,"active",!1);O(this,"options");O(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return _n(this.x)&&_n(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}O(Jt,"defaults",{}),O(Jt,"defaultRoutes");function vy(n,t){const e=n.options.ticks,i=My(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Sy(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return Dy(t,c,r,o/s),c;const u=ky(r,t,s);if(o>0){let h,f;const m=o>1?Math.round((l-a)/(o-1)):null;for(_r(t,c,u,at(m)?0:a-m,a),h=0,f=o-1;h<f;h++)_r(t,c,u,r[h],r[h+1]);return _r(t,c,u,l,at(m)?t.length:l+m),c}return _r(t,c,u),c}function My(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function ky(n,t,e){const i=Ty(n),s=t.length/e;if(!i)return Math.max(s,1);const r=gg(i);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function Sy(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Dy(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function _r(n,t,e,i,s){const r=lt(i,0),o=Math.min(lt(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function Ty(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const Cy=n=>n==="left"?"right":n==="right"?"left":n,Ru=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Iu=(n,t)=>Math.min(t||n,n);function Lu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function Py(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function Oy(n,t){Dt(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function cs(n){return n.drawTicks?n.tickLength:0}function Nu(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Ut(n.padding);return(kt(n.text)?n.text.length:1)*e.lineHeight+i.height}function Ey(n,t){return wn(n,{scale:t,type:"scale"})}function Ay(n,t,e){return wn(n,{tick:e,index:t,type:"tick"})}function Ry(n,t,e){let i=No(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Cy(i)),i}function Iy(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let h=0,f,m,g;const b=o-s,x=a-r;if(n.isHorizontal()){if(m=re(i,r,a),mt(e)){const k=Object.keys(e)[0],M=e[k];g=u[k].getPixelForValue(M)+b-t}else e==="center"?g=(c.bottom+c.top)/2+b-t:g=Ru(n,e,t);f=a-r}else{if(mt(e)){const k=Object.keys(e)[0],M=e[k];m=u[k].getPixelForValue(M)-x+t}else e==="center"?m=(c.left+c.right)/2-x+t:m=Ru(n,e,t);g=re(i,o,s),h=e==="left"?-Et:Et}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class jn extends Jt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=Me(t,Number.POSITIVE_INFINITY),e=Me(e,Number.NEGATIVE_INFINITY),i=Me(i,Number.POSITIVE_INFINITY),s=Me(s,Number.NEGATIVE_INFINITY),{min:Me(t,i),max:Me(e,s),minDefined:Rt(t),maxDefined:Rt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Me(e,Me(i,e)),max:Me(i,Me(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){St(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=jg(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Lu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=vy(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){St(this.options.afterUpdate,[this])}beforeSetDimensions(){St(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){St(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),St(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){St(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=St(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){St(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){St(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Iu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Qt(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/i:m/(i-1),h+6>a&&(a=m/(i-(t.offset?.5:1)),l=this.maxHeight-cs(t.grid)-e.padding-Nu(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),o=ir(Math.min(Math.asin(Qt((u.highest.height+6)/a,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){St(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){St(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Nu(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=cs(r)+l):(t.height=this.maxHeight,t.width=cs(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,g=$t(this.labelRotation),b=Math.cos(g),x=Math.sin(g);if(a){const k=i.mirror?0:x*h.width+b*f.height;t.height=Math.min(this.maxHeight,t.height+k+m)}else{const k=i.mirror?0:b*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+k+m)}this._calculatePadding(c,u,x,b)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=s*t.width,m=i*e.height):(f=i*t.height,m=s*e.width):r==="start"?m=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,m=e.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+o)*this.width/(this.width-h),0)}else{let u=e.height/2,h=t.height/2;r==="start"?(u=0,h=t.height):r==="end"&&(u=e.height,h=0),this.paddingTop=u+o,this.paddingBottom=h+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){St(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)at(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Lu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/Iu(e,i));let c=0,u=0,h,f,m,g,b,x,k,M,T,v,S;for(h=0;h<e;h+=l){if(g=t[h].label,b=this._resolveTickFontOptions(h),s.font=x=b.string,k=r[x]=r[x]||{data:{},gc:[]},M=b.lineHeight,T=v=0,!at(g)&&!kt(g))T=ar(s,k.data,k.gc,T,g),v=M;else if(kt(g))for(f=0,m=g.length;f<m;++f)S=g[f],!at(S)&&!kt(S)&&(T=ar(s,k.data,k.gc,T,S),v+=M);o.push(T),a.push(v),c=Math.max(T,c),u=Math.max(v,u)}Oy(r,e);const E=o.indexOf(c),P=a.indexOf(u),y=_=>({width:o[_]||0,height:a[_]||0});return{first:y(0),last:y(e-1),widest:y(E),highest:y(P),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return _g(this._alignToPixels?Bn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Ay(this.getContext(),t,i))}return this.$context||(this.$context=Ey(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=$t(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=cs(r),m=[],g=a.setContext(this.getContext()),b=g.display?g.width:0,x=b/2,k=function(tt){return Bn(i,tt,b)};let M,T,v,S,E,P,y,_,C,R,L,I;if(o==="top")M=k(this.bottom),P=this.bottom-f,_=M-x,R=k(t.top)+x,I=t.bottom;else if(o==="bottom")M=k(this.top),R=t.top,I=k(t.bottom)-x,P=M+x,_=this.top+f;else if(o==="left")M=k(this.right),E=this.right-f,y=M-x,C=k(t.left)+x,L=t.right;else if(o==="right")M=k(this.left),C=t.left,L=k(t.right)-x,E=M+x,y=this.left+f;else if(e==="x"){if(o==="center")M=k((t.top+t.bottom)/2+.5);else if(mt(o)){const tt=Object.keys(o)[0],V=o[tt];M=k(this.chart.scales[tt].getPixelForValue(V))}R=t.top,I=t.bottom,P=M+x,_=P+f}else if(e==="y"){if(o==="center")M=k((t.left+t.right)/2);else if(mt(o)){const tt=Object.keys(o)[0],V=o[tt];M=k(this.chart.scales[tt].getPixelForValue(V))}E=M-x,y=E-f,C=t.left,L=t.right}const B=lt(s.ticks.maxTicksLimit,h),q=Math.max(1,Math.ceil(h/B));for(T=0;T<h;T+=q){const tt=this.getContext(T),V=r.setContext(tt),ct=a.setContext(tt),U=V.lineWidth,J=V.color,et=ct.dash||[],X=ct.dashOffset,j=V.tickWidth,$=V.tickColor,K=V.tickBorderDash||[],_t=V.tickBorderDashOffset;v=Py(this,T,l),v!==void 0&&(S=Bn(i,v,U),c?E=y=C=L=S:P=_=R=I=S,m.push({tx1:E,ty1:P,tx2:y,ty2:_,x1:C,y1:R,x2:L,y2:I,width:U,color:J,borderDash:et,borderDashOffset:X,tickWidth:j,tickColor:$,tickBorderDash:K,tickBorderDashOffset:_t}))}return this._ticksLength=h,this._borderValue=M,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=r,f=cs(i.grid),m=f+u,g=h?-u:m,b=-$t(this.labelRotation),x=[];let k,M,T,v,S,E,P,y,_,C,R,L,I="middle";if(s==="top")E=this.bottom-g,P=this._getXAxisLabelAlignment();else if(s==="bottom")E=this.top+g,P=this._getXAxisLabelAlignment();else if(s==="left"){const q=this._getYAxisLabelAlignment(f);P=q.textAlign,S=q.x}else if(s==="right"){const q=this._getYAxisLabelAlignment(f);P=q.textAlign,S=q.x}else if(e==="x"){if(s==="center")E=(t.top+t.bottom)/2+m;else if(mt(s)){const q=Object.keys(s)[0],tt=s[q];E=this.chart.scales[q].getPixelForValue(tt)+m}P=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")S=(t.left+t.right)/2-m;else if(mt(s)){const q=Object.keys(s)[0],tt=s[q];S=this.chart.scales[q].getPixelForValue(tt)}P=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?I="top":l==="end"&&(I="bottom"));const B=this._getLabelSizes();for(k=0,M=a.length;k<M;++k){T=a[k],v=T.label;const q=r.setContext(this.getContext(k));y=this.getPixelForTick(k)+r.labelOffset,_=this._resolveTickFontOptions(k),C=_.lineHeight,R=kt(v)?v.length:1;const tt=R/2,V=q.color,ct=q.textStrokeColor,U=q.textStrokeWidth;let J=P;o?(S=y,P==="inner"&&(k===M-1?J=this.options.reverse?"left":"right":k===0?J=this.options.reverse?"right":"left":J="center"),s==="top"?c==="near"||b!==0?L=-R*C+C/2:c==="center"?L=-B.highest.height/2-tt*C+C:L=-B.highest.height+C/2:c==="near"||b!==0?L=C/2:c==="center"?L=B.highest.height/2-tt*C:L=B.highest.height-R*C,h&&(L*=-1),b!==0&&!q.showLabelBackdrop&&(S+=C/2*Math.sin(b))):(E=y,L=(1-R)*C/2);let et;if(q.showLabelBackdrop){const X=Ut(q.backdropPadding),j=B.heights[k],$=B.widths[k];let K=L-X.top,_t=0-X.left;switch(I){case"middle":K-=j/2;break;case"bottom":K-=j;break}switch(P){case"center":_t-=$/2;break;case"right":_t-=$;break;case"inner":k===M-1?_t-=$:k>0&&(_t-=$/2);break}et={left:_t,top:K,width:$+X.width,height:j+X.height,color:q.backdropColor}}x.push({label:v,font:_,textOffset:L,options:{rotation:b,color:V,strokeColor:ct,strokeWidth:U,textAlign:J,textBaseline:I,translation:[S,E],backdrop:et}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Bn(t,this.left,o)-o/2,u=Bn(t,this.right,a)+a/2,h=f=l):(h=Bn(t,this.top,o)-o/2,f=Bn(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,h),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Zi(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Hn(i,c,0,u,l,a)}s&&Qi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=It(i.font),o=Ut(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||mt(e)?(l+=o.bottom,kt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=Iy(this,l,e,a);Hn(t,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:f,textAlign:Ry(a,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=lt(t.grid&&t.grid.z,-1),s=lt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==jn.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return It(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class xr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Fy(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Ly(t,o,i),this.override&&At.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in At[s]&&(delete At[s][i],this.override&&delete zn[i])}}function Ly(n,t,e){const i=ji(Object.create(null),[e?At.get(e):{},At.get(t),n.defaults]);At.set(t,i),n.defaultRoutes&&Ny(t,n.defaultRoutes),n.descriptors&&At.describe(t,n.descriptors)}function Ny(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");At.route(r,s,l,a)})}function Fy(n){return"id"in n&&"defaults"in n}class zy{constructor(){this.controllers=new xr(Le,"datasets",!0),this.elements=new xr(Jt,"elements"),this.plugins=new xr(Object,"plugins"),this.scales=new xr(jn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Dt(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=Ro(t);St(i["before"+s],[],i),e[t](i),St(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ve=new zy;class By{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(St(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){at(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=lt(i.options&&i.options.plugins,{}),r=Hy(i);return s===!1&&!e?[]:Vy(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Hy(n){const t={},e=[],i=Object.keys(Ve.plugins.items);for(let r=0;r<i.length;r++)e.push(Ve.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function Wy(n,t){return!t&&n===!1?null:n===!0?{}:n}function Vy(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=Wy(i[l],s);c!==null&&r.push({plugin:a,options:Yy(n.config,{plugin:a,local:e[l]},c,o)})}return r}function Yy(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ra(n,t){const e=At.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function jy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function $y(n,t){return n===t?"_index_":"_value_"}function Fu(n){if(n==="x"||n==="y"||n==="r")return n}function Uy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function oa(n,...t){if(Fu(n))return n;for(const e of t){const i=e.axis||Uy(e.position)||n.length>1&&Fu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function zu(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function qy(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return zu(n,"x",e[0])||zu(n,"y",e[0])}return{}}function Xy(n,t){const e=zn[n.type]||{scales:{}},i=t.scales||{},s=ra(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!mt(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=oa(o,a,qy(o,n),At.scales[a.type]),c=$y(l,s),u=e.scales||{};r[o]=$i(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||ra(a,t),u=(zn[a]||{}).scales||{};Object.keys(u).forEach(h=>{const f=jy(h,l),m=o[f+"AxisID"]||f;r[m]=r[m]||Object.create(null),$i(r[m],[{axis:f},i[m],u[h]])})}),Object.keys(r).forEach(o=>{const a=r[o];$i(a,[At.scales[a.type],At.scale])}),r}function Bu(n){const t=n.options||(n.options={});t.plugins=lt(t.plugins,{}),t.scales=Xy(n,t)}function Hu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Gy(n){return n=n||{},n.data=Hu(n.data),Bu(n),n}const Wu=new Map,Vu=new Set;function wr(n,t){let e=Wu.get(n);return e||(e=t(),Wu.set(n,e),Vu.add(e)),e}const us=(n,t,e)=>{const i=yn(t,e);i!==void 0&&n.add(i)};class Ky{constructor(t){this._config=Gy(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Hu(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Bu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return wr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return wr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return wr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return wr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>us(l,t,h))),u.forEach(h=>us(l,s,h)),u.forEach(h=>us(l,zn[r]||{},h)),u.forEach(h=>us(l,At,h)),u.forEach(h=>us(l,Bo,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Vu.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,zn[e]||{},At.datasets[e]||{},{type:e},At,Bo]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Yu(this._resolverCache,t,s);let l=o;if(Qy(o,e)){r.$shared=!1,i=ge(i)?i():i;const c=this.createResolver(t,i,a);l=fi(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Yu(this._resolverCache,t,i);return mt(e)?fi(r,e,void 0,s):r}}function Yu(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:Yo(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Zy=n=>mt(n)&&Object.getOwnPropertyNames(n).some(t=>ge(n[t]));function Qy(n,t){const{isScriptable:e,isIndexable:i}=$c(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(ge(a)||Zy(a))||o&&kt(a))return!0}return!1}var Jy="4.5.0";const tb=["top","bottom","left","right","chartArea"];function ju(n,t){return n==="top"||n==="bottom"||tb.indexOf(n)===-1&&t==="x"}function $u(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Uu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),St(e&&e.onComplete,[n],t)}function eb(n){const t=n.chart,e=t.options.animation;St(e&&e.onProgress,[n],t)}function qu(n){return Uo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const vr={},Xu=n=>{const t=qu(n);return Object.values(vr).filter(e=>e.canvas===t).pop()};function nb(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function ib(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let Ce=(En=class{static register(...t){Ve.add(...t),Gu()}static unregister(...t){Ve.remove(...t),Gu()}constructor(t,e){const i=this.config=new Ky(e),s=qu(t),r=Xu(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||wy(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=ag(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new By,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Mg(h=>this.update(h),o.resizeDelay||0),this._dataChanges=[],vr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}tn.listen(this,"complete",Uu),tn.listen(this,"progress",eb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return at(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ve}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Jc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Vc(this.canvas,this.ctx),this}stop(){return tn.stop(this),this}resize(t,e){tn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Jc(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),St(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Dt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=oa(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Dt(r,o=>{const a=o.options,l=a.id,c=oa(l,a),u=lt(a.type,o.dtype);(a.position===void 0||ju(a.position,c)!==ju(o.dposition))&&(a.position=o.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ve.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(a,t)}),Dt(s,(o,a)=>{o||delete i[a]}),Dt(i,o=>{oe.configure(this,o,o.options),oe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort($u("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||ra(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=Ve.getController(a),{datasetElementType:c,dataElementType:u}=At.datasets[a];Object.assign(l,{dataElementType:Ve.getElement(u),datasetElementType:c&&Ve.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Dt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&r.indexOf(h)===-1;h.buildOrUpdateElements(f),o=Math.max(+h.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||Dt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort($u("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Dt(this.scales,t=>{oe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Dc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;nb(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Dc(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;oe.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Dt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,ge(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(tn.has(this)?this.attached&&!tn.running(this)&&tn.start(this):(this.draw(),Uu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=cu(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Zi(e,s),t.controller.draw(),s&&Qi(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Je(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=ia.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=wn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);me(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),tn.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Vc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete vr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Dt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){Dt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Dt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Js(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=fg(t),c=ib(t,this._lastEvent,i,l);i&&(this._lastEvent=null,St(r.onHover,[t,a,this],this),l&&St(r.onClick,[t,a,this],this));const u=!Js(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},O(En,"defaults",At),O(En,"instances",vr),O(En,"overrides",zn),O(En,"registry",Ve),O(En,"version",Jy),O(En,"getChart",Xu),En);function Gu(){return Dt(Ce.instances,n=>n._plugins.invalidate())}function sb(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/o,se(i-e));if(n.beginPath(),n.arc(s,r,o-c/2,i+h/2,e-h/2),a>0){const f=Math.min(c/a,se(i-e));n.arc(s,r,a+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,o*se(i-e));if(u==="round")n.arc(s,r,f,e-ht/2,i+ht/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(e+ht/2)+s,b=-m*Math.sin(e+ht/2)+r,x=m*Math.cos(i+ht/2)+s,k=m*Math.sin(i+ht/2)+r;n.lineTo(g,b),n.lineTo(x,k)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function rb(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Et,i-Et),n.closePath(),n.clip()}function ob(n){return Vo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function ab(n,t,e,i){const s=ob(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return Qt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Qt(s.innerStart,0,o),innerEnd:Qt(s.innerEnd,0,o)}}function pi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Mr(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let m=0;const g=s-l;if(i){const q=u>0?u-i:0,tt=h>0?h-i:0,V=(q+tt)/2,ct=V!==0?g*V/(V+i):g;m=(g-ct)/2}const b=Math.max(.001,g*h-e/ht)/h,x=(g-b)/2,k=l+x+m,M=s-x-m,{outerStart:T,outerEnd:v,innerStart:S,innerEnd:E}=ab(t,f,h,M-k),P=h-T,y=h-v,_=k+T/P,C=M-v/y,R=f+S,L=f+E,I=k+S/R,B=M-E/L;if(n.beginPath(),r){const q=(_+C)/2;if(n.arc(o,a,h,_,q),n.arc(o,a,h,q,C),v>0){const U=pi(y,C,o,a);n.arc(U.x,U.y,v,C,M+Et)}const tt=pi(L,M,o,a);if(n.lineTo(tt.x,tt.y),E>0){const U=pi(L,B,o,a);n.arc(U.x,U.y,E,M+Et,B+Math.PI)}const V=(M-E/f+(k+S/f))/2;if(n.arc(o,a,f,M-E/f,V,!0),n.arc(o,a,f,V,k+S/f,!0),S>0){const U=pi(R,I,o,a);n.arc(U.x,U.y,S,I+Math.PI,k-Et)}const ct=pi(P,k,o,a);if(n.lineTo(ct.x,ct.y),T>0){const U=pi(P,_,o,a);n.arc(U.x,U.y,T,k-Et,_)}}else{n.moveTo(o,a);const q=Math.cos(_)*h+o,tt=Math.sin(_)*h+a;n.lineTo(q,tt);const V=Math.cos(C)*h+o,ct=Math.sin(C)*h+a;n.lineTo(V,ct)}n.closePath()}function lb(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Mr(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%Ot||Ot))}return Mr(n,t,e,i,l,s),n.fill(),l}function cb(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(h||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let b=t.endAngle;if(r){Mr(n,t,e,i,b,s);for(let x=0;x<r;++x)n.stroke();isNaN(a)||(b=o+(a%Ot||Ot))}g&&rb(n,t,b),l.selfJoin&&b-o>=ht&&m===0&&u!=="miter"&&sb(n,t,b),r||(Mr(n,t,e,i,b,s),n.stroke())}class ds extends Jt{constructor(e){super();O(this,"circumference");O(this,"endAngle");O(this,"fullCircles");O(this,"innerRadius");O(this,"outerRadius");O(this,"pixelMargin");O(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=sr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,g=lt(f,c-l),b=qi(o,l,c)&&l!==c,x=g>=Ot||b,k=Ze(a,u+m,h+m);return x&&k}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,h=(r+o)/2,f=(a+l+u+c)/2;return{x:i+Math.cos(h)*f,y:s+Math.sin(h)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ot?Math.floor(s/Ot):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(ht,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,lb(e,this,u,o,a),cb(e,this,u,o,a),e.restore()}}O(ds,"id","arc"),O(ds,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),O(ds,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(ds,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Ku(n,t,e=t){n.lineCap=lt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(lt(e.borderDash,t.borderDash)),n.lineDashOffset=lt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=lt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=lt(e.borderWidth,t.borderWidth),n.strokeStyle=lt(e.borderColor,t.borderColor)}function ub(n,t,e){n.lineTo(e.x,e.y)}function db(n){return n.stepped?Lg:n.tension||n.cubicInterpolationMode==="monotone"?Ng:ub}function Zu(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function hb(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Zu(s,e,i),u=db(r);let{move:h=!0,reverse:f}=i||{},m,g,b;for(m=0;m<=c;++m)g=s[(a+(f?c-m:m))%o],!g.skip&&(h?(n.moveTo(g.x,g.y),h=!1):u(n,b,g,f,r.stepped),b=g);return l&&(g=s[(a+(f?c:0))%o],u(n,b,g,f,r.stepped)),!!l}function fb(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Zu(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,g,b,x,k;const M=v=>(o+(c?a-v:v))%r,T=()=>{b!==x&&(n.lineTo(u,x),n.lineTo(u,b),n.lineTo(u,k))};for(l&&(m=s[M(0)],n.moveTo(m.x,m.y)),f=0;f<=a;++f){if(m=s[M(f)],m.skip)continue;const v=m.x,S=m.y,E=v|0;E===g?(S<b?b=S:S>x&&(x=S),u=(h*u+v)/++h):(T(),n.lineTo(v,S),g=E,h=0,b=x=S),k=S}T()}function aa(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?fb:hb}function mb(n){return n.stepped?mp:n.tension||n.cubicInterpolationMode==="monotone"?gp:Vn}function gb(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Ku(n,t.options),n.stroke(s)}function pb(n,t,e,i){const{segments:s,options:r}=t,o=aa(t);for(const a of s)Ku(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const yb=typeof Path2D=="function";function bb(n,t,e,i){yb&&!t.options.segment?gb(n,t,e,i):pb(n,t,e,i)}class Mn extends Jt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;op(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=wp(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=ou(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=mb(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:h,end:f}=o[c],m=r[h],g=r[f];if(m===g){a.push(m);continue}const b=Math.abs((s-m[e])/(g[e]-m[e])),x=l(m,g,b,i.stepped);x[e]=t[e],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,e,i){return aa(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=aa(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),bb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}O(Mn,"id","line"),O(Mn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),O(Mn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),O(Mn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Qu(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class kr extends Jt{constructor(e){super();O(this,"parsed");O(this,"skip");O(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return Qu(this,e,"x",i)}inYRange(e,i){return Qu(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Je(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Wo(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}O(kr,"id","point"),O(kr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),O(kr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ju(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,h;return n.horizontal?(h=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=r/2,a=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function kn(n,t,e,i){return n?0:Qt(t,e,i)}function _b(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=jc(i);return{t:kn(s.top,r.top,0,e),r:kn(s.right,r.right,0,t),b:kn(s.bottom,r.bottom,0,e),l:kn(s.left,r.left,0,t)}}function xb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=xn(s),o=Math.min(t,e),a=n.borderSkipped,l=i||mt(s);return{topLeft:kn(!l||a.top||a.left,r.topLeft,0,o),topRight:kn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:kn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:kn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function wb(n){const t=Ju(n),e=t.right-t.left,i=t.bottom-t.top,s=_b(n,e/2,i/2),r=xb(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function la(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Ju(n,i);return a&&(s||Ze(t,a.left,a.right))&&(r||Ze(e,a.top,a.bottom))}function vb(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Mb(n,t){n.rect(t.x,t.y,t.w,t.h)}function ca(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class Sr extends Jt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=wb(this),a=vb(o.radius)?hi:Mb;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,ca(o,e,r)),t.clip(),a(t,ca(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ca(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return la(this,t,e,i)}inXRange(t,e){return la(this,t,null,e)}inYRange(t,e){return la(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}O(Sr,"id","bar"),O(Sr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),O(Sr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var kb=Object.freeze({__proto__:null,ArcElement:ds,BarElement:Sr,LineElement:Mn,PointElement:kr});const ua=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],td=ua.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ed(n){return ua[n%ua.length]}function nd(n){return td[n%td.length]}function Sb(n,t){return n.borderColor=ed(t),n.backgroundColor=nd(t),++t}function Db(n,t){return n.backgroundColor=n.data.map(()=>ed(t++)),t}function Tb(n,t){return n.backgroundColor=n.data.map(()=>nd(t++)),t}function Cb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof en?t=Db(e,t):s instanceof is?t=Tb(e,t):s&&(t=Sb(e,t))}}function id(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Pb(n){return n&&(n.borderColor||n.backgroundColor)}function Ob(){return At.borderColor!=="rgba(0,0,0,0.1)"||At.backgroundColor!=="rgba(0,0,0,0.1)"}var Eb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,o=id(i)||Pb(s)||r&&id(r)||Ob();if(!e.forceOverride&&o)return;const a=Cb(n);i.forEach(a)}};function Ab(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,h,f,m,g,b;for(o[l++]=n[u],h=0;h<r-2;h++){let x=0,k=0,M;const T=Math.floor((h+1)*a)+1+t,v=Math.min(Math.floor((h+2)*a)+1,e)+t,S=v-T;for(M=T;M<v;M++)x+=n[M].x,k+=n[M].y;x/=S,k/=S;const E=Math.floor(h*a)+1+t,P=Math.min(Math.floor((h+1)*a)+1,e)+t,{x:y,y:_}=n[u];for(m=g=-1,M=E;M<P;M++)g=.5*Math.abs((y-x)*(n[M].y-_)-(y-n[M].x)*(k-_)),g>m&&(m=g,f=n[M],b=M);o[l++]=f,u=b}return o[l++]=n[c],o}function Rb(n,t,e,i){let s=0,r=0,o,a,l,c,u,h,f,m,g,b;const x=[],k=t+e-1,M=n[t].x,v=n[k].x-M;for(o=t;o<t+e;++o){a=n[o],l=(a.x-M)/v*i,c=a.y;const S=l|0;if(S===u)c<g?(g=c,h=o):c>b&&(b=c,f=o),s=(r*s+a.x)/++r;else{const E=o-1;if(!at(h)&&!at(f)){const P=Math.min(h,f),y=Math.max(h,f);P!==m&&P!==E&&x.push({...n[P],x:s}),y!==m&&y!==E&&x.push({...n[y],x:s})}o>0&&E!==m&&x.push(n[E]),x.push(a),u=S,r=0,g=b=c,h=f=m=o}}return x}function sd(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function rd(n){n.data.datasets.forEach(t=>{sd(t)})}function Ib(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Qt(Qe(t,r.axis,o).lo,0,e-1)),c?s=Qt(Qe(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var Lb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){rd(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Ji([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:h,count:f}=Ib(l,c);const m=e.threshold||4*i;if(f<=m){sd(s);return}at(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let g;switch(e.algorithm){case"lttb":g=Ab(c,h,f,i,e);break;case"min-max":g=Rb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(n){rd(n)}};function Nb(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=Dr(l,c,s);const u=da(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const h=ou(t,u);for(const f of h){const m=da(e,r[f.start],r[f.end],f.loop),g=ru(a,s,m);for(const b of g)o.push({source:b,target:f,start:{[e]:od(u,m,"start",Math.max)},end:{[e]:od(u,m,"end",Math.min)}})}}return o}function da(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=se(s),r=se(r)),{property:n,start:s,end:r}}function Fb(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Dr(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Dr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function od(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function ad(n,t){let e=[],i=!1;return kt(n)?(i=!0,e=n):e=Fb(n,t),e.length?new Mn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ld(n){return n&&n.fill!==!1}function zb(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Rt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function Bb(n,t,e){const i=Yb(n);if(mt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?Hb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Hb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Wb(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:mt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Vb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:mt(n)?i=n.value:i=t.getBaseValue(),i}function Yb(n){const t=n.options,e=t.fill;let i=lt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function jb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=$b(t,e);a.push(ad({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)Ub(s,o[u],a)}return new Mn({points:s,options:{}})}function $b(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function Ub(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=qb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function qb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],h=o[u.start][e],f=o[u.end][e];if(Ze(s,h,f)){a=s===h,l=s===f;break}}return{first:a,last:l,point:i}}class cd{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:Ot},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function Xb(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return Gb(t,e);if(e==="stack")return jb(n);if(e==="shape")return!0;const s=Kb(n);return s instanceof cd?s:ad(s,i)}function Gb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Kb(n){return(n.scale||{}).getPointPositionForValue?Qb(n):Zb(n)}function Zb(n){const{scale:t={},fill:e}=n,i=Wb(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Qb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=Vb(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new cd({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function ha(n,t,e){const i=Xb(t),{chart:s,index:r,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},g=s.getDatasetMeta(r),b=cu(s,g);i&&o.points.length&&(Zi(n,e),Jb(n,{line:o,target:i,above:f,below:m,area:e,scale:a,axis:l,clip:b}),Qi(n))}function Jb(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(ud(n,i,o.top),fa(n,{line:e,target:i,color:s,scale:a,property:c,clip:l}),n.restore(),n.save(),ud(n,i,o.bottom)):c==="y"&&(dd(n,i,o.left),fa(n,{line:e,target:i,color:r,scale:a,property:c,clip:l}),n.restore(),n.save(),dd(n,i,o.right),u=s)),fa(n,{line:e,target:i,color:u,scale:a,property:c,clip:l}),n.restore()}function ud(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[Dr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function dd(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[Dr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(e,h.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function fa(n,t){const{line:e,target:i,property:s,color:r,scale:o,clip:a}=t,l=Nb(e,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=r}={}}=c,g=i!==!0;n.save(),n.fillStyle=m,t0(n,o,a,g&&da(s,h,f)),n.beginPath();const b=!!e.pathSegment(n,c);let x;if(g){b?n.closePath():hd(n,i,f,s);const k=!!i.pathSegment(n,u,{move:b,reverse:!0});x=b&&k,x||hd(n,i,h,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function t0(n,t,e,i){const s=t.chart.chartArea,{property:r,start:o,end:a}=i||{};if(r==="x"||r==="y"){let l,c,u,h;r==="x"?(l=o,c=s.top,u=a,h=s.bottom):(l=s.left,c=o,u=s.right,h=a),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),n.rect(l,c,u-l,h-c),n.clip()}}function hd(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var e0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof Mn&&(l={visible:n.isDatasetVisible(o),index:o,fill:Bb(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=zb(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&ha(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;ld(r)&&ha(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!ld(i)||e.drawTime!=="beforeDatasetDraw"||ha(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const fd=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},n0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class md extends Jt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=St(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=It(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=fd(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let h=t;r.textAlign="left",r.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((g,b)=>{const x=i+e/2+r.measureText(g.text).width;(b===0||c[c.length-1]+x+2*a>o)&&(h+=u,c[c.length-(b>0?0:1)]=0,m+=u,f++),l[b]={left:0,top:m,row:f,width:x,height:s},c[c.length-1]+=x+a}),h}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let h=a,f=0,m=0,g=0,b=0;return this.legendItems.forEach((x,k)=>{const{itemWidth:M,itemHeight:T}=i0(i,e,r,x,s);k>0&&m+T+2*a>u&&(h+=f+a,c.push({width:f,height:m}),g+=f+a,b++,f=m=0),l[k]={left:g,top:m,col:b,width:M,height:T},f=Math.max(f,M),m+=T+a}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=gi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=re(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=re(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Zi(t,this),this._draw(),Qi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=At.color,l=gi(t.rtl,this.left,this.width),c=It(o.font),{padding:u}=o,h=c.size,f=h/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:b,itemHeight:x}=fd(o,h),k=function(E,P,y){if(isNaN(g)||g<=0||isNaN(b)||b<0)return;s.save();const _=lt(y.lineWidth,1);if(s.fillStyle=lt(y.fillStyle,a),s.lineCap=lt(y.lineCap,"butt"),s.lineDashOffset=lt(y.lineDashOffset,0),s.lineJoin=lt(y.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=lt(y.strokeStyle,a),s.setLineDash(lt(y.lineDash,[])),o.usePointStyle){const C={radius:b*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:_},R=l.xPlus(E,g/2),L=P+f;Yc(s,C,R,L,o.pointStyleWidth&&g)}else{const C=P+Math.max((h-b)/2,0),R=l.leftForLtr(E,g),L=xn(y.borderRadius);s.beginPath(),Object.values(L).some(I=>I!==0)?hi(s,{x:R,y:C,w:g,h:b,radius:L}):s.rect(R,C,g,b),s.fill(),_!==0&&s.stroke()}s.restore()},M=function(E,P,y){Hn(s,y.text,E,P+x/2,c,{strikethrough:y.hidden,textAlign:l.textAlign(y.textAlign)})},T=this.isHorizontal(),v=this._computeTitleHeight();T?m={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+v,line:0}:m={x:this.left+u,y:re(r,this.top+v+u,this.bottom-e[0].height),line:0},eu(this.ctx,t.textDirection);const S=x+u;this.legendItems.forEach((E,P)=>{s.strokeStyle=E.fontColor,s.fillStyle=E.fontColor;const y=s.measureText(E.text).width,_=l.textAlign(E.textAlign||(E.textAlign=o.textAlign)),C=g+f+y;let R=m.x,L=m.y;l.setWidth(this.width),T?P>0&&R+C+u>this.right&&(L=m.y+=S,m.line++,R=m.x=re(r,this.left+u,this.right-i[m.line])):P>0&&L+S>this.bottom&&(R=m.x=R+e[m.line].width+u,m.line++,L=m.y=re(r,this.top+v+u,this.bottom-e[m.line].height));const I=l.x(R);if(k(I,L,E),R=kg(_,R+g+f,T?R+C:this.right,t.rtl),M(l.x(R),L,E),T)m.x+=C+u;else if(typeof E.text!="string"){const B=c.lineHeight;m.y+=gd(E,B)+u}else m.y+=S}),nu(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=It(e.font),s=Ut(e.padding);if(!e.display)return;const r=gi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=re(t.align,h,this.right-f);else{const g=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);u=c+re(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=re(a,h,h+f);o.textAlign=r.textAlign(No(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Hn(o,e.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,e=It(t.font),i=Ut(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Ze(t,this.left,this.right)&&Ze(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Ze(t,s.left,s.left+s.width)&&Ze(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!o0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=n0(s,i);s&&!r&&St(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&St(e.onHover,[t,i,this],this)}else i&&St(e.onClick,[t,i,this],this)}}function i0(n,t,e,i,s){const r=s0(i,n,t,e),o=r0(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function s0(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function r0(n,t,e){let i=n;return typeof t.text!="string"&&(i=gd(t,e)),i}function gd(n,t){const e=n.text?n.text.length:0;return t*e}function o0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var a0={id:"legend",_element:md,start(n,t,e){const i=n.legend=new md({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i)},stop(n){oe.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;oe.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Ut(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ma extends Jt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=kt(i.text)?i.text.length:1;this._padding=Ut(i.padding);const r=s*It(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,h;return this.isHorizontal()?(u=re(a,i,r),h=e+t,c=r-i):(o.position==="left"?(u=i+t,h=re(a,s,e),l=ht*-.5):(u=r-t,h=re(a,e,s),l=ht*.5),c=s-e),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Hn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:No(e.align),textBaseline:"middle",translation:[o,a]})}}function l0(n,t){const e=new ma({ctx:n.ctx,options:t,chart:n});oe.configure(n,e,t),oe.addBox(n,e),n.titleBlock=e}var c0={id:"title",_element:ma,start(n,t,e){l0(n,e)},stop(n){const t=n.titleBlock;oe.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;oe.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Tr=new WeakMap;var u0={id:"subtitle",start(n,t,e){const i=new ma({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i),Tr.set(n,i)},stop(n){oe.removeBox(n,Tr.get(n)),Tr.delete(n)},beforeUpdate(n,t,e){const i=Tr.get(n);oe.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const hs={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=di(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ye(n,t){return t&&(kt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function nn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
16
|
+
*/class Tp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Ic.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var tn=new Tp;const du="transparent",Cp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Hc(n||du),s=i.valid&&Hc(t||du);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Pp{constructor(t,e,i,s){const r=e[i];s=Ji([t.to,s,r,t.from]);const o=Ji([t.from,r,s]);this._active=!0,this._fn=t.fn||Cp[t.type||typeof o],this._easing=Xi[t.easing]||Xi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ji([t.to,e,s,t.from]),this._from=Ji([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Go{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!mt(t))return;const e=Object.keys(At.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!mt(r))return;const o={};for(const a of e)o[a]=r[a];(St(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=Ep(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Op(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let h=r[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,u,a);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=h=new Pp(f,t,c,u),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return tn.add(this._chart,i),!0}}function Op(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Ep(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function hu(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function Ap(n,t,e){if(e===!1)return!1;const i=hu(n,e),s=hu(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Rp(n){let t,e,i,s;return mt(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function fu(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function mu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(u=!0,i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||We(t)===We(c))&&(t+=c)}return!u&&!i.all?0:t}function Ip(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function Ko(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Lp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Np(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Fp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function gu(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function pu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=Lp(r,o,i),h=t.length;let f;for(let m=0;m<h;++m){const g=t[m],{[l]:_,[c]:x}=g,M=g._stacks||(g._stacks={});f=M[c]=Fp(s,u,_),f[a]=x,f._top=gu(f,o,!0,i.type),f._bottom=gu(f,o,!1,i.type);const v=f._visualValues||(f._visualValues={});v[a]=x}}function Zo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function zp(n,t){return wn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Bp(n,t,e){return wn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ts(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const Qo=n=>n==="reset"||n==="none",yu=(n,t)=>t?n:Object.assign({},n),Hp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:fu(e,!0),values:null};class Le{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ko(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ts(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,r=e.xAxisID=lt(i.xAxisID,Zo(t,"x")),o=e.yAxisID=lt(i.yAxisID,Zo(t,"y")),a=e.rAxisID=lt(i.rAxisID,Zo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ac(this._data,this),t._stacked&&ts(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(mt(e)){const s=this._cachedMeta;this._data=Ip(e,s)}else if(i!==e){if(i){Ac(i,this);const s=this._cachedMeta;ts(s),s._parsed=[]}e&&Object.isExtensible(e)&&Sg(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=Ko(e.vScale,e),e.stack!==i.stack&&(s=!0,ts(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(pu(this,e._parsed),e._stacked=Ko(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{St(s[t])?f=this.parseArrayData(i,s,t,e):mt(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const m=()=>h[a]===null||c&&h[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}o&&pu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,h=new Array(s);let f,m,g;for(f=0,m=s;f<m;++f)g=f+i,h[f]={[a]:u||r.parse(c[g],g),[l]:o.parse(e[g],g)};return h}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],a[l]={x:r.parse(h[0],u),y:o.parse(h[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=e[f],c[u]={x:r.parse(yn(m,a),f),y:o.parse(yn(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:fu(s,!0),values:e._stacks[t.axis]._visualValues};return mu(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=mu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=Hp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Np(a);let f,m;function g(){m=s[f];const _=m[a.axis];return!Rt(m[t.axis])||u>_||h<_}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(c,t,m,l),r));++f);if(r){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Rt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Rp(lt(this.options.clip,Ap(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const h=s[u];h.hidden||(h.active&&c?o.push(h):h.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=Bp(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=zp(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&me(i);if(a)return yu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(At.elements[t]),g=()=>this.getContext(i,s,e),_=c.resolveNamedOptions(f,m,g,h);return _.$shared&&(_.$shared=l,r[o]=Object.freeze(yu(_,l))),_}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Go(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Qo(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){Qo(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Qo(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&ts(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}E(Le,"defaults",{}),E(Le,"datasetElementType",null),E(Le,"dataElementType",null);function Wp(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Rc(i.sort((s,r)=>s-r))}return n._cache.$bar}function Vp(n){const t=n.iScale,e=Wp(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(me(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function Yp(n,t,e,i){const s=e.barThickness;let r,o;return at(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function jp(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function $p(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function bu(n,t,e,i){return St(n)?$p(n,t,e,i):t[e.axis]=e.parse(n,i),t}function _u(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,h,f;for(c=e,u=e+i;c<u;++c)f=t[c],h={},h[s.axis]=a||s.parse(o[c],c),l.push(bu(f,h,r,c));return l}function Jo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Up(n,t,e){return n!==0?We(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function qp(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function Xp(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=qp(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[xu(u,o,a,l)]=!0,s=c)),r[xu(s,o,a,l)]=!0,n.borderSkipped=r}function xu(n,t,e,i){return i?(n=Gp(n,t,e),n=wu(n,e,t)):n=wu(n,t,e),n}function Gp(n,t,e){return n===t?e:n===e?t:n}function wu(n,t,e){return n==="start"?t:n==="end"?e:n}function Kp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class es extends Le{parsePrimitiveData(t,e,i,s){return _u(t,e,i,s)}parseArrayData(t,e,i,s){return _u(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,h=[];let f,m,g,_;for(f=i,m=i+s;f<m;++f)_=e[f],g={},g[r.axis]=r.parse(yn(_,c),f),h.push(bu(yn(_,u),g,o,f));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Jo(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s);for(let m=e;m<e+i;m++){const g=this.getParsed(m),_=r||at(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),M=(g._stacks||{})[a.axis],v={horizontal:c,base:_.base,enableBorderRadius:!M||Jo(g._custom)||o===M._top||o===M._bottom,x:c?_.head:x.center,y:c?x.center:_.head,height:c?x.size:Math.abs(_.size),width:c?Math.abs(_.size):x.size};f&&(v.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const T=v.options||t[m].options;Xp(v,T,M,o),Kp(v,T,u.ratio),this.updateElement(t[m],m,v,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(at(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[lt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||Vp(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Jo(c);let h=l[e.axis],f=0,m=i?this.applyStack(e,l,i):h,g,_;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&We(h)!==We(c.barEnd)&&(f=0),f+=h);const x=!at(r)&&!u?r:f;let M=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(f+m):g=M,_=g-M,Math.abs(_)<o){_=Up(_,e,a)*o,h===a&&(M-=_/2);const v=e.getPixelForDecimal(0),T=e.getPixelForDecimal(1),k=Math.min(v,T),C=Math.max(v,T);M=Math.max(Math.min(M,C),k),g=M+_,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(M))}if(M===e.getPixelForValue(a)){const v=We(_)*e.getLineWidthForValue(a)/2;M+=v,_-=v}return{size:_,base:M,head:g,center:g+_/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=lt(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?jp(t,e,s,u*c):Yp(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(lt(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+m;a=h.start+h.chunk*g+h.chunk/2,l=Math.min(o,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}E(es,"id","bar"),E(es,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),E(es,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class mr extends Le{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=lt(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=lt(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,h=a.axis;for(let f=e;f<e+i;f++){const m=t[f],g=!r&&this.getParsed(f),_={},x=_[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(g[u]),M=_[h]=r?a.getBasePixel():a.getPixelForValue(g[h]);_.skip=isNaN(x)||isNaN(M),c&&(_.options=l||this.resolveDataElementOptions(f,m.active?"active":s),r&&(_.options.radius=0)),this.updateElement(m,f,_,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=lt(i&&i._custom,r),s}}E(mr,"id","bubble"),E(mr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),E(mr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Zp(n,t,e){let i=1,s=1,r=0,o=0;if(t<Ot){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),h=Math.cos(l),f=Math.sin(l),m=(T,k,C)=>qi(T,a,l,!0)?1:Math.max(k,k*e,C,C*e),g=(T,k,C)=>qi(T,a,l,!0)?-1:Math.min(k,k*e,C,C*e),_=m(0,c,h),x=m(Et,u,f),M=g(ht,c,h),v=g(ht+Et,u,f);i=(_-M)/2,s=(x-v)/2,r=-(_+M)/2,o=-(x+v)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class en extends Le{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(mt(i[t])){const{key:l="value"}=this._parsing;r=c=>+yn(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let t=Ot,e=-Ot;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(ug(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:_}=Zp(h,u,l),x=(i.width-o)/f,M=(i.height-o)/m,v=Math.max(Math.min(x,M)/2,0),T=Sc(this.options.radius,v),k=Math.max(T*l,0),C=(T-k)/this._getVisibleDatasetWeightTotal();this.offsetX=g*T,this.offsetY=_*T,s.total=this.calculateTotal(),this.outerRadius=T-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Ot)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,h=(a.top+a.bottom)/2,f=r&&c.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:_,includeOptions:x}=this._getSharedOptions(e,s);let M=this._getRotation(),v;for(v=0;v<e;++v)M+=this._circumference(v,r);for(v=e;v<e+i;++v){const T=this._circumference(v,r),k=t[v],C={x:u+this.offsetX,y:h+this.offsetY,startAngle:M,endAngle:M+T,circumference:T,outerRadius:g,innerRadius:m};x&&(C.options=_||this.resolveDataElementOptions(v,k.active?"active":s)),M+=T,this.updateElement(k,v,C,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ot*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(lt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}E(en,"id","doughnut"),E(en,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),E(en,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),E(en,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ns extends Le{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=Nc(e,s,o);this._drawStart=a,this._drawCount=l,Fc(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),f=o.axis,m=a.axis,{spanGaps:g,segment:_}=this.options,x=_n(g)?g:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none",v=e+i,T=t.length;let k=e>0&&this.getParsed(e-1);for(let C=0;C<T;++C){const I=t[C],P=M?I:{};if(C<e||C>=v){P.skip=!0;continue}const y=this.getParsed(C),b=at(y[m]),S=P[f]=o.getPixelForValue(y[f],C),O=P[m]=r||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,y,l):y[m],C);P.skip=isNaN(S)||isNaN(O)||b,P.stop=C>0&&Math.abs(y[f]-k[f])>x,_&&(P.parsed=y,P.raw=c.data[C]),h&&(P.options=u||this.resolveDataElementOptions(C,I.active?"active":s)),M||this.updateElement(I,C,P,s),k=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}E(ns,"id","line"),E(ns,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),E(ns,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class is extends Le{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return Qc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*ht;let m=f,g;const _=360/this.countVisibleElements();for(g=0;g<e;++g)m+=this._computeAngle(g,s,_);for(g=e;g<e+i;g++){const x=t[g];let M=m,v=m+this._computeAngle(g,s,_),T=o.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;m=v,r&&(l.animateScale&&(T=0),l.animateRotate&&(M=v=f));const k={x:u,y:h,innerRadius:0,outerRadius:T,startAngle:M,endAngle:v,options:this.resolveDataElementOptions(g,x.active?"active":s)};this.updateElement(x,g,k,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?$t(this.resolveDataElementOptions(t,e).angle||i):0}}E(is,"id","polarArea"),E(is,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),E(is,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ta extends en{}E(ta,"id","pie"),E(ta,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class gr extends Le{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Qc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),h=o?r.xCenter:u.x,f=o?r.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,a,m,s)}}}E(gr,"id","radar"),E(gr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),E(gr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class pr extends Le{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=Nc(e,i,s);if(this._drawStart=r,this._drawCount=o,Fc(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=o.axis,g=a.axis,{spanGaps:_,segment:x}=this.options,M=_n(_)?_:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none";let T=e>0&&this.getParsed(e-1);for(let k=e;k<e+i;++k){const C=t[k],I=this.getParsed(k),P=v?C:{},y=at(I[g]),b=P[m]=o.getPixelForValue(I[m],k),S=P[g]=r||y?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,I,l):I[g],k);P.skip=isNaN(b)||isNaN(S)||y,P.stop=k>0&&Math.abs(I[m]-T[m])>M,x&&(P.parsed=I,P.raw=c.data[k]),f&&(P.options=h||this.resolveDataElementOptions(k,C.active?"active":s)),v||this.updateElement(C,k,P,s),T=I}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}E(pr,"id","scatter"),E(pr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),E(pr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Qp=Object.freeze({__proto__:null,BarController:es,BubbleController:mr,DoughnutController:en,LineController:ns,PieController:ta,PolarAreaController:is,RadarController:gr,ScatterController:pr});function Yn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ea{constructor(t){E(this,"options");this.options=t||{}}static override(t){Object.assign(ea.prototype,t)}init(){}formats(){return Yn()}parse(){return Yn()}format(){return Yn()}add(){return Yn()}diff(){return Yn()}startOf(){return Yn()}endOf(){return Yn()}}var vu={_date:ea};function Jp(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const c=a._reversePixels?vg:Qe;if(i){if(s._sharedOptions){const u=r[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(r,t,e-h),m=c(r,t,e+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=n,m=f.slice(0,u.lo+1).reverse().findIndex(_=>!at(_[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(_=>!at(_[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:r.length-1}}function ss(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:h,hi:f}=Jp(r[a],t,o,s);for(let m=h;m<=f;++m){const g=u[m];g.skip||i(g,c,m)}}}function ty(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function na(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||ss(n,e,t,function(a,l,c){!s&&!Je(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function ey(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:h}=rr(o,{x:t.x,y:t.y});qi(h,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return ss(n,e,t,r),s}function ny(n,t,e,i,s,r){let o=[];const a=ty(e);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const g=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(g))&&!m)return;const x=a(t,g);x<l?(o=[{element:u,datasetIndex:h,index:f}],l=x):x===l&&o.push({element:u,datasetIndex:h,index:f})}return ss(n,e,t,c),o}function ia(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?ey(n,t,e,s):ny(n,t,e,i,s,r)}function Mu(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return ss(n,e,t,(l,c,u)=>{l[o]&&l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var sa={evaluateInteractionItems:ss,modes:{index(n,t,e,i){const s=vn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?na(n,s,r,i,o):ia(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?na(n,s,r,i,o):ia(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return na(n,s,r,i,o)},nearest(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return ia(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=vn(t,n);return Mu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=vn(t,n);return Mu(n,s,"y",e.intersect,i)}}};const Su=["left","top","right","bottom"];function rs(n,t){return n.filter(e=>e.pos===t)}function ku(n,t){return n.filter(e=>Su.indexOf(e.pos)===-1&&e.box.axis===t)}function os(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function iy(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function sy(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Su.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function ry(n,t){const e=sy(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function oy(n){const t=iy(n),e=os(t.filter(c=>c.box.fullSize),!0),i=os(rs(t,"left"),!0),s=os(rs(t,"right")),r=os(rs(t,"top"),!0),o=os(rs(t,"bottom")),a=ku(t,"x"),l=ku(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:rs(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function Du(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Tu(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function ay(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!mt(s)){e.size&&(n[s]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?r.height:r.width),e.size=h.size/h.count,n[s]+=e.size}r.getPadding&&Tu(o,r.getPadding());const a=Math.max(0,t.outerWidth-Du(o,n,"left","right")),l=Math.max(0,t.outerHeight-Du(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function ly(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function cy(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function as(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,cy(a.horizontal,t));const{same:h,other:f}=ay(t,e,a,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&as(s,t,e,i)||u}function yr(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Cu(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const h=t.w*u,f=c.size||l.height;me(c.start)&&(o=c.start),l.fullSize?yr(l,s.left,o,e.outerWidth-s.right-s.left,f):yr(l,t.left+c.placed,o,h,f),c.start=o,c.placed+=h,o=l.bottom}else{const h=t.h*u,f=c.size||l.width;me(c.start)&&(r=c.start),l.fullSize?yr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):yr(l,r,t.top+c.placed,f,h),c.start=r,c.placed+=h,r=l.right}}t.x=r,t.y=o}var oe={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=Ut(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=oy(n.boxes),l=a.vertical,c=a.horizontal;Dt(n.boxes,_=>{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=l.reduce((_,x)=>x.box.options&&x.box.options.display===!1?_:_+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);Tu(f,Ut(i));const m=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),g=ry(l.concat(c),h);as(a.fullSize,m,h,g),as(l,m,h,g),as(c,m,h,g)&&as(l,m,h,g),ly(m),Cu(a.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Cu(a.rightAndBottom,m,h,g),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Dt(a.chartArea,_=>{const x=_.box;Object.assign(x,n.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Pu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class uy extends Pu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const br="$chartjs",dy={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ou=n=>n===null||n==="";function hy(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[br]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ou(s)){const r=eu(n,"width");r!==void 0&&(n.width=r)}if(Ou(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=eu(n,"height");r!==void 0&&(n.height=r)}return n}const Eu=gp?{passive:!0}:!1;function fy(n,t,e){n&&n.addEventListener(t,e,Eu)}function my(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Eu)}function gy(n,t){const e=dy[n.type]||n.type,{x:i,y:s}=vn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function _r(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function py(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||_r(a.addedNodes,i),o=o&&!_r(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function yy(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||_r(a.removedNodes,i),o=o&&!_r(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ls=new Map;let Au=0;function Ru(){const n=window.devicePixelRatio;n!==Au&&(Au=n,ls.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function by(n,t){ls.size||window.addEventListener("resize",Ru),ls.set(n,t)}function _y(n){ls.delete(n),ls.size||window.removeEventListener("resize",Ru)}function xy(n,t,e){const i=n.canvas,s=i&&Xo(i);if(!s)return;const r=Lc((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),by(n,r),o}function ra(n,t,e){e&&e.disconnect(),t==="resize"&&_y(n)}function wy(n,t,e){const i=n.canvas,s=Lc(r=>{n.ctx!==null&&e(gy(r,n))},n);return fy(i,t,s),s}class vy extends Pu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(hy(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[br])return!1;const i=e[br].initial;["height","width"].forEach(r=>{const o=i[r];at(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[br],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:py,detach:yy,resize:xy}[e]||wy;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:ra,detach:ra,resize:ra}[e]||my)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return mp(t,e,i,s)}isAttached(t){const e=t&&Xo(t);return!!(e&&e.isConnected)}}function My(n){return!qo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?uy:vy}class Jt{constructor(){E(this,"x");E(this,"y");E(this,"active",!1);E(this,"options");E(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return _n(this.x)&&_n(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}E(Jt,"defaults",{}),E(Jt,"defaultRoutes");function Sy(n,t){const e=n.options.ticks,i=ky(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Ty(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return Cy(t,c,r,o/s),c;const u=Dy(r,t,s);if(o>0){let h,f;const m=o>1?Math.round((l-a)/(o-1)):null;for(xr(t,c,u,at(m)?0:a-m,a),h=0,f=o-1;h<f;h++)xr(t,c,u,r[h],r[h+1]);return xr(t,c,u,l,at(m)?t.length:l+m),c}return xr(t,c,u),c}function ky(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Dy(n,t,e){const i=Py(n),s=t.length/e;if(!i)return Math.max(s,1);const r=yg(i);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function Ty(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Cy(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function xr(n,t,e,i,s){const r=lt(i,0),o=Math.min(lt(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function Py(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const Oy=n=>n==="left"?"right":n==="right"?"left":n,Iu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Lu=(n,t)=>Math.min(t||n,n);function Nu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function Ey(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function Ay(n,t){Dt(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function cs(n){return n.drawTicks?n.tickLength:0}function Fu(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Ut(n.padding);return(St(n.text)?n.text.length:1)*e.lineHeight+i.height}function Ry(n,t){return wn(n,{scale:t,type:"scale"})}function Iy(n,t,e){return wn(n,{tick:e,index:t,type:"tick"})}function Ly(n,t,e){let i=Fo(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Oy(i)),i}function Ny(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let h=0,f,m,g;const _=o-s,x=a-r;if(n.isHorizontal()){if(m=re(i,r,a),mt(e)){const M=Object.keys(e)[0],v=e[M];g=u[M].getPixelForValue(v)+_-t}else e==="center"?g=(c.bottom+c.top)/2+_-t:g=Iu(n,e,t);f=a-r}else{if(mt(e)){const M=Object.keys(e)[0],v=e[M];m=u[M].getPixelForValue(v)-x+t}else e==="center"?m=(c.left+c.right)/2-x+t:m=Iu(n,e,t);g=re(i,o,s),h=e==="left"?-Et:Et}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class jn extends Jt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=Me(t,Number.POSITIVE_INFINITY),e=Me(e,Number.NEGATIVE_INFINITY),i=Me(i,Number.POSITIVE_INFINITY),s=Me(s,Number.NEGATIVE_INFINITY),{min:Me(t,i),max:Me(e,s),minDefined:Rt(t),maxDefined:Rt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Me(e,Me(i,e)),max:Me(i,Me(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){kt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ug(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Nu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Sy(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){kt(this.options.afterUpdate,[this])}beforeSetDimensions(){kt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){kt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),kt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){kt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=kt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){kt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){kt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Lu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Qt(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/i:m/(i-1),h+6>a&&(a=m/(i-(t.offset?.5:1)),l=this.maxHeight-cs(t.grid)-e.padding-Fu(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),o=sr(Math.min(Math.asin(Qt((u.highest.height+6)/a,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){kt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){kt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Fu(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=cs(r)+l):(t.height=this.maxHeight,t.width=cs(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,g=$t(this.labelRotation),_=Math.cos(g),x=Math.sin(g);if(a){const M=i.mirror?0:x*h.width+_*f.height;t.height=Math.min(this.maxHeight,t.height+M+m)}else{const M=i.mirror?0:_*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+M+m)}this._calculatePadding(c,u,x,_)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=s*t.width,m=i*e.height):(f=i*t.height,m=s*e.width):r==="start"?m=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,m=e.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+o)*this.width/(this.width-h),0)}else{let u=e.height/2,h=t.height/2;r==="start"?(u=0,h=t.height):r==="end"&&(u=e.height,h=0),this.paddingTop=u+o,this.paddingBottom=h+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){kt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)at(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Nu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/Lu(e,i));let c=0,u=0,h,f,m,g,_,x,M,v,T,k,C;for(h=0;h<e;h+=l){if(g=t[h].label,_=this._resolveTickFontOptions(h),s.font=x=_.string,M=r[x]=r[x]||{data:{},gc:[]},v=_.lineHeight,T=k=0,!at(g)&&!St(g))T=lr(s,M.data,M.gc,T,g),k=v;else if(St(g))for(f=0,m=g.length;f<m;++f)C=g[f],!at(C)&&!St(C)&&(T=lr(s,M.data,M.gc,T,C),k+=v);o.push(T),a.push(k),c=Math.max(T,c),u=Math.max(k,u)}Ay(r,e);const I=o.indexOf(c),P=a.indexOf(u),y=b=>({width:o[b]||0,height:a[b]||0});return{first:y(0),last:y(e-1),widest:y(I),highest:y(P),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return wg(this._alignToPixels?Bn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Iy(this.getContext(),t,i))}return this.$context||(this.$context=Ry(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=$t(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=cs(r),m=[],g=a.setContext(this.getContext()),_=g.display?g.width:0,x=_/2,M=function(X){return Bn(i,X,_)};let v,T,k,C,I,P,y,b,S,O,R,A;if(o==="top")v=M(this.bottom),P=this.bottom-f,b=v-x,O=M(t.top)+x,A=t.bottom;else if(o==="bottom")v=M(this.top),O=t.top,A=M(t.bottom)-x,P=v+x,b=this.top+f;else if(o==="left")v=M(this.right),I=this.right-f,y=v-x,S=M(t.left)+x,R=t.right;else if(o==="right")v=M(this.left),S=t.left,R=M(t.right)-x,I=v+x,y=this.left+f;else if(e==="x"){if(o==="center")v=M((t.top+t.bottom)/2+.5);else if(mt(o)){const X=Object.keys(o)[0],W=o[X];v=M(this.chart.scales[X].getPixelForValue(W))}O=t.top,A=t.bottom,P=v+x,b=P+f}else if(e==="y"){if(o==="center")v=M((t.left+t.right)/2);else if(mt(o)){const X=Object.keys(o)[0],W=o[X];v=M(this.chart.scales[X].getPixelForValue(W))}I=v-x,y=I-f,S=t.left,R=t.right}const z=lt(s.ticks.maxTicksLimit,h),U=Math.max(1,Math.ceil(h/z));for(T=0;T<h;T+=U){const X=this.getContext(T),W=r.setContext(X),ct=a.setContext(X),q=W.lineWidth,tt=W.color,et=ct.dash||[],G=ct.dashOffset,j=W.tickWidth,$=W.tickColor,Z=W.tickBorderDash||[],_t=W.tickBorderDashOffset;k=Ey(this,T,l),k!==void 0&&(C=Bn(i,k,q),c?I=y=S=R=C:P=b=O=A=C,m.push({tx1:I,ty1:P,tx2:y,ty2:b,x1:S,y1:O,x2:R,y2:A,width:q,color:tt,borderDash:et,borderDashOffset:G,tickWidth:j,tickColor:$,tickBorderDash:Z,tickBorderDashOffset:_t}))}return this._ticksLength=h,this._borderValue=v,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=r,f=cs(i.grid),m=f+u,g=h?-u:m,_=-$t(this.labelRotation),x=[];let M,v,T,k,C,I,P,y,b,S,O,R,A="middle";if(s==="top")I=this.bottom-g,P=this._getXAxisLabelAlignment();else if(s==="bottom")I=this.top+g,P=this._getXAxisLabelAlignment();else if(s==="left"){const U=this._getYAxisLabelAlignment(f);P=U.textAlign,C=U.x}else if(s==="right"){const U=this._getYAxisLabelAlignment(f);P=U.textAlign,C=U.x}else if(e==="x"){if(s==="center")I=(t.top+t.bottom)/2+m;else if(mt(s)){const U=Object.keys(s)[0],X=s[U];I=this.chart.scales[U].getPixelForValue(X)+m}P=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")C=(t.left+t.right)/2-m;else if(mt(s)){const U=Object.keys(s)[0],X=s[U];C=this.chart.scales[U].getPixelForValue(X)}P=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?A="top":l==="end"&&(A="bottom"));const z=this._getLabelSizes();for(M=0,v=a.length;M<v;++M){T=a[M],k=T.label;const U=r.setContext(this.getContext(M));y=this.getPixelForTick(M)+r.labelOffset,b=this._resolveTickFontOptions(M),S=b.lineHeight,O=St(k)?k.length:1;const X=O/2,W=U.color,ct=U.textStrokeColor,q=U.textStrokeWidth;let tt=P;o?(C=y,P==="inner"&&(M===v-1?tt=this.options.reverse?"left":"right":M===0?tt=this.options.reverse?"right":"left":tt="center"),s==="top"?c==="near"||_!==0?R=-O*S+S/2:c==="center"?R=-z.highest.height/2-X*S+S:R=-z.highest.height+S/2:c==="near"||_!==0?R=S/2:c==="center"?R=z.highest.height/2-X*S:R=z.highest.height-O*S,h&&(R*=-1),_!==0&&!U.showLabelBackdrop&&(C+=S/2*Math.sin(_))):(I=y,R=(1-O)*S/2);let et;if(U.showLabelBackdrop){const G=Ut(U.backdropPadding),j=z.heights[M],$=z.widths[M];let Z=R-G.top,_t=0-G.left;switch(A){case"middle":Z-=j/2;break;case"bottom":Z-=j;break}switch(P){case"center":_t-=$/2;break;case"right":_t-=$;break;case"inner":M===v-1?_t-=$:M>0&&(_t-=$/2);break}et={left:_t,top:Z,width:$+G.width,height:j+G.height,color:U.backdropColor}}x.push({label:k,font:b,textOffset:R,options:{rotation:_,color:W,strokeColor:ct,strokeWidth:q,textAlign:tt,textBaseline:A,translation:[C,I],backdrop:et}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Bn(t,this.left,o)-o/2,u=Bn(t,this.right,a)+a/2,h=f=l):(h=Bn(t,this.top,o)-o/2,f=Bn(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,h),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Zi(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Hn(i,c,0,u,l,a)}s&&Qi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=It(i.font),o=Ut(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||mt(e)?(l+=o.bottom,St(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=Ny(this,l,e,a);Hn(t,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:f,textAlign:Ly(a,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=lt(t.grid&&t.grid.z,-1),s=lt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==jn.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return It(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;By(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Fy(t,o,i),this.override&&At.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in At[s]&&(delete At[s][i],this.override&&delete zn[i])}}function Fy(n,t,e){const i=ji(Object.create(null),[e?At.get(e):{},At.get(t),n.defaults]);At.set(t,i),n.defaultRoutes&&zy(t,n.defaultRoutes),n.descriptors&&At.describe(t,n.descriptors)}function zy(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");At.route(r,s,l,a)})}function By(n){return"id"in n&&"defaults"in n}class Hy{constructor(){this.controllers=new wr(Le,"datasets",!0),this.elements=new wr(Jt,"elements"),this.plugins=new wr(Object,"plugins"),this.scales=new wr(jn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Dt(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=Io(t);kt(i["before"+s],[],i),e[t](i),kt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ve=new Hy;class Wy{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(kt(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){at(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=lt(i.options&&i.options.plugins,{}),r=Vy(i);return s===!1&&!e?[]:jy(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Vy(n){const t={},e=[],i=Object.keys(Ve.plugins.items);for(let r=0;r<i.length;r++)e.push(Ve.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function Yy(n,t){return!t&&n===!1?null:n===!0?{}:n}function jy(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=Yy(i[l],s);c!==null&&r.push({plugin:a,options:$y(n.config,{plugin:a,local:e[l]},c,o)})}return r}function $y(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function oa(n,t){const e=At.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Uy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function qy(n,t){return n===t?"_index_":"_value_"}function zu(n){if(n==="x"||n==="y"||n==="r")return n}function Xy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function aa(n,...t){if(zu(n))return n;for(const e of t){const i=e.axis||Xy(e.position)||n.length>1&&zu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Bu(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Gy(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Bu(n,"x",e[0])||Bu(n,"y",e[0])}return{}}function Ky(n,t){const e=zn[n.type]||{scales:{}},i=t.scales||{},s=oa(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!mt(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=aa(o,a,Gy(o,n),At.scales[a.type]),c=qy(l,s),u=e.scales||{};r[o]=$i(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||oa(a,t),u=(zn[a]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Uy(h,l),m=o[f+"AxisID"]||f;r[m]=r[m]||Object.create(null),$i(r[m],[{axis:f},i[m],u[h]])})}),Object.keys(r).forEach(o=>{const a=r[o];$i(a,[At.scales[a.type],At.scale])}),r}function Hu(n){const t=n.options||(n.options={});t.plugins=lt(t.plugins,{}),t.scales=Ky(n,t)}function Wu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Zy(n){return n=n||{},n.data=Wu(n.data),Hu(n),n}const Vu=new Map,Yu=new Set;function vr(n,t){let e=Vu.get(n);return e||(e=t(),Vu.set(n,e),Yu.add(e)),e}const us=(n,t,e)=>{const i=yn(t,e);i!==void 0&&n.add(i)};class Qy{constructor(t){this._config=Zy(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Wu(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Hu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return vr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return vr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return vr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return vr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>us(l,t,h))),u.forEach(h=>us(l,s,h)),u.forEach(h=>us(l,zn[r]||{},h)),u.forEach(h=>us(l,At,h)),u.forEach(h=>us(l,Ho,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Yu.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,zn[e]||{},At.datasets[e]||{},{type:e},At,Ho]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=ju(this._resolverCache,t,s);let l=o;if(tb(o,e)){r.$shared=!1,i=ge(i)?i():i;const c=this.createResolver(t,i,a);l=fi(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=ju(this._resolverCache,t,i);return mt(e)?fi(r,e,void 0,s):r}}function ju(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:jo(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Jy=n=>mt(n)&&Object.getOwnPropertyNames(n).some(t=>ge(n[t]));function tb(n,t){const{isScriptable:e,isIndexable:i}=Uc(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(ge(a)||Jy(a))||o&&St(a))return!0}return!1}var eb="4.5.0";const nb=["top","bottom","left","right","chartArea"];function $u(n,t){return n==="top"||n==="bottom"||nb.indexOf(n)===-1&&t==="x"}function Uu(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function qu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),kt(e&&e.onComplete,[n],t)}function ib(n){const t=n.chart,e=t.options.animation;kt(e&&e.onProgress,[n],t)}function Xu(n){return qo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Mr={},Gu=n=>{const t=Xu(n);return Object.values(Mr).filter(e=>e.canvas===t).pop()};function sb(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function rb(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let Ce=(En=class{static register(...t){Ve.add(...t),Ku()}static unregister(...t){Ve.remove(...t),Ku()}constructor(t,e){const i=this.config=new Qy(e),s=Xu(t),r=Gu(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||My(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=cg(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Wy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=kg(h=>this.update(h),o.resizeDelay||0),this._dataChanges=[],Mr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}tn.listen(this,"complete",qu),tn.listen(this,"progress",ib),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return at(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ve}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Yc(this.canvas,this.ctx),this}stop(){return tn.stop(this),this}resize(t,e){tn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tu(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),kt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Dt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=aa(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Dt(r,o=>{const a=o.options,l=a.id,c=aa(l,a),u=lt(a.type,o.dtype);(a.position===void 0||$u(a.position,c)!==$u(o.dposition))&&(a.position=o.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ve.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(a,t)}),Dt(s,(o,a)=>{o||delete i[a]}),Dt(i,o=>{oe.configure(this,o,o.options),oe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Uu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||oa(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=Ve.getController(a),{datasetElementType:c,dataElementType:u}=At.datasets[a];Object.assign(l,{dataElementType:Ve.getElement(u),datasetElementType:c&&Ve.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Dt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&r.indexOf(h)===-1;h.buildOrUpdateElements(f),o=Math.max(+h.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||Dt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Uu("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Dt(this.scales,t=>{oe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Tc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;sb(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Tc(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;oe.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Dt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,ge(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(tn.has(this)?this.attached&&!tn.running(this)&&tn.start(this):(this.draw(),qu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=uu(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Zi(e,s),t.controller.draw(),s&&Qi(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Je(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=sa.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=wn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);me(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),tn.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Yc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Mr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Dt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){Dt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Dt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!tr(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=gg(t),c=rb(t,this._lastEvent,i,l);i&&(this._lastEvent=null,kt(r.onHover,[t,a,this],this),l&&kt(r.onClick,[t,a,this],this));const u=!tr(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},E(En,"defaults",At),E(En,"instances",Mr),E(En,"overrides",zn),E(En,"registry",Ve),E(En,"version",eb),E(En,"getChart",Gu),En);function Ku(){return Dt(Ce.instances,n=>n._plugins.invalidate())}function ob(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/o,se(i-e));if(n.beginPath(),n.arc(s,r,o-c/2,i+h/2,e-h/2),a>0){const f=Math.min(c/a,se(i-e));n.arc(s,r,a+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,o*se(i-e));if(u==="round")n.arc(s,r,f,e-ht/2,i+ht/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(e+ht/2)+s,_=-m*Math.sin(e+ht/2)+r,x=m*Math.cos(i+ht/2)+s,M=m*Math.sin(i+ht/2)+r;n.lineTo(g,_),n.lineTo(x,M)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function ab(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Et,i-Et),n.closePath(),n.clip()}function lb(n){return Yo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function cb(n,t,e,i){const s=lb(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return Qt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Qt(s.innerStart,0,o),innerEnd:Qt(s.innerEnd,0,o)}}function pi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Sr(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let m=0;const g=s-l;if(i){const U=u>0?u-i:0,X=h>0?h-i:0,W=(U+X)/2,ct=W!==0?g*W/(W+i):g;m=(g-ct)/2}const _=Math.max(.001,g*h-e/ht)/h,x=(g-_)/2,M=l+x+m,v=s-x-m,{outerStart:T,outerEnd:k,innerStart:C,innerEnd:I}=cb(t,f,h,v-M),P=h-T,y=h-k,b=M+T/P,S=v-k/y,O=f+C,R=f+I,A=M+C/O,z=v-I/R;if(n.beginPath(),r){const U=(b+S)/2;if(n.arc(o,a,h,b,U),n.arc(o,a,h,U,S),k>0){const q=pi(y,S,o,a);n.arc(q.x,q.y,k,S,v+Et)}const X=pi(R,v,o,a);if(n.lineTo(X.x,X.y),I>0){const q=pi(R,z,o,a);n.arc(q.x,q.y,I,v+Et,z+Math.PI)}const W=(v-I/f+(M+C/f))/2;if(n.arc(o,a,f,v-I/f,W,!0),n.arc(o,a,f,W,M+C/f,!0),C>0){const q=pi(O,A,o,a);n.arc(q.x,q.y,C,A+Math.PI,M-Et)}const ct=pi(P,M,o,a);if(n.lineTo(ct.x,ct.y),T>0){const q=pi(P,b,o,a);n.arc(q.x,q.y,T,M-Et,b)}}else{n.moveTo(o,a);const U=Math.cos(b)*h+o,X=Math.sin(b)*h+a;n.lineTo(U,X);const W=Math.cos(S)*h+o,ct=Math.sin(S)*h+a;n.lineTo(W,ct)}n.closePath()}function ub(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Sr(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%Ot||Ot))}return Sr(n,t,e,i,l,s),n.fill(),l}function db(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(h||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let _=t.endAngle;if(r){Sr(n,t,e,i,_,s);for(let x=0;x<r;++x)n.stroke();isNaN(a)||(_=o+(a%Ot||Ot))}g&&ab(n,t,_),l.selfJoin&&_-o>=ht&&m===0&&u!=="miter"&&ob(n,t,_),r||(Sr(n,t,e,i,_,s),n.stroke())}class ds extends Jt{constructor(e){super();E(this,"circumference");E(this,"endAngle");E(this,"fullCircles");E(this,"innerRadius");E(this,"outerRadius");E(this,"pixelMargin");E(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=rr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,g=lt(f,c-l),_=qi(o,l,c)&&l!==c,x=g>=Ot||_,M=Ze(a,u+m,h+m);return x&&M}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,h=(r+o)/2,f=(a+l+u+c)/2;return{x:i+Math.cos(h)*f,y:s+Math.sin(h)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ot?Math.floor(s/Ot):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(ht,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,ub(e,this,u,o,a),db(e,this,u,o,a),e.restore()}}E(ds,"id","arc"),E(ds,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),E(ds,"defaultRoutes",{backgroundColor:"backgroundColor"}),E(ds,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Zu(n,t,e=t){n.lineCap=lt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(lt(e.borderDash,t.borderDash)),n.lineDashOffset=lt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=lt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=lt(e.borderWidth,t.borderWidth),n.strokeStyle=lt(e.borderColor,t.borderColor)}function hb(n,t,e){n.lineTo(e.x,e.y)}function fb(n){return n.stepped?Fg:n.tension||n.cubicInterpolationMode==="monotone"?zg:hb}function Qu(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function mb(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Qu(s,e,i),u=fb(r);let{move:h=!0,reverse:f}=i||{},m,g,_;for(m=0;m<=c;++m)g=s[(a+(f?c-m:m))%o],!g.skip&&(h?(n.moveTo(g.x,g.y),h=!1):u(n,_,g,f,r.stepped),_=g);return l&&(g=s[(a+(f?c:0))%o],u(n,_,g,f,r.stepped)),!!l}function gb(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Qu(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,g,_,x,M;const v=k=>(o+(c?a-k:k))%r,T=()=>{_!==x&&(n.lineTo(u,x),n.lineTo(u,_),n.lineTo(u,M))};for(l&&(m=s[v(0)],n.moveTo(m.x,m.y)),f=0;f<=a;++f){if(m=s[v(f)],m.skip)continue;const k=m.x,C=m.y,I=k|0;I===g?(C<_?_=C:C>x&&(x=C),u=(h*u+k)/++h):(T(),n.lineTo(k,C),g=I,h=0,_=x=C),M=C}T()}function la(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?gb:mb}function pb(n){return n.stepped?pp:n.tension||n.cubicInterpolationMode==="monotone"?yp:Vn}function yb(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Zu(n,t.options),n.stroke(s)}function bb(n,t,e,i){const{segments:s,options:r}=t,o=la(t);for(const a of s)Zu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const _b=typeof Path2D=="function";function xb(n,t,e,i){_b&&!t.options.segment?yb(n,t,e,i):bb(n,t,e,i)}class Mn extends Jt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;lp(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Mp(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=au(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=pb(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:h,end:f}=o[c],m=r[h],g=r[f];if(m===g){a.push(m);continue}const _=Math.abs((s-m[e])/(g[e]-m[e])),x=l(m,g,_,i.stepped);x[e]=t[e],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,e,i){return la(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=la(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),xb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}E(Mn,"id","line"),E(Mn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),E(Mn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),E(Mn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ju(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class kr extends Jt{constructor(e){super();E(this,"parsed");E(this,"skip");E(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return Ju(this,e,"x",i)}inYRange(e,i){return Ju(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Je(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Vo(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}E(kr,"id","point"),E(kr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),E(kr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function td(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,h;return n.horizontal?(h=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=r/2,a=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function Sn(n,t,e,i){return n?0:Qt(t,e,i)}function wb(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=$c(i);return{t:Sn(s.top,r.top,0,e),r:Sn(s.right,r.right,0,t),b:Sn(s.bottom,r.bottom,0,e),l:Sn(s.left,r.left,0,t)}}function vb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=xn(s),o=Math.min(t,e),a=n.borderSkipped,l=i||mt(s);return{topLeft:Sn(!l||a.top||a.left,r.topLeft,0,o),topRight:Sn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Sn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Sn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Mb(n){const t=td(n),e=t.right-t.left,i=t.bottom-t.top,s=wb(n,e/2,i/2),r=vb(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function ca(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&td(n,i);return a&&(s||Ze(t,a.left,a.right))&&(r||Ze(e,a.top,a.bottom))}function Sb(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function kb(n,t){n.rect(t.x,t.y,t.w,t.h)}function ua(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class Dr extends Jt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=Mb(this),a=Sb(o.radius)?hi:kb;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,ua(o,e,r)),t.clip(),a(t,ua(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ua(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ca(this,t,e,i)}inXRange(t,e){return ca(this,t,null,e)}inYRange(t,e){return ca(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}E(Dr,"id","bar"),E(Dr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),E(Dr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Db=Object.freeze({__proto__:null,ArcElement:ds,BarElement:Dr,LineElement:Mn,PointElement:kr});const da=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ed=da.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function nd(n){return da[n%da.length]}function id(n){return ed[n%ed.length]}function Tb(n,t){return n.borderColor=nd(t),n.backgroundColor=id(t),++t}function Cb(n,t){return n.backgroundColor=n.data.map(()=>nd(t++)),t}function Pb(n,t){return n.backgroundColor=n.data.map(()=>id(t++)),t}function Ob(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof en?t=Cb(e,t):s instanceof is?t=Pb(e,t):s&&(t=Tb(e,t))}}function sd(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Eb(n){return n&&(n.borderColor||n.backgroundColor)}function Ab(){return At.borderColor!=="rgba(0,0,0,0.1)"||At.backgroundColor!=="rgba(0,0,0,0.1)"}var Rb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,o=sd(i)||Eb(s)||r&&sd(r)||Ab();if(!e.forceOverride&&o)return;const a=Ob(n);i.forEach(a)}};function Ib(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,h,f,m,g,_;for(o[l++]=n[u],h=0;h<r-2;h++){let x=0,M=0,v;const T=Math.floor((h+1)*a)+1+t,k=Math.min(Math.floor((h+2)*a)+1,e)+t,C=k-T;for(v=T;v<k;v++)x+=n[v].x,M+=n[v].y;x/=C,M/=C;const I=Math.floor(h*a)+1+t,P=Math.min(Math.floor((h+1)*a)+1,e)+t,{x:y,y:b}=n[u];for(m=g=-1,v=I;v<P;v++)g=.5*Math.abs((y-x)*(n[v].y-b)-(y-n[v].x)*(M-b)),g>m&&(m=g,f=n[v],_=v);o[l++]=f,u=_}return o[l++]=n[c],o}function Lb(n,t,e,i){let s=0,r=0,o,a,l,c,u,h,f,m,g,_;const x=[],M=t+e-1,v=n[t].x,k=n[M].x-v;for(o=t;o<t+e;++o){a=n[o],l=(a.x-v)/k*i,c=a.y;const C=l|0;if(C===u)c<g?(g=c,h=o):c>_&&(_=c,f=o),s=(r*s+a.x)/++r;else{const I=o-1;if(!at(h)&&!at(f)){const P=Math.min(h,f),y=Math.max(h,f);P!==m&&P!==I&&x.push({...n[P],x:s}),y!==m&&y!==I&&x.push({...n[y],x:s})}o>0&&I!==m&&x.push(n[I]),x.push(a),u=C,r=0,g=_=c,h=f=m=o}}return x}function rd(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function od(n){n.data.datasets.forEach(t=>{rd(t)})}function Nb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Qt(Qe(t,r.axis,o).lo,0,e-1)),c?s=Qt(Qe(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var Fb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){od(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Ji([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:h,count:f}=Nb(l,c);const m=e.threshold||4*i;if(f<=m){rd(s);return}at(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(_){this._data=_}}));let g;switch(e.algorithm){case"lttb":g=Ib(c,h,f,i,e);break;case"min-max":g=Lb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(n){od(n)}};function zb(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=Tr(l,c,s);const u=ha(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const h=au(t,u);for(const f of h){const m=ha(e,r[f.start],r[f.end],f.loop),g=ou(a,s,m);for(const _ of g)o.push({source:_,target:f,start:{[e]:ad(u,m,"start",Math.max)},end:{[e]:ad(u,m,"end",Math.min)}})}}return o}function ha(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=se(s),r=se(r)),{property:n,start:s,end:r}}function Bb(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Tr(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Tr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function ad(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function ld(n,t){let e=[],i=!1;return St(n)?(i=!0,e=n):e=Bb(n,t),e.length?new Mn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function cd(n){return n&&n.fill!==!1}function Hb(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Rt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function Wb(n,t,e){const i=$b(n);if(mt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?Vb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Vb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Yb(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:mt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function jb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:mt(n)?i=n.value:i=t.getBaseValue(),i}function $b(n){const t=n.options,e=t.fill;let i=lt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Ub(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=qb(t,e);a.push(ld({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)Xb(s,o[u],a)}return new Mn({points:s,options:{}})}function qb(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function Xb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=Gb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function Gb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],h=o[u.start][e],f=o[u.end][e];if(Ze(s,h,f)){a=s===h,l=s===f;break}}return{first:a,last:l,point:i}}class ud{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:Ot},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function Kb(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return Zb(t,e);if(e==="stack")return Ub(n);if(e==="shape")return!0;const s=Qb(n);return s instanceof ud?s:ld(s,i)}function Zb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Qb(n){return(n.scale||{}).getPointPositionForValue?t0(n):Jb(n)}function Jb(n){const{scale:t={},fill:e}=n,i=Yb(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function t0(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=jb(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new ud({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function fa(n,t,e){const i=Kb(t),{chart:s,index:r,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},g=s.getDatasetMeta(r),_=uu(s,g);i&&o.points.length&&(Zi(n,e),e0(n,{line:o,target:i,above:f,below:m,area:e,scale:a,axis:l,clip:_}),Qi(n))}function e0(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(dd(n,i,o.top),ma(n,{line:e,target:i,color:s,scale:a,property:c,clip:l}),n.restore(),n.save(),dd(n,i,o.bottom)):c==="y"&&(hd(n,i,o.left),ma(n,{line:e,target:i,color:r,scale:a,property:c,clip:l}),n.restore(),n.save(),hd(n,i,o.right),u=s)),ma(n,{line:e,target:i,color:u,scale:a,property:c,clip:l}),n.restore()}function dd(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[Tr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function hd(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[Tr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(e,h.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function ma(n,t){const{line:e,target:i,property:s,color:r,scale:o,clip:a}=t,l=zb(e,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=r}={}}=c,g=i!==!0;n.save(),n.fillStyle=m,n0(n,o,a,g&&ha(s,h,f)),n.beginPath();const _=!!e.pathSegment(n,c);let x;if(g){_?n.closePath():fd(n,i,f,s);const M=!!i.pathSegment(n,u,{move:_,reverse:!0});x=_&&M,x||fd(n,i,h,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function n0(n,t,e,i){const s=t.chart.chartArea,{property:r,start:o,end:a}=i||{};if(r==="x"||r==="y"){let l,c,u,h;r==="x"?(l=o,c=s.top,u=a,h=s.bottom):(l=s.left,c=o,u=s.right,h=a),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),n.rect(l,c,u-l,h-c),n.clip()}}function fd(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var i0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof Mn&&(l={visible:n.isDatasetVisible(o),index:o,fill:Wb(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=Hb(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&fa(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;cd(r)&&fa(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!cd(i)||e.drawTime!=="beforeDatasetDraw"||fa(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const md=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},s0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class gd extends Jt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=kt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=It(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=md(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let h=t;r.textAlign="left",r.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((g,_)=>{const x=i+e/2+r.measureText(g.text).width;(_===0||c[c.length-1]+x+2*a>o)&&(h+=u,c[c.length-(_>0?0:1)]=0,m+=u,f++),l[_]={left:0,top:m,row:f,width:x,height:s},c[c.length-1]+=x+a}),h}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let h=a,f=0,m=0,g=0,_=0;return this.legendItems.forEach((x,M)=>{const{itemWidth:v,itemHeight:T}=r0(i,e,r,x,s);M>0&&m+T+2*a>u&&(h+=f+a,c.push({width:f,height:m}),g+=f+a,_++,f=m=0),l[M]={left:g,top:m,col:_,width:v,height:T},f=Math.max(f,v),m+=T+a}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=gi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=re(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=re(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Zi(t,this),this._draw(),Qi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=At.color,l=gi(t.rtl,this.left,this.width),c=It(o.font),{padding:u}=o,h=c.size,f=h/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:_,itemHeight:x}=md(o,h),M=function(I,P,y){if(isNaN(g)||g<=0||isNaN(_)||_<0)return;s.save();const b=lt(y.lineWidth,1);if(s.fillStyle=lt(y.fillStyle,a),s.lineCap=lt(y.lineCap,"butt"),s.lineDashOffset=lt(y.lineDashOffset,0),s.lineJoin=lt(y.lineJoin,"miter"),s.lineWidth=b,s.strokeStyle=lt(y.strokeStyle,a),s.setLineDash(lt(y.lineDash,[])),o.usePointStyle){const S={radius:_*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:b},O=l.xPlus(I,g/2),R=P+f;jc(s,S,O,R,o.pointStyleWidth&&g)}else{const S=P+Math.max((h-_)/2,0),O=l.leftForLtr(I,g),R=xn(y.borderRadius);s.beginPath(),Object.values(R).some(A=>A!==0)?hi(s,{x:O,y:S,w:g,h:_,radius:R}):s.rect(O,S,g,_),s.fill(),b!==0&&s.stroke()}s.restore()},v=function(I,P,y){Hn(s,y.text,I,P+x/2,c,{strikethrough:y.hidden,textAlign:l.textAlign(y.textAlign)})},T=this.isHorizontal(),k=this._computeTitleHeight();T?m={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+k,line:0}:m={x:this.left+u,y:re(r,this.top+k+u,this.bottom-e[0].height),line:0},nu(this.ctx,t.textDirection);const C=x+u;this.legendItems.forEach((I,P)=>{s.strokeStyle=I.fontColor,s.fillStyle=I.fontColor;const y=s.measureText(I.text).width,b=l.textAlign(I.textAlign||(I.textAlign=o.textAlign)),S=g+f+y;let O=m.x,R=m.y;l.setWidth(this.width),T?P>0&&O+S+u>this.right&&(R=m.y+=C,m.line++,O=m.x=re(r,this.left+u,this.right-i[m.line])):P>0&&R+C>this.bottom&&(O=m.x=O+e[m.line].width+u,m.line++,R=m.y=re(r,this.top+k+u,this.bottom-e[m.line].height));const A=l.x(O);if(M(A,R,I),O=Dg(b,O+g+f,T?O+S:this.right,t.rtl),v(l.x(O),R,I),T)m.x+=S+u;else if(typeof I.text!="string"){const z=c.lineHeight;m.y+=pd(I,z)+u}else m.y+=C}),iu(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=It(e.font),s=Ut(e.padding);if(!e.display)return;const r=gi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=re(t.align,h,this.right-f);else{const g=this.columnSizes.reduce((_,x)=>Math.max(_,x.height),0);u=c+re(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=re(a,h,h+f);o.textAlign=r.textAlign(Fo(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Hn(o,e.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,e=It(t.font),i=Ut(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Ze(t,this.left,this.right)&&Ze(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Ze(t,s.left,s.left+s.width)&&Ze(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!l0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=s0(s,i);s&&!r&&kt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&kt(e.onHover,[t,i,this],this)}else i&&kt(e.onClick,[t,i,this],this)}}function r0(n,t,e,i,s){const r=o0(i,n,t,e),o=a0(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function o0(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function a0(n,t,e){let i=n;return typeof t.text!="string"&&(i=pd(t,e)),i}function pd(n,t){const e=n.text?n.text.length:0;return t*e}function l0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var c0={id:"legend",_element:gd,start(n,t,e){const i=n.legend=new gd({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i)},stop(n){oe.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;oe.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Ut(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ga extends Jt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=St(i.text)?i.text.length:1;this._padding=Ut(i.padding);const r=s*It(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,h;return this.isHorizontal()?(u=re(a,i,r),h=e+t,c=r-i):(o.position==="left"?(u=i+t,h=re(a,s,e),l=ht*-.5):(u=r-t,h=re(a,e,s),l=ht*.5),c=s-e),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Hn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Fo(e.align),textBaseline:"middle",translation:[o,a]})}}function u0(n,t){const e=new ga({ctx:n.ctx,options:t,chart:n});oe.configure(n,e,t),oe.addBox(n,e),n.titleBlock=e}var d0={id:"title",_element:ga,start(n,t,e){u0(n,e)},stop(n){const t=n.titleBlock;oe.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;oe.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Cr=new WeakMap;var h0={id:"subtitle",start(n,t,e){const i=new ga({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i),Cr.set(n,i)},stop(n){oe.removeBox(n,Cr.get(n)),Cr.delete(n)},beforeUpdate(n,t,e){const i=Cr.get(n);oe.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const hs={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=di(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ye(n,t){return t&&(St(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function nn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
17
17
|
`)>-1?n.split(`
|
|
18
|
-
`):n}function d0(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function pd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),h=r.length,f=s.length,m=i.length,g=Ut(t.padding);let b=g.height,x=0,k=i.reduce((v,S)=>v+S.before.length+S.lines.length+S.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,h&&(b+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),k){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=m*v+(k-m)*l.lineHeight+(k-1)*t.bodySpacing}f&&(b+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const T=function(v){x=Math.max(x,e.measureText(v).width+M)};return e.save(),e.font=c.string,Dt(n.title,T),e.font=l.string,Dt(n.beforeBody.concat(n.afterBody),T),M=t.displayColors?o+2+t.boxPadding:0,Dt(i,v=>{Dt(v.before,T),Dt(v.lines,T),Dt(v.after,T)}),M=0,e.font=u.string,Dt(n.footer,T),e.restore(),x+=g.width,{width:x,height:b}}function h0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function f0(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function m0(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),f0(c,n,t,e)&&(c="center"),c}function yd(n,t,e){const i=e.yAlign||t.yAlign||h0(n,e);return{xAlign:e.xAlign||t.xAlign||m0(n,t,e,i),yAlign:i}}function g0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function p0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function bd(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=xn(o);let g=g0(t,a);const b=p0(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,f)+s:a==="right"&&(g+=Math.max(h,m)+s),{x:Qt(g,0,i.width-t.width),y:Qt(b,0,i.height-t.height)}}function Cr(n,t,e){const i=Ut(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function _d(n){return Ye([],nn(n))}function y0(n,t,e){return wn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function xd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const wd={beforeTitle:Ke,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ke,beforeBody:Ke,beforeLabel:Ke,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return at(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function pe(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?wd[t].call(e,i):s}class ga extends Jt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Xo(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=y0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=pe(i,"beforeTitle",this,t),r=pe(i,"title",this,t),o=pe(i,"afterTitle",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}getBeforeBody(t,e){return _d(pe(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return Dt(t,r=>{const o={before:[],lines:[],after:[]},a=xd(i,r);Ye(o.before,nn(pe(a,"beforeLabel",this,r))),Ye(o.lines,pe(a,"label",this,r)),Ye(o.after,nn(pe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return _d(pe(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=pe(i,"beforeFooter",this,t),r=pe(i,"footer",this,t),o=pe(i,"afterFooter",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(d0(this.chart,e[l]));return t.filter&&(a=a.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,i))),Dt(a,u=>{const h=xd(t.callbacks,u);s.push(pe(h,"labelColor",this,u)),r.push(pe(h,"labelPointStyle",this,u)),o.push(pe(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=hs[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=pd(this,i),c=Object.assign({},a,l),u=yd(this.chart,i,c),h=bd(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=xn(a),{x:f,y:m}=t,{width:g,height:b}=e;let x,k,M,T,v,S;return r==="center"?(v=m+b/2,s==="left"?(x=f,k=x-o,T=v+o,S=v-o):(x=f+g,k=x+o,T=v-o,S=v+o),M=x):(s==="left"?k=f+Math.max(l,u)+o:s==="right"?k=f+g-Math.max(c,h)-o:k=this.caretX,r==="top"?(T=m,v=T-o,x=k-o,M=k+o):(T=m+b,v=T+o,x=k+o,M=k-o),S=T),{x1:x,x2:k,x3:M,y1:T,y2:v,y3:S}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=gi(i.rtl,this.x,this.width);for(t.x=Cr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=It(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=It(r.bodyFont),h=Cr(this,"left",r),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+m;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,k=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Wo(t,b,x,k),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Wo(t,b,x,k)}else{t.lineWidth=mt(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const b=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),k=xn(o.borderRadius);Object.values(k).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,hi(t,{x:b,y:g,w:c,h:l,radius:k}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),hi(t,{x,y:g+1,w:c-2,h:l-2,radius:k}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,g,c,l),t.strokeRect(b,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(x,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=It(i.bodyFont);let f=h.lineHeight,m=0;const g=gi(i.rtl,this.x,this.width),b=function(y){e.fillText(y,g.x(t.x+m),t.y+f/2),t.y+=f+r},x=g.textAlign(o);let k,M,T,v,S,E,P;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Cr(this,x,i),e.fillStyle=i.bodyColor,Dt(this.beforeBody,b),m=a&&x!=="right"?o==="center"?c/2+u:c+2+u:0,v=0,E=s.length;v<E;++v){for(k=s[v],M=this.labelTextColors[v],e.fillStyle=M,Dt(k.before,b),T=k.lines,a&&T.length&&(this._drawColorBox(e,t,v,g,i),f=Math.max(h.lineHeight,l)),S=0,P=T.length;S<P;++S)b(T[S]),f=h.lineHeight;Dt(k.after,b)}m=0,f=h.lineHeight,Dt(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=gi(i.rtl,this.x,this.width);for(t.x=Cr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=It(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=xn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+h,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-g),e.quadraticCurveTo(a+c,l+u,a+c-g,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+m,l+u),e.quadraticCurveTo(a,l+u,a,l+u-m),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+h),e.quadraticCurveTo(a,l,a+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=hs[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=pd(this,t),l=Object.assign({},o,this._size),c=yd(e,t,l),u=bd(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ut(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),eu(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),nu(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Js(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Js(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=hs[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}O(ga,"positioners",hs);var ke={id:"tooltip",_element:ga,positioners:hs,afterInit(n,t,e){e&&(n.tooltip=new ga({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:wd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},b0=Object.freeze({__proto__:null,Colors:Eb,Decimation:Lb,Filler:e0,Legend:a0,SubTitle:u0,Title:c0,Tooltip:ke});const _0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function x0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return _0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const w0=(n,t)=>n===null?null:Qt(Math.round(n),0,t);function vd(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class pa extends jn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(at(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:x0(i,t,lt(e,t),this._addedLabels),w0(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return vd.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}O(pa,"id","category"),O(pa,"defaults",{ticks:{callback:vd}});function v0(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=r||1,g=u-1,{min:b,max:x}=t,k=!at(o),M=!at(a),T=!at(c),v=(x-b)/(h+1);let S=Tc((x-b)/g/m)*m,E,P,y,_;if(S<1e-14&&!k&&!M)return[{value:b},{value:x}];_=Math.ceil(x/S)-Math.floor(b/S),_>g&&(S=Tc(_*S/g/m)*m),at(l)||(E=Math.pow(10,l),S=Math.ceil(S*E)/E),s==="ticks"?(P=Math.floor(b/S)*S,y=Math.ceil(x/S)*S):(P=b,y=x),k&&M&&r&&yg((a-o)/r,S/1e3)?(_=Math.round(Math.min((a-o)/S,u)),S=(a-o)/_,P=o,y=a):T?(P=k?o:P,y=M?a:y,_=c-1,S=(y-P)/_):(_=(y-P)/S,Ui(_,Math.round(_),S/1e3)?_=Math.round(_):_=Math.ceil(_));const C=Math.max(Pc(S),Pc(P));E=Math.pow(10,at(l)?C:l),P=Math.round(P*E)/E,y=Math.round(y*E)/E;let R=0;for(k&&(f&&P!==o?(e.push({value:o}),P<o&&R++,Ui(Math.round((P+R*S)*E)/E,o,Md(o,v,n))&&R++):P<o&&R++);R<_;++R){const L=Math.round((P+R*S)*E)/E;if(M&&L>a)break;e.push({value:L})}return M&&f&&y!==a?e.length&&Ui(e[e.length-1].value,a,Md(a,v,n))?e[e.length-1].value=a:e.push({value:a}):(!M||y===a)&&e.push({value:y}),e}function Md(n,t,{horizontal:e,minRotation:i}){const s=$t(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Pr extends jn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return at(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=We(s),c=We(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=v0(s,r);return t.bounds==="ticks"&&Cc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Gi(t,this.chart.options.locale,this.options.ticks.format)}}class ya extends Pr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?t:0,this.max=Rt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=$t(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}O(ya,"id","linear"),O(ya,"defaults",{ticks:{callback:or.formatters.numeric}});const fs=n=>Math.floor(bn(n)),$n=(n,t)=>Math.pow(10,fs(n)+t);function kd(n){return n/Math.pow(10,fs(n))===1}function Sd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function M0(n,t){const e=t-n;let i=fs(e);for(;Sd(n,t,i)>10;)i++;for(;Sd(n,t,i)<10;)i--;return Math.min(i,fs(n))}function k0(n,{min:t,max:e}){t=Me(n.min,t);const i=[],s=fs(t);let r=M0(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((c-u)/Math.pow(10,r)),f=Me(n.min,Math.round((l+u+h*Math.pow(10,r))*o)/o);for(;f<e;)i.push({value:f,major:kd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,o=r>=0?1:o),f=Math.round((l+u+h*Math.pow(10,r))*o)/o;const m=Me(n.max,f);return i.push({value:m,major:kd(m),significand:h}),i}class ba extends jn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Pr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?Math.max(0,t):null,this.max=Rt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rt(this._userMin)&&(this.min=t===$n(this.min,0)?$n(this.min,-1):$n(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r($n(i,-1)),o($n(s,1)))),i<=0&&r($n(s,-1)),s<=0&&o($n(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=k0(e,this);return t.bounds==="ticks"&&Cc(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Gi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=bn(t),this._valueRange=bn(this.max)-bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}O(ba,"id","logarithmic"),O(ba,"defaults",{ticks:{callback:or.formatters.logarithmic,major:{enabled:!0}}});function _a(n){const t=n.ticks;if(t.display&&n.display){const e=Ut(t.backdropPadding);return lt(t.font&&t.font.size,At.font.size)+e.height}return 0}function S0(n,t,e){return e=kt(e)?e:[e],{w:Ig(n,t.string,e),h:e.length*t.lineHeight}}function Dd(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function D0(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?ht/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),h=It(c.font),f=S0(n.ctx,h,n._pointLabels[l]);i[l]=f;const m=se(n.getIndexAngle(l)+a),g=Math.round(ir(m)),b=Dd(g,u.x,f.w,0,180),x=Dd(g,u.y,f.h,90,270);T0(e,t,m,b,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=O0(n,i,s)}function T0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function C0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(ir(se(l.angle+Et))),u=R0(l.y,a.h,c),h=E0(c),f=A0(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+a.w,bottom:u+a.h}}function P0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Je({x:e,y:i},t)||Je({x:e,y:r},t)||Je({x:s,y:i},t)||Je({x:s,y:r},t))}function O0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:_a(r)/2,additionalAngle:o?ht/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=C0(n,u,l);i.push(h),a==="auto"&&(h.visible=P0(h,c),h.visible&&(c=h))}return i}function E0(n){return n===0||n===180?"center":n<180?"left":"right"}function A0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function R0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function I0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!at(a)){const l=xn(t.borderRadius),c=Ut(t.backdropPadding);n.fillStyle=a;const u=i-c.left,h=s-c.top,f=r-i+c.width,m=o-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),hi(n,{x:u,y:h,w:f,h:m,radius:l}),n.fill()):n.fillRect(u,h,f,m)}}function L0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));I0(e,o,r);const a=It(o.font),{x:l,y:c,textAlign:u}=r;Hn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Td(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ot);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function N0(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Td(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function F0(n,t,e){return wn(n,{label:e,index:t,type:"pointLabel"})}class ms extends Pr{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ut(_a(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Rt(t)&&!isNaN(t)?t:0,this.max=Rt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/_a(this.options))}generateTickLabels(t){Pr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=St(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?D0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=Ot/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*e+$t(i))}getDistanceFromCenterForValue(t){if(at(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(at(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return F0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Et+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Td(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&L0(this,o),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),g=r.setContext(f);N0(this,m,l,o,g)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=It(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const h=Ut(c.backdropPadding);t.fillRect(-o/2-h.left,-r-u.size/2-h.top,o+h.width,u.size+h.height)}Hn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}O(ms,"id","radialLinear"),O(ms,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:or.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),O(ms,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),O(ms,"descriptors",{angleLines:{_fallback:"grid"}});const Or={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ye=Object.keys(Or);function Cd(n,t){return n-t}function Pd(n,t){if(at(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Rt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(_n(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function Od(n,t,e,i){const s=ye.length;for(let r=ye.indexOf(n);r<s-1;++r){const o=Or[ye[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ye[r]}return ye[s-1]}function z0(n,t,e,i,s){for(let r=ye.length-1;r>=ye.indexOf(e);r--){const o=ye[r];if(Or[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ye[e?ye.indexOf(e):0]}function B0(n){for(let t=ye.indexOf(n)+1,e=ye.length;t<e;++t)if(Or[ye[t]].common)return ye[t]}function Ed(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Lo(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function H0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function Ad(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:H0(n,i,s,e)}class gs extends jn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new wu._date(t.adapters.date);s.init(e),$i(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Pd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Rt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Rt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=wg(s,r,o);return this._unit=e.unit||(i.autoSkip?Od(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):z0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:B0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Ad(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Qt(e,0,o),i=Qt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||Od(r.minUnit,e,i,this._getLabelCapacity(e)),a=lt(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=_n(l)||l===!0,u={};let h=e,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,a,o),m++)Ed(u,f,g);return(f===i||s.bounds==="ticks"||m===1)&&Ed(u,f,g),Object.keys(u).sort(Cd).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return St(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],f=i[e],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=$t(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Ad(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Pd(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ac(t.sort(Cd))}}O(gs,"id","time"),O(gs,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Er(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Qe(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Qe(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class xa extends gs{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Er(e,this.min),this._tableRange=Er(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Er(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Er(this._table,i*this._tableRange+this._minPos,!0)}}O(xa,"id","timeseries"),O(xa,"defaults",gs.defaults);var W0=Object.freeze({__proto__:null,CategoryScale:pa,LinearScale:ya,LogarithmicScale:ba,RadialLinearScale:ms,TimeScale:gs,TimeSeriesScale:xa});const V0=[Kp,kb,b0,W0],Rd=6048e5,Y0=864e5,ps=6e4,yi=36e5,j0=1e3,Id=Symbol.for("constructDateFrom");function Ft(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Id in n?n[Id](t):n instanceof Date?new n.constructor(t):new Date(t)}function dt(n,t){return Ft(t||n,n)}function Ar(n,t,e){const i=dt(n,e==null?void 0:e.in);return isNaN(t)?Ft((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function wa(n,t,e){const i=dt(n,e==null?void 0:e.in);if(isNaN(t))return Ft(n,NaN);if(!t)return i;const s=i.getDate(),r=Ft(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function va(n,t,e){return Ft(n,+dt(n)+t)}function $0(n,t,e){return va(n,t*yi)}let U0={};function Un(){return U0}function je(n,t){var a,l,c,u;const e=Un(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=dt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function bi(n,t){return je(n,{...t,weekStartsOn:1})}function Ld(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ft(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=bi(s),o=Ft(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=bi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Rr(n){const t=dt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function qn(n,...t){const e=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ma(n,t){const e=dt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Nd(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=Ma(i),o=Ma(s),a=+r-Rr(r),l=+o-Rr(o);return Math.round((a-l)/Y0)}function q0(n,t){const e=Ld(n,t),i=Ft(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),bi(i)}function X0(n,t,e){const i=dt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ps),i}function G0(n,t,e){return wa(n,t*3,e)}function K0(n,t,e){return va(n,t*1e3)}function Z0(n,t,e){return Ar(n,t*7,e)}function Q0(n,t,e){return wa(n,t*12,e)}function ys(n,t){const e=+dt(n)-+dt(t);return e<0?-1:e>0?1:e}function J0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ka(n){return!(!J0(n)&&typeof n!="number"||isNaN(+dt(n)))}function t_(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function e_(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Fd(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=zd(i,s),o=Math.abs(Nd(i,s));i.setDate(i.getDate()-r*o);const a=+(zd(i,s)===-r),l=r*(o-a);return l===0?0:l}function zd(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function bs(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function n_(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=(+i-+s)/yi;return bs(e==null?void 0:e.roundingMethod)(r)}function Sa(n,t){return+dt(n)-+dt(t)}function i_(n,t,e){const i=Sa(n,t)/ps;return bs(e==null?void 0:e.roundingMethod)(i)}function Bd(n,t){const e=dt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Hd(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function s_(n,t){const e=dt(n,t==null?void 0:t.in);return+Bd(e,t)==+Hd(e,t)}function Wd(n,t,e){const[i,s,r]=qn(e==null?void 0:e.in,n,n,t),o=ys(s,r),a=Math.abs(t_(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ys(s,r)===-o;s_(i)&&a===1&&ys(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function r_(n,t,e){const i=Wd(n,t,e)/3;return bs(e==null?void 0:e.roundingMethod)(i)}function o_(n,t,e){const i=Sa(n,t)/1e3;return bs(e==null?void 0:e.roundingMethod)(i)}function a_(n,t,e){const i=Fd(n,t,e)/7;return bs(e==null?void 0:e.roundingMethod)(i)}function l_(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=ys(i,s),o=Math.abs(e_(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ys(i,s)===-r,l=r*(o-+a);return l===0?0:l}function c_(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function u_(n,t){const e=dt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function d_(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Vd(n,t){const e=dt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function h_(n,t){const e=dt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function f_(n,t){var a,l;const e=Un(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=dt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function m_(n,t){const e=dt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function g_(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function p_(n,t){const e=dt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const y_={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"}},b_=(n,t,e)=>{let i;const s=y_[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Da(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const __={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},x_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},w_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},v_={date:Da({formats:__,defaultWidth:"full"}),time:Da({formats:x_,defaultWidth:"full"}),dateTime:Da({formats:w_,defaultWidth:"full"})},M_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},k_=(n,t,e,i)=>M_[n];function _s(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const S_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},D_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},T_={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"]},C_={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"]},P_={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"}},O_={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"}},E_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:_s({values:S_,defaultWidth:"wide"}),quarter:_s({values:D_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:_s({values:T_,defaultWidth:"wide"}),day:_s({values:C_,defaultWidth:"wide"}),dayPeriod:_s({values:P_,defaultWidth:"wide",formattingValues:O_,defaultFormattingWidth:"wide"})};function xs(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?R_(a,h=>h.test(o)):A_(a,h=>h.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function A_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function R_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function I_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const L_=/^(\d+)(th|st|nd|rd)?/i,N_=/\d+/i,F_={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},z_={any:[/^b/i,/^(a|c)/i]},B_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},H_={any:[/1/i,/2/i,/3/i,/4/i]},W_={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},V_={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]},Y_={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},j_={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]},$_={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},U_={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}},q_={ordinalNumber:I_({matchPattern:L_,parsePattern:N_,valueCallback:n=>parseInt(n,10)}),era:xs({matchPatterns:F_,defaultMatchWidth:"wide",parsePatterns:z_,defaultParseWidth:"any"}),quarter:xs({matchPatterns:B_,defaultMatchWidth:"wide",parsePatterns:H_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:xs({matchPatterns:W_,defaultMatchWidth:"wide",parsePatterns:V_,defaultParseWidth:"any"}),day:xs({matchPatterns:Y_,defaultMatchWidth:"wide",parsePatterns:j_,defaultParseWidth:"any"}),dayPeriod:xs({matchPatterns:$_,defaultMatchWidth:"any",parsePatterns:U_,defaultParseWidth:"any"})},Yd={code:"en-US",formatDistance:b_,formatLong:v_,formatRelative:k_,localize:E_,match:q_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function X_(n,t){const e=dt(n,t==null?void 0:t.in);return Nd(e,Vd(e))+1}function jd(n,t){const e=dt(n,t==null?void 0:t.in),i=+bi(e)-+q0(e);return Math.round(i/Rd)+1}function Ta(n,t){var u,h,f,m;const e=dt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Un(),r=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,o=Ft((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=je(o,t),l=Ft((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=je(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function G_(n,t){var a,l,c,u;const e=Un(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Ta(n,t),r=Ft((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),je(r,t)}function $d(n,t){const e=dt(n,t==null?void 0:t.in),i=+je(e,t)-+G_(e,t);return Math.round(i/Rd)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Sn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},_i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ud={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Sn.y(n,t)},Y:function(n,t,e,i){const s=Ta(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Tt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=Ld(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Sn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=$d(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=jd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Sn.d(n,t)},D:function(n,t,e){const i=X_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=_i.noon:i===0?s=_i.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=_i.evening:i>=12?s=_i.afternoon:i>=4?s=_i.morning:s=_i.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Sn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Sn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Sn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Sn.s(n,t)},S:function(n,t){return Sn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Xd(i);case"XXXX":case"XX":return Xn(i);case"XXXXX":case"XXX":default:return Xn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Xd(i);case"xxxx":case"xx":return Xn(i);case"xxxxx":case"xxx":default:return Xn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+qd(i,":");case"OOOO":default:return"GMT"+Xn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+qd(i,":");case"zzzz":default:return"GMT"+Xn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function qd(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function Xd(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Xn(n,t)}function Xn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Gd=(n,t)=>{switch(n){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"})}},Kd=(n,t)=>{switch(n){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"})}},Ca={p:Kd,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Gd(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Gd(i,t)).replace("{{time}}",Kd(s,t))}},K_=/^D+$/,Z_=/^Y+$/,Q_=["D","DD","YY","YYYY"];function Zd(n){return K_.test(n)}function Qd(n){return Z_.test(n)}function Pa(n,t,e){const i=J_(n,t,e);if(console.warn(i),Q_.includes(n))throw new RangeError(i)}function J_(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const tx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ex=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nx=/^'([^]*?)'?$/,ix=/''/g,sx=/[a-zA-Z]/;function Ir(n,t,e){var u,h,f,m,g,b,x,k;const i=Un(),s=(e==null?void 0:e.locale)??i.locale??Yd,r=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(f=i.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((b=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((k=(x=i.locale)==null?void 0:x.options)==null?void 0:k.weekStartsOn)??0,a=dt(n,e==null?void 0:e.in);if(!ka(a))throw new RangeError("Invalid time value");let l=t.match(ex).map(M=>{const T=M[0];if(T==="p"||T==="P"){const v=Ca[T];return v(M,s.formatLong)}return M}).join("").match(tx).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const T=M[0];if(T==="'")return{isToken:!1,value:rx(M)};if(Ud[T])return{isToken:!0,value:M};if(T.match(sx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const T=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Qd(T)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Zd(T))&&Pa(T,t,String(n));const v=Ud[T[0]];return v(a,T,s.localize,c)}).join("")}function rx(n){const t=n.match(nx);return t?t[1].replace(ix,"'"):n}function Jd(){return Object.assign({},Un())}function ox(n,t){const e=dt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function ax(n,t){const e=lx(t)?new t(0):Ft(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function lx(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const cx=10;class th{constructor(){O(this,"subPriority",0)}validate(t,e){return!0}}class ux extends th{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class dx extends th{constructor(e,i){super();O(this,"priority",cx);O(this,"subPriority",-1);this.context=e||(s=>Ft(i,s))}set(e,i){return i.timestampIsSet?e:Ft(e,ax(e,this.context))}}class vt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new ux(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class hx extends vt{constructor(){super(...arguments);O(this,"priority",140);O(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Vt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},$e={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Yt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*yi+r*ps+o*j0),rest:t.slice(e[0].length)}}function eh(n){return Lt(Vt.anyDigitsSigned,n)}function zt(n,t){switch(n){case 1:return Lt(Vt.singleDigit,t);case 2:return Lt(Vt.twoDigits,t);case 3:return Lt(Vt.threeDigits,t);case 4:return Lt(Vt.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Lr(n,t){switch(n){case 1:return Lt(Vt.singleDigitSigned,t);case 2:return Lt(Vt.twoDigitsSigned,t);case 3:return Lt(Vt.threeDigitsSigned,t);case 4:return Lt(Vt.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Oa(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function nh(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function ih(n){return n%400===0||n%4===0&&n%100!==0}class fx extends vt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return Yt(zt(4,e),r);case"yo":return Yt(s.ordinalNumber(e,{unit:"year"}),r);default:return Yt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=nh(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class mx extends vt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Yt(zt(4,e),r);case"Yo":return Yt(s.ordinalNumber(e,{unit:"year"}),r);default:return Yt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=Ta(e,r);if(s.isTwoDigitYear){const l=nh(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),je(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),je(e,r)}}class gx extends vt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Lr(i==="R"?4:i.length,e)}set(e,i,s){const r=Ft(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),bi(r)}}class px extends vt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Lr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class yx extends vt{constructor(){super(...arguments);O(this,"priority",120);O(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return zt(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class bx extends vt{constructor(){super(...arguments);O(this,"priority",120);O(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return zt(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class _x extends vt{constructor(){super(...arguments);O(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);O(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return Yt(Lt(Vt.month,e),r);case"MM":return Yt(zt(2,e),r);case"Mo":return Yt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class xx extends vt{constructor(){super(...arguments);O(this,"priority",110);O(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return Yt(Lt(Vt.month,e),r);case"LL":return Yt(zt(2,e),r);case"Lo":return Yt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function wx(n,t,e){const i=dt(n,e==null?void 0:e.in),s=$d(i,e)-t;return i.setDate(i.getDate()-s*7),dt(i,e==null?void 0:e.in)}class vx extends vt{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Vt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return je(wx(e,s,r),r)}}function Mx(n,t,e){const i=dt(n,e==null?void 0:e.in),s=jd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class kx extends vt{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Vt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return bi(Mx(e,s))}}const Sx=[31,28,31,30,31,30,31,31,30,31,30,31],Dx=[31,29,31,30,31,30,31,31,30,31,30,31];class Tx extends vt{constructor(){super(...arguments);O(this,"priority",90);O(this,"subPriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Vt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=ih(s),o=e.getMonth();return r?i>=1&&i<=Dx[o]:i>=1&&i<=Sx[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Cx extends vt{constructor(){super(...arguments);O(this,"priority",90);O(this,"subpriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Vt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear();return ih(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Ea(n,t,e){var h,f,m,g;const i=Un(),s=(e==null?void 0:e.weekStartsOn)??((f=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,r=dt(n,e==null?void 0:e.in),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Ar(r,u,e)}class Px extends vt{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ea(e,s,r),e.setHours(0,0,0,0),e}}class Ox extends vt{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Yt(zt(i.length,e),o);case"eo":return Yt(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ea(e,s,r),e.setHours(0,0,0,0),e}}class Ex extends vt{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Yt(zt(i.length,e),o);case"co":return Yt(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Ea(e,s,r),e.setHours(0,0,0,0),e}}function Ax(n,t,e){const i=dt(n,e==null?void 0:e.in),s=ox(i,e),r=t-s;return Ar(i,r,e)}class Rx extends vt{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return zt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Yt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Yt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Yt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Yt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=Ax(e,s),e.setHours(0,0,0,0),e}}class Ix extends vt{constructor(){super(...arguments);O(this,"priority",80);O(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Oa(s),0,0,0),e}}class Lx extends vt{constructor(){super(...arguments);O(this,"priority",80);O(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Oa(s),0,0,0),e}}class Nx extends vt{constructor(){super(...arguments);O(this,"priority",80);O(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Oa(s),0,0,0),e}}class Fx extends vt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Vt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class zx extends vt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Vt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class Bx extends vt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Vt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class Hx extends vt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Vt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class Wx extends vt{constructor(){super(...arguments);O(this,"priority",60);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Vt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class Vx extends vt{constructor(){super(...arguments);O(this,"priority",50);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Vt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class Yx extends vt{constructor(){super(...arguments);O(this,"priority",30);O(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Yt(zt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class jx extends vt{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ue($e.basicOptionalMinutes,e);case"XX":return Ue($e.basic,e);case"XXXX":return Ue($e.basicOptionalSeconds,e);case"XXXXX":return Ue($e.extendedOptionalSeconds,e);case"XXX":default:return Ue($e.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Rr(e)-s)}}class $x extends vt{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ue($e.basicOptionalMinutes,e);case"xx":return Ue($e.basic,e);case"xxxx":return Ue($e.basicOptionalSeconds,e);case"xxxxx":return Ue($e.extendedOptionalSeconds,e);case"xxx":default:return Ue($e.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Rr(e)-s)}}class Ux extends vt{constructor(){super(...arguments);O(this,"priority",40);O(this,"incompatibleTokens","*")}parse(e){return eh(e)}set(e,i,s){return[Ft(e,s*1e3),{timestampIsSet:!0}]}}class qx extends vt{constructor(){super(...arguments);O(this,"priority",20);O(this,"incompatibleTokens","*")}parse(e){return eh(e)}set(e,i,s){return[Ft(e,s),{timestampIsSet:!0}]}}const Xx={G:new hx,y:new fx,Y:new mx,R:new gx,u:new px,Q:new yx,q:new bx,M:new _x,L:new xx,w:new vx,I:new kx,d:new Tx,D:new Cx,E:new Px,e:new Ox,c:new Ex,i:new Rx,a:new Ix,b:new Lx,B:new Nx,h:new Fx,H:new zx,K:new Bx,k:new Hx,m:new Wx,s:new Vx,S:new Yx,X:new jx,x:new $x,t:new Ux,T:new qx},Gx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Kx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zx=/^'([^]*?)'?$/,Qx=/''/g,Jx=/\S/,tw=/[a-zA-Z]/;function ew(n,t,e,i){var x,k,M,T,v,S,E,P;const s=()=>Ft((i==null?void 0:i.in)||e,NaN),r=Jd(),o=(i==null?void 0:i.locale)??r.locale??Yd,a=(i==null?void 0:i.firstWeekContainsDate)??((k=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:k.firstWeekContainsDate)??r.firstWeekContainsDate??((T=(M=r.locale)==null?void 0:M.options)==null?void 0:T.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((S=(v=i==null?void 0:i.locale)==null?void 0:v.options)==null?void 0:S.weekStartsOn)??r.weekStartsOn??((P=(E=r.locale)==null?void 0:E.options)==null?void 0:P.weekStartsOn)??0;if(!t)return n?s():dt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new dx(i==null?void 0:i.in,e)],h=t.match(Kx).map(y=>{const _=y[0];if(_ in Ca){const C=Ca[_];return C(y,o.formatLong)}return y}).join("").match(Gx),f=[];for(let y of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&Qd(y)&&Pa(y,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Zd(y)&&Pa(y,t,n);const _=y[0],C=Xx[_];if(C){const{incompatibleTokens:R}=C;if(Array.isArray(R)){const I=f.find(B=>R.includes(B.token)||B.token===_);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${y}\` at the same time`)}else if(C.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);f.push({token:_,fullToken:y});const L=C.run(n,y,o.match,c);if(!L)return s();u.push(L.setter),n=L.rest}else{if(_.match(tw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(y==="''"?y="'":_==="'"&&(y=nw(y)),n.indexOf(y)===0)n=n.slice(y.length);else return s()}}if(n.length>0&&Jx.test(n))return s();const m=u.map(y=>y.priority).sort((y,_)=>_-y).filter((y,_,C)=>C.indexOf(y)===_).map(y=>u.filter(_=>_.priority===y).sort((_,C)=>C.subPriority-_.subPriority)).map(y=>y[0]);let g=dt(e,i==null?void 0:i.in);if(isNaN(+g))return s();const b={};for(const y of m){if(!y.validate(g,c))return s();const _=y.set(g,b,c);Array.isArray(_)?(g=_[0],Object.assign(b,_[1])):g=_}return g}function nw(n){return n.match(Zx)[1].replace(Qx,"'")}function iw(n,t){const e=dt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function sw(n,t){const e=dt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function rw(n,t){const e=dt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function ow(n){const t=n/yi;return Math.trunc(t)}function sh(n,t){const e=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=uw(n);let r;if(s.date){const c=dw(s.date,i);r=hw(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=fw(s.time),isNaN(a)))return e();if(s.timezone){if(l=mw(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=dt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return dt(o+a+l,t==null?void 0:t.in)}const Nr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},aw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,lw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,cw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function uw(n){const t={},e=n.split(Nr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Nr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Nr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Nr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function dw(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function hw(n,t){if(t===null)return new Date(NaN);const e=n.match(aw);if(!e)return new Date(NaN);const i=!!e[4],s=ws(e[1]),r=ws(e[2])-1,o=ws(e[3]),a=ws(e[4]),l=ws(e[5])-1;if(i)return _w(t,a,l)?gw(t,a,l):new Date(NaN);{const c=new Date(0);return!yw(t,r,o)||!bw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function ws(n){return n?parseInt(n):1}function fw(n){const t=n.match(lw);if(!t)return NaN;const e=Aa(t[1]),i=Aa(t[2]),s=Aa(t[3]);return xw(e,i,s)?e*yi+i*ps+s*1e3:NaN}function Aa(n){return n&&parseFloat(n.replace(",","."))||0}function mw(n){if(n==="Z")return 0;const t=n.match(cw);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return ww(i,s)?e*(i*yi+s*ps):NaN}function gw(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const pw=[31,null,31,30,31,30,31,31,30,31,30,31];function rh(n){return n%400===0||n%4===0&&n%100!==0}function yw(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(pw[t]||(rh(n)?29:28))}function bw(n,t){return t>=1&&t<=(rh(n)?366:365)}function _w(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function xw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function ww(n,t){return t>=0&&t<=59}const Fr=n=>["interactive","zoom-interactive"].includes(n),oh=(n,t,e,i)=>{var o,a;const{tooltip:s}=t;if(s.opacity===0&&!Fr(n.interactionMode)){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(s.body&&!Fr(n.interactionMode)){const l=s.labelColors,c=((a=(o=t.chart.config)==null?void 0:o.options)==null?void 0:a.indexAxis)==="y"?"x":"y";n.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(s.dataPoints[0].parsed.x,e):ks({tickValue:new Date(s.dataPoints[0].parsed.x),granularity:e}),n.tooltipSeries=s.dataPoints.map((u,h)=>{const f=u.parsed[c],m=Fh(f,n.units,{translateUnit:n.translateUnit}),g=u.dataset.label;return{backgroundColor:l[h].backgroundColor,borderColor:l[h].borderColor,label:g,value:m,rawValue:f,isSegmentEmpty:u.dataset.isSegmentEmpty}}).sort(r),n.left=`${s.x}px`,n.top=`${s.y}px`,n.showTooltip=!0}},ah=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!Fr(n.interactionMode)){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!Fr(n.interactionMode)){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["gauge","donut"].includes(n.chartType);l?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((c,u)=>{const h=l?c.parsed:c.parsed[a],f=Fh(h,n.units,{translateUnit:n.translateUnit});let m;return l?m=c.dataset.labels[c.dataIndex]:m=c.dataset.label,{backgroundColor:o[u].backgroundColor,borderColor:o[u].borderColor,label:m,value:f,rawValue:h,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},vw=n=>n&&n.datasets&&n.datasets.length,Mw=n=>vw(n)&&n.datasets.some(t=>t.data.length),kw=n=>n.datasets.some(t=>t.data[0]&&ka(t.data[0].x)),Sw=n=>!!Mw(n)&&n.datasets.some(t=>t.data.length==1),Dw=n=>kw(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Ra=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},Tw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Ia(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const lh=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},Cw=2,ch=10,uh=12,La=new Intl.NumberFormat(((Lm=document==null?void 0:document.documentElement)==null?void 0:Lm.lang)||"en-US"),zr=10,dh="#6c7489",Pw="#d60027",Na="#6c7489",Ow="#995c00",Ew="#ffc400",Fa="16px",Aw="20px",Rw="'Inter', Roboto, Helvetica, sans-serif",hh="24px",Iw="40px",Lw="48px",fh={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},sn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Br=(n,t)=>(t||sn)[n%sn.length],mh=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},gh="#6f7787",ph={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},Nw=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=ph[t])==null?void 0:e.background)||"#fafafa"},Fw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},zw={"4XX":"#FFBA81","5XX":"#FF8484"},Bw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},Hw="#dad4c7",yh="#afb7c5",Ww=n=>{const t=Object.entries(fh).find(([e])=>new RegExp(e).test(n));return t&&t[1]||fh.standard},za=(n,t,e,i)=>{let s;return e?s=yh:Array.isArray(i)?s=Br(n,i):s=i[t],s||Br(n)},Hr=n=>{switch(n){case"error":return Pw;case"warning":return Ew;case"neutral":return dh;default:return dh}},Vw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},Yw=2,jw=0,Ba=new Map,Ha=(n,t)=>t==="bytes"?Yr(n):t==="count/minute"?n.toFixed(2):La.format(n),bh=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},$w=()=>{const n="label_height";if(!Ba.has(n)){const t=It({});Ba.set(n,t.lineHeight)}return Ba.get(n)},Uw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),_h=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),xh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Wa="#e0e4ea",qw={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},vs=(n,t)=>{let e=1;const i=qw[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},wh=new Map([[100,vs("100",[100,101,102,103])],[200,vs("200",[200,201,202,203,204,205,206,207,208,226])],[300,vs("300",[300,301,302,303,304,305,307,308])],[400,vs("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,vs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Va=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=wh.get(e);return i===void 0?Wa:i.get(t)??i.get(-1)??Wa},Xw=n=>{const t=Va(n);return{solid:t,light:t}},Wr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Va(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function vh(n,t,e){const i=Jd(),s=Zw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Gw(s,t):Kw(s,t)}function Gw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Kw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Zw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Qw(n,t){const e=i1(t);return"formatToParts"in e?t1(e,n):e1(e,n)}const Jw={year:0,month:1,day:2,hour:3,minute:4,second:5};function t1(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Jw[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function e1(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Ya={},Mh=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")),n1=Mh==="06/25/2014, 00:00:00"||Mh==="06/25/2014 00:00:00";function i1(n){return Ya[n]||(Ya[n]=n1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ya[n]}function kh(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const Sh=36e5,s1=6e4,ja={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function $a(n,t,e){if(!n)return 0;let i=ja.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=ja.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Dh(s)?-(s*Sh):NaN;if(i=ja.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Dh(s,o)?(r=Math.abs(s)*Sh+o*s1,i[1]==="+"?-r:r):NaN}if(a1(n)){t=new Date(t||Date.now());const o=e?t:r1(t),a=Ua(o,n);return-(e?a:o1(t,a,n))}return NaN}function r1(n){return kh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ua(n,t){const e=Qw(n,t),i=kh(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function o1(n,t,e){let s=n.getTime()-t;const r=Ua(new Date(s),e);if(t===r)return t;s-=r-t;const o=Ua(new Date(s),e);return r===o?r:Math.max(r,o)}function Dh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Th={};function a1(n){if(Th[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Th[n]=!0,!0}catch{return!1}}const l1=60*1e3,c1={X:function(n,t,e){const i=qa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ch(i);case"XXXX":case"XX":return xi(i);case"XXXXX":case"XXX":default:return xi(i,":")}},x:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"x":return Ch(i);case"xxxx":case"xx":return xi(i);case"xxxxx":case"xxx":default:return xi(i,":")}},O:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+u1(i,":");case"OOOO":default:return"GMT"+xi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return vh("short",n,e);case"zzzz":default:return vh("long",n,e)}}};function qa(n,t){const e=n?$a(n,t,!0)/l1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Vr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function xi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Vr(Math.floor(i/60),2),r=Vr(Math.floor(i%60),2);return e+s+t+r}function Ch(n,t){return n%60===0?(n>0?"-":"+")+Vr(Math.abs(n)/60,2):xi(n,t)}function u1(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Vr(r,2)}function Ph(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const d1=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Xa=36e5,Oh=6e4,h1=2,ue={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:d1};function Eh(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?h1:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=f1(n),{year:s,restDateString:r}=m1(i.date,e),o=g1(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=p1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=$a(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=Ph(new Date(a+l)),c=Ph(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function f1(n){const t={};let e=ue.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ue.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function m1(n,t){if(n){const e=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ue.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function g1(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ue.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Ih(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ue.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return _1(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ue.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Ih(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ue.Www.exec(n),r)return s=parseInt(r[1],10)-1,Lh(s)?Ah(t,s):new Date(NaN);if(r=ue.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Lh(s,o)?Ah(t,s,o):new Date(NaN)}return null}function p1(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*Xa:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ga(t,e)?t%24*Xa+e*Oh:NaN;if(i=ue.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ga(t,e,s)?t%24*Xa+e*Oh+s*1e3:NaN}return null}function Ah(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const y1=[31,28,31,30,31,30,31,31,30,31,30,31],b1=[31,29,31,30,31,30,31,31,30,31,30,31];function Rh(n){return n%400===0||n%4===0&&n%100!==0}function Ih(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Rh(n);if(i&&e>b1[t]||!i&&e>y1[t])return!1}return!0}function _1(n,t){if(t<1)return!1;const e=Rh(n);return!(e&&t>366||!e&&t>365)}function Lh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ga(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const x1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ka(n,t,e={}){t=String(t);const i=t.match(x1);if(i){const s=Eh(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+c1[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Ir(n,t,e)}function w1(n,t,e){n=Eh(n,e);const i=$a(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Ms(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Ka(w1(n,t,{timeZone:i.timeZone}),e,i)}const v1=(n,t)=>`${Ms(n,t,"yyyy")} W${Ms(n,t,"II")}`,Za="yyyy-MM-dd h:mm:ss a",Qa="h:mm:ss a",Gn="yyyy-MM-dd h:mm a",wi="h:mm a",M1="yyyy-MM-dd",Ja="MMM dd, yyyy h:mm:ss a",Dn="MMM dd, yyyy h:mm a",k1={secondly:n=>n?Za:Qa,tenSecondly:n=>n?Za:Qa,thirtySecondly:n=>n?Za:Qa,minutely:n=>n?Gn:wi,fiveMinutely:n=>n?Gn:wi,tenMinutely:n=>n?Gn:wi,thirtyMinutely:n=>n?Gn:wi,hourly:n=>n?Gn:wi,twoHourly:n=>n?Gn:wi,twelveHourly:()=>Gn,daily:()=>M1},S1={secondly:()=>Ja,tenSecondly:()=>Ja,thirtySecondly:()=>Ja,minutely:()=>Dn,fiveMinutely:()=>Dn,tenMinutely:()=>Dn,thirtyMinutely:()=>Dn,hourly:()=>Dn,twoHourly:()=>Dn,twelveHourly:()=>Dn,daily:()=>Dn};function Nh({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:r,defaultFormat:o}){const a=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return v1(n,a);if(s&&s[t]){const l=s[t](i);return Ms(n,a,l)}if(r&&r[t]){const l=r[t]();return Ms(n,a,l)}return Ms(n,a,o)}const D1=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>Nh({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:k1,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ks=({tickValue:n,granularity:t,timezone:e})=>Nh({tickValue:n,granularity:t,timezone:e,tooltipMap:S1,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Yr=(n,t)=>{if(isNaN(n))return"0 B";const{i18n:e}=bt.useI18n(),i=t?0x4000000000000:1e15,s=t?1099511627776:1e12,r=t?1073741824:1e9,o=t?1048576:1e6,a=t?1024:1e3;let l;return n>=i?l=e.formatNumber(Number.parseFloat((n/i).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):n>=s?l=e.formatNumber(Number.parseFloat((n/s).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):n>=r?l=e.formatNumber(Number.parseFloat((n/r).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):n>=o?l=e.formatNumber(Number.parseFloat((n/o).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):n>=a?l=e.formatNumber(Number.parseFloat((n/a).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):l=e.formatNumber(Number.parseFloat(n.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),l.replace(/([a-zA-Z]*)$/," $1")},T1=(n,t="USD")=>{if(isNaN(n))return t==="USD"?"$0.00":`${n}`;const{i18n:e}=bt.useI18n();return n>=.01||t!=="USD"?e.formatNumber(n,{style:"currency",currency:t}):n<1e-4?"< $0.0001":`$${Number.parseFloat(n.toPrecision(4))}`},Fh=(n,t,{isBytes1024:e=!1,currency:i="USD",translateUnit:s=r=>r}={})=>{const r=s(t,n);switch(t){case"bytes":return Yr(n,e);case"usd":return T1(n,i);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(n)?`${n}`:n>=.01?`${La.format(Number.parseFloat(n.toFixed(2)))} ${r}`:`${Number.parseFloat(n.toPrecision(4))} ${r}`}},C1=n=>{var e,i,s,r,o;const{i18n:t}=bt.useI18n();return(n==null?void 0:n.status)===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(n==null?void 0:n.status)===408?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(e=n==null?void 0:n.response)==null?void 0:e.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:((o=(r=(s=n.response)==null?void 0:s.data)==null?void 0:r.invalid_parameters)==null?void 0:o.map(a=>a.reason).join(", "))||(n==null?void 0:n.message)}};function P1(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};ke.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=u.width/2,m=Ra(c,h,f),g=c.y,b=c.x<f?"left":"center";return{x:m-n.tooltipState.offsetX,y:g-n.tooltipState.offsetY,xAlign:b}},ia.modes.customInteractionMode=function(l,c){const u=vn(c,l),h=[];return ia.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,g)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g})}),h};const s=n.numLabels.value>25?ch:uh,r=({chart:l,index:c})=>{var h;const u=l.data;return{size:s,style:(h=u==null?void 0:u.isLabelEmpty)!=null&&h[c]?"italic":"normal"}},o=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>zr?c.slice(0,zr)+"...":c):l.getLabelForValue(Number(c)),a=d.computed(()=>{var l,c,u,h,f,m,g,b;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:r,callback:function(x,k){return o(this,x,k)}},title:{display:n.indexAxis==="y"?!at((l=n.metricAxesTitle)==null?void 0:l.value):!at((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(h=n.dimensionAxesTitle)==null?void 0:h.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(x,k){return o(this,x,k)}},title:{display:n.indexAxis==="x"?!at((f=n.metricAxesTitle)==null?void 0:f.value):!at((m=n.dimensionAxesTitle)==null?void 0:m.value),text:n.indexAxis==="x"?(g=n.metricAxesTitle)==null?void 0:g.value:(b=n.dimensionAxesTitle)==null?void 0:b.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{ah(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return d.getCurrentInstance()&&d.onUnmounted(()=>{ke.positioners[e]&&delete ke.positioners[e]}),a}Ce.register(...V0);const O1=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function E1(n,t,e,i,s){const r=d.shallowRef(null),o=(a,l)=>{if(t.value)return new Ce(t.value,{type:n,data:a,plugins:i,options:l})};return d.onMounted(()=>{r.value=o(e.value,s.value)}),d.onBeforeUnmount(()=>{at(r.value)||r.value.destroy()}),d.watch(e,(a,l)=>{if(O1(l,a)&&!at(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else at(r.value)||r.value.destroy(),r.value=o(a,s.value)}),d.watch(t,()=>{at(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),d.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(at(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,b){b&&b%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<o?h=e(c,r,u)+"m":c<a?h=t(e(c,o,u),u)+"b":h=t(e(c,a,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(zh);var A1=zh.exports;const Ss=tl(A1);function R1(n,t,e){const{i18n:i}=bt.useI18n(),{translateUnit:s}=bt.useTranslatedUnits();return{legendValues:d.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,h)=>u+(typeof h=="number"?Number(h)||0:Number(h&&h.y)||0),0);let c;if(e.value==="bytes")c=Yr(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:Ss(l,{capital:!0}),unit:u})||`${Ss(l,{capital:!0})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var I1=Object.defineProperty,L1=(n,t,e)=>t in n?I1(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Pe=(n,t,e)=>L1(n,typeof t!="symbol"?t+"":t,e);const N1=250;var yt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(yt||{});const F1=["in","not_in","selector"],z1=["empty","not_empty"],B1=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ds=n=>n.filter(t=>t!=="time"),Bh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Hh=Ds(Bh),H1=[...Bh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Wh=Ds(H1),W1=["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"],Vh=Ds(W1);Ds(["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","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"]),Ds(["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"]),new Set(Hh),new Set(Wh),new Set(Vh);const Yh=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];Yh.map(n=>n.code),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:F1},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:z1}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Wh,...Hh,...Vh])]);const jh=6048e5,V1=864e5,Y1=60,j1=3600,$h=Symbol.for("constructDateFrom");function Oe(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&$h in n?n[$h](t):n instanceof Date?new n.constructor(t):new Date(t)}function de(n,t){return Oe(t||n,n)}function Uh(n,t,e){const i=de(n,void 0);return isNaN(t)?Oe(n,NaN):(i.setDate(i.getDate()+t),i)}function $1(n,t,e){const i=de(n,void 0);if(isNaN(t))return Oe(n,NaN);const s=i.getDate(),r=Oe(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let U1={};function Ts(){return U1}function rn(n,t){var e,i,s,r;const o=Ts(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=de(n,t==null?void 0:t.in),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function jr(n,t){return rn(n,{...t,weekStartsOn:1})}function qh(n,t){const e=de(n,void 0),i=e.getFullYear(),s=Oe(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=jr(s),o=Oe(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=jr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Xh(n){const t=de(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function q1(n,...t){const e=Oe.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function $r(n,t){const e=de(n,void 0);return e.setHours(0,0,0,0),e}function X1(n,t,e){const[i,s]=q1(void 0,n,t),r=$r(i),o=$r(s),a=+r-Xh(r),l=+o-Xh(o);return Math.round((a-l)/V1)}function G1(n,t){const e=qh(n),i=Oe(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),jr(i)}function K1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Z1(n){return!(!K1(n)&&typeof n!="number"||isNaN(+de(n)))}function vi(n,t){const e=de(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function Q1(n,t){const e=de(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const J1={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"}},tv=(n,t,e)=>{let i;const s=J1[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function el(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const ev={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},iv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},sv={date:el({formats:ev,defaultWidth:"full"}),time:el({formats:nv,defaultWidth:"full"}),dateTime:el({formats:iv,defaultWidth:"full"})},rv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ov=(n,t,e,i)=>rv[n];function Cs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const av={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lv={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cv={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"]},uv={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"]},dv={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"}},hv={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"}},fv=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},mv={ordinalNumber:fv,era:Cs({values:av,defaultWidth:"wide"}),quarter:Cs({values:lv,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Cs({values:cv,defaultWidth:"wide"}),day:Cs({values:uv,defaultWidth:"wide"}),dayPeriod:Cs({values:dv,defaultWidth:"wide",formattingValues:hv,defaultFormattingWidth:"wide"})};function Ps(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?pv(a,h=>h.test(o)):gv(a,h=>h.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function gv(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function pv(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function yv(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const bv=/^(\d+)(th|st|nd|rd)?/i,_v=/\d+/i,xv={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},wv={any:[/^b/i,/^(a|c)/i]},vv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Mv={any:[/1/i,/2/i,/3/i,/4/i]},kv={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},Sv={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]},Dv={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},Tv={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]},Cv={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},Pv={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}},Ov={ordinalNumber:yv({matchPattern:bv,parsePattern:_v,valueCallback:n=>parseInt(n,10)}),era:Ps({matchPatterns:xv,defaultMatchWidth:"wide",parsePatterns:wv,defaultParseWidth:"any"}),quarter:Ps({matchPatterns:vv,defaultMatchWidth:"wide",parsePatterns:Mv,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ps({matchPatterns:kv,defaultMatchWidth:"wide",parsePatterns:Sv,defaultParseWidth:"any"}),day:Ps({matchPatterns:Dv,defaultMatchWidth:"wide",parsePatterns:Tv,defaultParseWidth:"any"}),dayPeriod:Ps({matchPatterns:Cv,defaultMatchWidth:"any",parsePatterns:Pv,defaultParseWidth:"any"})},Ev={code:"en-US",formatDistance:tv,formatLong:sv,formatRelative:ov,localize:mv,match:Ov,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Av(n,t){const e=de(n,void 0);return X1(e,Q1(e))+1}function Rv(n,t){const e=de(n,void 0),i=+jr(e)-+G1(e);return Math.round(i/jh)+1}function Gh(n,t){var e,i,s,r;const o=de(n,t==null?void 0:t.in),a=o.getFullYear(),l=Ts(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Oe((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const h=rn(u,t),f=Oe((t==null?void 0:t.in)||n,0);f.setFullYear(a,0,c),f.setHours(0,0,0,0);const m=rn(f,t);return+o>=+h?a+1:+o>=+m?a:a-1}function Iv(n,t){var e,i,s,r;const o=Ts(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Gh(n,t),c=Oe((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),rn(c,t)}function Lv(n,t){const e=de(n,t==null?void 0:t.in),i=+rn(e,t)-+Iv(e,t);return Math.round(i/jh)+1}function Ct(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Tn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Ct(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Ct(e+1,2)},d(n,t){return Ct(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Ct(n.getHours()%12||12,t.length)},H(n,t){return Ct(n.getHours(),t.length)},m(n,t){return Ct(n.getMinutes(),t.length)},s(n,t){return Ct(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Ct(s,t.length)}},Mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Tn.y(n,t)},Y:function(n,t,e,i){const s=Gh(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Ct(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Ct(r,t.length)},R:function(n,t){const e=qh(n);return Ct(e,t.length)},u:function(n,t){const e=n.getFullYear();return Ct(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ct(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ct(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Tn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Ct(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Lv(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Ct(s,t.length)},I:function(n,t,e){const i=Rv(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Ct(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Tn.d(n,t)},D:function(n,t,e){const i=Av(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Ct(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Ct(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Ct(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Ct(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Mi.noon:i===0?s=Mi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Mi.evening:i>=12?s=Mi.afternoon:i>=4?s=Mi.morning:s=Mi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Tn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Tn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Tn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Tn.s(n,t)},S:function(n,t){return Tn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Qh(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Qh(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zh(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zh(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Ct(i,t.length)},T:function(n,t,e){return Ct(+n,t.length)}};function Zh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Ct(r,2)}function Qh(n,t){return n%60===0?(n>0?"-":"+")+Ct(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ct(Math.trunc(i/60),2),r=Ct(i%60,2);return e+s+t+r}const Jh=(n,t)=>{switch(n){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"})}},tf=(n,t)=>{switch(n){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"})}},Nv=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Jh(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Jh(i,t)).replace("{{time}}",tf(s,t))},Fv={p:tf,P:Nv},zv=/^D+$/,Bv=/^Y+$/,Hv=["D","DD","YY","YYYY"];function Wv(n){return zv.test(n)}function Vv(n){return Bv.test(n)}function Yv(n,t,e){const i=jv(n,t,e);if(console.warn(i),Hv.includes(n))throw new RangeError(i)}function jv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $v=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Uv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qv=/^'([^]*?)'?$/,Xv=/''/g,Gv=/[a-zA-Z]/;function Kv(n,t,e){var i,s,r,o,a,l,c,u;const h=Ts(),f=(e==null?void 0:e.locale)??h.locale??Ev,m=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??h.firstWeekContainsDate??((o=(r=h.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,g=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??h.weekStartsOn??((u=(c=h.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,b=de(n,e==null?void 0:e.in);if(!Z1(b))throw new RangeError("Invalid time value");let x=t.match(Uv).map(M=>{const T=M[0];if(T==="p"||T==="P"){const v=Fv[T];return v(M,f.formatLong)}return M}).join("").match($v).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const T=M[0];if(T==="'")return{isToken:!1,value:Zv(M)};if(Kh[T])return{isToken:!0,value:M};if(T.match(Gv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:M}});f.localize.preprocessor&&(x=f.localize.preprocessor(b,x));const k={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(M=>{if(!M.isToken)return M.value;const T=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Vv(T)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Wv(T))&&Yv(T,t,String(n));const v=Kh[T[0]];return v(b,T,f.localize,k)}).join("")}function Zv(n){const t=n.match(qv);return t?t[1].replace(Xv,"'"):n}function Qv(n,t){const e=de(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Oe(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function Jv(){return Object.assign({},Ts())}function tM(n){return Math.trunc(n*j1)}function eM(n){const t=n/Y1;return Math.trunc(t)}function ef(n,t,e){return $1(n,-1)}function nf(n,t,e){const i=Jv(),s=sM(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?nM(s,t):iM(s,t)}function nM(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function iM(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function sM(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function rM(n,t){const e=uM(t);return"formatToParts"in e?aM(e,n):lM(e,n)}const oM={year:0,month:1,day:2,hour:3,minute:4,second:5};function aM(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=oM[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function lM(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const nl={},sf=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")),cM=sf==="06/25/2014, 00:00:00"||sf==="06/25/2014 00:00:00";function uM(n){return nl[n]||(nl[n]=cM?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),nl[n]}function il(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const rf=36e5,dM=6e4,sl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Os(n,t,e){if(!n)return 0;let i=sl.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=sl.timezoneHH.exec(n),i)return s=parseInt(i[1],10),of(s)?-(s*rf):NaN;if(i=sl.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return of(s,o)?(r=Math.abs(s)*rf+o*dM,i[1]==="+"?-r:r):NaN}if(mM(n)){t=new Date(t||Date.now());const o=e?t:hM(t),a=rl(o,n);return-(e?a:fM(t,a,n))}return NaN}function hM(n){return il(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function rl(n,t){const e=rM(n,t),i=il(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function fM(n,t,e){let i=n.getTime()-t;const s=rl(new Date(i),e);if(t===s)return t;i-=s-t;const r=rl(new Date(i),e);return s===r?s:Math.max(s,r)}function of(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const af={};function mM(n){if(af[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),af[n]=!0,!0}catch{return!1}}const gM=60*1e3,pM={X:function(n,t,e){const i=ol(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return lf(i);case"XXXX":case"XX":return ki(i);case"XXXXX":case"XXX":default:return ki(i,":")}},x:function(n,t,e){const i=ol(e.timeZone,n);switch(t){case"x":return lf(i);case"xxxx":case"xx":return ki(i);case"xxxxx":case"xxx":default:return ki(i,":")}},O:function(n,t,e){const i=ol(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+yM(i,":");case"OOOO":default:return"GMT"+ki(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return nf("short",n,e);case"zzzz":default:return nf("long",n,e)}}};function ol(n,t){const e=n?Os(n,t,!0)/gM:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ur(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function ki(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ur(Math.floor(i/60),2),r=Ur(Math.floor(i%60),2);return e+s+t+r}function lf(n,t){return n%60===0?(n>0?"-":"+")+Ur(Math.abs(n)/60,2):ki(n,t)}function yM(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Ur(r,2)}function cf(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const uf=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,al=36e5,df=6e4,bM=2,he={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:uf};function qr(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?bM:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=_M(n),{year:s,restDateString:r}=xM(i.date,e),o=wM(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=vM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Os(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=cf(new Date(a+l)),c=cf(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function _M(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function xM(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function wM(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,mf(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return SM(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return mf(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,gf(s)?hf(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return gf(s,o)?hf(t,s,o):new Date(NaN)}return null}function vM(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ll(t)?t%24*al:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ll(t,e)?t%24*al+e*df:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ll(t,e,s)?t%24*al+e*df+s*1e3:NaN}return null}function hf(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const MM=[31,28,31,30,31,30,31,31,30,31,30,31],kM=[31,29,31,30,31,30,31,31,30,31,30,31];function ff(n){return n%400===0||n%4===0&&n%100!==0}function mf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=ff(n);if(i&&e>kM[t]||!i&&e>MM[t])return!1}return!0}function SM(n,t){if(t<1)return!1;const e=ff(n);return!(e&&t>366||!e&&t>365)}function gf(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ll(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const DM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function TM(n,t,e={}){t=String(t);const i=t.match(DM);if(i){const s=qr(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+pM[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Kv(n,t,e)}function pf(n,t,e){n=qr(n,e);const i=Os(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function CM(n,t,e,i){return i={...i,timeZone:t,originalDate:n},TM(pf(n,t,{timeZone:i.timeZone}),e,i)}function PM(n,t,e){if(typeof n=="string"&&!n.match(uf))return qr(n,{...e,timeZone:t});n=qr(n,e);const i=il(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Os(t,new Date(i));return new Date(i+s)}function OM(n,t){return-Os(n,t)}function cl(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return CM(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const EM={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 ul(n){return n&&B1.find(t=>n<=EM[t])||null}var Xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Gr={exports:{}};Gr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",g="[object Object]",b="[object Promise]",x="[object RegExp]",k="[object Set]",M="[object String]",T="[object Symbol]",v="[object WeakMap]",S="[object ArrayBuffer]",E="[object DataView]",P="[object Float32Array]",y="[object Float64Array]",_="[object Int8Array]",C="[object Int16Array]",R="[object Int32Array]",L="[object Uint8Array]",I="[object Uint8ClampedArray]",B="[object Uint16Array]",q="[object Uint32Array]",tt=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,ct=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,J={};J[r]=J[o]=J[S]=J[E]=J[a]=J[l]=J[P]=J[y]=J[_]=J[C]=J[R]=J[f]=J[m]=J[g]=J[x]=J[k]=J[M]=J[T]=J[L]=J[I]=J[B]=J[q]=!0,J[c]=J[u]=J[v]=!1;var et=typeof Xr=="object"&&Xr&&Xr.Object===Object&&Xr,X=typeof self=="object"&&self&&self.Object===Object&&self,j=et||X||Function("return this")(),$=t&&!t.nodeType&&t,K=$&&!0&&n&&!n.nodeType&&n,_t=K&&K.exports===$;function gt(w,A){return w.set(A[0],A[1]),w}function pt(w,A){return w.add(A),w}function z(w,A){for(var F=-1,G=w?w.length:0;++F<G&&A(w[F],F,w)!==!1;);return w}function Y(w,A){for(var F=-1,G=A.length,jt=w.length;++F<G;)w[jt+F]=A[F];return w}function W(w,A,F,G){for(var jt=-1,Kt=w?w.length:0;++jt<Kt;)F=A(F,w[jt],jt,w);return F}function Q(w,A){for(var F=-1,G=Array(w);++F<w;)G[F]=A(F);return G}function nt(w,A){return w==null?void 0:w[A]}function it(w){var A=!1;if(w!=null&&typeof w.toString!="function")try{A=!!(w+"")}catch{}return A}function rt(w){var A=-1,F=Array(w.size);return w.forEach(function(G,jt){F[++A]=[jt,G]}),F}function st(w,A){return function(F){return w(A(F))}}function wt(w){var A=-1,F=Array(w.size);return w.forEach(function(G){F[++A]=G}),F}var ut=Array.prototype,Pt=Function.prototype,te=Object.prototype,ae=j["__core-js_shared__"],qt=function(){var w=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Ee=Pt.toString,Mt=te.hasOwnProperty,Xt=te.toString,Bt=RegExp("^"+Ee.call(Mt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=_t?j.Buffer:void 0,ie=j.Symbol,qe=j.Uint8Array,ni=st(Object.getPrototypeOf,Object),Fe=Object.create,Ht=te.propertyIsEnumerable,_e=ut.splice,ii=Object.getOwnPropertySymbols,uo=Gt?Gt.isBuffer:void 0,ho=st(Object.keys,Object),zs=In(j,"DataView"),si=In(j,"Map"),Bs=In(j,"Promise"),ri=In(j,"Set"),an=In(j,"WeakMap"),ln=In(Object,"create"),Hs=le(zs),Ws=le(si),oi=le(Bs),Rl=le(ri),Il=le(an),fo=ie?ie.prototype:void 0,mo=fo?fo.valueOf:void 0;function cn(w){var A=-1,F=w?w.length:0;for(this.clear();++A<F;){var G=w[A];this.set(G[0],G[1])}}function Ai(){this.__data__=ln?ln(null):{}}function Vs(w){return this.has(w)&&delete this.__data__[w]}function go(w){var A=this.__data__;if(ln){var F=A[w];return F===i?void 0:F}return Mt.call(A,w)?A[w]:void 0}function un(w){var A=this.__data__;return ln?A[w]!==void 0:Mt.call(A,w)}function Ll(w,A){var F=this.__data__;return F[w]=ln&&A===void 0?i:A,this}cn.prototype.clear=Ai,cn.prototype.delete=Vs,cn.prototype.get=go,cn.prototype.has=un,cn.prototype.set=Ll;function ze(w){var A=-1,F=w?w.length:0;for(this.clear();++A<F;){var G=w[A];this.set(G[0],G[1])}}function Nl(){this.__data__=[]}function Fl(w){var A=this.__data__,F=Ii(A,w);if(F<0)return!1;var G=A.length-1;return F==G?A.pop():_e.call(A,F,1),!0}function zl(w){var A=this.__data__,F=Ii(A,w);return F<0?void 0:A[F][1]}function Be(w){return Ii(this.__data__,w)>-1}function Bl(w,A){var F=this.__data__,G=Ii(F,w);return G<0?F.push([w,A]):F[G][1]=A,this}ze.prototype.clear=Nl,ze.prototype.delete=Fl,ze.prototype.get=zl,ze.prototype.has=Be,ze.prototype.set=Bl;function An(w){var A=-1,F=w?w.length:0;for(this.clear();++A<F;){var G=w[A];this.set(G[0],G[1])}}function Hl(){this.__data__={hash:new cn,map:new(si||ze),string:new cn}}function Wl(w){return Fi(this,w).delete(w)}function Vl(w){return Fi(this,w).get(w)}function He(w){return Fi(this,w).has(w)}function Yl(w,A){return Fi(this,w).set(w,A),this}An.prototype.clear=Hl,An.prototype.delete=Wl,An.prototype.get=Vl,An.prototype.has=He,An.prototype.set=Yl;function Rn(w){this.__data__=new ze(w)}function jl(){this.__data__=new ze}function $l(w){return this.__data__.delete(w)}function Ul(w){return this.__data__.get(w)}function Ri(w){return this.__data__.has(w)}function ql(w,A){var F=this.__data__;if(F instanceof ze){var G=F.__data__;if(!si||G.length<e-1)return G.push([w,A]),this;F=this.__data__=new An(G)}return F.set(w,A),this}Rn.prototype.clear=jl,Rn.prototype.delete=$l,Rn.prototype.get=Ul,Rn.prototype.has=Ri,Rn.prototype.set=ql;function Xl(w,A){var F=Us(w)||Bi(w)?Q(w.length,String):[],G=F.length,jt=!!G;for(var Kt in w)Mt.call(w,Kt)&&!(jt&&(Kt=="length"||dc(Kt,G)))&&F.push(Kt);return F}function Ae(w,A,F){var G=w[A];(!(Mt.call(w,A)&&$s(G,F))||F===void 0&&!(A in w))&&(w[A]=F)}function Ii(w,A){for(var F=w.length;F--;)if($s(w[F][0],A))return F;return-1}function Gl(w,A){return w&&po(A,ai(A),w)}function Ys(w,A,F,G,jt,Kt,xe){var ee;if(G&&(ee=Kt?G(w,jt,Kt,xe):G(w)),ee!==void 0)return ee;if(!hn(w))return w;var Mo=Us(w);if(Mo){if(ee=cc(w),!A)return oc(w,ee)}else{var Ln=Xe(w),ko=Ln==u||Ln==h;if(xo(w))return tc(w,A);if(Ln==g||Ln==r||ko&&!Kt){if(it(w))return Kt?w:{};if(ee=bo(ko?{}:w),!A)return ac(w,Gl(ee,w))}else{if(!J[Ln])return Kt?w:{};ee=uc(w,Ln,Ys,A)}}xe||(xe=new Rn);var So=xe.get(w);if(So)return So;if(xe.set(w,ee),!Mo)var li=F?lc(w):ai(w);return z(li||w,function(Xs,Hi){li&&(Hi=Xs,Xs=w[Hi]),Ae(ee,Hi,Ys(Xs,A,F,G,Hi,w,xe))}),ee}function Kl(w){return hn(w)?Fe(w):{}}function Zl(w,A,F){var G=A(w);return Us(w)?G:Y(G,F(w))}function Ql(w){return Xt.call(w)}function Li(w){if(!hn(w)||hc(w))return!1;var A=qs(w)||it(w)?Bt:ct;return A.test(le(w))}function Jl(w){if(!dn(w))return ho(w);var A=[];for(var F in Object(w))Mt.call(w,F)&&F!="constructor"&&A.push(F);return A}function tc(w,A){if(A)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function Ni(w){var A=new w.constructor(w.byteLength);return new qe(A).set(new qe(w)),A}function ec(w,A){var F=A?Ni(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function nc(w,A,F){var G=A?F(rt(w),!0):rt(w);return W(G,gt,new w.constructor)}function js(w){var A=new w.constructor(w.source,V.exec(w));return A.lastIndex=w.lastIndex,A}function ic(w,A,F){var G=A?F(wt(w),!0):wt(w);return W(G,pt,new w.constructor)}function sc(w){return mo?Object(mo.call(w)):{}}function rc(w,A){var F=A?Ni(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function oc(w,A){var F=-1,G=w.length;for(A||(A=Array(G));++F<G;)A[F]=w[F];return A}function po(w,A,F,G){F||(F={});for(var jt=-1,Kt=A.length;++jt<Kt;){var xe=A[jt],ee=void 0;Ae(F,xe,ee===void 0?w[xe]:ee)}return F}function ac(w,A){return po(w,yo(w),A)}function lc(w){return Zl(w,ai,yo)}function Fi(w,A){var F=w.__data__;return zi(A)?F[typeof A=="string"?"string":"hash"]:F.map}function In(w,A){var F=nt(w,A);return Li(F)?F:void 0}var yo=ii?st(ii,Object):wo,Xe=Ql;(zs&&Xe(new zs(new ArrayBuffer(1)))!=E||si&&Xe(new si)!=f||Bs&&Xe(Bs.resolve())!=b||ri&&Xe(new ri)!=k||an&&Xe(new an)!=v)&&(Xe=function(w){var A=Xt.call(w),F=A==g?w.constructor:void 0,G=F?le(F):void 0;if(G)switch(G){case Hs:return E;case Ws:return f;case oi:return b;case Rl:return k;case Il:return v}return A});function cc(w){var A=w.length,F=w.constructor(A);return A&&typeof w[0]=="string"&&Mt.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function bo(w){return typeof w.constructor=="function"&&!dn(w)?Kl(ni(w)):{}}function uc(w,A,F,G){var jt=w.constructor;switch(A){case S:return Ni(w);case a:case l:return new jt(+w);case E:return ec(w,G);case P:case y:case _:case C:case R:case L:case I:case B:case q:return rc(w,G);case f:return nc(w,G,F);case m:case M:return new jt(w);case x:return js(w);case k:return ic(w,G,F);case T:return sc(w)}}function dc(w,A){return A=A??s,!!A&&(typeof w=="number"||U.test(w))&&w>-1&&w%1==0&&w<A}function zi(w){var A=typeof w;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?w!=="__proto__":w===null}function hc(w){return!!qt&&qt in w}function dn(w){var A=w&&w.constructor,F=typeof A=="function"&&A.prototype||te;return w===F}function le(w){if(w!=null){try{return Ee.call(w)}catch{}try{return w+""}catch{}}return""}function fc(w){return Ys(w,!0,!0)}function $s(w,A){return w===A||w!==w&&A!==A}function Bi(w){return mc(w)&&Mt.call(w,"callee")&&(!Ht.call(w,"callee")||Xt.call(w)==r)}var Us=Array.isArray;function _o(w){return w!=null&&gc(w.length)&&!qs(w)}function mc(w){return fn(w)&&_o(w)}var xo=uo||vo;function qs(w){var A=hn(w)?Xt.call(w):"";return A==u||A==h}function gc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function hn(w){var A=typeof w;return!!w&&(A=="object"||A=="function")}function fn(w){return!!w&&typeof w=="object"}function ai(w){return _o(w)?Xl(w):Jl(w)}function wo(){return[]}function vo(){return!1}n.exports=fc}(Gr,Gr.exports),Gr.exports;const Si=(n,t)=>new Date(n.getTime()-OM(t,n));class Ne{constructor(t){Pe(this,"timeframeText"),Pe(this,"key"),Pe(this,"display"),Pe(this,"timeframeLength"),Pe(this,"allowedTiers"),Pe(this,"defaultResponseGranularity"),Pe(this,"dataGranularity"),Pe(this,"isRelative"),Pe(this,"fineGrainedDefaultGranularity"),Pe(this,"_startCustom"),Pe(this,"_endCustom"),Pe(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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}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 e=PM(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return pf(e,t)}}class AM extends Ne{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Si(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class RM extends Ne{rawStart(t){let e=vi(this.tzAdjustedDate(t));return t&&(e=Si(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class IM extends Ne{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Si(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Si(i,t)),i}}class LM extends Ne{rawEnd(t){let e=vi(this.tzAdjustedDate(t));return t&&(e=Si(e,t)),e}rawStart(t){let e=vi(ef(this.tzAdjustedDate(t)));return t&&(e=Si(e,t)),e}}yt.FIFTEEN_MIN,new Ne({key:yt.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"]}),yt.ONE_HOUR,new Ne({key:yt.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"]}),yt.SIX_HOUR,new Ne({key:yt.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"]}),yt.TWELVE_HOUR,new Ne({key:yt.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"]}),yt.ONE_DAY,new Ne({key:yt.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"]}),yt.SEVEN_DAY,new Ne({key:yt.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"]}),yt.THIRTY_DAY,new Ne({key:yt.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"]}),yt.CURRENT_WEEK,new AM({key:yt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return($r(Uh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),yt.CURRENT_MONTH,new RM({key:yt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=vi(new Date);return($r(Uh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),yt.PREVIOUS_WEEK,new IM({key:yt.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"]}),yt.PREVIOUS_MONTH,new LM({key:yt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=vi(new Date),e=vi(ef(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=NM(t,e)),60*60*24*Qv(new Date().setMonth(new Date().getMonth()-1))+tM(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function NM(n,t){return eM(n.getTimezoneOffset()-t.getTimezoneOffset())}yt.FIFTEEN_MIN,yt.ONE_HOUR,yt.SIX_HOUR,yt.TWELVE_HOUR,yt.ONE_DAY,yt.SEVEN_DAY,yt.FIFTEEN_MIN,yt.ONE_HOUR,yt.SIX_HOUR,yt.TWELVE_HOUR,yt.ONE_DAY,yt.SEVEN_DAY,yt.THIRTY_DAY,yt.CURRENT_WEEK,yt.CURRENT_MONTH,yt.PREVIOUS_WEEK,yt.PREVIOUS_MONTH;const FM=new Map(Yh.map(n=>[n.code,{code:n.code,name:n.name}])),dl=n=>{var t;return((t=FM.get(n))==null?void 0:t.name)||n};function zM(n){return d.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${cl(e)} - ${cl(i,{includeTZ:!0})}`:""})}function BM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};ke.positioners[e]=function(r,o){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=a.width/2,u=Ra(o,l,c),h=o.y,f=o.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{ah(n.tooltipState,r)}}}}));return d.onUnmounted(()=>{ke.positioners[e]&&delete ke.positioners[e]}),{options:s}}function HM(n){const t=d.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return D1({tickValue:h,granularity:n.granularity.value,dayBoundaryCrossed:o.value})}},title:{display:!at((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=d.computed(()=>{var l,c;return{title:{display:!at((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};ke.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,m=u.width/2,g=u.height/2,b=Ra(c,h,m);let x=Tw(c,f,g);const k=c.y<g?"top":"bottom",M=c.x<m?"left":"center";return f>u.height&&(x=0),{x:b,y:x,xAlign:M,yAlign:k}};const o=d.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return ow(l)>24||u.getDate()!==c.getDate()}),a=d.computed(()=>{var l,c;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:u=>{oh(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:(c=n.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1}}});return d.onUnmounted(()=>{ke.positioners[s]&&delete ke.positioners[s]}),{options:a}}function WM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=bt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Br(i.indexOf(u),sn),data:o.map((h,f)=>e?r[`${h.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=za(h,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:o.map(m=>r[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function VM(n,t){const{i18n:e}=bt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0,u=c&&a.length>1;if(!s.length||!o)return{datasets:[],labels:[]};const h=c&&a||o,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(l?s.flatMap(_=>o.map((C,R)=>{const L=_.event[f],I=c?`${L},${C}`:`${R},${C}`,B=_.event[C];return[I,B]})):s.map(_=>{const C=c?`${_.event[f]},${_.event[m]}`:`${f},${m}`,R=_.event[o[0]];return[C,R]})),b=Object.keys(g).reduce((_,C)=>{const[R]=C.split(","),L=g[C];return _[R]?_[R]+=L:_[R]=L,_},{}),x=Object.entries(b).sort(([,_],[,C])=>Number(C)-Number(_)).map(([_])=>_),k=r[f],M=r[m];let T=c&&k&&Object.entries(k).map(([_,C])=>({id:_,name:C.name}))||o.map(_=>({id:_,name:_})),v=c&&M&&Object.entries(M).map(([_,C])=>({id:_,name:C.name}))||o.map(_=>({id:_,name:_}));if(c&&f==="country_code"&&(T=T.map(_=>({..._,name:dl(_.id)||_.name}))),c&&m==="country_code"&&(v=v.map(_=>({..._,name:dl(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(T.sort((_,C)=>x.indexOf(_.id)-x.indexOf(C.id)),v.sort((_,C)=>x.indexOf(_.id)-x.indexOf(C.id))),!T||!v)return{labels:[],datasets:[]};const S=WM({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:h,barSegmentLabels:v,pivotRecords:g,rowLabels:T,colorPalette:n.colorPalette||sn}),E=c?T.map(_=>e&&e.te(`chartLabels.${_.name}`)&&e.t(`chartLabels.${_.name}`)||_.name):o.map(_=>e&&e.te(`chartLabels.${_}`)&&e.t(`chartLabels.${_}`)||_),P=T.map(_=>_.id==="empty");return{labels:E,datasets:S,isLabelEmpty:P,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const YM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),jM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return sh(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},$M=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return YM(a,l,e)};function UM(n,t){const{i18n:e}=bt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],h=r[u];let f=r&&h&&Object.keys(h).map(v=>({id:v,name:h[v].name}))||o.map(v=>({id:v,name:v}));u==="country_code"&&(f=f.map(v=>({...v,name:dl(v.id)||v.name})));const m=t.value.meta.granularity_ms;if(typeof m!="number"||isNaN(m)||!isFinite(m)||m===0)return console.error("Invalid step value:",m),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const g=jM(a),b=$M(a,l,m,g,s),x=new Set,k=s!=null&&s.length?s.reduce((v,S)=>{const E=new Date(S.timestamp).valueOf(),P=S.event;for(const y of o)x.add(y),E in v||(v[E]={}),y in v[E]||(v[E][y]={});for(const y of o)f.forEach(_=>{P[u]===_.id||y===_.id?(v[E][y]||(v[E][y]={}),v[E][y][_.name]=Math.round(Number(P[y])*1e3)/1e3):c.length||(v[E][y]||(v[E][y]={}),v[E][y][_.name]=Math.round(Number(P[_.id])*1e3)/1e3)});return v},{}):{},T=[...o.length===1?o.flatMap(v=>f.map(S=>[v,S.name,S.id==="empty"])):f.map(v=>[v.name,v.name,v.id==="empty"])].map(([v,S,E],P)=>{const y=b.map(L=>L in k&&v in k[L]?{x:L,y:k[L][v][S]||0}:{x:L,y:0});let{colorPalette:_,fill:C}=n;at(_)&&(_=sn);const R=za(P,S,E,_);return{rawDimension:S,rawMetric:v,label:e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S,borderColor:R,backgroundColor:R,data:y,total:y.reduce((L,{y:I})=>L+Number(I),0),...Vw,fill:C,borderWidth:C?jw:Yw,isSegmentEmpty:E}});return u==="status_code"||u==="status_code_grouped"?T.sort((v,S)=>(v.label??"")<(S.label??"")?-1:1):T.sort((v,S)=>Number(v.total)<Number(S.total)?-1:1),{datasets:T}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const qM=(n,t)=>{d.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function XM(){const{i18n:n}=bt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const yf="analytics-query-provider",bf=2;function GM(){const n=d.inject(yf);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function hl(n){return d.getCurrentScope()?(d.onScopeDispose(n),!0):!1}const _f=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const KM=n=>n!=null,ZM=Object.prototype.toString,QM=n=>ZM.call(n)==="[object Object]";function Kr(n){return Array.isArray(n)?n:[n]}function JM(n){return d.getCurrentInstance()}function tk(n,t={}){if(!d.isRef(n))return d.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=d.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=d.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return e}function ek(n,t=!0,e){JM()?d.onMounted(n,e):t?n():d.nextTick(n)}function nk(n,t,e){return d.watch(n,t,{...e,immediate:!0})}const Zr=_f?window:void 0;function Di(n){var t;const e=d.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Es(...n){const t=[],e=()=>{t.forEach(a=>a()),t.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=d.computed(()=>{const a=Kr(d.toValue(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=nk(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Di(c)))!=null?l:[Zr].filter(c=>c!=null),Kr(d.toValue(s.value?n[1]:n[0])),Kr(d.unref(s.value?n[2]:n[1])),d.toValue(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(e(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=QM(u)?{...u}:u;t.push(...a.flatMap(f=>l.flatMap(m=>c.map(g=>i(f,m,g,h)))))},{flush:"post"}),o=()=>{r(),e()};return hl(e),o}function ik(){const n=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{n.value=!0},t),n}function xf(n){const t=ik();return d.computed(()=>(t.value,!!n()))}function sk(n,t,e={}){const{window:i=Zr,...s}=e;let r;const o=xf(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const f=d.toValue(n),m=Kr(f).map(Di).filter(KM);return new Set(m)}),c=d.watch(()=>l.value,f=>{a(),o.value&&f.size&&(r=new MutationObserver(t),f.forEach(m=>r.observe(m,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),h=()=>{c(),a()};return hl(h),{isSupported:o,stop:h,takeRecords:u}}function rk(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:o,onMove:a,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=Zr,containerElement:m,handle:g=n,buttons:b=[0]}=t,x=d.ref((e=d.toValue(u))!=null?e:{x:0,y:0}),k=d.ref(),M=P=>i?i.includes(P.pointerType):!0,T=P=>{d.toValue(s)&&P.preventDefault(),d.toValue(r)&&P.stopPropagation()},v=P=>{var y;if(!d.toValue(b).includes(P.button)||d.toValue(t.disabled)||!M(P)||d.toValue(o)&&P.target!==d.toValue(n))return;const _=d.toValue(m),C=(y=_==null?void 0:_.getBoundingClientRect)==null?void 0:y.call(_),R=d.toValue(n).getBoundingClientRect(),L={x:P.clientX-(_?R.left-C.left+_.scrollLeft:R.left),y:P.clientY-(_?R.top-C.top+_.scrollTop:R.top)};(c==null?void 0:c(L,P))!==!1&&(k.value=L,T(P))},S=P=>{if(d.toValue(t.disabled)||!M(P)||!k.value)return;const y=d.toValue(m),_=d.toValue(n).getBoundingClientRect();let{x:C,y:R}=x.value;(h==="x"||h==="both")&&(C=P.clientX-k.value.x,y&&(C=Math.min(Math.max(0,C),y.scrollWidth-_.width))),(h==="y"||h==="both")&&(R=P.clientY-k.value.y,y&&(R=Math.min(Math.max(0,R),y.scrollHeight-_.height))),x.value={x:C,y:R},a==null||a(x.value,P),T(P)},E=P=>{d.toValue(t.disabled)||!M(P)||k.value&&(k.value=void 0,l==null||l(x.value,P),T(P))};if(_f){const P=()=>{var y;return{capture:(y=t.capture)!=null?y:!0,passive:!d.toValue(s)}};Es(g,"pointerdown",v,P),Es(f,"pointermove",S,P),Es(f,"pointerup",E,P)}return{...tk(x),position:x,isDragging:d.computed(()=>!!k.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function ok(n,t,e={}){const{window:i=Zr,...s}=e;let r;const o=xf(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const h=d.toValue(n);return Array.isArray(h)?h.map(f=>Di(f)):[Di(h)]}),c=d.watch(l,h=>{if(a(),o.value&&i){r=new ResizeObserver(t);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return hl(u),{isSupported:o,stop:u}}function ak(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=t,a=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),g=d.shallowRef(0);function b(){const k=Di(n);if(!k){e&&(a.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,g.value=0);return}const M=k.getBoundingClientRect();a.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,h.value=M.top,f.value=M.width,m.value=M.x,g.value=M.y}function x(){o==="sync"?b():o==="next-frame"&&requestAnimationFrame(()=>b())}return ok(n,x),d.watch(()=>Di(n),k=>!k&&x()),sk(n,x,{attributeFilter:["style","class"]}),s&&Es("scroll",x,{capture:!0,passive:!0}),i&&Es("resize",x,{passive:!0}),ek(()=>{r&&x()}),{height:a,bottom:l,left:c,right:u,top:h,width:f,x:m,y:g,update:x}}function lk(n,t){const{top:e,left:i}=ak(n),s=d.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=d.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const bt={useBarChartOptions:P1,useChartJSCommon:E1,useChartLegendValues:R1,useChartSelectedRange:zM,useExploreResultToDatasets:VM,useExploreResultToTimeDataset:UM,useDonutChartOptions:BM,useLineChartOptions:HM,useI18n:zm,useReportChartDataForSynthetics:qM,useTranslatedUnits:XM,useEvaluateFeatureFlag:GM,useTooltipAbsolutePosition:lk};var Nt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Nt||{});/*!
|
|
18
|
+
`):n}function f0(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function yd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),h=r.length,f=s.length,m=i.length,g=Ut(t.padding);let _=g.height,x=0,M=i.reduce((k,C)=>k+C.before.length+C.lines.length+C.after.length,0);if(M+=n.beforeBody.length+n.afterBody.length,h&&(_+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),M){const k=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;_+=m*k+(M-m)*l.lineHeight+(M-1)*t.bodySpacing}f&&(_+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const T=function(k){x=Math.max(x,e.measureText(k).width+v)};return e.save(),e.font=c.string,Dt(n.title,T),e.font=l.string,Dt(n.beforeBody.concat(n.afterBody),T),v=t.displayColors?o+2+t.boxPadding:0,Dt(i,k=>{Dt(k.before,T),Dt(k.lines,T),Dt(k.after,T)}),v=0,e.font=u.string,Dt(n.footer,T),e.restore(),x+=g.width,{width:x,height:_}}function m0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function g0(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function p0(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),g0(c,n,t,e)&&(c="center"),c}function bd(n,t,e){const i=e.yAlign||t.yAlign||m0(n,e);return{xAlign:e.xAlign||t.xAlign||p0(n,t,e,i),yAlign:i}}function y0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function b0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function _d(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=xn(o);let g=y0(t,a);const _=b0(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,f)+s:a==="right"&&(g+=Math.max(h,m)+s),{x:Qt(g,0,i.width-t.width),y:Qt(_,0,i.height-t.height)}}function Pr(n,t,e){const i=Ut(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function xd(n){return Ye([],nn(n))}function _0(n,t,e){return wn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function wd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const vd={beforeTitle:Ke,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ke,beforeBody:Ke,beforeLabel:Ke,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return at(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function pe(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?vd[t].call(e,i):s}class pa extends Jt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Go(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=_0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=pe(i,"beforeTitle",this,t),r=pe(i,"title",this,t),o=pe(i,"afterTitle",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}getBeforeBody(t,e){return xd(pe(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return Dt(t,r=>{const o={before:[],lines:[],after:[]},a=wd(i,r);Ye(o.before,nn(pe(a,"beforeLabel",this,r))),Ye(o.lines,pe(a,"label",this,r)),Ye(o.after,nn(pe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return xd(pe(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=pe(i,"beforeFooter",this,t),r=pe(i,"footer",this,t),o=pe(i,"afterFooter",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(f0(this.chart,e[l]));return t.filter&&(a=a.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,i))),Dt(a,u=>{const h=wd(t.callbacks,u);s.push(pe(h,"labelColor",this,u)),r.push(pe(h,"labelPointStyle",this,u)),o.push(pe(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=hs[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=yd(this,i),c=Object.assign({},a,l),u=bd(this.chart,i,c),h=_d(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=xn(a),{x:f,y:m}=t,{width:g,height:_}=e;let x,M,v,T,k,C;return r==="center"?(k=m+_/2,s==="left"?(x=f,M=x-o,T=k+o,C=k-o):(x=f+g,M=x+o,T=k-o,C=k+o),v=x):(s==="left"?M=f+Math.max(l,u)+o:s==="right"?M=f+g-Math.max(c,h)-o:M=this.caretX,r==="top"?(T=m,k=T-o,x=M-o,v=M+o):(T=m+_,k=T+o,x=M+o,v=M-o),C=T),{x1:x,x2:M,x3:v,y1:T,y2:k,y3:C}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=gi(i.rtl,this.x,this.width);for(t.x=Pr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=It(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=It(r.bodyFont),h=Pr(this,"left",r),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+m;if(r.usePointStyle){const _={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,M=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Vo(t,_,x,M),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Vo(t,_,x,M)}else{t.lineWidth=mt(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const _=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),M=xn(o.borderRadius);Object.values(M).some(v=>v!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,hi(t,{x:_,y:g,w:c,h:l,radius:M}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),hi(t,{x,y:g+1,w:c-2,h:l-2,radius:M}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(_,g,c,l),t.strokeRect(_,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(x,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=It(i.bodyFont);let f=h.lineHeight,m=0;const g=gi(i.rtl,this.x,this.width),_=function(y){e.fillText(y,g.x(t.x+m),t.y+f/2),t.y+=f+r},x=g.textAlign(o);let M,v,T,k,C,I,P;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Pr(this,x,i),e.fillStyle=i.bodyColor,Dt(this.beforeBody,_),m=a&&x!=="right"?o==="center"?c/2+u:c+2+u:0,k=0,I=s.length;k<I;++k){for(M=s[k],v=this.labelTextColors[k],e.fillStyle=v,Dt(M.before,_),T=M.lines,a&&T.length&&(this._drawColorBox(e,t,k,g,i),f=Math.max(h.lineHeight,l)),C=0,P=T.length;C<P;++C)_(T[C]),f=h.lineHeight;Dt(M.after,_)}m=0,f=h.lineHeight,Dt(this.afterBody,_),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=gi(i.rtl,this.x,this.width);for(t.x=Pr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=It(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=xn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+h,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-g),e.quadraticCurveTo(a+c,l+u,a+c-g,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+m,l+u),e.quadraticCurveTo(a,l+u,a,l+u-m),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+h),e.quadraticCurveTo(a,l,a+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=hs[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=yd(this,t),l=Object.assign({},o,this._size),c=bd(e,t,l),u=_d(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ut(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),nu(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),iu(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!tr(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!tr(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=hs[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}E(pa,"positioners",hs);var Se={id:"tooltip",_element:pa,positioners:hs,afterInit(n,t,e){e&&(n.tooltip=new pa({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:vd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},x0=Object.freeze({__proto__:null,Colors:Rb,Decimation:Fb,Filler:i0,Legend:c0,SubTitle:h0,Title:d0,Tooltip:Se});const w0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function v0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return w0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const M0=(n,t)=>n===null?null:Qt(Math.round(n),0,t);function Md(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ya extends jn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(at(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:v0(i,t,lt(e,t),this._addedLabels),M0(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return Md.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}E(ya,"id","category"),E(ya,"defaults",{ticks:{callback:Md}});function S0(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=r||1,g=u-1,{min:_,max:x}=t,M=!at(o),v=!at(a),T=!at(c),k=(x-_)/(h+1);let C=Cc((x-_)/g/m)*m,I,P,y,b;if(C<1e-14&&!M&&!v)return[{value:_},{value:x}];b=Math.ceil(x/C)-Math.floor(_/C),b>g&&(C=Cc(b*C/g/m)*m),at(l)||(I=Math.pow(10,l),C=Math.ceil(C*I)/I),s==="ticks"?(P=Math.floor(_/C)*C,y=Math.ceil(x/C)*C):(P=_,y=x),M&&v&&r&&_g((a-o)/r,C/1e3)?(b=Math.round(Math.min((a-o)/C,u)),C=(a-o)/b,P=o,y=a):T?(P=M?o:P,y=v?a:y,b=c-1,C=(y-P)/b):(b=(y-P)/C,Ui(b,Math.round(b),C/1e3)?b=Math.round(b):b=Math.ceil(b));const S=Math.max(Oc(C),Oc(P));I=Math.pow(10,at(l)?S:l),P=Math.round(P*I)/I,y=Math.round(y*I)/I;let O=0;for(M&&(f&&P!==o?(e.push({value:o}),P<o&&O++,Ui(Math.round((P+O*C)*I)/I,o,Sd(o,k,n))&&O++):P<o&&O++);O<b;++O){const R=Math.round((P+O*C)*I)/I;if(v&&R>a)break;e.push({value:R})}return v&&f&&y!==a?e.length&&Ui(e[e.length-1].value,a,Sd(a,k,n))?e[e.length-1].value=a:e.push({value:a}):(!v||y===a)&&e.push({value:y}),e}function Sd(n,t,{horizontal:e,minRotation:i}){const s=$t(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Or extends jn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return at(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=We(s),c=We(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=S0(s,r);return t.bounds==="ticks"&&Pc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Gi(t,this.chart.options.locale,this.options.ticks.format)}}class ba extends Or{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?t:0,this.max=Rt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=$t(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}E(ba,"id","linear"),E(ba,"defaults",{ticks:{callback:ar.formatters.numeric}});const fs=n=>Math.floor(bn(n)),$n=(n,t)=>Math.pow(10,fs(n)+t);function kd(n){return n/Math.pow(10,fs(n))===1}function Dd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function k0(n,t){const e=t-n;let i=fs(e);for(;Dd(n,t,i)>10;)i++;for(;Dd(n,t,i)<10;)i--;return Math.min(i,fs(n))}function D0(n,{min:t,max:e}){t=Me(n.min,t);const i=[],s=fs(t);let r=k0(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((c-u)/Math.pow(10,r)),f=Me(n.min,Math.round((l+u+h*Math.pow(10,r))*o)/o);for(;f<e;)i.push({value:f,major:kd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,o=r>=0?1:o),f=Math.round((l+u+h*Math.pow(10,r))*o)/o;const m=Me(n.max,f);return i.push({value:m,major:kd(m),significand:h}),i}class _a extends jn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Or.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?Math.max(0,t):null,this.max=Rt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rt(this._userMin)&&(this.min=t===$n(this.min,0)?$n(this.min,-1):$n(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r($n(i,-1)),o($n(s,1)))),i<=0&&r($n(s,-1)),s<=0&&o($n(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=D0(e,this);return t.bounds==="ticks"&&Pc(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Gi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=bn(t),this._valueRange=bn(this.max)-bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}E(_a,"id","logarithmic"),E(_a,"defaults",{ticks:{callback:ar.formatters.logarithmic,major:{enabled:!0}}});function xa(n){const t=n.ticks;if(t.display&&n.display){const e=Ut(t.backdropPadding);return lt(t.font&&t.font.size,At.font.size)+e.height}return 0}function T0(n,t,e){return e=St(e)?e:[e],{w:Ng(n,t.string,e),h:e.length*t.lineHeight}}function Td(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function C0(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?ht/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),h=It(c.font),f=T0(n.ctx,h,n._pointLabels[l]);i[l]=f;const m=se(n.getIndexAngle(l)+a),g=Math.round(sr(m)),_=Td(g,u.x,f.w,0,180),x=Td(g,u.y,f.h,90,270);P0(e,t,m,_,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=A0(n,i,s)}function P0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function O0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(sr(se(l.angle+Et))),u=L0(l.y,a.h,c),h=R0(c),f=I0(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+a.w,bottom:u+a.h}}function E0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Je({x:e,y:i},t)||Je({x:e,y:r},t)||Je({x:s,y:i},t)||Je({x:s,y:r},t))}function A0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:xa(r)/2,additionalAngle:o?ht/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=O0(n,u,l);i.push(h),a==="auto"&&(h.visible=E0(h,c),h.visible&&(c=h))}return i}function R0(n){return n===0||n===180?"center":n<180?"left":"right"}function I0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function L0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function N0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!at(a)){const l=xn(t.borderRadius),c=Ut(t.backdropPadding);n.fillStyle=a;const u=i-c.left,h=s-c.top,f=r-i+c.width,m=o-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),hi(n,{x:u,y:h,w:f,h:m,radius:l}),n.fill()):n.fillRect(u,h,f,m)}}function F0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));N0(e,o,r);const a=It(o.font),{x:l,y:c,textAlign:u}=r;Hn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Cd(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ot);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function z0(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Cd(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function B0(n,t,e){return wn(n,{label:e,index:t,type:"pointLabel"})}class ms extends Or{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ut(xa(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Rt(t)&&!isNaN(t)?t:0,this.max=Rt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xa(this.options))}generateTickLabels(t){Or.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=kt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?C0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=Ot/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*e+$t(i))}getDistanceFromCenterForValue(t){if(at(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(at(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return B0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Et+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Cd(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&F0(this,o),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),g=r.setContext(f);z0(this,m,l,o,g)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=It(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const h=Ut(c.backdropPadding);t.fillRect(-o/2-h.left,-r-u.size/2-h.top,o+h.width,u.size+h.height)}Hn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}E(ms,"id","radialLinear"),E(ms,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ar.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),E(ms,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),E(ms,"descriptors",{angleLines:{_fallback:"grid"}});const Er={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ye=Object.keys(Er);function Pd(n,t){return n-t}function Od(n,t){if(at(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Rt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(_n(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function Ed(n,t,e,i){const s=ye.length;for(let r=ye.indexOf(n);r<s-1;++r){const o=Er[ye[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ye[r]}return ye[s-1]}function H0(n,t,e,i,s){for(let r=ye.length-1;r>=ye.indexOf(e);r--){const o=ye[r];if(Er[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ye[e?ye.indexOf(e):0]}function W0(n){for(let t=ye.indexOf(n)+1,e=ye.length;t<e;++t)if(Er[ye[t]].common)return ye[t]}function Ad(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=No(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function V0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function Rd(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:V0(n,i,s,e)}class gs extends jn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new vu._date(t.adapters.date);s.init(e),$i(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Od(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Rt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Rt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=Mg(s,r,o);return this._unit=e.unit||(i.autoSkip?Ed(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):H0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:W0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Rd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Qt(e,0,o),i=Qt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||Ed(r.minUnit,e,i,this._getLabelCapacity(e)),a=lt(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=_n(l)||l===!0,u={};let h=e,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,a,o),m++)Ad(u,f,g);return(f===i||s.bounds==="ticks"||m===1)&&Ad(u,f,g),Object.keys(u).sort(Pd).map(_=>+_)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return kt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],f=i[e],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=$t(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Rd(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Od(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Rc(t.sort(Pd))}}E(gs,"id","time"),E(gs,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ar(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Qe(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Qe(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class wa extends gs{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ar(e,this.min),this._tableRange=Ar(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ar(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ar(this._table,i*this._tableRange+this._minPos,!0)}}E(wa,"id","timeseries"),E(wa,"defaults",gs.defaults);var Y0=Object.freeze({__proto__:null,CategoryScale:ya,LinearScale:ba,LogarithmicScale:_a,RadialLinearScale:ms,TimeScale:gs,TimeSeriesScale:wa});const j0=[Qp,Db,x0,Y0],Id=6048e5,$0=864e5,ps=6e4,yi=36e5,U0=1e3,Ld=Symbol.for("constructDateFrom");function Ft(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Ld in n?n[Ld](t):n instanceof Date?new n.constructor(t):new Date(t)}function dt(n,t){return Ft(t||n,n)}function Rr(n,t,e){const i=dt(n,e==null?void 0:e.in);return isNaN(t)?Ft((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function va(n,t,e){const i=dt(n,e==null?void 0:e.in);if(isNaN(t))return Ft(n,NaN);if(!t)return i;const s=i.getDate(),r=Ft(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function Ma(n,t,e){return Ft(n,+dt(n)+t)}function q0(n,t,e){return Ma(n,t*yi)}let X0={};function Un(){return X0}function je(n,t){var a,l,c,u;const e=Un(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=dt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function bi(n,t){return je(n,{...t,weekStartsOn:1})}function Nd(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ft(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=bi(s),o=Ft(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=bi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Ir(n){const t=dt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function qn(n,...t){const e=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Sa(n,t){const e=dt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Fd(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=Sa(i),o=Sa(s),a=+r-Ir(r),l=+o-Ir(o);return Math.round((a-l)/$0)}function G0(n,t){const e=Nd(n,t),i=Ft(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),bi(i)}function K0(n,t,e){const i=dt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ps),i}function Z0(n,t,e){return va(n,t*3,e)}function Q0(n,t,e){return Ma(n,t*1e3)}function J0(n,t,e){return Rr(n,t*7,e)}function t_(n,t,e){return va(n,t*12,e)}function ys(n,t){const e=+dt(n)-+dt(t);return e<0?-1:e>0?1:e}function e_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ka(n){return!(!e_(n)&&typeof n!="number"||isNaN(+dt(n)))}function n_(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function i_(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function zd(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=Bd(i,s),o=Math.abs(Fd(i,s));i.setDate(i.getDate()-r*o);const a=+(Bd(i,s)===-r),l=r*(o-a);return l===0?0:l}function Bd(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function bs(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function s_(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=(+i-+s)/yi;return bs(e==null?void 0:e.roundingMethod)(r)}function Da(n,t){return+dt(n)-+dt(t)}function r_(n,t,e){const i=Da(n,t)/ps;return bs(e==null?void 0:e.roundingMethod)(i)}function Hd(n,t){const e=dt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Wd(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function o_(n,t){const e=dt(n,t==null?void 0:t.in);return+Hd(e,t)==+Wd(e,t)}function Vd(n,t,e){const[i,s,r]=qn(e==null?void 0:e.in,n,n,t),o=ys(s,r),a=Math.abs(n_(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ys(s,r)===-o;o_(i)&&a===1&&ys(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function a_(n,t,e){const i=Vd(n,t,e)/3;return bs(e==null?void 0:e.roundingMethod)(i)}function l_(n,t,e){const i=Da(n,t)/1e3;return bs(e==null?void 0:e.roundingMethod)(i)}function c_(n,t,e){const i=zd(n,t,e)/7;return bs(e==null?void 0:e.roundingMethod)(i)}function u_(n,t,e){const[i,s]=qn(e==null?void 0:e.in,n,t),r=ys(i,s),o=Math.abs(i_(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ys(i,s)===-r,l=r*(o-+a);return l===0?0:l}function d_(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function h_(n,t){const e=dt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function f_(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Yd(n,t){const e=dt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function m_(n,t){const e=dt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function g_(n,t){var a,l;const e=Un(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=dt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function p_(n,t){const e=dt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function y_(n,t){const e=dt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function b_(n,t){const e=dt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const __={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"}},x_=(n,t,e)=>{let i;const s=__[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ta(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const w_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},v_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},M_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},S_={date:Ta({formats:w_,defaultWidth:"full"}),time:Ta({formats:v_,defaultWidth:"full"}),dateTime:Ta({formats:M_,defaultWidth:"full"})},k_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},D_=(n,t,e,i)=>k_[n];function _s(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const T_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},C_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},P_={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"]},O_={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"]},E_={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"}},A_={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"}},R_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:_s({values:T_,defaultWidth:"wide"}),quarter:_s({values:C_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:_s({values:P_,defaultWidth:"wide"}),day:_s({values:O_,defaultWidth:"wide"}),dayPeriod:_s({values:E_,defaultWidth:"wide",formattingValues:A_,defaultFormattingWidth:"wide"})};function xs(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?L_(a,h=>h.test(o)):I_(a,h=>h.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function I_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function L_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function N_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const F_=/^(\d+)(th|st|nd|rd)?/i,z_=/\d+/i,B_={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},H_={any:[/^b/i,/^(a|c)/i]},W_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},V_={any:[/1/i,/2/i,/3/i,/4/i]},Y_={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},j_={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]},$_={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},U_={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]},q_={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},X_={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}},G_={ordinalNumber:N_({matchPattern:F_,parsePattern:z_,valueCallback:n=>parseInt(n,10)}),era:xs({matchPatterns:B_,defaultMatchWidth:"wide",parsePatterns:H_,defaultParseWidth:"any"}),quarter:xs({matchPatterns:W_,defaultMatchWidth:"wide",parsePatterns:V_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:xs({matchPatterns:Y_,defaultMatchWidth:"wide",parsePatterns:j_,defaultParseWidth:"any"}),day:xs({matchPatterns:$_,defaultMatchWidth:"wide",parsePatterns:U_,defaultParseWidth:"any"}),dayPeriod:xs({matchPatterns:q_,defaultMatchWidth:"any",parsePatterns:X_,defaultParseWidth:"any"})},jd={code:"en-US",formatDistance:x_,formatLong:S_,formatRelative:D_,localize:R_,match:G_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function K_(n,t){const e=dt(n,t==null?void 0:t.in);return Fd(e,Yd(e))+1}function $d(n,t){const e=dt(n,t==null?void 0:t.in),i=+bi(e)-+G0(e);return Math.round(i/Id)+1}function Ca(n,t){var u,h,f,m;const e=dt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Un(),r=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,o=Ft((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=je(o,t),l=Ft((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=je(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function Z_(n,t){var a,l,c,u;const e=Un(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Ca(n,t),r=Ft((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),je(r,t)}function Ud(n,t){const e=dt(n,t==null?void 0:t.in),i=+je(e,t)-+Z_(e,t);return Math.round(i/Id)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const kn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},_i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qd={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return kn.y(n,t)},Y:function(n,t,e,i){const s=Ca(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Tt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=Nd(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return kn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Ud(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=$d(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):kn.d(n,t)},D:function(n,t,e){const i=K_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=_i.noon:i===0?s=_i.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=_i.evening:i>=12?s=_i.afternoon:i>=4?s=_i.morning:s=_i.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return kn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):kn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):kn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):kn.s(n,t)},S:function(n,t){return kn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Gd(i);case"XXXX":case"XX":return Xn(i);case"XXXXX":case"XXX":default:return Xn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Gd(i);case"xxxx":case"xx":return Xn(i);case"xxxxx":case"xxx":default:return Xn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xd(i,":");case"OOOO":default:return"GMT"+Xn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xd(i,":");case"zzzz":default:return"GMT"+Xn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function Xd(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function Gd(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Xn(n,t)}function Xn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Kd=(n,t)=>{switch(n){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"})}},Zd=(n,t)=>{switch(n){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"})}},Pa={p:Zd,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Kd(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Kd(i,t)).replace("{{time}}",Zd(s,t))}},Q_=/^D+$/,J_=/^Y+$/,tx=["D","DD","YY","YYYY"];function Qd(n){return Q_.test(n)}function Jd(n){return J_.test(n)}function Oa(n,t,e){const i=ex(n,t,e);if(console.warn(i),tx.includes(n))throw new RangeError(i)}function ex(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const nx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ix=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sx=/^'([^]*?)'?$/,rx=/''/g,ox=/[a-zA-Z]/;function Lr(n,t,e){var u,h,f,m,g,_,x,M;const i=Un(),s=(e==null?void 0:e.locale)??i.locale??jd,r=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(f=i.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((_=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:_.weekStartsOn)??i.weekStartsOn??((M=(x=i.locale)==null?void 0:x.options)==null?void 0:M.weekStartsOn)??0,a=dt(n,e==null?void 0:e.in);if(!ka(a))throw new RangeError("Invalid time value");let l=t.match(ix).map(v=>{const T=v[0];if(T==="p"||T==="P"){const k=Pa[T];return k(v,s.formatLong)}return v}).join("").match(nx).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const T=v[0];if(T==="'")return{isToken:!1,value:ax(v)};if(qd[T])return{isToken:!0,value:v};if(T.match(ox))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(v=>{if(!v.isToken)return v.value;const T=v.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Jd(T)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Qd(T))&&Oa(T,t,String(n));const k=qd[T[0]];return k(a,T,s.localize,c)}).join("")}function ax(n){const t=n.match(sx);return t?t[1].replace(rx,"'"):n}function th(){return Object.assign({},Un())}function lx(n,t){const e=dt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function cx(n,t){const e=ux(t)?new t(0):Ft(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function ux(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const dx=10;class eh{constructor(){E(this,"subPriority",0)}validate(t,e){return!0}}class hx extends eh{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class fx extends eh{constructor(e,i){super();E(this,"priority",dx);E(this,"subPriority",-1);this.context=e||(s=>Ft(i,s))}set(e,i){return i.timestampIsSet?e:Ft(e,cx(e,this.context))}}class vt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new hx(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class mx extends vt{constructor(){super(...arguments);E(this,"priority",140);E(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Vt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},$e={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Yt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*yi+r*ps+o*U0),rest:t.slice(e[0].length)}}function nh(n){return Lt(Vt.anyDigitsSigned,n)}function zt(n,t){switch(n){case 1:return Lt(Vt.singleDigit,t);case 2:return Lt(Vt.twoDigits,t);case 3:return Lt(Vt.threeDigits,t);case 4:return Lt(Vt.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Nr(n,t){switch(n){case 1:return Lt(Vt.singleDigitSigned,t);case 2:return Lt(Vt.twoDigitsSigned,t);case 3:return Lt(Vt.threeDigitsSigned,t);case 4:return Lt(Vt.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ea(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function ih(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function sh(n){return n%400===0||n%4===0&&n%100!==0}class gx extends vt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return Yt(zt(4,e),r);case"yo":return Yt(s.ordinalNumber(e,{unit:"year"}),r);default:return Yt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=ih(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class px extends vt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Yt(zt(4,e),r);case"Yo":return Yt(s.ordinalNumber(e,{unit:"year"}),r);default:return Yt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=Ca(e,r);if(s.isTwoDigitYear){const l=ih(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),je(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),je(e,r)}}class yx extends vt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Nr(i==="R"?4:i.length,e)}set(e,i,s){const r=Ft(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),bi(r)}}class bx extends vt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Nr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class _x extends vt{constructor(){super(...arguments);E(this,"priority",120);E(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return zt(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class xx extends vt{constructor(){super(...arguments);E(this,"priority",120);E(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return zt(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class wx extends vt{constructor(){super(...arguments);E(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);E(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return Yt(Lt(Vt.month,e),r);case"MM":return Yt(zt(2,e),r);case"Mo":return Yt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class vx extends vt{constructor(){super(...arguments);E(this,"priority",110);E(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return Yt(Lt(Vt.month,e),r);case"LL":return Yt(zt(2,e),r);case"Lo":return Yt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function Mx(n,t,e){const i=dt(n,e==null?void 0:e.in),s=Ud(i,e)-t;return i.setDate(i.getDate()-s*7),dt(i,e==null?void 0:e.in)}class Sx extends vt{constructor(){super(...arguments);E(this,"priority",100);E(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Vt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return je(Mx(e,s,r),r)}}function kx(n,t,e){const i=dt(n,e==null?void 0:e.in),s=$d(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Dx extends vt{constructor(){super(...arguments);E(this,"priority",100);E(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Vt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return bi(kx(e,s))}}const Tx=[31,28,31,30,31,30,31,31,30,31,30,31],Cx=[31,29,31,30,31,30,31,31,30,31,30,31];class Px extends vt{constructor(){super(...arguments);E(this,"priority",90);E(this,"subPriority",1);E(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Vt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=sh(s),o=e.getMonth();return r?i>=1&&i<=Cx[o]:i>=1&&i<=Tx[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Ox extends vt{constructor(){super(...arguments);E(this,"priority",90);E(this,"subpriority",1);E(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Vt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear();return sh(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Aa(n,t,e){var h,f,m,g;const i=Un(),s=(e==null?void 0:e.weekStartsOn)??((f=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,r=dt(n,e==null?void 0:e.in),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Rr(r,u,e)}class Ex extends vt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Aa(e,s,r),e.setHours(0,0,0,0),e}}class Ax extends vt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Yt(zt(i.length,e),o);case"eo":return Yt(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Aa(e,s,r),e.setHours(0,0,0,0),e}}class Rx extends vt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Yt(zt(i.length,e),o);case"co":return Yt(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Aa(e,s,r),e.setHours(0,0,0,0),e}}function Ix(n,t,e){const i=dt(n,e==null?void 0:e.in),s=lx(i,e),r=t-s;return Rr(i,r,e)}class Lx extends vt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return zt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Yt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Yt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Yt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Yt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=Ix(e,s),e.setHours(0,0,0,0),e}}class Nx extends vt{constructor(){super(...arguments);E(this,"priority",80);E(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ea(s),0,0,0),e}}class Fx extends vt{constructor(){super(...arguments);E(this,"priority",80);E(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ea(s),0,0,0),e}}class zx extends vt{constructor(){super(...arguments);E(this,"priority",80);E(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ea(s),0,0,0),e}}class Bx extends vt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Vt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class Hx extends vt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Vt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class Wx extends vt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Vt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class Vx extends vt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Vt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class Yx extends vt{constructor(){super(...arguments);E(this,"priority",60);E(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Vt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class jx extends vt{constructor(){super(...arguments);E(this,"priority",50);E(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Vt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class $x extends vt{constructor(){super(...arguments);E(this,"priority",30);E(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Yt(zt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class Ux extends vt{constructor(){super(...arguments);E(this,"priority",10);E(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ue($e.basicOptionalMinutes,e);case"XX":return Ue($e.basic,e);case"XXXX":return Ue($e.basicOptionalSeconds,e);case"XXXXX":return Ue($e.extendedOptionalSeconds,e);case"XXX":default:return Ue($e.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Ir(e)-s)}}class qx extends vt{constructor(){super(...arguments);E(this,"priority",10);E(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ue($e.basicOptionalMinutes,e);case"xx":return Ue($e.basic,e);case"xxxx":return Ue($e.basicOptionalSeconds,e);case"xxxxx":return Ue($e.extendedOptionalSeconds,e);case"xxx":default:return Ue($e.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Ir(e)-s)}}class Xx extends vt{constructor(){super(...arguments);E(this,"priority",40);E(this,"incompatibleTokens","*")}parse(e){return nh(e)}set(e,i,s){return[Ft(e,s*1e3),{timestampIsSet:!0}]}}class Gx extends vt{constructor(){super(...arguments);E(this,"priority",20);E(this,"incompatibleTokens","*")}parse(e){return nh(e)}set(e,i,s){return[Ft(e,s),{timestampIsSet:!0}]}}const Kx={G:new mx,y:new gx,Y:new px,R:new yx,u:new bx,Q:new _x,q:new xx,M:new wx,L:new vx,w:new Sx,I:new Dx,d:new Px,D:new Ox,E:new Ex,e:new Ax,c:new Rx,i:new Lx,a:new Nx,b:new Fx,B:new zx,h:new Bx,H:new Hx,K:new Wx,k:new Vx,m:new Yx,s:new jx,S:new $x,X:new Ux,x:new qx,t:new Xx,T:new Gx},Zx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jx=/^'([^]*?)'?$/,tw=/''/g,ew=/\S/,nw=/[a-zA-Z]/;function iw(n,t,e,i){var x,M,v,T,k,C,I,P;const s=()=>Ft((i==null?void 0:i.in)||e,NaN),r=th(),o=(i==null?void 0:i.locale)??r.locale??jd,a=(i==null?void 0:i.firstWeekContainsDate)??((M=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:M.firstWeekContainsDate)??r.firstWeekContainsDate??((T=(v=r.locale)==null?void 0:v.options)==null?void 0:T.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((C=(k=i==null?void 0:i.locale)==null?void 0:k.options)==null?void 0:C.weekStartsOn)??r.weekStartsOn??((P=(I=r.locale)==null?void 0:I.options)==null?void 0:P.weekStartsOn)??0;if(!t)return n?s():dt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new fx(i==null?void 0:i.in,e)],h=t.match(Qx).map(y=>{const b=y[0];if(b in Pa){const S=Pa[b];return S(y,o.formatLong)}return y}).join("").match(Zx),f=[];for(let y of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&Jd(y)&&Oa(y,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Qd(y)&&Oa(y,t,n);const b=y[0],S=Kx[b];if(S){const{incompatibleTokens:O}=S;if(Array.isArray(O)){const A=f.find(z=>O.includes(z.token)||z.token===b);if(A)throw new RangeError(`The format string mustn't contain \`${A.fullToken}\` and \`${y}\` at the same time`)}else if(S.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);f.push({token:b,fullToken:y});const R=S.run(n,y,o.match,c);if(!R)return s();u.push(R.setter),n=R.rest}else{if(b.match(nw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(y==="''"?y="'":b==="'"&&(y=sw(y)),n.indexOf(y)===0)n=n.slice(y.length);else return s()}}if(n.length>0&&ew.test(n))return s();const m=u.map(y=>y.priority).sort((y,b)=>b-y).filter((y,b,S)=>S.indexOf(y)===b).map(y=>u.filter(b=>b.priority===y).sort((b,S)=>S.subPriority-b.subPriority)).map(y=>y[0]);let g=dt(e,i==null?void 0:i.in);if(isNaN(+g))return s();const _={};for(const y of m){if(!y.validate(g,c))return s();const b=y.set(g,_,c);Array.isArray(b)?(g=b[0],Object.assign(_,b[1])):g=b}return g}function sw(n){return n.match(Jx)[1].replace(tw,"'")}function rw(n,t){const e=dt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function ow(n,t){const e=dt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function aw(n,t){const e=dt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function lw(n){const t=n/yi;return Math.trunc(t)}function rh(n,t){const e=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=hw(n);let r;if(s.date){const c=fw(s.date,i);r=mw(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=gw(s.time),isNaN(a)))return e();if(s.timezone){if(l=pw(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=dt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return dt(o+a+l,t==null?void 0:t.in)}const Fr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},cw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,uw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function hw(n){const t={},e=n.split(Fr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Fr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Fr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Fr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function fw(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function mw(n,t){if(t===null)return new Date(NaN);const e=n.match(cw);if(!e)return new Date(NaN);const i=!!e[4],s=ws(e[1]),r=ws(e[2])-1,o=ws(e[3]),a=ws(e[4]),l=ws(e[5])-1;if(i)return ww(t,a,l)?yw(t,a,l):new Date(NaN);{const c=new Date(0);return!_w(t,r,o)||!xw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function ws(n){return n?parseInt(n):1}function gw(n){const t=n.match(uw);if(!t)return NaN;const e=Ra(t[1]),i=Ra(t[2]),s=Ra(t[3]);return vw(e,i,s)?e*yi+i*ps+s*1e3:NaN}function Ra(n){return n&&parseFloat(n.replace(",","."))||0}function pw(n){if(n==="Z")return 0;const t=n.match(dw);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Mw(i,s)?e*(i*yi+s*ps):NaN}function yw(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const bw=[31,null,31,30,31,30,31,31,30,31,30,31];function oh(n){return n%400===0||n%4===0&&n%100!==0}function _w(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(bw[t]||(oh(n)?29:28))}function xw(n,t){return t>=1&&t<=(oh(n)?366:365)}function ww(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function vw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Mw(n,t){return t>=0&&t<=59}const zr=n=>["interactive","zoom-interactive"].includes(n),ah=(n,t,e,i)=>{var o,a;const{tooltip:s}=t;if(s.opacity===0&&!zr(n.interactionMode)){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(s.body&&!zr(n.interactionMode)){const l=s.labelColors,c=((a=(o=t.chart.config)==null?void 0:o.options)==null?void 0:a.indexAxis)==="y"?"x":"y";n.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(s.dataPoints[0].parsed.x,e):Ss({tickValue:new Date(s.dataPoints[0].parsed.x),granularity:e}),n.tooltipSeries=s.dataPoints.map((u,h)=>{const f=u.parsed[c],m=zh(f,n.units,{translateUnit:n.translateUnit}),g=u.dataset.label;return{backgroundColor:l[h].backgroundColor,borderColor:l[h].borderColor,label:g,value:m,rawValue:f,isSegmentEmpty:u.dataset.isSegmentEmpty}}).sort(r),n.left=`${s.x}px`,n.top=`${s.y}px`,n.showTooltip=!0}},lh=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!zr(n.interactionMode)){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!zr(n.interactionMode)){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["gauge","donut"].includes(n.chartType);l?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((c,u)=>{const h=l?c.parsed:c.parsed[a],f=zh(h,n.units,{translateUnit:n.translateUnit});let m;return l?m=c.dataset.labels[c.dataIndex]:m=c.dataset.label,{backgroundColor:o[u].backgroundColor,borderColor:o[u].borderColor,label:m,value:f,rawValue:h,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Sw=n=>n&&n.datasets&&n.datasets.length,kw=n=>Sw(n)&&n.datasets.some(t=>t.data.length),Dw=n=>n.datasets.some(t=>t.data[0]&&ka(t.data[0].x)),Tw=n=>!!kw(n)&&n.datasets.some(t=>t.data.length==1),Cw=n=>Dw(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Ia=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},Pw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function La(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const ch=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},Ow=2,uh=10,dh=12,Na=new Intl.NumberFormat(((Fm=document==null?void 0:document.documentElement)==null?void 0:Fm.lang)||"en-US"),Br=10,hh="#6c7489",Ew="#d60027",Fa="#6c7489",Aw="#995c00",Rw="#ffc400",za="16px",Iw="20px",Lw="'Inter', Roboto, Helvetica, sans-serif",fh="24px",Nw="40px",Fw="48px",mh={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},sn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Hr=(n,t)=>(t||sn)[n%sn.length],gh=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},ph="#6f7787",yh={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},zw=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=yh[t])==null?void 0:e.background)||"#fafafa"},Bw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},Hw={"4XX":"#FFBA81","5XX":"#FF8484"},Ww={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},Vw="#dad4c7",bh="#afb7c5",Yw=n=>{const t=Object.entries(mh).find(([e])=>new RegExp(e).test(n));return t&&t[1]||mh.standard},Ba=(n,t,e,i)=>{let s;return e?s=bh:Array.isArray(i)?s=Hr(n,i):s=i[t],s||Hr(n)},Wr=n=>{switch(n){case"error":return Ew;case"warning":return Rw;case"neutral":return hh;default:return hh}},jw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},$w=2,Uw=0,Ha=new Map,Wa=(n,t)=>t==="bytes"?jr(n):t==="count/minute"?n.toFixed(2):Na.format(n),_h=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},qw=()=>{const n="label_height";if(!Ha.has(n)){const t=It({});Ha.set(n,t.lineHeight)}return Ha.get(n)},Xw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),xh=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),wh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Va="#e0e4ea",Gw={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},vs=(n,t)=>{let e=1;const i=Gw[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},vh=new Map([[100,vs("100",[100,101,102,103])],[200,vs("200",[200,201,202,203,204,205,206,207,208,226])],[300,vs("300",[300,301,302,303,304,305,307,308])],[400,vs("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,vs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Ya=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=vh.get(e);return i===void 0?Va:i.get(t)??i.get(-1)??Va},Kw=n=>{const t=Ya(n);return{solid:t,light:t}},Vr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Ya(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function Mh(n,t,e){const i=th(),s=Jw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Zw(s,t):Qw(s,t)}function Zw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Qw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Jw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function tv(n,t){const e=rv(t);return"formatToParts"in e?nv(e,n):iv(e,n)}const ev={year:0,month:1,day:2,hour:3,minute:4,second:5};function nv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=ev[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function iv(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ja={},Sh=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")),sv=Sh==="06/25/2014, 00:00:00"||Sh==="06/25/2014 00:00:00";function rv(n){return ja[n]||(ja[n]=sv?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ja[n]}function kh(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const Dh=36e5,ov=6e4,$a={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ua(n,t,e){if(!n)return 0;let i=$a.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=$a.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Th(s)?-(s*Dh):NaN;if(i=$a.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Th(s,o)?(r=Math.abs(s)*Dh+o*ov,i[1]==="+"?-r:r):NaN}if(cv(n)){t=new Date(t||Date.now());const o=e?t:av(t),a=qa(o,n);return-(e?a:lv(t,a,n))}return NaN}function av(n){return kh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function qa(n,t){const e=tv(n,t),i=kh(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function lv(n,t,e){let s=n.getTime()-t;const r=qa(new Date(s),e);if(t===r)return t;s-=r-t;const o=qa(new Date(s),e);return r===o?r:Math.max(r,o)}function Th(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Ch={};function cv(n){if(Ch[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Ch[n]=!0,!0}catch{return!1}}const uv=60*1e3,dv={X:function(n,t,e){const i=Xa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ph(i);case"XXXX":case"XX":return xi(i);case"XXXXX":case"XXX":default:return xi(i,":")}},x:function(n,t,e){const i=Xa(e.timeZone,n);switch(t){case"x":return Ph(i);case"xxxx":case"xx":return xi(i);case"xxxxx":case"xxx":default:return xi(i,":")}},O:function(n,t,e){const i=Xa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+hv(i,":");case"OOOO":default:return"GMT"+xi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Mh("short",n,e);case"zzzz":default:return Mh("long",n,e)}}};function Xa(n,t){const e=n?Ua(n,t,!0)/uv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Yr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function xi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Yr(Math.floor(i/60),2),r=Yr(Math.floor(i%60),2);return e+s+t+r}function Ph(n,t){return n%60===0?(n>0?"-":"+")+Yr(Math.abs(n)/60,2):xi(n,t)}function hv(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Yr(r,2)}function Oh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const fv=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ga=36e5,Eh=6e4,mv=2,ue={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:fv};function Ah(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?mv:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=gv(n),{year:s,restDateString:r}=pv(i.date,e),o=yv(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=bv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ua(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=Oh(new Date(a+l)),c=Oh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function gv(n){const t={};let e=ue.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ue.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function pv(n,t){if(n){const e=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ue.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function yv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ue.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Lh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ue.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return wv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ue.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Lh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ue.Www.exec(n),r)return s=parseInt(r[1],10)-1,Nh(s)?Rh(t,s):new Date(NaN);if(r=ue.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Nh(s,o)?Rh(t,s,o):new Date(NaN)}return null}function bv(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ka(t)?t%24*Ga:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ka(t,e)?t%24*Ga+e*Eh:NaN;if(i=ue.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ka(t,e,s)?t%24*Ga+e*Eh+s*1e3:NaN}return null}function Rh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const _v=[31,28,31,30,31,30,31,31,30,31,30,31],xv=[31,29,31,30,31,30,31,31,30,31,30,31];function Ih(n){return n%400===0||n%4===0&&n%100!==0}function Lh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ih(n);if(i&&e>xv[t]||!i&&e>_v[t])return!1}return!0}function wv(n,t){if(t<1)return!1;const e=Ih(n);return!(e&&t>366||!e&&t>365)}function Nh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ka(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const vv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Za(n,t,e={}){t=String(t);const i=t.match(vv);if(i){const s=Ah(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+dv[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Lr(n,t,e)}function Mv(n,t,e){n=Ah(n,e);const i=Ua(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Ms(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Za(Mv(n,t,{timeZone:i.timeZone}),e,i)}const Sv=(n,t)=>`${Ms(n,t,"yyyy")} W${Ms(n,t,"II")}`,Qa="yyyy-MM-dd h:mm:ss a",Ja="h:mm:ss a",Gn="yyyy-MM-dd h:mm a",wi="h:mm a",kv="yyyy-MM-dd",tl="MMM dd, yyyy h:mm:ss a",Dn="MMM dd, yyyy h:mm a",Dv={secondly:n=>n?Qa:Ja,tenSecondly:n=>n?Qa:Ja,thirtySecondly:n=>n?Qa:Ja,minutely:n=>n?Gn:wi,fiveMinutely:n=>n?Gn:wi,tenMinutely:n=>n?Gn:wi,thirtyMinutely:n=>n?Gn:wi,hourly:n=>n?Gn:wi,twoHourly:n=>n?Gn:wi,twelveHourly:()=>Gn,daily:()=>kv},Tv={secondly:()=>tl,tenSecondly:()=>tl,thirtySecondly:()=>tl,minutely:()=>Dn,fiveMinutely:()=>Dn,tenMinutely:()=>Dn,thirtyMinutely:()=>Dn,hourly:()=>Dn,twoHourly:()=>Dn,twelveHourly:()=>Dn,daily:()=>Dn};function Fh({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:r,defaultFormat:o}){const a=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return Sv(n,a);if(s&&s[t]){const l=s[t](i);return Ms(n,a,l)}if(r&&r[t]){const l=r[t]();return Ms(n,a,l)}return Ms(n,a,o)}const Cv=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>Fh({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:Dv,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Ss=({tickValue:n,granularity:t,timezone:e})=>Fh({tickValue:n,granularity:t,timezone:e,tooltipMap:Tv,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),jr=(n,t)=>{if(isNaN(n))return"0 B";const{i18n:e}=bt.useI18n(),i=t?0x4000000000000:1e15,s=t?1099511627776:1e12,r=t?1073741824:1e9,o=t?1048576:1e6,a=t?1024:1e3;let l;return n>=i?l=e.formatNumber(Number.parseFloat((n/i).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):n>=s?l=e.formatNumber(Number.parseFloat((n/s).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):n>=r?l=e.formatNumber(Number.parseFloat((n/r).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):n>=o?l=e.formatNumber(Number.parseFloat((n/o).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):n>=a?l=e.formatNumber(Number.parseFloat((n/a).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):l=e.formatNumber(Number.parseFloat(n.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),l.replace(/([a-zA-Z]*)$/," $1")},Pv=(n,t="USD")=>{if(isNaN(n))return t==="USD"?"$0.00":`${n}`;const{i18n:e}=bt.useI18n();return n>=.01||t!=="USD"?e.formatNumber(n,{style:"currency",currency:t}):n<1e-4?"< $0.0001":`$${Number.parseFloat(n.toPrecision(4))}`},zh=(n,t,{isBytes1024:e=!1,currency:i="USD",translateUnit:s=r=>r}={})=>{const r=s(t,n);switch(t){case"bytes":return jr(n,e);case"usd":return Pv(n,i);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(n)?`${n}`:n>=.01?`${Na.format(Number.parseFloat(n.toFixed(2)))} ${r}`:`${Number.parseFloat(n.toPrecision(4))} ${r}`}},Ov=n=>{var e,i,s,r,o;const{i18n:t}=bt.useI18n();return(n==null?void 0:n.status)===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(n==null?void 0:n.status)===408?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(e=n==null?void 0:n.response)==null?void 0:e.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:((o=(r=(s=n.response)==null?void 0:s.data)==null?void 0:r.invalid_parameters)==null?void 0:o.map(a=>a.reason).join(", "))||(n==null?void 0:n.message)}};function Ev(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Se.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=u.width/2,m=Ia(c,h,f),g=c.y,_=c.x<f?"left":"center";return{x:m-n.tooltipState.offsetX,y:g-n.tooltipState.offsetY,xAlign:_}},sa.modes.customInteractionMode=function(l,c){const u=vn(c,l),h=[];return sa.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,g)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g})}),h};const s=n.numLabels.value>25?uh:dh,r=({chart:l,index:c})=>{var h;const u=l.data;return{size:s,style:(h=u==null?void 0:u.isLabelEmpty)!=null&&h[c]?"italic":"normal"}},o=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Br?c.slice(0,Br)+"...":c):l.getLabelForValue(Number(c)),a=d.computed(()=>{var l,c,u,h,f,m,g,_;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:r,callback:function(x,M){return o(this,x,M)}},title:{display:n.indexAxis==="y"?!at((l=n.metricAxesTitle)==null?void 0:l.value):!at((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(h=n.dimensionAxesTitle)==null?void 0:h.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(x,M){return o(this,x,M)}},title:{display:n.indexAxis==="x"?!at((f=n.metricAxesTitle)==null?void 0:f.value):!at((m=n.dimensionAxesTitle)==null?void 0:m.value),text:n.indexAxis==="x"?(g=n.metricAxesTitle)==null?void 0:g.value:(_=n.dimensionAxesTitle)==null?void 0:_.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{lh(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return d.getCurrentInstance()&&d.onUnmounted(()=>{Se.positioners[e]&&delete Se.positioners[e]}),a}Ce.register(...j0);const Av=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function Rv(n,t,e,i,s){const r=d.shallowRef(null),o=(a,l)=>{if(t.value)return new Ce(t.value,{type:n,data:a,plugins:i,options:l})};return d.onMounted(()=>{r.value=o(e.value,s.value)}),d.onBeforeUnmount(()=>{at(r.value)||r.value.destroy()}),d.watch(e,(a,l)=>{if(Av(l,a)&&!at(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else at(r.value)||r.value.destroy(),r.value=o(a,s.value)}),d.watch(t,()=>{at(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),d.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(at(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function el(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,_){_&&_%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<o?h=e(c,r,u)+"m":c<a?h=t(e(c,o,u),u)+"b":h=t(e(c,a,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(Bh);var Iv=Bh.exports;const ks=el(Iv);function Lv(n,t,e){const{i18n:i}=bt.useI18n(),{translateUnit:s}=bt.useTranslatedUnits();return{legendValues:d.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,h)=>u+(typeof h=="number"?Number(h)||0:Number(h&&h.y)||0),0);let c;if(e.value==="bytes")c=jr(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:ks(l,{capital:!0}),unit:u})||`${ks(l,{capital:!0})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var Nv=Object.defineProperty,Fv=(n,t,e)=>t in n?Nv(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Pe=(n,t,e)=>Fv(n,typeof t!="symbol"?t+"":t,e);const zv=250;var yt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(yt||{});const Bv=["in","not_in","selector"],Hv=["empty","not_empty"],Wv=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ds=n=>n.filter(t=>t!=="time"),Hh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Wh=Ds(Hh),Vv=[...Hh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Vh=Ds(Vv),Yv=["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"],Yh=Ds(Yv);Ds(["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","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"]),Ds(["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"]),new Set(Wh),new Set(Vh),new Set(Yh);const jh=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];jh.map(n=>n.code),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Bv},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Hv}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Vh,...Wh,...Yh])]);const $h=6048e5,jv=864e5,$v=60,Uv=3600,Uh=Symbol.for("constructDateFrom");function Oe(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Uh in n?n[Uh](t):n instanceof Date?new n.constructor(t):new Date(t)}function de(n,t){return Oe(t||n,n)}function qh(n,t,e){const i=de(n,void 0);return isNaN(t)?Oe(n,NaN):(i.setDate(i.getDate()+t),i)}function qv(n,t,e){const i=de(n,void 0);if(isNaN(t))return Oe(n,NaN);const s=i.getDate(),r=Oe(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let Xv={};function Ts(){return Xv}function rn(n,t){var e,i,s,r;const o=Ts(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=de(n,t==null?void 0:t.in),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function $r(n,t){return rn(n,{...t,weekStartsOn:1})}function Xh(n,t){const e=de(n,void 0),i=e.getFullYear(),s=Oe(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=$r(s),o=Oe(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=$r(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Gh(n){const t=de(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Gv(n,...t){const e=Oe.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ur(n,t){const e=de(n,void 0);return e.setHours(0,0,0,0),e}function Kv(n,t,e){const[i,s]=Gv(void 0,n,t),r=Ur(i),o=Ur(s),a=+r-Gh(r),l=+o-Gh(o);return Math.round((a-l)/jv)}function Zv(n,t){const e=Xh(n),i=Oe(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),$r(i)}function Qv(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Jv(n){return!(!Qv(n)&&typeof n!="number"||isNaN(+de(n)))}function vi(n,t){const e=de(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function t1(n,t){const e=de(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const e1={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"}},n1=(n,t,e)=>{let i;const s=e1[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function nl(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const i1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},s1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},r1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o1={date:nl({formats:i1,defaultWidth:"full"}),time:nl({formats:s1,defaultWidth:"full"}),dateTime:nl({formats:r1,defaultWidth:"full"})},a1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},l1=(n,t,e,i)=>a1[n];function Cs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const c1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},u1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},d1={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"]},h1={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"]},f1={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"}},m1={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"}},g1=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},p1={ordinalNumber:g1,era:Cs({values:c1,defaultWidth:"wide"}),quarter:Cs({values:u1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Cs({values:d1,defaultWidth:"wide"}),day:Cs({values:h1,defaultWidth:"wide"}),dayPeriod:Cs({values:f1,defaultWidth:"wide",formattingValues:m1,defaultFormattingWidth:"wide"})};function Ps(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?b1(a,h=>h.test(o)):y1(a,h=>h.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function y1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function b1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function _1(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const x1=/^(\d+)(th|st|nd|rd)?/i,w1=/\d+/i,v1={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},M1={any:[/^b/i,/^(a|c)/i]},S1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},k1={any:[/1/i,/2/i,/3/i,/4/i]},D1={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},T1={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]},C1={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},P1={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]},O1={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},E1={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}},A1={ordinalNumber:_1({matchPattern:x1,parsePattern:w1,valueCallback:n=>parseInt(n,10)}),era:Ps({matchPatterns:v1,defaultMatchWidth:"wide",parsePatterns:M1,defaultParseWidth:"any"}),quarter:Ps({matchPatterns:S1,defaultMatchWidth:"wide",parsePatterns:k1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ps({matchPatterns:D1,defaultMatchWidth:"wide",parsePatterns:T1,defaultParseWidth:"any"}),day:Ps({matchPatterns:C1,defaultMatchWidth:"wide",parsePatterns:P1,defaultParseWidth:"any"}),dayPeriod:Ps({matchPatterns:O1,defaultMatchWidth:"any",parsePatterns:E1,defaultParseWidth:"any"})},R1={code:"en-US",formatDistance:n1,formatLong:o1,formatRelative:l1,localize:p1,match:A1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function I1(n,t){const e=de(n,void 0);return Kv(e,t1(e))+1}function L1(n,t){const e=de(n,void 0),i=+$r(e)-+Zv(e);return Math.round(i/$h)+1}function Kh(n,t){var e,i,s,r;const o=de(n,t==null?void 0:t.in),a=o.getFullYear(),l=Ts(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Oe((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const h=rn(u,t),f=Oe((t==null?void 0:t.in)||n,0);f.setFullYear(a,0,c),f.setHours(0,0,0,0);const m=rn(f,t);return+o>=+h?a+1:+o>=+m?a:a-1}function N1(n,t){var e,i,s,r;const o=Ts(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Kh(n,t),c=Oe((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),rn(c,t)}function F1(n,t){const e=de(n,t==null?void 0:t.in),i=+rn(e,t)-+N1(e,t);return Math.round(i/$h)+1}function Ct(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Tn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Ct(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Ct(e+1,2)},d(n,t){return Ct(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Ct(n.getHours()%12||12,t.length)},H(n,t){return Ct(n.getHours(),t.length)},m(n,t){return Ct(n.getMinutes(),t.length)},s(n,t){return Ct(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Ct(s,t.length)}},Mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Tn.y(n,t)},Y:function(n,t,e,i){const s=Kh(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Ct(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Ct(r,t.length)},R:function(n,t){const e=Xh(n);return Ct(e,t.length)},u:function(n,t){const e=n.getFullYear();return Ct(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ct(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ct(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Tn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Ct(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=F1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Ct(s,t.length)},I:function(n,t,e){const i=L1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Ct(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Tn.d(n,t)},D:function(n,t,e){const i=I1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Ct(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Ct(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Ct(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Ct(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Mi.noon:i===0?s=Mi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Mi.evening:i>=12?s=Mi.afternoon:i>=4?s=Mi.morning:s=Mi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Tn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Tn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Tn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Tn.s(n,t)},S:function(n,t){return Tn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Jh(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Jh(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Qh(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Qh(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Ct(i,t.length)},T:function(n,t,e){return Ct(+n,t.length)}};function Qh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Ct(r,2)}function Jh(n,t){return n%60===0?(n>0?"-":"+")+Ct(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ct(Math.trunc(i/60),2),r=Ct(i%60,2);return e+s+t+r}const tf=(n,t)=>{switch(n){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"})}},ef=(n,t)=>{switch(n){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"})}},z1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return tf(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",tf(i,t)).replace("{{time}}",ef(s,t))},B1={p:ef,P:z1},H1=/^D+$/,W1=/^Y+$/,V1=["D","DD","YY","YYYY"];function Y1(n){return H1.test(n)}function j1(n){return W1.test(n)}function $1(n,t,e){const i=U1(n,t,e);if(console.warn(i),V1.includes(n))throw new RangeError(i)}function U1(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const q1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,X1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,G1=/^'([^]*?)'?$/,K1=/''/g,Z1=/[a-zA-Z]/;function Q1(n,t,e){var i,s,r,o,a,l,c,u;const h=Ts(),f=(e==null?void 0:e.locale)??h.locale??R1,m=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??h.firstWeekContainsDate??((o=(r=h.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,g=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??h.weekStartsOn??((u=(c=h.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,_=de(n,e==null?void 0:e.in);if(!Jv(_))throw new RangeError("Invalid time value");let x=t.match(X1).map(v=>{const T=v[0];if(T==="p"||T==="P"){const k=B1[T];return k(v,f.formatLong)}return v}).join("").match(q1).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const T=v[0];if(T==="'")return{isToken:!1,value:J1(v)};if(Zh[T])return{isToken:!0,value:v};if(T.match(Z1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:v}});f.localize.preprocessor&&(x=f.localize.preprocessor(_,x));const M={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(v=>{if(!v.isToken)return v.value;const T=v.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&j1(T)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Y1(T))&&$1(T,t,String(n));const k=Zh[T[0]];return k(_,T,f.localize,M)}).join("")}function J1(n){const t=n.match(G1);return t?t[1].replace(K1,"'"):n}function tM(n,t){const e=de(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Oe(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function eM(){return Object.assign({},Ts())}function nM(n){return Math.trunc(n*Uv)}function iM(n){const t=n/$v;return Math.trunc(t)}function nf(n,t,e){return qv(n,-1)}function sf(n,t,e){const i=eM(),s=oM(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?sM(s,t):rM(s,t)}function sM(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function rM(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function oM(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function aM(n,t){const e=hM(t);return"formatToParts"in e?cM(e,n):uM(e,n)}const lM={year:0,month:1,day:2,hour:3,minute:4,second:5};function cM(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=lM[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function uM(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const il={},rf=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")),dM=rf==="06/25/2014, 00:00:00"||rf==="06/25/2014 00:00:00";function hM(n){return il[n]||(il[n]=dM?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),il[n]}function sl(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const of=36e5,fM=6e4,rl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Os(n,t,e){if(!n)return 0;let i=rl.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=rl.timezoneHH.exec(n),i)return s=parseInt(i[1],10),af(s)?-(s*of):NaN;if(i=rl.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return af(s,o)?(r=Math.abs(s)*of+o*fM,i[1]==="+"?-r:r):NaN}if(pM(n)){t=new Date(t||Date.now());const o=e?t:mM(t),a=ol(o,n);return-(e?a:gM(t,a,n))}return NaN}function mM(n){return sl(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function ol(n,t){const e=aM(n,t),i=sl(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function gM(n,t,e){let i=n.getTime()-t;const s=ol(new Date(i),e);if(t===s)return t;i-=s-t;const r=ol(new Date(i),e);return s===r?s:Math.max(s,r)}function af(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const lf={};function pM(n){if(lf[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),lf[n]=!0,!0}catch{return!1}}const yM=60*1e3,bM={X:function(n,t,e){const i=al(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return cf(i);case"XXXX":case"XX":return Si(i);case"XXXXX":case"XXX":default:return Si(i,":")}},x:function(n,t,e){const i=al(e.timeZone,n);switch(t){case"x":return cf(i);case"xxxx":case"xx":return Si(i);case"xxxxx":case"xxx":default:return Si(i,":")}},O:function(n,t,e){const i=al(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+_M(i,":");case"OOOO":default:return"GMT"+Si(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return sf("short",n,e);case"zzzz":default:return sf("long",n,e)}}};function al(n,t){const e=n?Os(n,t,!0)/yM:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function qr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Si(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=qr(Math.floor(i/60),2),r=qr(Math.floor(i%60),2);return e+s+t+r}function cf(n,t){return n%60===0?(n>0?"-":"+")+qr(Math.abs(n)/60,2):Si(n,t)}function _M(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+qr(r,2)}function uf(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const df=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ll=36e5,hf=6e4,xM=2,he={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:df};function Xr(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?xM:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=wM(n),{year:s,restDateString:r}=vM(i.date,e),o=MM(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=SM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Os(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=uf(new Date(a+l)),c=uf(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function wM(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function vM(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function MM(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,gf(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return TM(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return gf(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,pf(s)?ff(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return pf(s,o)?ff(t,s,o):new Date(NaN)}return null}function SM(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),cl(t)?t%24*ll:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),cl(t,e)?t%24*ll+e*hf:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return cl(t,e,s)?t%24*ll+e*hf+s*1e3:NaN}return null}function ff(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const kM=[31,28,31,30,31,30,31,31,30,31,30,31],DM=[31,29,31,30,31,30,31,31,30,31,30,31];function mf(n){return n%400===0||n%4===0&&n%100!==0}function gf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=mf(n);if(i&&e>DM[t]||!i&&e>kM[t])return!1}return!0}function TM(n,t){if(t<1)return!1;const e=mf(n);return!(e&&t>366||!e&&t>365)}function pf(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function cl(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const CM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function PM(n,t,e={}){t=String(t);const i=t.match(CM);if(i){const s=Xr(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+bM[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Q1(n,t,e)}function yf(n,t,e){n=Xr(n,e);const i=Os(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function OM(n,t,e,i){return i={...i,timeZone:t,originalDate:n},PM(yf(n,t,{timeZone:i.timeZone}),e,i)}function EM(n,t,e){if(typeof n=="string"&&!n.match(df))return Xr(n,{...e,timeZone:t});n=Xr(n,e);const i=sl(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Os(t,new Date(i));return new Date(i+s)}function AM(n,t){return-Os(n,t)}function ul(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return OM(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const RM={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 dl(n){return n&&Wv.find(t=>n<=RM[t])||null}var Gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Kr={exports:{}};Kr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",g="[object Object]",_="[object Promise]",x="[object RegExp]",M="[object Set]",v="[object String]",T="[object Symbol]",k="[object WeakMap]",C="[object ArrayBuffer]",I="[object DataView]",P="[object Float32Array]",y="[object Float64Array]",b="[object Int8Array]",S="[object Int16Array]",O="[object Int32Array]",R="[object Uint8Array]",A="[object Uint8ClampedArray]",z="[object Uint16Array]",U="[object Uint32Array]",X=/[\\^$.*+?()[\]{}|]/g,W=/\w*$/,ct=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,tt={};tt[r]=tt[o]=tt[C]=tt[I]=tt[a]=tt[l]=tt[P]=tt[y]=tt[b]=tt[S]=tt[O]=tt[f]=tt[m]=tt[g]=tt[x]=tt[M]=tt[v]=tt[T]=tt[R]=tt[A]=tt[z]=tt[U]=!0,tt[c]=tt[u]=tt[k]=!1;var et=typeof Gr=="object"&&Gr&&Gr.Object===Object&&Gr,G=typeof self=="object"&&self&&self.Object===Object&&self,j=et||G||Function("return this")(),$=t&&!t.nodeType&&t,Z=$&&!0&&n&&!n.nodeType&&n,_t=Z&&Z.exports===$;function gt(w,L){return w.set(L[0],L[1]),w}function pt(w,L){return w.add(L),w}function B(w,L){for(var F=-1,K=w?w.length:0;++F<K&&L(w[F],F,w)!==!1;);return w}function Y(w,L){for(var F=-1,K=L.length,jt=w.length;++F<K;)w[jt+F]=L[F];return w}function V(w,L,F,K){for(var jt=-1,Kt=w?w.length:0;++jt<Kt;)F=L(F,w[jt],jt,w);return F}function J(w,L){for(var F=-1,K=Array(w);++F<w;)K[F]=L(F);return K}function nt(w,L){return w==null?void 0:w[L]}function it(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function rt(w){var L=-1,F=Array(w.size);return w.forEach(function(K,jt){F[++L]=[jt,K]}),F}function st(w,L){return function(F){return w(L(F))}}function wt(w){var L=-1,F=Array(w.size);return w.forEach(function(K){F[++L]=K}),F}var ut=Array.prototype,Pt=Function.prototype,te=Object.prototype,ae=j["__core-js_shared__"],qt=function(){var w=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Ee=Pt.toString,Mt=te.hasOwnProperty,Xt=te.toString,Bt=RegExp("^"+Ee.call(Mt).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=_t?j.Buffer:void 0,ie=j.Symbol,qe=j.Uint8Array,ni=st(Object.getPrototypeOf,Object),Fe=Object.create,Ht=te.propertyIsEnumerable,_e=ut.splice,ii=Object.getOwnPropertySymbols,ho=Gt?Gt.isBuffer:void 0,fo=st(Object.keys,Object),Bs=In(j,"DataView"),si=In(j,"Map"),Hs=In(j,"Promise"),ri=In(j,"Set"),an=In(j,"WeakMap"),ln=In(Object,"create"),Ws=le(Bs),Vs=le(si),oi=le(Hs),Il=le(ri),Ll=le(an),mo=ie?ie.prototype:void 0,go=mo?mo.valueOf:void 0;function cn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var K=w[L];this.set(K[0],K[1])}}function Ai(){this.__data__=ln?ln(null):{}}function Ys(w){return this.has(w)&&delete this.__data__[w]}function po(w){var L=this.__data__;if(ln){var F=L[w];return F===i?void 0:F}return Mt.call(L,w)?L[w]:void 0}function un(w){var L=this.__data__;return ln?L[w]!==void 0:Mt.call(L,w)}function Nl(w,L){var F=this.__data__;return F[w]=ln&&L===void 0?i:L,this}cn.prototype.clear=Ai,cn.prototype.delete=Ys,cn.prototype.get=po,cn.prototype.has=un,cn.prototype.set=Nl;function ze(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var K=w[L];this.set(K[0],K[1])}}function Fl(){this.__data__=[]}function zl(w){var L=this.__data__,F=Ii(L,w);if(F<0)return!1;var K=L.length-1;return F==K?L.pop():_e.call(L,F,1),!0}function Bl(w){var L=this.__data__,F=Ii(L,w);return F<0?void 0:L[F][1]}function Be(w){return Ii(this.__data__,w)>-1}function Hl(w,L){var F=this.__data__,K=Ii(F,w);return K<0?F.push([w,L]):F[K][1]=L,this}ze.prototype.clear=Fl,ze.prototype.delete=zl,ze.prototype.get=Bl,ze.prototype.has=Be,ze.prototype.set=Hl;function An(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var K=w[L];this.set(K[0],K[1])}}function Wl(){this.__data__={hash:new cn,map:new(si||ze),string:new cn}}function Vl(w){return Fi(this,w).delete(w)}function Yl(w){return Fi(this,w).get(w)}function He(w){return Fi(this,w).has(w)}function jl(w,L){return Fi(this,w).set(w,L),this}An.prototype.clear=Wl,An.prototype.delete=Vl,An.prototype.get=Yl,An.prototype.has=He,An.prototype.set=jl;function Rn(w){this.__data__=new ze(w)}function $l(){this.__data__=new ze}function Ul(w){return this.__data__.delete(w)}function ql(w){return this.__data__.get(w)}function Ri(w){return this.__data__.has(w)}function Xl(w,L){var F=this.__data__;if(F instanceof ze){var K=F.__data__;if(!si||K.length<e-1)return K.push([w,L]),this;F=this.__data__=new An(K)}return F.set(w,L),this}Rn.prototype.clear=$l,Rn.prototype.delete=Ul,Rn.prototype.get=ql,Rn.prototype.has=Ri,Rn.prototype.set=Xl;function Gl(w,L){var F=qs(w)||Bi(w)?J(w.length,String):[],K=F.length,jt=!!K;for(var Kt in w)Mt.call(w,Kt)&&!(jt&&(Kt=="length"||hc(Kt,K)))&&F.push(Kt);return F}function Ae(w,L,F){var K=w[L];(!(Mt.call(w,L)&&Us(K,F))||F===void 0&&!(L in w))&&(w[L]=F)}function Ii(w,L){for(var F=w.length;F--;)if(Us(w[F][0],L))return F;return-1}function Kl(w,L){return w&&yo(L,ai(L),w)}function js(w,L,F,K,jt,Kt,xe){var ee;if(K&&(ee=Kt?K(w,jt,Kt,xe):K(w)),ee!==void 0)return ee;if(!hn(w))return w;var So=qs(w);if(So){if(ee=uc(w),!L)return ac(w,ee)}else{var Ln=Xe(w),ko=Ln==u||Ln==h;if(wo(w))return ec(w,L);if(Ln==g||Ln==r||ko&&!Kt){if(it(w))return Kt?w:{};if(ee=_o(ko?{}:w),!L)return lc(w,Kl(ee,w))}else{if(!tt[Ln])return Kt?w:{};ee=dc(w,Ln,js,L)}}xe||(xe=new Rn);var Do=xe.get(w);if(Do)return Do;if(xe.set(w,ee),!So)var li=F?cc(w):ai(w);return B(li||w,function(Gs,Hi){li&&(Hi=Gs,Gs=w[Hi]),Ae(ee,Hi,js(Gs,L,F,K,Hi,w,xe))}),ee}function Zl(w){return hn(w)?Fe(w):{}}function Ql(w,L,F){var K=L(w);return qs(w)?K:Y(K,F(w))}function Jl(w){return Xt.call(w)}function Li(w){if(!hn(w)||fc(w))return!1;var L=Xs(w)||it(w)?Bt:ct;return L.test(le(w))}function tc(w){if(!dn(w))return fo(w);var L=[];for(var F in Object(w))Mt.call(w,F)&&F!="constructor"&&L.push(F);return L}function ec(w,L){if(L)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function Ni(w){var L=new w.constructor(w.byteLength);return new qe(L).set(new qe(w)),L}function nc(w,L){var F=L?Ni(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function ic(w,L,F){var K=L?F(rt(w),!0):rt(w);return V(K,gt,new w.constructor)}function $s(w){var L=new w.constructor(w.source,W.exec(w));return L.lastIndex=w.lastIndex,L}function sc(w,L,F){var K=L?F(wt(w),!0):wt(w);return V(K,pt,new w.constructor)}function rc(w){return go?Object(go.call(w)):{}}function oc(w,L){var F=L?Ni(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function ac(w,L){var F=-1,K=w.length;for(L||(L=Array(K));++F<K;)L[F]=w[F];return L}function yo(w,L,F,K){F||(F={});for(var jt=-1,Kt=L.length;++jt<Kt;){var xe=L[jt],ee=void 0;Ae(F,xe,ee===void 0?w[xe]:ee)}return F}function lc(w,L){return yo(w,bo(w),L)}function cc(w){return Ql(w,ai,bo)}function Fi(w,L){var F=w.__data__;return zi(L)?F[typeof L=="string"?"string":"hash"]:F.map}function In(w,L){var F=nt(w,L);return Li(F)?F:void 0}var bo=ii?st(ii,Object):vo,Xe=Jl;(Bs&&Xe(new Bs(new ArrayBuffer(1)))!=I||si&&Xe(new si)!=f||Hs&&Xe(Hs.resolve())!=_||ri&&Xe(new ri)!=M||an&&Xe(new an)!=k)&&(Xe=function(w){var L=Xt.call(w),F=L==g?w.constructor:void 0,K=F?le(F):void 0;if(K)switch(K){case Ws:return I;case Vs:return f;case oi:return _;case Il:return M;case Ll:return k}return L});function uc(w){var L=w.length,F=w.constructor(L);return L&&typeof w[0]=="string"&&Mt.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function _o(w){return typeof w.constructor=="function"&&!dn(w)?Zl(ni(w)):{}}function dc(w,L,F,K){var jt=w.constructor;switch(L){case C:return Ni(w);case a:case l:return new jt(+w);case I:return nc(w,K);case P:case y:case b:case S:case O:case R:case A:case z:case U:return oc(w,K);case f:return ic(w,K,F);case m:case v:return new jt(w);case x:return $s(w);case M:return sc(w,K,F);case T:return rc(w)}}function hc(w,L){return L=L??s,!!L&&(typeof w=="number"||q.test(w))&&w>-1&&w%1==0&&w<L}function zi(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function fc(w){return!!qt&&qt in w}function dn(w){var L=w&&w.constructor,F=typeof L=="function"&&L.prototype||te;return w===F}function le(w){if(w!=null){try{return Ee.call(w)}catch{}try{return w+""}catch{}}return""}function mc(w){return js(w,!0,!0)}function Us(w,L){return w===L||w!==w&&L!==L}function Bi(w){return gc(w)&&Mt.call(w,"callee")&&(!Ht.call(w,"callee")||Xt.call(w)==r)}var qs=Array.isArray;function xo(w){return w!=null&&pc(w.length)&&!Xs(w)}function gc(w){return fn(w)&&xo(w)}var wo=ho||Mo;function Xs(w){var L=hn(w)?Xt.call(w):"";return L==u||L==h}function pc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function hn(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function fn(w){return!!w&&typeof w=="object"}function ai(w){return xo(w)?Gl(w):tc(w)}function vo(){return[]}function Mo(){return!1}n.exports=mc}(Kr,Kr.exports),Kr.exports;const ki=(n,t)=>new Date(n.getTime()-AM(t,n));class Ne{constructor(t){Pe(this,"timeframeText"),Pe(this,"key"),Pe(this,"display"),Pe(this,"timeframeLength"),Pe(this,"allowedTiers"),Pe(this,"defaultResponseGranularity"),Pe(this,"dataGranularity"),Pe(this,"isRelative"),Pe(this,"fineGrainedDefaultGranularity"),Pe(this,"_startCustom"),Pe(this,"_endCustom"),Pe(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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}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 e=EM(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return yf(e,t)}}class IM extends Ne{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class LM extends Ne{rawStart(t){let e=vi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class NM extends Ne{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=ki(i,t)),i}}class FM extends Ne{rawEnd(t){let e=vi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}rawStart(t){let e=vi(nf(this.tzAdjustedDate(t)));return t&&(e=ki(e,t)),e}}yt.FIFTEEN_MIN,new Ne({key:yt.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"]}),yt.ONE_HOUR,new Ne({key:yt.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"]}),yt.SIX_HOUR,new Ne({key:yt.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"]}),yt.TWELVE_HOUR,new Ne({key:yt.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"]}),yt.ONE_DAY,new Ne({key:yt.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"]}),yt.SEVEN_DAY,new Ne({key:yt.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"]}),yt.THIRTY_DAY,new Ne({key:yt.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"]}),yt.CURRENT_WEEK,new IM({key:yt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Ur(qh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),yt.CURRENT_MONTH,new LM({key:yt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=vi(new Date);return(Ur(qh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),yt.PREVIOUS_WEEK,new NM({key:yt.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"]}),yt.PREVIOUS_MONTH,new FM({key:yt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=vi(new Date),e=vi(nf(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=zM(t,e)),60*60*24*tM(new Date().setMonth(new Date().getMonth()-1))+nM(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function zM(n,t){return iM(n.getTimezoneOffset()-t.getTimezoneOffset())}yt.FIFTEEN_MIN,yt.ONE_HOUR,yt.SIX_HOUR,yt.TWELVE_HOUR,yt.ONE_DAY,yt.SEVEN_DAY,yt.FIFTEEN_MIN,yt.ONE_HOUR,yt.SIX_HOUR,yt.TWELVE_HOUR,yt.ONE_DAY,yt.SEVEN_DAY,yt.THIRTY_DAY,yt.CURRENT_WEEK,yt.CURRENT_MONTH,yt.PREVIOUS_WEEK,yt.PREVIOUS_MONTH;const BM=new Map(jh.map(n=>[n.code,{code:n.code,name:n.name}])),hl=n=>{var t;return((t=BM.get(n))==null?void 0:t.name)||n};function HM(n){return d.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${ul(e)} - ${ul(i,{includeTZ:!0})}`:""})}function WM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};Se.positioners[e]=function(r,o){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=a.width/2,u=Ia(o,l,c),h=o.y,f=o.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{lh(n.tooltipState,r)}}}}));return d.onUnmounted(()=>{Se.positioners[e]&&delete Se.positioners[e]}),{options:s}}function VM(n){const t=d.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return Cv({tickValue:h,granularity:n.granularity.value,dayBoundaryCrossed:o.value})}},title:{display:!at((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=d.computed(()=>{var l,c;return{title:{display:!at((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};Se.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,m=u.width/2,g=u.height/2,_=Ia(c,h,m);let x=Pw(c,f,g);const M=c.y<g?"top":"bottom",v=c.x<m?"left":"center";return f>u.height&&(x=0),{x:_,y:x,xAlign:v,yAlign:M}};const o=d.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return lw(l)>24||u.getDate()!==c.getDate()}),a=d.computed(()=>{var l,c;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:u=>{ah(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:(c=n.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1}}});return d.onUnmounted(()=>{Se.positioners[s]&&delete Se.positioners[s]}),{options:a}}function YM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=bt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Hr(i.indexOf(u),sn),data:o.map((h,f)=>e?r[`${h.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=Ba(h,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:o.map(m=>r[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function jM(n,t){const{i18n:e}=bt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0,u=c&&a.length>1;if(!s.length||!o)return{datasets:[],labels:[]};const h=c&&a||o,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(l?s.flatMap(b=>o.map((S,O)=>{const R=b.event[f],A=c?`${R},${S}`:`${O},${S}`,z=b.event[S];return[A,z]})):s.map(b=>{const S=c?`${b.event[f]},${b.event[m]}`:`${f},${m}`,O=b.event[o[0]];return[S,O]})),_=Object.keys(g).reduce((b,S)=>{const[O]=S.split(","),R=g[S];return b[O]?b[O]+=R:b[O]=R,b},{}),x=Object.entries(_).sort(([,b],[,S])=>Number(S)-Number(b)).map(([b])=>b),M=r[f],v=r[m];let T=c&&M&&Object.entries(M).map(([b,S])=>({id:b,name:S.name}))||o.map(b=>({id:b,name:b})),k=c&&v&&Object.entries(v).map(([b,S])=>({id:b,name:S.name}))||o.map(b=>({id:b,name:b}));if(c&&f==="country_code"&&(T=T.map(b=>({...b,name:hl(b.id)||b.name}))),c&&m==="country_code"&&(k=k.map(b=>({...b,name:hl(b.id)||b.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(T.sort((b,S)=>x.indexOf(b.id)-x.indexOf(S.id)),k.sort((b,S)=>x.indexOf(b.id)-x.indexOf(S.id))),!T||!k)return{labels:[],datasets:[]};const C=YM({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:h,barSegmentLabels:k,pivotRecords:g,rowLabels:T,colorPalette:n.colorPalette||sn}),I=c?T.map(b=>e&&e.te(`chartLabels.${b.name}`)&&e.t(`chartLabels.${b.name}`)||b.name):o.map(b=>e&&e.te(`chartLabels.${b}`)&&e.t(`chartLabels.${b}`)||b),P=T.map(b=>b.id==="empty");return{labels:I,datasets:C,isLabelEmpty:P,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const $M=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),UM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return rh(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},qM=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return $M(a,l,e)};function XM(n,t){const{i18n:e}=bt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],h=r[u];let f=r&&h&&Object.keys(h).map(k=>({id:k,name:h[k].name}))||o.map(k=>({id:k,name:k}));u==="country_code"&&(f=f.map(k=>({...k,name:hl(k.id)||k.name})));const m=t.value.meta.granularity_ms;if(typeof m!="number"||isNaN(m)||!isFinite(m)||m===0)return console.error("Invalid step value:",m),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const g=UM(a),_=qM(a,l,m,g,s),x=new Set,M=s!=null&&s.length?s.reduce((k,C)=>{const I=new Date(C.timestamp).valueOf(),P=C.event;for(const y of o)x.add(y),I in k||(k[I]={}),y in k[I]||(k[I][y]={});for(const y of o)f.forEach(b=>{P[u]===b.id||y===b.id?(k[I][y]||(k[I][y]={}),k[I][y][b.name]=Math.round(Number(P[y])*1e3)/1e3):c.length||(k[I][y]||(k[I][y]={}),k[I][y][b.name]=Math.round(Number(P[b.id])*1e3)/1e3)});return k},{}):{},T=[...o.length===1?o.flatMap(k=>f.map(C=>[k,C.name,C.id==="empty"])):f.map(k=>[k.name,k.name,k.id==="empty"])].map(([k,C,I],P)=>{const y=_.map(R=>R in M&&k in M[R]?{x:R,y:M[R][k][C]||0}:{x:R,y:0});let{colorPalette:b,fill:S}=n;at(b)&&(b=sn);const O=Ba(P,C,I,b);return{rawDimension:C,rawMetric:k,label:e&&e.te(`chartLabels.${C}`)&&e.t(`chartLabels.${C}`)||C,borderColor:O,backgroundColor:O,data:y,total:y.reduce((R,{y:A})=>R+Number(A),0),...jw,fill:S,borderWidth:S?Uw:$w,isSegmentEmpty:I}});return u==="status_code"||u==="status_code_grouped"?T.sort((k,C)=>(k.label??"")<(C.label??"")?-1:1):T.sort((k,C)=>Number(k.total)<Number(C.total)?-1:1),{datasets:T}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const GM=(n,t)=>{d.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function KM(){const{i18n:n}=bt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const bf="analytics-query-provider",_f=2;function ZM(){const n=d.inject(bf);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function fl(n){return d.getCurrentScope()?(d.onScopeDispose(n),!0):!1}const xf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const QM=n=>n!=null,JM=Object.prototype.toString,tS=n=>JM.call(n)==="[object Object]";function Zr(n){return Array.isArray(n)?n:[n]}function eS(n){return d.getCurrentInstance()}function nS(n,t={}){if(!d.isRef(n))return d.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=d.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=d.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return e}function iS(n,t=!0,e){eS()?d.onMounted(n,e):t?n():d.nextTick(n)}function sS(n,t,e){return d.watch(n,t,{...e,immediate:!0})}const Qr=xf?window:void 0;function Di(n){var t;const e=d.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Es(...n){const t=[],e=()=>{t.forEach(a=>a()),t.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=d.computed(()=>{const a=Zr(d.toValue(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=sS(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Di(c)))!=null?l:[Qr].filter(c=>c!=null),Zr(d.toValue(s.value?n[1]:n[0])),Zr(d.unref(s.value?n[2]:n[1])),d.toValue(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(e(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=tS(u)?{...u}:u;t.push(...a.flatMap(f=>l.flatMap(m=>c.map(g=>i(f,m,g,h)))))},{flush:"post"}),o=()=>{r(),e()};return fl(e),o}function rS(){const n=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{n.value=!0},t),n}function wf(n){const t=rS();return d.computed(()=>(t.value,!!n()))}function oS(n,t,e={}){const{window:i=Qr,...s}=e;let r;const o=wf(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const f=d.toValue(n),m=Zr(f).map(Di).filter(QM);return new Set(m)}),c=d.watch(()=>l.value,f=>{a(),o.value&&f.size&&(r=new MutationObserver(t),f.forEach(m=>r.observe(m,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),h=()=>{c(),a()};return fl(h),{isSupported:o,stop:h,takeRecords:u}}function aS(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:o,onMove:a,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=Qr,containerElement:m,handle:g=n,buttons:_=[0]}=t,x=d.ref((e=d.toValue(u))!=null?e:{x:0,y:0}),M=d.ref(),v=P=>i?i.includes(P.pointerType):!0,T=P=>{d.toValue(s)&&P.preventDefault(),d.toValue(r)&&P.stopPropagation()},k=P=>{var y;if(!d.toValue(_).includes(P.button)||d.toValue(t.disabled)||!v(P)||d.toValue(o)&&P.target!==d.toValue(n))return;const b=d.toValue(m),S=(y=b==null?void 0:b.getBoundingClientRect)==null?void 0:y.call(b),O=d.toValue(n).getBoundingClientRect(),R={x:P.clientX-(b?O.left-S.left+b.scrollLeft:O.left),y:P.clientY-(b?O.top-S.top+b.scrollTop:O.top)};(c==null?void 0:c(R,P))!==!1&&(M.value=R,T(P))},C=P=>{if(d.toValue(t.disabled)||!v(P)||!M.value)return;const y=d.toValue(m),b=d.toValue(n).getBoundingClientRect();let{x:S,y:O}=x.value;(h==="x"||h==="both")&&(S=P.clientX-M.value.x,y&&(S=Math.min(Math.max(0,S),y.scrollWidth-b.width))),(h==="y"||h==="both")&&(O=P.clientY-M.value.y,y&&(O=Math.min(Math.max(0,O),y.scrollHeight-b.height))),x.value={x:S,y:O},a==null||a(x.value,P),T(P)},I=P=>{d.toValue(t.disabled)||!v(P)||M.value&&(M.value=void 0,l==null||l(x.value,P),T(P))};if(xf){const P=()=>{var y;return{capture:(y=t.capture)!=null?y:!0,passive:!d.toValue(s)}};Es(g,"pointerdown",k,P),Es(f,"pointermove",C,P),Es(f,"pointerup",I,P)}return{...nS(x),position:x,isDragging:d.computed(()=>!!M.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function lS(n,t,e={}){const{window:i=Qr,...s}=e;let r;const o=wf(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const h=d.toValue(n);return Array.isArray(h)?h.map(f=>Di(f)):[Di(h)]}),c=d.watch(l,h=>{if(a(),o.value&&i){r=new ResizeObserver(t);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return fl(u),{isSupported:o,stop:u}}function cS(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=t,a=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),g=d.shallowRef(0);function _(){const M=Di(n);if(!M){e&&(a.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,g.value=0);return}const v=M.getBoundingClientRect();a.value=v.height,l.value=v.bottom,c.value=v.left,u.value=v.right,h.value=v.top,f.value=v.width,m.value=v.x,g.value=v.y}function x(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return lS(n,x),d.watch(()=>Di(n),M=>!M&&x()),oS(n,x,{attributeFilter:["style","class"]}),s&&Es("scroll",x,{capture:!0,passive:!0}),i&&Es("resize",x,{passive:!0}),iS(()=>{r&&x()}),{height:a,bottom:l,left:c,right:u,top:h,width:f,x:m,y:g,update:x}}function uS(n,t){const{top:e,left:i}=cS(n),s=d.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=d.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const dS=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=e).sort((l,c)=>l-c),r=[];if(e-t<n-2)return[];const o=(e-t)/n;let a=0;for(let l=0;l<n;l++){const c=t+l*o,u=t+(l+1)*o;let h=0;for(;a<s.length&&s[a]>=c&&s[a]<=u;)h++,a++;r.push([Math.ceil(c),h])}return r},vf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),As=d.ref({}),hS=n=>(As.value[n]||(As.value[n]=vf()),As.value[n]),fS=(n,t)=>{const e=As.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete As.value[t])};function mS({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:s=void 0,minCount:r=void 0,maxCount:o=void 0,renderPoints:a=void 0,type:l}){const u=e!==void 0&&n!==void 0?hS(e):vf(),h=n!==void 0?n:"static-chart-key",f=d.computed(()=>t.reduce((S,{timestamps:O})=>[...S,...O],[])),m=d.computed(()=>i||f.value.reduce((S,O)=>S===0?O:Math.min(S,O),0)),g=d.computed(()=>s||f.value.reduce((S,O)=>Math.max(S,O),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=g.value,a!==void 0&&(u.renderPoints[h]=a)});const _=d.computed(()=>Object.values(u.minStamps).reduce((S,O)=>S===0?O:Math.min(S,O),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((S,O)=>Math.max(S,O),0)),M=d.computed(()=>{const S=Object.values(u.renderPoints);return S.length===0?24:S.reduce((O,R)=>Math.max(O,R),2)}),v=d.computed(()=>{const S=x.value-_.value;return Math.ceil(S/M.value)}),T=d.computed(()=>t.length>1),k=d.computed(()=>t.map(({timestamps:S,color:O,label:R})=>({data:dS({bucketCount:M.value,minStamp:_.value,maxStamp:x.value,timestamps:S}).map(([U,X])=>({x:U,y:X})),label:R,...(l==="sparkline_bar"||T.value)&&O&&{backgroundColor:O},...l!=="sparkline_bar"&&O&&{borderColor:O},...T.value&&l!=="sparkline_bar"&&{fill:!0}}))),C=d.computed(()=>{var R,A;const S=((A=(R=k.value[0])==null?void 0:R.data)==null?void 0:A.length)??0,O=[];for(let z=0;z<S;z++){let U=0;for(let X=0;X<k.value.length;X++)U+=k.value[X].data[z].y;O.push(U)}return O}),I=d.computed(()=>{const S=C.value.reduce((O,R)=>Math.max(O,R),0);return Math.max(S,o??0)}),P=d.computed(()=>{const S=k.value.reduce((A,{data:z})=>[...A,...z.map(({y:U})=>U)],[]),O=S.length?S[0]:0,R=S.reduce((A,z)=>Math.min(A,z),O);return r===void 0?R:Math.min(R,r)});d.watchEffect(()=>{u.maxCounts[h]=I.value,u.minCounts[h]=P.value});const y=d.computed(()=>{const S=Object.values(u.minCounts),O=S.length?S[0]:0;return S.reduce((R,A)=>Math.min(R,A),O)}),b=d.computed(()=>Object.values(u.maxCounts).reduce((S,O)=>Math.max(S,O),0));return d.onUnmounted(()=>{n!==void 0&&e!==void 0&&fS(n,e)}),{syncedMinStamp:_,syncedMaxStamp:x,syncedRenderPoints:M,syncedChartDatasets:k,syncedGroupSizeMs:v,syncedMinCount:y,syncedMaxCount:b}}const bt={useBarChartOptions:Ev,useChartJSCommon:Rv,useChartLegendValues:Lv,useChartSelectedRange:HM,useExploreResultToDatasets:jM,useExploreResultToTimeDataset:XM,useDonutChartOptions:WM,useLineChartOptions:VM,useI18n:Hm,useReportChartDataForSynthetics:GM,useTranslatedUnits:KM,useEvaluateFeatureFlag:ZM,useTooltipAbsolutePosition:uS,useSparklineSync:mS};var Nt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Nt||{});/*!
|
|
19
19
|
* chartjs-plugin-annotation v3.1.0
|
|
20
20
|
* https://www.chartjs.org/chartjs-plugin-annotation/index
|
|
21
21
|
* (c) 2024 chartjs-plugin-annotation Contributors
|
|
22
22
|
* Released under the MIT License
|
|
23
|
-
*/const wf={modes:{point(n,t){return Qr(n,t,{intersect:!0})},nearest(n,t,e){return dk(n,t,e)},x(n,t,e){return Qr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Qr(n,t,{intersect:e.intersect,axis:"y"})}}};function fl(n,t,e){return(wf.modes[e.mode]||wf.modes.nearest)(n,t,e)}function ck(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function uk(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Qr(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):ck(i,t,e.axis))}function dk(n,t,e){let i=Number.POSITIVE_INFINITY;return Qr(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=uk(t,o,e.axis),l=di(t,a);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Zn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,o=t.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}const hk=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Qn=.001,Jr=(n,t,e)=>Math.min(e,Math.max(t,n)),vf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function fk(n,t,e){for(const i of Object.keys(n))n[i]=Jr(n[i],t,e);return n}function mk(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Mf(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-Qn&&n.x<=i+l+Qn,u=n.y>=e-l-Qn&&n.y<=s+l+Qn;return r==="x"?c:(r==="y"||c)&&u}function kf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Zn(n,e,$t(-s));return Mf(a,t,i,{borderWidth:r,hitTolerance:o})}function Jn(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function gk(n,t,e,i=!0){const s=e.split(".");let r=0;for(const o of t.split(".")){const a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(hk(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Sf=n=>typeof n=="string"&&n.endsWith("%"),Df=n=>parseFloat(n)/100,Tf=n=>Jr(Df(n),0,1),As=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),pk={box:n=>As(n.centerX,n.centerY),doughnutLabel:n=>As(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>As(n.centerX,n.centerY),line:n=>As(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>As(n.centerX,n.centerY)};function ml(n,t){return t==="start"?0:t==="end"?n:Sf(t)?Tf(t)*n:n/2}function Cn(n,t,e=!0){return typeof t=="number"?t:Sf(t)?(e?Tf(t):Df(t))*n:n}function yk(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function Cf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=mt(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=gl(i),h=Af(n.x,l,s,u.x),f=Af(n.y,c,r,u.y);return{x:h,y:f,x2:h+l,y2:f+c,width:l,height:c,centerX:h+l/2,centerY:f+c/2}}function gl(n,t="center"){return mt(n)?{x:lt(n.x,t),y:lt(n.y,t)}:(n=lt(n,t),{x:n,y:n})}const Pf=(n,t)=>n&&n.autoFit&&t<1;function Of(n,t){const e=n.font,i=kt(e)?e:[e];return Pf(n,t)?i.map(function(s){const r=It(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,It(r)}):i.map(s=>It(s))}function Ef(n){return n&&(me(n.xValue)||me(n.yValue))}function Af(n,t,e=0,i){return n-ml(t,i)+e}function Ti(n,t,e){const i=e.init;if(i){if(i===!0)return If(t,e)}else return;return bk(n,t,e)}function Rf(n,t,e){let i=!1;return t.forEach(s=>{ge(n[s])?(i=!0,e[s]=n[s]):me(e[s])&&delete e[s]}),i}function If(n,t){const e=t.type||"line";return pk[e](n)}function bk(n,t,e){const i=St(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return If(t,e);if(mt(i))return i}const pl=new Map,_k=n=>isNaN(n)||n<=0,xk=n=>n.reduce(function(t,e){return t+=e.string,t},"");function to(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function eo(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate($t(i)),n.translate(-t,-e))}function on(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Ci(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function no(n,t){const e=t.content;if(to(e))return{width:Cn(e.width,t.width),height:Cn(e.height,t.height)};const i=Of(t),s=t.textStrokeWidth,r=kt(e)?e:[e],o=r.join()+xk(i)+s+(n._measureText?"-spriting":"");return pl.has(o)||pl.set(o,kk(n,r,i,s)),pl.get(o)}function Lf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Ci(n,e);const a=on(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),hi(n,{x:i,y:s,w:r,h:o,radius:fk(xn(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Nf(n,t,e,i){const s=e.content;if(to(s)){n.save(),n.globalAlpha=Tk(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=kt(s)?s:[s],o=Of(e,i),a=e.color,l=kt(a)?a:[a],c=yk(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,wk(n,e)&&Sk(n,{x:c,y:u},r,o),Dk(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function wk(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function vk(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Io;if(to(o)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),n.restore();return}_k(s)||Mk(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function Mk(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:o}){let a,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=nr,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=nr,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(o+Te)*c,l=Math.sin(o+Te)*c,n.arc(t-a,e-l,u,o-ht,o-Et),n.arc(t+l,e-a,u,o-Et,o),n.arc(t+a,e+l,u,o,o+Et),n.arc(t-l,e+a,u,o+Et,o+ht),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=Te;case"rectRot":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":o+=Te;case"cross":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),o+=Te,a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(o)*i,e+Math.sin(o)*i);break}n.fill()}function kk(n,t,e,i){n.save();const s=t.length;let r=0,o=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];r=Math.max(r,n.measureText(c).width+i),o+=l.lineHeight}return n.restore(),{width:r,height:o}}function Sk(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(o,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(o,t,e+c/2+r),r+=c}),n.stroke()}function Dk(n,{x:t,y:e},i,{fonts:s,colors:r}){let o=0;i.forEach(function(a,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],h=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(a,t,e+h/2+o),o+=h,n.fill()})}function Tk(n,t){const e=_n(n)?n:t;return _n(e)?Jr(e,0,1):1}const Ff=["left","bottom","top","right"];function Ck(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&Rk(t,r);if(!o||Lk(t,r,o))return;if(n.save(),n.beginPath(),!on(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=Pk(t,o),{sideStart:u,sideEnd:h}=Ek(t,o,l);(r.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(h.x,h.y);const f=Zn({x:e,y:i},t.getCenterPoint(),$t(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function Pk(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=Ok(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+o,y:i},l={x:a.x,y:r}):(a={x:e,y:i+o},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function Ok(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function Ek(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=Ak(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Cn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Cn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function Ak(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function Rk(n,t){const e=t.position;return Ff.includes(e)?e:Ik(n,t)}function Ik(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=n,m={x:u,y:h},g=t.start,b=Cn(o,g),x=Cn(a,g),k=[e,e+b,e+b,s],M=[i+x,r,i,r],T=[];for(let v=0;v<4;v++){const S=Zn({x:k[v],y:M[v]},m,$t(f));T.push({position:Ff[v],distance:di(S,{x:l,y:c})})}return T.sort((v,S)=>v.distance-S.distance)[0].position}function Lk(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let o=i,a=s;return e==="left"?o+=r:e==="right"?o-=r:e==="top"?a+=r:e==="bottom"&&(a-=r),n.inRange(o,a)}const zf={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Pi(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function ti(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function Bf(n,t){if(n){const e=n.options.reverse,i=Pi(n,t.min,e?t.end:t.start),s=Pi(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function Hf(n,t){const{chartArea:e,scales:i}=n,s=i[ti(i,t,"xScaleID")],r=i[ti(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=Pi(s,t.xValue,s.left+s.width/2)),r&&(a=Pi(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function yl(n,t){const e=n.scales,i=e[ti(e,t,"xScaleID")],s=e[ti(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=Yf(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=Yf(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:r,y:a,x2:o,y2:l,width:o-r,height:l-a,centerX:r+(o-r)/2,centerY:a+(l-a)/2}}function Wf(n,t){if(!Ef(t)){const e=yl(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,o=e.centerY+t.yAdjust;return{x:r-i,y:o-i,x2:r+i,y2:o+i,centerX:r,centerY:o,width:s,height:s,radius:i}}return Fk(n,t)}function Nk(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?zk(s,r,t):Bk(e,r,t),r}function Vf(n,t){const e=yl(n,t);return e.initProperties=Ti(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:Vk(n,e,t),initProperties:e.initProperties}],e}function Fk(n,t){const e=Hf(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Yf(n,t){const e=Bf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function zk(n,t,e){const i=Pi(n,e.value,NaN),s=Pi(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function Bk(n,t,e){for(const i of Object.keys(zf)){const s=n[ti(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=zf[i],h=Bf(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=h.start,t[u]=h.end}}}function Hk({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return jf({start:r,end:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function Wk({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return jf({start:r,end:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function jf(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:l}=t,c=i-s-e-o-a-t.size;return e+s/2+l+ml(c,r)}function Vk(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=gl(i.position),r=Ut(i.padding),o=no(n.ctx,i),a=Hk({properties:t,options:e},o,s,r),l=Wk({properties:t,options:e},o,s,r),c=o.width+r.width,u=o.height+r.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const bl=["enter","leave"],_l=bl.concat("click");function Yk(n,t,e){t.listened=Rf(e,_l,t.listeners),t.moveListened=!1,bl.forEach(i=>{ge(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&ge(i.click)&&(t.listened=!0),t.moveListened||bl.forEach(s=>{ge(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function jk(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return $k(n,t,e);case"click":return Uk(n,t,e)}}function $k(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=fl(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=$f(r,"leave",s,i);return $f(r,"enter",i,s)||o}function $f({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=Uf(o.options[e]||n.listeners[e],o,t)||r);return r}function Uk(n,t,e){const i=n.listeners,s=fl(n.visibleElements,t,e.interaction);let r;for(const o of s)r=Uf(o.options.click||i.click,o,t)||r;return r}function Uf(n,t,e){return St(n,[t.$context,e])===!0}const io=["afterDraw","beforeDraw"];function qk(n,t,e){const i=t.visibleElements;t.hooked=Rf(e,io,t.hooks),t.hooked||i.forEach(s=>{t.hooked||io.forEach(r=>{ge(s.options[r])&&(t.hooked=!0)})})}function qf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return St(i,[t.$context])}}function Xk(n,t,e){const i=Jk(n.scales,t,e);let s=Xf(t,i,"min","suggestedMin");s=Xf(t,i,"max","suggestedMax")||s,s&&ge(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function Gk(n,t){for(const e of n)Zk(e,t)}function Xf(n,t,e,i){if(Rt(t[e])&&!Kk(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function Kk(n,t,e){return me(n[t])||me(n[e])}function Zk(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ti(t,n,e);i&&!t[i]&&Qk(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function Qk(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(me(n[e+i]))return!0;return!1}function Jk(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:lt(t.min,Number.NEGATIVE_INFINITY),max:lt(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Gf(a,t,["value","endValue"],o):ti(n,a,r)===s&&Gf(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Gf(n,t,e,i){for(const s of e){const r=n[s];if(me(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Oi extends Jt{inRange(t,e,i,s){const{x:r,y:o}=Zn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation));return Mf({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return Jn(this,t)}draw(t){t.save(),eo(t,this.getCenterPoint(),this.options.rotation),Lf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Vf(t,e)}}Oi.id="boxAnnotation",Oi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Oi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Oi.descriptors={label:{_fallback:!0}};class so extends Jt{inRange(t,e,i,s){return kf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Jn(this,t)}draw(t){const e=this.options;!e.display||!e.content||(rS(t,this),t.save(),eo(t,this.getCenterPoint(),this.rotation),Nf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=tS(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=nS(t,e,i);let a=no(t.ctx,e);const l=iS(a,o);Pf(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:h}=e,f=Cf(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Ti(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}so.id="doughnutLabelAnnotation",so.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},so.defaultRoutes={};function tS(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof en&&eS(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function eS(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function nS({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:o}=n,{innerRadius:a,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,h=(s+o)/2+c,f={left:Math.max(u-a,i),right:Math.min(u+a,r),top:Math.max(h-a,s),bottom:Math.min(h+a,o)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},g=t.spacing+t.borderWidth/2,b=a-g,x=m.y>h,k=x?s+g:o-g,M=sS(k,u,h,b);return{controllerMeta:{_centerX:u,_centerY:h,_radius:b,_counterclockwise:x,...M},point:m,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function iS({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function sS(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),o=t*-2,a=Math.pow(t,2)+s-r,l=Math.pow(o,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Ot};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:sr({x:t,y:e},{x:c,y:n}).angle,_endAngle:sr({x:t,y:e},{x:u,y:n}).angle}}function rS(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=on(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,o,a),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Rs extends Jt{inRange(t,e,i,s){return kf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Jn(this,t)}draw(t){const e=this.options,i=!me(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),eo(t,this.getCenterPoint(),this.rotation),Ck(t,this),Lf(t,this,e),Nf(t,oS(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Ef(e))i=Hf(t,e);else{const{centerX:a,centerY:l}=yl(t,e);i={x:a,y:l}}const s=Ut(e.padding),r=no(t.ctx,e),o=Cf(i,r,e,s);return{initProperties:Ti(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Rs.id="labelAnnotation",Rs.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Rs.defaultRoutes={borderColor:"color"};function oS({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Ut(s.padding);return{x:n+o.left+r,y:t+o.top+r,width:e-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}const xl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),wl=(n,t,e)=>xl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Kf=(n,t,e)=>xl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Is=n=>n*n,aS=(n,t,{x:e,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},Zf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,vl=(n,t,e,i)=>({x:Zf(n.x,t.x,e.x,i),y:Zf(n.y,t.y,e.y,i)}),Qf=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Jf=(n,t,e,i)=>-Math.atan2(Qf(n.x,t.x,e.x,i),Qf(n.y,t.y,e.y,i))+.5*ht;class Ls extends Jt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const o={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){on(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,m=l.isPointInStroke(a,h,f)||Ml(this,o,s);return l.restore(),m}const c=Is(r);return dS(this,o,c,s)||Ml(this,o,s)}return lS(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return Jn(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!on(t,a))return t.restore();Ci(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return _S(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=sm(this),m=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),kl(t,0,h,c),kl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=Nk(t,e),{x:s,y:r,x2:o,y2:a}=i,l=cS(i,t.chartArea),c=l?uS({x:s,y:r},{x:o,y:a},t.chartArea):{x:s,y:r,x2:o,y2:a,width:Math.abs(o-s),height:Math.abs(a-r)};if(c.centerX=(o+s)/2,c.centerY=(a+r)/2,c.initProperties=Ti(t,c,e),e.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=bS(c,e,di(h,f))}const u=hS(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Ls.id="lineAnnotation";const tm={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};Ls.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},tm),fill:!1,length:12,start:Object.assign({},tm),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Rs.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Ls.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Ls.defaultRoutes={borderColor:"color"};function lS(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=aS(t,e,n.getProps(["x","y","x2","y2"],r),i);return vf(o,s)||Ml(n,{mouseX:t,mouseY:e},r,i)}function cS({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&e<a||n>r&&e>r||t<s&&i<s||t>o&&i>o)}function em({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Kf(o,{x:n,y:t},e),n=o),n>s&&(t=Kf(s,{x:n,y:t},e),n=s),t<i&&(n=wl(i,{x:n,y:t},e),t=i),t>r&&(n=wl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function uS(n,t,e){const{x:i,y:s}=em(n,t,e),{x:r,y:o}=em(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function dS(n,{mouseX:t,mouseY:e},i=Qn,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,h=Is(c)+Is(u),f=h===0?-1:((t-r)*c+(e-o)*u)/h;let m,g;return f<0?(m=r,g=o):f>1?(m=a,g=l):(m=r+f*c,g=o+f*u),Is(t-m)+Is(e-g)<=i}function Ml(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function hS(n,t,e){const i=e.borderWidth,s=Ut(e.padding),r=no(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return mS(t,e,{width:o,height:a,padding:s},n.chartArea)}function fS(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ht/2?r-ht:r<ht/-2?r+ht:r}function mS(n,t,e,i){const{width:s,height:r,padding:o}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},h=t.rotation==="auto"?fS(n):$t(t.rotation),f=gS(s,r,h),m=pS(n,t,{labelSize:f,padding:o},i),g=n.cp?vl(c,n.cp,u,m):xl(c,u,m),b={size:f.w,min:i.left,max:i.right,padding:o.left},x={size:f.h,min:i.top,max:i.bottom,padding:o.top},k=im(g.x,b)+a,M=im(g.y,x)+l;return{x:k-s/2,y:M-r/2,x2:k+s/2,y2:M+r/2,centerX:k,centerY:M,pointX:g.x,pointY:g.y,width:s,height:r,rotation:ir(h)}}function gS(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function pS(n,t,e,i){let s;const r=yS(n,i);return t.position==="start"?s=nm({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-nm({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=ml(1,t.position),s}function nm(n,t,e,i){const{labelSize:s,padding:r}=t,o=n.w*i.dx,a=n.h*i.dy,l=o>0&&(s.w/2+r.left-i.x)/o,c=a>0&&(s.h/2+r.top-i.y)/a;return Jr(Math.max(l,c),0,.25)}function yS(n,t){const{x:e,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(o,l),dx:a<=c?1:-1,dy:o<=l?1:-1}}function im(n,t){const{size:e,min:i,max:s,padding:r}=t,o=e/2;return e>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function sm(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:rm(n,e),endAdjust:rm(n,i)}}function rm(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(wl(0,r,{x:0,y:s}))}function kl(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:o,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ci(n,i),on(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),o===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function bS(n,t,e){const{x:i,y:s,x2:r,y2:o,centerX:a,centerY:l}=n,c=Math.atan2(o-s,r-i),u=gl(t.controlPoint,0),h={x:a+Cn(e,u.x,!1),y:l+Cn(e,u.y,!1)};return Zn(h,{x:a,y:l},c)}function om(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),kl(n,0,-s,r),n.restore())}function _S(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=sm(t),m={x:s,y:r},g={x:o,y:a},b=Jf(m,e,g,0),x=Jf(m,e,g,1)-ht,k=vl(m,e,g,h/i),M=vl(m,e,g,1-f/i),T=new Path2D;n.beginPath(),T.moveTo(k.x,k.y),T.quadraticCurveTo(e.x,e.y,M.x,M.y),n.shadowColor=l.borderShadowColor,n.stroke(T),t.path=T,t.ctx=n,om(n,k,{angle:b,adjust:h},c),om(n,M,{angle:x,adjust:f},u)}class Ns extends Jt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return xS({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,o);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:a,end:c},f=Zn({x:t,y:e},this.getCenterPoint(s),$t(-r));return f[i]>=h.start-o-Qn&&f[i]<=h.end+o+Qn}getCenterPoint(t){return Jn(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),eo(t,this.getCenterPoint(),o.rotation),Ci(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=on(t,o);t.ellipse(s,r,i/2,e/2,ht/2,0,2*ht),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Vf(t,e)}}Ns.id="ellipseAnnotation",Ns.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Oi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Ns.defaultRoutes={borderColor:"color",backgroundColor:"color"},Ns.descriptors={label:{_fallback:!0}};function xS(n,t,e,i){const{width:s,height:r,centerX:o,centerY:a}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=$t(e||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(n.x-o)+f*(n.y-a),2),g=Math.pow(f*(n.x-o)-h*(n.y-a),2);return m/Math.pow(l+i,2)+g/Math.pow(c+i,2)<=1.0001}class ro extends Jt{inRange(t,e,i,s){const{x:r,y:o,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?mk({x:t,y:e},this.getCenterPoint(s),c/2,u):vf(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return Jn(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ci(t,e);const s=on(t,e);vk(t,this,this.centerX,this.centerY),s&&!to(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Wf(t,e);return i.initProperties=Ti(t,i,e),i}}ro.id="pointAnnotation",ro.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ro.defaultRoutes={borderColor:"color",backgroundColor:"color"};class oo extends Jt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&vS(this.elements,t,e,s);const r=Zn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation)),o=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...o),l=Math.max(...o);return r[i]>=a&&r[i]<=l}getCenterPoint(t){return Jn(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ci(t,i);const s=on(t,i);let r=!0;for(const o of e)r?(t.moveTo(o.x,o.y),r=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Wf(t,e),{sides:s,rotation:r}=e,o=[],a=2*ht/s;let l=r*Io;for(let c=0;c<s;c++,l+=a){const u=wS(i,e,l);u.initProperties=Ti(t,i,e),o.push(u)}return i.elements=o,i}}oo.id="polygonAnnotation",oo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},oo.defaultRoutes={borderColor:"color",backgroundColor:"color"};function wS({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const o=(i+s)/2,a=Math.sin(r),l=Math.cos(r),c={x:n+a*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+a*(e+o),bY:t-l*(e+o)}}}function vS(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const o of n){const a=o.getProps(["bX","bY"],i);a.bY>e!=r.bY>e&&t<(r.bX-a.bX)*(e-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}const Pn={box:Oi,doughnutLabel:so,ellipse:Ns,label:Rs,line:Ls,point:ro,polygon:oo};Object.keys(Pn).forEach(n=>{At.describe(`elements.${Pn[n].id}`,{_fallback:"plugins.annotation.common"})});const MS={update:Object.assign},kS=_l.concat(io),am=(n,t)=>mt(t)?Tl(n,t):n,Sl=n=>n==="color"||n==="font";function Dl(n="line"){return Pn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function SS(n,t,e,i){const s=TS(n,e.animations,i),r=t.annotations,o=OS(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=lm(o,a,l.type),u=l.setContext(PS(n,c,o,l)),h=c.resolveElementProperties(n,u);h.skip=DS(h),"elements"in h&&(CS(c,h.elements,u,s),delete h.elements),me(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=cm(u),s.update(c,h)}}function DS(n){return isNaN(n.x)||isNaN(n.y)}function TS(n,t,e){return e==="reset"||e==="none"||e==="resize"?MS:new Xo(n,t)}function CS(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const o=t[r],a=o.properties,l=lm(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=cm(c),i.update(l,a)}}function lm(n,t,e,i){const s=Pn[Dl(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function cm(n){const t=Pn[Dl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Tl(n,t.defaults),Tl(n,t.defaultRoutes));for(const i of kS)e[i]=n[i];return e}function Tl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];Sl(i)&&kt(r)?e[i]=r.map(o=>am(o,s)):e[i]=am(r,s)}return e}function PS(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function OS(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var ES="3.1.0";const On=new Map,um=n=>n.type!=="doughnutLabel",AS=_l.concat(io);var dm={id:"annotation",version:ES,beforeRegister(){gk("chart.js","4.0",Ce.version)},afterRegister(){Ce.register(Pn)},afterUnregister(){Ce.unregister(Pn)},beforeInit(n){On.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=On.get(n),s=i.annotations=[];let r=e.annotations;mt(r)?Object.keys(r).forEach(o=>{const a=r[o];mt(a)&&(a.id=o,s.push(a))}):kt(r)&&s.push(...r),Gk(s.filter(um),n.scales)},afterDataLimits(n,t){const e=On.get(n);Xk(n,t.scale,e.annotations.filter(um).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=On.get(n);Yk(n,i,e),SS(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),qk(n,i,e)},beforeDatasetsDraw(n,t,e){Fs(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Fs(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Fs(n,t.index,e.clip)},beforeDraw(n,t,e){Fs(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Fs(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=On.get(n);jk(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){On.delete(n)},getAnnotations(n){const t=On.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return fl(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!AS.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Pn[Dl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Sl,_fallback:!0},_indexable:Sl}},additionalOptionScopes:[""]};function Fs(n,t,e){const{ctx:i,chartArea:s}=n,r=On.get(n);e&&Zi(i,s);const o=RS(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)IS(i,s,r,a);e&&Qi(i)}function RS(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function IS(n,t,e,i){const s=i.element;i.main?(qf(e,s,"beforeDraw"),s.draw(n,t),qf(e,s,"afterDraw")):s.draw(n,t)}const LS={class:"zoom-timerange-container"},NS={class:"zoom-timerange-details"},FS={class:"label","data-testid":"zoom-timerange-from"},zS={class:"label","data-testid":"zoom-timerange-to"},BS=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.ref(ks({tickValue:t.start,granularity:t.granularity})),s=d.ref(ks({tickValue:t.end,granularity:t.granularity})),r=(o,a)=>{Ia(()=>{i.value=ks({tickValue:o,granularity:t.granularity}),s.value=ks({tickValue:a,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([o,a])=>{r(o,a)},{immediate:!0}),(o,a)=>(d.openBlock(),d.createElementBlock("div",LS,[d.createElementVNode("div",NS,[d.createElementVNode("div",FS,d.toDisplayString(d.unref(e).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",zS,d.toDisplayString(d.unref(e).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(s.value),1)])]))}}),Se=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},hm=Se(BS,[["__scopeId","data-v-0e972e3c"]]),HS={class:"zoom-actions-container"},WS={class:"zoom-actions-heading"},VS={class:"zoom-action-select"},YS=["data-testid"],jS=["aria-disabled","href"],$S=["onClick"],US=Se(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,s=r=>{r.action&&(r.action(e.newTimeRange),i("onAction"))};return(r,o)=>(d.openBlock(),d.createElementBlock("div",HS,[d.createElementVNode("div",WS,[d.createVNode(hm,{end:r.newTimeRange.end,granularity:r.granularity,start:r.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Gs.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(Na),size:d.unref(Fa),onClick:o[0]||(o[0]=a=>r.$emit("onAction"))},null,8,["color","size"])]),o[2]||(o[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",VS,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.zoomActionItems,a=>(d.openBlock(),d.createElementBlock("div",{key:a.key,class:d.normalizeClass(["zoom-action-item",{disabled:a.disabled}]),"data-testid":`zoom-action-item-${a.key}`},[a.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":a.disabled,class:"zoom-action-link",href:a.href,onClick:o[1]||(o[1]=l=>r.$emit("onAction"))},d.toDisplayString(a.label),9,jS)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(a)},d.toDisplayString(a.label),9,$S))],10,YS))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),qS={key:2},XS={class:"tooltip-title"},GS={class:"title"},KS={key:0,class:"subtitle"},ZS={class:"context"},QS={class:"metric"},JS={class:"tooltip"},tD={key:0},eD={class:"display-value"},ao=Se(d.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,s=d.ref(null),{x:r,y:o,isDragging:a}=rk(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${o.value}px`),c=d.computed(()=>`${r.value}px`),u=d.computed(()=>i.state.tooltipContext),h=d.computed(()=>i.state.metricDisplay),f=d.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return d.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,g])=>{a.value||(r.value=parseFloat(m),o.value=parseFloat(g))}),d.watch(a,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(s,m=>{if(m){const{width:g,height:b}=m.getBoundingClientRect();e("dimensions",{width:g,height:b})}}),(m,g)=>{var b,x;return m.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:m.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${m.absoluteLeft}, ${m.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[m.state.interactionMode==="selecting-chart-area"&&m.granularity?(d.openBlock(),d.createBlock(hm,{key:0,end:(b=m.zoomTimeRange)==null?void 0:b.end,granularity:m.granularity,start:(x=m.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):m.state.interactionMode==="zoom-interactive"&&m.zoomTimeRange&&m.zoomActionItems&&m.granularity?(d.openBlock(),d.createBlock(US,{key:1,granularity:m.granularity,"new-time-range":m.zoomTimeRange,"zoom-action-items":m.zoomActionItems,onOnAction:g[0]||(g[0]=k=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",qS,[d.createElementVNode("div",XS,[d.createElementVNode("div",GS,[d.createElementVNode("div",null,d.toDisplayString(m.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Gs.DragIcon),{key:0,class:"drag-icon",color:d.unref(Na),size:d.unref(Fa)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",KS,[d.createElementVNode("div",ZS,d.toDisplayString(u.value),1),d.createElementVNode("div",QS,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",JS,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.state.tooltipSeries,({backgroundColor:k,borderColor:M,label:T,value:v,isSegmentEmpty:S},E)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:T+E},[m.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",tD,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:k,"border-color":M})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:S}])},d.toDisplayString(T),3),d.createElementVNode("span",eD,d.toDisplayString(v),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-078294a6"]]),nD=["onClick"],iD={key:0,class:"sub-label"},sD={class:"tooltip-content"},Cl=Se(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){d.useCssVars(v=>({"6d3f1170":l.value}));const t=n,{i18n:e}=bt.useI18n(),i=d.ref(),s=d.ref([]),r=d.inject("showLegendValues",!0),o=d.inject("legendPosition",d.ref(Nt.Right)),a=d.ref([]),l=d.ref(hh),c=()=>{const v=i.value;if(!v||!s.value||v.children.length===0)return 0;const S=v.children[0].getBoundingClientRect().top;for(const E of s.value)if(E.getBoundingClientRect().top>S)return!0;return!1},u=d.computed(()=>t.items.length>2||o.value===Nt.Right),h=()=>{i.value&&o.value===Nt.Bottom&&(c()?l.value=Lw:l.value=hh)},f=()=>{if(i.value&&o.value===Nt.Bottom){let v=0;s.value.forEach(E=>{const P=Array.from(E.children).reduce((y,_)=>y+_.offsetWidth,0);P>v&&(v=P)});const S=parseInt(Iw,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${v+S}px)`}h()},m=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let v=0;v<t.items.length;v++)if(t.items[v].text!==a.value[v].text)return a.value=t.items,!0;return!1};d.watch(()=>t.items,()=>{m()&&f()},{immediate:!0,flush:"post"});const g=d.ref(0),b=d.ref(0),x=new ResizeObserver(Ia(v=>{const S=v[0],E=S.contentRect.width,P=S.contentRect.height;E!==g.value&&P===b.value&&f(),g.value=E,b.value=P},100));d.watch(()=>o.value,()=>{f()}),d.onMounted(()=>{a.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),d.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const k=(v=0,S)=>{if(t.chartInstance===null)return;const E=t.chartInstance instanceof Ce?t.chartInstance:t.chartInstance.chart;M(v,S)?E.hide(v,S):E.show(v,S),E.update()},M=(v=0,S)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const E=t.chartInstance instanceof Ce?t.chartInstance:t.chartInstance.chart,P=E.getDatasetMeta(v);return P.dataset||S===void 0?E.isDatasetVisible(v):!(P.data.length&&P.data[S].hidden)},T=v=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[v];return(v,S)=>{const E=d.resolveComponent("KTooltip");return d.unref(o)!==d.unref(Nt).Hidden?(d.openBlock(),d.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:d.normalizeClass(["legend-container",T(d.unref(o))]),"data-testid":"legend"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.items,({fillStyle:P,strokeStyle:y,text:_,datasetIndex:C,index:R,value:L,isSegmentEmpty:I})=>(d.openBlock(),d.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:B=>k(C,R)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:P,"border-color":y})},null,4),d.createVNode(E,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!M(C,R)}])},[d.createElementVNode("div",{class:d.normalizeClass(["label",{"truncate-label":u.value,empty:I}])},d.toDisplayString(_),3),L&&d.unref(r)?(d.openBlock(),d.createElementBlock("div",iD,d.toDisplayString(L.formatted),1)):d.createCommentVNode("",!0)],2)]),_:2},[I?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",sD,d.toDisplayString(d.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,nD))),128))],2)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-2e13ddb3"]]),ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function rD(n,t=0){return(ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]).toLowerCase()}let Pl;const oD=new Uint8Array(16);function aD(){if(!Pl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Pl=crypto.getRandomValues.bind(crypto)}return Pl(oD)}const fm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function lo(n,t,e){var s;if(fm.randomUUID&&!n)return fm.randomUUID();n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??aD();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,rD(i)}const mm=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()};class gm{constructor(){O(this,"id","highlightPlugin");O(this,"_clickedElements");O(this,"_previousHoverOption");O(this,"_clicked",!1);O(this,"_pause",!1);O(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&mm(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,mm(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const lD=["id"],cD=["id"],uD={class:"axis-tooltip-content"},pm=6,dD="100%",hD="100%",fD=20,mD=20,ym=6,gD=0,pD=10,yD=10,bD=1,_D=Se(d.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=bt.useI18n(),{translateUnit:i}=bt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),o=new gm,a=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:z},Y)=>{var nt;const W=z.data,Q=(nt=W.labels)==null?void 0:nt.indexOf(Y);return W.datasets.reduce((it,rt,st)=>{if(z.isDatasetVisible(st)){const wt=rt.data[Q];return isNaN(wt)?it:it+wt}else return it},0)},u=(z,Y,W,Q)=>{const nt=Q==="horizontal";Y===null&&(Y=e.t("entityNoName"));const it={type:"label",yValue:wt=>nt?Y:c(wt,Y),xValue:wt=>nt?c(wt,Y):Y},rt={...it,position:nt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>nt?0:-Math.abs($w()),content:wt=>Ha(c(wt,Y),W)},st={...it,content:wt=>xh(c(wt,Y),_h(wt.chart,z)),position:nt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:wt=>nt?bh(Ha(c(wt,Y),W)):0,color:gh};return{[`${Y}-value`]:rt,[`${Y}-percent`]:st}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=lo(),g=lo(),b=lo(),x=d.ref([]),k=d.inject("legendPosition",Nt.Right),M=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),T=d.toRef(t,"metricUnit"),v=d.computed(()=>t.orientation==="horizontal"),S=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:v.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:E,tooltipAbsoluteTop:P}=bt.useTooltipAbsolutePosition(l,S),y=d.ref(0),_=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce((Y,W)=>Object.assign(Y,u(t.chartData,W,T.value,t.orientation)),{}))},C={id:m,afterUpdate(z){y.value+=1,x.value=lh(z,t.legendValues,t.chartLegendSortFn)}},R={id:g,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?_():{}}},B=[C,{id:"axisHover",afterEvent(z,Y){var W;if(M.show=!1,Y.event.type==="mousemove"){const Q=Y.event,nt=z.options.indexAxis,it=z.scales,rt=z.scales[nt].getLabelForValue(Number(z.scales[nt].getValueForPixel(Q[nt]))),wt=z.scales[nt].getLabels().indexOf(rt),ut=(W=t.chartData.isLabelEmpty)==null?void 0:W[wt];if((te=>te==="x"?Q.y>it.x.top:Q.x<it.y.right)(nt)){S.interactionMode!=="interactive"&&(S.showTooltip=!1);const ae=z.canvas.getContext("2d").measureText(rt).width,qt=Math.abs(Math.round(Q.x-ae*.5)),Ee=Math.round(Q.x+ae*.5),Mt=z.canvas.getBoundingClientRect(),Xt=40;M.left=nt==="x"?`${(qt>0?qt:Ee)-M.offset+Mt.left}px`:`${Q.x-ae*.5-M.offset+Mt.left}px`,M.top=`${Q.y-Xt+Mt.top}px`,rt.length>zr?(M.show=!0,M.text=rt):ut?(M.text=e.t("emptyEntityInfo"),M.show=!0):M.show=!1}else M.show=!1}}},{id:b,afterUpdate(z){z.options.layout.padding.right=v.value?j.value:0}},o,...t.annotations?[R]:[]],q=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),tt=d.ref(0),V=d.ref(0),ct=new ResizeObserver(Ia(z=>{tt.value=z[0].contentRect.width,V.value=z[0].contentRect.height},100)),U=d.computed(()=>{var Y,W;const z=(W=(Y=t.chartData)==null?void 0:Y.labels)==null?void 0:W.length;return h.value&&z&&!v.value?`${Math.max(z*(fD+ym),tt.value)}px`:dD}),J=d.computed(()=>{var Y,W;const z=(W=(Y=t.chartData)==null?void 0:Y.labels)==null?void 0:W.length;return h.value&&z&&v.value?`${Math.max(z*(mD+ym),V.value)}px`:hD});bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&Ce.register(dm),a.value&&(tt.value=a.value.offsetWidth,V.value=a.value.offsetHeight,ct.observe(a.value))}),d.onUnmounted(()=>{a.value&&ct.unobserve(a.value)});const et=d.computed(()=>{const z=bt.useBarChartOptions({tooltipState:S,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:v.value?"y":"x",numLabels:q});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*pm}}}}),X=bt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),B,et),j=d.computed(()=>{y.value;const z=t.chartData.labels,Y=t.chartData.datasets,W=z.map((it,rt)=>Y.reduce((st,wt)=>isNaN(Number(wt.data[rt]))?st:st+Number(wt.data[rt]),0)),Q=X.value?_h(X.value,t.chartData):Uw(t.chartData);return W.map(it=>bh(Ha(it,T.value)+xh(it,Q))).reduce((it,rt)=>Math.max(it,rt),0)+pm});d.onBeforeUnmount(()=>{Ce.unregister(dm)});const $={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},K=d.computed(()=>{if(f.value&&X.value){const z=window.devicePixelRatio,Y=X.value,W=Y.scales.y.width*z+bD,Q=(Y.scales.y.height+Y.scales.y.top+Y.scales.x.height)*z,nt=f.value.getContext("2d");return nt.scale(z,z),nt.canvas.width=W,nt.canvas.height=Q,nt.canvas.style.width=`${W/z}px`,nt.canvas.style.height=`${Q/z}px`,{scale:z,width:W*z,height:Q*z,targetCtx:nt}}return null}),_t=z=>{const Y=z.target;if(K.value&&X.value&&!v.value){const W=K.value.scale,Q=K.value.targetCtx,nt=K.value.width,it=K.value.height,rt=X.value,st=rt.canvas;Q.fillStyle="white",Y.scrollLeft>=gD&&Y.scrollLeft<=pD?(Q.globalCompositeOperation="source-over",Q.clearRect(0,0,nt,it),Q.drawImage(st,0,0,nt,it,0,0,nt,it),Q.globalCompositeOperation="destination-over",Q.fillRect(0,0,nt,it)):(Q.globalCompositeOperation="source-over",Q.fillRect(0,(rt.scales.y.height+rt.scales.y.top+yD)*W,nt,rt.scales.x.height*W))}S.offsetY=Y.scrollTop,S.offsetX=Y.scrollLeft,M.offset=Y.scrollLeft},gt=({width:z,height:Y})=>{S.width=z,S.height=Y};d.watch(()=>t.orientation,()=>{var z;if(f.value&&K.value){const Y=K.value.width,W=K.value.height;((z=f.value)==null?void 0:z.getContext("2d")).clearRect(0,0,Y,W)}S.showTooltip=!1,S.interactionMode="idle"}),d.watch(()=>t.annotations,z=>{X.value&&(z?X.value.options.plugins.annotation.annotations=_(t.chartData):delete X.value.options.plugins.annotation.annotations)});const pt=()=>{S.showTooltip&&(S.interactionMode!=="idle"?S.interactionMode="idle":S.interactionMode="interactive")};return(z,Y)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",$[d.unref(k)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,lD),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:Y[0]||(Y[0]=W=>pt()),onScroll:_t},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:U.value,height:J.value})},[d.createElementVNode("canvas",{id:d.unref(r),ref:"canvas",class:"chart-canvas"},null,8,cD)],4)],544),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[M.show?(d.openBlock(),d.createElementBlock("div",{key:0,class:"axis-tooltip",style:d.normalizeStyle({top:M.top,left:M.left}),width:"auto"},[d.createElementVNode("div",uD,d.toDisplayString(M.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(ao,{"absolute-left":d.unref(E),"absolute-top":d.unref(P),"chart-parent-ref":l.value,state:S,"tooltip-title":z.tooltipTitle,onDimensions:gt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(Cl,{id:d.unref(m),"chart-instance":d.unref(X),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-acf2a980"]]);/*!
|
|
23
|
+
*/const Mf={modes:{point(n,t){return Jr(n,t,{intersect:!0})},nearest(n,t,e){return yS(n,t,e)},x(n,t,e){return Jr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Jr(n,t,{intersect:e.intersect,axis:"y"})}}};function ml(n,t,e){return(Mf.modes[e.mode]||Mf.modes.nearest)(n,t,e)}function gS(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function pS(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Jr(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):gS(i,t,e.axis))}function yS(n,t,e){let i=Number.POSITIVE_INFINITY;return Jr(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=pS(t,o,e.axis),l=di(t,a);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Zn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,o=t.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}const bS=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Qn=.001,to=(n,t,e)=>Math.min(e,Math.max(t,n)),Sf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function _S(n,t,e){for(const i of Object.keys(n))n[i]=to(n[i],t,e);return n}function xS(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function kf(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-Qn&&n.x<=i+l+Qn,u=n.y>=e-l-Qn&&n.y<=s+l+Qn;return r==="x"?c:(r==="y"||c)&&u}function Df(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Zn(n,e,$t(-s));return kf(a,t,i,{borderWidth:r,hitTolerance:o})}function Jn(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function wS(n,t,e,i=!0){const s=e.split(".");let r=0;for(const o of t.split(".")){const a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(bS(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Tf=n=>typeof n=="string"&&n.endsWith("%"),Cf=n=>parseFloat(n)/100,Pf=n=>to(Cf(n),0,1),Rs=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),vS={box:n=>Rs(n.centerX,n.centerY),doughnutLabel:n=>Rs(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Rs(n.centerX,n.centerY),line:n=>Rs(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Rs(n.centerX,n.centerY)};function gl(n,t){return t==="start"?0:t==="end"?n:Tf(t)?Pf(t)*n:n/2}function Cn(n,t,e=!0){return typeof t=="number"?t:Tf(t)?(e?Pf(t):Cf(t))*n:n}function MS(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function Of(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=mt(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=pl(i),h=If(n.x,l,s,u.x),f=If(n.y,c,r,u.y);return{x:h,y:f,x2:h+l,y2:f+c,width:l,height:c,centerX:h+l/2,centerY:f+c/2}}function pl(n,t="center"){return mt(n)?{x:lt(n.x,t),y:lt(n.y,t)}:(n=lt(n,t),{x:n,y:n})}const Ef=(n,t)=>n&&n.autoFit&&t<1;function Af(n,t){const e=n.font,i=St(e)?e:[e];return Ef(n,t)?i.map(function(s){const r=It(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,It(r)}):i.map(s=>It(s))}function Rf(n){return n&&(me(n.xValue)||me(n.yValue))}function If(n,t,e=0,i){return n-gl(t,i)+e}function Ti(n,t,e){const i=e.init;if(i){if(i===!0)return Nf(t,e)}else return;return SS(n,t,e)}function Lf(n,t,e){let i=!1;return t.forEach(s=>{ge(n[s])?(i=!0,e[s]=n[s]):me(e[s])&&delete e[s]}),i}function Nf(n,t){const e=t.type||"line";return vS[e](n)}function SS(n,t,e){const i=kt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Nf(t,e);if(mt(i))return i}const yl=new Map,kS=n=>isNaN(n)||n<=0,DS=n=>n.reduce(function(t,e){return t+=e.string,t},"");function eo(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function no(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate($t(i)),n.translate(-t,-e))}function on(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Ci(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function io(n,t){const e=t.content;if(eo(e))return{width:Cn(e.width,t.width),height:Cn(e.height,t.height)};const i=Af(t),s=t.textStrokeWidth,r=St(e)?e:[e],o=r.join()+DS(i)+s+(n._measureText?"-spriting":"");return yl.has(o)||yl.set(o,OS(n,r,i,s)),yl.get(o)}function Ff(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Ci(n,e);const a=on(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),hi(n,{x:i,y:s,w:r,h:o,radius:_S(xn(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function zf(n,t,e,i){const s=e.content;if(eo(s)){n.save(),n.globalAlpha=RS(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=St(s)?s:[s],o=Af(e,i),a=e.color,l=St(a)?a:[a],c=MS(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,TS(n,e)&&ES(n,{x:c,y:u},r,o),AS(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function TS(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function CS(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Lo;if(eo(o)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),n.restore();return}kS(s)||PS(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function PS(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:o}){let a,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=ir,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=ir,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(o+Te)*c,l=Math.sin(o+Te)*c,n.arc(t-a,e-l,u,o-ht,o-Et),n.arc(t+l,e-a,u,o-Et,o),n.arc(t+a,e+l,u,o,o+Et),n.arc(t-l,e+a,u,o+Et,o+ht),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=Te;case"rectRot":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":o+=Te;case"cross":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),o+=Te,a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(o)*i,e+Math.sin(o)*i);break}n.fill()}function OS(n,t,e,i){n.save();const s=t.length;let r=0,o=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];r=Math.max(r,n.measureText(c).width+i),o+=l.lineHeight}return n.restore(),{width:r,height:o}}function ES(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(o,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(o,t,e+c/2+r),r+=c}),n.stroke()}function AS(n,{x:t,y:e},i,{fonts:s,colors:r}){let o=0;i.forEach(function(a,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],h=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(a,t,e+h/2+o),o+=h,n.fill()})}function RS(n,t){const e=_n(n)?n:t;return _n(e)?to(e,0,1):1}const Bf=["left","bottom","top","right"];function IS(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&BS(t,r);if(!o||WS(t,r,o))return;if(n.save(),n.beginPath(),!on(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=LS(t,o),{sideStart:u,sideEnd:h}=FS(t,o,l);(r.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(h.x,h.y);const f=Zn({x:e,y:i},t.getCenterPoint(),$t(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function LS(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=NS(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+o,y:i},l={x:a.x,y:r}):(a={x:e,y:i+o},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function NS(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function FS(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=zS(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Cn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Cn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function zS(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function BS(n,t){const e=t.position;return Bf.includes(e)?e:HS(n,t)}function HS(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=n,m={x:u,y:h},g=t.start,_=Cn(o,g),x=Cn(a,g),M=[e,e+_,e+_,s],v=[i+x,r,i,r],T=[];for(let k=0;k<4;k++){const C=Zn({x:M[k],y:v[k]},m,$t(f));T.push({position:Bf[k],distance:di(C,{x:l,y:c})})}return T.sort((k,C)=>k.distance-C.distance)[0].position}function WS(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let o=i,a=s;return e==="left"?o+=r:e==="right"?o-=r:e==="top"?a+=r:e==="bottom"&&(a-=r),n.inRange(o,a)}const Hf={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Pi(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function ti(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function Wf(n,t){if(n){const e=n.options.reverse,i=Pi(n,t.min,e?t.end:t.start),s=Pi(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function Vf(n,t){const{chartArea:e,scales:i}=n,s=i[ti(i,t,"xScaleID")],r=i[ti(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=Pi(s,t.xValue,s.left+s.width/2)),r&&(a=Pi(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function bl(n,t){const e=n.scales,i=e[ti(e,t,"xScaleID")],s=e[ti(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=$f(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=$f(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:r,y:a,x2:o,y2:l,width:o-r,height:l-a,centerX:r+(o-r)/2,centerY:a+(l-a)/2}}function Yf(n,t){if(!Rf(t)){const e=bl(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,o=e.centerY+t.yAdjust;return{x:r-i,y:o-i,x2:r+i,y2:o+i,centerX:r,centerY:o,width:s,height:s,radius:i}}return YS(n,t)}function VS(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?jS(s,r,t):$S(e,r,t),r}function jf(n,t){const e=bl(n,t);return e.initProperties=Ti(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:XS(n,e,t),initProperties:e.initProperties}],e}function YS(n,t){const e=Vf(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function $f(n,t){const e=Wf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function jS(n,t,e){const i=Pi(n,e.value,NaN),s=Pi(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function $S(n,t,e){for(const i of Object.keys(Hf)){const s=n[ti(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=Hf[i],h=Wf(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=h.start,t[u]=h.end}}}function US({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return Uf({start:r,end:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function qS({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return Uf({start:r,end:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Uf(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:l}=t,c=i-s-e-o-a-t.size;return e+s/2+l+gl(c,r)}function XS(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=pl(i.position),r=Ut(i.padding),o=io(n.ctx,i),a=US({properties:t,options:e},o,s,r),l=qS({properties:t,options:e},o,s,r),c=o.width+r.width,u=o.height+r.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const _l=["enter","leave"],xl=_l.concat("click");function GS(n,t,e){t.listened=Lf(e,xl,t.listeners),t.moveListened=!1,_l.forEach(i=>{ge(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&ge(i.click)&&(t.listened=!0),t.moveListened||_l.forEach(s=>{ge(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function KS(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return ZS(n,t,e);case"click":return QS(n,t,e)}}function ZS(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=ml(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=qf(r,"leave",s,i);return qf(r,"enter",i,s)||o}function qf({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=Xf(o.options[e]||n.listeners[e],o,t)||r);return r}function QS(n,t,e){const i=n.listeners,s=ml(n.visibleElements,t,e.interaction);let r;for(const o of s)r=Xf(o.options.click||i.click,o,t)||r;return r}function Xf(n,t,e){return kt(n,[t.$context,e])===!0}const so=["afterDraw","beforeDraw"];function JS(n,t,e){const i=t.visibleElements;t.hooked=Lf(e,so,t.hooks),t.hooked||i.forEach(s=>{t.hooked||so.forEach(r=>{ge(s.options[r])&&(t.hooked=!0)})})}function Gf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return kt(i,[t.$context])}}function tk(n,t,e){const i=rk(n.scales,t,e);let s=Kf(t,i,"min","suggestedMin");s=Kf(t,i,"max","suggestedMax")||s,s&&ge(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function ek(n,t){for(const e of n)ik(e,t)}function Kf(n,t,e,i){if(Rt(t[e])&&!nk(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function nk(n,t,e){return me(n[t])||me(n[e])}function ik(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ti(t,n,e);i&&!t[i]&&sk(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function sk(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(me(n[e+i]))return!0;return!1}function rk(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:lt(t.min,Number.NEGATIVE_INFINITY),max:lt(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Zf(a,t,["value","endValue"],o):ti(n,a,r)===s&&Zf(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Zf(n,t,e,i){for(const s of e){const r=n[s];if(me(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Oi extends Jt{inRange(t,e,i,s){const{x:r,y:o}=Zn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation));return kf({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return Jn(this,t)}draw(t){t.save(),no(t,this.getCenterPoint(),this.options.rotation),Ff(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return jf(t,e)}}Oi.id="boxAnnotation",Oi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Oi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Oi.descriptors={label:{_fallback:!0}};class ro extends Jt{inRange(t,e,i,s){return Df({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Jn(this,t)}draw(t){const e=this.options;!e.display||!e.content||(dk(t,this),t.save(),no(t,this.getCenterPoint(),this.rotation),zf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=ok(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=lk(t,e,i);let a=io(t.ctx,e);const l=ck(a,o);Ef(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:h}=e,f=Of(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Ti(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}ro.id="doughnutLabelAnnotation",ro.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},ro.defaultRoutes={};function ok(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof en&&ak(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function ak(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function lk({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:o}=n,{innerRadius:a,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,h=(s+o)/2+c,f={left:Math.max(u-a,i),right:Math.min(u+a,r),top:Math.max(h-a,s),bottom:Math.min(h+a,o)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},g=t.spacing+t.borderWidth/2,_=a-g,x=m.y>h,M=x?s+g:o-g,v=uk(M,u,h,_);return{controllerMeta:{_centerX:u,_centerY:h,_radius:_,_counterclockwise:x,...v},point:m,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function ck({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function uk(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),o=t*-2,a=Math.pow(t,2)+s-r,l=Math.pow(o,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Ot};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:rr({x:t,y:e},{x:c,y:n}).angle,_endAngle:rr({x:t,y:e},{x:u,y:n}).angle}}function dk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=on(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,o,a),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Is extends Jt{inRange(t,e,i,s){return Df({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Jn(this,t)}draw(t){const e=this.options,i=!me(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),no(t,this.getCenterPoint(),this.rotation),IS(t,this),Ff(t,this,e),zf(t,hk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Rf(e))i=Vf(t,e);else{const{centerX:a,centerY:l}=bl(t,e);i={x:a,y:l}}const s=Ut(e.padding),r=io(t.ctx,e),o=Of(i,r,e,s);return{initProperties:Ti(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Is.id="labelAnnotation",Is.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Is.defaultRoutes={borderColor:"color"};function hk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Ut(s.padding);return{x:n+o.left+r,y:t+o.top+r,width:e-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}const wl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),vl=(n,t,e)=>wl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Qf=(n,t,e)=>wl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Ls=n=>n*n,fk=(n,t,{x:e,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},Jf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Ml=(n,t,e,i)=>({x:Jf(n.x,t.x,e.x,i),y:Jf(n.y,t.y,e.y,i)}),tm=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),em=(n,t,e,i)=>-Math.atan2(tm(n.x,t.x,e.x,i),tm(n.y,t.y,e.y,i))+.5*ht;class Ns extends Jt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const o={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){on(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,m=l.isPointInStroke(a,h,f)||Sl(this,o,s);return l.restore(),m}const c=Ls(r);return yk(this,o,c,s)||Sl(this,o,s)}return mk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return Jn(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!on(t,a))return t.restore();Ci(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return kk(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=om(this),m=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),kl(t,0,h,c),kl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=VS(t,e),{x:s,y:r,x2:o,y2:a}=i,l=gk(i,t.chartArea),c=l?pk({x:s,y:r},{x:o,y:a},t.chartArea):{x:s,y:r,x2:o,y2:a,width:Math.abs(o-s),height:Math.abs(a-r)};if(c.centerX=(o+s)/2,c.centerY=(a+r)/2,c.initProperties=Ti(t,c,e),e.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Sk(c,e,di(h,f))}const u=bk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Ns.id="lineAnnotation";const nm={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};Ns.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},nm),fill:!1,length:12,start:Object.assign({},nm),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Is.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Ns.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Ns.defaultRoutes={borderColor:"color"};function mk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=fk(t,e,n.getProps(["x","y","x2","y2"],r),i);return Sf(o,s)||Sl(n,{mouseX:t,mouseY:e},r,i)}function gk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&e<a||n>r&&e>r||t<s&&i<s||t>o&&i>o)}function im({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Qf(o,{x:n,y:t},e),n=o),n>s&&(t=Qf(s,{x:n,y:t},e),n=s),t<i&&(n=vl(i,{x:n,y:t},e),t=i),t>r&&(n=vl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function pk(n,t,e){const{x:i,y:s}=im(n,t,e),{x:r,y:o}=im(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function yk(n,{mouseX:t,mouseY:e},i=Qn,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,h=Ls(c)+Ls(u),f=h===0?-1:((t-r)*c+(e-o)*u)/h;let m,g;return f<0?(m=r,g=o):f>1?(m=a,g=l):(m=r+f*c,g=o+f*u),Ls(t-m)+Ls(e-g)<=i}function Sl(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function bk(n,t,e){const i=e.borderWidth,s=Ut(e.padding),r=io(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return xk(t,e,{width:o,height:a,padding:s},n.chartArea)}function _k(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ht/2?r-ht:r<ht/-2?r+ht:r}function xk(n,t,e,i){const{width:s,height:r,padding:o}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},h=t.rotation==="auto"?_k(n):$t(t.rotation),f=wk(s,r,h),m=vk(n,t,{labelSize:f,padding:o},i),g=n.cp?Ml(c,n.cp,u,m):wl(c,u,m),_={size:f.w,min:i.left,max:i.right,padding:o.left},x={size:f.h,min:i.top,max:i.bottom,padding:o.top},M=rm(g.x,_)+a,v=rm(g.y,x)+l;return{x:M-s/2,y:v-r/2,x2:M+s/2,y2:v+r/2,centerX:M,centerY:v,pointX:g.x,pointY:g.y,width:s,height:r,rotation:sr(h)}}function wk(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function vk(n,t,e,i){let s;const r=Mk(n,i);return t.position==="start"?s=sm({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-sm({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=gl(1,t.position),s}function sm(n,t,e,i){const{labelSize:s,padding:r}=t,o=n.w*i.dx,a=n.h*i.dy,l=o>0&&(s.w/2+r.left-i.x)/o,c=a>0&&(s.h/2+r.top-i.y)/a;return to(Math.max(l,c),0,.25)}function Mk(n,t){const{x:e,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(o,l),dx:a<=c?1:-1,dy:o<=l?1:-1}}function rm(n,t){const{size:e,min:i,max:s,padding:r}=t,o=e/2;return e>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function om(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:am(n,e),endAdjust:am(n,i)}}function am(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(vl(0,r,{x:0,y:s}))}function kl(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:o,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ci(n,i),on(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),o===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Sk(n,t,e){const{x:i,y:s,x2:r,y2:o,centerX:a,centerY:l}=n,c=Math.atan2(o-s,r-i),u=pl(t.controlPoint,0),h={x:a+Cn(e,u.x,!1),y:l+Cn(e,u.y,!1)};return Zn(h,{x:a,y:l},c)}function lm(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),kl(n,0,-s,r),n.restore())}function kk(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=om(t),m={x:s,y:r},g={x:o,y:a},_=em(m,e,g,0),x=em(m,e,g,1)-ht,M=Ml(m,e,g,h/i),v=Ml(m,e,g,1-f/i),T=new Path2D;n.beginPath(),T.moveTo(M.x,M.y),T.quadraticCurveTo(e.x,e.y,v.x,v.y),n.shadowColor=l.borderShadowColor,n.stroke(T),t.path=T,t.ctx=n,lm(n,M,{angle:_,adjust:h},c),lm(n,v,{angle:x,adjust:f},u)}class Fs extends Jt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Dk({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,o);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:a,end:c},f=Zn({x:t,y:e},this.getCenterPoint(s),$t(-r));return f[i]>=h.start-o-Qn&&f[i]<=h.end+o+Qn}getCenterPoint(t){return Jn(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),no(t,this.getCenterPoint(),o.rotation),Ci(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=on(t,o);t.ellipse(s,r,i/2,e/2,ht/2,0,2*ht),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return jf(t,e)}}Fs.id="ellipseAnnotation",Fs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Oi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Fs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Fs.descriptors={label:{_fallback:!0}};function Dk(n,t,e,i){const{width:s,height:r,centerX:o,centerY:a}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=$t(e||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(n.x-o)+f*(n.y-a),2),g=Math.pow(f*(n.x-o)-h*(n.y-a),2);return m/Math.pow(l+i,2)+g/Math.pow(c+i,2)<=1.0001}class oo extends Jt{inRange(t,e,i,s){const{x:r,y:o,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?xS({x:t,y:e},this.getCenterPoint(s),c/2,u):Sf(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return Jn(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ci(t,e);const s=on(t,e);CS(t,this,this.centerX,this.centerY),s&&!eo(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Yf(t,e);return i.initProperties=Ti(t,i,e),i}}oo.id="pointAnnotation",oo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},oo.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ao extends Jt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Ck(this.elements,t,e,s);const r=Zn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation)),o=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...o),l=Math.max(...o);return r[i]>=a&&r[i]<=l}getCenterPoint(t){return Jn(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ci(t,i);const s=on(t,i);let r=!0;for(const o of e)r?(t.moveTo(o.x,o.y),r=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Yf(t,e),{sides:s,rotation:r}=e,o=[],a=2*ht/s;let l=r*Lo;for(let c=0;c<s;c++,l+=a){const u=Tk(i,e,l);u.initProperties=Ti(t,i,e),o.push(u)}return i.elements=o,i}}ao.id="polygonAnnotation",ao.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ao.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Tk({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const o=(i+s)/2,a=Math.sin(r),l=Math.cos(r),c={x:n+a*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+a*(e+o),bY:t-l*(e+o)}}}function Ck(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const o of n){const a=o.getProps(["bX","bY"],i);a.bY>e!=r.bY>e&&t<(r.bX-a.bX)*(e-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}const Pn={box:Oi,doughnutLabel:ro,ellipse:Fs,label:Is,line:Ns,point:oo,polygon:ao};Object.keys(Pn).forEach(n=>{At.describe(`elements.${Pn[n].id}`,{_fallback:"plugins.annotation.common"})});const Pk={update:Object.assign},Ok=xl.concat(so),cm=(n,t)=>mt(t)?Cl(n,t):n,Dl=n=>n==="color"||n==="font";function Tl(n="line"){return Pn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function Ek(n,t,e,i){const s=Rk(n,e.animations,i),r=t.annotations,o=Nk(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=um(o,a,l.type),u=l.setContext(Lk(n,c,o,l)),h=c.resolveElementProperties(n,u);h.skip=Ak(h),"elements"in h&&(Ik(c,h.elements,u,s),delete h.elements),me(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=dm(u),s.update(c,h)}}function Ak(n){return isNaN(n.x)||isNaN(n.y)}function Rk(n,t,e){return e==="reset"||e==="none"||e==="resize"?Pk:new Go(n,t)}function Ik(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const o=t[r],a=o.properties,l=um(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=dm(c),i.update(l,a)}}function um(n,t,e,i){const s=Pn[Tl(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function dm(n){const t=Pn[Tl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Cl(n,t.defaults),Cl(n,t.defaultRoutes));for(const i of Ok)e[i]=n[i];return e}function Cl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];Dl(i)&&St(r)?e[i]=r.map(o=>cm(o,s)):e[i]=cm(r,s)}return e}function Lk(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function Nk(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var Fk="3.1.0";const On=new Map,hm=n=>n.type!=="doughnutLabel",zk=xl.concat(so);var fm={id:"annotation",version:Fk,beforeRegister(){wS("chart.js","4.0",Ce.version)},afterRegister(){Ce.register(Pn)},afterUnregister(){Ce.unregister(Pn)},beforeInit(n){On.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=On.get(n),s=i.annotations=[];let r=e.annotations;mt(r)?Object.keys(r).forEach(o=>{const a=r[o];mt(a)&&(a.id=o,s.push(a))}):St(r)&&s.push(...r),ek(s.filter(hm),n.scales)},afterDataLimits(n,t){const e=On.get(n);tk(n,t.scale,e.annotations.filter(hm).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=On.get(n);GS(n,i,e),Ek(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),JS(n,i,e)},beforeDatasetsDraw(n,t,e){zs(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){zs(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){zs(n,t.index,e.clip)},beforeDraw(n,t,e){zs(n,"beforeDraw",e.clip)},afterDraw(n,t,e){zs(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=On.get(n);KS(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){On.delete(n)},getAnnotations(n){const t=On.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return ml(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!zk.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Pn[Tl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Dl,_fallback:!0},_indexable:Dl}},additionalOptionScopes:[""]};function zs(n,t,e){const{ctx:i,chartArea:s}=n,r=On.get(n);e&&Zi(i,s);const o=Bk(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)Hk(i,s,r,a);e&&Qi(i)}function Bk(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function Hk(n,t,e,i){const s=i.element;i.main?(Gf(e,s,"beforeDraw"),s.draw(n,t),Gf(e,s,"afterDraw")):s.draw(n,t)}const Wk={class:"zoom-timerange-container"},Vk={class:"zoom-timerange-details"},Yk={class:"label","data-testid":"zoom-timerange-from"},jk={class:"label","data-testid":"zoom-timerange-to"},$k=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.ref(Ss({tickValue:t.start,granularity:t.granularity})),s=d.ref(Ss({tickValue:t.end,granularity:t.granularity})),r=(o,a)=>{La(()=>{i.value=Ss({tickValue:o,granularity:t.granularity}),s.value=Ss({tickValue:a,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([o,a])=>{r(o,a)},{immediate:!0}),(o,a)=>(d.openBlock(),d.createElementBlock("div",Wk,[d.createElementVNode("div",Vk,[d.createElementVNode("div",Yk,d.toDisplayString(d.unref(e).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",jk,d.toDisplayString(d.unref(e).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(s.value),1)])]))}}),ke=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},mm=ke($k,[["__scopeId","data-v-0e972e3c"]]),Uk={class:"zoom-actions-container"},qk={class:"zoom-actions-heading"},Xk={class:"zoom-action-select"},Gk=["data-testid"],Kk=["aria-disabled","href"],Zk=["onClick"],Qk=ke(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,s=r=>{r.action&&(r.action(e.newTimeRange),i("onAction"))};return(r,o)=>(d.openBlock(),d.createElementBlock("div",Uk,[d.createElementVNode("div",qk,[d.createVNode(mm,{end:r.newTimeRange.end,granularity:r.granularity,start:r.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Ks.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(Fa),size:d.unref(za),onClick:o[0]||(o[0]=a=>r.$emit("onAction"))},null,8,["color","size"])]),o[2]||(o[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",Xk,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.zoomActionItems,a=>(d.openBlock(),d.createElementBlock("div",{key:a.key,class:d.normalizeClass(["zoom-action-item",{disabled:a.disabled}]),"data-testid":`zoom-action-item-${a.key}`},[a.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":a.disabled,class:"zoom-action-link",href:a.href,onClick:o[1]||(o[1]=l=>r.$emit("onAction"))},d.toDisplayString(a.label),9,Kk)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(a)},d.toDisplayString(a.label),9,Zk))],10,Gk))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),Jk={key:2},tD={class:"tooltip-title"},eD={class:"title"},nD={key:0,class:"subtitle"},iD={class:"context"},sD={class:"metric"},rD={class:"tooltip"},oD={key:0},aD={class:"display-value"},lo=ke(d.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,s=d.ref(null),{x:r,y:o,isDragging:a}=aS(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${o.value}px`),c=d.computed(()=>`${r.value}px`),u=d.computed(()=>i.state.tooltipContext),h=d.computed(()=>i.state.metricDisplay),f=d.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return d.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,g])=>{a.value||(r.value=parseFloat(m),o.value=parseFloat(g))}),d.watch(a,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(s,m=>{if(m){const{width:g,height:_}=m.getBoundingClientRect();e("dimensions",{width:g,height:_})}}),(m,g)=>{var _,x;return m.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:m.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${m.absoluteLeft}, ${m.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[m.state.interactionMode==="selecting-chart-area"&&m.granularity?(d.openBlock(),d.createBlock(mm,{key:0,end:(_=m.zoomTimeRange)==null?void 0:_.end,granularity:m.granularity,start:(x=m.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):m.state.interactionMode==="zoom-interactive"&&m.zoomTimeRange&&m.zoomActionItems&&m.granularity?(d.openBlock(),d.createBlock(Qk,{key:1,granularity:m.granularity,"new-time-range":m.zoomTimeRange,"zoom-action-items":m.zoomActionItems,onOnAction:g[0]||(g[0]=M=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",Jk,[d.createElementVNode("div",tD,[d.createElementVNode("div",eD,[d.createElementVNode("div",null,d.toDisplayString(m.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Ks.DragIcon),{key:0,class:"drag-icon",color:d.unref(Fa),size:d.unref(za)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",nD,[d.createElementVNode("div",iD,d.toDisplayString(u.value),1),d.createElementVNode("div",sD,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",rD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.state.tooltipSeries,({backgroundColor:M,borderColor:v,label:T,value:k,isSegmentEmpty:C},I)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:T+I},[m.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",oD,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:M,"border-color":v})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:C}])},d.toDisplayString(T),3),d.createElementVNode("span",aD,d.toDisplayString(k),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-078294a6"]]),lD=["onClick"],cD={key:0,class:"sub-label"},uD={class:"tooltip-content"},Pl=ke(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){d.useCssVars(k=>({"6d3f1170":l.value}));const t=n,{i18n:e}=bt.useI18n(),i=d.ref(),s=d.ref([]),r=d.inject("showLegendValues",!0),o=d.inject("legendPosition",d.ref(Nt.Right)),a=d.ref([]),l=d.ref(fh),c=()=>{const k=i.value;if(!k||!s.value||k.children.length===0)return 0;const C=k.children[0].getBoundingClientRect().top;for(const I of s.value)if(I.getBoundingClientRect().top>C)return!0;return!1},u=d.computed(()=>t.items.length>2||o.value===Nt.Right),h=()=>{i.value&&o.value===Nt.Bottom&&(c()?l.value=Fw:l.value=fh)},f=()=>{if(i.value&&o.value===Nt.Bottom){let k=0;s.value.forEach(I=>{const P=Array.from(I.children).reduce((y,b)=>y+b.offsetWidth,0);P>k&&(k=P)});const C=parseInt(Nw,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${k+C}px)`}h()},m=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let k=0;k<t.items.length;k++)if(t.items[k].text!==a.value[k].text)return a.value=t.items,!0;return!1};d.watch(()=>t.items,()=>{m()&&f()},{immediate:!0,flush:"post"});const g=d.ref(0),_=d.ref(0),x=new ResizeObserver(La(k=>{const C=k[0],I=C.contentRect.width,P=C.contentRect.height;I!==g.value&&P===_.value&&f(),g.value=I,_.value=P},100));d.watch(()=>o.value,()=>{f()}),d.onMounted(()=>{a.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),d.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const M=(k=0,C)=>{if(t.chartInstance===null)return;const I=t.chartInstance instanceof Ce?t.chartInstance:t.chartInstance.chart;v(k,C)?I.hide(k,C):I.show(k,C),I.update()},v=(k=0,C)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const I=t.chartInstance instanceof Ce?t.chartInstance:t.chartInstance.chart,P=I.getDatasetMeta(k);return P.dataset||C===void 0?I.isDatasetVisible(k):!(P.data.length&&P.data[C].hidden)},T=k=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[k];return(k,C)=>{const I=d.resolveComponent("KTooltip");return d.unref(o)!==d.unref(Nt).Hidden?(d.openBlock(),d.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:d.normalizeClass(["legend-container",T(d.unref(o))]),"data-testid":"legend"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.items,({fillStyle:P,strokeStyle:y,text:b,datasetIndex:S,index:O,value:R,isSegmentEmpty:A})=>(d.openBlock(),d.createElementBlock("li",{key:b,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:z=>M(S,O)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:P,"border-color":y})},null,4),d.createVNode(I,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!v(S,O)}])},[d.createElementVNode("div",{class:d.normalizeClass(["label",{"truncate-label":u.value,empty:A}])},d.toDisplayString(b),3),R&&d.unref(r)?(d.openBlock(),d.createElementBlock("div",cD,d.toDisplayString(R.formatted),1)):d.createCommentVNode("",!0)],2)]),_:2},[A?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",uD,d.toDisplayString(d.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,lD))),128))],2)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-2e13ddb3"]]),ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function dD(n,t=0){return(ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]).toLowerCase()}let Ol;const hD=new Uint8Array(16);function fD(){if(!Ol){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ol=crypto.getRandomValues.bind(crypto)}return Ol(hD)}const gm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function co(n,t,e){var s;if(gm.randomUUID&&!n)return gm.randomUUID();n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??fD();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,dD(i)}const pm=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()};class ym{constructor(){E(this,"id","highlightPlugin");E(this,"_clickedElements");E(this,"_previousHoverOption");E(this,"_clicked",!1);E(this,"_pause",!1);E(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&pm(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,pm(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const mD=["id"],gD=["id"],pD={class:"axis-tooltip-content"},bm=6,yD="100%",bD="100%",_D=20,xD=20,_m=6,wD=0,vD=10,MD=10,SD=1,kD=ke(d.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=bt.useI18n(),{translateUnit:i}=bt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),o=new ym,a=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:B},Y)=>{var nt;const V=B.data,J=(nt=V.labels)==null?void 0:nt.indexOf(Y);return V.datasets.reduce((it,rt,st)=>{if(B.isDatasetVisible(st)){const wt=rt.data[J];return isNaN(wt)?it:it+wt}else return it},0)},u=(B,Y,V,J)=>{const nt=J==="horizontal";Y===null&&(Y=e.t("entityNoName"));const it={type:"label",yValue:wt=>nt?Y:c(wt,Y),xValue:wt=>nt?c(wt,Y):Y},rt={...it,position:nt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>nt?0:-Math.abs(qw()),content:wt=>Wa(c(wt,Y),V)},st={...it,content:wt=>wh(c(wt,Y),xh(wt.chart,B)),position:nt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:wt=>nt?_h(Wa(c(wt,Y),V)):0,color:ph};return{[`${Y}-value`]:rt,[`${Y}-percent`]:st}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=co(),g=co(),_=co(),x=d.ref([]),M=d.inject("legendPosition",Nt.Right),v=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),T=d.toRef(t,"metricUnit"),k=d.computed(()=>t.orientation==="horizontal"),C=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:k.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:I,tooltipAbsoluteTop:P}=bt.useTooltipAbsolutePosition(l,C),y=d.ref(0),b=()=>{var B;return t.annotations&&((B=t.chartData.labels)==null?void 0:B.reduce((Y,V)=>Object.assign(Y,u(t.chartData,V,T.value,t.orientation)),{}))},S={id:m,afterUpdate(B){y.value+=1,x.value=ch(B,t.legendValues,t.chartLegendSortFn)}},O={id:g,afterUpdate(B){B.options.plugins.annotation.annotations=t.annotations?b():{}}},z=[S,{id:"axisHover",afterEvent(B,Y){var V;if(v.show=!1,Y.event.type==="mousemove"){const J=Y.event,nt=B.options.indexAxis,it=B.scales,rt=B.scales[nt].getLabelForValue(Number(B.scales[nt].getValueForPixel(J[nt]))),wt=B.scales[nt].getLabels().indexOf(rt),ut=(V=t.chartData.isLabelEmpty)==null?void 0:V[wt];if((te=>te==="x"?J.y>it.x.top:J.x<it.y.right)(nt)){C.interactionMode!=="interactive"&&(C.showTooltip=!1);const ae=B.canvas.getContext("2d").measureText(rt).width,qt=Math.abs(Math.round(J.x-ae*.5)),Ee=Math.round(J.x+ae*.5),Mt=B.canvas.getBoundingClientRect(),Xt=40;v.left=nt==="x"?`${(qt>0?qt:Ee)-v.offset+Mt.left}px`:`${J.x-ae*.5-v.offset+Mt.left}px`,v.top=`${J.y-Xt+Mt.top}px`,rt.length>Br?(v.show=!0,v.text=rt):ut?(v.text=e.t("emptyEntityInfo"),v.show=!0):v.show=!1}else v.show=!1}}},{id:_,afterUpdate(B){B.options.layout.padding.right=k.value?j.value:0}},o,...t.annotations?[O]:[]],U=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),X=d.ref(0),W=d.ref(0),ct=new ResizeObserver(La(B=>{X.value=B[0].contentRect.width,W.value=B[0].contentRect.height},100)),q=d.computed(()=>{var Y,V;const B=(V=(Y=t.chartData)==null?void 0:Y.labels)==null?void 0:V.length;return h.value&&B&&!k.value?`${Math.max(B*(_D+_m),X.value)}px`:yD}),tt=d.computed(()=>{var Y,V;const B=(V=(Y=t.chartData)==null?void 0:Y.labels)==null?void 0:V.length;return h.value&&B&&k.value?`${Math.max(B*(xD+_m),W.value)}px`:bD});bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&Ce.register(fm),a.value&&(X.value=a.value.offsetWidth,W.value=a.value.offsetHeight,ct.observe(a.value))}),d.onUnmounted(()=>{a.value&&ct.unobserve(a.value)});const et=d.computed(()=>{const B=bt.useBarChartOptions({tooltipState:C,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:k.value?"y":"x",numLabels:U});return{...B.value,plugins:{...B.value.plugins,annotation:{annotations:b(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*bm}}}}),G=bt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),z,et),j=d.computed(()=>{y.value;const B=t.chartData.labels,Y=t.chartData.datasets,V=B.map((it,rt)=>Y.reduce((st,wt)=>isNaN(Number(wt.data[rt]))?st:st+Number(wt.data[rt]),0)),J=G.value?xh(G.value,t.chartData):Xw(t.chartData);return V.map(it=>_h(Wa(it,T.value)+wh(it,J))).reduce((it,rt)=>Math.max(it,rt),0)+bm});d.onBeforeUnmount(()=>{Ce.unregister(fm)});const $={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},Z=d.computed(()=>{if(f.value&&G.value){const B=window.devicePixelRatio,Y=G.value,V=Y.scales.y.width*B+SD,J=(Y.scales.y.height+Y.scales.y.top+Y.scales.x.height)*B,nt=f.value.getContext("2d");return nt.scale(B,B),nt.canvas.width=V,nt.canvas.height=J,nt.canvas.style.width=`${V/B}px`,nt.canvas.style.height=`${J/B}px`,{scale:B,width:V*B,height:J*B,targetCtx:nt}}return null}),_t=B=>{const Y=B.target;if(Z.value&&G.value&&!k.value){const V=Z.value.scale,J=Z.value.targetCtx,nt=Z.value.width,it=Z.value.height,rt=G.value,st=rt.canvas;J.fillStyle="white",Y.scrollLeft>=wD&&Y.scrollLeft<=vD?(J.globalCompositeOperation="source-over",J.clearRect(0,0,nt,it),J.drawImage(st,0,0,nt,it,0,0,nt,it),J.globalCompositeOperation="destination-over",J.fillRect(0,0,nt,it)):(J.globalCompositeOperation="source-over",J.fillRect(0,(rt.scales.y.height+rt.scales.y.top+MD)*V,nt,rt.scales.x.height*V))}C.offsetY=Y.scrollTop,C.offsetX=Y.scrollLeft,v.offset=Y.scrollLeft},gt=({width:B,height:Y})=>{C.width=B,C.height=Y};d.watch(()=>t.orientation,()=>{var B;if(f.value&&Z.value){const Y=Z.value.width,V=Z.value.height;((B=f.value)==null?void 0:B.getContext("2d")).clearRect(0,0,Y,V)}C.showTooltip=!1,C.interactionMode="idle"}),d.watch(()=>t.annotations,B=>{G.value&&(B?G.value.options.plugins.annotation.annotations=b(t.chartData):delete G.value.options.plugins.annotation.annotations)});const pt=()=>{C.showTooltip&&(C.interactionMode!=="idle"?C.interactionMode="idle":C.interactionMode="interactive")};return(B,Y)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",$[d.unref(M)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,mD),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:Y[0]||(Y[0]=V=>pt()),onScroll:_t},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:q.value,height:tt.value})},[d.createElementVNode("canvas",{id:d.unref(r),ref:"canvas",class:"chart-canvas"},null,8,gD)],4)],544),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[v.show?(d.openBlock(),d.createElementBlock("div",{key:0,class:"axis-tooltip",style:d.normalizeStyle({top:v.top,left:v.left}),width:"auto"},[d.createElementVNode("div",pD,d.toDisplayString(v.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(lo,{"absolute-left":d.unref(I),"absolute-top":d.unref(P),"chart-parent-ref":l.value,state:C,"tooltip-title":B.tooltipTitle,onDimensions:gt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(Pl,{id:d.unref(m),"chart-instance":d.unref(G),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-acf2a980"]]);/*!
|
|
24
24
|
* chartjs-adapter-date-fns v3.0.0
|
|
25
25
|
* https://www.chartjs.org
|
|
26
26
|
* (c) 2022 chartjs-adapter-date-fns Contributors
|
|
27
27
|
* Released under the MIT license
|
|
28
|
-
*/const xD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};wu._date.override({_id:"date-fns",formats:function(){return xD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=dt(n):e==="string"&&(typeof t=="string"?n=ew(n,t,new Date,this.options):n=sh(n,this.options)),ka(n)?n.getTime():null},format:function(n,t){return Ir(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return va(n,t);case"second":return K0(n,t);case"minute":return X0(n,t);case"hour":return $0(n,t);case"day":return Ar(n,t);case"week":return Z0(n,t);case"month":return wa(n,t);case"quarter":return G0(n,t);case"year":return Q0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Sa(n,t);case"second":return o_(n,t);case"minute":return i_(n,t);case"hour":return n_(n,t);case"day":return Fd(n,t);case"week":return a_(n,t);case"month":return Wd(n,t);case"quarter":return r_(n,t);case"year":return l_(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return rw(n);case"minute":return sw(n);case"hour":return iw(n);case"day":return Ma(n);case"week":return je(n);case"isoWeek":return je(n,{weekStartsOn:+e});case"month":return u_(n);case"quarter":return c_(n);case"year":return Vd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return p_(n);case"minute":return m_(n);case"hour":return h_(n);case"day":return Bd(n);case"week":return f_(n);case"month":return Hd(n);case"quarter":return g_(n);case"year":return d_(n);default:return n}}});const bm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},wD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...bm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},vD=d.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ei(n){return d.isProxy(n)?d.toRaw(n):n}function MD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return d.isProxy(t)?new Proxy(n,{}):n}function kD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function _m(n,t){n.labels=t}function xm(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function SD(n,t){const e={labels:[],datasets:[]};return _m(e,n.labels),xm(e,n.datasets,t),e}const DD=d.defineComponent({props:wD,setup(n,t){let{expose:e,slots:i}=t;const s=d.ref(null),r=d.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=n,g=SD(u,m),b=MD(g,u);r.value=new Ce(s.value,{type:c,data:b,options:{...h},plugins:f})},a=()=>{const c=d.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return d.onMounted(o),d.onUnmounted(a),d.watch([()=>n.options,()=>n.data],(c,u)=>{let[h,f]=c,[m,g]=u;const b=d.toRaw(r.value);if(!b)return;let x=!1;if(h){const k=Ei(h),M=Ei(m);k&&k!==M&&(kD(b,k),x=!0)}if(f){const k=Ei(f.labels),M=Ei(g.labels),T=Ei(f.datasets),v=Ei(g.datasets);k!==M&&(_m(b.config.data,k),x=!0),T&&T!==v&&(xm(b.config.data,T,n.datasetIdKey),x=!0)}x&&d.nextTick(()=>{l(b)})},{deep:!0}),()=>d.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function Ol(n,t){return Ce.register(t),d.defineComponent({props:bm,setup(e,i){let{expose:s}=i;const r=d.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>d.h(DD,vD({ref:o},{type:n,...e}))}})}const wm=Ol("bar",es),vm=Ol("doughnut",en),Mm=Ol("line",ns),TD={class:"chart-container"},CD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>sn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=bt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=d.ref([]),o=d.useTemplateRef("chartParent"),a=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=bt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(M){r.value=M.options.plugins.legend.labels.generateLabels(M).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((T,v)=>(T.labels.push(v.label),T.backgroundColor.push(v.backgroundColor),T.borderColor.push(mh(v.backgroundColor,50)),T.data.push(v.data.reduce((S,E)=>S+E,0)),T),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=bt.useDonutChartOptions({tooltipState:a,legendID:i}),b=d.ref(),x=M=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[M],k=({width:M,height:T})=>{a.width=M,a.height=T};return(M,T)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(M.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",TD,[d.createVNode(d.unref(vm),{ref_key:"chartInstance",ref:b,"chart-id":d.unref(s),data:m.value,options:d.unref(g),plugins:h.value},null,8,["chart-id","data","options","plugins"]),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(ao,{"absolute-left":d.unref(l),"absolute-top":d.unref(c),state:a,"tooltip-title":M.tooltipTitle,unit:M.metricUnit,onDimensions:k},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Cl,{id:d.unref(i),"chart-instance":b.value,items:r.value,position:M.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),PD=Se(CD,[["__scopeId","data-v-f3942f91"]]),km=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()};class Sm{constructor(){O(this,"id","verticalLinePlugin");O(this,"_clickedSegment");O(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;km(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;km(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const OD=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},ED=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},Dm=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class AD{constructor(){O(this,"id","dragSelectPlugin");O(this,"_isDragging",!1);O(this,"_startX",0);O(this,"_endX",0);O(this,"_dragTimeout");O(this,"_clearSelectionArea",!0);O(this,"_chart",null);O(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},r=a=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,Dm("dragSelectMove",t,this))},o=a=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,Dm("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",o),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(ED(t,this._startX,this._endX),OD(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const RD=["hidden","single","full"];var ei=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ei||{});const ID=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],LD=["gauge","top_n","single_value"],ND=20,FD="rgba(255, 171, 171, 0.4)",zD="rgba(255, 196, 0, 0.2)",Tm=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const s=(e-n.y)/i;return n.x+s*(t.x-n.x)},BD=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const r=i.data;r!=null&&r.length&&t.filter(o=>o.highlightIntersections).forEach(o=>{const a=r.map(c=>({ts:c.x,aboveThreshold:c.y>=o.value}));let l=a[0].aboveThreshold?r[0].x:void 0;for(let c=1;c<a.length;c++)!a[c-1].aboveThreshold&&a[c].aboveThreshold?l=Tm(r[c-1],r[c],o.value):a[c-1].aboveThreshold&&!a[c].aboveThreshold&&l!==void 0&&(e.push({start:l,end:Tm(r[c-1],r[c],o.value),type:o.type}),l=void 0);l!==void 0&&e.push({start:l,end:a[a.length-1].ts,type:o.type})})}),e},HD=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:s})=>s===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class WD{constructor(t){O(this,"id","thresholdPlugin");O(this,"_thresholds");O(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var e,i;for(const s of Object.keys(t.threshold||{})){const r=(e=t.threshold)==null?void 0:e[s];r&&(this._thresholds={...this._thresholds,[s]:r.map(o=>({...o,hovered:!1}))})}if(this._thresholds)for(const s of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[s]||delete this._thresholds[s]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const s=t.canvas;this._syncThresholds(i);const r=o=>{var a;if(t){const l=o.clientY,c=t.scales.y,u=s.getBoundingClientRect(),h=c.getValueForPixel(l-u.top);if(h)for(const f of Object.keys(this._thresholds||{})){const m=(a=this._thresholds)==null?void 0:a[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<ND})}}};s.addEventListener("mousemove",r),this._mouseMoveHandler=r}afterDatasetsDraw(t,e){var s;const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const o=(s=this._thresholds)==null?void 0:s[r];if(o){o.forEach(c=>{const h=t.scales.y.getPixelForValue(c.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Hr(c.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";c.label?f=`${c.label}: ${c.value}`:c.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:c.value}):c.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:c.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:c.value}),c.hovered&&(i.save(),i.fillStyle=Hr(c.type),i.font=Rw,i.fillText(f,t.chartArea.left,h-4),i.restore())});const a=BD(t,o);HD(a).forEach(c=>{const u=t.scales.x.getPixelForValue(c.start),h=t.scales.x.getPixelForValue(c.end);i.save(),i.fillStyle=c.type==="error"?FD:zD,i.fillRect(u,t.chartArea.top,h-u,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(u,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Hr(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const VD=Se(d.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=bt.useI18n(),r=new Sm,o=new gm,a=new AD,l=new WD(s),{translateUnit:c}=bt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),b=d.inject("legendPosition",Nt.Right),x=d.useTemplateRef("chartParent"),k=d.ref(void 0),M=d.ref(!1),T=d.inject(yf),v=T==null?void 0:T.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),S=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:f,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:E,tooltipAbsoluteTop:P}=bt.useTooltipAbsolutePosition(x,S),y={id:h,afterUpdate($){m.value=lh($,e.legendValues,e.chartLegendSortFn)}},_=d.computed(()=>[y,o,...e.brush?[a]:[],...e.type==="timeseries_line"?[r]:[],...e.threshold?[l]:[]]),C=d.computed(()=>`line-${_.value.map($=>$.id).join("-")}`),R=d.computed(()=>`bar-${_.value.map($=>$.id).join("-")}`),L=d.computed(()=>e.chartData&&Sw(e.chartData)),I=d.computed(()=>v?!1:M.value),{options:B}=bt.useLineChartOptions({tooltipState:S,timeRangeMs:d.toRef(e,"timeRangeMs"),granularity:d.toRef(e,"granularity"),legendID:h,stacked:d.toRef(e,"stacked"),metricAxesTitle:d.toRef(e,"metricAxesTitle"),dimensionAxesTitle:d.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:L,threshold:d.toRef(e,"threshold")});bt.useReportChartDataForSynthetics(d.toRef(e,"chartData"),d.toRef(e,"syntheticsDataKey"));const q=$=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[$],tt=({width:$,height:K})=>{S.width=$,S.height=K},V=($=!0)=>{S.interactionMode="idle",S.showTooltip=!1,a.clearSelectionArea(),o.isPaused&&o.resume($),r.isPaused&&r.resume()},ct=()=>{S.interactionMode="interactive"},U=()=>{var $,K;!u.value||!((K=($=u.value.chart.tooltip)==null?void 0:$.dataPoints)!=null&&K.length)||(S.interactionMode==="interactive"?r.clickedSegment=u.value.chart.tooltip.dataPoints[0]:r.destroyClickedSegment())},J=()=>{if(M.value){M.value=!1;return}S.interactionMode!=="idle"?V():ct(),U()};d.watch(()=>e.type,()=>{S.interactionMode="idle",S.showTooltip=!1,r.destroyClickedSegment()});const et=$=>{$.preventDefault(),$.stopPropagation();const{xStart:K,xEnd:_t}=$.detail;K&&_t&&(k.value={start:new Date(K),end:new Date(_t),type:"absolute"},v?S.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(K),end:new Date(_t),type:"absolute"}),V()),i("select-chart-range",k.value))},X=$=>{v&&(S.interactionMode="selecting-chart-area"),M.value=!0,r.pause(),o.pause();const{xStart:K,xEnd:_t}=$.detail;K&&_t&&(k.value={start:new Date(K),end:new Date(_t),type:"absolute"})},j=$=>{if(!x.value||S.interactionMode==="idle")return;const K=$.target;K&&x.value.contains(K)||M.value||V(!1)};return d.watch(()=>{var $;return($=u.value)==null?void 0:$.chart},()=>{var $;($=u.value)!=null&&$.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",et),u.value.chart.canvas.removeEventListener("dragSelectMove",X),u.value.chart.canvas.addEventListener("dragSelect",et),u.value.chart.canvas.addEventListener("dragSelectMove",X))}),d.onMounted(()=>{document.addEventListener("click",j,!0)}),d.onUnmounted(()=>{var $;($=u.value)!=null&&$.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",et),u.value.chart.canvas.removeEventListener("dragSelectMove",X)),document.removeEventListener("click",j,!0)}),($,K)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",q(d.unref(b))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:K[0]||(K[0]=_t=>J())},[$.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Mm),{key:C.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:$.chartData,"data-testid":"time-series-line-chart",options:d.unref(B),plugins:_.value},null,8,["chart-id","data","options","plugins"])):$.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(wm),{key:R.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:$.chartData,"data-testid":"time-series-bar-chart",options:d.unref(B),plugins:_.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),I.value?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(ao,{key:0,ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(E),"absolute-top":d.unref(P),"data-testid":"tooltip",granularity:$.granularity,state:S,"tooltip-title":$.tooltipTitle,"zoom-action-items":$.zoomActionItems,"zoom-time-range":k.value,onDimensions:tt,onOnAction:K[1]||(K[1]=()=>V(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"])),d.createVNode(Cl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3a82636b"]]),YD={class:"analytics-chart-shell"},jD={key:0,class:"chart-header"},$D={class:"tooltip-content"},UD={key:2,class:"analytics-chart-parent"},qD=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=bt.useI18n(),r=d.computed(()=>b.value?bt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Wr},d.toRef(i,"chartData")).value:bt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Wr},d.toRef(i,"chartData")).value),o=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),a=d.computed(()=>{var I;return(I=i.chartData)!=null&&I.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),l=d.computed(()=>{var I;return(I=i.chartData.meta)!=null&&I.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),c=d.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:u}=bt.useChartLegendValues(r,i.chartOptions.type,l),h=d.computed(()=>{var I,B,q;return((q=(B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.limit)==null?void 0:q.toString())||null}),f=d.computed(()=>{var I,B;return((B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.truncated)||!1}),m=s.t("limitedResultsShown",{maxReturned:h.value}),g=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),b=d.computed(()=>["timeseries_bar","timeseries_line"].some(I=>I===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),k=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),M=d.computed(()=>{var q,tt;if(!((q=i.chartData)!=null&&q.meta.metric_names)||!((tt=i.chartData)!=null&&tt.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}if(I)return s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),T=d.computed(()=>{var q,tt,V,ct;if((q=i.chartOptions)!=null&&q.metricAxesTitle)return(tt=i.chartOptions)==null?void 0:tt.metricAxesTitle;if(!((V=i.chartData)!=null&&V.meta.metric_names)||!((ct=i.chartData)!=null&&ct.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}return s.te(`metricAxisTitles.${I}`)&&s.te(`chartUnits.${B}`)?s.t(`metricAxisTitles.${I}`,{unit:s.t(`chartUnits.${B}`,{plural:"s"})})||void 0:I||void 0}),v=d.computed(()=>{var B;if((B=i.chartOptions)!=null&&B.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const I=b.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(I)return s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),S=d.computed(()=>{const I=ul(Number(i.chartData.meta.granularity_ms));if(I)return s.te(`granularityAxisTitles.${I}`)?s.t(`granularityAxisTitles.${I}`):I}),E=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),P=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),y=d.computed(()=>b.value?Dw(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=d.computed(()=>i.chartData.meta.granularity_ms?ul(i.chartData.meta.granularity_ms)||"hourly":ul(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),C=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(I,B)=>I.text===s.t("chartLabels.____OTHER____")?1:B.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.text,10))&&!isNaN(parseInt(B.text,10))?I.text<B.text?-1:1:I.value&&B.value?B.value.raw-I.value.raw:0),R=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(I,B)=>I.label===s.t("chartLabels.____OTHER____")?1:B.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.label,10))&&!isNaN(parseInt(B.label,10))?I.label<B.label?-1:1:I.value&&B.value?B.rawValue-I.rawValue:0),L=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:I=>e("zoom-time-range",I)}]:[],...i.exploreLink?[{label:s.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",c),d.provide("legendPosition",d.toRef(i,"legendPosition")),(I,B)=>{const q=d.resolveComponent("KTooltip"),tt=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",YD,[y.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",jD,[d.createVNode(q,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",$D,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Gs.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(Ow)})`,size:d.unref(Aw)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),y.value?(d.openBlock(),d.createElementBlock("div",UD,[b.value?(d.openBlock(),d.createBlock(VD,{key:0,brush:o.value,"chart-data":r.value,"chart-legend-sort-fn":C.value,"chart-tooltip-sort-fn":R.value,"dimension-axes-title":S.value,fill:I.chartOptions.stacked,granularity:_.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,stacked:I.chartOptions.stacked,"synthetics-data-key":I.syntheticsDataKey,threshold:I.chartOptions.threshold,"time-range-ms":a.value,"tooltip-metric-display":M.value,"tooltip-title":I.tooltipTitle,type:I.chartOptions.type,"zoom-action-items":L.value,onSelectChartRange:B[0]||(B[0]=V=>e("select-chart-range",V)),onZoomTimeRange:B[1]||(B[1]=V=>e("zoom-time-range",V))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):g.value?(d.openBlock(),d.createBlock(_D,{key:1,annotations:I.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":C.value,"chart-tooltip-sort-fn":R.value,"data-testid":"bar-chart-container","dimension-axes-title":v.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,orientation:k.value,stacked:I.chartOptions.stacked,"synthetics-data-key":I.syntheticsDataKey,"tooltip-metric-display":M.value,"tooltip-title":I.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(PD,{key:2,"chart-data":r.value,"dataset-colors":I.chartOptions.chartDatasetColors||d.unref(Wr),"legend-position":I.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"synthetics-data-key":I.syntheticsDataKey,"tooltip-dimension-display":v.value,"tooltip-metric-display":M.value,"tooltip-title":I.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(tt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(E.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(P.value),1)]),_:1}))])}}}),XD=Se(qD,[["__scopeId","data-v-01aae525"]]),GD={class:"chart-parent","data-testid":"gauge-chart-parent"},KD={class:"chart-totals-flex"},ZD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},QD=Se(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:sn},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.ref(lo()),s=d.computed(()=>[t.chartData.datasets.reduce((g,b)=>(g.labels.push(b.label),g.borderColor.push(b.backgroundColor),g.backgroundColor.push(b.backgroundColor),g.data.push(b.data.reduce((x,k)=>x+k,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=d.computed(()=>({...t.chartData,datasets:s.value}));bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=d.ref(),l=d.computed(()=>{var m;return Ss((m=s==null?void 0:s.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),c=d.computed(()=>{var m,g;return Ss(((m=s==null?void 0:s.value[0])==null?void 0:m.data[0])+((g=s==null?void 0:s.value[0])==null?void 0:g.data[1]),{capital:!0})}),u=d.computed(()=>{var m;return`color: ${(m=s==null?void 0:s.value[0])==null?void 0:m.backgroundColor[t.numerator]}`}),h=d.computed(()=>["full","single"].includes(t.metricDisplay)),f=d.computed(()=>t.metricDisplay==="full");return(m,g)=>(d.openBlock(),d.createElementBlock("div",GD,[d.createElementVNode("div",KD,[h.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(u.value)},d.toDisplayString(l.value),5)):d.createCommentVNode("",!0),f.value?(d.openBlock(),d.createElementBlock("div",ZD,d.toDisplayString(d.unref(e).t("total"))+": "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:n.height,width:n.width})},[d.createVNode(d.unref(vm),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]),JD={class:"chart-parent","data-testid":"single-value-parent"},tT={key:1,class:"single-value-wrapper"},eT={class:"single-value","data-testid":"single-value-chart"},nT={key:0,class:"single-value-unit"},iT=Se(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:bf}},setup(n){const{i18n:{t}}=bt.useI18n(),e=n,i=d.computed(()=>e.data.data[0]),s=d.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=d.computed(()=>{var u,h;const c=s.value?(h=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:h[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=d.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=d.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=d.computed(()=>{var h;const c=a.value;if(c===null)return"";if((h=s.value)!=null&&h.includes("_size_"))return Yr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:bf;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return d.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",JD,[a.value===null?(d.openBlock(),d.createBlock(h,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t)("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",tT,[d.createElementVNode("span",eT,d.toDisplayString(l.value),1),o.value?(d.openBlock(),d.createElementBlock("span",nT," "+d.toDisplayString(r.value),1)):d.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),sT={class:"simple-chart-shell"},rT={key:1,class:"analytics-chart-parent"},oT=Se(d.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.computed(()=>{var u;const c=bt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||sn},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=d.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=d.computed(()=>t.chartOptions.type==="gauge"),o=d.computed(()=>t.chartOptions.type==="single_value"),a=d.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=d.computed(()=>{var u,h;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(h=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:h[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",sT,[l.value?(d.openBlock(),d.createElementBlock("div",rT,[r.value?(d.openBlock(),d.createBlock(QD,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),o.value?(d.openBlock(),d.createBlock(iT,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),aT={class:"top-n-card-title","data-testid":"top-n-card-title"},lT={class:"top-n-card-description","data-testid":"top-n-card-description"},cT={key:3,class:"top-n-table","data-testid":"top-n-table"},uT={class:"table-headings"},dT={class:"table-row"},hT={class:"column-1"},fT={class:"column-2"},mT={class:"table-body","data-testid":"top-n-data"},gT=["data-testid"],pT={class:"column-1"},yT={class:"column-2"},bT=Se(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.computed(()=>t.data.data),s=d.computed(()=>{var g;return!!((g=i.value)!=null&&g.length)}),r=d.computed(()=>{var g,b;return(g=t.data.meta)!=null&&g.display&&((b=Object.keys(t.data.meta.display))==null?void 0:b[0])||""}),o=d.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=d.computed(()=>{var g,b;return(b=(g=t.data.meta)==null?void 0:g.metric_names)!=null&&b.length?t.data.meta.metric_names[0]:""}),l=d.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=d.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=g=>{const b=g.event;return String(b[r.value])},h=g=>{const b=u(g),x=o.value&&o.value[b];return x?x.name:"-"},f=g=>{const b=u(g),x=o.value&&o.value[b];return x?!!x.deleted:!1},m=g=>{if(!a.value)return"–";const x=g.event[a.value];return x?Ss(x,{capital:!0,round:!0}):"–"};return(g,b)=>{const x=d.resolveComponent("KEmptyState"),k=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":g.titleTag},d.createSlots({default:d.withCtx(()=>[c.value?(d.openBlock(),d.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(c.value),1)]),_:1})):g.isLoading?(d.openBlock(),d.createBlock(k,{key:1,"table-columns":2,type:"table"})):s.value?(d.openBlock(),d.createElementBlock("div",cT,[d.createElementVNode("div",uT,[d.createElementVNode("div",dT,[d.createElementVNode("div",hT,d.toDisplayString(d.unref(e).t("topNTable.nameLabel")),1),d.createElementVNode("div",fT,d.toDisplayString(l.value),1)])]),d.createElementVNode("div",mT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(T,v)=>(d.openBlock(),d.createElementBlock("div",{key:`entry-${v}`,class:"table-row","data-testid":`row-${u(T)}`},[d.createElementVNode("div",pT,[d.renderSlot(g.$slots,"name",{record:{id:u(T),name:h(T),deleted:f(T),dimension:r.value}},()=>[d.createTextVNode(d.toDisplayString(h(T)),1)],!0)]),d.createElementVNode("div",yT," "+d.toDisplayString(m(T)),1)],8,gT))),128))])])):(d.openBlock(),d.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(g.emptyStateTitle||d.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[g.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",aT,d.toDisplayString(g.title),1)]),key:"0"}:void 0,g.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",lT,d.toDisplayString(g.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var co={exports:{}};co.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",b="[object Map]",x="[object Number]",k="[object Object]",M="[object Promise]",T="[object RegExp]",v="[object Set]",S="[object String]",E="[object Symbol]",P="[object WeakMap]",y="[object ArrayBuffer]",_="[object DataView]",C="[object Float32Array]",R="[object Float64Array]",L="[object Int8Array]",I="[object Int16Array]",B="[object Int32Array]",q="[object Uint8Array]",tt="[object Uint8ClampedArray]",V="[object Uint16Array]",ct="[object Uint32Array]",U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,et=/^\./,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,K=/^\[object .+?Constructor\]$/,_t=/^(?:0|[1-9]\d*)$/,gt={};gt[C]=gt[R]=gt[L]=gt[I]=gt[B]=gt[q]=gt[tt]=gt[V]=gt[ct]=!0,gt[l]=gt[c]=gt[y]=gt[u]=gt[_]=gt[h]=gt[f]=gt[m]=gt[b]=gt[x]=gt[k]=gt[T]=gt[v]=gt[S]=gt[P]=!1;var pt=typeof be=="object"&&be&&be.Object===Object&&be,z=typeof self=="object"&&self&&self.Object===Object&&self,Y=pt||z||Function("return this")(),W=t&&!t.nodeType&&t,Q=W&&!0&&n&&!n.nodeType&&n,nt=Q&&Q.exports===W,it=nt&&pt.process,rt=function(){try{return it&&it.binding("util")}catch{}}(),st=rt&&rt.isTypedArray;function wt(p,D){for(var N=-1,H=p?p.length:0;++N<H;)if(D(p[N],N,p))return!0;return!1}function ut(p){return function(D){return D==null?void 0:D[p]}}function Pt(p,D){for(var N=-1,H=Array(p);++N<p;)H[N]=D(N);return H}function te(p){return function(D){return p(D)}}function ae(p,D){return p==null?void 0:p[D]}function qt(p){var D=!1;if(p!=null&&typeof p.toString!="function")try{D=!!(p+"")}catch{}return D}function Ee(p){var D=-1,N=Array(p.size);return p.forEach(function(H,ft){N[++D]=[ft,H]}),N}function Mt(p,D){return function(N){return p(D(N))}}function Xt(p){var D=-1,N=Array(p.size);return p.forEach(function(H){N[++D]=H}),N}var Bt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,qe=Y["__core-js_shared__"],ni=function(){var p=/[^.]+$/.exec(qe&&qe.keys&&qe.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),Fe=Gt.toString,Ht=ie.hasOwnProperty,_e=ie.toString,ii=RegExp("^"+Fe.call(Ht).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uo=Y.Symbol,ho=Y.Uint8Array,zs=ie.propertyIsEnumerable,si=Bt.splice,Bs=Mt(Object.keys,Object),ri=dn(Y,"DataView"),an=dn(Y,"Map"),ln=dn(Y,"Promise"),Hs=dn(Y,"Set"),Ws=dn(Y,"WeakMap"),oi=dn(Object,"create"),Rl=fn(ri),Il=fn(an),fo=fn(ln),mo=fn(Hs),cn=fn(Ws),Ai=uo?uo.prototype:void 0,Vs=Ai?Ai.valueOf:void 0,go=Ai?Ai.toString:void 0;function un(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Ll(){this.__data__=oi?oi(null):{}}function ze(p){return this.has(p)&&delete this.__data__[p]}function Nl(p){var D=this.__data__;if(oi){var N=D[p];return N===s?void 0:N}return Ht.call(D,p)?D[p]:void 0}function Fl(p){var D=this.__data__;return oi?D[p]!==void 0:Ht.call(D,p)}function zl(p,D){var N=this.__data__;return N[p]=oi&&D===void 0?s:D,this}un.prototype.clear=Ll,un.prototype.delete=ze,un.prototype.get=Nl,un.prototype.has=Fl,un.prototype.set=zl;function Be(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Bl(){this.__data__=[]}function An(p){var D=this.__data__,N=Li(D,p);if(N<0)return!1;var H=D.length-1;return N==H?D.pop():si.call(D,N,1),!0}function Hl(p){var D=this.__data__,N=Li(D,p);return N<0?void 0:D[N][1]}function Wl(p){return Li(this.__data__,p)>-1}function Vl(p,D){var N=this.__data__,H=Li(N,p);return H<0?N.push([p,D]):N[H][1]=D,this}Be.prototype.clear=Bl,Be.prototype.delete=An,Be.prototype.get=Hl,Be.prototype.has=Wl,Be.prototype.set=Vl;function He(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Yl(){this.__data__={hash:new un,map:new(an||Be),string:new un}}function Rn(p){return zi(this,p).delete(p)}function jl(p){return zi(this,p).get(p)}function $l(p){return zi(this,p).has(p)}function Ul(p,D){return zi(this,p).set(p,D),this}He.prototype.clear=Yl,He.prototype.delete=Rn,He.prototype.get=jl,He.prototype.has=$l,He.prototype.set=Ul;function Ri(p){var D=-1,N=p?p.length:0;for(this.__data__=new He;++D<N;)this.add(p[D])}function ql(p){return this.__data__.set(p,s),this}function Xl(p){return this.__data__.has(p)}Ri.prototype.add=Ri.prototype.push=ql,Ri.prototype.has=Xl;function Ae(p){this.__data__=new Be(p)}function Ii(){this.__data__=new Be}function Gl(p){return this.__data__.delete(p)}function Ys(p){return this.__data__.get(p)}function Kl(p){return this.__data__.has(p)}function Zl(p,D){var N=this.__data__;if(N instanceof Be){var H=N.__data__;if(!an||H.length<e-1)return H.push([p,D]),this;N=this.__data__=new He(H)}return N.set(p,D),this}Ae.prototype.clear=Ii,Ae.prototype.delete=Gl,Ae.prototype.get=Ys,Ae.prototype.has=Kl,Ae.prototype.set=Zl;function Ql(p,D){var N=w(p)||vo(p)?Pt(p.length,String):[],H=N.length,ft=!!H;for(var Z in p)Ht.call(p,Z)&&!(ft&&(Z=="length"||$s(Z,H)))&&N.push(Z);return N}function Li(p,D){for(var N=p.length;N--;)if(wo(p[N][0],D))return N;return-1}var Jl=cc();function tc(p,D){return p&&Jl(p,D,li)}function Ni(p,D){D=Bi(D,p)?[D]:Xe(D);for(var N=0,H=D.length;p!=null&&N<H;)p=p[hn(D[N++])];return N&&N==H?p:void 0}function ec(p){return _e.call(p)}function nc(p,D){return p!=null&&D in Object(p)}function js(p,D,N,H,ft){return p===D?!0:p==null||D==null||!Kt(p)&&!xe(D)?p!==p&&D!==D:ic(p,D,js,N,H,ft)}function ic(p,D,N,H,ft,Z){var xt=w(p),Zt=w(D),Wt=c,ce=c;xt||(Wt=le(p),Wt=Wt==l?k:Wt),Zt||(ce=le(D),ce=ce==l?k:ce);var we=Wt==k&&!qt(p),ve=ce==k&&!qt(D),fe=Wt==ce;if(fe&&!we)return Z||(Z=new Ae),xt||Mo(p)?bo(p,D,N,H,ft,Z):uc(p,D,Wt,N,H,ft,Z);if(!(ft&o)){var Re=we&&Ht.call(p,"__wrapped__"),Ie=ve&&Ht.call(D,"__wrapped__");if(Re||Ie){var Nn=Re?p.value():p,mn=Ie?D.value():D;return Z||(Z=new Ae),N(Nn,mn,H,ft,Z)}}return fe?(Z||(Z=new Ae),dc(p,D,N,H,ft,Z)):!1}function sc(p,D,N,H){var ft=N.length,Z=ft;if(p==null)return!Z;for(p=Object(p);ft--;){var xt=N[ft];if(xt[2]?xt[1]!==p[xt[0]]:!(xt[0]in p))return!1}for(;++ft<Z;){xt=N[ft];var Zt=xt[0],Wt=p[Zt],ce=xt[1];if(xt[2]){if(Wt===void 0&&!(Zt in p))return!1}else{var we=new Ae,ve;if(!(ve===void 0?js(ce,Wt,H,r|o,we):ve))return!1}}return!0}function rc(p){if(!Kt(p)||_o(p))return!1;var D=G(p)||qt(p)?ii:K;return D.test(fn(p))}function oc(p){return xe(p)&&jt(p.length)&&!!gt[_e.call(p)]}function po(p){return typeof p=="function"?p:p==null?Hi:typeof p=="object"?w(p)?Fi(p[0],p[1]):lc(p):dC(p)}function ac(p){if(!mc(p))return Bs(p);var D=[];for(var N in Object(p))Ht.call(p,N)&&N!="constructor"&&D.push(N);return D}function lc(p){var D=hc(p);return D.length==1&&D[0][2]?qs(D[0][0],D[0][1]):function(N){return N===p||sc(N,p,D)}}function Fi(p,D){return Bi(p)&&xo(D)?qs(hn(p),D):function(N){var H=ko(N,p);return H===void 0&&H===D?So(N,p):js(D,H,void 0,r|o)}}function In(p){return function(D){return Ni(D,p)}}function yo(p){if(typeof p=="string")return p;if(ee(p))return go?go.call(p):"";var D=p+"";return D=="0"&&1/p==-1/0?"-0":D}function Xe(p){return w(p)?p:gc(p)}function cc(p){return function(D,N,H){for(var ft=-1,Z=Object(D),xt=H(D),Zt=xt.length;Zt--;){var Wt=xt[++ft];if(N(Z[Wt],Wt,Z)===!1)break}return D}}function bo(p,D,N,H,ft,Z){var xt=ft&o,Zt=p.length,Wt=D.length;if(Zt!=Wt&&!(xt&&Wt>Zt))return!1;var ce=Z.get(p);if(ce&&Z.get(D))return ce==D;var we=-1,ve=!0,fe=ft&r?new Ri:void 0;for(Z.set(p,D),Z.set(D,p);++we<Zt;){var Re=p[we],Ie=D[we];if(H)var Nn=xt?H(Ie,Re,we,D,p,Z):H(Re,Ie,we,p,D,Z);if(Nn!==void 0){if(Nn)continue;ve=!1;break}if(fe){if(!wt(D,function(mn,ci){if(!fe.has(ci)&&(Re===mn||N(Re,mn,H,ft,Z)))return fe.add(ci)})){ve=!1;break}}else if(!(Re===Ie||N(Re,Ie,H,ft,Z))){ve=!1;break}}return Z.delete(p),Z.delete(D),ve}function uc(p,D,N,H,ft,Z,xt){switch(N){case _:if(p.byteLength!=D.byteLength||p.byteOffset!=D.byteOffset)return!1;p=p.buffer,D=D.buffer;case y:return!(p.byteLength!=D.byteLength||!H(new ho(p),new ho(D)));case u:case h:case x:return wo(+p,+D);case f:return p.name==D.name&&p.message==D.message;case T:case S:return p==D+"";case b:var Zt=Ee;case v:var Wt=Z&o;if(Zt||(Zt=Xt),p.size!=D.size&&!Wt)return!1;var ce=xt.get(p);if(ce)return ce==D;Z|=r,xt.set(p,D);var we=bo(Zt(p),Zt(D),H,ft,Z,xt);return xt.delete(p),we;case E:if(Vs)return Vs.call(p)==Vs.call(D)}return!1}function dc(p,D,N,H,ft,Z){var xt=ft&o,Zt=li(p),Wt=Zt.length,ce=li(D),we=ce.length;if(Wt!=we&&!xt)return!1;for(var ve=Wt;ve--;){var fe=Zt[ve];if(!(xt?fe in D:Ht.call(D,fe)))return!1}var Re=Z.get(p);if(Re&&Z.get(D))return Re==D;var Ie=!0;Z.set(p,D),Z.set(D,p);for(var Nn=xt;++ve<Wt;){fe=Zt[ve];var mn=p[fe],ci=D[fe];if(H)var Nm=xt?H(ci,mn,fe,D,p,Z):H(mn,ci,fe,p,D,Z);if(!(Nm===void 0?mn===ci||N(mn,ci,H,ft,Z):Nm)){Ie=!1;break}Nn||(Nn=fe=="constructor")}if(Ie&&!Nn){var Do=p.constructor,To=D.constructor;Do!=To&&"constructor"in p&&"constructor"in D&&!(typeof Do=="function"&&Do instanceof Do&&typeof To=="function"&&To instanceof To)&&(Ie=!1)}return Z.delete(p),Z.delete(D),Ie}function zi(p,D){var N=p.__data__;return Us(D)?N[typeof D=="string"?"string":"hash"]:N.map}function hc(p){for(var D=li(p),N=D.length;N--;){var H=D[N],ft=p[H];D[N]=[H,ft,xo(ft)]}return D}function dn(p,D){var N=ae(p,D);return rc(N)?N:void 0}var le=ec;(ri&&le(new ri(new ArrayBuffer(1)))!=_||an&&le(new an)!=b||ln&&le(ln.resolve())!=M||Hs&&le(new Hs)!=v||Ws&&le(new Ws)!=P)&&(le=function(p){var D=_e.call(p),N=D==k?p.constructor:void 0,H=N?fn(N):void 0;if(H)switch(H){case Rl:return _;case Il:return b;case fo:return M;case mo:return v;case cn:return P}return D});function fc(p,D,N){D=Bi(D,p)?[D]:Xe(D);for(var H,ft=-1,xt=D.length;++ft<xt;){var Z=hn(D[ft]);if(!(H=p!=null&&N(p,Z)))break;p=p[Z]}if(H)return H;var xt=p?p.length:0;return!!xt&&jt(xt)&&$s(Z,xt)&&(w(p)||vo(p))}function $s(p,D){return D=D??a,!!D&&(typeof p=="number"||_t.test(p))&&p>-1&&p%1==0&&p<D}function Bi(p,D){if(w(p))return!1;var N=typeof p;return N=="number"||N=="symbol"||N=="boolean"||p==null||ee(p)?!0:J.test(p)||!U.test(p)||D!=null&&p in Object(D)}function Us(p){var D=typeof p;return D=="string"||D=="number"||D=="symbol"||D=="boolean"?p!=="__proto__":p===null}function _o(p){return!!ni&&ni in p}function mc(p){var D=p&&p.constructor,N=typeof D=="function"&&D.prototype||ie;return p===N}function xo(p){return p===p&&!Kt(p)}function qs(p,D){return function(N){return N==null?!1:N[p]===D&&(D!==void 0||p in Object(N))}}var gc=ai(function(p){p=Ln(p);var D=[];return et.test(p)&&D.push(""),p.replace(X,function(N,H,ft,Z){D.push(ft?Z.replace($,"$1"):H||N)}),D});function hn(p){if(typeof p=="string"||ee(p))return p;var D=p+"";return D=="0"&&1/p==-1/0?"-0":D}function fn(p){if(p!=null){try{return Fe.call(p)}catch{}try{return p+""}catch{}}return""}function ai(p,D){if(typeof p!="function"||D&&typeof D!="function")throw new TypeError(i);var N=function(){var H=arguments,ft=D?D.apply(this,H):H[0],Z=N.cache;if(Z.has(ft))return Z.get(ft);var xt=p.apply(this,H);return N.cache=Z.set(ft,xt),xt};return N.cache=new(ai.Cache||He),N}ai.Cache=He;function wo(p,D){return p===D||p!==p&&D!==D}function vo(p){return F(p)&&Ht.call(p,"callee")&&(!zs.call(p,"callee")||_e.call(p)==l)}var w=Array.isArray;function A(p){return p!=null&&jt(p.length)&&!G(p)}function F(p){return xe(p)&&A(p)}function G(p){var D=Kt(p)?_e.call(p):"";return D==m||D==g}function jt(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=a}function Kt(p){var D=typeof p;return!!p&&(D=="object"||D=="function")}function xe(p){return!!p&&typeof p=="object"}function ee(p){return typeof p=="symbol"||xe(p)&&_e.call(p)==E}var Mo=st?te(st):oc;function Ln(p){return p==null?"":yo(p)}function ko(p,D,N){var H=p==null?void 0:Ni(p,D);return H===void 0?N:H}function So(p,D){return p!=null&&fc(p,D,nc)}function li(p){return A(p)?Ql(p):ac(p)}function Xs(p,D){var N={};return D=po(D),tc(p,function(H,ft,Z){N[D(H,ft,Z)]=H}),N}function Hi(p){return p}function dC(p){return Bi(p)?ut(hn(p)):In(p)}n.exports=Xs}(co,co.exports);var _T=co.exports;const xT=tl(_T);var wT=9007199254740991,vT="[object Arguments]",MT="[object Function]",kT="[object GeneratorFunction]",ST="[object Symbol]",DT=typeof be=="object"&&be&&be.Object===Object&&be,TT=typeof self=="object"&&self&&self.Object===Object&&self,CT=DT||TT||Function("return this")();function PT(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function OT(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function ET(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var El=Object.prototype,AT=El.hasOwnProperty,Al=El.toString,Cm=CT.Symbol,RT=El.propertyIsEnumerable,Pm=Cm?Cm.isConcatSpreadable:void 0,Om=Math.max;function IT(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=zT),s||(s=[]);++r<o;){var a=n[r];e(a)?ET(s,a):s[s.length]=a}return s}function LT(n,t){return n=Object(n),NT(n,t,function(e,i){return i in n})}function NT(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function FT(n,t){return t=Om(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Om(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,PT(n,this,o)}}function zT(n){return WT(n)||HT(n)||!!(Pm&&n&&n[Pm])}function BT(n){if(typeof n=="string"||qT(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function HT(n){return YT(n)&&AT.call(n,"callee")&&(!RT.call(n,"callee")||Al.call(n)==vT)}var WT=Array.isArray;function VT(n){return n!=null&&$T(n.length)&&!jT(n)}function YT(n){return Em(n)&&VT(n)}function jT(n){var t=UT(n)?Al.call(n):"";return t==MT||t==kT}function $T(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wT}function UT(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Em(n){return!!n&&typeof n=="object"}function qT(n){return typeof n=="symbol"||Em(n)&&Al.call(n)==ST}var XT=FT(function(n,t){return n==null?{}:LT(n,OT(IT(t),BT))}),GT=XT;const KT=tl(GT);var Am={exports:{}};(function(n,t){(function(e,i){i()})(be,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,h)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof be=="object"&&be.global===be?be:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,h){var f=o.URL||o.webkitURL,m=document.createElement("a");u=u||c.name||"download",m.download=u,m.rel="noopener",typeof c=="string"?(m.href=c,m.origin===location.origin?r(m):s(m.href)?i(c,u,h):r(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){r(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,h),u);else if(s(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,h);var m=c.type==="application/octet-stream",g=/constructor/i.test(o.HTMLElement)||o.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||m&&g||a)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var T=x.result;T=b?T:T.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=T:location=T,f=null},x.readAsDataURL(c)}else{var k=o.URL||o.webkitURL,M=k.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){k.revokeObjectURL(M)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(Am);var ZT=Am.exports,Rm={exports:{}};/* @license
|
|
28
|
+
*/const DD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};vu._date.override({_id:"date-fns",formats:function(){return DD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=dt(n):e==="string"&&(typeof t=="string"?n=iw(n,t,new Date,this.options):n=rh(n,this.options)),ka(n)?n.getTime():null},format:function(n,t){return Lr(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Ma(n,t);case"second":return Q0(n,t);case"minute":return K0(n,t);case"hour":return q0(n,t);case"day":return Rr(n,t);case"week":return J0(n,t);case"month":return va(n,t);case"quarter":return Z0(n,t);case"year":return t_(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Da(n,t);case"second":return l_(n,t);case"minute":return r_(n,t);case"hour":return s_(n,t);case"day":return zd(n,t);case"week":return c_(n,t);case"month":return Vd(n,t);case"quarter":return a_(n,t);case"year":return u_(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return aw(n);case"minute":return ow(n);case"hour":return rw(n);case"day":return Sa(n);case"week":return je(n);case"isoWeek":return je(n,{weekStartsOn:+e});case"month":return h_(n);case"quarter":return d_(n);case"year":return Yd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return b_(n);case"minute":return p_(n);case"hour":return m_(n);case"day":return Hd(n);case"week":return g_(n);case"month":return Wd(n);case"quarter":return y_(n);case"year":return f_(n);default:return n}}});const xm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},TD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...xm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},CD=d.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ei(n){return d.isProxy(n)?d.toRaw(n):n}function PD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return d.isProxy(t)?new Proxy(n,{}):n}function OD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function wm(n,t){n.labels=t}function vm(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function ED(n,t){const e={labels:[],datasets:[]};return wm(e,n.labels),vm(e,n.datasets,t),e}const AD=d.defineComponent({props:TD,setup(n,t){let{expose:e,slots:i}=t;const s=d.ref(null),r=d.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=n,g=ED(u,m),_=PD(g,u);r.value=new Ce(s.value,{type:c,data:_,options:{...h},plugins:f})},a=()=>{const c=d.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return d.onMounted(o),d.onUnmounted(a),d.watch([()=>n.options,()=>n.data],(c,u)=>{let[h,f]=c,[m,g]=u;const _=d.toRaw(r.value);if(!_)return;let x=!1;if(h){const M=Ei(h),v=Ei(m);M&&M!==v&&(OD(_,M),x=!0)}if(f){const M=Ei(f.labels),v=Ei(g.labels),T=Ei(f.datasets),k=Ei(g.datasets);M!==v&&(wm(_.config.data,M),x=!0),T&&T!==k&&(vm(_.config.data,T,n.datasetIdKey),x=!0)}x&&d.nextTick(()=>{l(_)})},{deep:!0}),()=>d.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function El(n,t){return Ce.register(t),d.defineComponent({props:xm,setup(e,i){let{expose:s}=i;const r=d.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>d.h(AD,CD({ref:o},{type:n,...e}))}})}const Mm=El("bar",es),Sm=El("doughnut",en),km=El("line",ns),RD={class:"chart-container"},ID=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>sn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=bt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=d.ref([]),o=d.useTemplateRef("chartParent"),a=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=bt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(v){r.value=v.options.plugins.legend.labels.generateLabels(v).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((T,k)=>(T.labels.push(k.label),T.backgroundColor.push(k.backgroundColor),T.borderColor.push(gh(k.backgroundColor,50)),T.data.push(k.data.reduce((C,I)=>C+I,0)),T),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=bt.useDonutChartOptions({tooltipState:a,legendID:i}),_=d.ref(),x=v=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[v],M=({width:v,height:T})=>{a.width=v,a.height=T};return(v,T)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(v.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",RD,[d.createVNode(d.unref(Sm),{ref_key:"chartInstance",ref:_,"chart-id":d.unref(s),data:m.value,options:d.unref(g),plugins:h.value},null,8,["chart-id","data","options","plugins"]),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(lo,{"absolute-left":d.unref(l),"absolute-top":d.unref(c),state:a,"tooltip-title":v.tooltipTitle,unit:v.metricUnit,onDimensions:M},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Pl,{id:d.unref(i),"chart-instance":_.value,items:r.value,position:v.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),LD=ke(ID,[["__scopeId","data-v-f3942f91"]]),Dm=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()};class Tm{constructor(){E(this,"id","verticalLinePlugin");E(this,"_clickedSegment");E(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;Dm(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;Dm(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const ND=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},FD=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},Cm=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class zD{constructor(){E(this,"id","dragSelectPlugin");E(this,"_isDragging",!1);E(this,"_startX",0);E(this,"_endX",0);E(this,"_dragTimeout");E(this,"_clearSelectionArea",!0);E(this,"_chart",null);E(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},r=a=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,Cm("dragSelectMove",t,this))},o=a=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,Cm("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",o),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(FD(t,this._startX,this._endX),ND(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const BD=["hidden","single","full"];var ei=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ei||{});const HD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],WD=["gauge","top_n","single_value"],VD=20,YD="rgba(255, 171, 171, 0.4)",jD="rgba(255, 196, 0, 0.2)",Pm=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const s=(e-n.y)/i;return n.x+s*(t.x-n.x)},$D=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const r=i.data;r!=null&&r.length&&t.filter(o=>o.highlightIntersections).forEach(o=>{const a=r.map(c=>({ts:c.x,aboveThreshold:c.y>=o.value}));let l=a[0].aboveThreshold?r[0].x:void 0;for(let c=1;c<a.length;c++)!a[c-1].aboveThreshold&&a[c].aboveThreshold?l=Pm(r[c-1],r[c],o.value):a[c-1].aboveThreshold&&!a[c].aboveThreshold&&l!==void 0&&(e.push({start:l,end:Pm(r[c-1],r[c],o.value),type:o.type}),l=void 0);l!==void 0&&e.push({start:l,end:a[a.length-1].ts,type:o.type})})}),e},UD=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:s})=>s===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class qD{constructor(t){E(this,"id","thresholdPlugin");E(this,"_thresholds");E(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var e,i;for(const s of Object.keys(t.threshold||{})){const r=(e=t.threshold)==null?void 0:e[s];r&&(this._thresholds={...this._thresholds,[s]:r.map(o=>({...o,hovered:!1}))})}if(this._thresholds)for(const s of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[s]||delete this._thresholds[s]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const s=t.canvas;this._syncThresholds(i);const r=o=>{var a;if(t){const l=o.clientY,c=t.scales.y,u=s.getBoundingClientRect(),h=c.getValueForPixel(l-u.top);if(h)for(const f of Object.keys(this._thresholds||{})){const m=(a=this._thresholds)==null?void 0:a[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<VD})}}};s.addEventListener("mousemove",r),this._mouseMoveHandler=r}afterDatasetsDraw(t,e){var s;const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const o=(s=this._thresholds)==null?void 0:s[r];if(o){o.forEach(c=>{const h=t.scales.y.getPixelForValue(c.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Wr(c.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";c.label?f=`${c.label}: ${c.value}`:c.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:c.value}):c.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:c.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:c.value}),c.hovered&&(i.save(),i.fillStyle=Wr(c.type),i.font=Lw,i.fillText(f,t.chartArea.left,h-4),i.restore())});const a=$D(t,o);UD(a).forEach(c=>{const u=t.scales.x.getPixelForValue(c.start),h=t.scales.x.getPixelForValue(c.end);i.save(),i.fillStyle=c.type==="error"?YD:jD,i.fillRect(u,t.chartArea.top,h-u,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(u,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Wr(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const XD=ke(d.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=bt.useI18n(),r=new Tm,o=new ym,a=new zD,l=new qD(s),{translateUnit:c}=bt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),_=d.inject("legendPosition",Nt.Right),x=d.useTemplateRef("chartParent"),M=d.ref(void 0),v=d.ref(!1),T=d.inject(bf),k=T==null?void 0:T.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),C=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:f,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:I,tooltipAbsoluteTop:P}=bt.useTooltipAbsolutePosition(x,C),y={id:h,afterUpdate($){m.value=ch($,e.legendValues,e.chartLegendSortFn)}},b=d.computed(()=>[y,o,...e.brush?[a]:[],...e.type==="timeseries_line"?[r]:[],...e.threshold?[l]:[]]),S=d.computed(()=>`line-${b.value.map($=>$.id).join("-")}`),O=d.computed(()=>`bar-${b.value.map($=>$.id).join("-")}`),R=d.computed(()=>e.chartData&&Tw(e.chartData)),A=d.computed(()=>k?!1:v.value),{options:z}=bt.useLineChartOptions({tooltipState:C,timeRangeMs:d.toRef(e,"timeRangeMs"),granularity:d.toRef(e,"granularity"),legendID:h,stacked:d.toRef(e,"stacked"),metricAxesTitle:d.toRef(e,"metricAxesTitle"),dimensionAxesTitle:d.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:R,threshold:d.toRef(e,"threshold")});bt.useReportChartDataForSynthetics(d.toRef(e,"chartData"),d.toRef(e,"syntheticsDataKey"));const U=$=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[$],X=({width:$,height:Z})=>{C.width=$,C.height=Z},W=($=!0)=>{C.interactionMode="idle",C.showTooltip=!1,a.clearSelectionArea(),o.isPaused&&o.resume($),r.isPaused&&r.resume()},ct=()=>{C.interactionMode="interactive"},q=()=>{var $,Z;!u.value||!((Z=($=u.value.chart.tooltip)==null?void 0:$.dataPoints)!=null&&Z.length)||(C.interactionMode==="interactive"?r.clickedSegment=u.value.chart.tooltip.dataPoints[0]:r.destroyClickedSegment())},tt=()=>{if(v.value){v.value=!1;return}C.interactionMode!=="idle"?W():ct(),q()};d.watch(()=>e.type,()=>{C.interactionMode="idle",C.showTooltip=!1,r.destroyClickedSegment()});const et=$=>{$.preventDefault(),$.stopPropagation();const{xStart:Z,xEnd:_t}=$.detail;Z&&_t&&(M.value={start:new Date(Z),end:new Date(_t),type:"absolute"},k?C.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(Z),end:new Date(_t),type:"absolute"}),W()),i("select-chart-range",M.value))},G=$=>{k&&(C.interactionMode="selecting-chart-area"),v.value=!0,r.pause(),o.pause();const{xStart:Z,xEnd:_t}=$.detail;Z&&_t&&(M.value={start:new Date(Z),end:new Date(_t),type:"absolute"})},j=$=>{if(!x.value||C.interactionMode==="idle")return;const Z=$.target;Z&&x.value.contains(Z)||v.value||W(!1)};return d.watch(()=>{var $;return($=u.value)==null?void 0:$.chart},()=>{var $;($=u.value)!=null&&$.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",et),u.value.chart.canvas.removeEventListener("dragSelectMove",G),u.value.chart.canvas.addEventListener("dragSelect",et),u.value.chart.canvas.addEventListener("dragSelectMove",G))}),d.onMounted(()=>{document.addEventListener("click",j,!0)}),d.onUnmounted(()=>{var $;($=u.value)!=null&&$.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",et),u.value.chart.canvas.removeEventListener("dragSelectMove",G)),document.removeEventListener("click",j,!0)}),($,Z)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",U(d.unref(_))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:Z[0]||(Z[0]=_t=>tt())},[$.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(km),{key:S.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:$.chartData,"data-testid":"time-series-line-chart",options:d.unref(z),plugins:b.value},null,8,["chart-id","data","options","plugins"])):$.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Mm),{key:O.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:$.chartData,"data-testid":"time-series-bar-chart",options:d.unref(z),plugins:b.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),A.value?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(lo,{key:0,ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(I),"absolute-top":d.unref(P),"data-testid":"tooltip",granularity:$.granularity,state:C,"tooltip-title":$.tooltipTitle,"zoom-action-items":$.zoomActionItems,"zoom-time-range":M.value,onDimensions:X,onOnAction:Z[1]||(Z[1]=()=>W(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"])),d.createVNode(Pl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3a82636b"]]),GD={class:"analytics-chart-shell"},KD={key:0,class:"chart-header"},ZD={class:"tooltip-content"},QD={key:2,class:"analytics-chart-parent"},JD=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=bt.useI18n(),r=d.computed(()=>_.value?bt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Vr},d.toRef(i,"chartData")).value:bt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Vr},d.toRef(i,"chartData")).value),o=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),a=d.computed(()=>{var A;return(A=i.chartData)!=null&&A.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),l=d.computed(()=>{var A;return(A=i.chartData.meta)!=null&&A.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),c=d.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:u}=bt.useChartLegendValues(r,i.chartOptions.type,l),h=d.computed(()=>{var A,z,U;return((U=(z=(A=i.chartData)==null?void 0:A.meta)==null?void 0:z.limit)==null?void 0:U.toString())||null}),f=d.computed(()=>{var A,z;return((z=(A=i.chartData)==null?void 0:A.meta)==null?void 0:z.truncated)||!1}),m=s.t("limitedResultsShown",{maxReturned:h.value}),g=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),_=d.computed(()=>["timeseries_bar","timeseries_line"].some(A=>A===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),M=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),v=d.computed(()=>{var U,X;if(!((U=i.chartData)!=null&&U.meta.metric_names)||!((X=i.chartData)!=null&&X.meta.metric_units))return;const A=i.chartData.meta.metric_names[0],z=i.chartData.meta.metric_units[A];if(i.chartData.meta.metric_names.length>1){if(A.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${z}`,{plural:"s"})});if(A.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${z}`,{plural:"s"})})}if(A)return s.te(`chartLabels.${A}`)?s.t(`chartLabels.${A}`):A}),T=d.computed(()=>{var U,X,W,ct;if((U=i.chartOptions)!=null&&U.metricAxesTitle)return(X=i.chartOptions)==null?void 0:X.metricAxesTitle;if(!((W=i.chartData)!=null&&W.meta.metric_names)||!((ct=i.chartData)!=null&&ct.meta.metric_units))return;const A=i.chartData.meta.metric_names[0],z=i.chartData.meta.metric_units[A];if(i.chartData.meta.metric_names.length>1){if(A.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${z}`,{plural:"s"})});if(A.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${z}`,{plural:"s"})})}return s.te(`metricAxisTitles.${A}`)&&s.te(`chartUnits.${z}`)?s.t(`metricAxisTitles.${A}`,{unit:s.t(`chartUnits.${z}`,{plural:"s"})})||void 0:A||void 0}),k=d.computed(()=>{var z;if((z=i.chartOptions)!=null&&z.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const A=_.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(A)return s.te(`chartLabels.${A}`)?s.t(`chartLabels.${A}`):A}),C=d.computed(()=>{const A=dl(Number(i.chartData.meta.granularity_ms));if(A)return s.te(`granularityAxisTitles.${A}`)?s.t(`granularityAxisTitles.${A}`):A}),I=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),P=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),y=d.computed(()=>_.value?Cw(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),b=d.computed(()=>i.chartData.meta.granularity_ms?dl(i.chartData.meta.granularity_ms)||"hourly":dl(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),S=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(A,z)=>A.text===s.t("chartLabels.____OTHER____")?1:z.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(A.text,10))&&!isNaN(parseInt(z.text,10))?A.text<z.text?-1:1:A.value&&z.value?z.value.raw-A.value.raw:0),O=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(A,z)=>A.label===s.t("chartLabels.____OTHER____")?1:z.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(A.label,10))&&!isNaN(parseInt(z.label,10))?A.label<z.label?-1:1:A.value&&z.value?z.rawValue-A.rawValue:0),R=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:A=>e("zoom-time-range",A)}]:[],...i.exploreLink?[{label:s.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",c),d.provide("legendPosition",d.toRef(i,"legendPosition")),(A,z)=>{const U=d.resolveComponent("KTooltip"),X=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",GD,[y.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",KD,[d.createVNode(U,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",ZD,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Ks.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(Aw)})`,size:d.unref(Iw)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),y.value?(d.openBlock(),d.createElementBlock("div",QD,[_.value?(d.openBlock(),d.createBlock(XD,{key:0,brush:o.value,"chart-data":r.value,"chart-legend-sort-fn":S.value,"chart-tooltip-sort-fn":O.value,"dimension-axes-title":C.value,fill:A.chartOptions.stacked,granularity:b.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,stacked:A.chartOptions.stacked,"synthetics-data-key":A.syntheticsDataKey,threshold:A.chartOptions.threshold,"time-range-ms":a.value,"tooltip-metric-display":v.value,"tooltip-title":A.tooltipTitle,type:A.chartOptions.type,"zoom-action-items":R.value,onSelectChartRange:z[0]||(z[0]=W=>e("select-chart-range",W)),onZoomTimeRange:z[1]||(z[1]=W=>e("zoom-time-range",W))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):g.value?(d.openBlock(),d.createBlock(kD,{key:1,annotations:A.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":S.value,"chart-tooltip-sort-fn":O.value,"data-testid":"bar-chart-container","dimension-axes-title":k.value,"legend-values":d.unref(u),"metric-axes-title":T.value,"metric-unit":l.value,orientation:M.value,stacked:A.chartOptions.stacked,"synthetics-data-key":A.syntheticsDataKey,"tooltip-metric-display":v.value,"tooltip-title":A.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(LD,{key:2,"chart-data":r.value,"dataset-colors":A.chartOptions.chartDatasetColors||d.unref(Vr),"legend-position":A.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"synthetics-data-key":A.syntheticsDataKey,"tooltip-dimension-display":k.value,"tooltip-metric-display":v.value,"tooltip-title":A.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(X,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(I.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(P.value),1)]),_:1}))])}}}),tT=ke(JD,[["__scopeId","data-v-01aae525"]]),eT={class:"chart-parent","data-testid":"gauge-chart-parent"},nT={class:"chart-totals-flex"},iT={key:1,class:"metric-small","data-testid":"gauge-chart-total"},sT=ke(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:sn},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.ref(co()),s=d.computed(()=>[t.chartData.datasets.reduce((g,_)=>(g.labels.push(_.label),g.borderColor.push(_.backgroundColor),g.backgroundColor.push(_.backgroundColor),g.data.push(_.data.reduce((x,M)=>x+M,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=d.computed(()=>({...t.chartData,datasets:s.value}));bt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=d.ref(),l=d.computed(()=>{var m;return ks((m=s==null?void 0:s.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),c=d.computed(()=>{var m,g;return ks(((m=s==null?void 0:s.value[0])==null?void 0:m.data[0])+((g=s==null?void 0:s.value[0])==null?void 0:g.data[1]),{capital:!0})}),u=d.computed(()=>{var m;return`color: ${(m=s==null?void 0:s.value[0])==null?void 0:m.backgroundColor[t.numerator]}`}),h=d.computed(()=>["full","single"].includes(t.metricDisplay)),f=d.computed(()=>t.metricDisplay==="full");return(m,g)=>(d.openBlock(),d.createElementBlock("div",eT,[d.createElementVNode("div",nT,[h.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(u.value)},d.toDisplayString(l.value),5)):d.createCommentVNode("",!0),f.value?(d.openBlock(),d.createElementBlock("div",iT,d.toDisplayString(d.unref(e).t("total"))+": "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:n.height,width:n.width})},[d.createVNode(d.unref(Sm),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]),rT={class:"chart-parent","data-testid":"single-value-parent"},oT={key:1,class:"single-value-wrapper"},aT={class:"single-value","data-testid":"single-value-chart"},lT={key:0,class:"single-value-unit"},cT=ke(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:_f}},setup(n){const{i18n:{t}}=bt.useI18n(),e=n,i=d.computed(()=>e.data.data[0]),s=d.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=d.computed(()=>{var u,h;const c=s.value?(h=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:h[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=d.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=d.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=d.computed(()=>{var h;const c=a.value;if(c===null)return"";if((h=s.value)!=null&&h.includes("_size_"))return jr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:_f;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return d.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",rT,[a.value===null?(d.openBlock(),d.createBlock(h,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t)("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",oT,[d.createElementVNode("span",aT,d.toDisplayString(l.value),1),o.value?(d.openBlock(),d.createElementBlock("span",lT," "+d.toDisplayString(r.value),1)):d.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),uT={class:"simple-chart-shell"},dT={key:1,class:"analytics-chart-parent"},hT=ke(d.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.computed(()=>{var u;const c=bt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||sn},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=d.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=d.computed(()=>t.chartOptions.type==="gauge"),o=d.computed(()=>t.chartOptions.type==="single_value"),a=d.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=d.computed(()=>{var u,h;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(h=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:h[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",uT,[l.value?(d.openBlock(),d.createElementBlock("div",dT,[r.value?(d.openBlock(),d.createBlock(sT,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),o.value?(d.openBlock(),d.createBlock(cT,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),fT={class:"top-n-card-title","data-testid":"top-n-card-title"},mT={class:"top-n-card-description","data-testid":"top-n-card-description"},gT={key:3,class:"top-n-table","data-testid":"top-n-table"},pT={class:"table-headings"},yT={class:"table-row"},bT={class:"column-1"},_T={class:"column-2"},xT={class:"table-body","data-testid":"top-n-data"},wT=["data-testid"],vT={class:"column-1"},MT={class:"column-2"},ST=ke(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=d.computed(()=>t.data.data),s=d.computed(()=>{var g;return!!((g=i.value)!=null&&g.length)}),r=d.computed(()=>{var g,_;return(g=t.data.meta)!=null&&g.display&&((_=Object.keys(t.data.meta.display))==null?void 0:_[0])||""}),o=d.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=d.computed(()=>{var g,_;return(_=(g=t.data.meta)==null?void 0:g.metric_names)!=null&&_.length?t.data.meta.metric_names[0]:""}),l=d.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=d.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=g=>{const _=g.event;return String(_[r.value])},h=g=>{const _=u(g),x=o.value&&o.value[_];return x?x.name:"-"},f=g=>{const _=u(g),x=o.value&&o.value[_];return x?!!x.deleted:!1},m=g=>{if(!a.value)return"–";const x=g.event[a.value];return x?ks(x,{capital:!0,round:!0}):"–"};return(g,_)=>{const x=d.resolveComponent("KEmptyState"),M=d.resolveComponent("KSkeleton"),v=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(v,{class:"kong-ui-public-top-n-table","title-tag":g.titleTag},d.createSlots({default:d.withCtx(()=>[c.value?(d.openBlock(),d.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(c.value),1)]),_:1})):g.isLoading?(d.openBlock(),d.createBlock(M,{key:1,"table-columns":2,type:"table"})):s.value?(d.openBlock(),d.createElementBlock("div",gT,[d.createElementVNode("div",pT,[d.createElementVNode("div",yT,[d.createElementVNode("div",bT,d.toDisplayString(d.unref(e).t("topNTable.nameLabel")),1),d.createElementVNode("div",_T,d.toDisplayString(l.value),1)])]),d.createElementVNode("div",xT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(T,k)=>(d.openBlock(),d.createElementBlock("div",{key:`entry-${k}`,class:"table-row","data-testid":`row-${u(T)}`},[d.createElementVNode("div",vT,[d.renderSlot(g.$slots,"name",{record:{id:u(T),name:h(T),deleted:f(T),dimension:r.value}},()=>[d.createTextVNode(d.toDisplayString(h(T)),1)],!0)]),d.createElementVNode("div",MT," "+d.toDisplayString(m(T)),1)],8,wT))),128))])])):(d.openBlock(),d.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(g.emptyStateTitle||d.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[g.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",fT,d.toDisplayString(g.title),1)]),key:"0"}:void 0,g.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",mT,d.toDisplayString(g.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var uo={exports:{}};uo.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",_="[object Map]",x="[object Number]",M="[object Object]",v="[object Promise]",T="[object RegExp]",k="[object Set]",C="[object String]",I="[object Symbol]",P="[object WeakMap]",y="[object ArrayBuffer]",b="[object DataView]",S="[object Float32Array]",O="[object Float64Array]",R="[object Int8Array]",A="[object Int16Array]",z="[object Int32Array]",U="[object Uint8Array]",X="[object Uint8ClampedArray]",W="[object Uint16Array]",ct="[object Uint32Array]",q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/^\./,G=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,Z=/^\[object .+?Constructor\]$/,_t=/^(?:0|[1-9]\d*)$/,gt={};gt[S]=gt[O]=gt[R]=gt[A]=gt[z]=gt[U]=gt[X]=gt[W]=gt[ct]=!0,gt[l]=gt[c]=gt[y]=gt[u]=gt[b]=gt[h]=gt[f]=gt[m]=gt[_]=gt[x]=gt[M]=gt[T]=gt[k]=gt[C]=gt[P]=!1;var pt=typeof be=="object"&&be&&be.Object===Object&&be,B=typeof self=="object"&&self&&self.Object===Object&&self,Y=pt||B||Function("return this")(),V=t&&!t.nodeType&&t,J=V&&!0&&n&&!n.nodeType&&n,nt=J&&J.exports===V,it=nt&&pt.process,rt=function(){try{return it&&it.binding("util")}catch{}}(),st=rt&&rt.isTypedArray;function wt(p,D){for(var N=-1,H=p?p.length:0;++N<H;)if(D(p[N],N,p))return!0;return!1}function ut(p){return function(D){return D==null?void 0:D[p]}}function Pt(p,D){for(var N=-1,H=Array(p);++N<p;)H[N]=D(N);return H}function te(p){return function(D){return p(D)}}function ae(p,D){return p==null?void 0:p[D]}function qt(p){var D=!1;if(p!=null&&typeof p.toString!="function")try{D=!!(p+"")}catch{}return D}function Ee(p){var D=-1,N=Array(p.size);return p.forEach(function(H,ft){N[++D]=[ft,H]}),N}function Mt(p,D){return function(N){return p(D(N))}}function Xt(p){var D=-1,N=Array(p.size);return p.forEach(function(H){N[++D]=H}),N}var Bt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,qe=Y["__core-js_shared__"],ni=function(){var p=/[^.]+$/.exec(qe&&qe.keys&&qe.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),Fe=Gt.toString,Ht=ie.hasOwnProperty,_e=ie.toString,ii=RegExp("^"+Fe.call(Ht).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ho=Y.Symbol,fo=Y.Uint8Array,Bs=ie.propertyIsEnumerable,si=Bt.splice,Hs=Mt(Object.keys,Object),ri=dn(Y,"DataView"),an=dn(Y,"Map"),ln=dn(Y,"Promise"),Ws=dn(Y,"Set"),Vs=dn(Y,"WeakMap"),oi=dn(Object,"create"),Il=fn(ri),Ll=fn(an),mo=fn(ln),go=fn(Ws),cn=fn(Vs),Ai=ho?ho.prototype:void 0,Ys=Ai?Ai.valueOf:void 0,po=Ai?Ai.toString:void 0;function un(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Nl(){this.__data__=oi?oi(null):{}}function ze(p){return this.has(p)&&delete this.__data__[p]}function Fl(p){var D=this.__data__;if(oi){var N=D[p];return N===s?void 0:N}return Ht.call(D,p)?D[p]:void 0}function zl(p){var D=this.__data__;return oi?D[p]!==void 0:Ht.call(D,p)}function Bl(p,D){var N=this.__data__;return N[p]=oi&&D===void 0?s:D,this}un.prototype.clear=Nl,un.prototype.delete=ze,un.prototype.get=Fl,un.prototype.has=zl,un.prototype.set=Bl;function Be(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function Hl(){this.__data__=[]}function An(p){var D=this.__data__,N=Li(D,p);if(N<0)return!1;var H=D.length-1;return N==H?D.pop():si.call(D,N,1),!0}function Wl(p){var D=this.__data__,N=Li(D,p);return N<0?void 0:D[N][1]}function Vl(p){return Li(this.__data__,p)>-1}function Yl(p,D){var N=this.__data__,H=Li(N,p);return H<0?N.push([p,D]):N[H][1]=D,this}Be.prototype.clear=Hl,Be.prototype.delete=An,Be.prototype.get=Wl,Be.prototype.has=Vl,Be.prototype.set=Yl;function He(p){var D=-1,N=p?p.length:0;for(this.clear();++D<N;){var H=p[D];this.set(H[0],H[1])}}function jl(){this.__data__={hash:new un,map:new(an||Be),string:new un}}function Rn(p){return zi(this,p).delete(p)}function $l(p){return zi(this,p).get(p)}function Ul(p){return zi(this,p).has(p)}function ql(p,D){return zi(this,p).set(p,D),this}He.prototype.clear=jl,He.prototype.delete=Rn,He.prototype.get=$l,He.prototype.has=Ul,He.prototype.set=ql;function Ri(p){var D=-1,N=p?p.length:0;for(this.__data__=new He;++D<N;)this.add(p[D])}function Xl(p){return this.__data__.set(p,s),this}function Gl(p){return this.__data__.has(p)}Ri.prototype.add=Ri.prototype.push=Xl,Ri.prototype.has=Gl;function Ae(p){this.__data__=new Be(p)}function Ii(){this.__data__=new Be}function Kl(p){return this.__data__.delete(p)}function js(p){return this.__data__.get(p)}function Zl(p){return this.__data__.has(p)}function Ql(p,D){var N=this.__data__;if(N instanceof Be){var H=N.__data__;if(!an||H.length<e-1)return H.push([p,D]),this;N=this.__data__=new He(H)}return N.set(p,D),this}Ae.prototype.clear=Ii,Ae.prototype.delete=Kl,Ae.prototype.get=js,Ae.prototype.has=Zl,Ae.prototype.set=Ql;function Jl(p,D){var N=w(p)||Mo(p)?Pt(p.length,String):[],H=N.length,ft=!!H;for(var Q in p)Ht.call(p,Q)&&!(ft&&(Q=="length"||Us(Q,H)))&&N.push(Q);return N}function Li(p,D){for(var N=p.length;N--;)if(vo(p[N][0],D))return N;return-1}var tc=uc();function ec(p,D){return p&&tc(p,D,li)}function Ni(p,D){D=Bi(D,p)?[D]:Xe(D);for(var N=0,H=D.length;p!=null&&N<H;)p=p[hn(D[N++])];return N&&N==H?p:void 0}function nc(p){return _e.call(p)}function ic(p,D){return p!=null&&D in Object(p)}function $s(p,D,N,H,ft){return p===D?!0:p==null||D==null||!Kt(p)&&!xe(D)?p!==p&&D!==D:sc(p,D,$s,N,H,ft)}function sc(p,D,N,H,ft,Q){var xt=w(p),Zt=w(D),Wt=c,ce=c;xt||(Wt=le(p),Wt=Wt==l?M:Wt),Zt||(ce=le(D),ce=ce==l?M:ce);var we=Wt==M&&!qt(p),ve=ce==M&&!qt(D),fe=Wt==ce;if(fe&&!we)return Q||(Q=new Ae),xt||So(p)?_o(p,D,N,H,ft,Q):dc(p,D,Wt,N,H,ft,Q);if(!(ft&o)){var Re=we&&Ht.call(p,"__wrapped__"),Ie=ve&&Ht.call(D,"__wrapped__");if(Re||Ie){var Nn=Re?p.value():p,mn=Ie?D.value():D;return Q||(Q=new Ae),N(Nn,mn,H,ft,Q)}}return fe?(Q||(Q=new Ae),hc(p,D,N,H,ft,Q)):!1}function rc(p,D,N,H){var ft=N.length,Q=ft;if(p==null)return!Q;for(p=Object(p);ft--;){var xt=N[ft];if(xt[2]?xt[1]!==p[xt[0]]:!(xt[0]in p))return!1}for(;++ft<Q;){xt=N[ft];var Zt=xt[0],Wt=p[Zt],ce=xt[1];if(xt[2]){if(Wt===void 0&&!(Zt in p))return!1}else{var we=new Ae,ve;if(!(ve===void 0?$s(ce,Wt,H,r|o,we):ve))return!1}}return!0}function oc(p){if(!Kt(p)||xo(p))return!1;var D=K(p)||qt(p)?ii:Z;return D.test(fn(p))}function ac(p){return xe(p)&&jt(p.length)&&!!gt[_e.call(p)]}function yo(p){return typeof p=="function"?p:p==null?Hi:typeof p=="object"?w(p)?Fi(p[0],p[1]):cc(p):pC(p)}function lc(p){if(!gc(p))return Hs(p);var D=[];for(var N in Object(p))Ht.call(p,N)&&N!="constructor"&&D.push(N);return D}function cc(p){var D=fc(p);return D.length==1&&D[0][2]?Xs(D[0][0],D[0][1]):function(N){return N===p||rc(N,p,D)}}function Fi(p,D){return Bi(p)&&wo(D)?Xs(hn(p),D):function(N){var H=ko(N,p);return H===void 0&&H===D?Do(N,p):$s(D,H,void 0,r|o)}}function In(p){return function(D){return Ni(D,p)}}function bo(p){if(typeof p=="string")return p;if(ee(p))return po?po.call(p):"";var D=p+"";return D=="0"&&1/p==-1/0?"-0":D}function Xe(p){return w(p)?p:pc(p)}function uc(p){return function(D,N,H){for(var ft=-1,Q=Object(D),xt=H(D),Zt=xt.length;Zt--;){var Wt=xt[++ft];if(N(Q[Wt],Wt,Q)===!1)break}return D}}function _o(p,D,N,H,ft,Q){var xt=ft&o,Zt=p.length,Wt=D.length;if(Zt!=Wt&&!(xt&&Wt>Zt))return!1;var ce=Q.get(p);if(ce&&Q.get(D))return ce==D;var we=-1,ve=!0,fe=ft&r?new Ri:void 0;for(Q.set(p,D),Q.set(D,p);++we<Zt;){var Re=p[we],Ie=D[we];if(H)var Nn=xt?H(Ie,Re,we,D,p,Q):H(Re,Ie,we,p,D,Q);if(Nn!==void 0){if(Nn)continue;ve=!1;break}if(fe){if(!wt(D,function(mn,ci){if(!fe.has(ci)&&(Re===mn||N(Re,mn,H,ft,Q)))return fe.add(ci)})){ve=!1;break}}else if(!(Re===Ie||N(Re,Ie,H,ft,Q))){ve=!1;break}}return Q.delete(p),Q.delete(D),ve}function dc(p,D,N,H,ft,Q,xt){switch(N){case b:if(p.byteLength!=D.byteLength||p.byteOffset!=D.byteOffset)return!1;p=p.buffer,D=D.buffer;case y:return!(p.byteLength!=D.byteLength||!H(new fo(p),new fo(D)));case u:case h:case x:return vo(+p,+D);case f:return p.name==D.name&&p.message==D.message;case T:case C:return p==D+"";case _:var Zt=Ee;case k:var Wt=Q&o;if(Zt||(Zt=Xt),p.size!=D.size&&!Wt)return!1;var ce=xt.get(p);if(ce)return ce==D;Q|=r,xt.set(p,D);var we=_o(Zt(p),Zt(D),H,ft,Q,xt);return xt.delete(p),we;case I:if(Ys)return Ys.call(p)==Ys.call(D)}return!1}function hc(p,D,N,H,ft,Q){var xt=ft&o,Zt=li(p),Wt=Zt.length,ce=li(D),we=ce.length;if(Wt!=we&&!xt)return!1;for(var ve=Wt;ve--;){var fe=Zt[ve];if(!(xt?fe in D:Ht.call(D,fe)))return!1}var Re=Q.get(p);if(Re&&Q.get(D))return Re==D;var Ie=!0;Q.set(p,D),Q.set(D,p);for(var Nn=xt;++ve<Wt;){fe=Zt[ve];var mn=p[fe],ci=D[fe];if(H)var zm=xt?H(ci,mn,fe,D,p,Q):H(mn,ci,fe,p,D,Q);if(!(zm===void 0?mn===ci||N(mn,ci,H,ft,Q):zm)){Ie=!1;break}Nn||(Nn=fe=="constructor")}if(Ie&&!Nn){var To=p.constructor,Co=D.constructor;To!=Co&&"constructor"in p&&"constructor"in D&&!(typeof To=="function"&&To instanceof To&&typeof Co=="function"&&Co instanceof Co)&&(Ie=!1)}return Q.delete(p),Q.delete(D),Ie}function zi(p,D){var N=p.__data__;return qs(D)?N[typeof D=="string"?"string":"hash"]:N.map}function fc(p){for(var D=li(p),N=D.length;N--;){var H=D[N],ft=p[H];D[N]=[H,ft,wo(ft)]}return D}function dn(p,D){var N=ae(p,D);return oc(N)?N:void 0}var le=nc;(ri&&le(new ri(new ArrayBuffer(1)))!=b||an&&le(new an)!=_||ln&&le(ln.resolve())!=v||Ws&&le(new Ws)!=k||Vs&&le(new Vs)!=P)&&(le=function(p){var D=_e.call(p),N=D==M?p.constructor:void 0,H=N?fn(N):void 0;if(H)switch(H){case Il:return b;case Ll:return _;case mo:return v;case go:return k;case cn:return P}return D});function mc(p,D,N){D=Bi(D,p)?[D]:Xe(D);for(var H,ft=-1,xt=D.length;++ft<xt;){var Q=hn(D[ft]);if(!(H=p!=null&&N(p,Q)))break;p=p[Q]}if(H)return H;var xt=p?p.length:0;return!!xt&&jt(xt)&&Us(Q,xt)&&(w(p)||Mo(p))}function Us(p,D){return D=D??a,!!D&&(typeof p=="number"||_t.test(p))&&p>-1&&p%1==0&&p<D}function Bi(p,D){if(w(p))return!1;var N=typeof p;return N=="number"||N=="symbol"||N=="boolean"||p==null||ee(p)?!0:tt.test(p)||!q.test(p)||D!=null&&p in Object(D)}function qs(p){var D=typeof p;return D=="string"||D=="number"||D=="symbol"||D=="boolean"?p!=="__proto__":p===null}function xo(p){return!!ni&&ni in p}function gc(p){var D=p&&p.constructor,N=typeof D=="function"&&D.prototype||ie;return p===N}function wo(p){return p===p&&!Kt(p)}function Xs(p,D){return function(N){return N==null?!1:N[p]===D&&(D!==void 0||p in Object(N))}}var pc=ai(function(p){p=Ln(p);var D=[];return et.test(p)&&D.push(""),p.replace(G,function(N,H,ft,Q){D.push(ft?Q.replace($,"$1"):H||N)}),D});function hn(p){if(typeof p=="string"||ee(p))return p;var D=p+"";return D=="0"&&1/p==-1/0?"-0":D}function fn(p){if(p!=null){try{return Fe.call(p)}catch{}try{return p+""}catch{}}return""}function ai(p,D){if(typeof p!="function"||D&&typeof D!="function")throw new TypeError(i);var N=function(){var H=arguments,ft=D?D.apply(this,H):H[0],Q=N.cache;if(Q.has(ft))return Q.get(ft);var xt=p.apply(this,H);return N.cache=Q.set(ft,xt),xt};return N.cache=new(ai.Cache||He),N}ai.Cache=He;function vo(p,D){return p===D||p!==p&&D!==D}function Mo(p){return F(p)&&Ht.call(p,"callee")&&(!Bs.call(p,"callee")||_e.call(p)==l)}var w=Array.isArray;function L(p){return p!=null&&jt(p.length)&&!K(p)}function F(p){return xe(p)&&L(p)}function K(p){var D=Kt(p)?_e.call(p):"";return D==m||D==g}function jt(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=a}function Kt(p){var D=typeof p;return!!p&&(D=="object"||D=="function")}function xe(p){return!!p&&typeof p=="object"}function ee(p){return typeof p=="symbol"||xe(p)&&_e.call(p)==I}var So=st?te(st):ac;function Ln(p){return p==null?"":bo(p)}function ko(p,D,N){var H=p==null?void 0:Ni(p,D);return H===void 0?N:H}function Do(p,D){return p!=null&&mc(p,D,ic)}function li(p){return L(p)?Jl(p):lc(p)}function Gs(p,D){var N={};return D=yo(D),ec(p,function(H,ft,Q){N[D(H,ft,Q)]=H}),N}function Hi(p){return p}function pC(p){return Bi(p)?ut(hn(p)):In(p)}n.exports=Gs}(uo,uo.exports);var kT=uo.exports;const DT=el(kT);var TT=9007199254740991,CT="[object Arguments]",PT="[object Function]",OT="[object GeneratorFunction]",ET="[object Symbol]",AT=typeof be=="object"&&be&&be.Object===Object&&be,RT=typeof self=="object"&&self&&self.Object===Object&&self,IT=AT||RT||Function("return this")();function LT(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function NT(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function FT(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var Al=Object.prototype,zT=Al.hasOwnProperty,Rl=Al.toString,Om=IT.Symbol,BT=Al.propertyIsEnumerable,Em=Om?Om.isConcatSpreadable:void 0,Am=Math.max;function HT(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=jT),s||(s=[]);++r<o;){var a=n[r];e(a)?FT(s,a):s[s.length]=a}return s}function WT(n,t){return n=Object(n),VT(n,t,function(e,i){return i in n})}function VT(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function YT(n,t){return t=Am(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Am(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,LT(n,this,o)}}function jT(n){return qT(n)||UT(n)||!!(Em&&n&&n[Em])}function $T(n){if(typeof n=="string"||JT(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function UT(n){return GT(n)&&zT.call(n,"callee")&&(!BT.call(n,"callee")||Rl.call(n)==CT)}var qT=Array.isArray;function XT(n){return n!=null&&ZT(n.length)&&!KT(n)}function GT(n){return Rm(n)&&XT(n)}function KT(n){var t=QT(n)?Rl.call(n):"";return t==PT||t==OT}function ZT(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=TT}function QT(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Rm(n){return!!n&&typeof n=="object"}function JT(n){return typeof n=="symbol"||Rm(n)&&Rl.call(n)==ET}var tC=YT(function(n,t){return n==null?{}:WT(n,NT(HT(t),$T))}),eC=tC;const nC=el(eC);var Im={exports:{}};(function(n,t){(function(e,i){i()})(be,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,h)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof be=="object"&&be.global===be?be:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,h){var f=o.URL||o.webkitURL,m=document.createElement("a");u=u||c.name||"download",m.download=u,m.rel="noopener",typeof c=="string"?(m.href=c,m.origin===location.origin?r(m):s(m.href)?i(c,u,h):r(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){r(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,h),u);else if(s(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,h);var m=c.type==="application/octet-stream",g=/constructor/i.test(o.HTMLElement)||o.safari,_=/CriOS\/[\d]+/.test(navigator.userAgent);if((_||m&&g||a)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var T=x.result;T=_?T:T.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=T:location=T,f=null},x.readAsDataURL(c)}else{var M=o.URL||o.webkitURL,v=M.createObjectURL(c);f?f.location=v:location.href=v,f=null,setTimeout(function(){M.revokeObjectURL(v)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(Im);var iC=Im.exports,Lm={exports:{}};/* @license
|
|
29
29
|
Papa Parse
|
|
30
30
|
v5.5.3
|
|
31
31
|
https://github.com/mholt/PapaParse
|
|
32
32
|
License: MIT
|
|
33
|
-
*/(function(n,t){((e,i)=>{n.exports=i()})(be,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,r=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(y){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(
|
|
34
|
-
`),
|
|
33
|
+
*/(function(n,t){((e,i)=>{n.exports=i()})(be,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,r=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(y){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(b){var S=C(b);S.chunkSize=parseInt(S.chunkSize),b.step||b.chunk||(S.chunkSize=null),this._handle=new _(S),(this._handle.streamer=this)._config=S}).call(this,y),this.parseChunk=function(b,S){var O=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<O){let A=this._config.newline;A||(R=this._config.quoteChar||'"',A=this._handle.guessLineEndings(b,R)),b=[...b.split(A).slice(O)].join(A)}this.isFirstChunk&&P(this._config.beforeFirstChunk)&&(R=this._config.beforeFirstChunk(b))!==void 0&&(b=R),this.isFirstChunk=!1,this._halted=!1;var O=this._partialLine+b,R=(this._partialLine="",this._handle.parse(O,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(b=R.meta.cursor,O=(this._finished||(this._partialLine=O.substring(b-this._baseIndex),this._baseIndex=b),R&&R.data&&(this._rowCount+=R.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)i.postMessage({results:R,workerId:c.WORKER_ID,finished:O});else if(P(this._config.chunk)&&!S){if(this._config.chunk(R,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=R=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(R.data),this._completeResults.errors=this._completeResults.errors.concat(R.errors),this._completeResults.meta=R.meta),this._completed||!O||!P(this._config.complete)||R&&R.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),O||R&&R.meta.paused||this._nextChunk(),R}this._halted=!0},this._sendError=function(b){P(this._config.error)?this._config.error(b):o&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:b,finished:!1})}}function h(y){var b;(y=y||{}).chunkSize||(y.chunkSize=c.RemoteChunkSize),u.call(this,y),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(S){this._input=S,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(b=new XMLHttpRequest,this._config.withCredentials&&(b.withCredentials=this._config.withCredentials),r||(b.onload=I(this._chunkLoaded,this),b.onerror=I(this._chunkError,this)),b.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var S,O=this._config.downloadRequestHeaders;for(S in O)b.setRequestHeader(S,O[S])}var R;this._config.chunkSize&&(R=this._start+this._config.chunkSize-1,b.setRequestHeader("Range","bytes="+this._start+"-"+R));try{b.send(this._config.downloadRequestBody)}catch(A){this._chunkError(A.message)}r&&b.status===0&&this._chunkError()}},this._chunkLoaded=function(){b.readyState===4&&(b.status<200||400<=b.status?this._chunkError():(this._start+=this._config.chunkSize||b.responseText.length,this._finished=!this._config.chunkSize||this._start>=(S=>(S=S.getResponseHeader("Content-Range"))!==null?parseInt(S.substring(S.lastIndexOf("/")+1)):-1)(b),this.parseChunk(b.responseText)))},this._chunkError=function(S){S=b.statusText||S,this._sendError(new Error(S))}}function f(y){(y=y||{}).chunkSize||(y.chunkSize=c.LocalChunkSize),u.call(this,y);var b,S,O=typeof FileReader<"u";this.stream=function(R){this._input=R,S=R.slice||R.webkitSlice||R.mozSlice,O?((b=new FileReader).onload=I(this._chunkLoaded,this),b.onerror=I(this._chunkError,this)):b=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var R=this._input,A=(this._config.chunkSize&&(A=Math.min(this._start+this._config.chunkSize,this._input.size),R=S.call(R,this._start,A)),b.readAsText(R,this._config.encoding));O||this._chunkLoaded({target:{result:A}})},this._chunkLoaded=function(R){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(R.target.result)},this._chunkError=function(){this._sendError(b.error)}}function m(y){var b;u.call(this,y=y||{}),this.stream=function(S){return b=S,this._nextChunk()},this._nextChunk=function(){var S,O;if(!this._finished)return S=this._config.chunkSize,b=S?(O=b.substring(0,S),b.substring(S)):(O=b,""),this._finished=!b,this.parseChunk(O)}}function g(y){u.call(this,y=y||{});var b=[],S=!0,O=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(R){this._input=R,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){O&&b.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),b.length?this.parseChunk(b.shift()):S=!0},this._streamData=I(function(R){try{b.push(typeof R=="string"?R:R.toString(this._config.encoding)),S&&(S=!1,this._checkIsFinished(),this.parseChunk(b.shift()))}catch(A){this._streamError(A)}},this),this._streamError=I(function(R){this._streamCleanUp(),this._sendError(R)},this),this._streamEnd=I(function(){this._streamCleanUp(),O=!0,this._streamData("")},this),this._streamCleanUp=I(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function _(y){var b,S,O,R,A=Math.pow(2,53),z=-A,U=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,X=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,W=this,ct=0,q=0,tt=!1,et=!1,G=[],j={data:[],errors:[],meta:{}};function $(pt){return y.skipEmptyLines==="greedy"?pt.join("").trim()==="":pt.length===1&&pt[0].length===0}function Z(){if(j&&O&&(gt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),O=!1),y.skipEmptyLines&&(j.data=j.data.filter(function(V){return!$(V)})),_t()){let V=function(J,nt){P(y.transformHeader)&&(J=y.transformHeader(J,nt)),G.push(J)};if(j)if(Array.isArray(j.data[0])){for(var pt=0;_t()&&pt<j.data.length;pt++)j.data[pt].forEach(V);j.data.splice(0,1)}else j.data.forEach(V)}function B(V,J){for(var nt=y.header?{}:[],it=0;it<V.length;it++){var rt=it,st=V[it],st=((wt,ut)=>(Pt=>(y.dynamicTypingFunction&&y.dynamicTyping[Pt]===void 0&&(y.dynamicTyping[Pt]=y.dynamicTypingFunction(Pt)),(y.dynamicTyping[Pt]||y.dynamicTyping)===!0))(wt)?ut==="true"||ut==="TRUE"||ut!=="false"&&ut!=="FALSE"&&((Pt=>{if(U.test(Pt)&&(Pt=parseFloat(Pt),z<Pt&&Pt<A))return 1})(ut)?parseFloat(ut):X.test(ut)?new Date(ut):ut===""?null:ut):ut)(rt=y.header?it>=G.length?"__parsed_extra":G[it]:rt,st=y.transform?y.transform(st,rt):st);rt==="__parsed_extra"?(nt[rt]=nt[rt]||[],nt[rt].push(st)):nt[rt]=st}return y.header&&(it>G.length?gt("FieldMismatch","TooManyFields","Too many fields: expected "+G.length+" fields but parsed "+it,q+J):it<G.length&>("FieldMismatch","TooFewFields","Too few fields: expected "+G.length+" fields but parsed "+it,q+J)),nt}var Y;j&&(y.header||y.dynamicTyping||y.transform)&&(Y=1,!j.data.length||Array.isArray(j.data[0])?(j.data=j.data.map(B),Y=j.data.length):j.data=B(j.data,0),y.header&&j.meta&&(j.meta.fields=G),q+=Y)}function _t(){return y.header&&G.length===0}function gt(pt,B,Y,V){pt={type:pt,code:B,message:Y},V!==void 0&&(pt.row=V),j.errors.push(pt)}P(y.step)&&(R=y.step,y.step=function(pt){j=pt,_t()?Z():(Z(),j.data.length!==0&&(ct+=pt.data.length,y.preview&&ct>y.preview?S.abort():(j.data=j.data[0],R(j,W))))}),this.parse=function(pt,B,Y){var V=y.quoteChar||'"',V=(y.newline||(y.newline=this.guessLineEndings(pt,V)),O=!1,y.delimiter?P(y.delimiter)&&(y.delimiter=y.delimiter(pt),j.meta.delimiter=y.delimiter):((V=((J,nt,it,rt,st)=>{var wt,ut,Pt,te;st=st||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var ae=0;ae<st.length;ae++){for(var qt,Ee=st[ae],Mt=0,Xt=0,Bt=0,Gt=(Pt=void 0,new M({comments:rt,delimiter:Ee,newline:nt,preview:10}).parse(J)),ie=0;ie<Gt.data.length;ie++)it&&$(Gt.data[ie])?Bt++:(qt=Gt.data[ie].length,Xt+=qt,Pt===void 0?Pt=qt:0<qt&&(Mt+=Math.abs(qt-Pt),Pt=qt));0<Gt.data.length&&(Xt/=Gt.data.length-Bt),(ut===void 0||Mt<=ut)&&(te===void 0||te<Xt)&&1.99<Xt&&(ut=Mt,wt=Ee,te=Xt)}return{successful:!!(y.delimiter=wt),bestDelimiter:wt}})(pt,y.newline,y.skipEmptyLines,y.comments,y.delimitersToGuess)).successful?y.delimiter=V.bestDelimiter:(O=!0,y.delimiter=c.DefaultDelimiter),j.meta.delimiter=y.delimiter),C(y));return y.preview&&y.header&&V.preview++,b=pt,S=new M(V),j=S.parse(b,B,Y),Z(),tt?{meta:{paused:!0}}:j||{meta:{paused:!1}}},this.paused=function(){return tt},this.pause=function(){tt=!0,S.abort(),b=P(y.chunk)?"":b.substring(S.getCharIndex())},this.resume=function(){W.streamer._halted?(tt=!1,W.streamer.parseChunk(b,!0)):setTimeout(W.resume,3)},this.aborted=function(){return et},this.abort=function(){et=!0,S.abort(),j.meta.aborted=!0,P(y.complete)&&y.complete(j),b=""},this.guessLineEndings=function(J,V){J=J.substring(0,1048576);var V=new RegExp(x(V)+"([^]*?)"+x(V),"gm"),Y=(J=J.replace(V,"")).split("\r"),V=J.split(`
|
|
34
|
+
`),J=1<V.length&&V[0].length<Y[0].length;if(Y.length===1||J)return`
|
|
35
35
|
`;for(var nt=0,it=0;it<Y.length;it++)Y[it][0]===`
|
|
36
36
|
`&&nt++;return nt>=Y.length/2?`\r
|
|
37
|
-
`:"\r"}}function x(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function
|
|
38
|
-
`&&
|
|
39
|
-
`&&(
|
|
40
|
-
`);var
|
|
41
|
-
`,
|
|
42
|
-
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!r&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=
|
|
43
|
-
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const h=new Blob([u],{type:"text/csv;charset="+i.encoding});ZT.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(n.filename),1)])],8,JT))}}),eC=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=d.computed(()=>Object.keys(t.headers));return(i,s)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(tC,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),nC={class:"kong-ui-public-csv-export-modal"},iC={key:0,class:"selected-range"},sC={key:4,class:"text-muted",tag:"span"},Im=3,rC=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=bt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=d.ref(1),a=d.computed(()=>f.value.rows.length),l=d.computed(()=>{var g,b;return i.exportState.status==="success"&&!!((b=(g=i.exportState.chartData)==null?void 0:g.data)!=null&&b.length)}),c=d.computed(()=>i.exportState.status!=="success"?"":bt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(Im,a.value),rowsTotal:a.value,plural:a.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{var S,E,P;if(i.exportState.status!=="success"||!l.value||!((S=i.exportState.chartData)!=null&&S.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const g=i.exportState.chartData,b=g.data.some(y=>y.timestamp!==g.data[0].timestamp),x=g.data.map(y=>{const _=new Date(y.timestamp);return{...Object.keys(y.event).reduce((R,L)=>{if(L in g.meta.display){const I=y.event[L],B=g.meta.display[L];R[L]=I&&B&&B[I].name||y.event[L]}else R[L]=y.event[L];return R},{}),...b?{timestamp:Ka(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:Ka(_,"XXX")}:{}}});let k=[];b&&(k=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.exportState.chartData.meta&&((E=i.exportState.chartData.meta)!=null&&E.display)?(P=i.exportState.chartData.meta)==null?void 0:P.display:{},T=[...k,...Object.keys(M).map(y=>({label:e.t(`chartLabels.${y}`),key:y})),...i.exportState.chartData.meta.metric_names.map(y=>({label:e.t(`chartLabels.${y}`),key:y}))],v=T.reduce((y,_)=>(y[_.key]=_.label,y),{});return{headers:T,csvHeaders:v,rows:x}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:g}=f.value;return{total:Number(g.length)||0,data:g.slice(0,Im)}};return d.watch(f,()=>{o.value++}),(g,b)=>{const x=d.resolveComponent("KSkeleton"),k=d.resolveComponent("KEmptyState"),M=d.resolveComponent("KTableData"),T=d.resolveComponent("KTooltip"),v=d.resolveComponent("KButton"),S=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",nC,[d.createVNode(S,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>{var E;return[d.createElementVNode("div",null,[g.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",iC,[d.createElementVNode("p",null,d.toDisplayString(g.modalDescription?g.modalDescription:d.unref(e).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(c.value),1)])):d.createCommentVNode("",!0),g.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):g.exportState.status==="success"?(d.openBlock(),d.createBlock(M,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(o.value),headers:((E=f.value)==null?void 0:E.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(k,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):g.exportState.status==="error"?(d.openBlock(),d.createBlock(k,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),g.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",sC,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(T,{class:"preview-tooltip",placement:"right",text:d.unref(e).t("csvExport.maximumRecordAmount",{value:d.unref(N1)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Gs.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:d.unref(Fa)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(v,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(eC,{class:"vitals-report-export-button",filename:r,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(v,{appearance:"primary","data-testid":"csv-download-button",disabled:g.exportState.status!=="success"||!l.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),oC=({groupSizeMs:n,minStamp:t,maxStamp:e,timestamps:i})=>{const s=[...i].sort((l,c)=>l-c),r=[];let o=0,a=t;for(;a<=e&&t<e;){const l=a+n;let c=0;for(let u=o;u<s.length&&(s[u]>=a&&s[u]<l);u++)c++,o=u+1;r.push([a,c]),a=l}return r},aC={class:"container"},lC={key:0,class:"no-data","data-testId":"sparkline-empty"},cC=["title"],uC=Se(d.defineComponent({__name:"SparklineChart",props:{datasets:{},disableTooltip:{type:Boolean,default:!1},maxCount:{},maxStamp:{default:()=>Date.now()},minStamp:{},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{},type:{default:"sparkline_bar"}},emits:["max"],setup(n,{emit:t}){const e=crypto.randomUUID(),{i18n:i}=bt.useI18n(),s=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:e,interactionMode:"idle"}),r=({width:v,height:S})=>{s.width=v,s.height=S},o=d.computed(()=>n.disableTooltip?[]:[new Sm]),a=t,l=d.computed(()=>{const v=Math.max(2,n.pointRenderCount),S=Math.abs(n.maxStamp-n.minStamp);return Math.ceil(S/v)}),c=d.computed(()=>n.datasets.reduce((v,{timestamps:S,label:E})=>({...v,[E]:S.length}),{})),u=d.computed(()=>n.datasets.map(({label:v})=>[c.value[v],`${v}: ${c.value[v]}`]).sort(([v],[S])=>S-v).map(([,v])=>v).join(", ")),h=d.computed(()=>Object.keys(c.value).map(v=>c.value[v]).reduce((v,S)=>v+S,0)),f=d.computed(()=>h.value>0),m=d.computed(()=>n.datasets.length>1),g=d.computed(()=>n.datasets.map(({timestamps:v,color:S,label:E})=>({data:oC({groupSizeMs:l.value,minStamp:n.minStamp,maxStamp:n.maxStamp,timestamps:v}).map(([_,C])=>({x:_,y:C})),label:E,...(n.type==="sparkline_bar"||m.value)&&S&&{backgroundColor:S},...n.type!=="sparkline_bar"&&S&&{borderColor:S},...m.value&&n.type!=="sparkline_bar"&&{fill:!0}}))),b=d.computed(()=>({labels:new Array(n.pointRenderCount).fill(""),datasets:g.value})),x=`SparklineTooltipPosition-${e}`,k=d.computed(()=>({maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:0},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:x,external:v=>{oh(s,v,"minutely",{contextFormatter:S=>{const E=S+l.value;let P="";return l.value>24*60*60*1e3?P=Ir(new Date(E),"MMM dd, yyy hh:mm a"):P=Ir(new Date(E),"hh:mm a"),`${cl(S)} - ${P}`}})}}},scales:{x:{max:n.maxStamp,min:n.minStamp-1,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:m.value},y:{min:0,...n.maxCount!==void 0&&{max:n.maxCount},grid:{display:!1},display:!1,stacked:m.value}}})),M=d.ref("0"),T=d.ref("0");return d.onMounted(()=>{ke.positioners[x]=function(v,S){if(!v.length||s.interactionMode==="interactive")return!1;const E=10,P=this.chart.canvas.getBoundingClientRect(),y=s.width||this.width,_=s.height||this.height,C=P.top-_>0,R=C?P.top-_-E:P.top+P.height+E,L=P.left>y/2-S.x,I=Math.max(E,window.innerWidth-E-y),B=Math.min(I,L?Math.floor(P.left-y/2)+S.x:0+E);return M.value=`${R}px`,T.value=`${B}px`,{x:B,y:R,xAlign:"center",yAlign:C?"top":"bottom"}}}),d.onUnmounted(()=>{ke.positioners[x]&&delete ke.positioners[x]}),d.watch(g,()=>{var S;let v=0;for(let E=0;E<n.pointRenderCount+1;E++){let P=0;for(let y=0;y<g.value.length;y++)P+=((S=g.value[y].data[E])==null?void 0:S.y)??0;v=Math.max(v,P)}a("max",v)},{immediate:!0}),(v,S)=>(d.openBlock(),d.createElementBlock("div",aC,[f.value?v.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(wm),{key:1,"chart-id":d.unref(e),data:b.value,"data-testId":"sparkline-bar",options:k.value,plugins:o.value},null,8,["chart-id","data","options","plugins"])):v.type==="sparkline_line"||v.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(Mm),{key:2,"chart-id":d.unref(e),data:b.value,"data-testId":v.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:k.value,plugins:o.value},null,8,["chart-id","data","data-testId","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",lC,[d.renderSlot(v.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(i).t("sparkline_no_data")),1)],!0)])),v.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(ao,{key:3,"absolute-left":T.value,"absolute-top":M.value,class:"tooltip","data-testid":"sparkline-tooltip",state:s,"tooltip-title":v.tooltipTitle,onDimensions:r},null,8,["absolute-left","absolute-top","state","tooltip-title"])),f.value&&v.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:v.$slots.label?"":u.value},[d.renderSlot(v.$slots,"label",{total:h.value,totalByDataset:c.value},()=>[d.createTextVNode(d.toDisplayString(u.value),1)],!0)],8,cC)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ea085d8b"]]);ot.AnalyticsChart=XD,ot.ChartLegendPosition=Nt,ot.CsvExportModal=rC,ot.DECIMAL_DISPLAY=Cw,ot.EMPTY_COLOR=yh,ot.FONT_SIZE_REGULAR=uh,ot.FONT_SIZE_SMALL=ch,ot.MAX_LABEL_LENGTH=zr,ot.OTHERS_COLOR=Hw,ot.SimpleChart=oT,ot.SparklineChart=uC,ot.TopNTable=bT,ot.ValidType=ei,ot.accessibleGrey=gh,ot.apiRequestStatusCodeColors=ph,ot.chartTypes=ID,ot.codesInSpec=wh,ot.darkenColor=mh,ot.datavisPalette=sn,ot.defaultStatusCodeColors=Wr,ot.determineBaseColor=za,ot.errorRateColors=zw,ot.handleQueryError=C1,ot.latencyColors=Bw,ot.lightGrey=Wa,ot.lookupColor=Ww,ot.lookupDatavisColor=Br,ot.lookupStatusCodeCategoryColor=Xw,ot.lookupStatusCodeColor=Va,ot.numberFormatter=La,ot.simpleChartMetricDisplay=RD,ot.simpleChartTypes=LD,ot.statusCodeBadgeBackgroundColor=Nw,ot.thresholdColor=Hr,ot.trafficColors=Fw,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
|
|
37
|
+
`:"\r"}}function x(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(y){var b=(y=y||{}).delimiter,S=y.newline,O=y.comments,R=y.step,A=y.preview,z=y.fastMode,U=null,X=!1,W=y.quoteChar==null?'"':y.quoteChar,ct=W;if(y.escapeChar!==void 0&&(ct=y.escapeChar),(typeof b!="string"||-1<c.BAD_DELIMITERS.indexOf(b))&&(b=","),O===b)throw new Error("Comment character same as delimiter");O===!0?O="#":(typeof O!="string"||-1<c.BAD_DELIMITERS.indexOf(O))&&(O=!1),S!==`
|
|
38
|
+
`&&S!=="\r"&&S!==`\r
|
|
39
|
+
`&&(S=`
|
|
40
|
+
`);var q=0,tt=!1;this.parse=function(et,G,j){if(typeof et!="string")throw new Error("Input must be a string");var $=et.length,Z=b.length,_t=S.length,gt=O.length,pt=P(R),B=[],Y=[],V=[],J=q=0;if(!et)return Mt();if(z||z!==!1&&et.indexOf(W)===-1){for(var nt=et.split(S),it=0;it<nt.length;it++){if(V=nt[it],q+=V.length,it!==nt.length-1)q+=S.length;else if(j)return Mt();if(!O||V.substring(0,gt)!==O){if(pt){if(B=[],te(V.split(b)),Xt(),tt)return Mt()}else te(V.split(b));if(A&&A<=it)return B=B.slice(0,A),Mt(!0)}}return Mt()}for(var rt=et.indexOf(b,q),st=et.indexOf(S,q),wt=new RegExp(x(ct)+x(W),"g"),ut=et.indexOf(W,q);;)if(et[q]===W)for(ut=q,q++;;){if((ut=et.indexOf(W,ut+1))===-1)return j||Y.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:B.length,index:q}),qt();if(ut===$-1)return qt(et.substring(q,ut).replace(wt,W));if(W===ct&&et[ut+1]===ct)ut++;else if(W===ct||ut===0||et[ut-1]!==ct){rt!==-1&&rt<ut+1&&(rt=et.indexOf(b,ut+1));var Pt=ae((st=st!==-1&&st<ut+1?et.indexOf(S,ut+1):st)===-1?rt:Math.min(rt,st));if(et.substr(ut+1+Pt,Z)===b){V.push(et.substring(q,ut).replace(wt,W)),et[q=ut+1+Pt+Z]!==W&&(ut=et.indexOf(W,q)),rt=et.indexOf(b,q),st=et.indexOf(S,q);break}if(Pt=ae(st),et.substring(ut+1+Pt,ut+1+Pt+_t)===S){if(V.push(et.substring(q,ut).replace(wt,W)),Ee(ut+1+Pt+_t),rt=et.indexOf(b,q),ut=et.indexOf(W,q),pt&&(Xt(),tt))return Mt();if(A&&B.length>=A)return Mt(!0);break}Y.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:B.length,index:q}),ut++}}else if(O&&V.length===0&&et.substring(q,q+gt)===O){if(st===-1)return Mt();q=st+_t,st=et.indexOf(S,q),rt=et.indexOf(b,q)}else if(rt!==-1&&(rt<st||st===-1))V.push(et.substring(q,rt)),q=rt+Z,rt=et.indexOf(b,q);else{if(st===-1)break;if(V.push(et.substring(q,st)),Ee(st+_t),pt&&(Xt(),tt))return Mt();if(A&&B.length>=A)return Mt(!0)}return qt();function te(Bt){B.push(Bt),J=q}function ae(Bt){var Gt=0;return Gt=Bt!==-1&&(Bt=et.substring(ut+1,Bt))&&Bt.trim()===""?Bt.length:Gt}function qt(Bt){return j||(Bt===void 0&&(Bt=et.substring(q)),V.push(Bt),q=$,te(V),pt&&Xt()),Mt()}function Ee(Bt){q=Bt,te(V),V=[],st=et.indexOf(S,q)}function Mt(Bt){if(y.header&&!G&&B.length&&!X){var Gt=B[0],ie=Object.create(null),qe=new Set(Gt);let ni=!1;for(let Fe=0;Fe<Gt.length;Fe++){let Ht=Gt[Fe];if(ie[Ht=P(y.transformHeader)?y.transformHeader(Ht,Fe):Ht]){let _e,ii=ie[Ht];for(;_e=Ht+"_"+ii,ii++,qe.has(_e););qe.add(_e),Gt[Fe]=_e,ie[Ht]++,ni=!0,(U=U===null?{}:U)[_e]=Ht}else ie[Ht]=1,Gt[Fe]=Ht;qe.add(Ht)}ni&&console.warn("Duplicate headers found and renamed."),X=!0}return{data:B,errors:Y,meta:{delimiter:b,linebreak:S,aborted:tt,truncated:!!Bt,cursor:J+(G||0),renamedHeaders:U}}}function Xt(){R(Mt()),B=[],Y=[]}},this.abort=function(){tt=!0},this.getCharIndex=function(){return q}}function v(y){var b=y.data,S=a[b.workerId],O=!1;if(b.error)S.userError(b.error,b.file);else if(b.results&&b.results.data){var R={abort:function(){O=!0,T(b.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(P(S.userStep)){for(var A=0;A<b.results.data.length&&(S.userStep({data:b.results.data[A],errors:b.results.errors,meta:b.results.meta},R),!O);A++);delete b.results}else P(S.userChunk)&&(S.userChunk(b.results,R,b.file),delete b.results)}b.finished&&!O&&T(b.workerId,b.results)}function T(y,b){var S=a[y];P(S.userComplete)&&S.userComplete(b),S.terminate(),delete a[y]}function k(){throw new Error("Not implemented.")}function C(y){if(typeof y!="object"||y===null)return y;var b,S=Array.isArray(y)?[]:{};for(b in y)S[b]=C(y[b]);return S}function I(y,b){return function(){y.apply(b,arguments)}}function P(y){return typeof y=="function"}return c.parse=function(y,b){var S=(b=b||{}).dynamicTyping||!1;if(P(S)&&(b.dynamicTypingFunction=S,S={}),b.dynamicTyping=S,b.transform=!!P(b.transform)&&b.transform,!b.worker||!c.WORKERS_SUPPORTED)return S=null,c.NODE_STREAM_INPUT,typeof y=="string"?(y=(O=>O.charCodeAt(0)!==65279?O:O.slice(1))(y),S=new(b.download?h:m)(b)):y.readable===!0&&P(y.read)&&P(y.on)?S=new g(b):(i.File&&y instanceof File||y instanceof Object)&&(S=new f(b)),S.stream(y);(S=(()=>{var O;return!!c.WORKERS_SUPPORTED&&(O=(()=>{var R=i.URL||i.webkitURL||null,A=e.toString();return c.BLOB_URL||(c.BLOB_URL=R.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",A,")();"],{type:"text/javascript"})))})(),(O=new i.Worker(O)).onmessage=v,O.id=l++,a[O.id]=O)})()).userStep=b.step,S.userChunk=b.chunk,S.userComplete=b.complete,S.userError=b.error,b.step=P(b.step),b.chunk=P(b.chunk),b.complete=P(b.complete),b.error=P(b.error),delete b.worker,S.postMessage({input:y,config:b,workerId:S.id})},c.unparse=function(y,b){var S=!1,O=!0,R=",",A=`\r
|
|
41
|
+
`,z='"',U=z+z,X=!1,W=null,ct=!1,q=((()=>{if(typeof b=="object"){if(typeof b.delimiter!="string"||c.BAD_DELIMITERS.filter(function(G){return b.delimiter.indexOf(G)!==-1}).length||(R=b.delimiter),typeof b.quotes!="boolean"&&typeof b.quotes!="function"&&!Array.isArray(b.quotes)||(S=b.quotes),typeof b.skipEmptyLines!="boolean"&&typeof b.skipEmptyLines!="string"||(X=b.skipEmptyLines),typeof b.newline=="string"&&(A=b.newline),typeof b.quoteChar=="string"&&(z=b.quoteChar),typeof b.header=="boolean"&&(O=b.header),Array.isArray(b.columns)){if(b.columns.length===0)throw new Error("Option columns is empty");W=b.columns}b.escapeChar!==void 0&&(U=b.escapeChar+z),b.escapeFormulae instanceof RegExp?ct=b.escapeFormulae:typeof b.escapeFormulae=="boolean"&&b.escapeFormulae&&(ct=/^[=+\-@\t\r].*$/)}})(),new RegExp(x(z),"g"));if(typeof y=="string"&&(y=JSON.parse(y)),Array.isArray(y)){if(!y.length||Array.isArray(y[0]))return tt(null,y,X);if(typeof y[0]=="object")return tt(W||Object.keys(y[0]),y,X)}else if(typeof y=="object")return typeof y.data=="string"&&(y.data=JSON.parse(y.data)),Array.isArray(y.data)&&(y.fields||(y.fields=y.meta&&y.meta.fields||W),y.fields||(y.fields=Array.isArray(y.data[0])?y.fields:typeof y.data[0]=="object"?Object.keys(y.data[0]):[]),Array.isArray(y.data[0])||typeof y.data[0]=="object"||(y.data=[y.data])),tt(y.fields||[],y.data||[],X);throw new Error("Unable to serialize unrecognized input");function tt(G,j,$){var Z="",_t=(typeof G=="string"&&(G=JSON.parse(G)),typeof j=="string"&&(j=JSON.parse(j)),Array.isArray(G)&&0<G.length),gt=!Array.isArray(j[0]);if(_t&&O){for(var pt=0;pt<G.length;pt++)0<pt&&(Z+=R),Z+=et(G[pt],pt);0<j.length&&(Z+=A)}for(var B=0;B<j.length;B++){var Y=(_t?G:j[B]).length,V=!1,J=_t?Object.keys(j[B]).length===0:j[B].length===0;if($&&!_t&&(V=$==="greedy"?j[B].join("").trim()==="":j[B].length===1&&j[B][0].length===0),$==="greedy"&&_t){for(var nt=[],it=0;it<Y;it++){var rt=gt?G[it]:it;nt.push(j[B][rt])}V=nt.join("").trim()===""}if(!V){for(var st=0;st<Y;st++){0<st&&!J&&(Z+=R);var wt=_t&>?G[st]:st;Z+=et(j[B][wt],st)}B<j.length-1&&(!$||0<Y&&!J)&&(Z+=A)}}return Z}function et(G,j){var $,Z;return G==null?"":G.constructor===Date?JSON.stringify(G).slice(1,25):(Z=!1,ct&&typeof G=="string"&&ct.test(G)&&(G="'"+G,Z=!0),$=G.toString().replace(q,U),(Z=Z||S===!0||typeof S=="function"&&S(G,j)||Array.isArray(S)&&S[j]||((_t,gt)=>{for(var pt=0;pt<gt.length;pt++)if(-1<_t.indexOf(gt[pt]))return!0;return!1})($,c.BAD_DELIMITERS)||-1<$.indexOf(R)||$.charAt(0)===" "||$.charAt($.length-1)===" ")?z+$+z:$)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
|
|
42
|
+
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!r&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=M,c.ParserHandle=_,c.NetworkStreamer=h,c.FileStreamer=f,c.StringStreamer=m,c.ReadableStreamStreamer=g,i.jQuery&&((s=i.jQuery).fn.parse=function(y){var b=y.config||{},S=[];return this.each(function(A){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var z=0;z<this.files.length;z++)S.push({file:this.files[z],inputElem:this,instanceConfig:s.extend({},b)})}),O(),this;function O(){if(S.length===0)P(y.complete)&&y.complete();else{var A,z,U,X,W=S[0];if(P(y.before)){var ct=y.before(W.file,W.inputElem);if(typeof ct=="object"){if(ct.action==="abort")return A="AbortError",z=W.file,U=W.inputElem,X=ct.reason,void(P(y.error)&&y.error({name:A},z,U,X));if(ct.action==="skip")return void R();typeof ct.config=="object"&&(W.instanceConfig=s.extend(W.instanceConfig,ct.config))}else if(ct==="skip")return void R()}var q=W.instanceConfig.complete;W.instanceConfig.complete=function(tt){P(q)&&q(tt,W.file,W.inputElem),R()},c.parse(W.file,W.instanceConfig)}}function R(){S.splice(0,1),O()}}),o&&(i.onmessage=function(y){y=y.data,c.WORKER_ID===void 0&&y&&(c.WORKER_ID=y.workerId),typeof y.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(y.input,y.config),finished:!0}):(i.File&&y.input instanceof File||y.input instanceof Object)&&(y=c.parse(y.input,y.config))&&i.postMessage({workerId:c.WORKER_ID,results:y,finished:!0})}),(h.prototype=Object.create(u.prototype)).constructor=h,(f.prototype=Object.create(u.prototype)).constructor=f,(m.prototype=Object.create(m.prototype)).constructor=m,(g.prototype=Object.create(u.prototype)).constructor=g,c})})(Lm);var sC=Lm.exports;const rC=["id"],oC=d.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,s=d.computed(()=>`export_${new Date().getTime()}`),r=d.computed(()=>{const u=l();return u.length?u:null}),o=()=>{const u=i.labels;if(typeof i.fields!==ei.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ei.Object?h=>DT(h,(f,m)=>u[m]||m):h=>h},a=()=>{const u=i.fields;if(typeof i.fields!==ei.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?h=>nC(h,u):h=>h},l=()=>{if(typeof i.fields===ei.Undefined&&typeof i.labels===ei.Undefined)return i.data;const u=o(),h=a();return i.data.map(f=>u(h(f)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=sC.unparse(r.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
|
|
43
|
+
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const h=new Blob([u],{type:"text/csv;charset="+i.encoding});iC.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(n.filename),1)])],8,rC))}}),aC=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=d.computed(()=>Object.keys(t.headers));return(i,s)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(oC,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),lC={class:"kong-ui-public-csv-export-modal"},cC={key:0,class:"selected-range"},uC={key:4,class:"text-muted",tag:"span"},Nm=3,dC=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=bt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=d.ref(1),a=d.computed(()=>f.value.rows.length),l=d.computed(()=>{var g,_;return i.exportState.status==="success"&&!!((_=(g=i.exportState.chartData)==null?void 0:g.data)!=null&&_.length)}),c=d.computed(()=>i.exportState.status!=="success"?"":bt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(Nm,a.value),rowsTotal:a.value,plural:a.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{var C,I,P;if(i.exportState.status!=="success"||!l.value||!((C=i.exportState.chartData)!=null&&C.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const g=i.exportState.chartData,_=g.data.some(y=>y.timestamp!==g.data[0].timestamp),x=g.data.map(y=>{const b=new Date(y.timestamp);return{...Object.keys(y.event).reduce((O,R)=>{if(R in g.meta.display){const A=y.event[R],z=g.meta.display[R];O[R]=A&&z&&z[A].name||y.event[R]}else O[R]=y.event[R];return O},{}),..._?{timestamp:Za(b,"yyyy-MM-dd HH:mm:ss"),tzOffset:Za(b,"XXX")}:{}}});let M=[];_&&(M=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const v="display"in i.exportState.chartData.meta&&((I=i.exportState.chartData.meta)!=null&&I.display)?(P=i.exportState.chartData.meta)==null?void 0:P.display:{},T=[...M,...Object.keys(v).map(y=>({label:e.t(`chartLabels.${y}`),key:y})),...i.exportState.chartData.meta.metric_names.map(y=>({label:e.t(`chartLabels.${y}`),key:y}))],k=T.reduce((y,b)=>(y[b.key]=b.label,y),{});return{headers:T,csvHeaders:k,rows:x}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:g}=f.value;return{total:Number(g.length)||0,data:g.slice(0,Nm)}};return d.watch(f,()=>{o.value++}),(g,_)=>{const x=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KEmptyState"),v=d.resolveComponent("KTableData"),T=d.resolveComponent("KTooltip"),k=d.resolveComponent("KButton"),C=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",lC,[d.createVNode(C,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>{var I;return[d.createElementVNode("div",null,[g.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",cC,[d.createElementVNode("p",null,d.toDisplayString(g.modalDescription?g.modalDescription:d.unref(e).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(c.value),1)])):d.createCommentVNode("",!0),g.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):g.exportState.status==="success"?(d.openBlock(),d.createBlock(v,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(o.value),headers:((I=f.value)==null?void 0:I.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(M,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):g.exportState.status==="error"?(d.openBlock(),d.createBlock(M,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),g.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",uC,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(T,{class:"preview-tooltip",placement:"right",text:d.unref(e).t("csvExport.maximumRecordAmount",{value:d.unref(zv)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Ks.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Fa)})`,size:d.unref(za)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(k,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(aC,{class:"vitals-report-export-button",filename:r,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(k,{appearance:"primary","data-testid":"csv-download-button",disabled:g.exportState.status!=="success"||!l.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),hC={class:"container"},fC={key:0,class:"no-data","data-testId":"sparkline-empty"},mC=["title"],gC=ke(d.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=bt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:r,syncedMinCount:o,syncedMaxCount:a,syncedRenderPoints:l,syncedChartDatasets:c}=bt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),u=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:P,height:y})=>{u.width=P,u.height=y},f=d.computed(()=>n.disableTooltip?[]:[new Tm]),m=d.computed(()=>c.value.reduce((P,{data:y,label:b})=>({...P,[b]:y.reduce((S,{y:O})=>S+O,0)}),{})),g=d.computed(()=>c.value.map(({label:P})=>[m.value[P],`${P}: ${m.value[P]}`]).sort(([P],[y])=>y-P).map(([,P])=>P).join(", ")),_=d.computed(()=>Object.keys(m.value).map(P=>m.value[P]).reduce((P,y)=>P+y,0)),x=d.computed(()=>_.value>0),M=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),v=d.computed(()=>n.datasets.length>1),T=`SparklineTooltipPosition-${t}`,k=d.computed(()=>{const P=n.type==="sparkline_bar",y=P?s.value-1:s.value,b=P?r.value:r.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:P?0:2,right:P?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:T,external:S=>{ah(u,S,"minutely",{contextFormatter:O=>{const R=O+i.value;let A="";return i.value>24*60*60*1e3?A=Lr(new Date(R),"MMM dd, yyy hh:mm a"):A=Lr(new Date(R),"hh:mm a"),`${ul(O)} - ${A}`}})}}},scales:{x:{min:y,max:b,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:v.value},y:{min:Math.max(o.value-1,0),max:a.value,grid:{display:!1},display:!1,stacked:v.value}}}}),C=d.ref("0"),I=d.ref("0");return d.onMounted(()=>{Se.positioners[T]=function(P,y){if(!P.length||u.interactionMode==="interactive")return!1;const b=10,S=this.chart.canvas.getBoundingClientRect(),O=u.width||this.width,R=u.height||this.height,A=S.top-R>0,z=A?S.top-R-b:S.top+S.height+b,U=S.left>O/2-y.x,X=Math.max(b,window.innerWidth-b-O),W=Math.min(X,U?Math.floor(S.left-O/2)+y.x:0+b);return C.value=`${z}px`,I.value=`${W}px`,{x:W,y:z,xAlign:"center",yAlign:A?"top":"bottom"}}}),d.onUnmounted(()=>{Se.positioners[T]&&delete Se.positioners[T]}),(P,y)=>(d.openBlock(),d.createElementBlock("div",hC,[x.value?P.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Mm),{key:1,"chart-id":d.unref(t),data:M.value,"data-testId":"sparkline-bar",options:k.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):P.type==="sparkline_line"||P.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(km),{key:2,"chart-id":d.unref(t),data:M.value,"data-testId":P.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:k.value,plugins:f.value},null,8,["chart-id","data","data-testId","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",fC,[d.renderSlot(P.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("sparkline_no_data")),1)],!0)])),P.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(lo,{key:3,"absolute-left":I.value,"absolute-top":C.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":P.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),x.value&&P.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:P.$slots.label?"":g.value},[d.renderSlot(P.$slots,"label",{total:_.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(g.value),1)],!0)],8,mC)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-91e291d2"]]);ot.AnalyticsChart=tT,ot.ChartLegendPosition=Nt,ot.CsvExportModal=dC,ot.DECIMAL_DISPLAY=Ow,ot.EMPTY_COLOR=bh,ot.FONT_SIZE_REGULAR=dh,ot.FONT_SIZE_SMALL=uh,ot.MAX_LABEL_LENGTH=Br,ot.OTHERS_COLOR=Vw,ot.SimpleChart=hT,ot.SparklineChart=gC,ot.TopNTable=ST,ot.ValidType=ei,ot.accessibleGrey=ph,ot.apiRequestStatusCodeColors=yh,ot.chartTypes=HD,ot.codesInSpec=vh,ot.darkenColor=gh,ot.datavisPalette=sn,ot.defaultStatusCodeColors=Vr,ot.determineBaseColor=Ba,ot.errorRateColors=Hw,ot.handleQueryError=Ov,ot.latencyColors=Ww,ot.lightGrey=Va,ot.lookupColor=Yw,ot.lookupDatavisColor=Hr,ot.lookupStatusCodeCategoryColor=Kw,ot.lookupStatusCodeColor=Ya,ot.numberFormatter=Na,ot.simpleChartMetricDisplay=BD,ot.simpleChartTypes=WD,ot.statusCodeBadgeBackgroundColor=zw,ot.thresholdColor=Wr,ot.trafficColors=Bw,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
|