@kong-ui-public/analytics-chart 10.10.0 → 10.10.1-pr.2637.18f5d291a.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,43 +1,47 @@
1
- (function(at,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):(at=typeof globalThis<"u"?globalThis:at||self,d(at["kong-ui-publicvitals-chart"]={},at.Vue,at["kong-ui-public-i18n"],at.KongIcons))})(this,function(at,d,zn,Qs){"use strict";var wC=Object.defineProperty;var vC=(at,d,zn)=>d in at?wC(at,d,{enumerable:!0,configurable:!0,writable:!0,value:zn}):at[d]=zn;var P=(at,d,zn)=>vC(at,typeof d!="symbol"?d+"":d,zn);var Rn;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 Bm(){const n=zn.createI18n("en-us",Fm);return{i18n:n,i18nT:zn.i18nTComponent(n)}}/*!
1
+ (function(at,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","axios"],d):(at=typeof globalThis<"u"?globalThis:at||self,d(at["kong-ui-publicvitals-chart"]={},at.Vue,at["kong-ui-public-i18n"],at.KongIcons))})(this,function(at,d,Qe,Jt){"use strict";var nO=Object.defineProperty;var iO=(at,d,Qe)=>d in at?nO(at,d,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):at[d]=Qe;var R=(at,d,Qe)=>iO(at,typeof d!="symbol"?d+"":d,Qe);var zn;const _g={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",trend:{not_available:"Not available"}},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 xg(){const e=Qe.createI18n("en-us",_g);return{i18n:e,i18nT:Qe.i18nTComponent(e)}}/*!
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 Vi(n){return n+.5|0}const yn=(n,t,e)=>Math.max(Math.min(n,e),t);function $i(n){return yn(Vi(n*2.55),0,255)}function bn(n){return yn(Vi(n*255),0,255)}function Ke(n){return yn(Vi(n/2.55)/100,0,1)}function _c(n){return yn(Vi(n*100),0,100)}const Ee={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},Ea=[..."0123456789ABCDEF"],zm=n=>Ea[n&15],Hm=n=>Ea[(n&240)>>4]+Ea[n&15],Js=n=>(n&240)>>4===(n&15),Wm=n=>Js(n.r)&&Js(n.g)&&Js(n.b)&&Js(n.a);function Ym(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Ee[n[1]]*17,g:255&Ee[n[2]]*17,b:255&Ee[n[3]]*17,a:t===5?Ee[n[4]]*17:255}:(t===7||t===9)&&(e={r:Ee[n[1]]<<4|Ee[n[2]],g:Ee[n[3]]<<4|Ee[n[4]],b:Ee[n[5]]<<4|Ee[n[6]],a:t===9?Ee[n[7]]<<4|Ee[n[8]]:255})),e}const Vm=(n,t)=>n<255?t(n):"";function $m(n){var t=Wm(n)?zm:Hm;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Vm(n.a,t):void 0}const jm=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function xc(n,t,e){const i=t*Math.min(e,1-e),s=(r,a=(r+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function Um(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 qm(n,t,e){const i=xc(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 Xm(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 Oa(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),a=Math.min(e,i,s),o=(r+a)/2;let l,c,u;return r!==a&&(u=r-a,c=o>.5?u/(2-r-a):u/(r+a),l=Xm(e,i,s,u,r),l=l*60+.5),[l|0,c||0,o]}function Pa(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(bn)}function Aa(n,t,e){return Pa(xc,n,t,e)}function Gm(n,t,e){return Pa(qm,n,t,e)}function Km(n,t,e){return Pa(Um,n,t,e)}function wc(n){return(n%360+360)%360}function Zm(n){const t=jm.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?$i(+t[5]):bn(+t[5]));const s=wc(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=Gm(s,r,a):t[1]==="hsv"?i=Km(s,r,a):i=Aa(s,r,a),{r:i[0],g:i[1],b:i[2],a:e}}function Qm(n,t){var e=Oa(n);e[0]=wc(e[0]+t),e=Aa(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Jm(n){if(!n)return;const t=Oa(n),e=t[0],i=_c(t[1]),s=_c(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ke(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const vc={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"},Mc={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 tg(){const n={},t=Object.keys(Mc),e=Object.keys(vc);let i,s,r,a,o;for(i=0;i<t.length;i++){for(a=o=t[i],s=0;s<e.length;s++)r=e[s],o=o.replace(r,vc[r]);r=parseInt(Mc[a],16),n[o]=[r>>16&255,r>>8&255,r&255]}return n}let tr;function eg(n){tr||(tr=tg(),tr.transparent=[0,0,0,0]);const t=tr[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const ng=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ig(n){const t=ng.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?$i(a):yn(a*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?$i(i):yn(i,0,255)),s=255&(t[4]?$i(s):yn(s,0,255)),r=255&(t[6]?$i(r):yn(r,0,255)),{r:i,g:s,b:r,a:e}}}function sg(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ke(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Ra=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,hi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function rg(n,t,e){const i=hi(Ke(n.r)),s=hi(Ke(n.g)),r=hi(Ke(n.b));return{r:bn(Ra(i+e*(hi(Ke(t.r))-i))),g:bn(Ra(s+e*(hi(Ke(t.g))-s))),b:bn(Ra(r+e*(hi(Ke(t.b))-r))),a:n.a+e*(t.a-n.a)}}function er(n,t,e){if(n){let i=Oa(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Aa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Sc(n,t){return n&&Object.assign(t||{},n)}function kc(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=bn(n[3]))):(t=Sc(n,{r:0,g:0,b:0,a:1}),t.a=bn(t.a)),t}function ag(n){return n.charAt(0)==="r"?ig(n):Zm(n)}class ji{constructor(t){if(t instanceof ji)return t;const e=typeof t;let i;e==="object"?i=kc(t):e==="string"&&(i=Ym(t)||eg(t)||ag(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Sc(this._rgb);return t&&(t.a=Ke(t.a)),t}set rgb(t){this._rgb=kc(t)}rgbString(){return this._valid?sg(this._rgb):void 0}hexString(){return this._valid?$m(this._rgb):void 0}hslString(){return this._valid?Jm(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const a=e===r?.5:e,o=2*a-1,l=i.a-s.a,c=((o*l===-1?o:(o+l)/(1+o*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=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=rg(this._rgb,t._rgb,e)),this}clone(){return new ji(this.rgb)}alpha(t){return this._rgb.a=bn(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Vi(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 er(this._rgb,2,t),this}darken(t){return er(this._rgb,2,-t),this}saturate(t){return er(this._rgb,1,t),this}desaturate(t){return er(this._rgb,1,-t),this}rotate(t){return Qm(this._rgb,t),this}}/*!
6
+ */function Qi(e){return e+.5|0}const vn=(e,t,n)=>Math.max(Math.min(e,n),t);function Ji(e){return vn(Qi(e*2.55),0,255)}function Sn(e){return vn(Qi(e*255),0,255)}function Je(e){return vn(Qi(e/2.55)/100,0,1)}function Bc(e){return vn(Qi(e*100),0,100)}const Oe={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},Ha=[..."0123456789ABCDEF"],wg=e=>Ha[e&15],vg=e=>Ha[(e&240)>>4]+Ha[e&15],ls=e=>(e&240)>>4===(e&15),Sg=e=>ls(e.r)&&ls(e.g)&&ls(e.b)&&ls(e.a);function kg(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Oe[e[1]]*17,g:255&Oe[e[2]]*17,b:255&Oe[e[3]]*17,a:t===5?Oe[e[4]]*17:255}:(t===7||t===9)&&(n={r:Oe[e[1]]<<4|Oe[e[2]],g:Oe[e[3]]<<4|Oe[e[4]],b:Oe[e[5]]<<4|Oe[e[6]],a:t===9?Oe[e[7]]<<4|Oe[e[8]]:255})),n}const Mg=(e,t)=>e<255?t(e):"";function Tg(e){var t=Sg(e)?wg:vg;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Mg(e.a,t):void 0}const Dg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function zc(e,t,n){const i=t*Math.min(n,1-n),r=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function Cg(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Eg(e,t,n){const i=zc(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function Og(e,t,n,i,r){return e===r?(t-n)/i+(t<n?6:0):t===r?(n-e)/i+2:(e-t)/i+4}function Va(e){const n=e.r/255,i=e.g/255,r=e.b/255,s=Math.max(n,i,r),a=Math.min(n,i,r),o=(s+a)/2;let c,l,u;return s!==a&&(u=s-a,l=o>.5?u/(2-s-a):u/(s+a),c=Og(n,i,r,u,s),c=c*60+.5),[c|0,l||0,o]}function $a(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Sn)}function Wa(e,t,n){return $a(zc,e,t,n)}function Pg(e,t,n){return $a(Eg,e,t,n)}function Rg(e,t,n){return $a(Cg,e,t,n)}function Hc(e){return(e%360+360)%360}function Ag(e){const t=Dg.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ji(+t[5]):Sn(+t[5]));const r=Hc(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=Pg(r,s,a):t[1]==="hsv"?i=Rg(r,s,a):i=Wa(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function Ig(e,t){var n=Va(e);n[0]=Hc(n[0]+t),n=Wa(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Lg(e){if(!e)return;const t=Va(e),n=t[0],i=Bc(t[1]),r=Bc(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${Je(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Vc={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"},$c={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 e={},t=Object.keys($c),n=Object.keys(Vc);let i,r,s,a,o;for(i=0;i<t.length;i++){for(a=o=t[i],r=0;r<n.length;r++)s=n[r],o=o.replace(s,Vc[s]);s=parseInt($c[a],16),e[o]=[s>>16&255,s>>8&255,s&255]}return e}let cs;function Fg(e){cs||(cs=Ng(),cs.transparent=[0,0,0,0]);const t=cs[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Bg=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function zg(e){const t=Bg.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?Ji(a):vn(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Ji(i):vn(i,0,255)),r=255&(t[4]?Ji(r):vn(r,0,255)),s=255&(t[6]?Ji(s):vn(s,0,255)),{r:i,g:r,b:s,a:n}}}function Hg(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Je(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Ya=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,yi=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Vg(e,t,n){const i=yi(Je(e.r)),r=yi(Je(e.g)),s=yi(Je(e.b));return{r:Sn(Ya(i+n*(yi(Je(t.r))-i))),g:Sn(Ya(r+n*(yi(Je(t.g))-r))),b:Sn(Ya(s+n*(yi(Je(t.b))-s))),a:e.a+n*(t.a-e.a)}}function us(e,t,n){if(e){let i=Va(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Wa(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Wc(e,t){return e&&Object.assign(t||{},e)}function Yc(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Sn(e[3]))):(t=Wc(e,{r:0,g:0,b:0,a:1}),t.a=Sn(t.a)),t}function $g(e){return e.charAt(0)==="r"?zg(e):Ag(e)}class tr{constructor(t){if(t instanceof tr)return t;const n=typeof t;let i;n==="object"?i=Yc(t):n==="string"&&(i=kg(t)||Fg(t)||$g(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Wc(this._rgb);return t&&(t.a=Je(t.a)),t}set rgb(t){this._rgb=Yc(t)}rgbString(){return this._valid?Hg(this._rgb):void 0}hexString(){return this._valid?Tg(this._rgb):void 0}hslString(){return this._valid?Lg(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const a=n===s?.5:n,o=2*a-1,c=i.a-r.a,l=((o*c===-1?o:(o+c)/(1+o*c))+1)/2;s=1-l,i.r=255&l*i.r+s*r.r+.5,i.g=255&l*i.g+s*r.g+.5,i.b=255&l*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=Vg(this._rgb,t._rgb,n)),this}clone(){return new tr(this.rgb)}alpha(t){return this._rgb.a=Sn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Qi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.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 us(this._rgb,2,t),this}darken(t){return us(this._rgb,2,-t),this}saturate(t){return us(this._rgb,1,t),this}desaturate(t){return us(this._rgb,1,-t),this}rotate(t){return Ig(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 Ze(){}const og=(()=>{let n=0;return()=>n++})();function it(n){return n==null}function wt(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 ft(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function At(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function De(n,t){return At(n)?n:t}function st(n,t){return typeof n>"u"?t:n}const lg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Dc=(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 kt(n,t,e,i){let s,r,a;if(wt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ft(n))for(a=Object.keys(n),r=a.length,s=0;s<r;s++)t.call(e,n[a[s]],a[s])}function nr(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 ir(n){if(wt(n))return n.map(ir);if(ft(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=ir(n[e[s]]);return t}return n}function Tc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function cg(n,t,e,i){if(!Tc(n))return;const s=t[n],r=e[n];ft(s)&&ft(r)?Ui(s,r,i):t[n]=ir(r)}function Ui(n,t,e){const i=wt(t)?t:[t],s=i.length;if(!ft(n))return n;e=e||{};const r=e.merger||cg;let a;for(let o=0;o<s;++o){if(a=i[o],!ft(a))continue;const l=Object.keys(a);for(let c=0,u=l.length;c<u;++c)r(l[c],n,a,e)}return n}function qi(n,t){return Ui(n,t,{merger:ug})}function ug(n,t,e){if(!Tc(n))return;const i=t[n],s=e[n];ft(i)&&ft(s)?qi(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=ir(s))}const Cc={"":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 _n(n,t){return(Cc[t]||(Cc[t]=hg(t)))(n)}function Ia(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ge=n=>typeof n<"u",pe=n=>typeof n=="function",Ec=(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 ut=Math.PI,Ct=2*ut,mg=Ct+ut,sr=Number.POSITIVE_INFINITY,La=ut/180,Ot=ut/2,Oe=ut/4,rr=ut*2/3,xn=Math.log10,We=Math.sign;function Xi(n,t,e){return Math.abs(n-t)<e}function Oc(n){const t=Math.round(n);n=Xi(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xn(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 wn(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 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 Vt(n){return n*(ut/180)}function ar(n){return n*(180/ut)}function Ac(n){if(!At(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function or(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*ut&&(r+=Ct),{angle:r,distance:s}}function fi(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)%Ct-ut}function ie(n){return(n%Ct+Ct)%Ct}function Gi(n,t,e,i){const s=ie(n),r=ie(t),a=ie(e),o=ie(r-s),l=ie(a-s),c=ie(s-r),u=ie(s-a);return s===r||s===a||i&&r===a||o>l&&c<u}function Kt(n,t,e){return Math.max(t,Math.min(e,n))}function _g(n){return Kt(n,-32768,32767)}function Qe(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Na(n,t,e){e=e||(a=>n[a]<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 Je=(n,t,e,i)=>Na(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)=>Na(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 Rc=["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]}}),Rc.forEach(e=>{const i="_onData"+Ia(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const a=s.apply(this,r);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...r)}),a}})})}function Ic(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)&&(Rc.forEach(r=>{delete n[r]}),delete n._chartjs)}function Lc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Nc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Fc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Nc.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 Fa=n=>n==="start"?"left":n==="end"?"right":"center",se=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Sg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Bc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:a,vScale:o,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=a.axis,{min:h,max:f,minDefined:m,maxDefined:g}=a.getUserBounds();if(m){if(s=Math.min(Je(l,u,h).lo,e?i:Je(t,u,a.getPixelForValue(h)).lo),c){const _=l.slice(0,s+1).reverse().findIndex(x=>!it(x[o.axis]));s-=Math.max(0,_)}s=Kt(s,0,i-1)}if(g){let _=Math.max(Je(l,a.axis,f,!0).hi+1,e?0:Je(t,u,a.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(_-1).findIndex(v=>!it(v[o.axis]));_+=Math.max(0,x)}r=Kt(_,s,i)-s}else r=i-s}return{start:s,count:r}}function zc(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 lr=n=>n===0||n===1,Hc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ct/e)),Wc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ct/e)+1,Ki={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*Ot)+1,easeOutSine:n=>Math.sin(n*Ot),easeInOutSine:n=>-.5*(Math.cos(ut*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=>lr(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=>lr(n)?n:Hc(n,.075,.3),easeOutElastic:n=>lr(n)?n:Wc(n,.075,.3),easeInOutElastic(n){return lr(n)?n:n<.5?.5*Hc(n*2,.1125,.45):.5+.5*Wc(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-Ki.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?Ki.easeInBounce(n*2)*.5:Ki.easeOutBounce(n*2-1)*.5+.5};function Ba(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Yc(n){return Ba(n)?n:new ji(n)}function za(n){return Ba(n)?n:new ji(n).saturate(.5).darken(.1).hexString()}const kg=["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:kg}}),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 Vc=new Map;function Eg(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Vc.get(e);return i||(i=new Intl.NumberFormat(n,t),Vc.set(e,i)),i}function Zi(n,t,e){return Eg(t,e).format(n)}const $c={values(n){return wt(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 a=xn(Math.abs(r)),o=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Zi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?$c.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 cr={formatters:$c};function Pg(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:cr.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 Hn=Object.create(null),Ha=Object.create(null);function Qi(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 Wa(n,t,e){return typeof t=="string"?Ui(Qi(n,t),e):Ui(Qi(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)=>za(s.backgroundColor),this.hoverBorderColor=(i,s)=>za(s.borderColor),this.hoverColor=(i,s)=>za(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 Wa(this,t,e)}get(t){return Qi(this,t)}describe(t,e){return Wa(Ha,t,e)}override(t,e){return Wa(Hn,t,e)}route(t,e,i,s){const r=Qi(this,t),a=Qi(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=a[s];return ft(l)?Object.assign({},c,l):st(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Pt=new Ag({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Tg,Cg,Pg]);function Rg(n){return!n||it(n.size)||it(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ur(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 a=0;const o=e.length;let l,c,u,h,f;for(l=0;l<o;l++)if(h=e[l],h!=null&&!wt(h))a=ur(n,s,r,a,h);else if(wt(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!wt(f)&&(a=ur(n,s,r,a,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 a}function Wn(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 jc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Ya(n,t,e,i){Uc(n,t,e,i,null)}function Uc(n,t,e,i,s){let r,a,o,l,c,u,h,f;const m=t.pointStyle,g=t.rotation,_=t.radius;let x=(g||0)*La;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,Ct):n.arc(e,i,_,0,Ct),n.closePath();break;case"triangle":u=s?s/2:_,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*_),x+=rr,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*_),x+=rr,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*_),n.closePath();break;case"rectRounded":c=_*.516,l=_-c,a=Math.cos(x+Oe)*l,h=Math.cos(x+Oe)*(s?s/2-c:l),o=Math.sin(x+Oe)*l,f=Math.sin(x+Oe)*(s?s/2-c:l),n.arc(e-h,i-o,c,x-ut,x-Ot),n.arc(e+f,i-a,c,x-Ot,x),n.arc(e+h,i+o,c,x,x+Ot),n.arc(e-f,i+a,c,x+Ot,x+ut),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+=Oe;case"rectRot":h=Math.cos(x)*(s?s/2:_),a=Math.cos(x)*_,o=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-o),n.lineTo(e+f,i-a),n.lineTo(e+h,i+o),n.lineTo(e-f,i+a),n.closePath();break;case"crossRot":x+=Oe;case"cross":h=Math.cos(x)*(s?s/2:_),a=Math.cos(x)*_,o=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"star":h=Math.cos(x)*(s?s/2:_),a=Math.cos(x)*_,o=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a),x+=Oe,h=Math.cos(x)*(s?s/2:_),a=Math.cos(x)*_,o=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"line":a=s?s/2:Math.cos(x)*_,o=Math.sin(x)*_,n.moveTo(e-a,i-o),n.lineTo(e+a,i+o);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 tn(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 Ji(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function ts(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]),it(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 Bg(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),a=t-r.actualBoundingBoxLeft,o=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(a,u),n.lineTo(o,u),n.stroke()}}function zg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Yn(n,t,e,i,s,r={}){const a=wt(t)?t:[t],o=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,Fg(n,r),l=0;l<a.length;++l)c=a[l],r.backdrop&&zg(n,r.backdrop),o&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),it(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),Bg(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function mi(n,t){const{x:e,y:i,w:s,h:r,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*ut,ut,!0),n.lineTo(e,i+r-a.bottomLeft),n.arc(e+a.bottomLeft,i+r-a.bottomLeft,a.bottomLeft,ut,Ot,!0),n.lineTo(e+s-a.bottomRight,i+r),n.arc(e+s-a.bottomRight,i+r-a.bottomRight,a.bottomRight,Ot,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-Ot,!0),n.lineTo(e+a.topLeft,i)}const Hg=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Wg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Yg(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 Vg=n=>+n||0;function Va(n,t){const e={},i=ft(t),s=i?Object.keys(t):t,r=ft(n)?i?a=>st(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=Vg(r(a));return e}function qc(n){return Va(n,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(n){return Va(n,["topLeft","topRight","bottomLeft","bottomRight"])}function $t(n){const t=qc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Rt(n,t){n=n||{},t=t||Pt.font;let e=st(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=st(n.style,t.style);i&&!(""+i).match(Wg)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:st(n.family,t.family),lineHeight:Yg(st(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:st(n.weight,t.weight),string:""};return s.string=Rg(s),s}function es(n,t,e,i){let s,r,a;for(s=0,r=n.length;s<r;++s)if(a=n[s],a!==void 0&&a!==void 0)return a}function $g(n,t,e){const{min:i,max:s}=n,r=Dc(t,(s-i)/2),a=(o,l)=>e&&o===0?0:o+l;return{min:a(i,-Math.abs(r)),max:a(s,r)}}function Mn(n,t){return Object.assign(Object.create(n),t)}function $a(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Qc("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:o=>$a([o,...n],t,r,i)};return new Proxy(a,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Gc(o,l,()=>Qg(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return Jc(o).includes(l)},ownKeys(o){return Jc(o)},set(o,l,c){const u=o._storage||(o._storage=s());return o[l]=u[l]=c,delete o._keys,!0}})}function gi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Xc(n,i),setContext:r=>gi(n,r,e,i),override:r=>gi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,a){return delete r[a],delete n[a],!0},get(r,a,o){return Gc(r,a,()=>Ug(r,a,o))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(r,a,o){return n[a]=o,delete r[a],!0}})}function Xc(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:pe(e)?e:()=>e,isIndexable:pe(i)?i:()=>i}}const jg=(n,t)=>n?n+Ia(t):t,ja=(n,t)=>ft(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Gc(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:a}=n;let o=i[t];return pe(o)&&a.isScriptable(t)&&(o=qg(t,o,n,e)),wt(o)&&o.length&&(o=Xg(t,o,n,a.isIndexable)),ja(t,o)&&(o=gi(o,s,r&&r[t],a)),o}function qg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(r,a||i);return o.delete(n),ja(n,l)&&(l=Ua(s._scopes,s,n,l)),l}function Xg(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_descriptors:o}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(ft(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const h=Ua(c,s,n,u);t.push(gi(h,r,a&&a[n],o))}}return t}function Kc(n,t,e){return pe(n)?n(t,e):n}const Gg=(n,t)=>n===!0?t:typeof n=="string"?_n(t,n):void 0;function Kg(n,t,e,i,s){for(const r of t){const a=Gg(e,r);if(a){n.add(a);const o=Kc(a._fallback,e,s);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function Ua(n,t,e,i){const s=t._rootScopes,r=Kc(t._fallback,e,i),a=[...n,...s],o=new Set;o.add(i);let l=Zc(o,a,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Zc(o,a,r,l,i),l===null)?!1:$a(Array.from(o),[""],s,r,()=>Zg(t,e,i))}function Zc(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 wt(s)&&ft(e)?e:s||{}}function Qg(n,t,e,i){let s;for(const r of t)if(s=Qc(jg(r,n),e),typeof s<"u")return ja(n,s)?Ua(e,i,n,s):s}function Qc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Jc(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 tu(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,a=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],a[o]={r:s.parse(_n(u,r),c)};return a}const tp=Number.EPSILON||1e-14,pi=(n,t)=>t<n.length&&!n[t].skip&&n[t],eu=n=>n==="x"?"y":"x";function ep(n,t,e,i){const s=n.skip?t:n,r=t,a=e.skip?t:e,o=fi(r,s),l=fi(a,r);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,f=i*u;return{previous:{x:r.x-h*(a.x-s.x),y:r.y-h*(a.y-s.y)},next:{x:r.x+f*(a.x-s.x),y:r.y+f*(a.y-s.y)}}}function np(n,t,e){const i=n.length;let s,r,a,o,l,c=pi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=pi(n,u+1),!(!l||!c)){if(Xi(t[u],0,tp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],o=Math.pow(s,2)+Math.pow(r,2),!(o<=9)&&(a=3/Math.sqrt(o),e[u]=s*a*t[u],e[u+1]=r*a*t[u])}}function ip(n,t,e="x"){const i=eu(e),s=n.length;let r,a,o,l=pi(n,0);for(let c=0;c<s;++c){if(a=o,o=l,l=pi(n,c+1),!o)continue;const u=o[e],h=o[i];a&&(r=(u-a[e])/3,o[`cp1${e}`]=u-r,o[`cp1${i}`]=h-r*t[c]),l&&(r=(l[e]-u)/3,o[`cp2${e}`]=u+r,o[`cp2${i}`]=h+r*t[c])}}function sp(n,t="x"){const e=eu(t),i=n.length,s=Array(i).fill(0),r=Array(i);let a,o,l,c=pi(n,0);for(a=0;a<i;++a)if(o=l,l=c,c=pi(n,a+1),!!l){if(c){const u=c[t]-l[t];s[a]=u!==0?(c[e]-l[e])/u:0}r[a]=o?c?We(s[a-1])!==We(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}np(n,s,r),ip(n,r,t)}function dr(n,t,e){return Math.max(Math.min(n,e),t)}function rp(n,t){let e,i,s,r,a,o=tn(n[0],t);for(e=0,i=n.length;e<i;++e)a=r,r=o,o=e<i-1&&tn(n[e+1],t),r&&(s=n[e],a&&(s.cp1x=dr(s.cp1x,t.left,t.right),s.cp1y=dr(s.cp1y,t.top,t.bottom)),o&&(s.cp2x=dr(s.cp2x,t.left,t.right),s.cp2y=dr(s.cp2y,t.top,t.bottom)))}function ap(n,t,e,i,s){let r,a,o,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,a=n.length;r<a;++r)o=n[r],l=ep(c,o,n[Math.min(r+1,a-(i?0:1))%a],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&rp(n,e)}function qa(){return typeof window<"u"&&typeof document<"u"}function Xa(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function hr(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 fr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function op(n,t){return fr(n).getPropertyValue(t)}const lp=["top","right","bottom","left"];function Vn(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 a=!1,o,l;if(cp(s,r,n.target))o=s,l=r;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:o,y:l,box:a}}function Sn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=fr(e),r=s.boxSizing==="border-box",a=Vn(s,"padding"),o=Vn(s,"border","width"),{x:l,y:c,box:u}=up(n,e),h=a.left+(u&&o.left),f=a.top+(u&&o.top);let{width:m,height:g}=t;return r&&(m-=a.width+o.width,g-=a.height+o.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&&Xa(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const a=r.getBoundingClientRect(),o=fr(r),l=Vn(o,"border","width"),c=Vn(o,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=hr(o.maxWidth,r,"clientWidth"),s=hr(o.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||sr,maxHeight:s||sr}}const mr=n=>Math.round(n*10)/10;function hp(n,t,e,i){const s=fr(n),r=Vn(s,"margin"),a=hr(s.maxWidth,n,"clientWidth")||sr,o=hr(s.maxHeight,n,"clientHeight")||sr,l=dp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=Vn(s,"border","width"),m=Vn(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=mr(Math.min(c,a,l.maxWidth)),u=mr(Math.min(u,o,l.maxHeight)),c&&!u&&(u=mr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=mr(Math.floor(u*i))),{width:c,height:u}}function nu(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 a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==r?(n.currentDevicePixelRatio=i,a.height=s,a.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}};qa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function iu(n,t){const e=op(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function $n(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},a=$n(n,s,e),o=$n(s,r,e),l=$n(r,t,e),c=$n(a,o,e),u=$n(o,l,e);return $n(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 yi(n,t,e){return n?pp(t,e):yp()}function su(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 ru(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function au(n){return n==="angle"?{between:Gi,compare:bg,normalize:ie}:{between:Qe,compare:(t,e)=>t-e,normalize:t=>t}}function ou({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:a,normalize:o}=au(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&&a(o(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 lu(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,a=t.length,{compare:o,between:l,normalize:c}=au(i),{start:u,end:h,loop:f,style:m}=bp(n,t,e),g=[];let _=!1,x=null,v,S,k;const C=()=>l(s,k,v)&&o(s,k)!==0,A=()=>o(r,v)===0||l(r,k,v),O=()=>_||C(),T=()=>!_||A();for(let p=u,b=u;p<=h;++p)S=t[p%a],!S.skip&&(v=c(S[i]),v!==k&&(_=l(v,s,r),x===null&&O()&&(x=o(v,s)===0?p:b),x!==null&&T()&&(g.push(ou({start:x,end:p,loop:f,count:a,style:m})),x=null),b=p,k=v));return x!==null&&g.push(ou({start:x,end:h,loop:f,count:a,style:m})),g}function cu(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=lu(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 a=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?o.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,o.skip&&(t=l)),o=c}return a!==null&&r.push({start:t%s,end:a%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:a,end:o}=_p(e,s,r,i);if(i===!0)return uu(n,[{start:a,end:o,loop:r}],e,t);const l=o<a?o+s:o,c=!!n._fullLoop&&a===0&&o===s-1;return uu(n,xp(e,a,l,c),e,t)}function uu(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=du(n.options),{_datasetIndex:a,options:{spanGaps:o}}=n,l=e.length,c=[];let u=r,h=t[0].start,f=h;function m(g,_,x,v){const S=o?-1:1;if(g!==_){for(g+=l;e[g%l].skip;)g-=S;for(;e[_%l].skip;)_+=S;g%l!==_%l&&(c.push({start:g%l,end:_%l,loop:x,style:v}),u=v,h=_%l)}}for(const g of t){h=o?h:g.start;let _=e[h%l],x;for(f=h+1;f<=g.end;f++){const v=e[f%l];x=du(i.setContext(Mn(s,{type:"segment",p0:_,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),Mp(x,u)&&m(h,f-1,g.loop,u),_=v,u=x}h<f-1&&m(h,f-1,g.loop,u)}return c}function du(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 Ba(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function gr(n,t,e){return n.options.clip?n[e]:t[e]}function Sp(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:gr(e,t,"left"),right:gr(e,t,"right"),top:gr(i,t,"top"),bottom:gr(i,t,"bottom")}:t}function hu(n,t){const e=t._clip;if(e.disabled)return!1;const i=Sp(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 tn(){}const Wg=(()=>{let e=0;return()=>e++})();function it(e){return e==null}function wt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ft(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Rt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function De(e,t){return Rt(e)?e:t}function rt(e,t){return typeof e>"u"?t:e}const Yg=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,jc=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function kt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Mt(e,t,n,i){let r,s,a;if(wt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(ft(e))for(a=Object.keys(e),s=a.length,r=0;r<s;r++)t.call(n,e[a[r]],a[r])}function ds(e,t){let n,i,r,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(r=e[n],s=t[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function hs(e){if(wt(e))return e.map(hs);if(ft(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let r=0;for(;r<i;++r)t[n[r]]=hs(e[n[r]]);return t}return e}function Uc(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function jg(e,t,n,i){if(!Uc(e))return;const r=t[e],s=n[e];ft(r)&&ft(s)?er(r,s,i):t[e]=hs(s)}function er(e,t,n){const i=wt(t)?t:[t],r=i.length;if(!ft(e))return e;n=n||{};const s=n.merger||jg;let a;for(let o=0;o<r;++o){if(a=i[o],!ft(a))continue;const c=Object.keys(a);for(let l=0,u=c.length;l<u;++l)s(c[l],e,a,n)}return e}function nr(e,t){return er(e,t,{merger:Ug})}function Ug(e,t,n){if(!Uc(e))return;const i=t[e],r=n[e];ft(i)&&ft(r)?nr(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=hs(r))}const qc={"":e=>e,x:e=>e.x,y:e=>e.y};function qg(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Xg(e){const t=qg(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function kn(e,t){return(qc[t]||(qc[t]=Xg(t)))(e)}function ja(e){return e.charAt(0).toUpperCase()+e.slice(1)}const pe=e=>typeof e<"u",ye=e=>typeof e=="function",Xc=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Gg(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ut=Math.PI,Ct=2*ut,Kg=Ct+ut,fs=Number.POSITIVE_INFINITY,Ua=ut/180,Ot=ut/2,Pe=ut/4,ms=ut*2/3,Mn=Math.log10,$e=Math.sign;function ir(e,t,n){return Math.abs(e-t)<n}function Gc(e){const t=Math.round(e);e=ir(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Mn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Zg(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((r,s)=>r-s).pop(),t}function Qg(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Tn(e){return!Qg(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Jg(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Kc(e,t,n){let i,r,s;for(i=0,r=e.length;i<r;i++)s=e[i][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function Wt(e){return e*(ut/180)}function gs(e){return e*(180/ut)}function Zc(e){if(!Rt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function ps(e,t){const n=t.x-e.x,i=t.y-e.y,r=Math.sqrt(n*n+i*i);let s=Math.atan2(i,n);return s<-.5*ut&&(s+=Ct),{angle:s,distance:r}}function bi(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function tp(e,t){return(e-t+Kg)%Ct-ut}function re(e){return(e%Ct+Ct)%Ct}function rr(e,t,n,i){const r=re(e),s=re(t),a=re(n),o=re(s-r),c=re(a-r),l=re(r-s),u=re(r-a);return r===s||r===a||i&&s===a||o>c&&l<u}function Kt(e,t,n){return Math.max(t,Math.min(n,e))}function ep(e){return Kt(e,-32768,32767)}function en(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function qa(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const nn=(e,t,n,i)=>qa(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),np=(e,t,n)=>qa(e,n,i=>e[i][t]>=n);function ip(e,t,n){let i=0,r=e.length;for(;i<r&&e[i]<t;)i++;for(;r>i&&e[r-1]>n;)r--;return i>0||r<e.length?e.slice(i,r):e}const Qc=["push","pop","shift","splice","unshift"];function rp(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Qc.forEach(n=>{const i="_onData"+ja(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return e._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...s)}),a}})})}function Jc(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Qc.forEach(s=>{delete e[s]}),delete e._chartjs)}function tu(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const eu=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function nu(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,eu.call(window,()=>{i=!1,e.apply(t,n)}))}}function sp(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Xa=e=>e==="start"?"left":e==="end"?"right":"center",se=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ap=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function iu(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:a,vScale:o,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=a.axis,{min:h,max:f,minDefined:m,maxDefined:g}=a.getUserBounds();if(m){if(r=Math.min(nn(c,u,h).lo,n?i:nn(t,u,a.getPixelForValue(h)).lo),l){const y=c.slice(0,r+1).reverse().findIndex(x=>!it(x[o.axis]));r-=Math.max(0,y)}r=Kt(r,0,i-1)}if(g){let y=Math.max(nn(c,a.axis,f,!0).hi+1,n?0:nn(t,u,a.getPixelForValue(f),!0).hi+1);if(l){const x=c.slice(y-1).findIndex(v=>!it(v[o.axis]));y+=Math.max(0,x)}s=Kt(y,r,i)-r}else s=i-r}return{start:r,count:s}}function ru(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const ys=e=>e===0||e===1,su=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ct/n)),au=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ct/n)+1,sr={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Ot)+1,easeOutSine:e=>Math.sin(e*Ot),easeInOutSine:e=>-.5*(Math.cos(ut*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ys(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ys(e)?e:su(e,.075,.3),easeOutElastic:e=>ys(e)?e:au(e,.075,.3),easeInOutElastic(e){return ys(e)?e:e<.5?.5*su(e*2,.1125,.45):.5+.5*au(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-sr.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?sr.easeInBounce(e*2)*.5:sr.easeOutBounce(e*2-1)*.5+.5};function Ga(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ou(e){return Ga(e)?e:new tr(e)}function Ka(e){return Ga(e)?e:new tr(e).saturate(.5).darken(.1).hexString()}const op=["x","y","borderWidth","radius","tension"],lp=["color","borderColor","backgroundColor"];function cp(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:lp},numbers:{type:"number",properties:op}}),e.describe("animations",{_fallback:"animation"}),e.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 up(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const lu=new Map;function dp(e,t){t=t||{};const n=e+JSON.stringify(t);let i=lu.get(n);return i||(i=new Intl.NumberFormat(e,t),lu.set(n,i)),i}function ar(e,t,n){return dp(t,n).format(e)}const cu={values(e){return wt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const l=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(l<1e-4||l>1e15)&&(r="scientific"),s=hp(e,n)}const a=Mn(Math.abs(s)),o=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(c,this.options.ticks.format),ar(e,i,c)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Mn(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?cu.numeric.call(this,e,t,n):""}};function hp(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var bs={formatters:cu};function fp(e){e.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,n)=>n.lineWidth,tickColor:(t,n)=>n.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:bs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const jn=Object.create(null),Za=Object.create(null);function or(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;i<r;++i){const s=n[i];e=e[s]||(e[s]=Object.create(null))}return e}function Qa(e,t,n){return typeof t=="string"?er(or(e,t),n):er(or(e,""),t)}class mp{constructor(t,n){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,r)=>Ka(r.backgroundColor),this.hoverBorderColor=(i,r)=>Ka(r.borderColor),this.hoverColor=(i,r)=>Ka(r.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(n)}set(t,n){return Qa(this,t,n)}get(t){return or(this,t)}describe(t,n){return Qa(Za,t,n)}override(t,n){return Qa(jn,t,n)}route(t,n,i,r){const s=or(this,t),a=or(this,i),o="_"+n;Object.defineProperties(s,{[o]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[o],l=a[r];return ft(c)?Object.assign({},l,c):rt(c,l)},set(c){this[o]=c}}})}apply(t){t.forEach(n=>n(this))}}var Pt=new mp({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cp,up,fp]);function gp(e){return!e||it(e.size)||it(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function _s(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function pp(e,t,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let a=0;const o=n.length;let c,l,u,h,f;for(c=0;c<o;c++)if(h=n[c],h!=null&&!wt(h))a=_s(e,r,s,a,h);else if(wt(h))for(l=0,u=h.length;l<u;l++)f=h[l],f!=null&&!wt(f)&&(a=_s(e,r,s,a,f));e.restore();const m=s.length/2;if(m>n.length){for(c=0;c<m;c++)delete r[s[c]];s.splice(0,m)}return a}function Un(e,t,n){const i=e.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((t-r)*i)/i+r}function uu(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ja(e,t,n,i){du(e,t,n,i,null)}function du(e,t,n,i,r){let s,a,o,c,l,u,h,f;const m=t.pointStyle,g=t.rotation,y=t.radius;let x=(g||0)*Ua;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(x),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),m){default:r?e.ellipse(n,i,r/2,y,0,0,Ct):e.arc(n,i,y,0,Ct),e.closePath();break;case"triangle":u=r?r/2:y,e.moveTo(n+Math.sin(x)*u,i-Math.cos(x)*y),x+=ms,e.lineTo(n+Math.sin(x)*u,i-Math.cos(x)*y),x+=ms,e.lineTo(n+Math.sin(x)*u,i-Math.cos(x)*y),e.closePath();break;case"rectRounded":l=y*.516,c=y-l,a=Math.cos(x+Pe)*c,h=Math.cos(x+Pe)*(r?r/2-l:c),o=Math.sin(x+Pe)*c,f=Math.sin(x+Pe)*(r?r/2-l:c),e.arc(n-h,i-o,l,x-ut,x-Ot),e.arc(n+f,i-a,l,x-Ot,x),e.arc(n+h,i+o,l,x,x+Ot),e.arc(n-f,i+a,l,x+Ot,x+ut),e.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*y,u=r?r/2:c,e.rect(n-u,i-c,2*u,2*c);break}x+=Pe;case"rectRot":h=Math.cos(x)*(r?r/2:y),a=Math.cos(x)*y,o=Math.sin(x)*y,f=Math.sin(x)*(r?r/2:y),e.moveTo(n-h,i-o),e.lineTo(n+f,i-a),e.lineTo(n+h,i+o),e.lineTo(n-f,i+a),e.closePath();break;case"crossRot":x+=Pe;case"cross":h=Math.cos(x)*(r?r/2:y),a=Math.cos(x)*y,o=Math.sin(x)*y,f=Math.sin(x)*(r?r/2:y),e.moveTo(n-h,i-o),e.lineTo(n+h,i+o),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"star":h=Math.cos(x)*(r?r/2:y),a=Math.cos(x)*y,o=Math.sin(x)*y,f=Math.sin(x)*(r?r/2:y),e.moveTo(n-h,i-o),e.lineTo(n+h,i+o),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a),x+=Pe,h=Math.cos(x)*(r?r/2:y),a=Math.cos(x)*y,o=Math.sin(x)*y,f=Math.sin(x)*(r?r/2:y),e.moveTo(n-h,i-o),e.lineTo(n+h,i+o),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"line":a=r?r/2:Math.cos(x)*y,o=Math.sin(x)*y,e.moveTo(n-a,i-o),e.lineTo(n+a,i+o);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(x)*(r?r/2:y),i+Math.sin(x)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function rn(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function lr(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function cr(e){e.restore()}function yp(e,t,n,i,r){if(!t)return e.lineTo(n.x,n.y);if(r==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else r==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function bp(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function _p(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),it(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function xp(e,t,n,i,r){if(r.strikethrough||r.underline){const s=e.measureText(i),a=t-s.actualBoundingBoxLeft,o=t+s.actualBoundingBoxRight,c=n-s.actualBoundingBoxAscent,l=n+s.actualBoundingBoxDescent,u=r.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(a,u),e.lineTo(o,u),e.stroke()}}function wp(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function qn(e,t,n,i,r,s={}){const a=wt(t)?t:[t],o=s.strokeWidth>0&&s.strokeColor!=="";let c,l;for(e.save(),e.font=r.string,_p(e,s),c=0;c<a.length;++c)l=a[c],s.backdrop&&wp(e,s.backdrop),o&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),it(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(l,n,i,s.maxWidth)),e.fillText(l,n,i,s.maxWidth),xp(e,n,i,l,s),i+=Number(r.lineHeight);e.restore()}function _i(e,t){const{x:n,y:i,w:r,h:s,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*ut,ut,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,ut,Ot,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,Ot,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-Ot,!0),e.lineTo(n+a.topLeft,i)}const vp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Sp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function kp(e,t){const n=(""+e).match(vp);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const Mp=e=>+e||0;function to(e,t){const n={},i=ft(t),r=i?Object.keys(t):t,s=ft(e)?i?a=>rt(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=Mp(s(a));return n}function hu(e){return to(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Dn(e){return to(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Yt(e){const t=hu(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function At(e,t){e=e||{},t=t||Pt.font;let n=rt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=rt(e.style,t.style);i&&!(""+i).match(Sp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:rt(e.family,t.family),lineHeight:kp(rt(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:rt(e.weight,t.weight),string:""};return r.string=gp(r),r}function ur(e,t,n,i){let r,s,a;for(r=0,s=e.length;r<s;++r)if(a=e[r],a!==void 0&&a!==void 0)return a}function Tp(e,t,n){const{min:i,max:r}=e,s=jc(t,(r-i)/2),a=(o,c)=>n&&o===0?0:o+c;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Cn(e,t){return Object.assign(Object.create(e),t)}function eo(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=yu("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:o=>eo([o,...e],t,s,i)};return new Proxy(a,{deleteProperty(o,c){return delete o[c],delete o._keys,delete e[0][c],!0},get(o,c){return mu(o,c,()=>Ip(c,t,e,o))},getOwnPropertyDescriptor(o,c){return Reflect.getOwnPropertyDescriptor(o._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(o,c){return bu(o).includes(c)},ownKeys(o){return bu(o)},set(o,c,l){const u=o._storage||(o._storage=r());return o[c]=u[c]=l,delete o._keys,!0}})}function xi(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:fu(e,i),setContext:s=>xi(e,s,n,i),override:s=>xi(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete e[a],!0},get(s,a,o){return mu(s,a,()=>Cp(s,a,o))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(s,a,o){return e[a]=o,delete s[a],!0}})}function fu(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:ye(n)?n:()=>n,isIndexable:ye(i)?i:()=>i}}const Dp=(e,t)=>e?e+ja(t):t,no=(e,t)=>ft(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function mu(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function Cp(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let o=i[t];return ye(o)&&a.isScriptable(t)&&(o=Ep(t,o,e,n)),wt(o)&&o.length&&(o=Op(t,o,e,a.isIndexable)),no(t,o)&&(o=xi(o,r,s&&s[t],a)),o}function Ep(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_stack:o}=n;if(o.has(e))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+e);o.add(e);let c=t(s,a||i);return o.delete(e),no(e,c)&&(c=io(r._scopes,r,e,c)),c}function Op(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:o}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(ft(t[0])){const c=t,l=r._scopes.filter(u=>u!==c);t=[];for(const u of c){const h=io(l,r,e,u);t.push(xi(h,s,a&&a[e],o))}}return t}function gu(e,t,n){return ye(e)?e(t,n):e}const Pp=(e,t)=>e===!0?t:typeof e=="string"?kn(t,e):void 0;function Rp(e,t,n,i,r){for(const s of t){const a=Pp(n,s);if(a){e.add(a);const o=gu(a._fallback,n,r);if(typeof o<"u"&&o!==n&&o!==i)return o}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function io(e,t,n,i){const r=t._rootScopes,s=gu(t._fallback,n,i),a=[...e,...r],o=new Set;o.add(i);let c=pu(o,a,n,s||n,i);return c===null||typeof s<"u"&&s!==n&&(c=pu(o,a,s,c,i),c===null)?!1:eo(Array.from(o),[""],r,s,()=>Ap(t,n,i))}function pu(e,t,n,i,r){for(;n;)n=Rp(e,t,n,i,r);return n}function Ap(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return wt(r)&&ft(n)?n:r||{}}function Ip(e,t,n,i){let r;for(const s of t)if(r=yu(Dp(s,e),n),typeof r<"u")return no(e,r)?io(n,i,e,r):r}function yu(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function bu(e){let t=e._keys;return t||(t=e._keys=Lp(e._scopes)),t}function Lp(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function _u(e,t,n,i){const{iScale:r}=e,{key:s="r"}=this._parsing,a=new Array(i);let o,c,l,u;for(o=0,c=i;o<c;++o)l=o+n,u=t[l],a[o]={r:r.parse(kn(u,s),l)};return a}const Np=Number.EPSILON||1e-14,wi=(e,t)=>t<e.length&&!e[t].skip&&e[t],xu=e=>e==="x"?"y":"x";function Fp(e,t,n,i){const r=e.skip?t:e,s=t,a=n.skip?t:n,o=bi(s,r),c=bi(a,s);let l=o/(o+c),u=c/(o+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const h=i*l,f=i*u;return{previous:{x:s.x-h*(a.x-r.x),y:s.y-h*(a.y-r.y)},next:{x:s.x+f*(a.x-r.x),y:s.y+f*(a.y-r.y)}}}function Bp(e,t,n){const i=e.length;let r,s,a,o,c,l=wi(e,0);for(let u=0;u<i-1;++u)if(c=l,l=wi(e,u+1),!(!c||!l)){if(ir(t[u],0,Np)){n[u]=n[u+1]=0;continue}r=n[u]/t[u],s=n[u+1]/t[u],o=Math.pow(r,2)+Math.pow(s,2),!(o<=9)&&(a=3/Math.sqrt(o),n[u]=r*a*t[u],n[u+1]=s*a*t[u])}}function zp(e,t,n="x"){const i=xu(n),r=e.length;let s,a,o,c=wi(e,0);for(let l=0;l<r;++l){if(a=o,o=c,c=wi(e,l+1),!o)continue;const u=o[n],h=o[i];a&&(s=(u-a[n])/3,o[`cp1${n}`]=u-s,o[`cp1${i}`]=h-s*t[l]),c&&(s=(c[n]-u)/3,o[`cp2${n}`]=u+s,o[`cp2${i}`]=h+s*t[l])}}function Hp(e,t="x"){const n=xu(t),i=e.length,r=Array(i).fill(0),s=Array(i);let a,o,c,l=wi(e,0);for(a=0;a<i;++a)if(o=c,c=l,l=wi(e,a+1),!!c){if(l){const u=l[t]-c[t];r[a]=u!==0?(l[n]-c[n])/u:0}s[a]=o?l?$e(r[a-1])!==$e(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}Bp(e,r,s),zp(e,s,t)}function xs(e,t,n){return Math.max(Math.min(e,n),t)}function Vp(e,t){let n,i,r,s,a,o=rn(e[0],t);for(n=0,i=e.length;n<i;++n)a=s,s=o,o=n<i-1&&rn(e[n+1],t),s&&(r=e[n],a&&(r.cp1x=xs(r.cp1x,t.left,t.right),r.cp1y=xs(r.cp1y,t.top,t.bottom)),o&&(r.cp2x=xs(r.cp2x,t.left,t.right),r.cp2y=xs(r.cp2y,t.top,t.bottom)))}function $p(e,t,n,i,r){let s,a,o,c;if(t.spanGaps&&(e=e.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")Hp(e,r);else{let l=i?e[e.length-1]:e[0];for(s=0,a=e.length;s<a;++s)o=e[s],c=Fp(l,o,e[Math.min(s+1,a-(i?0:1))%a],t.tension),o.cp1x=c.previous.x,o.cp1y=c.previous.y,o.cp2x=c.next.x,o.cp2y=c.next.y,l=o}t.capBezierPoints&&Vp(e,n)}function ro(){return typeof window<"u"&&typeof document<"u"}function so(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ws(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const vs=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Wp(e,t){return vs(e).getPropertyValue(t)}const Yp=["top","right","bottom","left"];function Xn(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=Yp[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const jp=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Up(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,o,c;if(jp(r,s,e.target))o=r,c=s;else{const l=t.getBoundingClientRect();o=i.clientX-l.left,c=i.clientY-l.top,a=!0}return{x:o,y:c,box:a}}function En(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=vs(n),s=r.boxSizing==="border-box",a=Xn(r,"padding"),o=Xn(r,"border","width"),{x:c,y:l,box:u}=Up(e,n),h=a.left+(u&&o.left),f=a.top+(u&&o.top);let{width:m,height:g}=t;return s&&(m-=a.width+o.width,g-=a.height+o.height),{x:Math.round((c-h)/m*n.width/i),y:Math.round((l-f)/g*n.height/i)}}function qp(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&so(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const a=s.getBoundingClientRect(),o=vs(s),c=Xn(o,"border","width"),l=Xn(o,"padding");t=a.width-l.width-c.width,n=a.height-l.height-c.height,i=ws(o.maxWidth,s,"clientWidth"),r=ws(o.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||fs,maxHeight:r||fs}}const Ss=e=>Math.round(e*10)/10;function Xp(e,t,n,i){const r=vs(e),s=Xn(r,"margin"),a=ws(r.maxWidth,e,"clientWidth")||fs,o=ws(r.maxHeight,e,"clientHeight")||fs,c=qp(e,t,n);let{width:l,height:u}=c;if(r.boxSizing==="content-box"){const f=Xn(r,"border","width"),m=Xn(r,"padding");l-=m.width+f.width,u-=m.height+f.height}return l=Math.max(0,l-s.width),u=Math.max(0,i?l/i:u-s.height),l=Ss(Math.min(l,a,c.maxWidth)),u=Ss(Math.min(u,o,c.maxHeight)),l&&!u&&(u=Ss(l/2)),(t!==void 0||n!==void 0)&&i&&c.height&&u>c.height&&(u=c.height,l=Ss(Math.floor(u*i))),{width:l,height:u}}function wu(e,t,n){const i=t||1,r=Math.floor(e.height*i),s=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(e.currentDevicePixelRatio=i,a.height=r,a.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Gp=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};ro()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function vu(e,t){const n=Wp(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Gn(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Kp(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Zp(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},a=Gn(e,r,n),o=Gn(r,s,n),c=Gn(s,t,n),l=Gn(a,o,n),u=Gn(o,c,n);return Gn(l,u,n)}const Qp=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},Jp=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function vi(e,t,n){return e?Qp(t,n):Jp()}function Su(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function ku(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Mu(e){return e==="angle"?{between:rr,compare:tp,normalize:re}:{between:en,compare:(t,n)=>t-n,normalize:t=>t}}function Tu({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function ty(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:o}=Mu(i),c=t.length;let{start:l,end:u,loop:h}=e,f,m;if(h){for(l+=c,u+=c,f=0,m=c;f<m&&a(o(t[l%c][i]),r,s);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:h,style:e.style}}function Du(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:o,between:c,normalize:l}=Mu(i),{start:u,end:h,loop:f,style:m}=ty(e,t,n),g=[];let y=!1,x=null,v,S,k;const C=()=>c(r,k,v)&&o(r,k)!==0,E=()=>o(s,v)===0||c(s,k,v),P=()=>y||C(),T=()=>!y||E();for(let p=u,_=u;p<=h;++p)S=t[p%a],!S.skip&&(v=l(S[i]),v!==k&&(y=c(v,r,s),x===null&&P()&&(x=o(v,r)===0?p:_),x!==null&&T()&&(g.push(Tu({start:x,end:p,loop:f,count:a,style:m})),x=null),_=p,k=v));return x!==null&&g.push(Tu({start:x,end:h,loop:f,count:a,style:m})),g}function Cu(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=Du(i[r],e.points,t);s.length&&n.push(...s)}return n}function ey(e,t,n,i){let r=0,s=t-1;if(n&&!i)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,n&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function ny(e,t,n,i){const r=e.length,s=[];let a=t,o=e[t],c;for(c=t+1;c<=n;++c){const l=e[c%r];l.skip||l.stop?o.skip||(i=!1,s.push({start:t%r,end:(c-1)%r,loop:i}),t=a=l.stop?c:null):(a=c,o.skip&&(t=c)),o=l}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function iy(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:o}=ey(n,r,s,i);if(i===!0)return Eu(e,[{start:a,end:o,loop:s}],n,t);const c=o<a?o+r:o,l=!!e._fullLoop&&a===0&&o===r-1;return Eu(e,ny(n,a,c,l),n,t)}function Eu(e,t,n,i){return!i||!i.setContext||!n?t:ry(e,t,n,i)}function ry(e,t,n,i){const r=e._chart.getContext(),s=Ou(e.options),{_datasetIndex:a,options:{spanGaps:o}}=e,c=n.length,l=[];let u=s,h=t[0].start,f=h;function m(g,y,x,v){const S=o?-1:1;if(g!==y){for(g+=c;n[g%c].skip;)g-=S;for(;n[y%c].skip;)y+=S;g%c!==y%c&&(l.push({start:g%c,end:y%c,loop:x,style:v}),u=v,h=y%c)}}for(const g of t){h=o?h:g.start;let y=n[h%c],x;for(f=h+1;f<=g.end;f++){const v=n[f%c];x=Ou(i.setContext(Cn(r,{type:"segment",p0:y,p1:v,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:a}))),sy(x,u)&&m(h,f-1,g.loop,u),y=v,u=x}h<f-1&&m(h,f-1,g.loop,u)}return l}function Ou(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function sy(e,t){if(!t)return!1;const n=[],i=function(r,s){return Ga(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function ks(e,t,n){return e.options.clip?e[n]:t[n]}function ay(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:ks(n,t,"left"),right:ks(n,t,"right"),top:ks(i,t,"top"),bottom:ks(i,t,"bottom")}:t}function Pu(e,t){const n=t._clip;if(n.disabled)return!1;const i=ay(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.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 kp{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],a=e.duration;r.forEach(o=>o({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Nc.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 a=r.length-1,o=!1,l;for(;a>=0;--a)l=r[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(r[a]=r[r.length-1],r.pop());o&&(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 en=new kp;const fu="transparent",Dp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Yc(n||fu),s=i.valid&&Yc(t||fu);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=es([t.to,s,r,t.from]);const a=es([t.from,r,s]);this._active=!0,this._fn=t.fn||Dp[t.type||typeof a],this._easing=Ki[t.easing]||Ki.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=a,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,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=es([t.to,e,s,t.from]),this._from=es([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,a=this._loop,o=this._to;let l;if(this._active=r!==o&&(a||e<i),!this._active){this._target[s]=o,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,o,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 Ga{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ft(t))return;const e=Object.keys(Pt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ft(r))return;const a={};for(const o of e)a[o]=r[o];(wt(r.properties)&&r.properties||[s]).forEach(o=>{(o===s||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,e){const i=e.options,s=Ep(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={}),a=Object.keys(e),o=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[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,o);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 en.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 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 mu(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=mu(n,e),s=mu(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Pp(n){let t,e,i,s;return ft(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 gu(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 pu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let a,o,l,c;if(t===null)return;let u=!1;for(a=0,o=s.length;a<o;++a){if(l=+s[a],l===e){if(u=!0,i.all)continue;break}c=n.values[l],At(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",a=Object.keys(n),o=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],o[l]={[s]:u,[r]:n[u]};return o}function Ka(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 yu(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 bu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:o}=i,l=r.axis,c=a.axis,u=Rp(r,a,i),h=t.length;let f;for(let m=0;m<h;++m){const g=t[m],{[l]:_,[c]:x}=g,v=g._stacks||(g._stacks={});f=v[c]=Lp(s,u,_),f[o]=x,f._top=yu(f,a,!0,i.type),f._bottom=yu(f,a,!1,i.type);const S=f._visualValues||(f._visualValues={});S[o]=x}}function Za(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Np(n,t){return Mn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Fp(n,t,e){return Mn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ns(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 Qa=n=>n==="reset"||n==="none",_u=(n,t)=>t?n:Object.assign({},n),Bp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:gu(e,!0),values:null};class Ne{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=Ka(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&&ns(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=st(i.xAxisID,Za(t,"x")),a=e.yAxisID=st(i.yAxisID,Za(t,"y")),o=e.rAxisID=st(i.rAxisID,Za(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,a,o),u=e.vAxisID=s(l,a,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),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&&Ic(this._data,this),t._stacked&&ns(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ft(e)){const s=this._cachedMeta;this._data=Ap(e,s)}else if(i!==e){if(i){Ic(i,this);const s=this._cachedMeta;ns(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=Ka(e.vScale,e),e.stack!==i.stack&&(s=!0,ns(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(bu(this,e._parsed),e._stacked=Ka(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:a}=i,o=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{wt(s[t])?f=this.parseArrayData(i,s,t,e):ft(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const m=()=>h[o]===null||c&&h[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&bu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:a}=t,o=r.axis,l=a.axis,c=r.getLabels(),u=r===a,h=new Array(s);let f,m,g;for(f=0,m=s;f<m;++f)g=f+i,h[f]={[o]:u||r.parse(c[g],g),[l]:a.parse(e[g],g)};return h}parseArrayData(t,e,i,s){const{xScale:r,yScale:a}=t,o=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],o[l]={x:r.parse(h[0],u),y:a.parse(h[1],u)};return o}parseObjectData(t,e,i,s){const{xScale:r,yScale:a}=t,{xAxisKey:o="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(_n(m,o),f),y:a.parse(_n(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,a=e[t.axis],o={keys:gu(s,!0),values:e._stacks[t.axis]._visualValues};return pu(o,a,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let a=r===null?NaN:r;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=pu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),l=Bp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Ip(o);let f,m;function g(){m=s[f];const _=m[o.axis];return!At(m[t.axis])||u>_||h<_}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(c,t,m,l),r));++f);if(r){for(f=a-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,a;for(s=0,r=e.length;s<r;++s)a=e[s][t.axis],At(a)&&i.push(a);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=Pp(st(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,a=[],o=this._drawStart||0,l=this._drawCount||s.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,o,l),u=o;u<o+l;++u){const h=s[u];h.hidden||(h.active&&c?a.push(h):h.draw(t,r))}for(u=0;u<a.length;++u)a[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 a=this._cachedMeta.data[t];r=a.$context||(a.$context=Fp(this.getContext(),t,a)),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,a=t+"-"+e,o=r[a],l=this.enableOptionSharing&&ge(i);if(o)return _u(o,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(Pt.elements[t]),g=()=>this.getContext(i,s,e),_=c.resolveNamedOptions(f,m,g,h);return _.$shared&&(_.$shared=l,r[a]=Object.freeze(_u(_,l))),_}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,o=r[a];if(o)return o;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 Ga(s,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Qa(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}updateElement(t,e,i,s){Qa(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Qa(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[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const s=i.length,r=e.length,a=Math.min(r,s);a&&this.parse(0,a),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,a=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=a;o--)c[o]=c[o-e]};for(l(r),o=t;o<a;++o)r[o]=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&&ns(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])}}P(Ne,"defaults",{}),P(Ne,"datasetElementType",null),P(Ne,"dataElementType",null);function zp(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=Lc(i.sort((s,r)=>s-r))}return n._cache.$bar}function Hp(n){const t=n.iScale,e=zp(t,n.type);let i=t._length,s,r,a,o;const l=()=>{a===32767||a===-32768||(ge(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(s=0,r=e.length;s<r;++s)a=t.getPixelForValue(e[s]),l();for(o=void 0,s=0,r=t.ticks.length;s<r;++s)a=t.getPixelForTick(s),l();return i}function Wp(n,t,e,i){const s=e.barThickness;let r,a;return it(s)?(r=t.min*e.categoryPercentage,a=e.barPercentage):(r=s*i,a=1),{chunk:r/i,ratio:a,start:t.pixels[n]-r/2}}function Yp(n,t,e,i){const s=t.pixels,r=s[n];let a=n>0?s[n-1]:null,o=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=r-(o===null?t.end-t.start:o-r)),o===null&&(o=r+r-a);const c=r-(r-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/i,ratio:e.barPercentage,start:c}}function Vp(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),a=Math.min(s,r),o=Math.max(s,r);let l=a,c=o;Math.abs(a)>Math.abs(o)&&(l=o,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:a,max:o}}function xu(n,t,e,i){return wt(n)?Vp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function wu(n,t,e,i){const s=n.iScale,r=n.vScale,a=s.getLabels(),o=s===r,l=[];let c,u,h,f;for(c=e,u=e+i;c<u;++c)f=t[c],h={},h[s.axis]=o||s.parse(a[c],c),l.push(xu(f,h,r,c));return l}function Ja(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function $p(n,t,e){return n!==0?We(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function jp(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:a,end:o,reverse:l,top:c,bottom:u}=jp(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[vu(u,a,o,l)]=!0,s=c)),r[vu(s,a,o,l)]=!0,n.borderSkipped=r}function vu(n,t,e,i){return i?(n=qp(n,t,e),n=Mu(n,e,t)):n=Mu(n,t,e),n}function qp(n,t,e){return n===t?e:n===e?t:n}function Mu(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 is extends Ne{parsePrimitiveData(t,e,i,s){return wu(t,e,i,s)}parseArrayData(t,e,i,s){return wu(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?o:l,u=a.axis==="x"?o:l,h=[];let f,m,g,_;for(f=i,m=i+s;f<m;++f)_=e[f],g={},g[r.axis]=r.parse(_n(_,c),f),h.push(xu(_n(_,u),g,a,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),a=r._custom,o=Ja(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}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:a,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.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||it(g[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),v=(g._stacks||{})[o.axis],S={horizontal:c,base:_.base,enableBorderRadius:!v||Ja(g._custom)||a===v._top||a===v._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&&(S.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const k=S.options||t[m].options;Up(S,k,v,a),Xp(S,k,u.ratio),this.updateElement(t[m],m,S,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(e),l=o&&o[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(it(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||a.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_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[st(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,a;for(r=0,a=e.data.length;r<a;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||Hp(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:a}}=this,o=r||0,l=this.getParsed(t),c=l._custom,u=Ja(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=!it(r)&&!u?r:f;let v=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(f+m):g=v,_=g-v,Math.abs(_)<a){_=$p(_,e,o)*a,h===o&&(v-=_/2);const S=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),C=Math.min(S,k),A=Math.max(S,k);v=Math.max(Math.min(v,A),C),g=v+_,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(v))}if(v===e.getPixelForValue(o)){const S=We(_)*e.getLineWidthForValue(o)/2;v+=S,_-=S}return{size:_,base:v,head:g,center:g+_/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,a=st(s.maxBarThickness,1/0);let o,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?Yp(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(st(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+m;o=h.start+h.chunk*g+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,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)}}P(is,"id","bar"),P(is,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(is,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class pr extends Ne{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=st(o[2],this.resolveDataElementOptions(a+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=st(o&&o.r&&+o.r,this.resolveDataElementOptions(a+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,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+o+", "+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:a,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=a.axis,h=o.axis;for(let f=e;f<e+i;f++){const m=t[f],g=!r&&this.getParsed(f),_={},x=_[u]=r?a.getPixelForDecimal(.5):a.getPixelForValue(g[u]),v=_[h]=r?o.getBasePixel():o.getPixelForValue(g[h]);_.skip=isNaN(x)||isNaN(v),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+=st(i&&i._custom,r),s}}P(pr,"id","bubble"),P(pr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(pr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Gp(n,t,e){let i=1,s=1,r=0,a=0;if(t<Ct){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),h=Math.cos(l),f=Math.sin(l),m=(k,C,A)=>Gi(k,o,l,!0)?1:Math.max(C,C*e,A,A*e),g=(k,C,A)=>Gi(k,o,l,!0)?-1:Math.min(C,C*e,A,A*e),_=m(0,c,h),x=m(Ot,u,f),v=g(ut,c,h),S=g(ut+Ot,u,f);i=(_-v)/2,s=(x-S)/2,r=-(_+v)/2,a=-(x+S)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:a}}class nn extends Ne{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(ft(i[t])){const{key:l="value"}=this._parsing;r=c=>+_n(i[c],l)}let a,o;for(a=t,o=t+e;a<o;++a)s._parsed[a]=r(a)}}_getRotation(){return Vt(this.options.rotation-90)}_getCircumference(){return Vt(this.options.circumference)}_getRotationExtents(){let t=Ct,e=-Ct;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(),a=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(lg(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:_}=Gp(h,u,l),x=(i.width-a)/f,v=(i.height-a)/m,S=Math.max(Math.min(x,v)/2,0),k=Dc(this.options.radius,S),C=Math.max(k*l,0),A=(k-C)/this._getVisibleDatasetWeightTotal();this.offsetX=g*k,this.offsetY=_*k,s.total=this.calculateTotal(),this.outerRadius=k-A*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-A*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/Ct)}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,o=a.chartArea,c=a.options.animation,u=(o.left+o.right)/2,h=(o.top+o.bottom)/2,f=r&&c.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:_,includeOptions:x}=this._getSharedOptions(e,s);let v=this._getRotation(),S;for(S=0;S<e;++S)v+=this._circumference(S,r);for(S=e;S<e+i;++S){const k=this._circumference(S,r),C=t[S],A={x:u+this.offsetX,y:h+this.offsetY,startAngle:v,endAngle:v+k,circumference:k,outerRadius:g,innerRadius:m};x&&(A.options=_||this.resolveDataElementOptions(S,C.active?"active":s)),v+=k,this.updateElement(C,S,A,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)?Ct*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Zi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,a,o,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=o.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(st(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(nn,"id","doughnut"),P(nn,"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"}),P(nn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(nn,"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,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ss extends Ne{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:o,count:l}=Bc(e,s,a);this._drawStart=o,this._drawCount=l,zc(e)&&(o=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:!a,options:c},t),this.updateElements(s,o,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),f=a.axis,m=o.axis,{spanGaps:g,segment:_}=this.options,x=wn(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",S=e+i,k=t.length;let C=e>0&&this.getParsed(e-1);for(let A=0;A<k;++A){const O=t[A],T=v?O:{};if(A<e||A>=S){T.skip=!0;continue}const p=this.getParsed(A),b=it(p[m]),M=T[f]=a.getPixelForValue(p[f],A),E=T[m]=r||b?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,p,l):p[m],A);T.skip=isNaN(M)||isNaN(E)||b,T.stop=A>0&&Math.abs(p[f]-C[f])>x,_&&(T.parsed=p,T.raw=c.data[A]),h&&(T.options=u||this.resolveDataElementOptions(A,O.active?"active":s)),v||this.updateElement(O,A,T,s),C=p}}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)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(ss,"id","line"),P(ss,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(ss,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class rs extends Ne{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=Zi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return tu.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),a=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),o=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*ut;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 v=m,S=m+this._computeAngle(g,s,_),k=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;m=S,r&&(l.animateScale&&(k=0),l.animateRotate&&(v=S=f));const C={x:u,y:h,innerRadius:0,outerRadius:k,startAngle:v,endAngle:S,options:this.resolveDataElementOptions(g,x.active?"active":s)};this.updateElement(x,g,C,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)?Vt(this.resolveDataElementOptions(t,e).angle||i):0}}P(rs,"id","polarArea"),P(rs,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(rs,"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,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}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 to extends nn{}P(to,"id","pie"),P(to,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class yr extends Ne{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 tu.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 a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===s.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,a=s==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":s),u=r.getPointPositionForValue(o,this.getParsed(o).r),h=a?r.xCenter:u.x,f=a?r.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,o,m,s)}}}P(yr,"id","radar"),P(yr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(yr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class br extends Ne{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:a}=Bc(e,i,s);if(this._drawStart=r,this._drawCount=a,zc(e)&&(r=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,a,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:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=a.axis,g=o.axis,{spanGaps:_,segment:x}=this.options,v=wn(_)?_:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||r||s==="none";let k=e>0&&this.getParsed(e-1);for(let C=e;C<e+i;++C){const A=t[C],O=this.getParsed(C),T=S?A:{},p=it(O[g]),b=T[m]=a.getPixelForValue(O[m],C),M=T[g]=r||p?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,O,l):O[g],C);T.skip=isNaN(b)||isNaN(M)||p,T.stop=C>0&&Math.abs(O[m]-k[m])>v,x&&(T.parsed=O,T.raw=c.data[C]),f&&(T.options=h||this.resolveDataElementOptions(C,A.active?"active":s)),S||this.updateElement(A,C,T,s),k=O}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,a)/2}}P(br,"id","scatter"),P(br,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(br,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Kp=Object.freeze({__proto__:null,BarController:is,BubbleController:pr,DoughnutController:nn,LineController:ss,PieController:to,PolarAreaController:rs,RadarController:yr,ScatterController:br});function jn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class eo{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(eo.prototype,t)}init(){}formats(){return jn()}parse(){return jn()}format(){return jn()}add(){return jn()}diff(){return jn()}startOf(){return jn()}endOf(){return jn()}}var Su={_date:eo};function Zp(n,t,e,i){const{controller:s,data:r,_sorted:a}=n,o=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(o&&t===o.axis&&t!=="r"&&a&&r.length){const c=o._reversePixels?xg:Je;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(_=>!it(_[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(_=>!it(_[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:r.length-1}}function as(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),a=e[t];for(let o=0,l=r.length;o<l;++o){const{index:c,data:u}=r[o],{lo:h,hi:f}=Zp(r[o],t,a,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,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function no(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||as(n,e,t,function(o,l,c){!s&&!tn(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&r.push({element:o,datasetIndex:l,index:c})},!0),r}function Jp(n,t,e,i){let s=[];function r(a,o,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:h}=or(a,{x:t.x,y:t.y});Gi(h,c,u)&&s.push({element:a,datasetIndex:o,index:l})}return as(n,e,t,r),s}function ty(n,t,e,i,s,r){let a=[];const o=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=o(t,g);x<l?(a=[{element:u,datasetIndex:h,index:f}],l=x):x===l&&a.push({element:u,datasetIndex:h,index:f})}return as(n,e,t,c),a}function io(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 ku(n,t,e,i,s){const r=[],a=e==="x"?"inXRange":"inYRange";let o=!1;return as(n,e,t,(l,c,u)=>{l[a]&&l[a](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,s))}),i&&!o?[]:r}var so={evaluateInteractionItems:as,modes:{index(n,t,e,i){const s=Sn(t,n),r=e.axis||"x",a=e.includeInvisible||!1,o=e.intersect?no(n,s,r,i,a):io(n,s,r,!1,i,a),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[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=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;let o=e.intersect?no(n,s,r,i,a):io(n,s,r,!1,i,a);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return no(n,s,r,i,a)},nearest(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return io(n,s,r,e.intersect,i,a)},x(n,t,e,i){const s=Sn(t,n);return ku(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Sn(t,n);return ku(n,s,"y",e.intersect,i)}}};const Du=["left","top","right","bottom"];function os(n,t){return n.filter(e=>e.pos===t)}function Tu(n,t){return n.filter(e=>Du.indexOf(e.pos)===-1&&e.box.axis===t)}function ls(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,a,o;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:a,stackWeight:o=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&r+a,stackWeight:o});return t}function ny(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Du.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return t}function iy(n,t){const e=ny(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,a,o;for(r=0,a=n.length;r<a;++r){o=n[r];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=s):(o.width=i,o.height=u?u*s:l&&t.availableHeight)}return e}function sy(n){const t=ey(n),e=ls(t.filter(c=>c.box.fullSize),!0),i=ls(os(t,"left"),!0),s=ls(os(t,"right")),r=ls(os(t,"top"),!0),a=ls(os(t,"bottom")),o=Tu(t,"x"),l=Tu(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(a).concat(o),chartArea:os(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(a).concat(o)}}function Cu(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Eu(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,a=n.maxPadding;if(!ft(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&&Eu(a,r.getPadding());const o=Math.max(0,t.outerWidth-Cu(a,n,"left","right")),l=Math.max(0,t.outerHeight-Cu(a,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function ay(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 oy(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return i(n?["left","right"]:["top","bottom"])}function cs(n,t,e,i){const s=[];let r,a,o,l,c,u;for(r=0,a=n.length,c=0;r<a;++r){o=n[r],l=o.box,l.update(o.width||t.w,o.height||t.h,oy(o.horizontal,t));const{same:h,other:f}=ry(t,e,o,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(o)}return c&&cs(s,t,e,i)||u}function _r(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 Ou(n,t,e,i){const s=e.padding;let{x:r,y:a}=t;for(const o of n){const l=o.box,c=i[o.stack]||{placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const h=t.w*u,f=c.size||l.height;ge(c.start)&&(a=c.start),l.fullSize?_r(l,s.left,a,e.outerWidth-s.right-s.left,f):_r(l,t.left+c.placed,a,h,f),c.start=a,c.placed+=h,a=l.bottom}else{const h=t.h*u,f=c.size||l.width;ge(c.start)&&(r=c.start),l.fullSize?_r(l,r,s.top,f,e.outerHeight-s.bottom-s.top):_r(l,r,t.top+c.placed,f,h),c.start=r,c.placed+=h,r=l.right}}t.x=r,t.y=a}var re={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=$t(n.options.layout.padding),r=Math.max(t-s.width,0),a=Math.max(e-s.height,0),o=sy(n.boxes),l=o.vertical,c=o.horizontal;kt(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:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},s);Eu(f,$t(i));const m=Object.assign({maxPadding:f,w:r,h:a,x:s.left,y:s.top},s),g=iy(l.concat(c),h);cs(o.fullSize,m,h,g),cs(l,m,h,g),cs(c,m,h,g)&&cs(l,m,h,g),ay(m),Ou(o.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Ou(o.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},kt(o.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 ly extends Pu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const xr="$chartjs",cy={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Au=n=>n===null||n==="";function uy(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[xr]={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",Au(s)){const r=iu(n,"width");r!==void 0&&(n.width=r)}if(Au(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=iu(n,"height");r!==void 0&&(n.height=r)}return n}const Ru=fp?{passive:!0}:!1;function dy(n,t,e){n&&n.addEventListener(t,e,Ru)}function hy(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Ru)}function fy(n,t){const e=cy[n.type]||n.type,{x:i,y:s}=Sn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function wr(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 a=!1;for(const o of r)a=a||wr(o.addedNodes,i),a=a&&!wr(o.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function gy(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||wr(o.removedNodes,i),a=a&&!wr(o.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const us=new Map;let Iu=0;function Lu(){const n=window.devicePixelRatio;n!==Iu&&(Iu=n,us.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function py(n,t){us.size||window.addEventListener("resize",Lu),us.set(n,t)}function yy(n){us.delete(n),us.size||window.removeEventListener("resize",Lu)}function by(n,t,e){const i=n.canvas,s=i&&Xa(i);if(!s)return;const r=Fc((o,l)=>{const c=s.clientWidth;e(o,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(s),py(n,r),a}function ro(n,t,e){e&&e.disconnect(),t==="resize"&&yy(n)}function _y(n,t,e){const i=n.canvas,s=Fc(r=>{n.ctx!==null&&e(fy(r,n))},n);return dy(i,t,s),s}class xy extends Pu{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[xr])return!1;const i=e[xr].initial;["height","width"].forEach(r=>{const a=i[r];it(a)?e.removeAttribute(r):e.setAttribute(r,a)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[xr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:my,detach:gy,resize:by}[e]||_y;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:ro,detach:ro,resize:ro}[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&&Xa(t);return!!(e&&e.isConnected)}}function wy(n){return!qa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?ly:xy}class Zt{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return wn(this.x)&&wn(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}}P(Zt,"defaults",{}),P(Zt,"defaultRoutes");function vy(n,t){const e=n.options.ticks,i=My(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?ky(t):[],a=r.length,o=r[0],l=r[a-1],c=[];if(a>s)return Dy(t,c,r,a/s),c;const u=Sy(r,t,s);if(a>0){let h,f;const m=a>1?Math.round((l-o)/(a-1)):null;for(vr(t,c,u,it(m)?0:o-m,o),h=0,f=a-1;h<f;h++)vr(t,c,u,r[h],r[h+1]);return vr(t,c,u,l,it(m)?t.length:l+m),c}return vr(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 Sy(n,t,e){const i=Ty(n),s=t.length/e;if(!i)return Math.max(s,1);const r=gg(i);for(let a=0,o=r.length-1;a<o;a++){const l=r[a];if(l>s)return l}return Math.max(s,1)}function ky(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],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===r&&(t.push(n[a]),s++,r=e[s*i])}function vr(n,t,e,i,s){const r=st(i,0),a=Math.min(st(s,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)o++,u=Math.round(r+o*e);for(c=Math.max(r,0);c<a;c++)c===u&&(t.push(n[c]),o++,u=Math.round(r+o*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,Nu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Fu=(n,t)=>Math.min(t||n,n);function Bu(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,a=n._endPixel,o=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-o||l>a+o)))return l}function Oy(n,t){kt(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 ds(n){return n.drawTicks?n.tickLength:0}function zu(n,t){if(!n.display)return 0;const e=Rt(n.font,t),i=$t(n.padding);return(wt(n.text)?n.text.length:1)*e.lineHeight+i.height}function Py(n,t){return Mn(n,{scale:t,type:"scale"})}function Ay(n,t,e){return Mn(n,{tick:e,index:t,type:"tick"})}function Ry(n,t,e){let i=Fa(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Cy(i)),i}function Iy(n,t,e,i){const{top:s,left:r,bottom:a,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let h=0,f,m,g;const _=a-s,x=o-r;if(n.isHorizontal()){if(m=se(i,r,o),ft(e)){const v=Object.keys(e)[0],S=e[v];g=u[v].getPixelForValue(S)+_-t}else e==="center"?g=(c.bottom+c.top)/2+_-t:g=Nu(n,e,t);f=o-r}else{if(ft(e)){const v=Object.keys(e)[0],S=e[v];m=u[v].getPixelForValue(S)-x+t}else e==="center"?m=(c.left+c.right)/2-x+t:m=Nu(n,e,t);g=se(i,a,s),h=e==="left"?-Ot:Ot}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class Un extends Zt{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=De(t,Number.POSITIVE_INFINITY),e=De(e,Number.NEGATIVE_INFINITY),i=De(i,Number.POSITIVE_INFINITY),s=De(s,Number.NEGATIVE_INFINITY),{min:De(t,i),max:De(e,s),minDefined:At(t),maxDefined:At(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),a;if(s&&r)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)a=o[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),r||(i=Math.max(i,a.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:De(e,De(i,e)),max:De(i,De(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:a}=this.options,o=a.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=$g(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Bu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.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=Fu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let a=s,o,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=Kt(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:m/(i-1),h+6>o&&(o=m/(i-(t.offset?.5:1)),l=this.maxHeight-ds(t.grid)-e.padding-zu(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=ar(Math.min(Math.asin(Kt((u.highest.height+6)/o,-1,1)),Math.asin(Kt(l/c,-1,1))-Math.asin(Kt(f/c,-1,1)))),a=Math.max(s,Math.min(r,a))),this.labelRotation=a}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,a=this._isVisible(),o=this.isHorizontal();if(a){const l=zu(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=ds(r)+l):(t.height=this.maxHeight,t.width=ds(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,g=Vt(this.labelRotation),_=Math.cos(g),x=Math.sin(g);if(o){const v=i.mirror?0:x*h.width+_*f.height;t.height=Math.min(this.maxHeight,t.height+v+m)}else{const v=i.mirror?0:_*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+v+m)}this._calculatePadding(c,u,x,_)}}this._handleMargins(),o?(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:a},position:o}=this.options,l=this.labelRotation!==0,c=o!=="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+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+a)*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+a,this.paddingBottom=h+a}}_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++)it(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=Bu(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,a=[],o=[],l=Math.floor(e/Fu(e,i));let c=0,u=0,h,f,m,g,_,x,v,S,k,C,A;for(h=0;h<e;h+=l){if(g=t[h].label,_=this._resolveTickFontOptions(h),s.font=x=_.string,v=r[x]=r[x]||{data:{},gc:[]},S=_.lineHeight,k=C=0,!it(g)&&!wt(g))k=ur(s,v.data,v.gc,k,g),C=S;else if(wt(g))for(f=0,m=g.length;f<m;++f)A=g[f],!it(A)&&!wt(A)&&(k=ur(s,v.data,v.gc,k,A),C+=S);a.push(k),o.push(C),c=Math.max(k,c),u=Math.max(C,u)}Oy(r,e);const O=a.indexOf(c),T=o.indexOf(u),p=b=>({width:a[b]||0,height:o[b]||0});return{first:p(0),last:p(e-1),widest:p(O),highest:p(T),widths:a,heights:o}}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?Wn(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=Py(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Vt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,o=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*i>o*s?o/i:l/s:l*s<o*i?l/i:o/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:a,border:o}=s,l=r.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=ds(r),m=[],g=o.setContext(this.getContext()),_=g.display?g.width:0,x=_/2,v=function(J){return Wn(i,J,_)};let S,k,C,A,O,T,p,b,M,E,R,I;if(a==="top")S=v(this.bottom),T=this.bottom-f,b=S-x,E=v(t.top)+x,I=t.bottom;else if(a==="bottom")S=v(this.top),E=t.top,I=v(t.bottom)-x,T=S+x,b=this.top+f;else if(a==="left")S=v(this.right),O=this.right-f,p=S-x,M=v(t.left)+x,R=t.right;else if(a==="right")S=v(this.left),M=t.left,R=v(t.right)-x,O=S+x,p=this.left+f;else if(e==="x"){if(a==="center")S=v((t.top+t.bottom)/2+.5);else if(ft(a)){const J=Object.keys(a)[0],$=a[J];S=v(this.chart.scales[J].getPixelForValue($))}E=t.top,I=t.bottom,T=S+x,b=T+f}else if(e==="y"){if(a==="center")S=v((t.left+t.right)/2);else if(ft(a)){const J=Object.keys(a)[0],$=a[J];S=v(this.chart.scales[J].getPixelForValue($))}O=S-x,p=O-f,M=t.left,R=t.right}const B=st(s.ticks.maxTicksLimit,h),U=Math.max(1,Math.ceil(h/B));for(k=0;k<h;k+=U){const J=this.getContext(k),$=r.setContext(J),lt=o.setContext(J),q=$.lineWidth,K=$.color,z=lt.dash||[],j=lt.dashOffset,Y=$.tickWidth,yt=$.tickColor,_t=$.tickBorderDash||[],V=$.tickBorderDashOffset;C=Ey(this,k,l),C!==void 0&&(A=Wn(i,C,q),c?O=p=M=R=A:T=b=E=I=A,m.push({tx1:O,ty1:T,tx2:p,ty2:b,x1:M,y1:E,x2:R,y2:I,width:q,color:K,borderDash:z,borderDashOffset:j,tickWidth:Y,tickColor:yt,tickBorderDash:_t,tickBorderDashOffset:V}))}return this._ticksLength=h,this._borderValue=S,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,a=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=r,f=ds(i.grid),m=f+u,g=h?-u:m,_=-Vt(this.labelRotation),x=[];let v,S,k,C,A,O,T,p,b,M,E,R,I="middle";if(s==="top")O=this.bottom-g,T=this._getXAxisLabelAlignment();else if(s==="bottom")O=this.top+g,T=this._getXAxisLabelAlignment();else if(s==="left"){const U=this._getYAxisLabelAlignment(f);T=U.textAlign,A=U.x}else if(s==="right"){const U=this._getYAxisLabelAlignment(f);T=U.textAlign,A=U.x}else if(e==="x"){if(s==="center")O=(t.top+t.bottom)/2+m;else if(ft(s)){const U=Object.keys(s)[0],J=s[U];O=this.chart.scales[U].getPixelForValue(J)+m}T=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")A=(t.left+t.right)/2-m;else if(ft(s)){const U=Object.keys(s)[0],J=s[U];A=this.chart.scales[U].getPixelForValue(J)}T=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?I="top":l==="end"&&(I="bottom"));const B=this._getLabelSizes();for(v=0,S=o.length;v<S;++v){k=o[v],C=k.label;const U=r.setContext(this.getContext(v));p=this.getPixelForTick(v)+r.labelOffset,b=this._resolveTickFontOptions(v),M=b.lineHeight,E=wt(C)?C.length:1;const J=E/2,$=U.color,lt=U.textStrokeColor,q=U.textStrokeWidth;let K=T;a?(A=p,T==="inner"&&(v===S-1?K=this.options.reverse?"left":"right":v===0?K=this.options.reverse?"right":"left":K="center"),s==="top"?c==="near"||_!==0?R=-E*M+M/2:c==="center"?R=-B.highest.height/2-J*M+M:R=-B.highest.height+M/2:c==="near"||_!==0?R=M/2:c==="center"?R=B.highest.height/2-J*M:R=B.highest.height-E*M,h&&(R*=-1),_!==0&&!U.showLabelBackdrop&&(A+=M/2*Math.sin(_))):(O=p,R=(1-E)*M/2);let z;if(U.showLabelBackdrop){const j=$t(U.backdropPadding),Y=B.heights[v],yt=B.widths[v];let _t=R-j.top,V=0-j.left;switch(I){case"middle":_t-=Y/2;break;case"bottom":_t-=Y;break}switch(T){case"center":V-=yt/2;break;case"right":V-=yt;break;case"inner":v===S-1?V-=yt:v>0&&(V-=yt/2);break}z={left:V,top:_t,width:yt+j.width,height:Y+j.height,color:U.backdropColor}}x.push({label:C,font:b,textOffset:R,options:{rotation:_,color:$,strokeColor:lt,strokeWidth:q,textAlign:K,textBaseline:I,translation:[A,O],backdrop:z}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Vt(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,a=this._getLabelSizes(),o=t+r,l=a.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-o,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+o,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:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,a),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,a;const o=(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,a=s.length;r<a;++r){const l=s[r];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({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()),a=i.display?r.width:0;if(!a)return;const o=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Wn(t,this.left,a)-a/2,u=Wn(t,this.right,o)+o/2,h=f=l):(h=Wn(t,this.top,a)-a/2,f=Wn(t,this.bottom,o)+o/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&&Ji(i,s);const r=this.getLabelItems(t);for(const a of r){const o=a.options,l=a.font,c=a.label,u=a.textOffset;Yn(i,c,0,u,l,o)}s&&ts(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=Rt(i.font),a=$t(i.padding),o=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ft(e)?(l+=a.bottom,wt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=Iy(this,l,e,o);Yn(t,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:f,textAlign:Ry(o,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=st(t.grid&&t.grid.z,-1),s=st(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Un.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,a;for(r=0,a=e.length;r<a;++r){const o=e[r];o[i]===this.id&&(!t||o.type===t)&&s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Rt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Mr{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,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Ly(t,a,i),this.override&&Pt.override(t.id,t.overrides)),a}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 Pt[s]&&(delete Pt[s][i],this.override&&delete Hn[i])}}function Ly(n,t,e){const i=Ui(Object.create(null),[e?Pt.get(e):{},Pt.get(t),n.defaults]);Pt.set(t,i),n.defaultRoutes&&Ny(t,n.defaultRoutes),n.descriptors&&Pt.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("."),a=t[e].split("."),o=a.pop(),l=a.join(".");Pt.route(r,s,l,o)})}function Fy(n){return"id"in n&&"defaults"in n}class By{constructor(){this.controllers=new Mr(Ne,"datasets",!0),this.elements=new Mr(Zt,"elements"),this.plugins=new Mr(Object,"plugins"),this.scales=new Mr(Un,"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):kt(s,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,e,i){const s=Ia(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 Ye=new By;class zy{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),a=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const r of t){const a=r.plugin,o=a[i],l=[e,s,r.options];if(St(o,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){it(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=st(i.options&&i.options.plugins,{}),r=Hy(i);return s===!1&&!e?[]:Yy(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,a)=>r.filter(o=>!a.some(l=>o.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(Ye.plugins.items);for(let r=0;r<i.length;r++)e.push(Ye.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const a=s[r];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Wy(n,t){return!t&&n===!1?null:n===!0?{}:n}function Yy(n,{plugins:t,localIds:e},i,s){const r=[],a=n.getContext();for(const o of t){const l=o.id,c=Wy(i[l],s);c!==null&&r.push({plugin:o,options:Vy(n.config,{plugin:o,local:e[l]},c,a)})}return r}function Vy(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),a=n.getOptionScopes(i,r);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ao(n,t){const e=Pt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function $y(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function jy(n,t){return n===t?"_index_":"_value_"}function Hu(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 oo(n,...t){if(Hu(n))return n;for(const e of t){const i=e.axis||Uy(e.position)||n.length>1&&Hu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Wu(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 Wu(n,"x",e[0])||Wu(n,"y",e[0])}return{}}function Xy(n,t){const e=Hn[n.type]||{scales:{}},i=t.scales||{},s=ao(n.type,t),r=Object.create(null);return Object.keys(i).forEach(a=>{const o=i[a];if(!ft(o))return console.error(`Invalid scale configuration for scale: ${a}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=oo(a,o,qy(a,n),Pt.scales[o.type]),c=jy(l,s),u=e.scales||{};r[a]=qi(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(a=>{const o=a.type||n.type,l=a.indexAxis||ao(o,t),u=(Hn[o]||{}).scales||{};Object.keys(u).forEach(h=>{const f=$y(h,l),m=a[f+"AxisID"]||f;r[m]=r[m]||Object.create(null),qi(r[m],[{axis:f},i[m],u[h]])})}),Object.keys(r).forEach(a=>{const o=r[a];qi(o,[Pt.scales[o.type],Pt.scale])}),r}function Yu(n){const t=n.options||(n.options={});t.plugins=st(t.plugins,{}),t.scales=Xy(n,t)}function Vu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Gy(n){return n=n||{},n.data=Vu(n.data),Yu(n),n}const $u=new Map,ju=new Set;function Sr(n,t){let e=$u.get(n);return e||(e=t(),$u.set(n,e),ju.add(e)),e}const hs=(n,t,e)=>{const i=_n(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=Vu(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(),Yu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Sr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Sr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Sr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Sr(`${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,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>hs(l,t,h))),u.forEach(h=>hs(l,s,h)),u.forEach(h=>hs(l,Hn[r]||{},h)),u.forEach(h=>hs(l,Pt,h)),u.forEach(h=>hs(l,Ha,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ju.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Hn[e]||{},Pt.datasets[e]||{},{type:e},Pt,Ha]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:a,subPrefixes:o}=Uu(this._resolverCache,t,s);let l=a;if(Qy(a,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,o);l=gi(a,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Uu(this._resolverCache,t,i);return ft(e)?gi(r,e,void 0,s):r}}function Uu(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:$a(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(s,r)),r}const Zy=n=>ft(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function Qy(n,t){const{isScriptable:e,isIndexable:i}=Xc(n);for(const s of t){const r=e(s),a=i(s),o=(a||r)&&n[s];if(r&&(pe(o)||Zy(o))||a&&wt(o))return!0}return!1}var Jy="4.5.0";const tb=["top","bottom","left","right","chartArea"];function qu(n,t){return n==="top"||n==="bottom"||tb.indexOf(n)===-1&&t==="x"}function Xu(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Gu(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 Ku(n){return qa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const kr={},Zu=n=>{const t=Ku(n);return Object.values(kr).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 a=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=a)}}}function ib(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let ye=(Rn=class{static register(...t){Ye.add(...t),Qu()}static unregister(...t){Ye.remove(...t),Qu()}constructor(t,e){const i=this.config=new Ky(e),s=Ku(t),r=Zu(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 a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||wy(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=og(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=a,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 zy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Mg(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],kr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}en.listen(this,"complete",Gu),en.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 it(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 Ye}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():nu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return jc(this.canvas,this.ctx),this}stop(){return en.stop(this),this}resize(t,e){en.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,a=this.platform.getMaximumSize(s,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,nu(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),St(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};kt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const o=e[a],l=oo(a,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),kt(r,a=>{const o=a.options,l=o.id,c=oo(l,o),u=st(o.type,a.dtype);(o.position===void 0||qu(o.position,c)!==qu(a.dposition))&&(o.position=a.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ye.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(o,t)}),kt(s,(a,o)=>{a||delete i[o]}),kt(i,a=>{re.configure(this,a,a.options),re.addBox(this,a)})}_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(Xu("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 a=this.getDatasetMeta(i);const o=r.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=r.indexAxis||ao(o,this.options),a.order=r.order||0,a.index=i,a.label=""+r.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=Ye.getController(o),{datasetElementType:c,dataElementType:u}=Pt.datasets[o];Object.assign(l,{dataElementType:Ye.getElement(u),datasetElementType:c&&Ye.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){kt(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 a=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),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||kt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Xu("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){kt(this.scales,t=>{re.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ec(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 a=i==="_removeElements"?-r:r;nb(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(a=>a[0]===r).map((a,o)=>o+","+a.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Ec(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;re.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],kt(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,pe(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&&(en.has(this)?this.attached&&!en.running(this)&&en.start(this):(this.draw(),Gu({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 a=e[s];(!t||a.visible)&&i.push(a)}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=hu(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Ji(e,s),t.controller.draw(),s&&ts(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return tn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=so.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=Mn(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),a=r.controller._resolveAnimations(void 0,s);ge(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(o=>o.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(),en.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(),jc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete kr[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,a)=>{e.addEventListener(this,r,a),t[r]=a},s=(r,a,o)=>{r.offsetX=a,r.offsetY=o,this._eventHandler(r)};kt(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 a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",a)};a=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){kt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},kt(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,a,o,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){a=t[o];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:a})=>{const o=this.getDatasetMeta(r);if(!o)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:o.data[a],index:a}});!nr(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)),a=r(e,t),o=i?t:r(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.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,a=e,o=this._getActiveElements(t,s,i,a),l=fg(t),c=ib(t,this._lastEvent,i,l);i&&(this._lastEvent=null,St(r.onHover,[t,o,this],this),l&&St(r.onClick,[t,o,this],this));const u=!nr(o,s);return(u||e)&&(this._active=o,this._updateHoverStyles(o,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)}},P(Rn,"defaults",Pt),P(Rn,"instances",kr),P(Rn,"overrides",Hn),P(Rn,"registry",Ye),P(Rn,"version",Jy),P(Rn,"getChart",Zu),Rn);function Qu(){return kt(ye.instances,n=>n._plugins.invalidate())}function sb(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:a,innerRadius:o,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/a,ie(i-e));if(n.beginPath(),n.arc(s,r,a-c/2,i+h/2,e-h/2),o>0){const f=Math.min(c/o,ie(i-e));n.arc(s,r,o+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*ie(i-e));if(u==="round")n.arc(s,r,f,e-ut/2,i+ut/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(e+ut/2)+s,_=-m*Math.sin(e+ut/2)+r,x=m*Math.cos(i+ut/2)+s,v=m*Math.sin(i+ut/2)+r;n.lineTo(g,_),n.lineTo(x,v)}}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:a,outerRadius:o,innerRadius:l}=t;let c=s/o;n.beginPath(),n.arc(r,a,o,i-c,e+c),l>s?(c=s/l,n.arc(r,a,l,e+c,i-c,!0)):n.arc(r,a,s,e+Ot,i-Ot),n.closePath(),n.clip()}function ab(n){return Va(n,["outerStart","outerEnd","innerStart","innerEnd"])}function ob(n,t,e,i){const s=ab(n.options.borderRadius),r=(e-t)/2,a=Math.min(r,i*t/2),o=l=>{const c=(e-Math.min(r,l))*i/2;return Kt(l,0,Math.min(r,c))};return{outerStart:o(s.outerStart),outerEnd:o(s.outerEnd),innerStart:Kt(s.innerStart,0,a),innerEnd:Kt(s.innerEnd,0,a)}}function bi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Dr(n,t,e,i,s,r){const{x:a,y:o,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,J=h>0?h-i:0,$=(U+J)/2,lt=$!==0?g*$/($+i):g;m=(g-lt)/2}const _=Math.max(.001,g*h-e/ut)/h,x=(g-_)/2,v=l+x+m,S=s-x-m,{outerStart:k,outerEnd:C,innerStart:A,innerEnd:O}=ob(t,f,h,S-v),T=h-k,p=h-C,b=v+k/T,M=S-C/p,E=f+A,R=f+O,I=v+A/E,B=S-O/R;if(n.beginPath(),r){const U=(b+M)/2;if(n.arc(a,o,h,b,U),n.arc(a,o,h,U,M),C>0){const q=bi(p,M,a,o);n.arc(q.x,q.y,C,M,S+Ot)}const J=bi(R,S,a,o);if(n.lineTo(J.x,J.y),O>0){const q=bi(R,B,a,o);n.arc(q.x,q.y,O,S+Ot,B+Math.PI)}const $=(S-O/f+(v+A/f))/2;if(n.arc(a,o,f,S-O/f,$,!0),n.arc(a,o,f,$,v+A/f,!0),A>0){const q=bi(E,I,a,o);n.arc(q.x,q.y,A,I+Math.PI,v-Ot)}const lt=bi(T,v,a,o);if(n.lineTo(lt.x,lt.y),k>0){const q=bi(T,b,a,o);n.arc(q.x,q.y,k,v-Ot,b)}}else{n.moveTo(a,o);const U=Math.cos(b)*h+a,J=Math.sin(b)*h+o;n.lineTo(U,J);const $=Math.cos(M)*h+a,lt=Math.sin(M)*h+o;n.lineTo($,lt)}n.closePath()}function lb(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o}=t;let l=t.endAngle;if(r){Dr(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(o)||(l=a+(o%Ct||Ct))}return Dr(n,t,e,i,l,s),n.fill(),l}function cb(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o,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){Dr(n,t,e,i,_,s);for(let x=0;x<r;++x)n.stroke();isNaN(o)||(_=a+(o%Ct||Ct))}g&&rb(n,t,_),l.selfJoin&&_-a>=ut&&m===0&&u!=="miter"&&sb(n,t,_),r||(Dr(n,t,e,i,_,s),n.stroke())}class fs extends Zt{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(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:a,distance:o}=or(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=st(f,c-l),_=Gi(a,l,c)&&l!==c,x=g>=Ct||_,v=Qe(o,u+m,h+m);return x&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:a,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,h=(r+a)/2,f=(o+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,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ct?Math.floor(s/Ct):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(ut,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,lb(e,this,u,a,o),cb(e,this,u,a,o),e.restore()}}P(fs,"id","arc"),P(fs,"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}),P(fs,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(fs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Ju(n,t,e=t){n.lineCap=st(e.borderCapStyle,t.borderCapStyle),n.setLineDash(st(e.borderDash,t.borderDash)),n.lineDashOffset=st(e.borderDashOffset,t.borderDashOffset),n.lineJoin=st(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=st(e.borderWidth,t.borderWidth),n.strokeStyle=st(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 td(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:a,end:o}=t,l=Math.max(s,a),c=Math.min(r,o),u=s<a&&r<a||s>o&&r>o;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:a,start:o,loop:l,ilen:c}=td(s,e,i),u=db(r);let{move:h=!0,reverse:f}=i||{},m,g,_;for(m=0;m<=c;++m)g=s[(o+(f?c-m:m))%a],!g.skip&&(h?(n.moveTo(g.x,g.y),h=!1):u(n,_,g,f,r.stepped),_=g);return l&&(g=s[(o+(f?c:0))%a],u(n,_,g,f,r.stepped)),!!l}function fb(n,t,e,i){const s=t.points,{count:r,start:a,ilen:o}=td(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,g,_,x,v;const S=C=>(a+(c?o-C:C))%r,k=()=>{_!==x&&(n.lineTo(u,x),n.lineTo(u,_),n.lineTo(u,v))};for(l&&(m=s[S(0)],n.moveTo(m.x,m.y)),f=0;f<=o;++f){if(m=s[S(f)],m.skip)continue;const C=m.x,A=m.y,O=C|0;O===g?(A<_?_=A:A>x&&(x=A),u=(h*u+C)/++h):(k(),n.lineTo(C,A),g=O,h=0,_=x=A),v=A}k()}function lo(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:$n}function gb(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Ju(n,t.options),n.stroke(s)}function pb(n,t,e,i){const{segments:s,options:r}=t,a=lo(t);for(const o of s)Ju(n,r,o.style),n.beginPath(),a(n,t,o,{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 kn extends Zt{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;ap(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,a=cu(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],l=mb(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:h,end:f}=a[c],m=r[h],g=r[f];if(m===g){o.push(m);continue}const _=Math.abs((s-m[e])/(g[e]-m[e])),x=l(m,g,_,i.stepped);x[e]=t[e],o.push(x)}return o.length===1?o[0]:o}pathSegment(t,e,i){return lo(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=lo(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=r(t,this,o,{start:e,end:e+i-1});return!!a}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)}}P(kn,"id","line"),P(kn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(kn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(kn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ed(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class Tr extends Zt{constructor(e){super();P(this,"parsed");P(this,"skip");P(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:a,y:o}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return ed(this,e,"x",i)}inYRange(e,i){return ed(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||!tn(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Ya(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(Tr,"id","point"),P(Tr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(Tr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function nd(n,t){const{x:e,y:i,base:s,width:r,height:a}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,h;return n.horizontal?(h=a/2,o=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=r/2,o=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:o,top:c,right:l,bottom:u}}function Dn(n,t,e,i){return n?0:Kt(t,e,i)}function _b(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=qc(i);return{t:Dn(s.top,r.top,0,e),r:Dn(s.right,r.right,0,t),b:Dn(s.bottom,r.bottom,0,e),l:Dn(s.left,r.left,0,t)}}function xb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=vn(s),a=Math.min(t,e),o=n.borderSkipped,l=i||ft(s);return{topLeft:Dn(!l||o.top||o.left,r.topLeft,0,a),topRight:Dn(!l||o.top||o.right,r.topRight,0,a),bottomLeft:Dn(!l||o.bottom||o.left,r.bottomLeft,0,a),bottomRight:Dn(!l||o.bottom||o.right,r.bottomRight,0,a)}}function wb(n){const t=nd(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 co(n,t,e,i){const s=t===null,r=e===null,o=n&&!(s&&r)&&nd(n,i);return o&&(s||Qe(t,o.left,o.right))&&(r||Qe(e,o.top,o.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 uo(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,a=(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+a,radius:n.radius}}class Cr extends Zt{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:a}=wb(this),o=vb(a.radius)?mi:Mb;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),o(t,uo(a,e,r)),t.clip(),o(t,uo(r,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,uo(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return co(this,t,e,i)}inXRange(t,e){return co(this,t,null,e)}inYRange(t,e){return co(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}}P(Cr,"id","bar"),P(Cr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(Cr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Sb=Object.freeze({__proto__:null,ArcElement:fs,BarElement:Cr,LineElement:kn,PointElement:Tr});const ho=["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)"],id=ho.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function sd(n){return ho[n%ho.length]}function rd(n){return id[n%id.length]}function kb(n,t){return n.borderColor=sd(t),n.backgroundColor=rd(t),++t}function Db(n,t){return n.backgroundColor=n.data.map(()=>sd(t++)),t}function Tb(n,t){return n.backgroundColor=n.data.map(()=>rd(t++)),t}function Cb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof nn?t=Db(e,t):s instanceof rs?t=Tb(e,t):s&&(t=kb(e,t))}}function ad(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 Ob(){return Pt.borderColor!=="rgba(0,0,0,0.1)"||Pt.backgroundColor!=="rgba(0,0,0,0.1)"}var Pb={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,a=ad(i)||Eb(s)||r&&ad(r)||Ob();if(!e.forceOverride&&a)return;const o=Cb(n);i.forEach(o)}};function Ab(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const a=[],o=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,h,f,m,g,_;for(a[l++]=n[u],h=0;h<r-2;h++){let x=0,v=0,S;const k=Math.floor((h+1)*o)+1+t,C=Math.min(Math.floor((h+2)*o)+1,e)+t,A=C-k;for(S=k;S<C;S++)x+=n[S].x,v+=n[S].y;x/=A,v/=A;const O=Math.floor(h*o)+1+t,T=Math.min(Math.floor((h+1)*o)+1,e)+t,{x:p,y:b}=n[u];for(m=g=-1,S=O;S<T;S++)g=.5*Math.abs((p-x)*(n[S].y-b)-(p-n[S].x)*(v-b)),g>m&&(m=g,f=n[S],_=S);a[l++]=f,u=_}return a[l++]=n[c],a}function Rb(n,t,e,i){let s=0,r=0,a,o,l,c,u,h,f,m,g,_;const x=[],v=t+e-1,S=n[t].x,C=n[v].x-S;for(a=t;a<t+e;++a){o=n[a],l=(o.x-S)/C*i,c=o.y;const A=l|0;if(A===u)c<g?(g=c,h=a):c>_&&(_=c,f=a),s=(r*s+o.x)/++r;else{const O=a-1;if(!it(h)&&!it(f)){const T=Math.min(h,f),p=Math.max(h,f);T!==m&&T!==O&&x.push({...n[T],x:s}),p!==m&&p!==O&&x.push({...n[p],x:s})}a>0&&O!==m&&x.push(n[O]),x.push(o),u=A,r=0,g=_=c,h=f=m=a}}return x}function od(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 ld(n){n.data.datasets.forEach(t=>{od(t)})}function Ib(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:a,max:o,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Kt(Je(t,r.axis,a).lo,0,e-1)),c?s=Kt(Je(t,r.axis,o).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){ld(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:a,indexAxis:o}=s,l=n.getDatasetMeta(r),c=a||s.data;if(es([o,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){od(s);return}it(a)&&(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=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){ld(n)}};function Nb(n,t,e){const i=n.segments,s=n.points,r=t.points,a=[];for(const o of i){let{start:l,end:c}=o;c=Er(l,c,s);const u=fo(e,s[l],s[c],o.loop);if(!t.segments){a.push({source:o,target:u,start:s[l],end:s[c]});continue}const h=cu(t,u);for(const f of h){const m=fo(e,r[f.start],r[f.end],f.loop),g=lu(o,s,m);for(const _ of g)a.push({source:_,target:f,start:{[e]:cd(u,m,"start",Math.max)},end:{[e]:cd(u,m,"end",Math.min)}})}}return a}function fo(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=ie(s),r=ie(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:a,end:o})=>{o=Er(a,o,s);const l=s[a],c=s[o];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 Er(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function cd(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function ud(n,t){let e=[],i=!1;return wt(n)?(i=!0,e=n):e=Fb(n,t),e.length?new kn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function dd(n){return n&&n.fill!==!1}function Bb(n,t,e){let s=n[t].fill;const r=[t];let a;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!At(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;r.push(s),s=a.fill}return!1}function zb(n,t,e){const i=Vb(n);if(ft(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return At(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:ft(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Yb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ft(n)?i=n.value:i=t.getBaseValue(),i}function Vb(n){const t=n.options,e=t.fill;let i=st(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function $b(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,a=i.points,o=jb(t,e);o.push(ud({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,a[u],o)}return new kn({points:s,options:{}})}function jb(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:a,last:o,point:l}=qb(r,t,"x");if(!(!l||a&&o)){if(a)i.unshift(l);else if(n.push(l),!o)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,a=n.points;let o=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],h=a[u.start][e],f=a[u.end][e];if(Qe(s,h,f)){o=s===h,l=s===f;break}}return{first:o,last:l,point:i}}class hd{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:a}=this;return e=e||{start:0,end:Ct},t.arc(s,r,a,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(At(e))return Gb(t,e);if(e==="stack")return $b(n);if(e==="shape")return!0;const s=Kb(n);return s instanceof hd?s:ud(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(At(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,a=Yb(e,t,r),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new hd({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)o.push(t.getPointPositionForValue(l,a));return o}function mo(n,t,e){const i=Xb(t),{chart:s,index:r,line:a,scale:o,axis:l}=t,c=a.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},g=s.getDatasetMeta(r),_=hu(s,g);i&&a.points.length&&(Ji(n,e),Jb(n,{line:a,target:i,above:f,below:m,area:e,scale:o,axis:l,clip:_}),ts(n))}function Jb(n,t){const{line:e,target:i,above:s,below:r,area:a,scale:o,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(fd(n,i,a.top),go(n,{line:e,target:i,color:s,scale:o,property:c,clip:l}),n.restore(),n.save(),fd(n,i,a.bottom)):c==="y"&&(md(n,i,a.left),go(n,{line:e,target:i,color:r,scale:o,property:c,clip:l}),n.restore(),n.save(),md(n,i,a.right),u=s)),go(n,{line:e,target:i,color:u,scale:o,property:c,clip:l}),n.restore()}function fd(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Er(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function md(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Er(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(e,h.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function go(n,t){const{line:e,target:i,property:s,color:r,scale:a,clip:o}=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,a,o,g&&fo(s,h,f)),n.beginPath();const _=!!e.pathSegment(n,c);let x;if(g){_?n.closePath():gd(n,i,f,s);const v=!!i.pathSegment(n,u,{move:_,reverse:!0});x=_&&v,x||gd(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:a,end:o}=i||{};if(r==="x"||r==="y"){let l,c,u,h;r==="x"?(l=a,c=s.top,u=o,h=s.bottom):(l=s.left,c=a,u=s.right,h=o),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 gd(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,a,o,l;for(a=0;a<i;++a)r=n.getDatasetMeta(a),o=r.dataset,l=null,o&&o.options&&o instanceof kn&&(l={visible:n.isDatasetVisible(a),index:a,fill:zb(o,a,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=Bb(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let a=s.length-1;a>=0;--a){const o=s[a].$filler;o&&(o.line.updateControlPoints(r,o.axis),i&&o.fill&&mo(n.ctx,o,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;dd(r)&&mo(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!dd(i)||e.drawTime!=="beforeDatasetDraw"||mo(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const pd=(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 yd extends Zt{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=Rt(i.font),r=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=pd(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,r,o,l)+10):(u=this.maxHeight,c=this._fitCols(a,s,o,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:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+o;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*o>a)&&(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+o}),h}_fitCols(t,e,i,s){const{ctx:r,maxHeight:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let h=o,f=0,m=0,g=0,_=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:S,itemHeight:k}=i0(i,e,r,x,s);v>0&&m+k+2*o>u&&(h+=f+o,c.push({width:f,height:m}),g+=f+o,_++,f=m=0),l[v]={left:g,top:m,col:_,width:S,height:k},f=Math.max(f,S),m+=k+o}),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,a=yi(r,this.left,this.width);if(this.isHorizontal()){let o=0,l=se(i,this.left+s,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=se(i,this.left+s,this.right-this.lineWidths[o])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let o=0,l=se(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=se(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.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;Ji(t,this),this._draw(),ts(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:a}=t,o=Pt.color,l=yi(t.rtl,this.left,this.width),c=Rt(a.font),{padding:u}=a,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}=pd(a,h),v=function(O,T,p){if(isNaN(g)||g<=0||isNaN(_)||_<0)return;s.save();const b=st(p.lineWidth,1);if(s.fillStyle=st(p.fillStyle,o),s.lineCap=st(p.lineCap,"butt"),s.lineDashOffset=st(p.lineDashOffset,0),s.lineJoin=st(p.lineJoin,"miter"),s.lineWidth=b,s.strokeStyle=st(p.strokeStyle,o),s.setLineDash(st(p.lineDash,[])),a.usePointStyle){const M={radius:_*Math.SQRT2/2,pointStyle:p.pointStyle,rotation:p.rotation,borderWidth:b},E=l.xPlus(O,g/2),R=T+f;Uc(s,M,E,R,a.pointStyleWidth&&g)}else{const M=T+Math.max((h-_)/2,0),E=l.leftForLtr(O,g),R=vn(p.borderRadius);s.beginPath(),Object.values(R).some(I=>I!==0)?mi(s,{x:E,y:M,w:g,h:_,radius:R}):s.rect(E,M,g,_),s.fill(),b!==0&&s.stroke()}s.restore()},S=function(O,T,p){Yn(s,p.text,O,T+x/2,c,{strikethrough:p.hidden,textAlign:l.textAlign(p.textAlign)})},k=this.isHorizontal(),C=this._computeTitleHeight();k?m={x:se(r,this.left+u,this.right-i[0]),y:this.top+u+C,line:0}:m={x:this.left+u,y:se(r,this.top+C+u,this.bottom-e[0].height),line:0},su(this.ctx,t.textDirection);const A=x+u;this.legendItems.forEach((O,T)=>{s.strokeStyle=O.fontColor,s.fillStyle=O.fontColor;const p=s.measureText(O.text).width,b=l.textAlign(O.textAlign||(O.textAlign=a.textAlign)),M=g+f+p;let E=m.x,R=m.y;l.setWidth(this.width),k?T>0&&E+M+u>this.right&&(R=m.y+=A,m.line++,E=m.x=se(r,this.left+u,this.right-i[m.line])):T>0&&R+A>this.bottom&&(E=m.x=E+e[m.line].width+u,m.line++,R=m.y=se(r,this.top+C+u,this.bottom-e[m.line].height));const I=l.x(E);if(v(I,R,O),E=Sg(b,E+g+f,k?E+M:this.right,t.rtl),S(l.x(E),R,O),k)m.x+=M+u;else if(typeof O.text!="string"){const B=c.lineHeight;m.y+=bd(O,B)+u}else m.y+=A}),ru(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Rt(e.font),s=$t(e.padding);if(!e.display)return;const r=yi(t.rtl,this.left,this.width),a=this.ctx,o=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=se(t.align,h,this.right-f);else{const g=this.columnSizes.reduce((_,x)=>Math.max(_,x.height),0);u=c+se(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=se(o,h,h+f);a.textAlign=r.textAlign(Fa(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Yn(a,e.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,e=Rt(t.font),i=$t(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Qe(t,this.left,this.right)&&Qe(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Qe(t,s.left,s.left+s.width)&&Qe(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!a0(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),a=r0(s,i,t.lineHeight);return{itemWidth:r,itemHeight:a}}function s0(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,a)=>r.length>a.length?r:a)),t+e.size/2+i.measureText(s).width}function r0(n,t,e){let i=n;return typeof t.text!="string"&&(i=bd(t,e)),i}function bd(n,t){const e=n.text?n.text.length:0;return t*e}function a0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var o0={id:"legend",_element:yd,start(n,t,e){const i=n.legend=new yd({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i)},stop(n){re.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;re.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:a,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=$t(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:a&&(o||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 po extends Zt{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=wt(i.text)?i.text.length:1;this._padding=$t(i.padding);const r=s*Rt(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:a}=this,o=a.align;let l=0,c,u,h;return this.isHorizontal()?(u=se(o,i,r),h=e+t,c=r-i):(a.position==="left"?(u=i+t,h=se(o,s,e),l=ut*-.5):(u=r-t,h=se(o,e,s),l=ut*.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=Rt(e.font),r=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(r);Yn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Fa(e.align),textBaseline:"middle",translation:[a,o]})}}function l0(n,t){const e=new po({ctx:n.ctx,options:t,chart:n});re.configure(n,e,t),re.addBox(n,e),n.titleBlock=e}var c0={id:"title",_element:po,start(n,t,e){l0(n,e)},stop(n){const t=n.titleBlock;re.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;re.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 Or=new WeakMap;var u0={id:"subtitle",start(n,t,e){const i=new po({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i),Or.set(n,i)},stop(n){re.removeBox(n,Or.get(n)),Or.delete(n)},beforeUpdate(n,t,e){const i=Or.get(n);re.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 ms={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 o=n[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((o,l)=>o+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,a,o;for(r=0,a=n.length;r<a;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=fi(t,c);u<s&&(s=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ve(n,t){return t&&(wt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function sn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
- `)>-1?n.split(`
18
- `):n}function d0(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function _d(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),u=Rt(t.footerFont),h=r.length,f=s.length,m=i.length,g=$t(t.padding);let _=g.height,x=0,v=i.reduce((C,A)=>C+A.before.length+A.lines.length+A.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,h&&(_+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),v){const C=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;_+=m*C+(v-m)*l.lineHeight+(v-1)*t.bodySpacing}f&&(_+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const k=function(C){x=Math.max(x,e.measureText(C).width+S)};return e.save(),e.font=c.string,kt(n.title,k),e.font=l.string,kt(n.beforeBody.concat(n.afterBody),k),S=t.displayColors?a+2+t.boxPadding:0,kt(i,C=>{kt(C.before,k),kt(C.lines,k),kt(C.after,k)}),S=0,e.font=u.string,kt(n.footer,k),e.restore(),x+=g.width,{width:x,height:_}}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,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function m0(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),f0(c,n,t,e)&&(c="center"),c}function xd(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 wd(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=vn(a);let g=g0(t,o);const _=p0(t,l,c);return l==="center"?o==="left"?g+=c:o==="right"&&(g-=c):o==="left"?g-=Math.max(u,f)+s:o==="right"&&(g+=Math.max(h,m)+s),{x:Kt(g,0,i.width-t.width),y:Kt(_,0,i.height-t.height)}}function Pr(n,t,e){const i=$t(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function vd(n){return Ve([],sn(n))}function y0(n,t,e){return Mn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Md(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Sd={beforeTitle:Ze,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:Ze,beforeBody:Ze,beforeLabel:Ze,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 it(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:Ze,afterBody:Ze,beforeFooter:Ze,footer:Ze,afterFooter:Ze};function be(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Sd[t].call(e,i):s}class yo extends Zt{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 Ga(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=be(i,"beforeTitle",this,t),r=be(i,"title",this,t),a=be(i,"afterTitle",this,t);let o=[];return o=Ve(o,sn(s)),o=Ve(o,sn(r)),o=Ve(o,sn(a)),o}getBeforeBody(t,e){return vd(be(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return kt(t,r=>{const a={before:[],lines:[],after:[]},o=Md(i,r);Ve(a.before,sn(be(o,"beforeLabel",this,r))),Ve(a.lines,be(o,"label",this,r)),Ve(a.after,sn(be(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return vd(be(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=be(i,"beforeFooter",this,t),r=be(i,"footer",this,t),a=be(i,"afterFooter",this,t);let o=[];return o=Ve(o,sn(s)),o=Ve(o,sn(r)),o=Ve(o,sn(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(d0(this.chart,e[l]));return t.filter&&(o=o.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(o=o.sort((u,h)=>t.itemSort(u,h,i))),kt(o,u=>{const h=Md(t.callbacks,u);s.push(be(h,"labelColor",this,u)),r.push(be(h,"labelPointStyle",this,u)),a.push(be(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=ms[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=_d(this,i),c=Object.assign({},o,l),u=xd(this.chart,i,c),h=wd(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:o.x,caretY:o.y}}this._tooltipItems=a,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:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=vn(o),{x:f,y:m}=t,{width:g,height:_}=e;let x,v,S,k,C,A;return r==="center"?(C=m+_/2,s==="left"?(x=f,v=x-a,k=C+a,A=C-a):(x=f+g,v=x+a,k=C-a,A=C+a),S=x):(s==="left"?v=f+Math.max(l,u)+a:s==="right"?v=f+g-Math.max(c,h)-a:v=this.caretX,r==="top"?(k=m,C=k-a,x=v-a,S=v+a):(k=m+_,C=k+a,x=v+a,S=v-a),A=k),{x1:x,x2:v,x3:S,y1:k,y2:C,y3:A}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=yi(i.rtl,this.x,this.width);for(t.x=Pr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=Rt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=Rt(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:o.pointStyle,rotation:o.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Ya(t,_,x,v),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Ya(t,_,x,v)}else{t.lineWidth=ft(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const _=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),v=vn(a.borderRadius);Object.values(v).some(S=>S!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,mi(t,{x:_,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),mi(t,{x,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(_,g,c,l),t.strokeRect(_,g,c,l),t.fillStyle=a.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:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=Rt(i.bodyFont);let f=h.lineHeight,m=0;const g=yi(i.rtl,this.x,this.width),_=function(p){e.fillText(p,g.x(t.x+m),t.y+f/2),t.y+=f+r},x=g.textAlign(a);let v,S,k,C,A,O,T;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Pr(this,x,i),e.fillStyle=i.bodyColor,kt(this.beforeBody,_),m=o&&x!=="right"?a==="center"?c/2+u:c+2+u:0,C=0,O=s.length;C<O;++C){for(v=s[C],S=this.labelTextColors[C],e.fillStyle=S,kt(v.before,_),k=v.lines,o&&k.length&&(this._drawColorBox(e,t,C,g,i),f=Math.max(h.lineHeight,l)),A=0,T=k.length;A<T;++A)_(k[A]),f=h.lineHeight;kt(v.after,_)}m=0,f=h.lineHeight,kt(this.afterBody,_),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=yi(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",a=Rt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=vn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+h,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-g),e.quadraticCurveTo(o+c,l+u,o+c-g,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+m,l+u),e.quadraticCurveTo(o,l+u,o,l+u-m),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+h),e.quadraticCurveTo(o,l,o+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 a=ms[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=_d(this,t),l=Object.assign({},a,this._size),c=xd(e,t,l),u=wd(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.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 a=$t(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),su(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ru(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),r=!nr(i,s),a=this._positionChanged(s,e);(r||a)&&(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||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!nr(a,r)||o;return l&&(this._active=a,(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(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=ms[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}P(yo,"positioners",ms);var Te={id:"tooltip",_element:yo,positioners:ms,afterInit(n,t,e){e&&(n.tooltip=new yo({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:Sd},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:Pb,Decimation:Lb,Filler:e0,Legend:o0,SubTitle:u0,Title:c0,Tooltip:Te});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:Kt(Math.round(n),0,t);function kd(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class bo extends Un{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(it(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:x0(i,t,st(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 a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return kd.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}}P(bo,"id","category"),P(bo,"defaults",{ticks:{callback:kd}});function v0(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=r||1,g=u-1,{min:_,max:x}=t,v=!it(a),S=!it(o),k=!it(c),C=(x-_)/(h+1);let A=Oc((x-_)/g/m)*m,O,T,p,b;if(A<1e-14&&!v&&!S)return[{value:_},{value:x}];b=Math.ceil(x/A)-Math.floor(_/A),b>g&&(A=Oc(b*A/g/m)*m),it(l)||(O=Math.pow(10,l),A=Math.ceil(A*O)/O),s==="ticks"?(T=Math.floor(_/A)*A,p=Math.ceil(x/A)*A):(T=_,p=x),v&&S&&r&&yg((o-a)/r,A/1e3)?(b=Math.round(Math.min((o-a)/A,u)),A=(o-a)/b,T=a,p=o):k?(T=v?a:T,p=S?o:p,b=c-1,A=(p-T)/b):(b=(p-T)/A,Xi(b,Math.round(b),A/1e3)?b=Math.round(b):b=Math.ceil(b));const M=Math.max(Ac(A),Ac(T));O=Math.pow(10,it(l)?M:l),T=Math.round(T*O)/O,p=Math.round(p*O)/O;let E=0;for(v&&(f&&T!==a?(e.push({value:a}),T<a&&E++,Xi(Math.round((T+E*A)*O)/O,a,Dd(a,C,n))&&E++):T<a&&E++);E<b;++E){const R=Math.round((T+E*A)*O)/O;if(S&&R>o)break;e.push({value:R})}return S&&f&&p!==o?e.length&&Xi(e[e.length-1].value,o,Dd(o,C,n))?e[e.length-1].value=o:e.push({value:o}):(!S||p===o)&&e.push({value:p}),e}function Dd(n,t,{horizontal:e,minRotation:i}){const s=Vt(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class Ar extends Un{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 it(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 a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=We(s),c=We(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(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,a=v0(s,r);return t.bounds==="ticks"&&Pc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}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 Zi(t,this.chart.options.locale,this.options.ticks.format)}}class _o extends Ar{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Vt(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}}P(_o,"id","linear"),P(_o,"defaults",{ticks:{callback:cr.formatters.numeric}});const gs=n=>Math.floor(xn(n)),qn=(n,t)=>Math.pow(10,gs(n)+t);function Td(n){return n/Math.pow(10,gs(n))===1}function Cd(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=gs(e);for(;Cd(n,t,i)>10;)i++;for(;Cd(n,t,i)<10;)i--;return Math.min(i,gs(n))}function S0(n,{min:t,max:e}){t=De(n.min,t);const i=[],s=gs(t);let r=M0(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/o/10)*o*10;let h=Math.floor((c-u)/Math.pow(10,r)),f=De(n.min,Math.round((l+u+h*Math.pow(10,r))*a)/a);for(;f<e;)i.push({value:f,major:Td(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,a=r>=0?1:a),f=Math.round((l+u+h*Math.pow(10,r))*a)/a;const m=De(n.max,f);return i.push({value:m,major:Td(m),significand:h}),i}class xo extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Ar.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===qn(this.min,0)?qn(this.min,-1):qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(qn(i,-1)),a(qn(s,1)))),i<=0&&r(qn(s,-1)),s<=0&&a(qn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=S0(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":Zi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xn(t),this._valueRange=xn(this.max)-xn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(xo,"id","logarithmic"),P(xo,"defaults",{ticks:{callback:cr.formatters.logarithmic,major:{enabled:!0}}});function wo(n){const t=n.ticks;if(t.display&&n.display){const e=$t(t.backdropPadding);return st(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function k0(n,t,e){return e=wt(e)?e:[e],{w:Ig(n,t.string,e),h:e.length*t.lineHeight}}function Ed(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,a=n.options.pointLabels,o=a.centerPointLabels?ut/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),h=Rt(c.font),f=k0(n.ctx,h,n._pointLabels[l]);i[l]=f;const m=ie(n.getIndexAngle(l)+o),g=Math.round(ar(m)),_=Ed(g,u.x,f.w,0,180),x=Ed(g,u.y,f.h,90,270);T0(e,t,m,_,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)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function C0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(ar(ie(l.angle+Ot))),u=R0(l.y,o.h,c),h=P0(c),f=A0(l.x,o.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+o.w,bottom:u+o.h}}function E0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(tn({x:e,y:i},t)||tn({x:e,y:r},t)||tn({x:s,y:i},t)||tn({x:s,y:r},t))}function O0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:wo(r)/2,additionalAngle:a?ut/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),o==="auto"&&(h.visible=E0(h,c),h.visible&&(c=h))}return i}function P0(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:a}=e,{backdropColor:o}=t;if(!it(o)){const l=vn(t.borderRadius),c=$t(t.backdropPadding);n.fillStyle=o;const u=i-c.left,h=s-c.top,f=r-i+c.width,m=a-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),mi(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 a=i.setContext(n.getPointLabelContext(s));I0(e,a,r);const o=Rt(a.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Od(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ct);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function N0(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Od(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function F0(n,t,e){return Mn(n,{label:e,index:t,type:"pointLabel"})}class ps extends Ar{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=$t(wo(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=At(t)&&!isNaN(t)?t:0,this.max=At(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/wo(this.options))}generateTickLabels(t){Ar.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=Ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return ie(t*e+Vt(i))}getDistanceFromCenterForValue(t){if(it(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(it(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)-Ot+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(),Od(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,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&L0(this,a),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,a,g)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{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(o,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,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Rt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const h=$t(c.backdropPadding);t.fillRect(-a/2-h.left,-r-u.size/2-h.top,a+h.width,u.size+h.height)}Yn(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(ps,"id","radialLinear"),P(ps,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:cr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(ps,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(ps,"descriptors",{angleLines:{_fallback:"grid"}});const Rr={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}},_e=Object.keys(Rr);function Pd(n,t){return n-t}function Ad(n,t){if(it(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),At(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(wn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function Rd(n,t,e,i){const s=_e.length;for(let r=_e.indexOf(n);r<s-1;++r){const a=Rr[_e[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return _e[r]}return _e[s-1]}function B0(n,t,e,i,s){for(let r=_e.length-1;r>=_e.indexOf(e);r--){const a=_e[r];if(Rr[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return _e[e?_e.indexOf(e):0]}function z0(n){for(let t=_e.indexOf(n)+1,e=_e.length;t<e;++t)if(Rr[_e[t]].common)return _e[t]}function Id(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Na(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),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Ld(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:H0(n,i,s,e)}class ys extends Un{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 Su._date(t.adapters.date);s.init(e),qi(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:Ad(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:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=At(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=At(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,a=this.max,o=wg(s,r,a);return this._unit=e.unit||(i.autoSkip?Rd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):B0(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:z0(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),Ld(this,o,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 a=t.length<3?.5:.25;e=Kt(e,0,a),i=Kt(i,0,a),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,a=r.unit||Rd(r.minUnit,e,i,this._getLabelCapacity(e)),o=st(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=wn(l)||l===!0,u={};let h=e,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)Id(u,f,g);return(f===i||s.bounds==="ticks"||m===1)&&Id(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,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return St(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],h=c&&o[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=Vt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Ld(this,[t],this._majorUnit),s),a=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o: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(Ad(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Lc(t.sort(Pd))}}P(ys,"id","time"),P(ys,"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 Ir(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Je(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Je(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class vo extends ys{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=Ir(e,this.min),this._tableRange=Ir(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-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(Ir(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ir(this._table,i*this._tableRange+this._minPos,!0)}}P(vo,"id","timeseries"),P(vo,"defaults",ys.defaults);var W0=Object.freeze({__proto__:null,CategoryScale:bo,LinearScale:_o,LogarithmicScale:xo,RadialLinearScale:ps,TimeScale:ys,TimeSeriesScale:vo});const Y0=[Kp,Sb,b0,W0],Nd=6048e5,V0=864e5,bs=6e4,_i=36e5,$0=1e3,Fd=Symbol.for("constructDateFrom");function Lt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Fd in n?n[Fd](t):n instanceof Date?new n.constructor(t):new Date(t)}function ct(n,t){return Lt(t||n,n)}function Lr(n,t,e){const i=ct(n,e==null?void 0:e.in);return isNaN(t)?Lt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Mo(n,t,e){const i=ct(n,e==null?void 0:e.in);if(isNaN(t))return Lt(n,NaN);if(!t)return i;const s=i.getDate(),r=Lt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function So(n,t,e){return Lt(n,+ct(n)+t)}function j0(n,t,e){return So(n,t*_i)}let U0={};function Xn(){return U0}function $e(n,t){var o,l,c,u;const e=Xn(),i=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function xi(n,t){return $e(n,{...t,weekStartsOn:1})}function Bd(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Lt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=xi(s),a=Lt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=xi(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Nr(n){const t=ct(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 Gn(n,...t){const e=Lt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ko(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function zd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ko(i),a=ko(s),o=+r-Nr(r),l=+a-Nr(a);return Math.round((o-l)/V0)}function q0(n,t){const e=Bd(n,t),i=Lt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),xi(i)}function X0(n,t,e){const i=ct(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*bs),i}function G0(n,t,e){return Mo(n,t*3,e)}function K0(n,t,e){return So(n,t*1e3)}function Z0(n,t,e){return Lr(n,t*7,e)}function Q0(n,t,e){return Mo(n,t*12,e)}function _s(n,t){const e=+ct(n)-+ct(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 Do(n){return!(!J0(n)&&typeof n!="number"||isNaN(+ct(n)))}function t_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function e_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Hd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=Wd(i,s),a=Math.abs(zd(i,s));i.setDate(i.getDate()-r*a);const o=+(Wd(i,s)===-r),l=r*(a-o);return l===0?0:l}function Wd(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 xs(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function n_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/_i;return xs(e==null?void 0:e.roundingMethod)(r)}function To(n,t){return+ct(n)-+ct(t)}function i_(n,t,e){const i=To(n,t)/bs;return xs(e==null?void 0:e.roundingMethod)(i)}function Yd(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Vd(n,t){const e=ct(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=ct(n,t==null?void 0:t.in);return+Yd(e,t)==+Vd(e,t)}function $d(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),a=_s(s,r),o=Math.abs(t_(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=_s(s,r)===-a;s_(i)&&o===1&&_s(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function r_(n,t,e){const i=$d(n,t,e)/3;return xs(e==null?void 0:e.roundingMethod)(i)}function a_(n,t,e){const i=To(n,t)/1e3;return xs(e==null?void 0:e.roundingMethod)(i)}function o_(n,t,e){const i=Hd(n,t,e)/7;return xs(e==null?void 0:e.roundingMethod)(i)}function l_(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=_s(i,s),a=Math.abs(e_(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=_s(i,s)===-r,l=r*(a-+o);return l===0?0:l}function c_(n,t){const e=ct(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=ct(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function d_(n,t){const e=ct(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 jd(n,t){const e=ct(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=ct(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function f_(n,t){var o,l;const e=Xn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function m_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function g_(n,t){const e=ct(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=ct(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 Co(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:Co({formats:__,defaultWidth:"full"}),time:Co({formats:x_,defaultWidth:"full"}),dateTime:Co({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"},S_=(n,t,e,i)=>M_[n];function ws(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const k_={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"]},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"}},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"}},P_={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:ws({values:k_,defaultWidth:"wide"}),quarter:ws({values:D_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ws({values:T_,defaultWidth:"wide"}),day:ws({values:C_,defaultWidth:"wide"}),dayPeriod:ws({values:E_,defaultWidth:"wide",formattingValues:O_,defaultFormattingWidth:"wide"})};function vs(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 a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?R_(o,h=>h.test(a)):A_(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.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 a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}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},B_={any:[/^b/i,/^(a|c)/i]},z_={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},Y_={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]},V_={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},$_={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]},j_={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:vs({matchPatterns:F_,defaultMatchWidth:"wide",parsePatterns:B_,defaultParseWidth:"any"}),quarter:vs({matchPatterns:z_,defaultMatchWidth:"wide",parsePatterns:H_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:vs({matchPatterns:W_,defaultMatchWidth:"wide",parsePatterns:Y_,defaultParseWidth:"any"}),day:vs({matchPatterns:V_,defaultMatchWidth:"wide",parsePatterns:$_,defaultParseWidth:"any"}),dayPeriod:vs({matchPatterns:j_,defaultMatchWidth:"any",parsePatterns:U_,defaultParseWidth:"any"})},Ud={code:"en-US",formatDistance:b_,formatLong:v_,formatRelative:S_,localize:P_,match:q_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function X_(n,t){const e=ct(n,t==null?void 0:t.in);return zd(e,jd(e))+1}function qd(n,t){const e=ct(n,t==null?void 0:t.in),i=+xi(e)-+q0(e);return Math.round(i/Nd)+1}function Eo(n,t){var u,h,f,m;const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Xn(),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,a=Lt((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=$e(a,t),l=Lt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=$e(l,t);return+e>=+o?i+1:+e>=+c?i:i-1}function G_(n,t){var o,l,c,u;const e=Xn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Eo(n,t),r=Lt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),$e(r,t)}function Xd(n,t){const e=ct(n,t==null?void 0:t.in),i=+$e(e,t)-+G_(e,t);return Math.round(i/Nd)+1}function Dt(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 Dt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Dt(e+1,2)},d(n,t){return Dt(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 Dt(n.getHours()%12||12,t.length)},H(n,t){return Dt(n.getHours(),t.length)},m(n,t){return Dt(n.getMinutes(),t.length)},s(n,t){return Dt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Dt(s,t.length)}},wi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Gd={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=Eo(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Dt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Dt(r,t.length)},R:function(n,t){const e=Bd(n);return Dt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Dt(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 Dt(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 Dt(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 Dt(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=Xd(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Dt(s,t.length)},I:function(n,t,e){const i=qd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Dt(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=X_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Dt(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 Dt(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 Dt(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 Dt(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=wi.noon:i===0?s=wi.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=wi.evening:i>=12?s=wi.afternoon:i>=4?s=wi.morning:s=wi.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"}):Dt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(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 Zd(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 Zd(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"+Kd(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"+Kd(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Dt(i,t.length)},T:function(n,t,e){return Dt(+n,t.length)}};function Kd(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+Dt(r,2)}function Zd(n,t){return n%60===0?(n>0?"-":"+")+Dt(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Dt(Math.trunc(i/60),2),r=Dt(i%60,2);return e+s+t+r}const Qd=(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"})}},Jd=(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"})}},Oo={p:Jd,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Qd(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}}",Qd(i,t)).replace("{{time}}",Jd(s,t))}},K_=/^D+$/,Z_=/^Y+$/,Q_=["D","DD","YY","YYYY"];function th(n){return K_.test(n)}function eh(n){return Z_.test(n)}function Po(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 Fr(n,t,e){var u,h,f,m,g,_,x,v;const i=Xn(),s=(e==null?void 0:e.locale)??i.locale??Ud,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,a=(e==null?void 0:e.weekStartsOn)??((_=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:_.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,o=ct(n,e==null?void 0:e.in);if(!Do(o))throw new RangeError("Invalid time value");let l=t.match(ex).map(S=>{const k=S[0];if(k==="p"||k==="P"){const C=Oo[k];return C(S,s.formatLong)}return S}).join("").match(tx).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const k=S[0];if(k==="'")return{isToken:!1,value:rx(S)};if(Gd[k])return{isToken:!0,value:S};if(k.match(sx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:S}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(S=>{if(!S.isToken)return S.value;const k=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&eh(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&th(k))&&Po(k,t,String(n));const C=Gd[k[0]];return C(o,k,s.localize,c)}).join("")}function rx(n){const t=n.match(nx);return t?t[1].replace(ix,"'"):n}function nh(){return Object.assign({},Xn())}function ax(n,t){const e=ct(n,t==null?void 0:t.in).getDay();return e===0?7:e}function ox(n,t){const e=lx(t)?new t(0):Lt(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 ih{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class ux extends ih{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 ih{constructor(e,i){super();P(this,"priority",cx);P(this,"subPriority",-1);this.context=e||(s=>Lt(i,s))}set(e,i){return i.timestampIsSet?e:Lt(e,ox(e,this.context))}}class xt{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 xt{constructor(){super(...arguments);P(this,"priority",140);P(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 Ht={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}/},je={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 Wt(n,t){return n&&{value:t(n.value),rest:n.rest}}function It(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,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*_i+r*bs+a*$0),rest:t.slice(e[0].length)}}function sh(n){return It(Ht.anyDigitsSigned,n)}function Nt(n,t){switch(n){case 1:return It(Ht.singleDigit,t);case 2:return It(Ht.twoDigits,t);case 3:return It(Ht.threeDigits,t);case 4:return It(Ht.fourDigits,t);default:return It(new RegExp("^\\d{1,"+n+"}"),t)}}function Br(n,t){switch(n){case 1:return It(Ht.singleDigitSigned,t);case 2:return It(Ht.twoDigitsSigned,t);case 3:return It(Ht.threeDigitsSigned,t);case 4:return It(Ht.fourDigitsSigned,t);default:return It(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ao(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 rh(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function ah(n){return n%400===0||n%4===0&&n%100!==0}class fx extends xt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Wt(Nt(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(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 o=rh(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class mx extends xt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Wt(Nt(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=Eo(e,r);if(s.isTwoDigitYear){const l=rh(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}}class gx extends xt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Br(i==="R"?4:i.length,e)}set(e,i,s){const r=Lt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),xi(r)}}class px extends xt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Br(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 xt{constructor(){super(...arguments);P(this,"priority",120);P(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 Nt(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 xt{constructor(){super(...arguments);P(this,"priority",120);P(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 Nt(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 xt{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return Wt(It(Ht.month,e),r);case"MM":return Wt(Nt(2,e),r);case"Mo":return Wt(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 xt{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return Wt(It(Ht.month,e),r);case"LL":return Wt(Nt(2,e),r);case"Lo":return Wt(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=ct(n,e==null?void 0:e.in),s=Xd(i,e)-t;return i.setDate(i.getDate()-s*7),ct(i,e==null?void 0:e.in)}class vx extends xt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return It(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return $e(wx(e,s,r),r)}}function Mx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=qd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Sx extends xt{constructor(){super(...arguments);P(this,"priority",100);P(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 It(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return xi(Mx(e,s))}}const kx=[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 xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return It(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=ah(s),a=e.getMonth();return r?i>=1&&i<=Dx[a]:i>=1&&i<=kx[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Cx extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(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 It(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear();return ah(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 Ro(n,t,e){var h,f,m,g;const i=Xn(),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=ct(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Lr(r,u,e)}class Ex extends xt{constructor(){super(...arguments);P(this,"priority",90);P(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=Ro(e,s,r),e.setHours(0,0,0,0),e}}class Ox extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Wt(Nt(i.length,e),a);case"eo":return Wt(s.ordinalNumber(e,{unit:"day"}),a);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=Ro(e,s,r),e.setHours(0,0,0,0),e}}class Px extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Wt(Nt(i.length,e),a);case"co":return Wt(s.ordinalNumber(e,{unit:"day"}),a);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=Ro(e,s,r),e.setHours(0,0,0,0),e}}function Ax(n,t,e){const i=ct(n,e==null?void 0:e.in),s=ax(i,e),r=t-s;return Lr(i,r,e)}class Rx extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Nt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Wt(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 Wt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Wt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Wt(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 xt{constructor(){super(...arguments);P(this,"priority",80);P(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(Ao(s),0,0,0),e}}class Lx extends xt{constructor(){super(...arguments);P(this,"priority",80);P(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(Ao(s),0,0,0),e}}class Nx extends xt{constructor(){super(...arguments);P(this,"priority",80);P(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(Ao(s),0,0,0),e}}class Fx extends xt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return It(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(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 Bx extends xt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return It(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class zx extends xt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return It(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(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 xt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return It(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(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 xt{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return It(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class Yx extends xt{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return It(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class Vx extends xt{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Nt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class $x extends xt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ue(je.basicOptionalMinutes,e);case"XX":return Ue(je.basic,e);case"XXXX":return Ue(je.basicOptionalSeconds,e);case"XXXXX":return Ue(je.extendedOptionalSeconds,e);case"XXX":default:return Ue(je.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-Nr(e)-s)}}class jx extends xt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ue(je.basicOptionalMinutes,e);case"xx":return Ue(je.basic,e);case"xxxx":return Ue(je.basicOptionalSeconds,e);case"xxxxx":return Ue(je.extendedOptionalSeconds,e);case"xxx":default:return Ue(je.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-Nr(e)-s)}}class Ux extends xt{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return sh(e)}set(e,i,s){return[Lt(e,s*1e3),{timestampIsSet:!0}]}}class qx extends xt{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return sh(e)}set(e,i,s){return[Lt(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 Sx,d:new Tx,D:new Cx,E:new Ex,e:new Ox,c:new Px,i:new Rx,a:new Ix,b:new Lx,B:new Nx,h:new Fx,H:new Bx,K:new zx,k:new Hx,m:new Wx,s:new Yx,S:new Vx,X:new $x,x:new jx,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,v,S,k,C,A,O,T;const s=()=>Lt((i==null?void 0:i.in)||e,NaN),r=nh(),a=(i==null?void 0:i.locale)??r.locale??Ud,o=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((k=(S=r.locale)==null?void 0:S.options)==null?void 0:k.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((A=(C=i==null?void 0:i.locale)==null?void 0:C.options)==null?void 0:A.weekStartsOn)??r.weekStartsOn??((T=(O=r.locale)==null?void 0:O.options)==null?void 0:T.weekStartsOn)??0;if(!t)return n?s():ct(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new dx(i==null?void 0:i.in,e)],h=t.match(Kx).map(p=>{const b=p[0];if(b in Oo){const M=Oo[b];return M(p,a.formatLong)}return p}).join("").match(Gx),f=[];for(let p of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&eh(p)&&Po(p,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&th(p)&&Po(p,t,n);const b=p[0],M=Xx[b];if(M){const{incompatibleTokens:E}=M;if(Array.isArray(E)){const I=f.find(B=>E.includes(B.token)||B.token===b);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${p}\` at the same time`)}else if(M.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${p}\` and any other token at the same time`);f.push({token:b,fullToken:p});const R=M.run(n,p,a.match,c);if(!R)return s();u.push(R.setter),n=R.rest}else{if(b.match(tw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(p==="''"?p="'":b==="'"&&(p=nw(p)),n.indexOf(p)===0)n=n.slice(p.length);else return s()}}if(n.length>0&&Jx.test(n))return s();const m=u.map(p=>p.priority).sort((p,b)=>b-p).filter((p,b,M)=>M.indexOf(p)===b).map(p=>u.filter(b=>b.priority===p).sort((b,M)=>M.subPriority-b.subPriority)).map(p=>p[0]);let g=ct(e,i==null?void 0:i.in);if(isNaN(+g))return s();const _={};for(const p of m){if(!p.validate(g,c))return s();const b=p.set(g,_,c);Array.isArray(b)?(g=b[0],Object.assign(_,b[1])):g=b}return g}function nw(n){return n.match(Zx)[1].replace(Qx,"'")}function iw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function sw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function rw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function aw(n){const t=n/_i;return Math.trunc(t)}function oh(n,t){const e=()=>Lt(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 a=+r;let o=0,l;if(s.time&&(o=fw(s.time),isNaN(o)))return e();if(s.timezone){if(l=mw(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=ct(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 ct(a+o+l,t==null?void 0:t.in)}const zr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ow=/^-?(?:(\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(zr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],zr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(zr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=zr.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(ow);if(!e)return new Date(NaN);const i=!!e[4],s=Ms(e[1]),r=Ms(e[2])-1,a=Ms(e[3]),o=Ms(e[4]),l=Ms(e[5])-1;if(i)return _w(t,o,l)?gw(t,o,l):new Date(NaN);{const c=new Date(0);return!yw(t,r,a)||!bw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function Ms(n){return n?parseInt(n):1}function fw(n){const t=n.match(lw);if(!t)return NaN;const e=Io(t[1]),i=Io(t[2]),s=Io(t[3]);return xw(e,i,s)?e*_i+i*bs+s*1e3:NaN}function Io(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*_i+s*bs):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 lh(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]||(lh(n)?29:28))}function bw(n,t){return t>=1&&t<=(lh(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}var vw=Object.defineProperty,Mw=(n,t,e)=>t in n?vw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Pe=(n,t,e)=>Mw(n,typeof t!="symbol"?t+"":t,e);const Sw=1e3;var nt=(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.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(nt||{});const kw=["in","not_in","selector"],Dw=["empty","not_empty"],Tw=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Cw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ss=n=>n.filter(t=>t!=="time"),ch=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],uh=Ss(ch),Ew=[...ch,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],dh=Ss(Ew),Ow=["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"],hh=Ss(Ow);Ss(["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"]),Ss(["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(uh),new Set(dh),new Set(hh);const fh=[{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"}];fh.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:kw},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:Dw}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...dh,...uh,...hh])]);const Pw={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"}},Aw=(n,t,e)=>{let i;const s=Pw[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 Lo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Rw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Iw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Lw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Nw={date:Lo({formats:Rw,defaultWidth:"full"}),time:Lo({formats:Iw,defaultWidth:"full"}),dateTime:Lo({formats:Lw,defaultWidth:"full"})},Fw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Bw=(n,t,e,i)=>Fw[n];function ks(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const zw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ww={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"]},Yw={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"]},Vw={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"}},$w={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"}},jw=(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"},Uw={ordinalNumber:jw,era:ks({values:zw,defaultWidth:"wide"}),quarter:ks({values:Hw,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ks({values:Ww,defaultWidth:"wide"}),day:ks({values:Yw,defaultWidth:"wide"}),dayPeriod:ks({values:Vw,defaultWidth:"wide",formattingValues:$w,defaultFormattingWidth:"wide"})};function Ds(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 a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Xw(o,h=>h.test(a)):qw(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function qw(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Xw(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Gw(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 a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const Kw=/^(\d+)(th|st|nd|rd)?/i,Zw=/\d+/i,Qw={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},Jw={any:[/^b/i,/^(a|c)/i]},tv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ev={any:[/1/i,/2/i,/3/i,/4/i]},nv={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},iv={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]},sv={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},rv={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]},av={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},ov={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}},lv={ordinalNumber:Gw({matchPattern:Kw,parsePattern:Zw,valueCallback:n=>parseInt(n,10)}),era:Ds({matchPatterns:Qw,defaultMatchWidth:"wide",parsePatterns:Jw,defaultParseWidth:"any"}),quarter:Ds({matchPatterns:tv,defaultMatchWidth:"wide",parsePatterns:ev,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ds({matchPatterns:nv,defaultMatchWidth:"wide",parsePatterns:iv,defaultParseWidth:"any"}),day:Ds({matchPatterns:sv,defaultMatchWidth:"wide",parsePatterns:rv,defaultParseWidth:"any"}),dayPeriod:Ds({matchPatterns:av,defaultMatchWidth:"any",parsePatterns:ov,defaultParseWidth:"any"})},cv={code:"en-US",formatDistance:Aw,formatLong:Nw,formatRelative:Bw,localize:Uw,match:lv,options:{weekStartsOn:0,firstWeekContainsDate:1}};let uv={};function Ts(){return uv}const mh=6048e5,dv=864e5,hv=60,fv=3600,gh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&gh in n?n[gh](t):n instanceof Date?new n.constructor(t):new Date(t)}function ue(n,t){return Ae(t||n,n)}function ph(n){const t=ue(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 mv(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Cs(n,t){const e=ue(n,void 0);return e.setHours(0,0,0,0),e}function gv(n,t,e){const[i,s]=mv(void 0,n,t),r=Cs(i),a=Cs(s),o=+r-ph(r),l=+a-ph(a);return Math.round((o-l)/dv)}function pv(n,t){const e=ue(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function yv(n,t){const e=ue(n,void 0);return gv(e,pv(e))+1}function rn(n,t){var e,i,s,r;const a=Ts(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=ue(n,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Hr(n,t){return rn(n,{...t,weekStartsOn:1})}function yh(n,t){const e=ue(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Hr(s),a=Ae(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Hr(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function bv(n,t){const e=yh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Hr(i)}function _v(n,t){const e=ue(n,void 0),i=+Hr(e)-+bv(e);return Math.round(i/mh)+1}function bh(n,t){var e,i,s,r;const a=ue(n,t==null?void 0:t.in),o=a.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=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const h=rn(u,t),f=Ae((t==null?void 0:t.in)||n,0);f.setFullYear(o,0,c),f.setHours(0,0,0,0);const m=rn(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function xv(n,t){var e,i,s,r;const a=Ts(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=bh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),rn(c,t)}function wv(n,t){const e=ue(n,t==null?void 0:t.in),i=+rn(e,t)-+xv(e,t);return Math.round(i/mh)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Cn={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)}},vi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},_h={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 Cn.y(n,t)},Y:function(n,t,e,i){const s=bh(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Tt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=yh(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 Cn.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=wv(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=_v(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"}):Cn.d(n,t)},D:function(n,t,e){const i=yv(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 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=vi.noon:i===0?s=vi.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=vi.evening:i>=12?s=vi.afternoon:i>=4?s=vi.morning:s=vi.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 Cn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Cn.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"}):Cn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Cn.s(n,t)},S:function(n,t){return Cn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return wh(i);case"XXXX":case"XX":return Zn(i);case"XXXXX":case"XXX":default:return Zn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return wh(i);case"xxxx":case"xx":return Zn(i);case"xxxxx":case"xxx":default:return Zn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+xh(i,":");case"OOOO":default:return"GMT"+Zn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+xh(i,":");case"zzzz":default:return"GMT"+Zn(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 xh(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 wh(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Zn(n,t)}function Zn(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 vh=(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"})}},Mh=(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"})}},vv=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return vh(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}}",vh(i,t)).replace("{{time}}",Mh(s,t))},Mv={p:Mh,P:vv},Sv=/^D+$/,kv=/^Y+$/,Dv=["D","DD","YY","YYYY"];function Tv(n){return Sv.test(n)}function Cv(n){return kv.test(n)}function Ev(n,t,e){const i=Ov(n,t,e);if(console.warn(i),Dv.includes(n))throw new RangeError(i)}function Ov(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`}function Pv(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Av(n){return!(!Pv(n)&&typeof n!="number"||isNaN(+ue(n)))}const Rv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Iv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Lv=/^'([^]*?)'?$/,Nv=/''/g,Fv=/[a-zA-Z]/;function Bv(n,t,e){var i,s,r,a,o,l,c,u;const h=Ts(),f=(e==null?void 0:e.locale)??h.locale??cv,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??((a=(r=h.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,g=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??h.weekStartsOn??((u=(c=h.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,_=ue(n,e==null?void 0:e.in);if(!Av(_))throw new RangeError("Invalid time value");let x=t.match(Iv).map(S=>{const k=S[0];if(k==="p"||k==="P"){const C=Mv[k];return C(S,f.formatLong)}return S}).join("").match(Rv).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const k=S[0];if(k==="'")return{isToken:!1,value:zv(S)};if(_h[k])return{isToken:!0,value:S};if(k.match(Fv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:S}});f.localize.preprocessor&&(x=f.localize.preprocessor(_,x));const v={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(S=>{if(!S.isToken)return S.value;const k=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Cv(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Tv(k))&&Ev(k,t,String(n));const C=_h[k[0]];return C(_,k,f.localize,v)}).join("")}function zv(n){const t=n.match(Lv);return t?t[1].replace(Nv,"'"):n}function No(n,t,e){const i=ue(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function Hv(n,t,e){const i=ue(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function Mi(n,t){const e=ue(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function Wv(n,t){const e=ue(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function Yv(){return Object.assign({},Ts())}function Sh(n){return Math.trunc(n*fv)}function Vv(n){const t=n/hv;return Math.trunc(t)}function kh(n,t,e){return Hv(n,-1)}function Dh(n,t,e){const i=Yv(),s=Uv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?$v(s,t):jv(s,t)}function $v(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 jv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Uv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function qv(n,t){const e=Qv(t);return"formatToParts"in e?Gv(e,n):Kv(e,n)}const Xv={year:0,month:1,day:2,hour:3,minute:4,second:5};function Gv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Xv[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 Kv(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 Fo={},Th=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")),Zv=Th==="06/25/2014, 00:00:00"||Th==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Qv(n){return Fo[n]||(Fo[n]=Zv?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"})),Fo[n]}function Bo(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Ch=36e5,Jv=6e4,zo={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Es(n,t,e){if(!n)return 0;let i=zo.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=zo.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Eh(s)?-(s*Ch):NaN;if(i=zo.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Eh(s,a)?(r=Math.abs(s)*Ch+a*Jv,i[1]==="+"?-r:r):NaN}if(n1(n)){t=new Date(t||Date.now());const a=e?t:t1(t),o=Ho(a,n);return-(e?o:e1(t,o,n))}return NaN}function t1(n){return Bo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ho(n,t){const e=qv(n,t),i=Bo(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 e1(n,t,e){let i=n.getTime()-t;const s=Ho(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ho(new Date(i),e);return s===r?s:Math.max(s,r)}function Eh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Oh={};function n1(n){if(Oh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Oh[n]=!0,!0}catch{return!1}}const i1=60*1e3,s1={X:function(n,t,e){const i=Wo(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ph(i);case"XXXX":case"XX":return Si(i);case"XXXXX":case"XXX":default:return Si(i,":")}},x:function(n,t,e){const i=Wo(e.timeZone,n);switch(t){case"x":return Ph(i);case"xxxx":case"xx":return Si(i);case"xxxxx":case"xxx":default:return Si(i,":")}},O:function(n,t,e){const i=Wo(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+r1(i,":");case"OOOO":default:return"GMT"+Si(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Dh("short",n,e);case"zzzz":default:return Dh("long",n,e)}}};function Wo(n,t){const e=n?Es(n,t,!0)/i1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Wr(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=Wr(Math.floor(i/60),2),r=Wr(Math.floor(i%60),2);return e+s+t+r}function Ph(n,t){return n%60===0?(n>0?"-":"+")+Wr(Math.abs(n)/60,2):Si(n,t)}function r1(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+Wr(r,2)}function Ah(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 Rh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Yo=36e5,Ih=6e4,a1=2,de={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:Rh};function Yr(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?a1: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=o1(n),{year:s,restDateString:r}=l1(i.date,e),a=c1(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=u1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Es(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Ah(new Date(o+l)),c=Ah(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function o1(n){const t={};let e=de.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=de.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=de.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function l1(n,t){if(n){const e=de.YYY[t],i=de.YYYYY[t];let s=de.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=de.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 c1(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=de.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Fh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=de.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return f1(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=de.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return Fh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=de.Www.exec(n),r)return s=parseInt(r[1],10)-1,Bh(s)?Lh(t,s):new Date(NaN);if(r=de.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return Bh(s,a)?Lh(t,s,a):new Date(NaN)}return null}function u1(n){let t,e,i=de.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Vo(t)?t%24*Yo:NaN;if(i=de.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Vo(t,e)?t%24*Yo+e*Ih:NaN;if(i=de.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Vo(t,e,s)?t%24*Yo+e*Ih+s*1e3:NaN}return null}function Lh(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 d1=[31,28,31,30,31,30,31,31,30,31,30,31],h1=[31,29,31,30,31,30,31,31,30,31,30,31];function Nh(n){return n%400===0||n%4===0&&n%100!==0}function Fh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Nh(n);if(i&&e>h1[t]||!i&&e>d1[t])return!1}return!0}function f1(n,t){if(t<1)return!1;const e=Nh(n);return!(e&&t>366||!e&&t>365)}function Bh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Vo(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const m1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function g1(n,t,e={}){t=String(t);const i=t.match(m1);if(i){const s=Yr(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+s1[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return Bv(n,t,e)}function zh(n,t,e){n=Yr(n,e);const i=Es(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 p1(n,t,e,i){return i={...i,timeZone:t,originalDate:n},g1(zh(n,t,{timeZone:i.timeZone}),e,i)}function y1(n,t,e){if(typeof n=="string"&&!n.match(Rh))return Yr(n,{...e,timeZone:t});n=Yr(n,e);const i=Bo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Es(t,new Date(i));return new Date(i+s)}function b1(n,t){return-Es(n,t)}function $o(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 p1(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const _1={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 jo(n){return n&&Cw.find(t=>n<=_1[t])||null}var Vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function x1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $r={exports:{}};$r.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",a="[object Array]",o="[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]",v="[object Set]",S="[object String]",k="[object Symbol]",C="[object WeakMap]",A="[object ArrayBuffer]",O="[object DataView]",T="[object Float32Array]",p="[object Float64Array]",b="[object Int8Array]",M="[object Int16Array]",E="[object Int32Array]",R="[object Uint8Array]",I="[object Uint8ClampedArray]",B="[object Uint16Array]",U="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,$=/\w*$/,lt=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,K={};K[r]=K[a]=K[A]=K[O]=K[o]=K[l]=K[T]=K[p]=K[b]=K[M]=K[E]=K[f]=K[m]=K[g]=K[x]=K[v]=K[S]=K[k]=K[R]=K[I]=K[B]=K[U]=!0,K[c]=K[u]=K[C]=!1;var z=typeof Vr=="object"&&Vr&&Vr.Object===Object&&Vr,j=typeof self=="object"&&self&&self.Object===Object&&self,Y=z||j||Function("return this")(),yt=t&&!t.nodeType&&t,_t=yt&&!0&&n&&!n.nodeType&&n,V=_t&&_t.exports===yt;function H(w,L){return w.set(L[0],L[1]),w}function X(w,L){return w.add(L),w}function Z(w,L){for(var F=-1,tt=w?w.length:0;++F<tt&&L(w[F],F,w)!==!1;);return w}function Q(w,L){for(var F=-1,tt=L.length,Yt=w.length;++F<tt;)w[Yt+F]=L[F];return w}function G(w,L,F,tt){for(var Yt=-1,Xt=w?w.length:0;++Yt<Xt;)F=L(F,w[Yt],Yt,w);return F}function gt(w,L){for(var F=-1,tt=Array(w);++F<w;)tt[F]=L(F);return tt}function vt(w,L){return w==null?void 0:w[L]}function rt(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function bt(w){var L=-1,F=Array(w.size);return w.forEach(function(tt,Yt){F[++L]=[Yt,tt]}),F}function dt(w,L){return function(F){return w(L(F))}}function jt(w){var L=-1,F=Array(w.size);return w.forEach(function(tt){F[++L]=tt}),F}var ot=Array.prototype,Mt=Function.prototype,te=Object.prototype,oe=Y["__core-js_shared__"],Ut=function(){var w=/[^.]+$/.exec(oe&&oe.keys&&oe.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),qe=Mt.toString,Et=te.hasOwnProperty,ee=te.toString,Ft=RegExp("^"+qe.call(Et).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=V?Y.Buffer:void 0,ne=Y.Symbol,Xe=Y.Uint8Array,si=dt(Object.getPrototypeOf,Object),Fe=Object.create,Bt=te.propertyIsEnumerable,ve=ot.splice,ri=Object.getOwnPropertySymbols,ha=qt?qt.isBuffer:void 0,fa=dt(Object.keys,Object),Ws=Nn(Y,"DataView"),ai=Nn(Y,"Map"),Ys=Nn(Y,"Promise"),oi=Nn(Y,"Set"),cn=Nn(Y,"WeakMap"),un=Nn(Object,"create"),Vs=le(Ws),$s=le(ai),li=le(Ys),Nl=le(oi),Fl=le(cn),ma=ne?ne.prototype:void 0,ga=ma?ma.valueOf:void 0;function dn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function Ii(){this.__data__=un?un(null):{}}function js(w){return this.has(w)&&delete this.__data__[w]}function pa(w){var L=this.__data__;if(un){var F=L[w];return F===i?void 0:F}return Et.call(L,w)?L[w]:void 0}function hn(w){var L=this.__data__;return un?L[w]!==void 0:Et.call(L,w)}function Bl(w,L){var F=this.__data__;return F[w]=un&&L===void 0?i:L,this}dn.prototype.clear=Ii,dn.prototype.delete=js,dn.prototype.get=pa,dn.prototype.has=hn,dn.prototype.set=Bl;function Be(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function zl(){this.__data__=[]}function Hl(w){var L=this.__data__,F=Ni(L,w);if(F<0)return!1;var tt=L.length-1;return F==tt?L.pop():ve.call(L,F,1),!0}function Wl(w){var L=this.__data__,F=Ni(L,w);return F<0?void 0:L[F][1]}function ze(w){return Ni(this.__data__,w)>-1}function Yl(w,L){var F=this.__data__,tt=Ni(F,w);return tt<0?F.push([w,L]):F[tt][1]=L,this}Be.prototype.clear=zl,Be.prototype.delete=Hl,Be.prototype.get=Wl,Be.prototype.has=ze,Be.prototype.set=Yl;function In(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function Vl(){this.__data__={hash:new dn,map:new(ai||Be),string:new dn}}function $l(w){return zi(this,w).delete(w)}function jl(w){return zi(this,w).get(w)}function He(w){return zi(this,w).has(w)}function Ul(w,L){return zi(this,w).set(w,L),this}In.prototype.clear=Vl,In.prototype.delete=$l,In.prototype.get=jl,In.prototype.has=He,In.prototype.set=Ul;function Ln(w){this.__data__=new Be(w)}function ql(){this.__data__=new Be}function Xl(w){return this.__data__.delete(w)}function Gl(w){return this.__data__.get(w)}function Li(w){return this.__data__.has(w)}function Kl(w,L){var F=this.__data__;if(F instanceof Be){var tt=F.__data__;if(!ai||tt.length<e-1)return tt.push([w,L]),this;F=this.__data__=new In(tt)}return F.set(w,L),this}Ln.prototype.clear=ql,Ln.prototype.delete=Xl,Ln.prototype.get=Gl,Ln.prototype.has=Li,Ln.prototype.set=Kl;function Zl(w,L){var F=Gs(w)||Wi(w)?gt(w.length,String):[],tt=F.length,Yt=!!tt;for(var Xt in w)Et.call(w,Xt)&&!(Yt&&(Xt=="length"||mc(Xt,tt)))&&F.push(Xt);return F}function Re(w,L,F){var tt=w[L];(!(Et.call(w,L)&&Xs(tt,F))||F===void 0&&!(L in w))&&(w[L]=F)}function Ni(w,L){for(var F=w.length;F--;)if(Xs(w[F][0],L))return F;return-1}function Ql(w,L){return w&&ya(L,ci(L),w)}function Us(w,L,F,tt,Yt,Xt,Me){var Qt;if(tt&&(Qt=Xt?tt(w,Yt,Xt,Me):tt(w)),Qt!==void 0)return Qt;if(!mn(w))return w;var Sa=Gs(w);if(Sa){if(Qt=hc(w),!L)return cc(w,Qt)}else{var Fn=Ge(w),ka=Fn==u||Fn==h;if(wa(w))return ic(w,L);if(Fn==g||Fn==r||ka&&!Xt){if(rt(w))return Xt?w:{};if(Qt=_a(ka?{}:w),!L)return uc(w,Ql(Qt,w))}else{if(!K[Fn])return Xt?w:{};Qt=fc(w,Fn,Us,L)}}Me||(Me=new Ln);var Da=Me.get(w);if(Da)return Da;if(Me.set(w,Qt),!Sa)var ui=F?dc(w):ci(w);return Z(ui||w,function(Zs,Yi){ui&&(Yi=Zs,Zs=w[Yi]),Re(Qt,Yi,Us(Zs,L,F,tt,Yi,w,Me))}),Qt}function Jl(w){return mn(w)?Fe(w):{}}function tc(w,L,F){var tt=L(w);return Gs(w)?tt:Q(tt,F(w))}function ec(w){return ee.call(w)}function Fi(w){if(!mn(w)||gc(w))return!1;var L=Ks(w)||rt(w)?Ft:lt;return L.test(le(w))}function nc(w){if(!fn(w))return fa(w);var L=[];for(var F in Object(w))Et.call(w,F)&&F!="constructor"&&L.push(F);return L}function ic(w,L){if(L)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function Bi(w){var L=new w.constructor(w.byteLength);return new Xe(L).set(new Xe(w)),L}function sc(w,L){var F=L?Bi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function rc(w,L,F){var tt=L?F(bt(w),!0):bt(w);return G(tt,H,new w.constructor)}function qs(w){var L=new w.constructor(w.source,$.exec(w));return L.lastIndex=w.lastIndex,L}function ac(w,L,F){var tt=L?F(jt(w),!0):jt(w);return G(tt,X,new w.constructor)}function oc(w){return ga?Object(ga.call(w)):{}}function lc(w,L){var F=L?Bi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function cc(w,L){var F=-1,tt=w.length;for(L||(L=Array(tt));++F<tt;)L[F]=w[F];return L}function ya(w,L,F,tt){F||(F={});for(var Yt=-1,Xt=L.length;++Yt<Xt;){var Me=L[Yt],Qt=void 0;Re(F,Me,Qt===void 0?w[Me]:Qt)}return F}function uc(w,L){return ya(w,ba(w),L)}function dc(w){return tc(w,ci,ba)}function zi(w,L){var F=w.__data__;return Hi(L)?F[typeof L=="string"?"string":"hash"]:F.map}function Nn(w,L){var F=vt(w,L);return Fi(F)?F:void 0}var ba=ri?dt(ri,Object):va,Ge=ec;(Ws&&Ge(new Ws(new ArrayBuffer(1)))!=O||ai&&Ge(new ai)!=f||Ys&&Ge(Ys.resolve())!=_||oi&&Ge(new oi)!=v||cn&&Ge(new cn)!=C)&&(Ge=function(w){var L=ee.call(w),F=L==g?w.constructor:void 0,tt=F?le(F):void 0;if(tt)switch(tt){case Vs:return O;case $s:return f;case li:return _;case Nl:return v;case Fl:return C}return L});function hc(w){var L=w.length,F=w.constructor(L);return L&&typeof w[0]=="string"&&Et.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function _a(w){return typeof w.constructor=="function"&&!fn(w)?Jl(si(w)):{}}function fc(w,L,F,tt){var Yt=w.constructor;switch(L){case A:return Bi(w);case o:case l:return new Yt(+w);case O:return sc(w,tt);case T:case p:case b:case M:case E:case R:case I:case B:case U:return lc(w,tt);case f:return rc(w,tt,F);case m:case S:return new Yt(w);case x:return qs(w);case v:return ac(w,tt,F);case k:return oc(w)}}function mc(w,L){return L=L??s,!!L&&(typeof w=="number"||q.test(w))&&w>-1&&w%1==0&&w<L}function Hi(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function gc(w){return!!Ut&&Ut in w}function fn(w){var L=w&&w.constructor,F=typeof L=="function"&&L.prototype||te;return w===F}function le(w){if(w!=null){try{return qe.call(w)}catch{}try{return w+""}catch{}}return""}function pc(w){return Us(w,!0,!0)}function Xs(w,L){return w===L||w!==w&&L!==L}function Wi(w){return yc(w)&&Et.call(w,"callee")&&(!Bt.call(w,"callee")||ee.call(w)==r)}var Gs=Array.isArray;function xa(w){return w!=null&&bc(w.length)&&!Ks(w)}function yc(w){return gn(w)&&xa(w)}var wa=ha||Ma;function Ks(w){var L=mn(w)?ee.call(w):"";return L==u||L==h}function bc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function mn(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function gn(w){return!!w&&typeof w=="object"}function ci(w){return xa(w)?Zl(w):nc(w)}function va(){return[]}function Ma(){return!1}n.exports=pc}($r,$r.exports),$r.exports;const an=(n,t)=>new Date(n.getTime()-b1(t,n));class ae{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){if(this.key==="custom")return{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t};if(Tw.includes(this.key))return{type:"relative",time_range:this.key,tz:t};throw new Error("Unsupported relative time value for Explore")}tzAdjustedDate(t){if(!t)return new Date;const e=y1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return zh(e,t)}}class w1 extends ae{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class v1 extends ae{rawStart(t){let e=Mi(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class M1 extends ae{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*366}}class S1 extends ae{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=an(i,t)),i}}class k1 extends ae{rawEnd(t){let e=Mi(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}rawStart(t){let e=Mi(kh(this.tzAdjustedDate(t)));return t&&(e=an(e,t)),e}}class D1 extends ae{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=an(e,t)),e}}nt.FIFTEEN_MIN,new ae({key:nt.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"]}),nt.ONE_HOUR,new ae({key:nt.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"]}),nt.SIX_HOUR,new ae({key:nt.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"]}),nt.TWELVE_HOUR,new ae({key:nt.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"]}),nt.ONE_DAY,new ae({key:nt.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"]}),nt.SEVEN_DAY,new ae({key:nt.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"]}),nt.THIRTY_DAY,new ae({key:nt.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"]}),nt.NINETY_DAY,new ae({key:nt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>60*60*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.ONE_HUNDRED_EIGHTY_DAY,new ae({key:nt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>60*60*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.ONE_YEAR,new ae({key:nt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>60*60*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.CURRENT_WEEK,new w1({key:nt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Cs(No(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),nt.CURRENT_MONTH,new v1({key:nt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Mi(new Date);return(Cs(No(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.CURRENT_YEAR,new M1({key:nt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Cs(No(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.PREVIOUS_WEEK,new S1({key:nt.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"]}),nt.PREVIOUS_MONTH,new k1({key:nt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Mi(new Date),e=Mi(kh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Hh(t,e)),60*60*24*Wv(new Date().setMonth(new Date().getMonth()-1))+Sh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.PREVIOUS_YEAR,new D1({key:nt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Hh(n,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+Sh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Hh(n,t){return Vv(n.getTimezoneOffset()-t.getTimezoneOffset())}nt.FIFTEEN_MIN,nt.ONE_HOUR,nt.SIX_HOUR,nt.TWELVE_HOUR,nt.ONE_DAY,nt.SEVEN_DAY,nt.FIFTEEN_MIN,nt.ONE_HOUR,nt.SIX_HOUR,nt.TWELVE_HOUR,nt.ONE_DAY,nt.SEVEN_DAY,nt.THIRTY_DAY,nt.NINETY_DAY,nt.ONE_HUNDRED_EIGHTY_DAY,nt.ONE_YEAR,nt.CURRENT_WEEK,nt.CURRENT_MONTH,nt.CURRENT_YEAR,nt.PREVIOUS_WEEK,nt.PREVIOUS_MONTH,nt.PREVIOUS_YEAR;const T1=new Map(fh.map(n=>[n.code,{code:n.code,name:n.name}])),Uo=n=>{var t;return((t=T1.get(n))==null?void 0:t.name)||n};var Wh={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,a=1e9,o=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<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,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})()})(Wh);var C1=Wh.exports;const qo=x1(C1);var Yh;const jr=new Intl.NumberFormat(((Yh=document==null?void 0:document.documentElement)==null?void 0:Yh.lang)||"en-US");function ki({i18n:n}){const t=(i,s)=>{if(isNaN(i))return"0 B";const r=s?Math.pow(2,50):1e15,a=s?Math.pow(2,40):1e12,o=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=r?u=n.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=n.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},e=(i,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?n.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:r=!1,currency:a="USD",approximate:o=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,r);case"usd":return e(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${qo(i,{capital:!0})} ${c}`:i>=.01?`${jr.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:e,formatRange:(i,s,r,{isBytes1024:a=!1,currency:o="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(r,s);switch(r){case"bytes":return`${t(i,a)} - ${t(s,a)}`;case"usd":return`${e(i,o)} - ${e(s,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${qo(i,{capital:!0})} - ${qo(s,{capital:!0})} ${u}`}const h=i>=.01?`${jr.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${jr.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const Ur=n=>["interactive","zoom-interactive"].includes(n),Vh=(n,t,e,i)=>{var l,c;const{tooltip:s}=t;if(s.opacity===0&&!Ur(n.interactionMode)){n.showTooltip=!1;return}const{i18n:r}=mt.useI18n(),{formatUnit:a}=ki({i18n:r}),o=n.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(s.body&&!Ur(n.interactionMode)){const u=s.labelColors,h=((c=(l=t.chart.config)==null?void 0:l.options)==null?void 0:c.indexAxis)==="y"?"x":"y";n.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(s.dataPoints[0].parsed.x,e):As({tickValue:new Date(s.dataPoints[0].parsed.x),granularity:e}),n.tooltipSeries=s.dataPoints.map((f,m)=>{const g=f.parsed[h],_=a(g,n.units,{translateUnit:n.translateUnit}),x=f.dataset.label;return{backgroundColor:u[m].backgroundColor,borderColor:u[m].borderColor,label:x,value:_,rawValue:g,isSegmentEmpty:f.dataset.isSegmentEmpty}}).sort(o),n.left=`${s.x}px`,n.top=`${s.y}px`,n.showTooltip=!0}},$h=(n,t)=>{var a,o;const{tooltip:e}=t,{i18n:i}=mt.useI18n(),{formatUnit:s}=ki({i18n:i});if(e.opacity===0&&!Ur(n.interactionMode)){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(e.body&&!Ur(n.interactionMode)){const l=e.labelColors,c=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?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((h,f)=>{const m=u?h.parsed:h.parsed[c],g=s(m,n.units,{translateUnit:n.translateUnit});let _;return u?_=h.dataset.labels[h.dataIndex]:_=h.dataset.label,{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:_,value:g,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},E1=n=>n&&n.datasets&&n.datasets.length,O1=n=>E1(n)&&n.datasets.some(t=>t.data.length),P1=n=>n.datasets.some(t=>t.data[0]&&Do(t.data[0].x)),A1=n=>!!O1(n)&&n.datasets.some(t=>t.data.length==1),R1=n=>P1(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Xo=(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)},I1=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function jh(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Uh=(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)},L1=2,qh=10,Xh=12,qr=10,Gh="#6c7489",N1="#d60027",Go="#6c7489",F1="#995c00",B1="#ffc400",Ko="16px",z1="20px",H1="'Inter', Roboto, Helvetica, sans-serif",Kh={"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"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Xr=(n,t)=>(t||on)[n%on.length],Zh=(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),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},Qh="#6f7787",Jh={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"}},W1=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Jh[t])==null?void 0:e.background)||"#fafafa"},Y1={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},V1={"4XX":"#FFBA81","5XX":"#FF8484"},$1={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},j1="#dad4c7",tf="#afb7c5",U1=n=>{const t=Object.entries(Kh).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Kh.standard},Zo=(n,t,e,i)=>{let s;return e?s=tf:Array.isArray(i)?s=Xr(n,i):s=i[t],s||Xr(n)},Gr=n=>{switch(n){case"error":return N1;case"warning":return B1;case"neutral":return Gh;default:return Gh}},q1={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},X1=2,G1=0,Qo=new Map,ef=(n,t)=>{const{i18n:e}=mt.useI18n(),{formatBytes:i}=ki({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):jr.format(n)},K1=n=>{const e=document.createElement("canvas").getContext("2d"),i=Rt({});return e.font=i.string,e.measureText(n).width},Z1=()=>{const n="label_height";if(!Qo.has(n)){const t=Rt({});Qo.set(n,t.lineHeight)}return Qo.get(n)},Q1=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),J1=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Jo="#e0e4ea",tM={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"]},Os=(n,t)=>{let e=1;const i=tM[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},nf=new Map([[100,Os("100",[100,101,102,103])],[200,Os("200",[200,201,202,203,204,205,206,207,208,226])],[300,Os("300",[300,301,302,303,304,305,307,308])],[400,Os("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,Os("500",[500,501,502,503,504,505,506,507,508,510,511])]]),tl=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=nf.get(e);return i===void 0?Jo:i.get(t)??i.get(-1)??Jo},eM=n=>{const t=tl(n);return{solid:t,light:t}},Kr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=tl(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function sf(n,t,e){const i=nh(),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?oM(e,n):lM(e,n)}const aM={year:0,month:1,day:2,hour:3,minute:4,second:5};function oM(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=aM[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 el={},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")),cM=rf==="06/25/2014, 00:00:00"||rf==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function uM(n){return el[n]||(el[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"})),el[n]}function af(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const of=36e5,dM=6e4,nl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function il(n,t,e){if(!n)return 0;let i=nl.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=nl.timezoneHH.exec(n),i)return s=parseInt(i[1],10),lf(s)?-(s*of):NaN;if(i=nl.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return lf(s,a)?(r=Math.abs(s)*of+a*dM,i[1]==="+"?-r:r):NaN}if(mM(n)){t=new Date(t||Date.now());const a=e?t:hM(t),o=sl(a,n);return-(e?o:fM(t,o,n))}return NaN}function hM(n){return af(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function sl(n,t){const e=rM(n,t),i=af(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 s=n.getTime()-t;const r=sl(new Date(s),e);if(t===r)return t;s-=r-t;const a=sl(new Date(s),e);return r===a?r:Math.max(r,a)}function lf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const cf={};function mM(n){if(cf[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),cf[n]=!0,!0}catch{return!1}}const gM=60*1e3,pM={X:function(n,t,e){const i=rl(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return uf(i);case"XXXX":case"XX":return Di(i);case"XXXXX":case"XXX":default:return Di(i,":")}},x:function(n,t,e){const i=rl(e.timeZone,n);switch(t){case"x":return uf(i);case"xxxx":case"xx":return Di(i);case"xxxxx":case"xxx":default:return Di(i,":")}},O:function(n,t,e){const i=rl(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+yM(i,":");case"OOOO":default:return"GMT"+Di(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 rl(n,t){const e=n?il(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 Zr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Di(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Zr(Math.floor(i/60),2),r=Zr(Math.floor(i%60),2);return e+s+t+r}function uf(n,t){return n%60===0?(n>0?"-":"+")+Zr(Math.abs(n)/60,2):Di(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+Zr(r,2)}function df(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 bM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,al=36e5,hf=6e4,_M=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:bM};function ff(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?_M: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=xM(n),{year:s,restDateString:r}=wM(i.date,e),a=vM(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=MM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=il(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=df(new Date(o+l)),c=df(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function xM(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 wM(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 vM(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,pf(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return DM(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return pf(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,yf(s)?mf(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return yf(s,a)?mf(t,s,a):new Date(NaN)}return null}function MM(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ol(t)?t%24*al:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ol(t,e)?t%24*al+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 ol(t,e,s)?t%24*al+e*hf+s*1e3:NaN}return null}function mf(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 SM=[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 gf(n){return n%400===0||n%4===0&&n%100!==0}function pf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gf(n);if(i&&e>kM[t]||!i&&e>SM[t])return!1}return!0}function DM(n,t){if(t<1)return!1;const e=gf(n);return!(e&&t>366||!e&&t>365)}function yf(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ol(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const TM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ll(n,t,e={}){t=String(t);const i=t.match(TM);if(i){const s=ff(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+pM[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return Fr(n,t,e)}function CM(n,t,e){n=ff(n,e);const i=il(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 Ps(n,t,e,i){return i={...i,timeZone:t,originalDate:n},ll(CM(n,t,{timeZone:i.timeZone}),e,i)}const EM=(n,t)=>`${Ps(n,t,"yyyy")} W${Ps(n,t,"II")}`,cl="yyyy-MM-dd h:mm:ss a",ul="h:mm:ss a",Qn="yyyy-MM-dd h:mm a",Ti="h:mm a",OM="yyyy-MM-dd",dl="MMM dd, yyyy h:mm:ss a",En="MMM dd, yyyy h:mm a",PM={secondly:n=>n?cl:ul,tenSecondly:n=>n?cl:ul,thirtySecondly:n=>n?cl:ul,minutely:n=>n?Qn:Ti,fiveMinutely:n=>n?Qn:Ti,tenMinutely:n=>n?Qn:Ti,thirtyMinutely:n=>n?Qn:Ti,hourly:n=>n?Qn:Ti,twoHourly:n=>n?Qn:Ti,twelveHourly:()=>Qn,daily:()=>OM},AM={secondly:()=>dl,tenSecondly:()=>dl,thirtySecondly:()=>dl,minutely:()=>En,fiveMinutely:()=>En,tenMinutely:()=>En,thirtyMinutely:()=>En,hourly:()=>En,twoHourly:()=>En,twelveHourly:()=>En,daily:()=>En};function bf({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:r,defaultFormat:a}){const o=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return EM(n,o);if(s&&s[t]){const l=s[t](i);return Ps(n,o,l)}if(r&&r[t]){const l=r[t]();return Ps(n,o,l)}return Ps(n,o,a)}const RM=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>bf({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:PM,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),As=({tickValue:n,granularity:t,timezone:e})=>bf({tickValue:n,granularity:t,timezone:e,tooltipMap:AM,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),IM=n=>{var e,i,s,r,a;const{i18n:t}=mt.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:((a=(r=(s=n.response)==null?void 0:s.data)==null?void 0:r.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(n==null?void 0:n.message)}};function LM(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Te.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=Xo(c,h,f),g=c.y,_=c.x<f?"left":"center";return{x:m-n.tooltipState.offsetX,y:g-n.tooltipState.offsetY,xAlign:_}},so.modes.customInteractionMode=function(l,c){const u=Sn(c,l),h=[];return so.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?qh:Xh,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"}},a=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>qr?c.slice(0,qr)+"...":c):l.getLabelForValue(Number(c)),o=d.computed(()=>{var l,c,u,h,f,m,g,_;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="y"?!it((l=n.metricAxesTitle)==null?void 0:l.value):!it((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:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="x"?!it((f=n.metricAxesTitle)==null?void 0:f.value):!it((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:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{$h(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.getCurrentInstance()&&d.onUnmounted(()=>{Te.positioners[e]&&delete Te.positioners[e]}),o}ye.register(...Y0);const NM=(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 FM(n,t,e,i,s){const r=d.shallowRef(null),a=(o,l)=>{if(t.value)return new ye(t.value,{type:n,data:o,plugins:i,options:l})};return d.onMounted(()=>{r.value=a(e.value,s.value)}),d.onBeforeUnmount(()=>{it(r.value)||r.value.destroy()}),d.watch(e,(o,l)=>{if(NM(l,o)&&!it(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else it(r.value)||r.value.destroy(),r.value=a(o,s.value)}),d.watch(t,()=>{it(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),d.watch(s,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(it(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}var xe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _f={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,a=1e9,o=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<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,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})()})(_f);var BM=_f.exports;const Qr=hl(BM);function zM(n,t,e){const{i18n:i}=mt.useI18n(),{formatBytes:s}=ki({i18n:i}),{translateUnit:r}=mt.useTranslatedUnits();return{legendValues:d.computed(()=>n.value.datasets.reduce((o,l)=>{const c=l.total?l.total:l.data.reduce((h,f)=>h+(typeof f=="number"?Number(f)||0:Number(f&&f.y)||0),0);let u;if(e.value==="bytes")u=s(c);else{const h=r(e.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:Qr(c,{capital:!0}),unit:h})||`${Qr(c,{capital:!0})} ${e.value}`}return{...o,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}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?`${$o(e)} - ${$o(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})}};Te.positioners[e]=function(r,a){if(!r.length)return!1;const o=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=o.width/2,u=Xo(a,l,c),h=a.y,f=a.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=>{$h(n.tooltipState,r)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return d.onUnmounted(()=>{Te.positioners[e]&&delete Te.positioners[e]}),{options:s}}function YM(n){const t=d.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return RM({tickValue:h,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!it((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=d.computed(()=>{var l,c;return{title:{display:!it((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:3},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};Te.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,_=Xo(c,h,m);let x=I1(c,f,g);const v=c.y<g?"top":"bottom",S=c.x<m?"left":"center";return f>u.height&&(x=0),{x:_,y:x,xAlign:S,yAlign:v}};const a=d.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return aw(l)>24||u.getDate()!==c.getDate()}),o=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=>{Vh(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:(c=n.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.onUnmounted(()=>{Te.positioners[s]&&delete Te.positioners[s]}),{options:o}}function VM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=mt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Xr(i.indexOf(u),on),data:a.map((h,f)=>e?r[`${h.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=Zo(h,u.name,u.id==="empty",o);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:a.map(m=>r[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function $M(n,t){const{i18n:e}=mt.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:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0,u=c&&o.length>1;if(!s.length||!a)return{datasets:[],labels:[]};const h=c&&o||a,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(l?s.flatMap(b=>a.map((M,E)=>{const R=b.event[f],I=c?`${R},${M}`:`${E},${M}`,B=b.event[M];return[I,B]})):s.map(b=>{const M=c?`${b.event[f]},${b.event[m]}`:`${f},${m}`,E=b.event[a[0]];return[M,E]})),_=Object.keys(g).reduce((b,M)=>{const[E]=M.split(","),R=g[M];return b[E]?b[E]+=R:b[E]=R,b},{}),x=Object.entries(_).sort(([,b],[,M])=>Number(M)-Number(b)).map(([b])=>b),v=r[f],S=r[m];let k=c&&v&&Object.entries(v).map(([b,M])=>({id:b,name:M.name}))||a.map(b=>({id:b,name:b})),C=c&&S&&Object.entries(S).map(([b,M])=>({id:b,name:M.name}))||a.map(b=>({id:b,name:b}));if(c&&f==="country_code"&&(k=k.map(b=>({...b,name:Uo(b.id)||b.name}))),c&&m==="country_code"&&(C=C.map(b=>({...b,name:Uo(b.id)||b.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(k.sort((b,M)=>x.indexOf(b.id)-x.indexOf(M.id)),C.sort((b,M)=>x.indexOf(b.id)-x.indexOf(M.id))),!k||!C)return{labels:[],datasets:[]};const A=VM({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:C,pivotRecords:g,rowLabels:k,colorPalette:n.colorPalette||on}),O=c?k.map(b=>e&&e.te(`chartLabels.${b.name}`)&&e.t(`chartLabels.${b.name}`)||b.name):a.map(b=>e&&e.te(`chartLabels.${b}`)&&e.t(`chartLabels.${b}`)||b),T=k.map(b=>b.id==="empty");return{labels:O,datasets:A,isLabelEmpty:T,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const jM=(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 oh(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},qM=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return jM(o,l,e)};function XM(n,t){const{i18n:e}=mt.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:a,start_ms:o,end_ms:l}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||a,u=c&&c[0],h=r[u];let f=r&&h&&Object.keys(h).map(C=>({id:C,name:h[C].name}))||a.map(C=>({id:C,name:C}));u==="country_code"&&(f=f.map(C=>({...C,name:Uo(C.id)||C.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(o),_=qM(o,l,m,g,s),x=new Set,v=s!=null&&s.length?s.reduce((C,A)=>{const O=new Date(A.timestamp).valueOf(),T=A.event;for(const p of a)x.add(p),O in C||(C[O]={}),p in C[O]||(C[O][p]={});for(const p of a)f.forEach(b=>{T[u]===b.id||p===b.id?(C[O][p]||(C[O][p]={}),C[O][p][b.name]=Math.round(Number(T[p])*1e3)/1e3):c.length||(C[O][p]||(C[O][p]={}),C[O][p][b.name]=Math.round(Number(T[b.id])*1e3)/1e3)});return C},{}):{},k=[...a.length===1?a.flatMap(C=>f.map(A=>[C,A.name,A.id==="empty"])):f.map(C=>[C.name,C.name,C.id==="empty"])].map(([C,A,O],T)=>{const p=_.map(R=>R in v&&C in v[R]?{x:R,y:v[R][C][A]||0}:{x:R,y:0});let{colorPalette:b,fill:M}=n;it(b)&&(b=on);const E=Zo(T,A,O,b);return{rawDimension:A,rawMetric:C,label:e&&e.te(`chartLabels.${A}`)&&e.t(`chartLabels.${A}`)||A,borderColor:E,backgroundColor:E,data:p,total:p.reduce((R,{y:I})=>R+Number(I),0),...q1,fill:M,borderWidth:M?G1:X1,isSegmentEmpty:O}});return u==="status_code"||u==="status_code_grouped"?k.sort((C,A)=>(C.label??"")<(A.label??"")?-1:1):k.sort((C,A)=>Number(C.total)<Number(A.total)?-1:1),{datasets:k}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const GM=(n,t)=>{d.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function KM(){const{i18n:n}=mt.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 ZM="analytics-query-provider",xf=2;function QM(){const n=d.inject(ZM);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function fl(n){return d.getCurrentScope()?(d.onScopeDispose(n),!0):!1}const wf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const JM=n=>n!=null,tS=Object.prototype.toString,eS=n=>tS.call(n)==="[object Object]";function Jr(n){return Array.isArray(n)?n:[n]}function nS(n){return d.getCurrentInstance()}function iS(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 o=[...n.value];o[i]=s,n.value=o}else{const o={...n.value,[i]:s};Object.setPrototypeOf(o,Object.getPrototypeOf(n.value)),n.value=o}else n.value[i]=s}}));return e}function sS(n,t=!0,e){nS()?d.onMounted(n,e):t?n():d.nextTick(n)}function rS(n,t,e){return d.watch(n,t,{...e,immediate:!0})}const ta=wf?window:void 0;function Ci(n){var t;const e=d.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Rs(...n){const t=[],e=()=>{t.forEach(o=>o()),t.length=0},i=(o,l,c,u)=>(o.addEventListener(l,c,u),()=>o.removeEventListener(l,c,u)),s=d.computed(()=>{const o=Jr(d.toValue(n[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),r=rS(()=>{var o,l;return[(l=(o=s.value)==null?void 0:o.map(c=>Ci(c)))!=null?l:[ta].filter(c=>c!=null),Jr(d.toValue(s.value?n[1]:n[0])),Jr(d.unref(s.value?n[2]:n[1])),d.toValue(s.value?n[3]:n[2])]},([o,l,c,u])=>{if(e(),!(o!=null&&o.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=eS(u)?{...u}:u;t.push(...o.flatMap(f=>l.flatMap(m=>c.map(g=>i(f,m,g,h)))))},{flush:"post"}),a=()=>{r(),e()};return fl(e),a}function aS(){const n=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{n.value=!0},t),n}function vf(n){const t=aS();return d.computed(()=>(t.value,!!n()))}function oS(n,t,e={}){const{window:i=ta,...s}=e;let r;const a=vf(()=>i&&"MutationObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const f=d.toValue(n),m=Jr(f).map(Ci).filter(JM);return new Set(m)}),c=d.watch(()=>l.value,f=>{o(),a.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(),o()};return fl(h),{isSupported:a,stop:h,takeRecords:u}}function lS(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:a,onMove:o,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=ta,containerElement:m,handle:g=n,buttons:_=[0]}=t,x=d.ref((e=d.toValue(u))!=null?e:{x:0,y:0}),v=d.ref(),S=T=>i?i.includes(T.pointerType):!0,k=T=>{d.toValue(s)&&T.preventDefault(),d.toValue(r)&&T.stopPropagation()},C=T=>{var p;if(!d.toValue(_).includes(T.button)||d.toValue(t.disabled)||!S(T)||d.toValue(a)&&T.target!==d.toValue(n))return;const b=d.toValue(m),M=(p=b==null?void 0:b.getBoundingClientRect)==null?void 0:p.call(b),E=d.toValue(n).getBoundingClientRect(),R={x:T.clientX-(b?E.left-M.left+b.scrollLeft:E.left),y:T.clientY-(b?E.top-M.top+b.scrollTop:E.top)};(c==null?void 0:c(R,T))!==!1&&(v.value=R,k(T))},A=T=>{if(d.toValue(t.disabled)||!S(T)||!v.value)return;const p=d.toValue(m),b=d.toValue(n).getBoundingClientRect();let{x:M,y:E}=x.value;(h==="x"||h==="both")&&(M=T.clientX-v.value.x,p&&(M=Math.min(Math.max(0,M),p.scrollWidth-b.width))),(h==="y"||h==="both")&&(E=T.clientY-v.value.y,p&&(E=Math.min(Math.max(0,E),p.scrollHeight-b.height))),x.value={x:M,y:E},o==null||o(x.value,T),k(T)},O=T=>{d.toValue(t.disabled)||!S(T)||v.value&&(v.value=void 0,l==null||l(x.value,T),k(T))};if(wf){const T=()=>{var p;return{capture:(p=t.capture)!=null?p:!0,passive:!d.toValue(s)}};Rs(g,"pointerdown",C,T),Rs(f,"pointermove",A,T),Rs(f,"pointerup",O,T)}return{...iS(x),position:x,isDragging:d.computed(()=>!!v.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function cS(n,t,e={}){const{window:i=ta,...s}=e;let r;const a=vf(()=>i&&"ResizeObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const h=d.toValue(n);return Array.isArray(h)?h.map(f=>Ci(f)):[Ci(h)]}),c=d.watch(l,h=>{if(o(),a.value&&i){r=new ResizeObserver(t);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{o(),c()};return fl(u),{isSupported:a,stop:u}}function uS(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:a="sync"}=t,o=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 v=Ci(n);if(!v){e&&(o.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 S=v.getBoundingClientRect();o.value=S.height,l.value=S.bottom,c.value=S.left,u.value=S.right,h.value=S.top,f.value=S.width,m.value=S.x,g.value=S.y}function x(){a==="sync"?_():a==="next-frame"&&requestAnimationFrame(()=>_())}return cS(n,x),d.watch(()=>Ci(n),v=>!v&&x()),oS(n,x,{attributeFilter:["style","class"]}),s&&Rs("scroll",x,{capture:!0,passive:!0}),i&&Rs("resize",x,{passive:!0}),sS(()=>{r&&x()}),{height:o,bottom:l,left:c,right:u,top:h,width:f,x:m,y:g,update:x}}function dS(n,t){const{top:e,left:i}=uS(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 hS=({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 a=(e-t)/n;let o=0;for(let l=0;l<n;l++){const c=t+l*a,u=t+(l+1)*a;let h=0;for(;o<s.length&&s[o]>=c&&s[o]<=u;)h++,o++;r.push([Math.ceil(c),h])}return r},Mf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Is=d.ref({}),fS=n=>(Is.value[n]||(Is.value[n]=Mf()),Is.value[n]),mS=(n,t)=>{const e=Is.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 Is.value[t])};function gS({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:s=void 0,minCount:r=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:l}){const u=e!==void 0&&n!==void 0?fS(e):Mf(),h=n!==void 0?n:"static-chart-key",f=d.computed(()=>t.reduce((M,{timestamps:E})=>[...M,...E],[])),m=d.computed(()=>i||f.value.reduce((M,E)=>M===0?E:Math.min(M,E),0)),g=d.computed(()=>s||f.value.reduce((M,E)=>Math.max(M,E),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=g.value,o!==void 0&&(u.renderPoints[h]=o)});const _=d.computed(()=>Object.values(u.minStamps).reduce((M,E)=>M===0?E:Math.min(M,E),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((M,E)=>Math.max(M,E),0)),v=d.computed(()=>{const M=Object.values(u.renderPoints);return M.length===0?24:M.reduce((E,R)=>Math.max(E,R),2)}),S=d.computed(()=>{const M=x.value-_.value;return Math.ceil(M/v.value)}),k=d.computed(()=>t.length>1),C=d.computed(()=>t.map(({timestamps:M,color:E,label:R})=>({data:hS({bucketCount:v.value,minStamp:_.value,maxStamp:x.value,timestamps:M}).map(([U,J])=>({x:U,y:J})),label:R,...(l==="sparkline_bar"||k.value)&&E&&{backgroundColor:E},...l!=="sparkline_bar"&&E&&{borderColor:E},...k.value&&l!=="sparkline_bar"&&{fill:!0}}))),A=d.computed(()=>{var R,I;const M=((I=(R=C.value[0])==null?void 0:R.data)==null?void 0:I.length)??0,E=[];for(let B=0;B<M;B++){let U=0;for(let J=0;J<C.value.length;J++)U+=C.value[J].data[B].y;E.push(U)}return E}),O=d.computed(()=>{const M=A.value.reduce((E,R)=>Math.max(E,R),0);return Math.max(M,a??0)}),T=d.computed(()=>{const M=C.value.reduce((I,{data:B})=>[...I,...B.map(({y:U})=>U)],[]),E=M.length?M[0]:0,R=M.reduce((I,B)=>Math.min(I,B),E);return r===void 0?R:Math.min(R,r)});d.watchEffect(()=>{u.maxCounts[h]=O.value,u.minCounts[h]=T.value});const p=d.computed(()=>{const M=Object.values(u.minCounts),E=M.length?M[0]:0;return M.reduce((R,I)=>Math.min(R,I),E)}),b=d.computed(()=>Object.values(u.maxCounts).reduce((M,E)=>Math.max(M,E),0));return d.onUnmounted(()=>{n!==void 0&&e!==void 0&&mS(n,e)}),{syncedMinStamp:_,syncedMaxStamp:x,syncedRenderPoints:v,syncedChartDatasets:C,syncedGroupSizeMs:S,syncedMinCount:p,syncedMaxCount:b}}const mt={useBarChartOptions:LM,useChartJSCommon:FM,useChartLegendValues:zM,useChartSelectedRange:HM,useExploreResultToDatasets:$M,useExploreResultToTimeDataset:XM,useDonutChartOptions:WM,useLineChartOptions:YM,useI18n:Bm,useReportChartDataForSynthetics:GM,useTranslatedUnits:KM,useEvaluateFeatureFlag:QM,useTooltipAbsolutePosition:dS,useSparklineSync:gS};var we=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(we||{});/*!
16
+ */class oy{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,r){const s=n.listeners[r],a=n.duration;s.forEach(o=>o({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=eu.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,o=!1,c;for(;a>=0;--a)c=s[a],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(t),o=!0):(s[a]=s[s.length-1],s.pop());o&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var sn=new oy;const Ru="transparent",ly={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=ou(e||Ru),r=i.valid&&ou(t||Ru);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class cy{constructor(t,n,i,r){const s=n[i];r=ur([t.to,r,s,t.from]);const a=ur([t.from,s,r]);this._active=!0,this._fn=t.fn||ly[t.type||typeof a],this._easing=sr[t.easing]||sr.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ur([t.to,n,r,t.from]),this._from=ur([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,o=this._to;let c;if(this._active=s!==o&&(a||n<i),!this._active){this._target[r]=o,this._notify(!0);return}if(n<0){this._target[r]=s;return}c=n/i%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[r]=this._fn(s,o,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][n]()}}class ao{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ft(t))return;const n=Object.keys(Pt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!ft(s))return;const a={};for(const o of n)a[o]=s[o];(wt(s.properties)&&s.properties||[r]).forEach(o=>{(o===r||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,n){const i=n.options,r=dy(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&uy(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(n),o=Date.now();let c;for(c=a.length-1;c>=0;--c){const l=a[c];if(l.charAt(0)==="$")continue;if(l==="options"){r.push(...this._animateOptions(t,n));continue}const u=n[l];let h=s[l];const f=i.get(l);if(h)if(f&&h.active()){h.update(f,u,o);continue}else h.cancel();if(!f||!f.duration){t[l]=u;continue}s[l]=h=new cy(f,t,l,u),r.push(h)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return sn.add(this._chart,i),!0}}function uy(e,t){const n=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=e[i[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function dy(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Au(e,t){const n=e&&e.options||{},i=n.reverse,r=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function hy(e,t,n){if(n===!1)return!1;const i=Au(e,n),r=Au(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function fy(e){let t,n,i,r;return ft(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r,disabled:e===!1}}function Iu(e,t){const n=[],i=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)n.push(i[r].index);return n}function Lu(e,t,n,i={}){const r=e.keys,s=i.mode==="single";let a,o,c,l;if(t===null)return;let u=!1;for(a=0,o=r.length;a<o;++a){if(c=+r[a],c===n){if(u=!0,i.all)continue;break}l=e.values[c],Rt(l)&&(s||t===0||$e(t)===$e(l))&&(t+=l)}return!u&&!i.all?0:t}function my(e,t){const{iScale:n,vScale:i}=t,r=n.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(e),o=new Array(a.length);let c,l,u;for(c=0,l=a.length;c<l;++c)u=a[c],o[c]={[r]:u,[s]:e[u]};return o}function oo(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function gy(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function py(e){const{min:t,max:n,minDefined:i,maxDefined:r}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function yy(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Nu(e,t,n,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=e[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function Fu(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:a,index:o}=i,c=s.axis,l=a.axis,u=gy(s,a,i),h=t.length;let f;for(let m=0;m<h;++m){const g=t[m],{[c]:y,[l]:x}=g,v=g._stacks||(g._stacks={});f=v[l]=yy(r,u,y),f[o]=x,f._top=Nu(f,a,!0,i.type),f._bottom=Nu(f,a,!1,i.type);const S=f._visualValues||(f._visualValues={});S[o]=x}}function lo(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function by(e,t){return Cn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function _y(e,t,n){return Cn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function dr(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const co=e=>e==="reset"||e==="none",Bu=(e,t)=>t?e:Object.assign({},e),xy=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Iu(n,!0),values:null};class Fe{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=oo(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&&dr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,s=n.xAxisID=rt(i.xAxisID,lo(t,"x")),a=n.yAxisID=rt(i.yAxisID,lo(t,"y")),o=n.rAxisID=rt(i.rAxisID,lo(t,"r")),c=n.indexAxis,l=n.iAxisID=r(c,s,a,o),u=n.vAxisID=r(c,a,s,o);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(o),n.iScale=this.getScaleForId(l),n.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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Jc(this._data,this),t._stacked&&dr(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(ft(n)){const r=this._cachedMeta;this._data=my(n,r)}else if(i!==n){if(i){Jc(i,this);const r=this._cachedMeta;dr(r),r._parsed=[]}n&&Object.isExtensible(n)&&rp(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=oo(n.vScale,n),n.stack!==i.stack&&(r=!0,dr(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&(Fu(this,n._parsed),n._stacked=oo(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,o=s.axis;let c=t===0&&n===r.length?!0:i._sorted,l=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=r,i._sorted=!0,f=r;else{wt(r[t])?f=this.parseArrayData(i,r,t,n):ft(r[t])?f=this.parseObjectData(i,r,t,n):f=this.parsePrimitiveData(i,r,t,n);const m=()=>h[o]===null||l&&h[o]<l[o];for(u=0;u<n;++u)i._parsed[u+t]=h=f[u],c&&(m()&&(c=!1),l=h);i._sorted=c}a&&Fu(this,f)}parsePrimitiveData(t,n,i,r){const{iScale:s,vScale:a}=t,o=s.axis,c=a.axis,l=s.getLabels(),u=s===a,h=new Array(r);let f,m,g;for(f=0,m=r;f<m;++f)g=f+i,h[f]={[o]:u||s.parse(l[g],g),[c]:a.parse(n[g],g)};return h}parseArrayData(t,n,i,r){const{xScale:s,yScale:a}=t,o=new Array(r);let c,l,u,h;for(c=0,l=r;c<l;++c)u=c+i,h=n[u],o[c]={x:s.parse(h[0],u),y:a.parse(h[1],u)};return o}parseObjectData(t,n,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:o="x",yAxisKey:c="y"}=this._parsing,l=new Array(r);let u,h,f,m;for(u=0,h=r;u<h;++u)f=u+i,m=n[f],l[u]={x:s.parse(kn(m,o),f),y:a.parse(kn(m,c),f)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const r=this.chart,s=this._cachedMeta,a=n[t.axis],o={keys:Iu(r,!0),values:n._stacks[t.axis]._visualValues};return Lu(o,a,s.index,{mode:i})}updateRangeFromParsed(t,n,i,r){const s=i[n.axis];let a=s===null?NaN:s;const o=r&&i._stacks[n.axis];r&&o&&(r.values=o,a=Lu(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,o=this._getOtherScale(t),c=xy(n,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=py(o);let f,m;function g(){m=r[f];const y=m[o.axis];return!Rt(m[t.axis])||u>y||h<y}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(l,t,m,c),s));++f);if(s){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(l,t,m,c);break}}return l}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=n.length;r<s;++r)a=n[r][t.axis],Rt(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,r=n.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=fy(rt(this.options.clip,hy(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,r=i.data||[],s=n.chartArea,a=[],o=this._drawStart||0,c=this._drawCount||r.length-o,l=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,s,o,c),u=o;u<o+c;++u){const h=r[u];h.hidden||(h.active&&l?a.push(h):h.draw(t,s))}for(u=0;u<a.length;++u)a[u].draw(t,s)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=_y(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=by(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const r=n==="active",s=this._cachedDataOpts,a=t+"-"+n,o=s[a],c=this.enableOptionSharing&&pe(i);if(o)return Bu(o,c);const l=this.chart.config,u=l.datasetElementScopeKeys(this._type,t),h=r?[`${t}Hover`,"hover",t,""]:[t,""],f=l.getOptionScopes(this.getDataset(),u),m=Object.keys(Pt.elements[t]),g=()=>this.getContext(i,r,n),y=l.resolveNamedOptions(f,m,g,h);return y.$shared&&(y.$shared=c,s[a]=Object.freeze(Bu(y,c))),y}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${n}`,o=s[a];if(o)return o;let c;if(r.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),h);c=u.createResolver(f,this.getContext(t,i,n))}const l=new ao(r,c&&c.animations);return c&&c._cacheable&&(s[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||co(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:a}}updateElement(t,n,i,r){co(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!co(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,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 n=this._data,i=this._cachedMeta.data;for(const[o,c,l]of this._syncList)this[o](c,l);this._syncList=[];const r=i.length,s=n.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,n,i=!0){const r=this._cachedMeta,s=r.data,a=t+n;let o;const c=l=>{for(l.length+=n,o=l.length-1;o>=a;o--)l[o]=l[o-n]};for(c(s),o=t;o<a;++o)s[o]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(t,n),i&&this.updateElements(s,t,n,"reset")}updateElements(t,n,i,r){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,n);i._stacked&&dr(i,r)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,r]=t;this[n](i,r)}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,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}R(Fe,"defaults",{}),R(Fe,"datasetElementType",null),R(Fe,"dataElementType",null);function wy(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=n.length;r<s;r++)i=i.concat(n[r].controller.getAllParsedValues(e));e._cache.$bar=tu(i.sort((r,s)=>r-s))}return e._cache.$bar}function vy(e){const t=e.iScale,n=wy(t,e.type);let i=t._length,r,s,a,o;const c=()=>{a===32767||a===-32768||(pe(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(r=0,s=n.length;r<s;++r)a=t.getPixelForValue(n[r]),c();for(o=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),c();return i}function Sy(e,t,n,i){const r=n.barThickness;let s,a;return it(r)?(s=t.min*n.categoryPercentage,a=n.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[e]-s/2}}function ky(e,t,n,i){const r=t.pixels,s=r[e];let a=e>0?r[e-1]:null,o=e<r.length-1?r[e+1]:null;const c=n.categoryPercentage;a===null&&(a=s-(o===null?t.end-t.start:o-s)),o===null&&(o=s+s-a);const l=s-(s-Math.min(a,o))/2*c;return{chunk:Math.abs(o-a)/2*c/i,ratio:n.barPercentage,start:l}}function My(e,t,n,i){const r=n.parse(e[0],i),s=n.parse(e[1],i),a=Math.min(r,s),o=Math.max(r,s);let c=a,l=o;Math.abs(a)>Math.abs(o)&&(c=o,l=a),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:r,end:s,min:a,max:o}}function zu(e,t,n,i){return wt(e)?My(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Hu(e,t,n,i){const r=e.iScale,s=e.vScale,a=r.getLabels(),o=r===s,c=[];let l,u,h,f;for(l=n,u=n+i;l<u;++l)f=t[l],h={},h[r.axis]=o||r.parse(a[l],l),c.push(zu(f,h,s,l));return c}function uo(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Ty(e,t,n){return e!==0?$e(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Dy(e){let t,n,i,r,s;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:n,end:i,reverse:t,top:r,bottom:s}}function Cy(e,t,n,i){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:o,reverse:c,top:l,bottom:u}=Dy(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=l:(n._bottom||0)===i?r=u:(s[Vu(u,a,o,c)]=!0,r=l)),s[Vu(r,a,o,c)]=!0,e.borderSkipped=s}function Vu(e,t,n,i){return i?(e=Ey(e,t,n),e=$u(e,n,t)):e=$u(e,t,n),e}function Ey(e,t,n){return e===t?n:e===n?t:e}function $u(e,t,n){return e==="start"?t:e==="end"?n:e}function Oy(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class hr extends Fe{parsePrimitiveData(t,n,i,r){return Hu(t,n,i,r)}parseArrayData(t,n,i,r){return Hu(t,n,i,r)}parseObjectData(t,n,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:o="x",yAxisKey:c="y"}=this._parsing,l=s.axis==="x"?o:c,u=a.axis==="x"?o:c,h=[];let f,m,g,y;for(f=i,m=i+r;f<m;++f)y=n[f],g={},g[s.axis]=s.parse(kn(y,l),f),h.push(zu(kn(y,u),g,a,f));return h}updateRangeFromParsed(t,n,i,r){super.updateRangeFromParsed(t,n,i,r);const s=i._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:r}=n,s=this.getParsed(t),a=s._custom,o=uo(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:o}}=this,c=o.getBasePixel(),l=o.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,r);for(let m=n;m<n+i;m++){const g=this.getParsed(m),y=s||it(g[o.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),v=(g._stacks||{})[o.axis],S={horizontal:l,base:y.base,enableBorderRadius:!v||uo(g._custom)||a===v._top||a===v._bottom,x:l?y.head:x.center,y:l?x.center:y.head,height:l?x.size:Math.abs(y.size),width:l?Math.abs(y.size):x.size};f&&(S.options=h||this.resolveDataElementOptions(m,t[m].active?"active":r));const k=S.options||t[m].options;Cy(S,k,v,a),Oy(S,k,u.ratio),this.updateElement(t[m],m,S,r)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(n),c=o&&o[i.axis],l=u=>{const h=u._parsed.find(m=>m[i.axis]===c),f=h&&h[u.vScale.axis];if(it(f)||isNaN(f))return!0};for(const u of r)if(!(n!==void 0&&l(u))&&((s===!1||a.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[rt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const r=this._getStacks(t,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,a;for(s=0,a=n.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const o=t.barThickness;return{min:o||vy(n),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,o=s||0,c=this.getParsed(t),l=c._custom,u=uo(l);let h=c[n.axis],f=0,m=i?this.applyStack(n,c,i):h,g,y;m!==h&&(f=m-h,m=h),u&&(h=l.barStart,m=l.barEnd-l.barStart,h!==0&&$e(h)!==$e(l.barEnd)&&(f=0),f+=h);const x=!it(s)&&!u?s:f;let v=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(f+m):g=v,y=g-v,Math.abs(y)<a){y=Ty(y,n,o)*a,h===o&&(v-=y/2);const S=n.getPixelForDecimal(0),k=n.getPixelForDecimal(1),C=Math.min(S,k),E=Math.max(S,k);v=Math.max(Math.min(v,E),C),g=v+y,i&&!u&&(c._stacks[n.axis]._visualValues[r]=n.getValueForPixel(g)-n.getValueForPixel(v))}if(v===n.getPixelForValue(o)){const S=$e(y)*n.getLineWidthForValue(o)/2;v+=S,y-=S}return{size:y,base:v,head:g,center:g+y/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=rt(r.maxBarThickness,1/0);let o,c;const l=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(t):n.stackCount,h=r.barThickness==="flex"?ky(t,n,r,u*l):Sy(t,n,r,u*l),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(rt(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+m;o=h.start+h.chunk*g+h.chunk/2,c=Math.min(a,h.chunk*h.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),c=Math.min(a,n.min*n.ratio);return{base:o-c/2,head:o+c/2,center:o,size:c}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}R(hr,"id","bar"),R(hr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(hr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ms extends Fe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,r){const s=super.parsePrimitiveData(t,n,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,n,i,r){const s=super.parseArrayData(t,n,i,r);for(let a=0;a<s.length;a++){const o=n[i+a];s[a]._custom=rt(o[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,n,i,r){const s=super.parseObjectData(t,n,i,r);for(let a=0;a<s.length;a++){const o=n[i+a];s[a]._custom=rt(o&&o.r&&+o.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),o=r.getLabelForValue(a.x),c=s.getLabelForValue(a.y),l=a._custom;return{label:i[t]||"",value:"("+o+", "+c+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:c,includeOptions:l}=this._getSharedOptions(n,r),u=a.axis,h=o.axis;for(let f=n;f<n+i;f++){const m=t[f],g=!s&&this.getParsed(f),y={},x=y[u]=s?a.getPixelForDecimal(.5):a.getPixelForValue(g[u]),v=y[h]=s?o.getBasePixel():o.getPixelForValue(g[h]);y.skip=isNaN(x)||isNaN(v),l&&(y.options=c||this.resolveDataElementOptions(f,m.active?"active":r),s&&(y.options.radius=0)),this.updateElement(m,f,y,r)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,n);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return n!=="active"&&(r.radius=0),r.radius+=rt(i&&i._custom,s),r}}R(Ms,"id","bubble"),R(Ms,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),R(Ms,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Py(e,t,n){let i=1,r=1,s=0,a=0;if(t<Ct){const o=e,c=o+t,l=Math.cos(o),u=Math.sin(o),h=Math.cos(c),f=Math.sin(c),m=(k,C,E)=>rr(k,o,c,!0)?1:Math.max(C,C*n,E,E*n),g=(k,C,E)=>rr(k,o,c,!0)?-1:Math.min(C,C*n,E,E*n),y=m(0,l,h),x=m(Ot,u,f),v=g(ut,l,h),S=g(ut+Ot,u,f);i=(y-v)/2,r=(x-S)/2,s=-(y+v)/2,a=-(x+S)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class an extends Fe{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=c=>+i[c];if(ft(i[t])){const{key:c="value"}=this._parsing;s=l=>+kn(i[l],c)}let a,o;for(a=t,o=t+n;a<o;++a)r._parsed[a]=s(a)}}_getRotation(){return Wt(this.options.rotation-90)}_getCircumference(){return Wt(this.options.circumference)}_getRotationExtents(){let t=Ct,n=-Ct;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),n=Math.max(n,s+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),c=Math.min(Yg(this.options.cutout,o),1),l=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:y}=Py(h,u,c),x=(i.width-a)/f,v=(i.height-a)/m,S=Math.max(Math.min(x,v)/2,0),k=jc(this.options.radius,S),C=Math.max(k*c,0),E=(k-C)/this._getVisibleDatasetWeightTotal();this.offsetX=g*k,this.offsetY=y*k,r.total=this.calculateTotal(),this.outerRadius=k-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*l,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/Ct)}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,o=a.chartArea,l=a.options.animation,u=(o.left+o.right)/2,h=(o.top+o.bottom)/2,f=s&&l.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,r);let v=this._getRotation(),S;for(S=0;S<n;++S)v+=this._circumference(S,s);for(S=n;S<n+i;++S){const k=this._circumference(S,s),C=t[S],E={x:u+this.offsetX,y:h+this.offsetY,startAngle:v,endAngle:v+k,circumference:k,outerRadius:g,innerRadius:m};x&&(E.options=y||this.resolveDataElementOptions(S,C.active?"active":r)),v+=k,this.updateElement(C,S,E,r)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,r;for(r=0;r<n.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ct*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=ar(n._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const i=this.chart;let r,s,a,o,c;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,o=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)c=o.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(an,"id","doughnut"),R(an,"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"}),R(an,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),R(an,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:r,lineWidth:c.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class fr extends Fe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=n,a=this.chart._animationsDisabled;let{start:o,count:c}=iu(n,r,a);this._drawStart=o,this._drawCount=c,ru(n)&&(o=0,c=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:l},t),this.updateElements(r,o,c,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:o,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,r),f=a.axis,m=o.axis,{spanGaps:g,segment:y}=this.options,x=Tn(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||r==="none",S=n+i,k=t.length;let C=n>0&&this.getParsed(n-1);for(let E=0;E<k;++E){const P=t[E],T=v?P:{};if(E<n||E>=S){T.skip=!0;continue}const p=this.getParsed(E),_=it(p[m]),M=T[f]=a.getPixelForValue(p[f],E),O=T[m]=s||_?o.getBasePixel():o.getPixelForValue(c?this.applyStack(o,p,c):p[m],E);T.skip=isNaN(M)||isNaN(O)||_,T.stop=E>0&&Math.abs(p[f]-C[f])>x,y&&(T.parsed=p,T.raw=l.data[E]),h&&(T.options=u||this.resolveDataElementOptions(E,P.active?"active":r)),v||this.updateElement(P,E,T,r),C=p}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}R(fr,"id","line"),R(fr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(fr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class mr extends Fe{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=ar(n._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,n,i,r){return _u.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),o=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,c=a.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,h=l.yCenter,f=l.getIndexAngle(0)-.5*ut;let m=f,g;const y=360/this.countVisibleElements();for(g=0;g<n;++g)m+=this._computeAngle(g,r,y);for(g=n;g<n+i;g++){const x=t[g];let v=m,S=m+this._computeAngle(g,r,y),k=a.getDataVisibility(g)?l.getDistanceFromCenterForValue(this.getParsed(g).r):0;m=S,s&&(c.animateScale&&(k=0),c.animateRotate&&(v=S=f));const C={x:u,y:h,innerRadius:0,outerRadius:k,startAngle:v,endAngle:S,options:this.resolveDataElementOptions(g,x.active?"active":r)};this.updateElement(x,g,C,r)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Wt(this.resolveDataElementOptions(t,n).angle||i):0}}R(mr,"id","polarArea"),R(mr,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(mr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:r,lineWidth:c.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ho extends an{}R(ho,"id","pie"),R(ho,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ts extends Fe{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,r){return _u.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta,i=n.dataset,r=n.data||[],s=n.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,n,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let o=n;o<n+i;o++){const c=t[o],l=this.resolveDataElementOptions(o,c.active?"active":r),u=s.getPointPositionForValue(o,this.getParsed(o).r),h=a?s.xCenter:u.x,f=a?s.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:l};this.updateElement(c,o,m,r)}}}R(Ts,"id","radar"),R(Ts,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),R(Ts,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Ds extends Fe{getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),o=r.getLabelForValue(a.x),c=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+c+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,r=this.chart._animationsDisabled;let{start:s,count:a}=iu(n,i,r);if(this._drawStart=s,this._drawCount=a,ru(n)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:c}=n;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!c._decimated,o.points=i;const l=this.resolveDatasetElementOptions(t);l.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:l},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:o,_stacked:c,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(n,r),h=this.getSharedOptions(u),f=this.includeOptions(r,h),m=a.axis,g=o.axis,{spanGaps:y,segment:x}=this.options,v=Tn(y)?y:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||s||r==="none";let k=n>0&&this.getParsed(n-1);for(let C=n;C<n+i;++C){const E=t[C],P=this.getParsed(C),T=S?E:{},p=it(P[g]),_=T[m]=a.getPixelForValue(P[m],C),M=T[g]=s||p?o.getBasePixel():o.getPixelForValue(c?this.applyStack(o,P,c):P[g],C);T.skip=isNaN(_)||isNaN(M)||p,T.stop=C>0&&Math.abs(P[m]-k[m])>v,x&&(T.parsed=P,T.raw=l.data[C]),f&&(T.options=h||this.resolveDataElementOptions(C,E.active?"active":r)),S||this.updateElement(E,C,T,r),k=P}this.updateSharedOptions(h,r,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let o=0;for(let c=n.length-1;c>=0;--c)o=Math.max(o,n[c].size(this.resolveDataElementOptions(c))/2);return o>0&&o}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!n.length)return r;const s=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,s,a)/2}}R(Ds,"id","scatter"),R(Ds,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),R(Ds,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Ry=Object.freeze({__proto__:null,BarController:hr,BubbleController:Ms,DoughnutController:an,LineController:fr,PieController:ho,PolarAreaController:mr,RadarController:Ts,ScatterController:Ds});function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class fo{constructor(t){R(this,"options");this.options=t||{}}static override(t){Object.assign(fo.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}}var Wu={_date:fo};function Ay(e,t,n,i){const{controller:r,data:s,_sorted:a}=e,o=r._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(o&&t===o.axis&&t!=="r"&&a&&s.length){const l=o._reversePixels?np:nn;if(i){if(r._sharedOptions){const u=s[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=l(s,t,n-h),m=l(s,t,n+h);return{lo:f.lo,hi:m.hi}}}}else{const u=l(s,t,n);if(c){const{vScale:h}=r._cachedMeta,{_parsed:f}=e,m=f.slice(0,u.lo+1).reverse().findIndex(y=>!it(y[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(y=>!it(y[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function gr(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),a=n[t];for(let o=0,c=s.length;o<c;++o){const{index:l,data:u}=s[o],{lo:h,hi:f}=Ay(s[o],t,a,r);for(let m=h;m<=f;++m){const g=u[m];g.skip||i(g,l,m)}}}function Iy(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=n?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function mo(e,t,n,i,r){const s=[];return!r&&!e.isPointInArea(t)||gr(e,n,t,function(o,c,l){!r&&!rn(o,e.chartArea,0)||o.inRange(t.x,t.y,i)&&s.push({element:o,datasetIndex:c,index:l})},!0),s}function Ly(e,t,n,i){let r=[];function s(a,o,c){const{startAngle:l,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:h}=ps(a,{x:t.x,y:t.y});rr(h,l,u)&&r.push({element:a,datasetIndex:o,index:c})}return gr(e,n,t,s),r}function Ny(e,t,n,i,r,s){let a=[];const o=Iy(n);let c=Number.POSITIVE_INFINITY;function l(u,h,f){const m=u.inRange(t.x,t.y,r);if(i&&!m)return;const g=u.getCenterPoint(r);if(!(!!s||e.isPointInArea(g))&&!m)return;const x=o(t,g);x<c?(a=[{element:u,datasetIndex:h,index:f}],c=x):x===c&&a.push({element:u,datasetIndex:h,index:f})}return gr(e,n,t,l),a}function go(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?Ly(e,t,n,r):Ny(e,t,n,i,r,s)}function Yu(e,t,n,i,r){const s=[],a=n==="x"?"inXRange":"inYRange";let o=!1;return gr(e,n,t,(c,l,u)=>{c[a]&&c[a](t[n],r)&&(s.push({element:c,datasetIndex:l,index:u}),o=o||c.inRange(t.x,t.y,r))}),i&&!o?[]:s}var po={evaluateInteractionItems:gr,modes:{index(e,t,n,i){const r=En(t,e),s=n.axis||"x",a=n.includeInvisible||!1,o=n.intersect?mo(e,r,s,i,a):go(e,r,s,!1,i,a),c=[];return o.length?(e.getSortedVisibleDatasetMetas().forEach(l=>{const u=o[0].index,h=l.data[u];h&&!h.skip&&c.push({element:h,datasetIndex:l.index,index:u})}),c):[]},dataset(e,t,n,i){const r=En(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;let o=n.intersect?mo(e,r,s,i,a):go(e,r,s,!1,i,a);if(o.length>0){const c=o[0].datasetIndex,l=e.getDatasetMeta(c).data;o=[];for(let u=0;u<l.length;++u)o.push({element:l[u],datasetIndex:c,index:u})}return o},point(e,t,n,i){const r=En(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return mo(e,r,s,i,a)},nearest(e,t,n,i){const r=En(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return go(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=En(t,e);return Yu(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=En(t,e);return Yu(e,r,"y",n.intersect,i)}}};const ju=["left","top","right","bottom"];function pr(e,t){return e.filter(n=>n.pos===t)}function Uu(e,t){return e.filter(n=>ju.indexOf(n.pos)===-1&&n.box.axis===t)}function yr(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function Fy(e){const t=[];let n,i,r,s,a,o;for(n=0,i=(e||[]).length;n<i;++n)r=e[n],{position:s,options:{stack:a,stackWeight:o=1}}=r,t.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:o});return t}function By(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!ju.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function zy(e,t){const n=By(e),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,o;for(s=0,a=e.length;s<a;++s){o=e[s];const{fullSize:c}=o.box,l=n[o.stack],u=l&&o.stackWeight/l.weight;o.horizontal?(o.width=u?u*i:c&&t.availableWidth,o.height=r):(o.width=i,o.height=u?u*r:c&&t.availableHeight)}return n}function Hy(e){const t=Fy(e),n=yr(t.filter(l=>l.box.fullSize),!0),i=yr(pr(t,"left"),!0),r=yr(pr(t,"right")),s=yr(pr(t,"top"),!0),a=yr(pr(t,"bottom")),o=Uu(t,"x"),c=Uu(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(c).concat(a).concat(o),chartArea:pr(t,"chartArea"),vertical:i.concat(r).concat(c),horizontal:s.concat(a).concat(o)}}function qu(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Xu(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Vy(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!ft(r)){n.size&&(e[r]-=n.size);const h=i[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?s.height:s.width),n.size=h.size/h.count,e[r]+=n.size}s.getPadding&&Xu(a,s.getPadding());const o=Math.max(0,t.outerWidth-qu(a,e,"left","right")),c=Math.max(0,t.outerHeight-qu(a,e,"top","bottom")),l=o!==e.w,u=c!==e.h;return e.w=o,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function $y(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Wy(e,t){const n=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],n[a])}),s}return i(e?["left","right"]:["top","bottom"])}function br(e,t,n,i){const r=[];let s,a,o,c,l,u;for(s=0,a=e.length,l=0;s<a;++s){o=e[s],c=o.box,c.update(o.width||t.w,o.height||t.h,Wy(o.horizontal,t));const{same:h,other:f}=Vy(t,n,o,i);l|=h&&r.length,u=u||f,c.fullSize||r.push(o)}return l&&br(r,t,n,i)||u}function Cs(e,t,n,i,r){e.top=n,e.left=t,e.right=t+i,e.bottom=n+r,e.width=i,e.height=r}function Gu(e,t,n,i){const r=n.padding;let{x:s,y:a}=t;for(const o of e){const c=o.box,l=i[o.stack]||{placed:0,weight:1},u=o.stackWeight/l.weight||1;if(o.horizontal){const h=t.w*u,f=l.size||c.height;pe(l.start)&&(a=l.start),c.fullSize?Cs(c,r.left,a,n.outerWidth-r.right-r.left,f):Cs(c,t.left+l.placed,a,h,f),l.start=a,l.placed+=h,a=c.bottom}else{const h=t.h*u,f=l.size||c.width;pe(l.start)&&(s=l.start),c.fullSize?Cs(c,s,r.top,f,n.outerHeight-r.bottom-r.top):Cs(c,s,t.top+l.placed,f,h),l.start=s,l.placed+=h,s=c.right}}t.x=s,t.y=a}var ae={addBox(e,t){e.boxes||(e.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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const r=Yt(e.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(n-r.height,0),o=Hy(e.boxes),c=o.vertical,l=o.horizontal;Mt(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=c.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},r);Xu(f,Yt(i));const m=Object.assign({maxPadding:f,w:s,h:a,x:r.left,y:r.top},r),g=zy(c.concat(l),h);br(o.fullSize,m,h,g),br(c,m,h,g),br(l,m,h,g)&&br(c,m,h,g),$y(m),Gu(o.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Gu(o.rightAndBottom,m,h,g),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Mt(o.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Ku{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class Yy extends Ku{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Es="$chartjs",jy={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zu=e=>e===null||e==="";function Uy(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[Es]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Zu(r)){const s=vu(e,"width");s!==void 0&&(e.width=s)}if(Zu(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=vu(e,"height");s!==void 0&&(e.height=s)}return e}const Qu=Gp?{passive:!0}:!1;function qy(e,t,n){e&&e.addEventListener(t,n,Qu)}function Xy(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Qu)}function Gy(e,t){const n=jy[e.type]||e.type,{x:i,y:r}=En(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Os(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Ky(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const o of s)a=a||Os(o.addedNodes,i),a=a&&!Os(o.removedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function Zy(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const o of s)a=a||Os(o.removedNodes,i),a=a&&!Os(o.addedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const _r=new Map;let Ju=0;function td(){const e=window.devicePixelRatio;e!==Ju&&(Ju=e,_r.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Qy(e,t){_r.size||window.addEventListener("resize",td),_r.set(e,t)}function Jy(e){_r.delete(e),_r.size||window.removeEventListener("resize",td)}function tb(e,t,n){const i=e.canvas,r=i&&so(i);if(!r)return;const s=nu((o,c)=>{const l=r.clientWidth;n(o,c),l<r.clientWidth&&n()},window),a=new ResizeObserver(o=>{const c=o[0],l=c.contentRect.width,u=c.contentRect.height;l===0&&u===0||s(l,u)});return a.observe(r),Qy(e,s),a}function yo(e,t,n){n&&n.disconnect(),t==="resize"&&Jy(e)}function eb(e,t,n){const i=e.canvas,r=nu(s=>{e.ctx!==null&&n(Gy(s,e))},e);return qy(i,t,r),r}class nb extends Ku{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Uy(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Es])return!1;const i=n[Es].initial;["height","width"].forEach(s=>{const a=i[s];it(a)?n.removeAttribute(s):n.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Es],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),a={attach:Ky,detach:Zy,resize:tb}[n]||eb;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:yo,detach:yo,resize:yo}[n]||Xy)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return Xp(t,n,i,r)}isAttached(t){const n=t&&so(t);return!!(n&&n.isConnected)}}function ib(e){return!ro()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Yy:nb}class Zt{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Tn(this.x)&&Tn(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}R(Zt,"defaults",{}),R(Zt,"defaultRoutes");function rb(e,t){const n=e.options.ticks,i=sb(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?ob(t):[],a=s.length,o=s[0],c=s[a-1],l=[];if(a>r)return lb(t,l,s,a/r),l;const u=ab(s,t,r);if(a>0){let h,f;const m=a>1?Math.round((c-o)/(a-1)):null;for(Ps(t,l,u,it(m)?0:o-m,o),h=0,f=a-1;h<f;h++)Ps(t,l,u,s[h],s[h+1]);return Ps(t,l,u,c,it(m)?t.length:c+m),l}return Ps(t,l,u),l}function sb(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),r=e._maxLength/n;return Math.floor(Math.min(i,r))}function ab(e,t,n){const i=cb(e),r=t.length/n;if(!i)return Math.max(r,1);const s=Zg(i);for(let a=0,o=s.length-1;a<o;a++){const c=s[a];if(c>r)return c}return Math.max(r,1)}function ob(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function lb(e,t,n,i){let r=0,s=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===s&&(t.push(e[a]),r++,s=n[r*i])}function Ps(e,t,n,i,r){const s=rt(i,0),a=Math.min(rt(r,e.length),e.length);let o=0,c,l,u;for(n=Math.ceil(n),r&&(c=r-i,n=c/Math.floor(c/n)),u=s;u<0;)o++,u=Math.round(s+o*n);for(l=Math.max(s,0);l<a;l++)l===u&&(t.push(e[l]),o++,u=Math.round(s+o*n))}function cb(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const ub=e=>e==="left"?"right":e==="right"?"left":e,ed=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,nd=(e,t)=>Math.min(t||e,e);function id(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;s<r;s+=i)n.push(e[Math.floor(s)]);return n}function db(e,t,n){const i=e.ticks.length,r=Math.min(t,i-1),s=e._startPixel,a=e._endPixel,o=1e-6;let c=e.getPixelForTick(r),l;if(!(n&&(i===1?l=Math.max(c-s,a-c):t===0?l=(e.getPixelForTick(1)-c)/2:l=(c-e.getPixelForTick(r-1))/2,c+=r<t?l:-l,c<s-o||c>a+o)))return c}function hb(e,t){Mt(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete n.data[i[s]];i.splice(0,r)}})}function xr(e){return e.drawTicks?e.tickLength:0}function rd(e,t){if(!e.display)return 0;const n=At(e.font,t),i=Yt(e.padding);return(wt(e.text)?e.text.length:1)*n.lineHeight+i.height}function fb(e,t){return Cn(e,{scale:t,type:"scale"})}function mb(e,t,n){return Cn(e,{tick:n,index:t,type:"tick"})}function gb(e,t,n){let i=Xa(e);return(n&&t!=="right"||!n&&t==="right")&&(i=ub(i)),i}function pb(e,t,n,i){const{top:r,left:s,bottom:a,right:o,chart:c}=e,{chartArea:l,scales:u}=c;let h=0,f,m,g;const y=a-r,x=o-s;if(e.isHorizontal()){if(m=se(i,s,o),ft(n)){const v=Object.keys(n)[0],S=n[v];g=u[v].getPixelForValue(S)+y-t}else n==="center"?g=(l.bottom+l.top)/2+y-t:g=ed(e,n,t);f=o-s}else{if(ft(n)){const v=Object.keys(n)[0],S=n[v];m=u[v].getPixelForValue(S)-x+t}else n==="center"?m=(l.left+l.right)/2-x+t:m=ed(e,n,t);g=se(i,a,r),h=n==="left"?-Ot:Ot}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class Zn extends Zt{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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:r}=this;return t=De(t,Number.POSITIVE_INFINITY),n=De(n,Number.NEGATIVE_INFINITY),i=De(i,Number.POSITIVE_INFINITY),r=De(r,Number.NEGATIVE_INFINITY),{min:De(t,i),max:De(n,r),minDefined:Rt(t),maxDefined:Rt(n)}}getMinMax(t){let{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:n,max:i};const o=this.getMatchingVisibleMetas();for(let c=0,l=o.length;c<l;++c)a=o[c].controller.getMinMax(this,t),r||(n=Math.min(n,a.min)),s||(i=Math.max(i,a.max));return n=s&&n>i?i:n,i=r&&n>i?n:i,{min:De(n,De(i,n)),max:De(i,De(n,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,n,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,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=Tp(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=o<this.ticks.length;this._convertTicksToLabels(c?id(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=rb(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,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 n=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=kt(n.callback,[s.value,i,t],this)}afterTickToLabelConversion(){kt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){kt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=nd(this.ticks.length,t.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let a=r,o,c,l;if(!this._isVisible()||!n.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Kt(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:m/(i-1),h+6>o&&(o=m/(i-(t.offset?.5:1)),c=this.maxHeight-xr(t.grid)-n.padding-rd(t.title,this.chart.options.font),l=Math.sqrt(h*h+f*f),a=gs(Math.min(Math.asin(Kt((u.highest.height+6)/o,-1,1)),Math.asin(Kt(c/l,-1,1))-Math.asin(Kt(f/l,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){kt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){kt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const c=rd(r,n.options.font);if(o?(t.width=this.maxWidth,t.height=xr(s)+c):(t.height=this.maxHeight,t.width=xr(s)+c),i.display&&this.ticks.length){const{first:l,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,g=Wt(this.labelRotation),y=Math.cos(g),x=Math.sin(g);if(o){const v=i.mirror?0:x*h.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+v+m)}else{const v=i.mirror?0:y*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+v+m)}this._calculatePadding(l,u,x,y)}}this._handleMargins(),o?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,r){const{ticks:{align:s,padding:a},position:o}=this.options,c=this.labelRotation!==0,l=o!=="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;c?l?(f=r*t.width,m=i*n.height):(f=i*t.height,m=r*n.width):s==="start"?m=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,m=n.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let u=n.height/2,h=t.height/2;s==="start"?(u=0,h=t.height):s==="end"&&(u=n.height,h=0),this.paddingTop=u+a,this.paddingBottom=h+a}}_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:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)it(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=id(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:r,_longestTextCache:s}=this,a=[],o=[],c=Math.floor(n/nd(n,i));let l=0,u=0,h,f,m,g,y,x,v,S,k,C,E;for(h=0;h<n;h+=c){if(g=t[h].label,y=this._resolveTickFontOptions(h),r.font=x=y.string,v=s[x]=s[x]||{data:{},gc:[]},S=y.lineHeight,k=C=0,!it(g)&&!wt(g))k=_s(r,v.data,v.gc,k,g),C=S;else if(wt(g))for(f=0,m=g.length;f<m;++f)E=g[f],!it(E)&&!wt(E)&&(k=_s(r,v.data,v.gc,k,E),C+=S);a.push(k),o.push(C),l=Math.max(k,l),u=Math.max(C,u)}hb(s,n);const P=a.indexOf(l),T=o.indexOf(u),p=_=>({width:a[_]||0,height:o[_]||0});return{first:p(0),last:p(n-1),widest:p(P),highest:p(T),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return ep(this._alignToPixels?Un(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=mb(this.getContext(),t,i))}return this.$context||(this.$context=fb(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Wt(this.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,o=s?s.widest.width+a:0,c=s?s.highest.height+a:0;return this.isHorizontal()?c*i>o*r?o/i:c/r:c*r<o*i?c/i:o/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:o}=r,c=s.offset,l=this.isHorizontal(),h=this.ticks.length+(c?1:0),f=xr(s),m=[],g=o.setContext(this.getContext()),y=g.display?g.width:0,x=y/2,v=function(G){return Un(i,G,y)};let S,k,C,E,P,T,p,_,M,O,A,I;if(a==="top")S=v(this.bottom),T=this.bottom-f,_=S-x,O=v(t.top)+x,I=t.bottom;else if(a==="bottom")S=v(this.top),O=t.top,I=v(t.bottom)-x,T=S+x,_=this.top+f;else if(a==="left")S=v(this.right),P=this.right-f,p=S-x,M=v(t.left)+x,A=t.right;else if(a==="right")S=v(this.left),M=t.left,A=v(t.right)-x,P=S+x,p=this.left+f;else if(n==="x"){if(a==="center")S=v((t.top+t.bottom)/2+.5);else if(ft(a)){const G=Object.keys(a)[0],$=a[G];S=v(this.chart.scales[G].getPixelForValue($))}O=t.top,I=t.bottom,T=S+x,_=T+f}else if(n==="y"){if(a==="center")S=v((t.left+t.right)/2);else if(ft(a)){const G=Object.keys(a)[0],$=a[G];S=v(this.chart.scales[G].getPixelForValue($))}P=S-x,p=P-f,M=t.left,A=t.right}const B=rt(r.ticks.maxTicksLimit,h),j=Math.max(1,Math.ceil(h/B));for(k=0;k<h;k+=j){const G=this.getContext(k),$=s.setContext(G),lt=o.setContext(G),q=$.lineWidth,Z=$.color,z=lt.dash||[],U=lt.dashOffset,W=$.tickWidth,yt=$.tickColor,_t=$.tickBorderDash||[],Y=$.tickBorderDashOffset;C=db(this,k,c),C!==void 0&&(E=Un(i,C,q),l?P=p=M=A=E:T=_=O=I=E,m.push({tx1:P,ty1:T,tx2:p,ty2:_,x1:M,y1:O,x2:A,y2:I,width:q,color:Z,borderDash:z,borderDashOffset:U,tickWidth:W,tickColor:yt,tickBorderDash:_t,tickBorderDashOffset:Y}))}return this._ticksLength=h,this._borderValue=S,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),o=this.ticks,{align:c,crossAlign:l,padding:u,mirror:h}=s,f=xr(i.grid),m=f+u,g=h?-u:m,y=-Wt(this.labelRotation),x=[];let v,S,k,C,E,P,T,p,_,M,O,A,I="middle";if(r==="top")P=this.bottom-g,T=this._getXAxisLabelAlignment();else if(r==="bottom")P=this.top+g,T=this._getXAxisLabelAlignment();else if(r==="left"){const j=this._getYAxisLabelAlignment(f);T=j.textAlign,E=j.x}else if(r==="right"){const j=this._getYAxisLabelAlignment(f);T=j.textAlign,E=j.x}else if(n==="x"){if(r==="center")P=(t.top+t.bottom)/2+m;else if(ft(r)){const j=Object.keys(r)[0],G=r[j];P=this.chart.scales[j].getPixelForValue(G)+m}T=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")E=(t.left+t.right)/2-m;else if(ft(r)){const j=Object.keys(r)[0],G=r[j];E=this.chart.scales[j].getPixelForValue(G)}T=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(c==="start"?I="top":c==="end"&&(I="bottom"));const B=this._getLabelSizes();for(v=0,S=o.length;v<S;++v){k=o[v],C=k.label;const j=s.setContext(this.getContext(v));p=this.getPixelForTick(v)+s.labelOffset,_=this._resolveTickFontOptions(v),M=_.lineHeight,O=wt(C)?C.length:1;const G=O/2,$=j.color,lt=j.textStrokeColor,q=j.textStrokeWidth;let Z=T;a?(E=p,T==="inner"&&(v===S-1?Z=this.options.reverse?"left":"right":v===0?Z=this.options.reverse?"right":"left":Z="center"),r==="top"?l==="near"||y!==0?A=-O*M+M/2:l==="center"?A=-B.highest.height/2-G*M+M:A=-B.highest.height+M/2:l==="near"||y!==0?A=M/2:l==="center"?A=B.highest.height/2-G*M:A=B.highest.height-O*M,h&&(A*=-1),y!==0&&!j.showLabelBackdrop&&(E+=M/2*Math.sin(y))):(P=p,A=(1-O)*M/2);let z;if(j.showLabelBackdrop){const U=Yt(j.backdropPadding),W=B.heights[v],yt=B.widths[v];let _t=A-U.top,Y=0-U.left;switch(I){case"middle":_t-=W/2;break;case"bottom":_t-=W;break}switch(T){case"center":Y-=yt/2;break;case"right":Y-=yt;break;case"inner":v===S-1?Y-=yt:v>0&&(Y-=yt/2);break}z={left:Y,top:_t,width:yt+U.width,height:W+U.height,color:j.backdropColor}}x.push({label:C,font:_,textOffset:A,options:{rotation:y,color:$,strokeColor:lt,strokeWidth:q,textAlign:Z,textBaseline:I,translation:[E,P],backdrop:z}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Wt(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),o=t+s,c=a.widest.width;let l,u;return n==="left"?r?(u=this.right+s,i==="near"?l="left":i==="center"?(l="center",u+=c/2):(l="right",u+=c)):(u=this.right-o,i==="near"?l="right":i==="center"?(l="center",u-=c/2):(l="left",u=this.left)):n==="right"?r?(u=this.left+s,i==="near"?l="right":i==="center"?(l="center",u-=c/2):(l="left",u-=c)):(u=this.left+o,i==="near"?l="left":i==="center"?(l="center",u+=c/2):(l="right",u=this.right)):l="right",{textAlign:l,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:r,width:s,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const o=(c,l,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(c.x,c.y),i.lineTo(l.x,l.y),i.stroke(),i.restore())};if(n.display)for(s=0,a=r.length;s<a;++s){const c=r[s];n.drawOnChartArea&&o({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&o({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const o=r.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let l,u,h,f;this.isHorizontal()?(l=Un(t,this.left,a)-a/2,u=Un(t,this.right,o)+o/2,h=f=c):(h=Un(t,this.top,a)-a/2,f=Un(t,this.bottom,o)+o/2,l=u=c),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(l,h),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&lr(i,r);const s=this.getLabelItems(t);for(const a of s){const o=a.options,c=a.font,l=a.label,u=a.textOffset;qn(i,l,0,u,c,o)}r&&cr(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:r}}=this;if(!i.display)return;const s=At(i.font),a=Yt(i.padding),o=i.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||ft(n)?(c+=a.bottom,wt(i.text)&&(c+=s.lineHeight*(i.text.length-1))):c+=a.top;const{titleX:l,titleY:u,maxWidth:h,rotation:f}=pb(this,c,n,o);qn(t,i.text,0,0,s,{color:i.color,maxWidth:h,rotation:f,textAlign:gb(o,n,r),textBaseline:"middle",translation:[l,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=rt(t.grid&&t.grid.z,-1),r=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Zn.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=n.length;s<a;++s){const o=n[s];o[i]===this.id&&(!t||o.type===t)&&r.push(o)}return r}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return At(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Rs{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;_b(n)&&(i=this.register(n));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,yb(t,a,i),this.override&&Pt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,r=this.scope;i in n&&delete n[i],r&&i in Pt[r]&&(delete Pt[r][i],this.override&&delete jn[i])}}function yb(e,t,n){const i=er(Object.create(null),[n?Pt.get(n):{},Pt.get(t),e.defaults]);Pt.set(t,i),e.defaultRoutes&&bb(t,e.defaultRoutes),e.descriptors&&Pt.describe(t,e.descriptors)}function bb(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),a=t[n].split("."),o=a.pop(),c=a.join(".");Pt.route(s,r,c,o)})}function _b(e){return"id"in e&&"defaults"in e}class xb{constructor(){this.controllers=new Rs(Fe,"datasets",!0),this.elements=new Rs(Zt,"elements"),this.plugins=new Rs(Object,"plugins"),this.scales=new Rs(Zn,"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,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Mt(r,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,n,i){const r=ja(t);kt(i["before"+r],[],i),n[t](i),kt(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const r=n.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var We=new xb;class wb{constructor(){this._init=[]}notify(t,n,i,r){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,n,i);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,i,r){r=r||{};for(const s of t){const a=s.plugin,o=a[i],c=[n,r,s.options];if(kt(o,c,a)===!1&&r.cancelable)return!1}return!0}invalidate(){it(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,r=rt(i.options&&i.options.plugins,{}),s=vb(i);return r===!1&&!n?[]:kb(t,s,r,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(o=>!a.some(c=>o.plugin.id===c.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function vb(e){const t={},n=[],i=Object.keys(We.plugins.items);for(let s=0;s<i.length;s++)n.push(We.getPlugin(i[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function Sb(e,t){return!t&&e===!1?null:e===!0?{}:e}function kb(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const o of t){const c=o.id,l=Sb(i[c],r);l!==null&&s.push({plugin:o,options:Mb(e.config,{plugin:o,local:n[c]},l,a)})}return s}function Mb(e,{plugin:t,local:n},i,r){const s=e.pluginScopeKeys(t),a=e.getOptionScopes(i,s);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function bo(e,t){const n=Pt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Tb(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Db(e,t){return e===t?"_index_":"_value_"}function sd(e){if(e==="x"||e==="y"||e==="r")return e}function Cb(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function _o(e,...t){if(sd(e))return e;for(const n of t){const i=n.axis||Cb(n.position)||e.length>1&&sd(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ad(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Eb(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return ad(e,"x",n[0])||ad(e,"y",n[0])}return{}}function Ob(e,t){const n=jn[e.type]||{scales:{}},i=t.scales||{},r=bo(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const o=i[a];if(!ft(o))return console.error(`Invalid scale configuration for scale: ${a}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=_o(a,o,Eb(a,e),Pt.scales[o.type]),l=Db(c,r),u=n.scales||{};s[a]=nr(Object.create(null),[{axis:c},o,u[c],u[l]])}),e.data.datasets.forEach(a=>{const o=a.type||e.type,c=a.indexAxis||bo(o,t),u=(jn[o]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Tb(h,c),m=a[f+"AxisID"]||f;s[m]=s[m]||Object.create(null),nr(s[m],[{axis:f},i[m],u[h]])})}),Object.keys(s).forEach(a=>{const o=s[a];nr(o,[Pt.scales[o.type],Pt.scale])}),s}function od(e){const t=e.options||(e.options={});t.plugins=rt(t.plugins,{}),t.scales=Ob(e,t)}function ld(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Pb(e){return e=e||{},e.data=ld(e.data),od(e),e}const cd=new Map,ud=new Set;function As(e,t){let n=cd.get(e);return n||(n=t(),cd.set(e,n),ud.add(n)),n}const wr=(e,t,n)=>{const i=kn(t,n);i!==void 0&&e.add(i)};class Rb{constructor(t){this._config=Pb(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=ld(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(),od(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return As(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return As(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return As(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return As(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),o=a.get(n);if(o)return o;const c=new Set;n.forEach(u=>{t&&(c.add(t),u.forEach(h=>wr(c,t,h))),u.forEach(h=>wr(c,r,h)),u.forEach(h=>wr(c,jn[s]||{},h)),u.forEach(h=>wr(c,Pt,h)),u.forEach(h=>wr(c,Za,h))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),ud.has(n)&&a.set(n,l),l}chartOptionScopes(){const{options:t,type:n}=this;return[t,jn[n]||{},Pt.datasets[n]||{},{type:n},Pt,Za]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:o}=dd(this._resolverCache,t,r);let c=a;if(Ib(a,n)){s.$shared=!1,i=ye(i)?i():i;const l=this.createResolver(t,i,o);c=xi(a,i,l)}for(const l of n)s[l]=c[l];return s}createResolver(t,n,i=[""],r){const{resolver:s}=dd(this._resolverCache,t,i);return ft(n)?xi(s,n,void 0,r):s}}function dd(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:eo(t,n),subPrefixes:n.filter(o=>!o.toLowerCase().includes("hover"))},i.set(r,s)),s}const Ab=e=>ft(e)&&Object.getOwnPropertyNames(e).some(t=>ye(e[t]));function Ib(e,t){const{isScriptable:n,isIndexable:i}=fu(e);for(const r of t){const s=n(r),a=i(r),o=(a||s)&&e[r];if(s&&(ye(o)||Ab(o))||a&&wt(o))return!0}return!1}var Lb="4.5.0";const Nb=["top","bottom","left","right","chartArea"];function hd(e,t){return e==="top"||e==="bottom"||Nb.indexOf(e)===-1&&t==="x"}function fd(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function md(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),kt(n&&n.onComplete,[e],t)}function Fb(e){const t=e.chart,n=t.options.animation;kt(n&&n.onProgress,[e],t)}function gd(e){return ro()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Is={},pd=e=>{const t=gd(e);return Object.values(Is).filter(n=>n.canvas===t).pop()};function Bb(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const a=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=a)}}}function zb(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let be=(zn=class{static register(...t){We.add(...t),yd()}static unregister(...t){We.remove(...t),yd()}constructor(t,n){const i=this.config=new Rb(n),r=gd(t),s=pd(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ib(r)),this.platform.updateConfig(i);const o=this.platform.acquireContext(r,a.aspectRatio),c=o&&o.canvas,l=c&&c.height,u=c&&c.width;if(this.id=Wg(),this.ctx=o,this.canvas=c,this.width=u,this.height=l,this._options=a,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 wb,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=sp(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Is[this.id]=this,!o||!c){console.error("Failed to create chart: can't acquire context from the given item");return}sn.listen(this,"complete",md),sn.listen(this,"progress",Fb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return it(t)?n&&s?s:r?i/r: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 We}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():wu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return uu(this.canvas,this.ctx),this}stop(){return sn.stop(this),this}resize(t,n){sn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,n,s),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,wu(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),kt(i.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Mt(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let s=[];n&&(s=s.concat(Object.keys(n).map(a=>{const o=n[a],c=_o(a,o),l=c==="r",u=c==="x";return{options:o,dposition:l?"chartArea":u?"bottom":"left",dtype:l?"radialLinear":u?"category":"linear"}}))),Mt(s,a=>{const o=a.options,c=o.id,l=_o(c,o),u=rt(o.type,a.dtype);(o.position===void 0||hd(o.position,l)!==hd(a.dposition))&&(o.position=a.dposition),r[c]=!0;let h=null;if(c in i&&i[c].type===u)h=i[c];else{const f=We.getScale(u);h=new f({id:c,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(o,t)}),Mt(r,(a,o)=>{a||delete i[o]}),Mt(i,a=>{ae.configure(this,a,a.options),ae.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;r<i;++r)this._destroyDatasetMeta(r);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(fd("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const s=n[i];let a=this.getDatasetMeta(i);const o=s.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=s.indexAxis||bo(o,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const c=We.getController(o),{datasetElementType:l,dataElementType:u}=Pt.datasets[o];Object.assign(c,{dataElementType:We.getElement(u),datasetElementType:l&&We.getElement(l)}),a.controller=new c(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Mt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let l=0,u=this.data.datasets.length;l<u;l++){const{controller:h}=this.getDatasetMeta(l),f=!r&&s.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Mt(s,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fd("z","_idx"));const{_active:o,_lastEvent:c}=this;c?this._eventHandler(c,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Mt(this.scales,t=>{ae.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xc(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const a=i==="_removeElements"?-s:s;Bb(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,o)=>o+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<n;s++)if(!Xc(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ae.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Mt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,ye(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(sn.has(this)?this.attached&&!sn.running(this)&&sn.start(this):(this.draw(),md({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let r,s;for(r=0,s=n.length;r<s;++r){const a=n[r];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=Pu(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&lr(n,r),t.controller.draw(),r&&cr(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return rn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=po.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Cn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);pe(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(o=>o.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),sn.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),uu(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Is[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,n=this.platform,i=(s,a)=>{n.addEventListener(this,s,a),t[s]=a},r=(s,a,o)=>{s.offsetX=a,s.offsetY=o,this._eventHandler(s)};Mt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(c,l)=>{n.addEventListener(this,c,l),t[c]=l},r=(c,l)=>{t[c]&&(n.removeEventListener(this,c,l),delete t[c])},s=(c,l)=>{this.canvas&&this.resize(c,l)};let a;const o=()=>{r("attach",o),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",o)},n.isAttached(this.canvas)?o():a()}unbindEvents(){Mt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Mt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,a,o,c;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),o=0,c=t.length;o<c;++o){a=t[o];const l=a&&this.getDatasetMeta(a.datasetIndex).controller;l&&l[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const o=this.getDatasetMeta(s);if(!o)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:o.data[a],index:a}});!ds(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(c,l)=>c.filter(u=>!l.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),a=s(n,t),o=i?t:s(t,n);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,a=n,o=this._getActiveElements(t,r,i,a),c=Gg(t),l=zb(t,this._lastEvent,i,c);i&&(this._lastEvent=null,kt(s.onHover,[t,o,this],this),c&&kt(s.onClick,[t,o,this],this));const u=!ds(o,r);return(u||n)&&(this._active=o,this._updateHoverStyles(o,r,n)),this._lastEvent=l,u}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}},R(zn,"defaults",Pt),R(zn,"instances",Is),R(zn,"overrides",jn),R(zn,"registry",We),R(zn,"version",Lb),R(zn,"getChart",pd),zn);function yd(){return Mt(be.instances,e=>e._plugins.invalidate())}function Hb(e,t,n){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:o,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,h=Math.min(l/a,re(i-n));if(e.beginPath(),e.arc(r,s,a-l/2,i+h/2,n-h/2),o>0){const f=Math.min(l/o,re(i-n));e.arc(r,s,o+l/2,n-f/2,i+f/2,!0)}else{const f=Math.min(l/2,a*re(i-n));if(u==="round")e.arc(r,s,f,n-ut/2,i+ut/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(n+ut/2)+r,y=-m*Math.sin(n+ut/2)+s,x=m*Math.cos(i+ut/2)+r,v=m*Math.sin(i+ut/2)+s;e.lineTo(g,y),e.lineTo(x,v)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Vb(e,t,n){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:o,innerRadius:c}=t;let l=r/o;e.beginPath(),e.arc(s,a,o,i-l,n+l),c>r?(l=r/c,e.arc(s,a,c,n+l,i-l,!0)):e.arc(s,a,r,n+Ot,i-Ot),e.closePath(),e.clip()}function $b(e){return to(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Wb(e,t,n,i){const r=$b(e.options.borderRadius),s=(n-t)/2,a=Math.min(s,i*t/2),o=c=>{const l=(n-Math.min(s,c))*i/2;return Kt(c,0,Math.min(s,l))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Kt(r.innerStart,0,a),innerEnd:Kt(r.innerEnd,0,a)}}function Si(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Ls(e,t,n,i,r,s){const{x:a,y:o,startAngle:c,pixelMargin:l,innerRadius:u}=t,h=Math.max(t.outerRadius+i+n-l,0),f=u>0?u+i+n+l:0;let m=0;const g=r-c;if(i){const j=u>0?u-i:0,G=h>0?h-i:0,$=(j+G)/2,lt=$!==0?g*$/($+i):g;m=(g-lt)/2}const y=Math.max(.001,g*h-n/ut)/h,x=(g-y)/2,v=c+x+m,S=r-x-m,{outerStart:k,outerEnd:C,innerStart:E,innerEnd:P}=Wb(t,f,h,S-v),T=h-k,p=h-C,_=v+k/T,M=S-C/p,O=f+E,A=f+P,I=v+E/O,B=S-P/A;if(e.beginPath(),s){const j=(_+M)/2;if(e.arc(a,o,h,_,j),e.arc(a,o,h,j,M),C>0){const q=Si(p,M,a,o);e.arc(q.x,q.y,C,M,S+Ot)}const G=Si(A,S,a,o);if(e.lineTo(G.x,G.y),P>0){const q=Si(A,B,a,o);e.arc(q.x,q.y,P,S+Ot,B+Math.PI)}const $=(S-P/f+(v+E/f))/2;if(e.arc(a,o,f,S-P/f,$,!0),e.arc(a,o,f,$,v+E/f,!0),E>0){const q=Si(O,I,a,o);e.arc(q.x,q.y,E,I+Math.PI,v-Ot)}const lt=Si(T,v,a,o);if(e.lineTo(lt.x,lt.y),k>0){const q=Si(T,_,a,o);e.arc(q.x,q.y,k,v-Ot,_)}}else{e.moveTo(a,o);const j=Math.cos(_)*h+a,G=Math.sin(_)*h+o;e.lineTo(j,G);const $=Math.cos(M)*h+a,lt=Math.sin(M)*h+o;e.lineTo($,lt)}e.closePath()}function Yb(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:o}=t;let c=t.endAngle;if(s){Ls(e,t,n,i,c,r);for(let l=0;l<s;++l)e.fill();isNaN(o)||(c=a+(o%Ct||Ct))}return Ls(e,t,n,i,c,r),e.fill(),c}function jb(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:o,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=c,g=c.borderAlign==="inner";if(!l)return;e.setLineDash(h||[]),e.lineDashOffset=f,g?(e.lineWidth=l*2,e.lineJoin=u||"round"):(e.lineWidth=l,e.lineJoin=u||"bevel");let y=t.endAngle;if(s){Ls(e,t,n,i,y,r);for(let x=0;x<s;++x)e.stroke();isNaN(o)||(y=a+(o%Ct||Ct))}g&&Vb(e,t,y),c.selfJoin&&y-a>=ut&&m===0&&u!=="miter"&&Hb(e,t,y),s||(Ls(e,t,n,i,y,r),e.stroke())}class vr extends Zt{constructor(n){super();R(this,"circumference");R(this,"endAngle");R(this,"fullCircles");R(this,"innerRadius");R(this,"outerRadius");R(this,"pixelMargin");R(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,n&&Object.assign(this,n)}inRange(n,i,r){const s=this.getProps(["x","y"],r),{angle:a,distance:o}=ps(s,{x:n,y:i}),{startAngle:c,endAngle:l,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,g=rt(f,l-c),y=rr(a,c,l)&&c!==l,x=g>=Ct||y,v=en(o,u+m,h+m);return x&&v}getCenterPoint(n){const{x:i,y:r,startAngle:s,endAngle:a,innerRadius:o,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:l,spacing:u}=this.options,h=(s+a)/2,f=(o+c+u+l)/2;return{x:i+Math.cos(h)*f,y:r+Math.sin(h)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:r}=this,s=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>Ct?Math.floor(r/Ct):0,r===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*s,Math.sin(c)*s);const l=1-Math.sin(Math.min(ut,r||0)),u=s*l;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,Yb(n,this,u,a,o),jb(n,this,u,a,o),n.restore()}}R(vr,"id","arc"),R(vr,"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}),R(vr,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(vr,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function bd(e,t,n=t){e.lineCap=rt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(rt(n.borderDash,t.borderDash)),e.lineDashOffset=rt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=rt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=rt(n.borderWidth,t.borderWidth),e.strokeStyle=rt(n.borderColor,t.borderColor)}function Ub(e,t,n){e.lineTo(n.x,n.y)}function qb(e){return e.stepped?yp:e.tension||e.cubicInterpolationMode==="monotone"?bp:Ub}function _d(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{start:a,end:o}=t,c=Math.max(r,a),l=Math.min(s,o),u=r<a&&s<a||r>o&&s>o;return{count:i,start:c,loop:t.loop,ilen:l<c&&!u?i+l-c:l-c}}function Xb(e,t,n,i){const{points:r,options:s}=t,{count:a,start:o,loop:c,ilen:l}=_d(r,n,i),u=qb(s);let{move:h=!0,reverse:f}=i||{},m,g,y;for(m=0;m<=l;++m)g=r[(o+(f?l-m:m))%a],!g.skip&&(h?(e.moveTo(g.x,g.y),h=!1):u(e,y,g,f,s.stepped),y=g);return c&&(g=r[(o+(f?l:0))%a],u(e,y,g,f,s.stepped)),!!c}function Gb(e,t,n,i){const r=t.points,{count:s,start:a,ilen:o}=_d(r,n,i),{move:c=!0,reverse:l}=i||{};let u=0,h=0,f,m,g,y,x,v;const S=C=>(a+(l?o-C:C))%s,k=()=>{y!==x&&(e.lineTo(u,x),e.lineTo(u,y),e.lineTo(u,v))};for(c&&(m=r[S(0)],e.moveTo(m.x,m.y)),f=0;f<=o;++f){if(m=r[S(f)],m.skip)continue;const C=m.x,E=m.y,P=C|0;P===g?(E<y?y=E:E>x&&(x=E),u=(h*u+C)/++h):(k(),e.lineTo(C,E),g=P,h=0,y=x=E),v=E}k()}function xo(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Gb:Xb}function Kb(e){return e.stepped?Kp:e.tension||e.cubicInterpolationMode==="monotone"?Zp:Gn}function Zb(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),bd(e,t.options),e.stroke(r)}function Qb(e,t,n,i){const{segments:r,options:s}=t,a=xo(t);for(const o of r)bd(e,s,o.style),e.beginPath(),a(e,t,o,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const Jb=typeof Path2D=="function";function t0(e,t,n,i){Jb&&!t.options.segment?Zb(e,t,n,i):Qb(e,t,n,i)}class On extends Zt{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,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;$p(this._points,i,t,r,n),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=iy(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,a=Cu(this,{property:n,start:r,end:r});if(!a.length)return;const o=[],c=Kb(i);let l,u;for(l=0,u=a.length;l<u;++l){const{start:h,end:f}=a[l],m=s[h],g=s[f];if(m===g){o.push(m);continue}const y=Math.abs((r-m[n])/(g[n]-m[n])),x=c(m,g,y,i.stepped);x[n]=t[n],o.push(x)}return o.length===1?o[0]:o}pathSegment(t,n,i){return xo(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=xo(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const o of r)a&=s(t,this,o,{start:n,end:n+i-1});return!!a}draw(t,n,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),t0(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(On,"id","line"),R(On,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(On,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(On,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function xd(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class Ns extends Zt{constructor(n){super();R(this,"parsed");R(this,"skip");R(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,i,r){const s=this.options,{x:a,y:o}=this.getProps(["x","y"],r);return Math.pow(n-a,2)+Math.pow(i-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,i){return xd(this,n,"x",i)}inYRange(n,i){return xd(this,n,"y",i)}getCenterPoint(n){const{x:i,y:r}=this.getProps(["x","y"],n);return{x:i,y:r}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);const r=i&&n.borderWidth||0;return(i+r)*2}draw(n,i){const r=this.options;this.skip||r.radius<.1||!rn(this,i,this.size(r)/2)||(n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.fillStyle=r.backgroundColor,Ja(n,r,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}R(Ns,"id","point"),R(Ns,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(Ns,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function wd(e,t){const{x:n,y:i,base:r,width:s,height:a}=e.getProps(["x","y","base","width","height"],t);let o,c,l,u,h;return e.horizontal?(h=a/2,o=Math.min(n,r),c=Math.max(n,r),l=i-h,u=i+h):(h=s/2,o=n-h,c=n+h,l=Math.min(i,r),u=Math.max(i,r)),{left:o,top:l,right:c,bottom:u}}function Pn(e,t,n,i){return e?0:Kt(t,n,i)}function e0(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=hu(i);return{t:Pn(r.top,s.top,0,n),r:Pn(r.right,s.right,0,t),b:Pn(r.bottom,s.bottom,0,n),l:Pn(r.left,s.left,0,t)}}function n0(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=Dn(r),a=Math.min(t,n),o=e.borderSkipped,c=i||ft(r);return{topLeft:Pn(!c||o.top||o.left,s.topLeft,0,a),topRight:Pn(!c||o.top||o.right,s.topRight,0,a),bottomLeft:Pn(!c||o.bottom||o.left,s.bottomLeft,0,a),bottomRight:Pn(!c||o.bottom||o.right,s.bottomRight,0,a)}}function i0(e){const t=wd(e),n=t.right-t.left,i=t.bottom-t.top,r=e0(e,n/2,i/2),s=n0(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function wo(e,t,n,i){const r=t===null,s=n===null,o=e&&!(r&&s)&&wd(e,i);return o&&(r||en(t,o.left,o.right))&&(s||en(n,o.top,o.bottom))}function r0(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function s0(e,t){e.rect(t.x,t.y,t.w,t.h)}function vo(e,t,n={}){const i=e.x!==n.x?-t:0,r=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-r;return{x:e.x+i,y:e.y+r,w:e.w+s,h:e.h+a,radius:e.radius}}class Fs extends Zt{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:n,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=i0(this),o=r0(a.radius)?_i:s0;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),o(t,vo(a,n,s)),t.clip(),o(t,vo(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,vo(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return wo(this,t,n,i)}inXRange(t,n){return wo(this,t,null,n)}inYRange(t,n){return wo(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+r)/2:n,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}R(Fs,"id","bar"),R(Fs,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(Fs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var a0=Object.freeze({__proto__:null,ArcElement:vr,BarElement:Fs,LineElement:On,PointElement:Ns});const So=["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)"],vd=So.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Sd(e){return So[e%So.length]}function kd(e){return vd[e%vd.length]}function o0(e,t){return e.borderColor=Sd(t),e.backgroundColor=kd(t),++t}function l0(e,t){return e.backgroundColor=e.data.map(()=>Sd(t++)),t}function c0(e,t){return e.backgroundColor=e.data.map(()=>kd(t++)),t}function u0(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof an?t=l0(n,t):r instanceof mr?t=c0(n,t):r&&(t=o0(n,t))}}function Md(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function d0(e){return e&&(e.borderColor||e.backgroundColor)}function h0(){return Pt.borderColor!=="rgba(0,0,0,0.1)"||Pt.backgroundColor!=="rgba(0,0,0,0.1)"}var f0={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=e.config,{elements:s}=r,a=Md(i)||d0(r)||s&&Md(s)||h0();if(!n.forceOverride&&a)return;const o=u0(e);i.forEach(o)}};function m0(e,t,n,i,r){const s=r.samples||i;if(s>=n)return e.slice(t,t+n);const a=[],o=(n-2)/(s-2);let c=0;const l=t+n-1;let u=t,h,f,m,g,y;for(a[c++]=e[u],h=0;h<s-2;h++){let x=0,v=0,S;const k=Math.floor((h+1)*o)+1+t,C=Math.min(Math.floor((h+2)*o)+1,n)+t,E=C-k;for(S=k;S<C;S++)x+=e[S].x,v+=e[S].y;x/=E,v/=E;const P=Math.floor(h*o)+1+t,T=Math.min(Math.floor((h+1)*o)+1,n)+t,{x:p,y:_}=e[u];for(m=g=-1,S=P;S<T;S++)g=.5*Math.abs((p-x)*(e[S].y-_)-(p-e[S].x)*(v-_)),g>m&&(m=g,f=e[S],y=S);a[c++]=f,u=y}return a[c++]=e[l],a}function g0(e,t,n,i){let r=0,s=0,a,o,c,l,u,h,f,m,g,y;const x=[],v=t+n-1,S=e[t].x,C=e[v].x-S;for(a=t;a<t+n;++a){o=e[a],c=(o.x-S)/C*i,l=o.y;const E=c|0;if(E===u)l<g?(g=l,h=a):l>y&&(y=l,f=a),r=(s*r+o.x)/++s;else{const P=a-1;if(!it(h)&&!it(f)){const T=Math.min(h,f),p=Math.max(h,f);T!==m&&T!==P&&x.push({...e[T],x:r}),p!==m&&p!==P&&x.push({...e[p],x:r})}a>0&&P!==m&&x.push(e[P]),x.push(o),u=E,s=0,g=y=l,h=f=m=a}}return x}function Td(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Dd(e){e.data.datasets.forEach(t=>{Td(t)})}function p0(e,t){const n=t.length;let i=0,r;const{iScale:s}=e,{min:a,max:o,minDefined:c,maxDefined:l}=s.getUserBounds();return c&&(i=Kt(nn(t,s.axis,a).lo,0,n-1)),l?r=Kt(nn(t,s.axis,o).hi+1,i,n)-i:r=n-i,{start:i,count:r}}var y0={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Dd(e);return}const i=e.width;e.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:o}=r,c=e.getDatasetMeta(s),l=a||r.data;if(ur([o,e.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=e.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:h,count:f}=p0(c,l);const m=n.threshold||4*i;if(f<=m){Td(r);return}it(a)&&(r._data=l,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let g;switch(n.algorithm){case"lttb":g=m0(l,h,f,i,n);break;case"min-max":g=g0(l,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=g})},destroy(e){Dd(e)}};function b0(e,t,n){const i=e.segments,r=e.points,s=t.points,a=[];for(const o of i){let{start:c,end:l}=o;l=Bs(c,l,r);const u=ko(n,r[c],r[l],o.loop);if(!t.segments){a.push({source:o,target:u,start:r[c],end:r[l]});continue}const h=Cu(t,u);for(const f of h){const m=ko(n,s[f.start],s[f.end],f.loop),g=Du(o,r,m);for(const y of g)a.push({source:y,target:f,start:{[n]:Cd(u,m,"start",Math.max)},end:{[n]:Cd(u,m,"end",Math.min)}})}}return a}function ko(e,t,n,i){if(i)return;let r=t[e],s=n[e];return e==="angle"&&(r=re(r),s=re(s)),{property:e,start:r,end:s}}function _0(e,t){const{x:n=null,y:i=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:o})=>{o=Bs(a,o,r);const c=r[a],l=r[o];i!==null?(s.push({x:c.x,y:i}),s.push({x:l.x,y:i})):n!==null&&(s.push({x:n,y:c.y}),s.push({x:n,y:l.y}))}),s}function Bs(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Cd(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Ed(e,t){let n=[],i=!1;return wt(e)?(i=!0,n=e):n=_0(e,t),n.length?new On({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Od(e){return e&&e.fill!==!1}function x0(e,t,n){let r=e[t].fill;const s=[t];let a;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!Rt(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function w0(e,t,n){const i=M0(e);if(ft(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Rt(r)&&Math.floor(r)===r?v0(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function v0(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function S0(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ft(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function k0(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:ft(e)?i=e.value:i=t.getBaseValue(),i}function M0(e){const t=e.options,n=t.fill;let i=rt(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function T0(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,o=D0(t,n);o.push(Ed({x:null,y:t.bottom},i));for(let c=0;c<s.length;c++){const l=s[c];for(let u=l.start;u<=l.end;u++)C0(r,a[u],o)}return new On({points:r,options:{}})}function D0(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function C0(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:o,point:c}=E0(s,t,"x");if(!(!c||a&&o)){if(a)i.unshift(c);else if(e.push(c),!o)break}}e.push(...i)}function E0(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const r=i[n],s=e.segments,a=e.points;let o=!1,c=!1;for(let l=0;l<s.length;l++){const u=s[l],h=a[u.start][n],f=a[u.end][n];if(en(r,h,f)){o=r===h,c=r===f;break}}return{first:o,last:c,point:i}}class Pd{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:r,y:s,radius:a}=this;return n=n||{start:0,end:Ct},t.arc(r,s,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:r}=this,s=t.angle;return{x:n+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function O0(e){const{chart:t,fill:n,line:i}=e;if(Rt(n))return P0(t,n);if(n==="stack")return T0(e);if(n==="shape")return!0;const r=R0(e);return r instanceof Pd?r:Ed(r,i)}function P0(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function R0(e){return(e.scale||{}).getPointPositionForValue?I0(e):A0(e)}function A0(e){const{scale:t={},fill:n}=e,i=S0(n,t);if(Rt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function I0(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=k0(n,t,s),o=[];if(i.grid.circular){const c=t.getPointPositionForValue(0,s);return new Pd({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(a)})}for(let c=0;c<r;++c)o.push(t.getPointPositionForValue(c,a));return o}function Mo(e,t,n){const i=O0(t),{chart:r,index:s,line:a,scale:o,axis:c}=t,l=a.options,u=l.fill,h=l.backgroundColor,{above:f=h,below:m=h}=u||{},g=r.getDatasetMeta(s),y=Pu(r,g);i&&a.points.length&&(lr(e,n),L0(e,{line:a,target:i,above:f,below:m,area:n,scale:o,axis:c,clip:y}),cr(e))}function L0(e,t){const{line:n,target:i,above:r,below:s,area:a,scale:o,clip:c}=t,l=n._loop?"angle":t.axis;e.save();let u=s;s!==r&&(l==="x"?(Rd(e,i,a.top),To(e,{line:n,target:i,color:r,scale:o,property:l,clip:c}),e.restore(),e.save(),Rd(e,i,a.bottom)):l==="y"&&(Ad(e,i,a.left),To(e,{line:n,target:i,color:s,scale:o,property:l,clip:c}),e.restore(),e.save(),Ad(e,i,a.right),u=r)),To(e,{line:n,target:i,color:u,scale:o,property:l,clip:c}),e.restore()}function Rd(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const o of i){const{start:c,end:l}=o,u=r[c],h=r[Bs(c,l,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),a=!!t.pathSegment(e,o,{move:a}),a?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Ad(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const o of i){const{start:c,end:l}=o,u=r[c],h=r[Bs(c,l,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),a=!!t.pathSegment(e,o,{move:a}),a?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function To(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:o}=t,c=b0(n,i,r);for(const{source:l,target:u,start:h,end:f}of c){const{style:{backgroundColor:m=s}={}}=l,g=i!==!0;e.save(),e.fillStyle=m,N0(e,a,o,g&&ko(r,h,f)),e.beginPath();const y=!!n.pathSegment(e,l);let x;if(g){y?e.closePath():Id(e,i,f,r);const v=!!i.pathSegment(e,u,{move:y,reverse:!0});x=y&&v,x||Id(e,i,h,r)}e.closePath(),e.fill(x?"evenodd":"nonzero"),e.restore()}}function N0(e,t,n,i){const r=t.chart.chartArea,{property:s,start:a,end:o}=i||{};if(s==="x"||s==="y"){let c,l,u,h;s==="x"?(c=a,l=r.top,u=o,h=r.bottom):(c=r.left,l=a,u=r.right,h=o),e.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),l=Math.max(l,n.top),h=Math.min(h,n.bottom)),e.rect(c,l,u-c,h-l),e.clip()}}function Id(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var F0={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,r=[];let s,a,o,c;for(a=0;a<i;++a)s=e.getDatasetMeta(a),o=s.dataset,c=null,o&&o.options&&o instanceof On&&(c={visible:e.isDatasetVisible(a),index:a,fill:w0(o,a,i),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:o}),s.$filler=c,r.push(c);for(a=0;a<i;++a)c=r[a],!(!c||c.fill===!1)&&(c.fill=x0(r,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let a=r.length-1;a>=0;--a){const o=r[a].$filler;o&&(o.line.updateControlPoints(s,o.axis),i&&o.fill&&Mo(e.ctx,o,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;Od(s)&&Mo(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Od(i)||n.drawTime!=="beforeDatasetDraw"||Mo(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ld=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},B0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Nd extends Zt{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,n,i){this.maxWidth=t,this.maxHeight=n,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 n=kt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=At(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:c}=Ld(i,s);let l,u;n.font=r.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(a,s,o,c)+10):(u=this.maxHeight,l=this._fitCols(a,r,o,c)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:o}}}=this,c=this.legendHitBoxes=[],l=this.lineWidths=[0],u=r+o;let h=t;s.textAlign="left",s.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((g,y)=>{const x=i+n/2+s.measureText(g.text).width;(y===0||l[l.length-1]+x+2*o>a)&&(h+=u,l[l.length-(y>0?0:1)]=0,m+=u,f++),c[y]={left:0,top:m,row:f,width:x,height:r},l[l.length-1]+=x+o}),h}_fitCols(t,n,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:o}}}=this,c=this.legendHitBoxes=[],l=this.columnSizes=[],u=a-t;let h=o,f=0,m=0,g=0,y=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:S,itemHeight:k}=z0(i,n,s,x,r);v>0&&m+k+2*o>u&&(h+=f+o,l.push({width:f,height:m}),g+=f+o,y++,f=m=0),c[v]={left:g,top:m,col:y,width:S,height:k},f=Math.max(f,S),m+=k+o}),h+=f,l.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,a=vi(s,this.left,this.width);if(this.isHorizontal()){let o=0,c=se(i,this.left+r,this.right-this.lineWidths[o]);for(const l of n)o!==l.row&&(o=l.row,c=se(i,this.left+r,this.right-this.lineWidths[o])),l.top+=this.top+t+r,l.left=a.leftForLtr(a.x(c),l.width),c+=l.width+r}else{let o=0,c=se(i,this.top+t+r,this.bottom-this.columnSizes[o].height);for(const l of n)l.col!==o&&(o=l.col,c=se(i,this.top+t+r,this.bottom-this.columnSizes[o].height)),l.top=c,l.left+=this.left+r,l.left=a.leftForLtr(a.x(l.left),l.width),c+=l.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;lr(t,this),this._draw(),cr(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,o=Pt.color,c=vi(t.rtl,this.left,this.width),l=At(a.font),{padding:u}=a,h=l.size,f=h/2;let m;this.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;const{boxWidth:g,boxHeight:y,itemHeight:x}=Ld(a,h),v=function(P,T,p){if(isNaN(g)||g<=0||isNaN(y)||y<0)return;r.save();const _=rt(p.lineWidth,1);if(r.fillStyle=rt(p.fillStyle,o),r.lineCap=rt(p.lineCap,"butt"),r.lineDashOffset=rt(p.lineDashOffset,0),r.lineJoin=rt(p.lineJoin,"miter"),r.lineWidth=_,r.strokeStyle=rt(p.strokeStyle,o),r.setLineDash(rt(p.lineDash,[])),a.usePointStyle){const M={radius:y*Math.SQRT2/2,pointStyle:p.pointStyle,rotation:p.rotation,borderWidth:_},O=c.xPlus(P,g/2),A=T+f;du(r,M,O,A,a.pointStyleWidth&&g)}else{const M=T+Math.max((h-y)/2,0),O=c.leftForLtr(P,g),A=Dn(p.borderRadius);r.beginPath(),Object.values(A).some(I=>I!==0)?_i(r,{x:O,y:M,w:g,h:y,radius:A}):r.rect(O,M,g,y),r.fill(),_!==0&&r.stroke()}r.restore()},S=function(P,T,p){qn(r,p.text,P,T+x/2,l,{strikethrough:p.hidden,textAlign:c.textAlign(p.textAlign)})},k=this.isHorizontal(),C=this._computeTitleHeight();k?m={x:se(s,this.left+u,this.right-i[0]),y:this.top+u+C,line:0}:m={x:this.left+u,y:se(s,this.top+C+u,this.bottom-n[0].height),line:0},Su(this.ctx,t.textDirection);const E=x+u;this.legendItems.forEach((P,T)=>{r.strokeStyle=P.fontColor,r.fillStyle=P.fontColor;const p=r.measureText(P.text).width,_=c.textAlign(P.textAlign||(P.textAlign=a.textAlign)),M=g+f+p;let O=m.x,A=m.y;c.setWidth(this.width),k?T>0&&O+M+u>this.right&&(A=m.y+=E,m.line++,O=m.x=se(s,this.left+u,this.right-i[m.line])):T>0&&A+E>this.bottom&&(O=m.x=O+n[m.line].width+u,m.line++,A=m.y=se(s,this.top+C+u,this.bottom-n[m.line].height));const I=c.x(O);if(v(I,A,P),O=ap(_,O+g+f,k?O+M:this.right,t.rtl),S(c.x(O),A,P),k)m.x+=M+u;else if(typeof P.text!="string"){const B=l.lineHeight;m.y+=Fd(P,B)+u}else m.y+=E}),ku(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=At(n.font),r=Yt(n.padding);if(!n.display)return;const s=vi(t.rtl,this.left,this.width),a=this.ctx,o=n.position,c=i.size/2,l=r.top+c;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+l,h=se(t.align,h,this.right-f);else{const g=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);u=l+se(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=se(o,h,h+f);a.textAlign=s.textAlign(Xa(o)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,qn(a,n.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,n=At(t.font),i=Yt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(en(t,this.left,this.right)&&en(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],en(t,r.left,r.left+r.width)&&en(n,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!$0(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=B0(r,i);r&&!s&&kt(n.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&kt(n.onHover,[t,i,this],this)}else i&&kt(n.onClick,[t,i,this],this)}}function z0(e,t,n,i,r){const s=H0(i,e,t,n),a=V0(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function H0(e,t,n,i){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+n.size/2+i.measureText(r).width}function V0(e,t,n){let i=e;return typeof t.text!="string"&&(i=Fd(t,n)),i}function Fd(e,t){const n=e.text?e.text.length:0;return t*n}function $0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var W0={id:"legend",_element:Nd,start(e,t,n){const i=e.legend=new Nd({ctx:e.ctx,options:n,chart:e});ae.configure(e,i,n),ae.addBox(e,i)},stop(e){ae.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;ae.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:o}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const l=c.controller.getStyle(n?0:void 0),u=Yt(l.borderWidth);return{text:t[c.index].label,fillStyle:l.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:i||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:a&&(o||l.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Do extends Zt{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,n){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=n;const r=wt(i.text)?i.text.length:1;this._padding=Yt(i.padding);const s=r*At(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:r,right:s,options:a}=this,o=a.align;let c=0,l,u,h;return this.isHorizontal()?(u=se(o,i,s),h=n+t,l=s-i):(a.position==="left"?(u=i+t,h=se(o,r,n),c=ut*-.5):(u=s-t,h=se(o,n,r),c=ut*.5),l=r-n),{titleX:u,titleY:h,maxWidth:l,rotation:c}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=At(n.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:c,rotation:l}=this._drawArgs(s);qn(t,n.text,0,0,i,{color:n.color,maxWidth:c,rotation:l,textAlign:Xa(n.align),textBaseline:"middle",translation:[a,o]})}}function Y0(e,t){const n=new Do({ctx:e.ctx,options:t,chart:e});ae.configure(e,n,t),ae.addBox(e,n),e.titleBlock=n}var j0={id:"title",_element:Do,start(e,t,n){Y0(e,n)},stop(e){const t=e.titleBlock;ae.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;ae.configure(e,i,n),i.options=n},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 zs=new WeakMap;var U0={id:"subtitle",start(e,t,n){const i=new Do({ctx:e.ctx,options:n,chart:e});ae.configure(e,i,n),ae.addBox(e,i),zs.set(e,i)},stop(e){ae.removeBox(e,zs.get(e)),zs.delete(e)},beforeUpdate(e,t,n){const i=zs.get(e);ae.configure(e,i,n),i.options=n},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 Sr={average(e){if(!e.length)return!1;let t,n,i=new Set,r=0,s=0;for(t=0,n=e.length;t<n;++t){const o=e[t].element;if(o&&o.hasValue()){const c=o.tooltipPosition();i.add(c.x),r+=c.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((o,c)=>o+c)/i.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,o;for(s=0,a=e.length;s<a;++s){const c=e[s].element;if(c&&c.hasValue()){const l=c.getCenterPoint(),u=bi(t,l);u<r&&(r=u,o=c)}}if(o){const c=o.tooltipPosition();n=c.x,i=c.y}return{x:n,y:i}}};function Ye(e,t){return t&&(wt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function on(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
17
+ `)>-1?e.split(`
18
+ `):e}function q0(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:a,value:o}=s.getLabelAndValue(r);return{chart:e,label:a,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:o,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Bd(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:a,boxHeight:o}=t,c=At(t.bodyFont),l=At(t.titleFont),u=At(t.footerFont),h=s.length,f=r.length,m=i.length,g=Yt(t.padding);let y=g.height,x=0,v=i.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,h&&(y+=h*l.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),v){const C=t.displayColors?Math.max(o,c.lineHeight):c.lineHeight;y+=m*C+(v-m)*c.lineHeight+(v-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const k=function(C){x=Math.max(x,n.measureText(C).width+S)};return n.save(),n.font=l.string,Mt(e.title,k),n.font=c.string,Mt(e.beforeBody.concat(e.afterBody),k),S=t.displayColors?a+2+t.boxPadding:0,Mt(i,C=>{Mt(C.before,k),Mt(C.lines,k),Mt(C.after,k)}),S=0,n.font=u.string,Mt(e.footer,k),n.restore(),x+=g.width,{width:x,height:y}}function X0(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function G0(e,t,n,i){const{x:r,width:s}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&r+s+a>t.width||e==="right"&&r-s-a<0)return!0}function K0(e,t,n,i){const{x:r,width:s}=n,{width:a,chartArea:{left:o,right:c}}=e;let l="center";return i==="center"?l=r<=(o+c)/2?"left":"right":r<=s/2?l="left":r>=a-s/2&&(l="right"),G0(l,e,t,n)&&(l="center"),l}function zd(e,t,n){const i=n.yAlign||t.yAlign||X0(e,n);return{xAlign:n.xAlign||t.xAlign||K0(e,t,n,i),yAlign:i}}function Z0(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function Q0(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Hd(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=e,{xAlign:o,yAlign:c}=n,l=r+s,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=Dn(a);let g=Z0(t,o);const y=Q0(t,c,l);return c==="center"?o==="left"?g+=l:o==="right"&&(g-=l):o==="left"?g-=Math.max(u,f)+r:o==="right"&&(g+=Math.max(h,m)+r),{x:Kt(g,0,i.width-t.width),y:Kt(y,0,i.height-t.height)}}function Hs(e,t,n){const i=Yt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Vd(e){return Ye([],on(e))}function J0(e,t,n){return Cn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function $d(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Wd={beforeTitle:tn,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.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 n[t.dataIndex]}return""},afterTitle:tn,beforeBody:tn,beforeLabel:tn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return it(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:tn,afterBody:tn,beforeFooter:tn,footer:tn,afterFooter:tn};function _e(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?Wd[t].call(n,i):r}class Co extends Zt{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 n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new ao(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=J0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=_e(i,"beforeTitle",this,t),s=_e(i,"title",this,t),a=_e(i,"afterTitle",this,t);let o=[];return o=Ye(o,on(r)),o=Ye(o,on(s)),o=Ye(o,on(a)),o}getBeforeBody(t,n){return Vd(_e(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return Mt(t,s=>{const a={before:[],lines:[],after:[]},o=$d(i,s);Ye(a.before,on(_e(o,"beforeLabel",this,s))),Ye(a.lines,_e(o,"label",this,s)),Ye(a.after,on(_e(o,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return Vd(_e(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=_e(i,"beforeFooter",this,t),s=_e(i,"footer",this,t),a=_e(i,"afterFooter",this,t);let o=[];return o=Ye(o,on(r)),o=Ye(o,on(s)),o=Ye(o,on(a)),o}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],a=[];let o=[],c,l;for(c=0,l=n.length;c<l;++c)o.push(q0(this.chart,n[c]));return t.filter&&(o=o.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(o=o.sort((u,h)=>t.itemSort(u,h,i))),Mt(o,u=>{const h=$d(t.callbacks,u);r.push(_e(h,"labelColor",this,u)),s.push(_e(h,"labelPointStyle",this,u)),a.push(_e(h,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=o,o}update(t,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const o=Sr[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const c=this._size=Bd(this,i),l=Object.assign({},o,c),u=zd(this.chart,i,l),h=Hd(i,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:c,topRight:l,bottomLeft:u,bottomRight:h}=Dn(o),{x:f,y:m}=t,{width:g,height:y}=n;let x,v,S,k,C,E;return s==="center"?(C=m+y/2,r==="left"?(x=f,v=x-a,k=C+a,E=C-a):(x=f+g,v=x+a,k=C-a,E=C+a),S=x):(r==="left"?v=f+Math.max(c,u)+a:r==="right"?v=f+g-Math.max(l,h)-a:v=this.caretX,s==="top"?(k=m,C=k-a,x=v-a,S=v+a):(k=m+y,C=k+a,x=v+a,S=v-a),E=k),{x1:x,x2:v,x3:S,y1:k,y2:C,y3:E}}drawTitle(t,n,i){const r=this.title,s=r.length;let a,o,c;if(s){const l=vi(i.rtl,this.x,this.width);for(t.x=Hs(this,i.titleAlign,i),n.textAlign=l.textAlign(i.titleAlign),n.textBaseline="middle",a=At(i.titleFont),o=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,c=0;c<s;++c)n.fillText(r[c],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,c+1===s&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,n,i,r,s){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:c,boxWidth:l}=s,u=At(s.bodyFont),h=Hs(this,"left",s),f=r.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=n.y+m;if(s.usePointStyle){const y={radius:Math.min(l,c)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},x=r.leftForLtr(f,l)+l/2,v=g+c/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Ja(t,y,x,v),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Ja(t,y,x,v)}else{t.lineWidth=ft(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const y=r.leftForLtr(f,l),x=r.leftForLtr(r.xPlus(f,1),l-2),v=Dn(a.borderRadius);Object.values(v).some(S=>S!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,_i(t,{x:y,y:g,w:l,h:c,radius:v}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),_i(t,{x,y:g+1,w:l-2,h:c-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(y,g,l,c),t.strokeRect(y,g,l,c),t.fillStyle=a.backgroundColor,t.fillRect(x,g+1,l-2,c-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:o,boxHeight:c,boxWidth:l,boxPadding:u}=i,h=At(i.bodyFont);let f=h.lineHeight,m=0;const g=vi(i.rtl,this.x,this.width),y=function(p){n.fillText(p,g.x(t.x+m),t.y+f/2),t.y+=f+s},x=g.textAlign(a);let v,S,k,C,E,P,T;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,t.x=Hs(this,x,i),n.fillStyle=i.bodyColor,Mt(this.beforeBody,y),m=o&&x!=="right"?a==="center"?l/2+u:l+2+u:0,C=0,P=r.length;C<P;++C){for(v=r[C],S=this.labelTextColors[C],n.fillStyle=S,Mt(v.before,y),k=v.lines,o&&k.length&&(this._drawColorBox(n,t,C,g,i),f=Math.max(h.lineHeight,c)),E=0,T=k.length;E<T;++E)y(k[E]),f=h.lineHeight;Mt(v.after,y)}m=0,f=h.lineHeight,Mt(this.afterBody,y),t.y-=s}drawFooter(t,n,i){const r=this.footer,s=r.length;let a,o;if(s){const c=vi(i.rtl,this.x,this.width);for(t.x=Hs(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=c.textAlign(i.footerAlign),n.textBaseline="middle",a=At(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,o=0;o<s;++o)n.fillText(r[o],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,r){const{xAlign:s,yAlign:a}=this,{x:o,y:c}=t,{width:l,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=Dn(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(o+h,c),a==="top"&&this.drawCaret(t,n,i,r),n.lineTo(o+l-f,c),n.quadraticCurveTo(o+l,c,o+l,c+f),a==="center"&&s==="right"&&this.drawCaret(t,n,i,r),n.lineTo(o+l,c+u-g),n.quadraticCurveTo(o+l,c+u,o+l-g,c+u),a==="bottom"&&this.drawCaret(t,n,i,r),n.lineTo(o+m,c+u),n.quadraticCurveTo(o,c+u,o,c+u-m),a==="center"&&s==="left"&&this.drawCaret(t,n,i,r),n.lineTo(o,c+h),n.quadraticCurveTo(o,c,o+h,c),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=Sr[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=Bd(this,t),c=Object.assign({},a,this._size),l=zd(n,t,c),u=Hd(t,c,l,n);(r._to!==u.x||s._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Yt(n.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),Su(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),ku(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,r=t.map(({datasetIndex:o,index:c})=>{const l=this.chart.getDatasetMeta(o);if(!l)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:l.data[c],index:c}}),s=!ds(i,r),a=this._positionChanged(r,n);(s||a)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,n,i),o=this._positionChanged(a,t),c=n||!ds(a,s)||o;return c&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:i,caretY:r,options:s}=this,a=Sr[s.position].call(this,t,n);return a!==!1&&(i!==a.x||r!==a.y)}}R(Co,"positioners",Sr);var Ce={id:"tooltip",_element:Co,positioners:Sr,afterInit(e,t,n){n&&(e.tooltip=new Co({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},t_=Object.freeze({__proto__:null,Colors:f0,Decimation:y0,Filler:F0,Legend:W0,SubTitle:U0,Title:j0,Tooltip:Ce});const e_=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function n_(e,t,n,i){const r=e.indexOf(t);if(r===-1)return e_(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const i_=(e,t)=>e===null?null:Kt(Math.round(e),0,t);function Yd(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Eo extends Zn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:r,label:s}of n)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(it(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:n_(i,t,rt(n,t),this._addedLabels),i_(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)r.push({value:a});return r}getLabelForValue(t){return Yd.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}R(Eo,"id","category"),R(Eo,"defaults",{ticks:{callback:Yd}});function r_(e,t){const n=[],{bounds:r,step:s,min:a,max:o,precision:c,count:l,maxTicks:u,maxDigits:h,includeBounds:f}=e,m=s||1,g=u-1,{min:y,max:x}=t,v=!it(a),S=!it(o),k=!it(l),C=(x-y)/(h+1);let E=Gc((x-y)/g/m)*m,P,T,p,_;if(E<1e-14&&!v&&!S)return[{value:y},{value:x}];_=Math.ceil(x/E)-Math.floor(y/E),_>g&&(E=Gc(_*E/g/m)*m),it(c)||(P=Math.pow(10,c),E=Math.ceil(E*P)/P),r==="ticks"?(T=Math.floor(y/E)*E,p=Math.ceil(x/E)*E):(T=y,p=x),v&&S&&s&&Jg((o-a)/s,E/1e3)?(_=Math.round(Math.min((o-a)/E,u)),E=(o-a)/_,T=a,p=o):k?(T=v?a:T,p=S?o:p,_=l-1,E=(p-T)/_):(_=(p-T)/E,ir(_,Math.round(_),E/1e3)?_=Math.round(_):_=Math.ceil(_));const M=Math.max(Zc(E),Zc(T));P=Math.pow(10,it(c)?M:c),T=Math.round(T*P)/P,p=Math.round(p*P)/P;let O=0;for(v&&(f&&T!==a?(n.push({value:a}),T<a&&O++,ir(Math.round((T+O*E)*P)/P,a,jd(a,C,e))&&O++):T<a&&O++);O<_;++O){const A=Math.round((T+O*E)*P)/P;if(S&&A>o)break;n.push({value:A})}return S&&f&&p!==o?n.length&&ir(n[n.length-1].value,o,jd(o,C,e))?n[n.length-1].value=o:n.push({value:o}):(!S||p===o)&&n.push({value:p}),n}function jd(e,t,{horizontal:n,minRotation:i}){const r=Wt(i),s=(n?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+e).length;return Math.min(t/s,a)}class Vs extends Zn{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,n){return it(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=c=>r=n?r:c,o=c=>s=i?s:c;if(t){const c=$e(r),l=$e(s);c<0&&l<0?o(0):c>0&&l>0&&a(0)}if(r===s){let c=s===0?1:Math.abs(s*.05);o(s+c),t||a(r-c)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,a=r_(r,s);return t.bounds==="ticks"&&Kc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return ar(t,this.chart.options.locale,this.options.ticks.format)}}class Oo extends Vs{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Rt(t)?t:0,this.max=Rt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Wt(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}R(Oo,"id","linear"),R(Oo,"defaults",{ticks:{callback:bs.formatters.numeric}});const kr=e=>Math.floor(Mn(e)),Qn=(e,t)=>Math.pow(10,kr(e)+t);function Ud(e){return e/Math.pow(10,kr(e))===1}function qd(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function s_(e,t){const n=t-e;let i=kr(n);for(;qd(e,t,i)>10;)i++;for(;qd(e,t,i)<10;)i--;return Math.min(i,kr(e))}function a_(e,{min:t,max:n}){t=De(e.min,t);const i=[],r=kr(t);let s=s_(t,n),a=s<0?Math.pow(10,Math.abs(s)):1;const o=Math.pow(10,s),c=r>s?Math.pow(10,r):0,l=Math.round((t-c)*a)/a,u=Math.floor((t-c)/o/10)*o*10;let h=Math.floor((l-u)/Math.pow(10,s)),f=De(e.min,Math.round((c+u+h*Math.pow(10,s))*a)/a);for(;f<n;)i.push({value:f,major:Ud(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(s++,h=2,a=s>=0?1:a),f=Math.round((c+u+h*Math.pow(10,s))*a)/a;const m=De(e.max,f);return i.push({value:m,major:Ud(m),significand:h}),i}class Po extends Zn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Vs.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Rt(t)?Math.max(0,t):null,this.max=Rt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rt(this._userMin)&&(this.min=t===Qn(this.min,0)?Qn(this.min,-1):Qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=o=>i=t?i:o,a=o=>r=n?r:o;i===r&&(i<=0?(s(1),a(10)):(s(Qn(i,-1)),a(Qn(r,1)))),i<=0&&s(Qn(r,-1)),r<=0&&a(Qn(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=a_(n,this);return t.bounds==="ticks"&&Kc(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":ar(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Mn(t),this._valueRange=Mn(this.max)-Mn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Mn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}R(Po,"id","logarithmic"),R(Po,"defaults",{ticks:{callback:bs.formatters.logarithmic,major:{enabled:!0}}});function Ro(e){const t=e.ticks;if(t.display&&e.display){const n=Yt(t.backdropPadding);return rt(t.font&&t.font.size,Pt.font.size)+n.height}return 0}function o_(e,t,n){return n=wt(n)?n:[n],{w:pp(e,t.string,n),h:n.length*t.lineHeight}}function Xd(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:e<i||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function l_(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,a=e.options.pointLabels,o=a.centerPointLabels?ut/s:0;for(let c=0;c<s;c++){const l=a.setContext(e.getPointLabelContext(c));r[c]=l.padding;const u=e.getPointPosition(c,e.drawingArea+r[c],o),h=At(l.font),f=o_(e.ctx,h,e._pointLabels[c]);i[c]=f;const m=re(e.getIndexAngle(c)+o),g=Math.round(gs(m)),y=Xd(g,u.x,f.w,0,180),x=Xd(g,u.y,f.h,90,270);c_(n,t,m,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=h_(e,i,r)}function c_(e,t,n,i,r){const s=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let o=0,c=0;i.start<t.l?(o=(t.l-i.start)/s,e.l=Math.min(e.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+o)),r.start<t.t?(c=(t.t-r.start)/a,e.t=Math.min(e.t,t.t-c)):r.end>t.b&&(c=(r.end-t.b)/a,e.b=Math.max(e.b,t.b+c))}function u_(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:a,size:o}=n,c=e.getPointPosition(t,i+r+a,s),l=Math.round(gs(re(c.angle+Ot))),u=g_(c.y,o.h,l),h=f_(l),f=m_(c.x,o.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:f,top:u,right:f+o.w,bottom:u+o.h}}function d_(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(rn({x:n,y:i},t)||rn({x:n,y:s},t)||rn({x:r,y:i},t)||rn({x:r,y:s},t))}function h_(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:o}=s.pointLabels,c={extra:Ro(s)/2,additionalAngle:a?ut/r:0};let l;for(let u=0;u<r;u++){c.padding=n[u],c.size=t[u];const h=u_(e,u,c);i.push(h),o==="auto"&&(h.visible=d_(h,l),h.visible&&(l=h))}return i}function f_(e){return e===0||e===180?"center":e<180?"left":"right"}function m_(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function g_(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function p_(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:o}=t;if(!it(o)){const c=Dn(t.borderRadius),l=Yt(t.backdropPadding);e.fillStyle=o;const u=i-l.left,h=r-l.top,f=s-i+l.width,m=a-r+l.height;Object.values(c).some(g=>g!==0)?(e.beginPath(),_i(e,{x:u,y:h,w:f,h:m,radius:c}),e.fill()):e.fillRect(u,h,f,m)}}function y_(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(e.getPointLabelContext(r));p_(n,a,s);const o=At(a.font),{x:c,y:l,textAlign:u}=s;qn(n,e._pointLabels[r],c,l+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Gd(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,Ct);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=e.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function b_(e,t,n,i,r){const s=e.ctx,a=t.circular,{color:o,lineWidth:c}=t;!a&&!i||!o||!c||n<0||(s.save(),s.strokeStyle=o,s.lineWidth=c,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Gd(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function __(e,t,n){return Cn(e,{label:n,index:t,type:"pointLabel"})}class Mr extends Vs{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=Yt(Ro(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Rt(t)&&!isNaN(t)?t:0,this.max=Rt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ro(this.options))}generateTickLabels(t){Vs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const r=kt(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?l_(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=Ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return re(t*n+Wt(i))}getDistanceFromCenterForValue(t){if(it(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(it(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return __(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(r)*n+this.xCenter,y:Math.sin(r)*n+this.yCenter,angle:r}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:n,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Gd(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:r,border:s}=n,a=this._pointLabels.length;let o,c,l;if(n.pointLabels.display&&y_(this,a),r.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=r.setContext(f),g=s.setContext(f);b_(this,m,c,a,g)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),l=this.getPointPosition(o,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const l=i.setContext(this.getContext(c)),u=At(l.font);if(s=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=l.backdropColor;const h=Yt(l.backdropPadding);t.fillRect(-a/2-h.left,-s-u.size/2-h.top,a+h.width,u.size+h.height)}qn(t,o.label,0,-s,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}R(Mr,"id","radialLinear"),R(Mr,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:bs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),R(Mr,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(Mr,"descriptors",{angleLines:{_fallback:"grid"}});const $s={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}},xe=Object.keys($s);function Kd(e,t){return e-t}function Zd(e,t){if(it(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),Rt(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(r&&(a=r==="week"&&(Tn(s)||s===!0)?n.startOf(a,"isoWeek",s):n.startOf(a,r)),+a)}function Qd(e,t,n,i){const r=xe.length;for(let s=xe.indexOf(e);s<r-1;++s){const a=$s[xe[s]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(o*a.size))<=i)return xe[s]}return xe[r-1]}function x_(e,t,n,i,r){for(let s=xe.length-1;s>=xe.indexOf(n);s--){const a=xe[s];if($s[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return xe[n?xe.indexOf(n):0]}function w_(e){for(let t=xe.indexOf(e)+1,n=xe.length;t<n;++t)if($s[xe[t]].common)return xe[t]}function Jd(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=qa(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function v_(e,t,n,i){const r=e._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let o,c;for(o=s;o<=a;o=+r.add(o,1,i))c=n[o],c>=0&&(t[c].major=!0);return t}function th(e,t,n){const i=[],r={},s=t.length;let a,o;for(a=0;a<s;++a)o=t[a],r[o]=a,i.push({value:o,major:!1});return s===0||!n?i:v_(e,i,r,n)}class Tr extends Zn{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,n={}){const i=t.time||(t.time={}),r=this._adapter=new Wu._date(t.adapters.date);r.init(n),nr(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Zd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:o}=this.getUserBounds();function c(l){!a&&!isNaN(l.min)&&(r=Math.min(r,l.min)),!o&&!isNaN(l.max)&&(s=Math.max(s,l.max))}(!a||!o)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=Rt(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),s=Rt(s)&&!isNaN(s)?s:+n.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,o=ip(r,s,a);return this._unit=n.unit||(i.autoSkip?Qd(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):x_(this,o.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:w_(this._unit),this.initOffsets(r),t.reverse&&o.reverse(),th(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Kt(n,0,a),i=Kt(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||Qd(s.minUnit,n,i,this._getLabelCapacity(n)),o=rt(r.ticks.stepSize,1),c=a==="week"?s.isoWeekday:!1,l=Tn(c)||c===!0,u={};let h=n,f,m;if(l&&(h=+t.startOf(h,"isoWeek",c)),h=+t.startOf(h,l?"day":a),t.diff(i,n,a)>1e5*o)throw new Error(n+" and "+i+" are too far apart with stepSize of "+o+" "+a);const g=r.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)Jd(u,f,g);return(f===i||r.bounds==="ticks"||m===1)&&Jd(u,f,g),Object.keys(u).sort(Kd).map(y=>+y)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,a=n||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,r){const s=this.options,a=s.ticks.callback;if(a)return kt(a,[t,n,i],this);const o=s.time.displayFormats,c=this._unit,l=this._majorUnit,u=c&&o[c],h=l&&o[l],f=i[n],m=l&&h&&f&&f.major;return this._adapter.format(t,r||(m?h:u))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],r.label=this._tickFormatFunction(r.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,r=Wt(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:i*s+o*a,h:i*a+o*s}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=this._tickFormatFunction(t,0,th(this,[t],this._majorUnit),r),a=this._getLabelSize(s),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n<i;++n)t=t.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const r=this.getLabels();for(n=0,i=r.length;n<i;++n)t.push(Zd(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return tu(t.sort(Kd))}}R(Tr,"id","time"),R(Tr,"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 Ws(e,t,n){let i=0,r=e.length-1,s,a,o,c;n?(t>=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=nn(e,"pos",t)),{pos:s,time:o}=e[i],{pos:a,time:c}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=nn(e,"time",t)),{time:s,pos:o}=e[i],{time:a,pos:c}=e[r]);const l=a-s;return l?o+(c-o)*(t-s)/l:o}class Ao extends Tr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Ws(n,this.min),this._tableRange=Ws(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let a,o,c,l,u;for(a=0,o=t.length;a<o;++a)l=t[a],l>=n&&l<=i&&r.push(l);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,o=r.length;a<o;++a)u=r[a+1],c=r[a-1],l=r[a],Math.round((u+c)/2)!==l&&s.push({time:l,pos:a/(o-1)});return s}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ws(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Ws(this._table,i*this._tableRange+this._minPos,!0)}}R(Ao,"id","timeseries"),R(Ao,"defaults",Tr.defaults);var S_=Object.freeze({__proto__:null,CategoryScale:Eo,LinearScale:Oo,LogarithmicScale:Po,RadialLinearScale:Mr,TimeScale:Tr,TimeSeriesScale:Ao});const k_=[Ry,a0,t_,S_],eh=6048e5,M_=864e5,Dr=6e4,ki=36e5,T_=1e3,nh=Symbol.for("constructDateFrom");function Lt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&nh in e?e[nh](t):e instanceof Date?new e.constructor(t):new Date(t)}function ct(e,t){return Lt(t||e,e)}function Ys(e,t,n){const i=ct(e,n==null?void 0:n.in);return isNaN(t)?Lt((n==null?void 0:n.in)||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Io(e,t,n){const i=ct(e,n==null?void 0:n.in);if(isNaN(t))return Lt(e,NaN);if(!t)return i;const r=i.getDate(),s=Lt(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Lo(e,t,n){return Lt(e,+ct(e)+t)}function D_(e,t,n){return Lo(e,t*ki)}let C_={};function Jn(){return C_}function je(e,t){var o,c,l,u;const n=Jn(),i=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,r=ct(e,t==null?void 0:t.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Mi(e,t){return je(e,{...t,weekStartsOn:1})}function ih(e,t){const n=ct(e,t==null?void 0:t.in),i=n.getFullYear(),r=Lt(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Mi(r),a=Lt(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Mi(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=o.getTime()?i:i-1}function js(e){const t=ct(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ti(e,...t){const n=Lt.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function No(e,t){const n=ct(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function rh(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=No(i),a=No(r),o=+s-js(s),c=+a-js(a);return Math.round((o-c)/M_)}function E_(e,t){const n=ih(e,t),i=Lt(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Mi(i)}function O_(e,t,n){const i=ct(e,n==null?void 0:n.in);return i.setTime(i.getTime()+t*Dr),i}function P_(e,t,n){return Io(e,t*3,n)}function R_(e,t,n){return Lo(e,t*1e3)}function A_(e,t,n){return Ys(e,t*7,n)}function I_(e,t,n){return Io(e,t*12,n)}function Cr(e,t){const n=+ct(e)-+ct(t);return n<0?-1:n>0?1:n}function L_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Fo(e){return!(!L_(e)&&typeof e!="number"||isNaN(+ct(e)))}function N_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function F_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t);return i.getFullYear()-r.getFullYear()}function sh(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=ah(i,r),a=Math.abs(rh(i,r));i.setDate(i.getDate()-s*a);const o=+(ah(i,r)===-s),c=s*(a-o);return c===0?0:c}function ah(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Er(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function B_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=(+i-+r)/ki;return Er(n==null?void 0:n.roundingMethod)(s)}function Bo(e,t){return+ct(e)-+ct(t)}function z_(e,t,n){const i=Bo(e,t)/Dr;return Er(n==null?void 0:n.roundingMethod)(i)}function oh(e,t){const n=ct(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function lh(e,t){const n=ct(e,t==null?void 0:t.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function H_(e,t){const n=ct(e,t==null?void 0:t.in);return+oh(n,t)==+lh(n,t)}function ch(e,t,n){const[i,r,s]=ti(n==null?void 0:n.in,e,e,t),a=Cr(r,s),o=Math.abs(N_(r,s));if(o<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*o);let c=Cr(r,s)===-a;H_(i)&&o===1&&Cr(i,s)===1&&(c=!1);const l=a*(o-+c);return l===0?0:l}function V_(e,t,n){const i=ch(e,t,n)/3;return Er(n==null?void 0:n.roundingMethod)(i)}function $_(e,t,n){const i=Bo(e,t)/1e3;return Er(n==null?void 0:n.roundingMethod)(i)}function W_(e,t,n){const i=sh(e,t,n)/7;return Er(n==null?void 0:n.roundingMethod)(i)}function Y_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=Cr(i,r),a=Math.abs(F_(i,r));i.setFullYear(1584),r.setFullYear(1584);const o=Cr(i,r)===-s,c=s*(a-+o);return c===0?0:c}function j_(e,t){const n=ct(e,t==null?void 0:t.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function U_(e,t){const n=ct(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function q_(e,t){const n=ct(e,t==null?void 0:t.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function uh(e,t){const n=ct(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function X_(e,t){const n=ct(e,t==null?void 0:t.in);return n.setMinutes(59,59,999),n}function G_(e,t){var o,c;const n=Jn(),i=n.weekStartsOn??((c=(o=n.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??0,r=ct(e,t==null?void 0:t.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function K_(e,t){const n=ct(e,t==null?void 0:t.in);return n.setSeconds(59,999),n}function Z_(e,t){const n=ct(e,t==null?void 0:t.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function Q_(e,t){const n=ct(e,t==null?void 0:t.in);return n.setMilliseconds(999),n}const J_={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"}},tx=(e,t,n)=>{let i;const r=J_[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function zo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const ex={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ix={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rx={date:zo({formats:ex,defaultWidth:"full"}),time:zo({formats:nx,defaultWidth:"full"}),dateTime:zo({formats:ix,defaultWidth:"full"})},sx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ax=(e,t,n,i)=>sx[e];function Or(e){return(t,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;r=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const ox={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cx={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"]},ux={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"]},dx={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"}},hx={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"}},fx={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Or({values:ox,defaultWidth:"wide"}),quarter:Or({values:lx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Or({values:cx,defaultWidth:"wide"}),day:Or({values:ux,defaultWidth:"wide"}),dayPeriod:Or({values:dx,defaultWidth:"wide",formattingValues:hx,defaultFormattingWidth:"wide"})};function Pr(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?gx(o,h=>h.test(a)):mx(o,h=>h.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(a.length);return{value:l,rest:u}}}function mx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function gx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function px(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(r.length);return{value:a,rest:o}}}const yx=/^(\d+)(th|st|nd|rd)?/i,bx=/\d+/i,_x={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},xx={any:[/^b/i,/^(a|c)/i]},wx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vx={any:[/1/i,/2/i,/3/i,/4/i]},Sx={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},kx={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]},Mx={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},Tx={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]},Dx={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},Cx={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}},Ex={ordinalNumber:px({matchPattern:yx,parsePattern:bx,valueCallback:e=>parseInt(e,10)}),era:Pr({matchPatterns:_x,defaultMatchWidth:"wide",parsePatterns:xx,defaultParseWidth:"any"}),quarter:Pr({matchPatterns:wx,defaultMatchWidth:"wide",parsePatterns:vx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Pr({matchPatterns:Sx,defaultMatchWidth:"wide",parsePatterns:kx,defaultParseWidth:"any"}),day:Pr({matchPatterns:Mx,defaultMatchWidth:"wide",parsePatterns:Tx,defaultParseWidth:"any"}),dayPeriod:Pr({matchPatterns:Dx,defaultMatchWidth:"any",parsePatterns:Cx,defaultParseWidth:"any"})},dh={code:"en-US",formatDistance:tx,formatLong:rx,formatRelative:ax,localize:fx,match:Ex,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ox(e,t){const n=ct(e,t==null?void 0:t.in);return rh(n,uh(n))+1}function hh(e,t){const n=ct(e,t==null?void 0:t.in),i=+Mi(n)-+E_(n);return Math.round(i/eh)+1}function Ho(e,t){var u,h,f,m;const n=ct(e,t==null?void 0:t.in),i=n.getFullYear(),r=Jn(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(f=r.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=Lt((t==null?void 0:t.in)||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const o=je(a,t),c=Lt((t==null?void 0:t.in)||e,0);c.setFullYear(i,0,s),c.setHours(0,0,0,0);const l=je(c,t);return+n>=+o?i+1:+n>=+l?i:i-1}function Px(e,t){var o,c,l,u;const n=Jn(),i=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??1,r=Ho(e,t),s=Lt((t==null?void 0:t.in)||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),je(s,t)}function fh(e,t){const n=ct(e,t==null?void 0:t.in),i=+je(n,t)-+Px(n,t);return Math.round(i/eh)+1}function Tt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Rn={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Tt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Tt(n+1,2)},d(e,t){return Tt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Tt(e.getHours()%12||12,t.length)},H(e,t){return Tt(e.getHours(),t.length)},m(e,t){return Tt(e.getMinutes(),t.length)},s(e,t){return Tt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Tt(r,t.length)}},Ti={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mh={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Rn.y(e,t)},Y:function(e,t,n,i){const r=Ho(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Tt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Tt(s,t.length)},R:function(e,t){const n=ih(e);return Tt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Tt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Rn.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=fh(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Tt(r,t.length)},I:function(e,t,n){const i=hh(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Rn.d(e,t)},D:function(e,t,n){const i=Ox(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Tt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Tt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Tt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Ti.noon:i===0?r=Ti.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Ti.evening:i>=12?r=Ti.afternoon:i>=4?r=Ti.morning:r=Ti.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Rn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Rn.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Rn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Rn.s(e,t)},S:function(e,t){return Rn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ph(i);case"XXXX":case"XX":return ei(i);case"XXXXX":case"XXX":default:return ei(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return ph(i);case"xxxx":case"xx":return ei(i);case"xxxxx":case"xxx":default:return ei(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+gh(i,":");case"OOOO":default:return"GMT"+ei(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+gh(i,":");case"zzzz":default:return"GMT"+ei(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Tt(i,t.length)},T:function(e,t,n){return Tt(+e,t.length)}};function gh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Tt(s,2)}function ph(e,t){return e%60===0?(e>0?"-":"+")+Tt(Math.abs(e)/60,2):ei(e,t)}function ei(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Tt(Math.trunc(i/60),2),s=Tt(i%60,2);return n+r+t+s}const yh=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bh=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Vo={p:bh,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return yh(e,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",yh(i,t)).replace("{{time}}",bh(r,t))}},Rx=/^D+$/,Ax=/^Y+$/,Ix=["D","DD","YY","YYYY"];function _h(e){return Rx.test(e)}function xh(e){return Ax.test(e)}function $o(e,t,n){const i=Lx(e,t,n);if(console.warn(i),Ix.includes(e))throw new RangeError(i)}function Lx(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Nx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bx=/^'([^]*?)'?$/,zx=/''/g,Hx=/[a-zA-Z]/;function Us(e,t,n){var u,h,f,m,g,y,x,v;const i=Jn(),r=(n==null?void 0:n.locale)??i.locale??dh,s=(n==null?void 0:n.firstWeekContainsDate)??((h=(u=n==null?void 0:n.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,a=(n==null?void 0:n.weekStartsOn)??((y=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:y.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,o=ct(e,n==null?void 0:n.in);if(!Fo(o))throw new RangeError("Invalid time value");let c=t.match(Fx).map(S=>{const k=S[0];if(k==="p"||k==="P"){const C=Vo[k];return C(S,r.formatLong)}return S}).join("").match(Nx).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const k=S[0];if(k==="'")return{isToken:!1,value:Vx(S)};if(mh[k])return{isToken:!0,value:S};if(k.match(Hx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:S}});r.localize.preprocessor&&(c=r.localize.preprocessor(o,c));const l={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return c.map(S=>{if(!S.isToken)return S.value;const k=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&xh(k)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&_h(k))&&$o(k,t,String(e));const C=mh[k[0]];return C(o,k,r.localize,l)}).join("")}function Vx(e){const t=e.match(Bx);return t?t[1].replace(zx,"'"):e}function wh(){return Object.assign({},Jn())}function $x(e,t){const n=ct(e,t==null?void 0:t.in).getDay();return n===0?7:n}function Wx(e,t){const n=Yx(t)?new t(0):Lt(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Yx(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const jx=10;class vh{constructor(){R(this,"subPriority",0)}validate(t,n){return!0}}class Ux extends vh{constructor(t,n,i,r,s){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class qx extends vh{constructor(n,i){super();R(this,"priority",jx);R(this,"subPriority",-1);this.context=n||(r=>Lt(i,r))}set(n,i){return i.timestampIsSet?n:Lt(n,Wx(n,this.context))}}class xt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new Ux(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class Xx extends xt{constructor(){super(...arguments);R(this,"priority",140);R(this,"incompatibleTokens",["R","u","t","T"])}parse(n,i,r){switch(i){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"})||r.era(n,{width:"narrow"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})||r.era(n,{width:"abbreviated"})||r.era(n,{width:"narrow"})}}set(n,i,r){return i.era=r,n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}}const Ht={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}/},Ue={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 Vt(e,t){return e&&{value:t(e.value),rest:e.rest}}function It(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function qe(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(r*ki+s*Dr+a*T_),rest:t.slice(n[0].length)}}function Sh(e){return It(Ht.anyDigitsSigned,e)}function Nt(e,t){switch(e){case 1:return It(Ht.singleDigit,t);case 2:return It(Ht.twoDigits,t);case 3:return It(Ht.threeDigits,t);case 4:return It(Ht.fourDigits,t);default:return It(new RegExp("^\\d{1,"+e+"}"),t)}}function qs(e,t){switch(e){case 1:return It(Ht.singleDigitSigned,t);case 2:return It(Ht.twoDigitsSigned,t);case 3:return It(Ht.threeDigitsSigned,t);case 4:return It(Ht.fourDigitsSigned,t);default:return It(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Wo(e){switch(e){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 kh(e,t){const n=t>0,i=n?t:1-t;let r;if(i<=50)r=e||100;else{const s=i+50,a=Math.trunc(s/100)*100,o=e>=s%100;r=e+a-(o?100:0)}return n?r:1-r}function Mh(e){return e%400===0||e%4===0&&e%100!==0}class Gx extends xt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,i,r){const s=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Vt(Nt(4,n),s);case"yo":return Vt(r.ordinalNumber(n,{unit:"year"}),s);default:return Vt(Nt(i.length,n),s)}}validate(n,i){return i.isTwoDigitYear||i.year>0}set(n,i,r){const s=n.getFullYear();if(r.isTwoDigitYear){const o=kh(r.year,s);return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}const a=!("era"in i)||i.era===1?r.year:1-r.year;return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}class Kx extends xt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,i,r){const s=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Vt(Nt(4,n),s);case"Yo":return Vt(r.ordinalNumber(n,{unit:"year"}),s);default:return Vt(Nt(i.length,n),s)}}validate(n,i){return i.isTwoDigitYear||i.year>0}set(n,i,r,s){const a=Ho(n,s);if(r.isTwoDigitYear){const c=kh(r.year,a);return n.setFullYear(c,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),je(n,s)}const o=!("era"in i)||i.era===1?r.year:1-r.year;return n.setFullYear(o,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),je(n,s)}}class Zx extends xt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,i){return qs(i==="R"?4:i.length,n)}set(n,i,r){const s=Lt(n,0);return s.setFullYear(r,0,4),s.setHours(0,0,0,0),Mi(s)}}class Qx extends xt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,i){return qs(i==="u"?4:i.length,n)}set(n,i,r){return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}}class Jx extends xt{constructor(){super(...arguments);R(this,"priority",120);R(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"Q":case"QQ":return Nt(i.length,n);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"})||r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})||r.quarter(n,{width:"abbreviated",context:"formatting"})||r.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=1&&i<=4}set(n,i,r){return n.setMonth((r-1)*3,1),n.setHours(0,0,0,0),n}}class tw extends xt{constructor(){super(...arguments);R(this,"priority",120);R(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"q":case"qq":return Nt(i.length,n);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"})||r.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})||r.quarter(n,{width:"abbreviated",context:"standalone"})||r.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=1&&i<=4}set(n,i,r){return n.setMonth((r-1)*3,1),n.setHours(0,0,0,0),n}}class ew extends xt{constructor(){super(...arguments);R(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);R(this,"priority",110)}parse(n,i,r){const s=a=>a-1;switch(i){case"M":return Vt(It(Ht.month,n),s);case"MM":return Vt(Nt(2,n),s);case"Mo":return Vt(r.ordinalNumber(n,{unit:"month"}),s);case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"})||r.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})||r.month(n,{width:"abbreviated",context:"formatting"})||r.month(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=11}set(n,i,r){return n.setMonth(r,1),n.setHours(0,0,0,0),n}}class nw extends xt{constructor(){super(...arguments);R(this,"priority",110);R(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,i,r){const s=a=>a-1;switch(i){case"L":return Vt(It(Ht.month,n),s);case"LL":return Vt(Nt(2,n),s);case"Lo":return Vt(r.ordinalNumber(n,{unit:"month"}),s);case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"})||r.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})||r.month(n,{width:"abbreviated",context:"standalone"})||r.month(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=0&&i<=11}set(n,i,r){return n.setMonth(r,1),n.setHours(0,0,0,0),n}}function iw(e,t,n){const i=ct(e,n==null?void 0:n.in),r=fh(i,n)-t;return i.setDate(i.getDate()-r*7),ct(i,n==null?void 0:n.in)}class rw extends xt{constructor(){super(...arguments);R(this,"priority",100);R(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,i,r){switch(i){case"w":return It(Ht.week,n);case"wo":return r.ordinalNumber(n,{unit:"week"});default:return Nt(i.length,n)}}validate(n,i){return i>=1&&i<=53}set(n,i,r,s){return je(iw(n,r,s),s)}}function sw(e,t,n){const i=ct(e,n==null?void 0:n.in),r=hh(i,n)-t;return i.setDate(i.getDate()-r*7),i}class aw extends xt{constructor(){super(...arguments);R(this,"priority",100);R(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,i,r){switch(i){case"I":return It(Ht.week,n);case"Io":return r.ordinalNumber(n,{unit:"week"});default:return Nt(i.length,n)}}validate(n,i){return i>=1&&i<=53}set(n,i,r){return Mi(sw(n,r))}}const ow=[31,28,31,30,31,30,31,31,30,31,30,31],lw=[31,29,31,30,31,30,31,31,30,31,30,31];class cw extends xt{constructor(){super(...arguments);R(this,"priority",90);R(this,"subPriority",1);R(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"d":return It(Ht.date,n);case"do":return r.ordinalNumber(n,{unit:"date"});default:return Nt(i.length,n)}}validate(n,i){const r=n.getFullYear(),s=Mh(r),a=n.getMonth();return s?i>=1&&i<=lw[a]:i>=1&&i<=ow[a]}set(n,i,r){return n.setDate(r),n.setHours(0,0,0,0),n}}class uw extends xt{constructor(){super(...arguments);R(this,"priority",90);R(this,"subpriority",1);R(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,i,r){switch(i){case"D":case"DD":return It(Ht.dayOfYear,n);case"Do":return r.ordinalNumber(n,{unit:"date"});default:return Nt(i.length,n)}}validate(n,i){const r=n.getFullYear();return Mh(r)?i>=1&&i<=366:i>=1&&i<=365}set(n,i,r){return n.setMonth(0,r),n.setHours(0,0,0,0),n}}function Yo(e,t,n){var h,f,m,g;const i=Jn(),r=(n==null?void 0:n.weekStartsOn)??((f=(h=n==null?void 0:n.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,s=ct(e,n==null?void 0:n.in),a=s.getDay(),c=(t%7+7)%7,l=7-r,u=t<0||t>6?t-(a+l)%7:(c+l)%7-(a+l)%7;return Ys(s,u,n)}class dw extends xt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})||r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=6}set(n,i,r,s){return n=Yo(n,r,s),n.setHours(0,0,0,0),n}}class hw extends xt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,i,r,s){const a=o=>{const c=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+c};switch(i){case"e":case"ee":return Vt(Nt(i.length,n),a);case"eo":return Vt(r.ordinalNumber(n,{unit:"day"}),a);case"eee":return r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"eeeee":return r.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(n,{width:"wide",context:"formatting"})||r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=6}set(n,i,r,s){return n=Yo(n,r,s),n.setHours(0,0,0,0),n}}class fw extends xt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,i,r,s){const a=o=>{const c=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+c};switch(i){case"c":case"cc":return Vt(Nt(i.length,n),a);case"co":return Vt(r.ordinalNumber(n,{unit:"day"}),a);case"ccc":return r.day(n,{width:"abbreviated",context:"standalone"})||r.day(n,{width:"short",context:"standalone"})||r.day(n,{width:"narrow",context:"standalone"});case"ccccc":return r.day(n,{width:"narrow",context:"standalone"});case"cccccc":return r.day(n,{width:"short",context:"standalone"})||r.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(n,{width:"wide",context:"standalone"})||r.day(n,{width:"abbreviated",context:"standalone"})||r.day(n,{width:"short",context:"standalone"})||r.day(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=0&&i<=6}set(n,i,r,s){return n=Yo(n,r,s),n.setHours(0,0,0,0),n}}function mw(e,t,n){const i=ct(e,n==null?void 0:n.in),r=$x(i,n),s=t-r;return Ys(i,s,n)}class gw extends xt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,i,r){const s=a=>a===0?7:a;switch(i){case"i":case"ii":return Nt(i.length,n);case"io":return r.ordinalNumber(n,{unit:"day"});case"iii":return Vt(r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"}),s);case"iiiii":return Vt(r.day(n,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Vt(r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"}),s);case"iiii":default:return Vt(r.day(n,{width:"wide",context:"formatting"})||r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"}),s)}}validate(n,i){return i>=1&&i<=7}set(n,i,r){return n=mw(n,r),n.setHours(0,0,0,0),n}}class pw extends xt{constructor(){super(...arguments);R(this,"priority",80);R(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,i,r){switch(i){case"a":case"aa":case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})||r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,r){return n.setHours(Wo(r),0,0,0),n}}class yw extends xt{constructor(){super(...arguments);R(this,"priority",80);R(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,i,r){switch(i){case"b":case"bb":case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})||r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,r){return n.setHours(Wo(r),0,0,0),n}}class bw extends xt{constructor(){super(...arguments);R(this,"priority",80);R(this,"incompatibleTokens",["a","b","t","T"])}parse(n,i,r){switch(i){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})||r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,r){return n.setHours(Wo(r),0,0,0),n}}class _w extends xt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,i,r){switch(i){case"h":return It(Ht.hour12h,n);case"ho":return r.ordinalNumber(n,{unit:"hour"});default:return Nt(i.length,n)}}validate(n,i){return i>=1&&i<=12}set(n,i,r){const s=n.getHours()>=12;return s&&r<12?n.setHours(r+12,0,0,0):!s&&r===12?n.setHours(0,0,0,0):n.setHours(r,0,0,0),n}}class xw extends xt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,i,r){switch(i){case"H":return It(Ht.hour23h,n);case"Ho":return r.ordinalNumber(n,{unit:"hour"});default:return Nt(i.length,n)}}validate(n,i){return i>=0&&i<=23}set(n,i,r){return n.setHours(r,0,0,0),n}}class ww extends xt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,i,r){switch(i){case"K":return It(Ht.hour11h,n);case"Ko":return r.ordinalNumber(n,{unit:"hour"});default:return Nt(i.length,n)}}validate(n,i){return i>=0&&i<=11}set(n,i,r){return n.getHours()>=12&&r<12?n.setHours(r+12,0,0,0):n.setHours(r,0,0,0),n}}class vw extends xt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,i,r){switch(i){case"k":return It(Ht.hour24h,n);case"ko":return r.ordinalNumber(n,{unit:"hour"});default:return Nt(i.length,n)}}validate(n,i){return i>=1&&i<=24}set(n,i,r){const s=r<=24?r%24:r;return n.setHours(s,0,0,0),n}}class Sw extends xt{constructor(){super(...arguments);R(this,"priority",60);R(this,"incompatibleTokens",["t","T"])}parse(n,i,r){switch(i){case"m":return It(Ht.minute,n);case"mo":return r.ordinalNumber(n,{unit:"minute"});default:return Nt(i.length,n)}}validate(n,i){return i>=0&&i<=59}set(n,i,r){return n.setMinutes(r,0,0),n}}class kw extends xt{constructor(){super(...arguments);R(this,"priority",50);R(this,"incompatibleTokens",["t","T"])}parse(n,i,r){switch(i){case"s":return It(Ht.second,n);case"so":return r.ordinalNumber(n,{unit:"second"});default:return Nt(i.length,n)}}validate(n,i){return i>=0&&i<=59}set(n,i,r){return n.setSeconds(r,0),n}}class Mw extends xt{constructor(){super(...arguments);R(this,"priority",30);R(this,"incompatibleTokens",["t","T"])}parse(n,i){const r=s=>Math.trunc(s*Math.pow(10,-i.length+3));return Vt(Nt(i.length,n),r)}set(n,i,r){return n.setMilliseconds(r),n}}class Tw extends xt{constructor(){super(...arguments);R(this,"priority",10);R(this,"incompatibleTokens",["t","T","x"])}parse(n,i){switch(i){case"X":return qe(Ue.basicOptionalMinutes,n);case"XX":return qe(Ue.basic,n);case"XXXX":return qe(Ue.basicOptionalSeconds,n);case"XXXXX":return qe(Ue.extendedOptionalSeconds,n);case"XXX":default:return qe(Ue.extended,n)}}set(n,i,r){return i.timestampIsSet?n:Lt(n,n.getTime()-js(n)-r)}}class Dw extends xt{constructor(){super(...arguments);R(this,"priority",10);R(this,"incompatibleTokens",["t","T","X"])}parse(n,i){switch(i){case"x":return qe(Ue.basicOptionalMinutes,n);case"xx":return qe(Ue.basic,n);case"xxxx":return qe(Ue.basicOptionalSeconds,n);case"xxxxx":return qe(Ue.extendedOptionalSeconds,n);case"xxx":default:return qe(Ue.extended,n)}}set(n,i,r){return i.timestampIsSet?n:Lt(n,n.getTime()-js(n)-r)}}class Cw extends xt{constructor(){super(...arguments);R(this,"priority",40);R(this,"incompatibleTokens","*")}parse(n){return Sh(n)}set(n,i,r){return[Lt(n,r*1e3),{timestampIsSet:!0}]}}class Ew extends xt{constructor(){super(...arguments);R(this,"priority",20);R(this,"incompatibleTokens","*")}parse(n){return Sh(n)}set(n,i,r){return[Lt(n,r),{timestampIsSet:!0}]}}const Ow={G:new Xx,y:new Gx,Y:new Kx,R:new Zx,u:new Qx,Q:new Jx,q:new tw,M:new ew,L:new nw,w:new rw,I:new aw,d:new cw,D:new uw,E:new dw,e:new hw,c:new fw,i:new gw,a:new pw,b:new yw,B:new bw,h:new _w,H:new xw,K:new ww,k:new vw,m:new Sw,s:new kw,S:new Mw,X:new Tw,x:new Dw,t:new Cw,T:new Ew},Pw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Aw=/^'([^]*?)'?$/,Iw=/''/g,Lw=/\S/,Nw=/[a-zA-Z]/;function Fw(e,t,n,i){var x,v,S,k,C,E,P,T;const r=()=>Lt((i==null?void 0:i.in)||n,NaN),s=wh(),a=(i==null?void 0:i.locale)??s.locale??dh,o=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??s.firstWeekContainsDate??((k=(S=s.locale)==null?void 0:S.options)==null?void 0:k.firstWeekContainsDate)??1,c=(i==null?void 0:i.weekStartsOn)??((E=(C=i==null?void 0:i.locale)==null?void 0:C.options)==null?void 0:E.weekStartsOn)??s.weekStartsOn??((T=(P=s.locale)==null?void 0:P.options)==null?void 0:T.weekStartsOn)??0;if(!t)return e?r():ct(n,i==null?void 0:i.in);const l={firstWeekContainsDate:o,weekStartsOn:c,locale:a},u=[new qx(i==null?void 0:i.in,n)],h=t.match(Rw).map(p=>{const _=p[0];if(_ in Vo){const M=Vo[_];return M(p,a.formatLong)}return p}).join("").match(Pw),f=[];for(let p of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&xh(p)&&$o(p,t,e),!(i!=null&&i.useAdditionalDayOfYearTokens)&&_h(p)&&$o(p,t,e);const _=p[0],M=Ow[_];if(M){const{incompatibleTokens:O}=M;if(Array.isArray(O)){const I=f.find(B=>O.includes(B.token)||B.token===_);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${p}\` at the same time`)}else if(M.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${p}\` and any other token at the same time`);f.push({token:_,fullToken:p});const A=M.run(e,p,a.match,l);if(!A)return r();u.push(A.setter),e=A.rest}else{if(_.match(Nw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(p==="''"?p="'":_==="'"&&(p=Bw(p)),e.indexOf(p)===0)e=e.slice(p.length);else return r()}}if(e.length>0&&Lw.test(e))return r();const m=u.map(p=>p.priority).sort((p,_)=>_-p).filter((p,_,M)=>M.indexOf(p)===_).map(p=>u.filter(_=>_.priority===p).sort((_,M)=>M.subPriority-_.subPriority)).map(p=>p[0]);let g=ct(n,i==null?void 0:i.in);if(isNaN(+g))return r();const y={};for(const p of m){if(!p.validate(g,l))return r();const _=p.set(g,y,l);Array.isArray(_)?(g=_[0],Object.assign(y,_[1])):g=_}return g}function Bw(e){return e.match(Aw)[1].replace(Iw,"'")}function zw(e,t){const n=ct(e,t==null?void 0:t.in);return n.setMinutes(0,0,0),n}function Hw(e,t){const n=ct(e,t==null?void 0:t.in);return n.setSeconds(0,0),n}function Vw(e,t){const n=ct(e,t==null?void 0:t.in);return n.setMilliseconds(0),n}function $w(e){const t=e/ki;return Math.trunc(t)}function Th(e,t){const n=()=>Lt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,r=Uw(e);let s;if(r.date){const l=qw(r.date,i);s=Xw(l.restDateString,l.year)}if(!s||isNaN(+s))return n();const a=+s;let o=0,c;if(r.time&&(o=Gw(r.time),isNaN(o)))return n();if(r.timezone){if(c=Kw(r.timezone),isNaN(c))return n()}else{const l=new Date(a+o),u=ct(0,t==null?void 0:t.in);return u.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),u.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),u}return ct(a+o+c,t==null?void 0:t.in)}const Xs={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ww=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Yw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,jw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Uw(e){const t={},n=e.split(Xs.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],Xs.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Xs.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const r=Xs.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function qw(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:e.slice((i[1]||i[2]).length)}}function Xw(e,t){if(t===null)return new Date(NaN);const n=e.match(Ww);if(!n)return new Date(NaN);const i=!!n[4],r=Rr(n[1]),s=Rr(n[2])-1,a=Rr(n[3]),o=Rr(n[4]),c=Rr(n[5])-1;if(i)return ev(t,o,c)?Zw(t,o,c):new Date(NaN);{const l=new Date(0);return!Jw(t,s,a)||!tv(t,r)?new Date(NaN):(l.setUTCFullYear(t,s,Math.max(r,a)),l)}}function Rr(e){return e?parseInt(e):1}function Gw(e){const t=e.match(Yw);if(!t)return NaN;const n=jo(t[1]),i=jo(t[2]),r=jo(t[3]);return nv(n,i,r)?n*ki+i*Dr+r*1e3:NaN}function jo(e){return e&&parseFloat(e.replace(",","."))||0}function Kw(e){if(e==="Z")return 0;const t=e.match(jw);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return iv(i,r)?n*(i*ki+r*Dr):NaN}function Zw(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Qw=[31,null,31,30,31,30,31,31,30,31,30,31];function Dh(e){return e%400===0||e%4===0&&e%100!==0}function Jw(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Qw[t]||(Dh(e)?29:28))}function tv(e,t){return t>=1&&t<=(Dh(e)?366:365)}function ev(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function nv(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function iv(e,t){return t>=0&&t<=59}var rv=Object.defineProperty,sv=(e,t,n)=>t in e?rv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Re=(e,t,n)=>sv(e,typeof t!="symbol"?t+"":t,n);const av=1e3;var nt=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(nt||{});const ov=["in","not_in","selector"],lv=["empty","not_empty"],cv=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],uv=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ar=e=>e.filter(t=>t!=="time"),Ch=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Eh=Ar(Ch),dv=[...Ch,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Oh=Ar(dv),hv=["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"],Ph=Ar(hv);Ar(["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"]),Ar(["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(Eh),new Set(Oh),new Set(Ph);const Rh=[{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"}];Rh.map(e=>e.code),(e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:ov},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:lv}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Oh,...Eh,...Ph])]);const fv={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"}},mv=(e,t,n)=>{let i;const r=fv[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Uo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const gv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},pv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},bv={date:Uo({formats:gv,defaultWidth:"full"}),time:Uo({formats:pv,defaultWidth:"full"}),dateTime:Uo({formats:yv,defaultWidth:"full"})},_v={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xv=(e,t,n,i)=>_v[e];function Ir(e){return(t,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;r=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const wv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},vv={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Sv={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"]},kv={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"]},Mv={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"}},Tv={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"}},Dv=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Cv={ordinalNumber:Dv,era:Ir({values:wv,defaultWidth:"wide"}),quarter:Ir({values:vv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ir({values:Sv,defaultWidth:"wide"}),day:Ir({values:kv,defaultWidth:"wide"}),dayPeriod:Ir({values:Mv,defaultWidth:"wide",formattingValues:Tv,defaultFormattingWidth:"wide"})};function Lr(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?Ov(o,h=>h.test(a)):Ev(o,h=>h.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(a.length);return{value:l,rest:u}}}function Ev(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ov(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Pv(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(r.length);return{value:a,rest:o}}}const Rv=/^(\d+)(th|st|nd|rd)?/i,Av=/\d+/i,Iv={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},Lv={any:[/^b/i,/^(a|c)/i]},Nv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Fv={any:[/1/i,/2/i,/3/i,/4/i]},Bv={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},zv={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]},Hv={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},Vv={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]},$v={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},Wv={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}},Yv={ordinalNumber:Pv({matchPattern:Rv,parsePattern:Av,valueCallback:e=>parseInt(e,10)}),era:Lr({matchPatterns:Iv,defaultMatchWidth:"wide",parsePatterns:Lv,defaultParseWidth:"any"}),quarter:Lr({matchPatterns:Nv,defaultMatchWidth:"wide",parsePatterns:Fv,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Lr({matchPatterns:Bv,defaultMatchWidth:"wide",parsePatterns:zv,defaultParseWidth:"any"}),day:Lr({matchPatterns:Hv,defaultMatchWidth:"wide",parsePatterns:Vv,defaultParseWidth:"any"}),dayPeriod:Lr({matchPatterns:$v,defaultMatchWidth:"any",parsePatterns:Wv,defaultParseWidth:"any"})},jv={code:"en-US",formatDistance:mv,formatLong:bv,formatRelative:xv,localize:Cv,match:Yv,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Uv={};function Nr(){return Uv}const Ah=6048e5,qv=864e5,Xv=60,Gv=3600,Ih=Symbol.for("constructDateFrom");function Ae(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ih in e?e[Ih](t):e instanceof Date?new e.constructor(t):new Date(t)}function de(e,t){return Ae(t||e,e)}function Lh(e){const t=de(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Kv(e,...t){const n=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Fr(e,t){const n=de(e,void 0);return n.setHours(0,0,0,0),n}function Zv(e,t,n){const[i,r]=Kv(void 0,e,t),s=Fr(i),a=Fr(r),o=+s-Lh(s),c=+a-Lh(a);return Math.round((o-c)/qv)}function Qv(e,t){const n=de(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Jv(e,t){const n=de(e,void 0);return Zv(n,Qv(n))+1}function ln(e,t){var n,i,r,s;const a=Nr(),o=(t==null?void 0:t.weekStartsOn)??((i=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((s=(r=a.locale)==null?void 0:r.options)==null?void 0:s.weekStartsOn)??0,c=de(e,t==null?void 0:t.in),l=c.getDay(),u=(l<o?7:0)+l-o;return c.setDate(c.getDate()-u),c.setHours(0,0,0,0),c}function Gs(e,t){return ln(e,{...t,weekStartsOn:1})}function Nh(e,t){const n=de(e,void 0),i=n.getFullYear(),r=Ae(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Gs(r),a=Ae(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Gs(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=o.getTime()?i:i-1}function t1(e,t){const n=Nh(e),i=Ae(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Gs(i)}function e1(e,t){const n=de(e,void 0),i=+Gs(n)-+t1(n);return Math.round(i/Ah)+1}function Fh(e,t){var n,i,r,s;const a=de(e,t==null?void 0:t.in),o=a.getFullYear(),c=Nr(),l=(t==null?void 0:t.firstWeekContainsDate)??((i=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:i.firstWeekContainsDate)??c.firstWeekContainsDate??((s=(r=c.locale)==null?void 0:r.options)==null?void 0:s.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,l),u.setHours(0,0,0,0);const h=ln(u,t),f=Ae((t==null?void 0:t.in)||e,0);f.setFullYear(o,0,l),f.setHours(0,0,0,0);const m=ln(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function n1(e,t){var n,i,r,s;const a=Nr(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(r=a.locale)==null?void 0:r.options)==null?void 0:s.firstWeekContainsDate)??1,c=Fh(e,t),l=Ae((t==null?void 0:t.in)||e,0);return l.setFullYear(c,0,o),l.setHours(0,0,0,0),ln(l,t)}function i1(e,t){const n=de(e,t==null?void 0:t.in),i=+ln(n,t)-+n1(n,t);return Math.round(i/Ah)+1}function Dt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const An={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Dt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Dt(n+1,2)},d(e,t){return Dt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Dt(e.getHours()%12||12,t.length)},H(e,t){return Dt(e.getHours(),t.length)},m(e,t){return Dt(e.getMinutes(),t.length)},s(e,t){return Dt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Dt(r,t.length)}},Di={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bh={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return An.y(e,t)},Y:function(e,t,n,i){const r=Fh(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Dt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Dt(s,t.length)},R:function(e,t){const n=Nh(e);return Dt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Dt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Dt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Dt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return An.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Dt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=i1(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Dt(r,t.length)},I:function(e,t,n){const i=e1(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Dt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):An.d(e,t)},D:function(e,t,n){const i=Jv(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Dt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Dt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Dt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Dt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Di.noon:i===0?r=Di.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Di.evening:i>=12?r=Di.afternoon:i>=4?r=Di.morning:r=Di.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return An.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):An.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):An.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):An.s(e,t)},S:function(e,t){return An.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Hh(i);case"XXXX":case"XX":return ni(i);case"XXXXX":case"XXX":default:return ni(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Hh(i);case"xxxx":case"xx":return ni(i);case"xxxxx":case"xxx":default:return ni(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zh(i,":");case"OOOO":default:return"GMT"+ni(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zh(i,":");case"zzzz":default:return"GMT"+ni(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Dt(i,t.length)},T:function(e,t,n){return Dt(+e,t.length)}};function zh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Dt(s,2)}function Hh(e,t){return e%60===0?(e>0?"-":"+")+Dt(Math.abs(e)/60,2):ni(e,t)}function ni(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Dt(Math.trunc(i/60),2),s=Dt(i%60,2);return n+r+t+s}const Vh=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},$h=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},r1=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Vh(e,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Vh(i,t)).replace("{{time}}",$h(r,t))},s1={p:$h,P:r1},a1=/^D+$/,o1=/^Y+$/,l1=["D","DD","YY","YYYY"];function c1(e){return a1.test(e)}function u1(e){return o1.test(e)}function d1(e,t,n){const i=h1(e,t,n);if(console.warn(i),l1.includes(e))throw new RangeError(i)}function h1(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function f1(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function m1(e){return!(!f1(e)&&typeof e!="number"||isNaN(+de(e)))}const g1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,p1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,y1=/^'([^]*?)'?$/,b1=/''/g,_1=/[a-zA-Z]/;function x1(e,t,n){var i,r,s,a,o,c,l,u;const h=Nr(),f=(n==null?void 0:n.locale)??h.locale??jv,m=(n==null?void 0:n.firstWeekContainsDate)??((r=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:r.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(s=h.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,g=(n==null?void 0:n.weekStartsOn)??((c=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??h.weekStartsOn??((u=(l=h.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,y=de(e,n==null?void 0:n.in);if(!m1(y))throw new RangeError("Invalid time value");let x=t.match(p1).map(S=>{const k=S[0];if(k==="p"||k==="P"){const C=s1[k];return C(S,f.formatLong)}return S}).join("").match(g1).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const k=S[0];if(k==="'")return{isToken:!1,value:w1(S)};if(Bh[k])return{isToken:!0,value:S};if(k.match(_1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:S}});f.localize.preprocessor&&(x=f.localize.preprocessor(y,x));const v={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(S=>{if(!S.isToken)return S.value;const k=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&u1(k)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&c1(k))&&d1(k,t,String(e));const C=Bh[k[0]];return C(y,k,f.localize,v)}).join("")}function w1(e){const t=e.match(y1);return t?t[1].replace(b1,"'"):e}function qo(e,t,n){const i=de(e,void 0);return isNaN(t)?Ae(e,NaN):(i.setDate(i.getDate()+t),i)}function v1(e,t,n){const i=de(e,void 0);if(isNaN(t))return Ae(e,NaN);const r=i.getDate(),s=Ae(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Ci(e,t){const n=de(e,void 0);return n.setDate(1),n.setHours(0,0,0,0),n}function S1(e,t){const n=de(e,void 0),i=n.getFullYear(),r=n.getMonth(),s=Ae(n,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function k1(){return Object.assign({},Nr())}function Wh(e){return Math.trunc(e*Gv)}function M1(e){const t=e/Xv;return Math.trunc(t)}function Yh(e,t,n){return v1(e,-1)}function jh(e,t,n){const i=k1(),r=C1(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?T1(r,t):D1(r,t)}function T1(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function D1(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function C1(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function E1(e,t){const n=I1(t);return"formatToParts"in n?P1(n,e):R1(n,e)}const O1={year:0,month:1,day:2,hour:3,minute:4,second:5};function P1(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=O1[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function R1(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 Xo={},Uh=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")),A1=Uh==="06/25/2014, 00:00:00"||Uh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function I1(e){return Xo[e]||(Xo[e]=A1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Xo[e]}function Go(e,t,n,i,r,s,a){const o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(i,r,s,a),o}const qh=36e5,L1=6e4,Ko={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Br(e,t,n){if(!e)return 0;let i=Ko.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Ko.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Xh(r)?-(r*qh):NaN;if(i=Ko.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Xh(r,a)?(s=Math.abs(r)*qh+a*L1,i[1]==="+"?-s:s):NaN}if(B1(e)){t=new Date(t||Date.now());const a=n?t:N1(t),o=Zo(a,e);return-(n?o:F1(t,o,e))}return NaN}function N1(e){return Go(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Zo(e,t){const n=E1(e,t),i=Go(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function F1(e,t,n){let i=e.getTime()-t;const r=Zo(new Date(i),n);if(t===r)return t;i-=r-t;const s=Zo(new Date(i),n);return r===s?r:Math.max(r,s)}function Xh(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Gh={};function B1(e){if(Gh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Gh[e]=!0,!0}catch{return!1}}const z1=60*1e3,H1={X:function(e,t,n){const i=Qo(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Kh(i);case"XXXX":case"XX":return Ei(i);case"XXXXX":case"XXX":default:return Ei(i,":")}},x:function(e,t,n){const i=Qo(n.timeZone,e);switch(t){case"x":return Kh(i);case"xxxx":case"xx":return Ei(i);case"xxxxx":case"xxx":default:return Ei(i,":")}},O:function(e,t,n){const i=Qo(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+V1(i,":");case"OOOO":default:return"GMT"+Ei(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return jh("short",e,n);case"zzzz":default:return jh("long",e,n)}}};function Qo(e,t){const n=e?Br(e,t,!0)/z1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Ks(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Ei(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Ks(Math.floor(i/60),2),s=Ks(Math.floor(i%60),2);return n+r+t+s}function Kh(e,t){return e%60===0?(e>0?"-":"+")+Ks(Math.abs(e)/60,2):Ei(e,t)}function V1(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Ks(s,2)}function Zh(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const Qh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Jo=36e5,Jh=6e4,$1=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:Qh};function Zs(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?$1:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=W1(e),{year:r,restDateString:s}=Y1(i.date,n),a=j1(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let c=0,l;if(i.time&&(c=U1(i.time),c===null||isNaN(c)))return new Date(NaN);if(i.timeZone||t.timeZone){if(l=Br(i.timeZone||t.timeZone,new Date(o+c)),isNaN(l))return new Date(NaN)}else l=Zh(new Date(o+c)),l=Zh(new Date(o+c+l));return new Date(o+c+l)}else return new Date(NaN)}function W1(e){const t={};let n=he.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=he.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=he.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Y1(e,t){if(e){const n=he.YYY[t],i=he.YYYYY[t];let r=he.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=he.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function j1(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=he.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,nf(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=he.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return G1(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=he.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return nf(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=he.Www.exec(e),s)return r=parseInt(s[1],10)-1,rf(r)?tf(t,r):new Date(NaN);if(s=he.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return rf(r,a)?tf(t,r,a):new Date(NaN)}return null}function U1(e){let t,n,i=he.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),tl(t)?t%24*Jo:NaN;if(i=he.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),tl(t,n)?t%24*Jo+n*Jh:NaN;if(i=he.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return tl(t,n,r)?t%24*Jo+n*Jh+r*1e3:NaN}return null}function tf(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const q1=[31,28,31,30,31,30,31,31,30,31,30,31],X1=[31,29,31,30,31,30,31,31,30,31,30,31];function ef(e){return e%400===0||e%4===0&&e%100!==0}function nf(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=ef(e);if(i&&n>X1[t]||!i&&n>q1[t])return!1}return!0}function G1(e,t){if(t<1)return!1;const n=ef(e);return!(n&&t>366||!n&&t>365)}function rf(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function tl(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const K1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Z1(e,t,n={}){t=String(t);const i=t.match(K1);if(i){const r=Zs(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const o=s.indexOf(a),c=s[o-1]==="'",l=s.replace(a,"'"+H1[a[0]](r,a,n)+"'");return c?l.substring(0,o-1)+l.substring(o+1):l},t)}return x1(e,t,n)}function sf(e,t,n){e=Zs(e,n);const i=Br(t,e,!0),r=new Date(e.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function Q1(e,t,n,i){return i={...i,timeZone:t,originalDate:e},Z1(sf(e,t,{timeZone:i.timeZone}),n,i)}function J1(e,t,n){if(typeof e=="string"&&!e.match(Qh))return Zs(e,{...n,timeZone:t});e=Zs(e,n);const i=Go(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),r=Br(t,new Date(i));return new Date(i+r)}function tS(e,t){return-Br(e,t)}function el(e,t={}){if(!e)return e;const n=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 r=new Date(e);return Q1(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const eS={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 nl(e){return e&&uv.find(t=>e<=eS[t])||null}var Qs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Js={exports:{}};Js.exports,function(e,t){var n=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",o="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",g="[object Object]",y="[object Promise]",x="[object RegExp]",v="[object Set]",S="[object String]",k="[object Symbol]",C="[object WeakMap]",E="[object ArrayBuffer]",P="[object DataView]",T="[object Float32Array]",p="[object Float64Array]",_="[object Int8Array]",M="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",I="[object Uint8ClampedArray]",B="[object Uint16Array]",j="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,$=/\w*$/,lt=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,Z={};Z[s]=Z[a]=Z[E]=Z[P]=Z[o]=Z[c]=Z[T]=Z[p]=Z[_]=Z[M]=Z[O]=Z[f]=Z[m]=Z[g]=Z[x]=Z[v]=Z[S]=Z[k]=Z[A]=Z[I]=Z[B]=Z[j]=!0,Z[l]=Z[u]=Z[C]=!1;var z=typeof Qs=="object"&&Qs&&Qs.Object===Object&&Qs,U=typeof self=="object"&&self&&self.Object===Object&&self,W=z||U||Function("return this")(),yt=t&&!t.nodeType&&t,_t=yt&&!0&&e&&!e.nodeType&&e,Y=_t&&_t.exports===yt;function H(w,L){return w.set(L[0],L[1]),w}function X(w,L){return w.add(L),w}function Q(w,L){for(var F=-1,tt=w?w.length:0;++F<tt&&L(w[F],F,w)!==!1;);return w}function J(w,L){for(var F=-1,tt=L.length,$t=w.length;++F<tt;)w[$t+F]=L[F];return w}function K(w,L,F,tt){for(var $t=-1,Xt=w?w.length:0;++$t<Xt;)F=L(F,w[$t],$t,w);return F}function gt(w,L){for(var F=-1,tt=Array(w);++F<w;)tt[F]=L(F);return tt}function vt(w,L){return w==null?void 0:w[L]}function st(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function bt(w){var L=-1,F=Array(w.size);return w.forEach(function(tt,$t){F[++L]=[$t,tt]}),F}function dt(w,L){return function(F){return w(L(F))}}function jt(w){var L=-1,F=Array(w.size);return w.forEach(function(tt){F[++L]=tt}),F}var ot=Array.prototype,St=Function.prototype,ee=Object.prototype,le=W["__core-js_shared__"],Ut=function(){var w=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Ge=St.toString,Et=ee.hasOwnProperty,ne=ee.toString,Ft=RegExp("^"+Ge.call(Et).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=Y?W.Buffer:void 0,ie=W.Symbol,Ke=W.Uint8Array,ci=dt(Object.getPrototypeOf,Object),Be=Object.create,Bt=ee.propertyIsEnumerable,Se=ot.splice,ui=Object.getOwnPropertySymbols,Sa=qt?qt.isBuffer:void 0,ka=dt(Object.keys,Object),Zr=$n(W,"DataView"),di=$n(W,"Map"),Qr=$n(W,"Promise"),hi=$n(W,"Set"),mn=$n(W,"WeakMap"),gn=$n(Object,"create"),Jr=ce(Zr),ts=ce(di),fi=ce(Qr),ec=ce(hi),nc=ce(mn),Ma=ie?ie.prototype:void 0,Ta=Ma?Ma.valueOf:void 0;function pn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function Wi(){this.__data__=gn?gn(null):{}}function es(w){return this.has(w)&&delete this.__data__[w]}function Da(w){var L=this.__data__;if(gn){var F=L[w];return F===i?void 0:F}return Et.call(L,w)?L[w]:void 0}function yn(w){var L=this.__data__;return gn?L[w]!==void 0:Et.call(L,w)}function ic(w,L){var F=this.__data__;return F[w]=gn&&L===void 0?i:L,this}pn.prototype.clear=Wi,pn.prototype.delete=es,pn.prototype.get=Da,pn.prototype.has=yn,pn.prototype.set=ic;function ze(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function rc(){this.__data__=[]}function sc(w){var L=this.__data__,F=ji(L,w);if(F<0)return!1;var tt=L.length-1;return F==tt?L.pop():Se.call(L,F,1),!0}function ac(w){var L=this.__data__,F=ji(L,w);return F<0?void 0:L[F][1]}function He(w){return ji(this.__data__,w)>-1}function oc(w,L){var F=this.__data__,tt=ji(F,w);return tt<0?F.push([w,L]):F[tt][1]=L,this}ze.prototype.clear=rc,ze.prototype.delete=sc,ze.prototype.get=ac,ze.prototype.has=He,ze.prototype.set=oc;function Hn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function lc(){this.__data__={hash:new pn,map:new(di||ze),string:new pn}}function cc(w){return Xi(this,w).delete(w)}function uc(w){return Xi(this,w).get(w)}function Ve(w){return Xi(this,w).has(w)}function dc(w,L){return Xi(this,w).set(w,L),this}Hn.prototype.clear=lc,Hn.prototype.delete=cc,Hn.prototype.get=uc,Hn.prototype.has=Ve,Hn.prototype.set=dc;function Vn(w){this.__data__=new ze(w)}function hc(){this.__data__=new ze}function fc(w){return this.__data__.delete(w)}function mc(w){return this.__data__.get(w)}function Yi(w){return this.__data__.has(w)}function gc(w,L){var F=this.__data__;if(F instanceof ze){var tt=F.__data__;if(!di||tt.length<n-1)return tt.push([w,L]),this;F=this.__data__=new Hn(tt)}return F.set(w,L),this}Vn.prototype.clear=hc,Vn.prototype.delete=fc,Vn.prototype.get=mc,Vn.prototype.has=Yi,Vn.prototype.set=gc;function pc(w,L){var F=ss(w)||Ki(w)?gt(w.length,String):[],tt=F.length,$t=!!tt;for(var Xt in w)Et.call(w,Xt)&&!($t&&(Xt=="length"||Ac(Xt,tt)))&&F.push(Xt);return F}function Ie(w,L,F){var tt=w[L];(!(Et.call(w,L)&&rs(tt,F))||F===void 0&&!(L in w))&&(w[L]=F)}function ji(w,L){for(var F=w.length;F--;)if(rs(w[F][0],L))return F;return-1}function yc(w,L){return w&&Ca(L,mi(L),w)}function ns(w,L,F,tt,$t,Xt,ke){var Qt;if(tt&&(Qt=Xt?tt(w,$t,Xt,ke):tt(w)),Qt!==void 0)return Qt;if(!_n(w))return w;var La=ss(w);if(La){if(Qt=Pc(w),!L)return Cc(w,Qt)}else{var Wn=Ze(w),Na=Wn==u||Wn==h;if(Ra(w))return vc(w,L);if(Wn==g||Wn==s||Na&&!Xt){if(st(w))return Xt?w:{};if(Qt=Oa(Na?{}:w),!L)return Ec(w,yc(Qt,w))}else{if(!Z[Wn])return Xt?w:{};Qt=Rc(w,Wn,ns,L)}}ke||(ke=new Vn);var Fa=ke.get(w);if(Fa)return Fa;if(ke.set(w,Qt),!La)var gi=F?Oc(w):mi(w);return Q(gi||w,function(os,Zi){gi&&(Zi=os,os=w[Zi]),Ie(Qt,Zi,ns(os,L,F,tt,Zi,w,ke))}),Qt}function bc(w){return _n(w)?Be(w):{}}function _c(w,L,F){var tt=L(w);return ss(w)?tt:J(tt,F(w))}function xc(w){return ne.call(w)}function Ui(w){if(!_n(w)||Ic(w))return!1;var L=as(w)||st(w)?Ft:lt;return L.test(ce(w))}function wc(w){if(!bn(w))return ka(w);var L=[];for(var F in Object(w))Et.call(w,F)&&F!="constructor"&&L.push(F);return L}function vc(w,L){if(L)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function qi(w){var L=new w.constructor(w.byteLength);return new Ke(L).set(new Ke(w)),L}function Sc(w,L){var F=L?qi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function kc(w,L,F){var tt=L?F(bt(w),!0):bt(w);return K(tt,H,new w.constructor)}function is(w){var L=new w.constructor(w.source,$.exec(w));return L.lastIndex=w.lastIndex,L}function Mc(w,L,F){var tt=L?F(jt(w),!0):jt(w);return K(tt,X,new w.constructor)}function Tc(w){return Ta?Object(Ta.call(w)):{}}function Dc(w,L){var F=L?qi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function Cc(w,L){var F=-1,tt=w.length;for(L||(L=Array(tt));++F<tt;)L[F]=w[F];return L}function Ca(w,L,F,tt){F||(F={});for(var $t=-1,Xt=L.length;++$t<Xt;){var ke=L[$t],Qt=void 0;Ie(F,ke,Qt===void 0?w[ke]:Qt)}return F}function Ec(w,L){return Ca(w,Ea(w),L)}function Oc(w){return _c(w,mi,Ea)}function Xi(w,L){var F=w.__data__;return Gi(L)?F[typeof L=="string"?"string":"hash"]:F.map}function $n(w,L){var F=vt(w,L);return Ui(F)?F:void 0}var Ea=ui?dt(ui,Object):Aa,Ze=xc;(Zr&&Ze(new Zr(new ArrayBuffer(1)))!=P||di&&Ze(new di)!=f||Qr&&Ze(Qr.resolve())!=y||hi&&Ze(new hi)!=v||mn&&Ze(new mn)!=C)&&(Ze=function(w){var L=ne.call(w),F=L==g?w.constructor:void 0,tt=F?ce(F):void 0;if(tt)switch(tt){case Jr:return P;case ts:return f;case fi:return y;case ec:return v;case nc:return C}return L});function Pc(w){var L=w.length,F=w.constructor(L);return L&&typeof w[0]=="string"&&Et.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function Oa(w){return typeof w.constructor=="function"&&!bn(w)?bc(ci(w)):{}}function Rc(w,L,F,tt){var $t=w.constructor;switch(L){case E:return qi(w);case o:case c:return new $t(+w);case P:return Sc(w,tt);case T:case p:case _:case M:case O:case A:case I:case B:case j:return Dc(w,tt);case f:return kc(w,tt,F);case m:case S:return new $t(w);case x:return is(w);case v:return Mc(w,tt,F);case k:return Tc(w)}}function Ac(w,L){return L=L??r,!!L&&(typeof w=="number"||q.test(w))&&w>-1&&w%1==0&&w<L}function Gi(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function Ic(w){return!!Ut&&Ut in w}function bn(w){var L=w&&w.constructor,F=typeof L=="function"&&L.prototype||ee;return w===F}function ce(w){if(w!=null){try{return Ge.call(w)}catch{}try{return w+""}catch{}}return""}function Lc(w){return ns(w,!0,!0)}function rs(w,L){return w===L||w!==w&&L!==L}function Ki(w){return Nc(w)&&Et.call(w,"callee")&&(!Bt.call(w,"callee")||ne.call(w)==s)}var ss=Array.isArray;function Pa(w){return w!=null&&Fc(w.length)&&!as(w)}function Nc(w){return xn(w)&&Pa(w)}var Ra=Sa||Ia;function as(w){var L=_n(w)?ne.call(w):"";return L==u||L==h}function Fc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=r}function _n(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function xn(w){return!!w&&typeof w=="object"}function mi(w){return Pa(w)?pc(w):wc(w)}function Aa(){return[]}function Ia(){return!1}e.exports=Lc}(Js,Js.exports),Js.exports;const cn=(e,t)=>new Date(e.getTime()-tS(t,e));class oe{constructor(t){Re(this,"timeframeText"),Re(this,"key"),Re(this,"display"),Re(this,"timeframeLength"),Re(this,"allowedTiers"),Re(this,"defaultResponseGranularity"),Re(this,"dataGranularity"),Re(this,"isRelative"),Re(this,"fineGrainedDefaultGranularity"),Re(this,"_startCustom"),Re(this,"_endCustom"),Re(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 n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=7*24&&n.add("hourly"),i>=2*24&&n.add("daily"),i>=2*24*14&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){if(this.key==="custom")return{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t};if(cv.includes(this.key))return{type:"relative",time_range:this.key,tz:t};throw new Error("Unsupported relative time value for Explore")}tzAdjustedDate(t){if(!t)return new Date;const n=J1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return sf(n,t)}}class iS extends oe{rawStart(t){let n=ln(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=cn(n,t)),n}maximumTimeframeLength(){return 60*60*24*7}}class rS extends oe{rawStart(t){let n=Ci(this.tzAdjustedDate(t));return t&&(n=cn(n,t)),n}maximumTimeframeLength(){return 60*60*24*31}}class sS extends oe{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=cn(n,t)),n}maximumTimeframeLength(){return 60*60*24*366}}class aS extends oe{rawEnd(t){let n=ln(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=cn(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=ln(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=cn(i,t)),i}}class oS extends oe{rawEnd(t){let n=Ci(this.tzAdjustedDate(t));return t&&(n=cn(n,t)),n}rawStart(t){let n=Ci(Yh(this.tzAdjustedDate(t)));return t&&(n=cn(n,t)),n}}class lS extends oe{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=cn(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=cn(n,t)),n}}nt.FIFTEEN_MIN,new oe({key:nt.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"]}),nt.ONE_HOUR,new oe({key:nt.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"]}),nt.SIX_HOUR,new oe({key:nt.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"]}),nt.TWELVE_HOUR,new oe({key:nt.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"]}),nt.ONE_DAY,new oe({key:nt.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"]}),nt.SEVEN_DAY,new oe({key:nt.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"]}),nt.THIRTY_DAY,new oe({key:nt.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"]}),nt.NINETY_DAY,new oe({key:nt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>60*60*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.ONE_HUNDRED_EIGHTY_DAY,new oe({key:nt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>60*60*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.ONE_YEAR,new oe({key:nt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>60*60*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.CURRENT_WEEK,new iS({key:nt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=ln(new Date,{weekStartsOn:1});return(Fr(qo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),nt.CURRENT_MONTH,new rS({key:nt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=Ci(new Date);return(Fr(qo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.CURRENT_YEAR,new sS({key:nt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(Fr(qo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.PREVIOUS_WEEK,new aS({key:nt.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"]}),nt.PREVIOUS_MONTH,new oS({key:nt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=Ci(new Date),n=Ci(Yh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=af(t,n)),60*60*24*S1(new Date().setMonth(new Date().getMonth()-1))+Wh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.PREVIOUS_YEAR,new lS({key:nt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=af(e,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+Wh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function af(e,t){return M1(e.getTimezoneOffset()-t.getTimezoneOffset())}nt.FIFTEEN_MIN,nt.ONE_HOUR,nt.SIX_HOUR,nt.TWELVE_HOUR,nt.ONE_DAY,nt.SEVEN_DAY,nt.FIFTEEN_MIN,nt.ONE_HOUR,nt.SIX_HOUR,nt.TWELVE_HOUR,nt.ONE_DAY,nt.SEVEN_DAY,nt.THIRTY_DAY,nt.NINETY_DAY,nt.ONE_HUNDRED_EIGHTY_DAY,nt.ONE_YEAR,nt.CURRENT_WEEK,nt.CURRENT_MONTH,nt.CURRENT_YEAR,nt.PREVIOUS_WEEK,nt.PREVIOUS_MONTH,nt.PREVIOUS_YEAR;const cS=new Map(Rh.map(e=>[e.code,{code:e.code,name:e.name}])),il=e=>{var t;return((t=cS.get(e))==null?void 0:t.name)||e};var of={exports:{}};(function(e){(function(){function t(l,u){if(u.separator===!1||l<1e3)return l.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(l).toString().split("");return m.reverse().forEach(function(g,y){y&&y%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function n(l,u,h){var f=l/u,m=h.round?"round":"floor";return h.decimal===!1?(l=Math[m](f),l.toString()):(h.precision?l=f:l=f<10?Math[m](f*10)/10:Math[m](f),l=l.toString(),typeof h.decimal=="string"&&(l=l.replace(".",h.decimal)),l)}var i=1e3,r=1e4,s=1e6,a=1e9,o=1e12;function c(l,u){var h;u=u||{};var f=l<0;f&&(l=Math.abs(l)),u.precision&&(l=parseFloat(l.toPrecision(u.precision)));var m=u.min10k?r:i;return l<m||u.precision&&u.precision>Math.log10(l)?h=t(n(l,1,u),u):l<s?h=n(l,i,u)+"k":l<a?h=n(l,s,u)+"m":l<o?h=t(n(l,a,u),u)+"b":h=t(n(l,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}c.addCommas=t,e.exports=c})()})(of);var uS=of.exports;const rl=nS(uS);var lf;const ta=new Intl.NumberFormat(((lf=document==null?void 0:document.documentElement)==null?void 0:lf.lang)||"en-US");function Oi({i18n:e}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,o=r?Math.pow(2,30):1e9,c=r?Math.pow(2,20):1e6,l=r?Math.pow(2,10):1e3;let u;return i>=s?u=e.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=e.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=c?u=e.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=l?u=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=e.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},n=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?e.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:o=!1,translateUnit:c=l=>l}={})=>{const l=c(r,i);switch(r){case"bytes":return t(i,s);case"usd":return n(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${rl(i,{capital:!0})} ${l}`:i>=.01?`${ta.format(Number.parseFloat(i.toFixed(2)))} ${l}`:`${Number.parseFloat(i.toPrecision(4))} ${l}`}},formatBytes:t,formatCost:n,formatRange:(i,r,s,{isBytes1024:a=!1,currency:o="USD",approximate:c=!1,translateUnit:l=u=>u}={})=>{const u=l(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${n(i,o)} - ${n(r,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(c)return`${rl(i,{capital:!0})} - ${rl(r,{capital:!0})} ${u}`}const h=i>=.01?`${ta.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=r>=.01?`${ta.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const ea=e=>["interactive","zoom-interactive"].includes(e),cf=(e,t,n,i)=>{var c,l;const{tooltip:r}=t;if(r.opacity===0&&!ea(e.interactionMode)){e.showTooltip=!1;return}const{i18n:s}=mt.useI18n(),{formatUnit:a}=Oi({i18n:s}),o=e.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(r.body&&!ea(e.interactionMode)){const u=r.labelColors,h=((l=(c=t.chart.config)==null?void 0:c.options)==null?void 0:l.indexAxis)==="y"?"x":"y";e.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(r.dataPoints[0].parsed.x,n):$r({tickValue:new Date(r.dataPoints[0].parsed.x),granularity:n}),e.tooltipSeries=r.dataPoints.map((f,m)=>{const g=f.parsed[h],y=a(g,e.units,{translateUnit:e.translateUnit}),x=f.dataset.label;return{backgroundColor:u[m].backgroundColor,borderColor:u[m].borderColor,label:x,value:y,rawValue:g,isSegmentEmpty:f.dataset.isSegmentEmpty}}).sort(o),e.left=`${r.x}px`,e.top=`${r.y}px`,e.showTooltip=!0}},uf=(e,t)=>{var a,o;const{tooltip:n}=t,{i18n:i}=mt.useI18n(),{formatUnit:r}=Oi({i18n:i});if(n.opacity===0&&!ea(e.interactionMode)){e.showTooltip=!1;return}const s=e.chartTooltipSortFn||((c,l)=>l.rawValue-c.rawValue);if(n.body&&!ea(e.interactionMode)){const c=n.labelColors,l=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(e.chartType);u?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((h,f)=>{const m=u?h.parsed:h.parsed[l],g=r(m,e.units,{translateUnit:e.translateUnit});let y;return u?y=h.dataset.labels[h.dataIndex]:y=h.dataset.label,{backgroundColor:c[f].backgroundColor,borderColor:c[f].borderColor,label:y,value:g,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(s),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},dS=e=>e&&e.datasets&&e.datasets.length,hS=e=>dS(e)&&e.datasets.some(t=>t.data.length),fS=e=>e.datasets.some(t=>t.data[0]&&Fo(t.data[0].x)),mS=e=>!!hS(e)&&e.datasets.some(t=>t.data.length==1),gS=e=>fS(e)&&e.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),sl=(e,t,n)=>{const r=Math.min(t/1150,1);return e.x<n?e.x+t*.15*(1-r):e.x-t*1.15*(1-r)},pS=(e,t,n)=>e.y<n?e.y+t*.15:e.y-t*.5;function df(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const hf=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(r=>{var s;return!((s=t==null?void 0:t[r.text])!=null&&s.isThreshold)}).map((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty})).sort(n)},yS=2,ff=10,mf=12,na=10,gf="#6c7489",bS="#d60027",_S="#ad000e",al="#6c7489",pf="#52596e",xS="#007d60",wS="#995c00",vS="#ffc400",zr="16px",SS="20px",kS="'Inter', Roboto, Helvetica, sans-serif",yf={"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"}},un=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ia=(e,t)=>(t||un)[e%un.length],bf=(e,t)=>{e[0]==="#"&&(e=e.slice(1));let n=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16);n=n-t,i=i-t,r=r-t,n>255?n=255:n<0&&(n=0),i>255?i=255:i<0&&(i=0),r>255?r=255:r<0&&(r=0);const s=n.toString(16).length===1?"0"+n.toString(16):n.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length===1?"0"+r.toString(16):r.toString(16);return`#${s}${a}${o}`},_f="#6f7787",xf={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"}},MS=e=>{var n;const t=Math.floor(parseInt(e,10)/100)*100;return((n=xf[t])==null?void 0:n.background)||"#fafafa"},TS={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},DS={"4XX":"#FFBA81","5XX":"#FF8484"},CS={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},ES="#dad4c7",wf="#afb7c5",OS=e=>{const t=Object.entries(yf).find(([n])=>new RegExp(n).test(e));return t&&t[1]||yf.standard},ol=(e,t,n,i)=>{let r;return n?r=wf:Array.isArray(i)?r=ia(e,i):r=i[t],r||ia(e)},ra=e=>{switch(e){case"error":return bS;case"warning":return vS;case"neutral":return gf;default:return gf}},PS={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},RS=2,AS=0,ll=new Map,vf=(e,t)=>{const{i18n:n}=mt.useI18n(),{formatBytes:i}=Oi({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):ta.format(e)},IS=e=>{const n=document.createElement("canvas").getContext("2d"),i=At({});return n.font=i.string,n.measureText(e).width},LS=()=>{const e="label_height";if(!ll.has(e)){const t=At({});ll.set(e,t.lineHeight)}return ll.get(e)},NS=(e,t)=>t.datasets.reduce((n,i,r)=>e.isDatasetVisible(r)?n+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):n,0),FS=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,cl="#e0e4ea",BS={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"]},Hr=(e,t)=>{let n=1;const i=BS[e],r=new Map;for(const s of t)r.set(s,i[n]),n=n%(i.length-1)+1;return r.set(-1,i[0]),r},Sf=new Map([[100,Hr("100",[100,101,102,103])],[200,Hr("200",[200,201,202,203,204,205,206,207,208,226])],[300,Hr("300",[300,301,302,303,304,305,307,308])],[400,Hr("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,Hr("500",[500,501,502,503,504,505,506,507,508,510,511])]]),ul=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100,i=Sf.get(n);return i===void 0?cl:i.get(t)??i.get(-1)??cl},zS=e=>{const t=ul(e);return{solid:t,light:t}},sa={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=ul(`${t}`),e),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function kf(e,t,n){const i=wh(),r=$S(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?HS(r,t):VS(r,t)}function HS(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function VS(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function $S(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function WS(e,t){const n=XS(t);return"formatToParts"in n?jS(n,e):US(n,e)}const YS={year:0,month:1,day:2,hour:3,minute:4,second:5};function jS(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=YS[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function US(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 dl={},Mf=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")),qS=Mf==="06/25/2014, 00:00:00"||Mf==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function XS(e){return dl[e]||(dl[e]=qS?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),dl[e]}function Tf(e,t,n,i,r,s,a){const o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(i,r,s,a),o}const Df=36e5,GS=6e4,hl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function fl(e,t,n){if(!e)return 0;let i=hl.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=hl.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Cf(r)?-(r*Df):NaN;if(i=hl.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Cf(r,a)?(s=Math.abs(r)*Df+a*GS,i[1]==="+"?-s:s):NaN}if(QS(e)){t=new Date(t||Date.now());const a=n?t:KS(t),o=ml(a,e);return-(n?o:ZS(t,o,e))}return NaN}function KS(e){return Tf(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ml(e,t){const n=WS(e,t),i=Tf(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function ZS(e,t,n){let r=e.getTime()-t;const s=ml(new Date(r),n);if(t===s)return t;r-=s-t;const a=ml(new Date(r),n);return s===a?s:Math.max(s,a)}function Cf(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Ef={};function QS(e){if(Ef[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Ef[e]=!0,!0}catch{return!1}}const JS=60*1e3,tk={X:function(e,t,n){const i=gl(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Of(i);case"XXXX":case"XX":return Pi(i);case"XXXXX":case"XXX":default:return Pi(i,":")}},x:function(e,t,n){const i=gl(n.timeZone,e);switch(t){case"x":return Of(i);case"xxxx":case"xx":return Pi(i);case"xxxxx":case"xxx":default:return Pi(i,":")}},O:function(e,t,n){const i=gl(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ek(i,":");case"OOOO":default:return"GMT"+Pi(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return kf("short",e,n);case"zzzz":default:return kf("long",e,n)}}};function gl(e,t){const n=e?fl(e,t,!0)/JS:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function aa(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Pi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=aa(Math.floor(i/60),2),s=aa(Math.floor(i%60),2);return n+r+t+s}function Of(e,t){return e%60===0?(e>0?"-":"+")+aa(Math.abs(e)/60,2):Pi(e,t)}function ek(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+aa(s,2)}function Pf(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const nk=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,pl=36e5,Rf=6e4,ik=2,fe={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:nk};function Af(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?ik:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=rk(e),{year:r,restDateString:s}=sk(i.date,n),a=ak(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let c=0,l;if(i.time&&(c=ok(i.time),c===null||isNaN(c)))return new Date(NaN);if(i.timeZone||t.timeZone){if(l=fl(i.timeZone||t.timeZone,new Date(o+c)),isNaN(l))return new Date(NaN)}else l=Pf(new Date(o+c)),l=Pf(new Date(o+c+l));return new Date(o+c+l)}else return new Date(NaN)}function rk(e){const t={};let n=fe.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=fe.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=fe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function sk(e,t){if(e){const n=fe.YYY[t],i=fe.YYYYY[t];let r=fe.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=fe.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function ak(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=fe.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,Nf(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=fe.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return uk(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=fe.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Nf(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=fe.Www.exec(e),s)return r=parseInt(s[1],10)-1,Ff(r)?If(t,r):new Date(NaN);if(s=fe.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Ff(r,a)?If(t,r,a):new Date(NaN)}return null}function ok(e){let t,n,i=fe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),yl(t)?t%24*pl:NaN;if(i=fe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),yl(t,n)?t%24*pl+n*Rf:NaN;if(i=fe.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return yl(t,n,r)?t%24*pl+n*Rf+r*1e3:NaN}return null}function If(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const lk=[31,28,31,30,31,30,31,31,30,31,30,31],ck=[31,29,31,30,31,30,31,31,30,31,30,31];function Lf(e){return e%400===0||e%4===0&&e%100!==0}function Nf(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Lf(e);if(i&&n>ck[t]||!i&&n>lk[t])return!1}return!0}function uk(e,t){if(t<1)return!1;const n=Lf(e);return!(n&&t>366||!n&&t>365)}function Ff(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function yl(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const dk=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function bl(e,t,n={}){t=String(t);const i=t.match(dk);if(i){const r=Af(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const o=s.indexOf(a),c=s[o-1]==="'",l=s.replace(a,"'"+tk[a[0]](r,a,n)+"'");return c?l.substring(0,o-1)+l.substring(o+1):l},t)}return Us(e,t,n)}function hk(e,t,n){e=Af(e,n);const i=fl(t,e,!0),r=new Date(e.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function Vr(e,t,n,i){return i={...i,timeZone:t,originalDate:e},bl(hk(e,t,{timeZone:i.timeZone}),n,i)}const fk=(e,t)=>`${Vr(e,t,"yyyy")} W${Vr(e,t,"II")}`,_l="yyyy-MM-dd h:mm:ss a",xl="h:mm:ss a",ii="yyyy-MM-dd h:mm a",Ri="h:mm a",mk="yyyy-MM-dd",wl="MMM dd, yyyy h:mm:ss a",In="MMM dd, yyyy h:mm a",gk={secondly:e=>e?_l:xl,tenSecondly:e=>e?_l:xl,thirtySecondly:e=>e?_l:xl,minutely:e=>e?ii:Ri,fiveMinutely:e=>e?ii:Ri,tenMinutely:e=>e?ii:Ri,thirtyMinutely:e=>e?ii:Ri,hourly:e=>e?ii:Ri,twoHourly:e=>e?ii:Ri,twelveHourly:()=>ii,daily:()=>mk},pk={secondly:()=>wl,tenSecondly:()=>wl,thirtySecondly:()=>wl,minutely:()=>In,fiveMinutely:()=>In,tenMinutely:()=>In,thirtyMinutely:()=>In,hourly:()=>In,twoHourly:()=>In,twelveHourly:()=>In,daily:()=>In};function Bf({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const o=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return fk(e,o);if(r&&r[t]){const c=r[t](i);return Vr(e,o,c)}if(s&&s[t]){const c=s[t]();return Vr(e,o,c)}return Vr(e,o,a)}const yk=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>Bf({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:gk,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),$r=({tickValue:e,granularity:t,timezone:n})=>Bf({tickValue:e,granularity:t,timezone:n,tooltipMap:pk,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),bk=e=>{var n,i,r,s,a;const{i18n:t}=mt.useI18n();return(e==null?void 0:e.status)===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(e==null?void 0:e.status)===408?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(n=e==null?void 0:e.response)==null?void 0:n.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:((a=(s=(r=e.response)==null?void 0:r.data)==null?void 0:s.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(e==null?void 0:e.message)}};function _k(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:c=>({label:c.dataset.label,value:c.label})}};Ce.positioners[n]=function(c,l){if(!c.length||e.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=u.width/2,m=sl(l,h,f),g=l.y,y=l.x<f?"left":"center";return{x:m-e.tooltipState.offsetX,y:g-e.tooltipState.offsetY,xAlign:y}},po.modes.customInteractionMode=function(c,l){const u=En(l,c),h=[];return po.evaluateInteractionItems(c,c.options.indexAxis||"x",u,(f,m,g)=>{c.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&c.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g}),c.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&c.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g})}),h};const r=e.numLabels.value>25?ff:mf,s=({chart:c,index:l})=>{var h;const u=c.data;return{size:r,style:(h=u==null?void 0:u.isLabelEmpty)!=null&&h[l]?"italic":"normal"}},a=(c,l,u)=>c.chart.options.indexAxis===c.axis?(l=c.getLabelForValue(u),l&&l.length>na?l.slice(0,na)+"...":l):c.getLabelForValue(Number(l)),o=d.computed(()=>{var c,l,u,h,f,m,g,y;return{indexAxis:e.indexAxis,skipNull:!0,scales:{x:{stacked:e.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(x,v){return a(this,x,v)}},title:{display:e.indexAxis==="y"?!it((c=e.metricAxesTitle)==null?void 0:c.value):!it((l=e.dimensionAxesTitle)==null?void 0:l.value),text:e.indexAxis==="y"?(u=e.metricAxesTitle)==null?void 0:u.value:(h=e.dimensionAxesTitle)==null?void 0:h.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:e.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:s,callback:function(x,v){return a(this,x,v)}},title:{display:e.indexAxis==="x"?!it((f=e.metricAxesTitle)==null?void 0:f.value):!it((m=e.dimensionAxesTitle)==null?void 0:m.value),text:e.indexAxis==="x"?(g=e.metricAxesTitle)==null?void 0:g.value:(y=e.dimensionAxesTitle)==null?void 0:y.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:x=>{uf(e.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.getCurrentInstance()&&d.onUnmounted(()=>{Ce.positioners[n]&&delete Ce.positioners[n]}),o}be.register(...k_);const xk=(e,t)=>{const n=t.datasets.map(r=>r.label),i=e.datasets.map(r=>r.label);return e.datasets.length===t.datasets.length&&n.every((r,s)=>r===i[s])};function wk(e,t,n,i,r){const s=d.shallowRef(null),a=(o,c)=>{if(t.value)return new be(t.value,{type:e,data:o,plugins:i,options:c})};return d.onMounted(()=>{s.value=a(n.value,r.value)}),d.onBeforeUnmount(()=>{it(s.value)||s.value.destroy()}),d.watch(n,(o,c)=>{if(xk(c,o)&&!it(s.value)){for(const[l,u]of o.datasets.entries())Object.assign(s.value.data.datasets[l],u);s.value.data.labels=o.labels,s.value.update()}else it(s.value)||s.value.destroy(),s.value=a(o,r.value)}),d.watch(t,()=>{it(s.value)||s.value.destroy(),s.value=a(n.value,r.value)}),d.watch(r,(o,c)=>{(o.indexAxis!==c.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(c.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(c.scales.y.title))&&(it(s.value)||s.value.destroy(),s.value=a(n.value,o))}),s}var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zf={exports:{}};(function(e){(function(){function t(l,u){if(u.separator===!1||l<1e3)return l.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(l).toString().split("");return m.reverse().forEach(function(g,y){y&&y%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function n(l,u,h){var f=l/u,m=h.round?"round":"floor";return h.decimal===!1?(l=Math[m](f),l.toString()):(h.precision?l=f:l=f<10?Math[m](f*10)/10:Math[m](f),l=l.toString(),typeof h.decimal=="string"&&(l=l.replace(".",h.decimal)),l)}var i=1e3,r=1e4,s=1e6,a=1e9,o=1e12;function c(l,u){var h;u=u||{};var f=l<0;f&&(l=Math.abs(l)),u.precision&&(l=parseFloat(l.toPrecision(u.precision)));var m=u.min10k?r:i;return l<m||u.precision&&u.precision>Math.log10(l)?h=t(n(l,1,u),u):l<s?h=n(l,i,u)+"k":l<a?h=n(l,s,u)+"m":l<o?h=t(n(l,a,u),u)+"b":h=t(n(l,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}c.addCommas=t,e.exports=c})()})(zf);var vk=zf.exports;const oa=vl(vk);function Sk(e,t,n){const{i18n:i}=mt.useI18n(),{formatBytes:r}=Oi({i18n:i}),{translateUnit:s}=mt.useTranslatedUnits();return{legendValues:d.computed(()=>e.value.datasets.reduce((o,c)=>{const l=c.total?c.total:c.data.reduce((h,f)=>h+(typeof f=="number"?Number(f)||0:Number(f&&f.y)||0),0);let u;if(n.value==="bytes")u=r(l);else{const h=s(n.value,l);u=i&&i.t("legend.datapointValueDisplay",{value:oa(l,{capital:!0}),unit:h})||`${oa(l,{capital:!0})} ${n.value}`}return{...o,[c.label]:{raw:l,formatted:u,isThreshold:c.isThreshold}}},{}))}}function kk(e){return d.computed(()=>{var r;if(!((r=e.value)!=null&&r.meta))return"";const n=e.value.meta.start_ms,i=e.value.meta.end_ms;return n&&i?`${el(n)} - ${el(i,{includeTZ:!0})}`:""})}function Mk(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ce.positioners[n]=function(s,a){if(!s.length)return!1;const o=this.chart.canvas.getBoundingClientRect(),c=e.tooltipState.width||this.width,l=o.width/2,u=sl(a,c,l),h=a.y,f=a.x<l?"left":"center";return{x:u-e.tooltipState.offsetX,y:h,xAlign:f}};const r=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:s=>{uf(e.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return d.onUnmounted(()=>{Ce.positioners[n]&&delete Ce.positioners[n]}),{options:r}}function Tk(e){const t=d.computed(()=>{var c,l;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return yk({tickValue:h,granularity:e.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!it((c=e.dimensionAxesTitle)==null?void 0:c.value),text:(l=e.dimensionAxesTitle)==null?void 0:l.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value}}),n=d.computed(()=>{var c,l;return{title:{display:!it((c=e.metricAxesTitle)==null?void 0:c.value),text:(l=e.metricAxesTitle)==null?void 0:l.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value}}),r=`lineChartTooltipPosition-${e.tooltipState.chartID}`,s={enabled:!1,position:r};Ce.positioners[r]=function(c,l){if(!c.length||e.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=e.tooltipState.height||this.height,m=u.width/2,g=u.height/2,y=sl(l,h,m);let x=pS(l,f,g);const v=l.y<g?"top":"bottom",S=l.x<m?"left":"center";return f>u.height&&(x=0),{x:y,y:x,xAlign:S,yAlign:v}};const a=d.computed(()=>{const c=Number(e.timeRangeMs.value),l=new Date,u=new Date(l.getTime()-c);return $w(c)>24||u.getDate()!==l.getDate()}),o=d.computed(()=>{var c,l;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(c=e.pointsWithoutHover)!=null&&c.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:n.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{cf(e.tooltipState,u,e.granularity.value)}},thresholdPlugin:{threshold:(l=e.threshold)==null?void 0:l.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.onUnmounted(()=>{Ce.positioners[r]&&delete Ce.positioners[r]}),{options:o}}function Dk(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:o}=e,{i18n:c}=mt.useI18n();return t?i.map(u=>({label:c&&c.te(`chartLabels.${u}`)&&c.t(`chartLabels.${u}`)||u,backgroundColor:ia(i.indexOf(u),un),data:a.map((h,f)=>n?s[`${h.id},${u}`]||0:s[`${f},${u}`]||null)})):Array.from(r).flatMap((u,h)=>{if(!u)return[];const f=ol(h,u.name,u.id==="empty",o);return{label:c&&c.te(`chartLabels.${u.name}`)&&c.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:a.map(m=>s[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function Ck(e,t){const{i18n:n}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,o=s&&Object.keys(s),c=a&&a.length>1,l=s&&o&&o.length>0,u=l&&o.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const h=l&&o||a,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(c?r.flatMap(_=>a.map((M,O)=>{const A=_.event[f],I=l?`${A},${M}`:`${O},${M}`,B=_.event[M];return[I,B]})):r.map(_=>{const M=l?`${_.event[f]},${_.event[m]}`:`${f},${m}`,O=_.event[a[0]];return[M,O]})),y=Object.keys(g).reduce((_,M)=>{const[O]=M.split(","),A=g[M];return _[O]?_[O]+=A:_[O]=A,_},{}),x=Object.entries(y).sort(([,_],[,M])=>Number(M)-Number(_)).map(([_])=>_),v=s[f],S=s[m];let k=l&&v&&Object.entries(v).map(([_,M])=>({id:_,name:M.name}))||a.map(_=>({id:_,name:_})),C=l&&S&&Object.entries(S).map(([_,M])=>({id:_,name:M.name}))||a.map(_=>({id:_,name:_}));if(l&&f==="country_code"&&(k=k.map(_=>({..._,name:il(_.id)||_.name}))),l&&m==="country_code"&&(C=C.map(_=>({..._,name:il(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(k.sort((_,M)=>x.indexOf(_.id)-x.indexOf(M.id)),C.sort((_,M)=>x.indexOf(_.id)-x.indexOf(M.id))),!k||!C)return{labels:[],datasets:[]};const E=Dk({isMultiMetric:c,hasDimensions:l,metricNames:a,dimensionFieldNames:h,barSegmentLabels:C,pivotRecords:g,rowLabels:k,colorPalette:e.colorPalette||un}),P=l?k.map(_=>n&&n.te(`chartLabels.${_.name}`)&&n.t(`chartLabels.${_.name}`)||_.name):a.map(_=>n&&n.te(`chartLabels.${_}`)&&n.t(`chartLabels.${_}`)||_),T=k.map(_=>_.id==="empty");return{labels:P,datasets:E,isLabelEmpty:T,isMultiDimension:u}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const Ek=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),Ok=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Th(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},Pk=(e,t,n,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(l=>new Date(l.timestamp).valueOf()))),o=Math.floor((e-i)/n)*n+i,c=Math.floor((a-i)/n)*n+i+n;return Ek(o,c,n)};function Rk(e,t){const{i18n:n}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start_ms:o,end_ms:c}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const l=s&&Object.keys(s)||a,u=l&&l[0],h=s[u];let f=s&&h&&Object.keys(h).map(C=>({id:C,name:h[C].name}))||a.map(C=>({id:C,name:C}));u==="country_code"&&(f=f.map(C=>({...C,name:il(C.id)||C.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(!r.length)return{datasets:[],labels:[]};const g=Ok(o),y=Pk(o,c,m,g,r),x=new Set,v=r!=null&&r.length?r.reduce((C,E)=>{const P=new Date(E.timestamp).valueOf(),T=E.event;for(const p of a)x.add(p),P in C||(C[P]={}),p in C[P]||(C[P][p]={});for(const p of a)f.forEach(_=>{T[u]===_.id||p===_.id?(C[P][p]||(C[P][p]={}),C[P][p][_.name]=Math.round(Number(T[p])*1e3)/1e3):l.length||(C[P][p]||(C[P][p]={}),C[P][p][_.name]=Math.round(Number(T[_.id])*1e3)/1e3)});return C},{}):{},k=[...a.length===1?a.flatMap(C=>f.map(E=>[C,E.name,E.id==="empty"])):f.map(C=>[C.name,C.name,C.id==="empty"])].map(([C,E,P],T)=>{const p=y.map(A=>A in v&&C in v[A]?{x:A,y:v[A][C][E]||0}:{x:A,y:0});let{colorPalette:_,fill:M}=e;it(_)&&(_=un);const O=ol(T,E,P,_);return{rawDimension:E,rawMetric:C,label:n&&n.te(`chartLabels.${E}`)&&n.t(`chartLabels.${E}`)||E,borderColor:O,backgroundColor:O,data:p,total:p.reduce((A,{y:I})=>A+Number(I),0),...PS,fill:M,borderWidth:M?AS:RS,isSegmentEmpty:P}});return u==="status_code"||u==="status_code_grouped"?k.sort((C,E)=>(C.label??"")<(E.label??"")?-1:1):k.sort((C,E)=>Number(C.total)<Number(E.total)?-1:1),{datasets:k}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const Ak=(e,t)=>{d.watch([e,t],(n,i,r)=>{const[s,a]=n;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function Ik(){const{i18n:e}=mt.useI18n();return{translateUnit:(n,i)=>{const r=i===1,s=`chartUnits.${n}`;return n==="usd"?"":e.te(s)?e.t(s,{plural:r?"":"s"}):n}}}const Lk="analytics-query-provider",Hf=2;function Nk(){const e=d.inject(Lk);return{evaluateFeatureFlag:(n,i)=>e?e.evaluateFeatureFlagFn(n,i):i}}function Sl(e){return d.getCurrentScope()?(d.onScopeDispose(e),!0):!1}const Vf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Fk=e=>e!=null,Bk=Object.prototype.toString,zk=e=>Bk.call(e)==="[object Object]";function la(e){return Array.isArray(e)?e:[e]}function Hk(e){return d.getCurrentInstance()}function Vk(e,t={}){if(!d.isRef(e))return d.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=d.customRef(()=>({get(){return e.value[i]},set(r){var s;if((s=d.toValue(t.replaceRef))!=null?s:!0)if(Array.isArray(e.value)){const o=[...e.value];o[i]=r,e.value=o}else{const o={...e.value,[i]:r};Object.setPrototypeOf(o,Object.getPrototypeOf(e.value)),e.value=o}else e.value[i]=r}}));return n}function $k(e,t=!0,n){Hk()?d.onMounted(e,n):t?e():d.nextTick(e)}function Wk(e,t,n){return d.watch(e,t,{...n,immediate:!0})}const ca=Vf?window:void 0;function Ai(e){var t;const n=d.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function Wr(...e){const t=[],n=()=>{t.forEach(o=>o()),t.length=0},i=(o,c,l,u)=>(o.addEventListener(c,l,u),()=>o.removeEventListener(c,l,u)),r=d.computed(()=>{const o=la(d.toValue(e[0])).filter(c=>c!=null);return o.every(c=>typeof c!="string")?o:void 0}),s=Wk(()=>{var o,c;return[(c=(o=r.value)==null?void 0:o.map(l=>Ai(l)))!=null?c:[ca].filter(l=>l!=null),la(d.toValue(r.value?e[1]:e[0])),la(d.unref(r.value?e[2]:e[1])),d.toValue(r.value?e[3]:e[2])]},([o,c,l,u])=>{if(n(),!(o!=null&&o.length)||!(c!=null&&c.length)||!(l!=null&&l.length))return;const h=zk(u)?{...u}:u;t.push(...o.flatMap(f=>c.flatMap(m=>l.map(g=>i(f,m,g,h)))))},{flush:"post"}),a=()=>{s(),n()};return Sl(n),a}function Yk(){const e=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{e.value=!0},t),e}function $f(e){const t=Yk();return d.computed(()=>(t.value,!!e()))}function jk(e,t,n={}){const{window:i=ca,...r}=n;let s;const a=$f(()=>i&&"MutationObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},c=d.computed(()=>{const f=d.toValue(e),m=la(f).map(Ai).filter(Fk);return new Set(m)}),l=d.watch(()=>c.value,f=>{o(),a.value&&f.size&&(s=new MutationObserver(t),f.forEach(m=>s.observe(m,r)))},{immediate:!0,flush:"post"}),u=()=>s==null?void 0:s.takeRecords(),h=()=>{l(),o()};return Sl(h),{isSupported:a,stop:h,takeRecords:u}}function Uk(e,t={}){var n;const{pointerTypes:i,preventDefault:r,stopPropagation:s,exact:a,onMove:o,onEnd:c,onStart:l,initialValue:u,axis:h="both",draggingElement:f=ca,containerElement:m,handle:g=e,buttons:y=[0]}=t,x=d.ref((n=d.toValue(u))!=null?n:{x:0,y:0}),v=d.ref(),S=T=>i?i.includes(T.pointerType):!0,k=T=>{d.toValue(r)&&T.preventDefault(),d.toValue(s)&&T.stopPropagation()},C=T=>{var p;if(!d.toValue(y).includes(T.button)||d.toValue(t.disabled)||!S(T)||d.toValue(a)&&T.target!==d.toValue(e))return;const _=d.toValue(m),M=(p=_==null?void 0:_.getBoundingClientRect)==null?void 0:p.call(_),O=d.toValue(e).getBoundingClientRect(),A={x:T.clientX-(_?O.left-M.left+_.scrollLeft:O.left),y:T.clientY-(_?O.top-M.top+_.scrollTop:O.top)};(l==null?void 0:l(A,T))!==!1&&(v.value=A,k(T))},E=T=>{if(d.toValue(t.disabled)||!S(T)||!v.value)return;const p=d.toValue(m),_=d.toValue(e).getBoundingClientRect();let{x:M,y:O}=x.value;(h==="x"||h==="both")&&(M=T.clientX-v.value.x,p&&(M=Math.min(Math.max(0,M),p.scrollWidth-_.width))),(h==="y"||h==="both")&&(O=T.clientY-v.value.y,p&&(O=Math.min(Math.max(0,O),p.scrollHeight-_.height))),x.value={x:M,y:O},o==null||o(x.value,T),k(T)},P=T=>{d.toValue(t.disabled)||!S(T)||v.value&&(v.value=void 0,c==null||c(x.value,T),k(T))};if(Vf){const T=()=>{var p;return{capture:(p=t.capture)!=null?p:!0,passive:!d.toValue(r)}};Wr(g,"pointerdown",C,T),Wr(f,"pointermove",E,T),Wr(f,"pointerup",P,T)}return{...Vk(x),position:x,isDragging:d.computed(()=>!!v.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function qk(e,t,n={}){const{window:i=ca,...r}=n;let s;const a=$f(()=>i&&"ResizeObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},c=d.computed(()=>{const h=d.toValue(e);return Array.isArray(h)?h.map(f=>Ai(f)):[Ai(h)]}),l=d.watch(c,h=>{if(o(),a.value&&i){s=new ResizeObserver(t);for(const f of h)f&&s.observe(f,r)}},{immediate:!0,flush:"post"}),u=()=>{o(),l()};return Sl(u),{isSupported:a,stop:u}}function Xk(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,o=d.shallowRef(0),c=d.shallowRef(0),l=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),g=d.shallowRef(0);function y(){const v=Ai(e);if(!v){n&&(o.value=0,c.value=0,l.value=0,u.value=0,h.value=0,f.value=0,m.value=0,g.value=0);return}const S=v.getBoundingClientRect();o.value=S.height,c.value=S.bottom,l.value=S.left,u.value=S.right,h.value=S.top,f.value=S.width,m.value=S.x,g.value=S.y}function x(){a==="sync"?y():a==="next-frame"&&requestAnimationFrame(()=>y())}return qk(e,x),d.watch(()=>Ai(e),v=>!v&&x()),jk(e,x,{attributeFilter:["style","class"]}),r&&Wr("scroll",x,{capture:!0,passive:!0}),i&&Wr("resize",x,{passive:!0}),$k(()=>{s&&x()}),{height:o,bottom:c,left:l,right:u,top:h,width:f,x:m,y:g,update:x}}function Gk(e,t){const{top:n,left:i}=Xk(e),r=d.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),s=d.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const Kk=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const r=[...i].filter(c=>c>=t&&c<=n).sort((c,l)=>c-l),s=[];if(n-t<e-2)return[];const a=(n-t)/e;let o=0;for(let c=0;c<e;c++){const l=t+c*a,u=t+(c+1)*a;let h=0;for(;o<r.length&&r[o]>=l&&r[o]<=u;)h++,o++;s.push([Math.ceil(l),h])}return s},Wf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Yr=d.ref({}),Zk=e=>(Yr.value[e]||(Yr.value[e]=Wf()),Yr.value[e]),Qk=(e,t)=>{const n=Yr.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete Yr.value[t])};function Jk({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:c}){const u=n!==void 0&&e!==void 0?Zk(n):Wf(),h=e!==void 0?e:"static-chart-key",f=d.computed(()=>t.reduce((M,{timestamps:O})=>[...M,...O],[])),m=d.computed(()=>i||f.value.reduce((M,O)=>M===0?O:Math.min(M,O),0)),g=d.computed(()=>r||f.value.reduce((M,O)=>Math.max(M,O),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=g.value,o!==void 0&&(u.renderPoints[h]=o)});const y=d.computed(()=>Object.values(u.minStamps).reduce((M,O)=>M===0?O:Math.min(M,O),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((M,O)=>Math.max(M,O),0)),v=d.computed(()=>{const M=Object.values(u.renderPoints);return M.length===0?24:M.reduce((O,A)=>Math.max(O,A),2)}),S=d.computed(()=>{const M=x.value-y.value;return Math.ceil(M/v.value)}),k=d.computed(()=>t.length>1),C=d.computed(()=>t.map(({timestamps:M,color:O,label:A})=>({data:Kk({bucketCount:v.value,minStamp:y.value,maxStamp:x.value,timestamps:M}).map(([j,G])=>({x:j,y:G})),label:A,...(c==="sparkline_bar"||k.value)&&O&&{backgroundColor:O},...c!=="sparkline_bar"&&O&&{borderColor:O},...k.value&&c!=="sparkline_bar"&&{fill:!0}}))),E=d.computed(()=>{var A,I;const M=((I=(A=C.value[0])==null?void 0:A.data)==null?void 0:I.length)??0,O=[];for(let B=0;B<M;B++){let j=0;for(let G=0;G<C.value.length;G++)j+=C.value[G].data[B].y;O.push(j)}return O}),P=d.computed(()=>{const M=E.value.reduce((O,A)=>Math.max(O,A),0);return Math.max(M,a??0)}),T=d.computed(()=>{const M=C.value.reduce((I,{data:B})=>[...I,...B.map(({y:j})=>j)],[]),O=M.length?M[0]:0,A=M.reduce((I,B)=>Math.min(I,B),O);return s===void 0?A:Math.min(A,s)});d.watchEffect(()=>{u.maxCounts[h]=P.value,u.minCounts[h]=T.value});const p=d.computed(()=>{const M=Object.values(u.minCounts),O=M.length?M[0]:0;return M.reduce((A,I)=>Math.min(A,I),O)}),_=d.computed(()=>Object.values(u.maxCounts).reduce((M,O)=>Math.max(M,O),0));return d.onUnmounted(()=>{e!==void 0&&n!==void 0&&Qk(e,n)}),{syncedMinStamp:y,syncedMaxStamp:x,syncedRenderPoints:v,syncedChartDatasets:C,syncedGroupSizeMs:S,syncedMinCount:p,syncedMaxCount:_}}const mt={useBarChartOptions:_k,useChartJSCommon:wk,useChartLegendValues:Sk,useChartSelectedRange:kk,useExploreResultToDatasets:Ck,useExploreResultToTimeDataset:Rk,useDonutChartOptions:Mk,useLineChartOptions:Tk,useI18n:xg,useReportChartDataForSynthetics:Ak,useTranslatedUnits:Ik,useEvaluateFeatureFlag:Nk,useTooltipAbsolutePosition:Gk,useSparklineSync:Jk};var ve=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(ve||{});/*!
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 Sf={modes:{point(n,t){return ea(n,t,{intersect:!0})},nearest(n,t,e){return bS(n,t,e)},x(n,t,e){return ea(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return ea(n,t,{intersect:e.intersect,axis:"y"})}}};function ml(n,t,e){return(Sf.modes[e.mode]||Sf.modes.nearest)(n,t,e)}function pS(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 yS(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function ea(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):pS(i,t,e.axis))}function bS(n,t,e){let i=Number.POSITIVE_INFINITY;return ea(n,t,e).reduce((s,r)=>{const a=r.getCenterPoint(),o=yS(t,a,e.axis),l=fi(t,o);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Jn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,a=t.y;return{x:r+i*(n.x-r)-s*(n.y-a),y:a+s*(n.x-r)+i*(n.y-a)}}const _S=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ti=.001,na=(n,t,e)=>Math.min(e,Math.max(t,n)),kf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function xS(n,t,e){for(const i of Object.keys(n))n[i]=na(n[i],t,e);return n}function wS(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 Df(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:a,hitTolerance:o}){const l=(a+o)/2,c=n.x>=t-l-ti&&n.x<=i+l+ti,u=n.y>=e-l-ti&&n.y<=s+l+ti;return r==="x"?c:(r==="y"||c)&&u}function Tf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:a}){const o=Jn(n,e,Vt(-s));return Df(o,t,i,{borderWidth:r,hitTolerance:a})}function ei(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function vS(n,t,e,i=!0){const s=e.split(".");let r=0;for(const a of t.split(".")){const o=s[r++];if(parseInt(a,10)<parseInt(o,10))break;if(_S(o,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Cf=n=>typeof n=="string"&&n.endsWith("%"),Ef=n=>parseFloat(n)/100,Of=n=>na(Ef(n),0,1),Ls=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),MS={box:n=>Ls(n.centerX,n.centerY),doughnutLabel:n=>Ls(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ls(n.centerX,n.centerY),line:n=>Ls(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ls(n.centerX,n.centerY)};function gl(n,t){return t==="start"?0:t==="end"?n:Cf(t)?Of(t)*n:n/2}function On(n,t,e=!0){return typeof t=="number"?t:Cf(t)?(e?Of(t):Ef(t))*n:n}function SS(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 Pf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},a){const o=ft(a),l=t.width+(o?a.width:0)+e,c=t.height+(o?a.height:0)+e,u=pl(i),h=Lf(n.x,l,s,u.x),f=Lf(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 ft(n)?{x:st(n.x,t),y:st(n.y,t)}:(n=st(n,t),{x:n,y:n})}const Af=(n,t)=>n&&n.autoFit&&t<1;function Rf(n,t){const e=n.font,i=wt(e)?e:[e];return Af(n,t)?i.map(function(s){const r=Rt(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,Rt(r)}):i.map(s=>Rt(s))}function If(n){return n&&(ge(n.xValue)||ge(n.yValue))}function Lf(n,t,e=0,i){return n-gl(t,i)+e}function Ei(n,t,e){const i=e.init;if(i){if(i===!0)return Ff(t,e)}else return;return kS(n,t,e)}function Nf(n,t,e){let i=!1;return t.forEach(s=>{pe(n[s])?(i=!0,e[s]=n[s]):ge(e[s])&&delete e[s]}),i}function Ff(n,t){const e=t.type||"line";return MS[e](n)}function kS(n,t,e){const i=St(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Ff(t,e);if(ft(i))return i}const yl=new Map,DS=n=>isNaN(n)||n<=0,TS=n=>n.reduce(function(t,e){return t+=e.string,t},"");function ia(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function sa(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Vt(i)),n.translate(-t,-e))}function ln(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 Oi(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function ra(n,t){const e=t.content;if(ia(e))return{width:On(e.width,t.width),height:On(e.height,t.height)};const i=Rf(t),s=t.textStrokeWidth,r=wt(e)?e:[e],a=r.join()+TS(i)+s+(n._measureText?"-spriting":"");return yl.has(a)||yl.set(a,PS(n,r,i,s)),yl.get(a)}function Bf(n,t,e){const{x:i,y:s,width:r,height:a}=t;n.save(),Oi(n,e);const o=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),mi(n,{x:i,y:s,w:r,h:a,radius:xS(vn(e.borderRadius),0,Math.min(r,a)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function zf(n,t,e,i){const s=e.content;if(ia(s)){n.save(),n.globalAlpha=IS(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=wt(s)?s:[s],a=Rf(e,i),o=e.color,l=wt(o)?o:[o],c=SS(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,CS(n,e)&&AS(n,{x:c,y:u},r,a),RS(n,{x:c,y:u},r,{fonts:a,colors:l}),n.restore()}function CS(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function ES(n,t,e,i){const{radius:s,options:r}=t,a=r.pointStyle,o=r.rotation;let l=(o||0)*La;if(ia(a)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}DS(s)||OS(n,{x:e,y:i,radius:s,rotation:o,style:a,rad:l})}function OS(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:a}){let o,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ct),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=rr,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=rr,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(a+Oe)*c,l=Math.sin(a+Oe)*c,n.arc(t-o,e-l,u,a-ut,a-Ot),n.arc(t+l,e-o,u,a-Ot,a),n.arc(t+o,e+l,u,a,a+Ot),n.arc(t-l,e+o,u,a+Ot,a+ut),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}a+=Oe;case"rectRot":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":a+=Oe;case"cross":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),a+=Oe,o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function PS(n,t,e,i){n.save();const s=t.length;let r=0,a=i;for(let o=0;o<s;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];r=Math.max(r,n.measureText(c).width+i),a+=l.lineHeight}return n.restore(),{width:r,height:a}}function AS(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(a,o){const l=s[Math.min(o,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(a,t,e+c/2+r),r+=c}),n.stroke()}function RS(n,{x:t,y:e},i,{fonts:s,colors:r}){let a=0;i.forEach(function(o,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(o,t,e+h/2+a),a+=h,n.fill()})}function IS(n,t){const e=wn(n)?n:t;return wn(e)?na(e,0,1):1}const Hf=["left","bottom","top","right"];function LS(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,a=r&&r.display&&HS(t,r);if(!a||YS(t,r,a))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=NS(t,a),{sideStart:u,sideEnd:h}=BS(t,a,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=Jn({x:e,y:i},t.getCenterPoint(),Vt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function NS(n,t){const{x:e,y:i,x2:s,y2:r}=n,a=FS(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+a,y:i},l={x:o.x,y:r}):(o={x:e,y:i+a},l={x:s,y:o.y}),{separatorStart:o,separatorEnd:l}}function FS(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 BS(n,t,e){const{y:i,width:s,height:r,options:a}=n,o=a.callout.start,l=zS(t,a.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+On(r,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+On(s,o),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 HS(n,t){const e=t.position;return Hf.includes(e)?e:WS(n,t)}function WS(n,t){const{x:e,y:i,x2:s,y2:r,width:a,height:o,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=n,m={x:u,y:h},g=t.start,_=On(a,g),x=On(o,g),v=[e,e+_,e+_,s],S=[i+x,r,i,r],k=[];for(let C=0;C<4;C++){const A=Jn({x:v[C],y:S[C]},m,Vt(f));k.push({position:Hf[C],distance:fi(A,{x:l,y:c})})}return k.sort((C,A)=>C.distance-A.distance)[0].position}function YS(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let a=i,o=s;return e==="left"?a+=r:e==="right"?a-=r:e==="top"?o+=r:e==="bottom"&&(o-=r),n.inRange(a,o)}const Wf={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),At(t)?n.getPixelForValue(t):e}function ni(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(a=>a.axis&&a.axis===s);return r.length?r[0].id:s}function Yf(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[ni(i,t,"xScaleID")],r=i[ni(i,t,"yScaleID")];let a=e.width/2,o=e.height/2;return s&&(a=Pi(s,t.xValue,s.left+s.width/2)),r&&(o=Pi(r,t.yValue,r.top+r.height/2)),{x:a,y:o}}function bl(n,t){const e=n.scales,i=e[ni(e,t,"xScaleID")],s=e[ni(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:a}=i||n.chartArea,{top:o,bottom:l}=s||n.chartArea;const c=Uf(i,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;const u=Uf(s,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:r,y:o,x2:a,y2:l,width:a-r,height:l-o,centerX:r+(a-r)/2,centerY:o+(l-o)/2}}function $f(n,t){if(!If(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,a=e.centerY+t.yAdjust;return{x:r-i,y:a-i,x2:r+i,y2:a+i,centerX:r,centerY:a,width:s,height:s,radius:i}}return $S(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):US(e,r,t),r}function jf(n,t){const e=bl(n,t);return e.initProperties=Ei(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:GS(n,e,t),initProperties:e.initProperties}],e}function $S(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 Uf(n,t){const e=Yf(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 US(n,t,e){for(const i of Object.keys(Wf)){const s=n[ni(n,e,i)];if(s){const{min:r,max:a,start:o,end:l,startProp:c,endProp:u}=Wf[i],h=Yf(s,{min:e[r],max:e[a],start:s[o],end:s[l]});t[c]=h.start,t[u]=h.end}}}function qS({properties:n,options:t},e,i,s){const{x:r,x2:a,width:o}=n;return qf({start:r,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function XS({properties:n,options:t},e,i,s){const{y:r,y2:a,height:o}=n;return qf({start:r,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function qf(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:a,end:o},adjust:l}=t,c=i-s-e-a-o-t.size;return e+s/2+l+gl(c,r)}function GS(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=pl(i.position),r=$t(i.padding),a=ra(n.ctx,i),o=qS({properties:t,options:e},a,s,r),l=XS({properties:t,options:e},a,s,r),c=a.width+r.width,u=a.height+r.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}const _l=["enter","leave"],xl=_l.concat("click");function KS(n,t,e){t.listened=Nf(e,xl,t.listeners),t.moveListened=!1,_l.forEach(i=>{pe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&pe(i.click)&&(t.listened=!0),t.moveListened||_l.forEach(s=>{pe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function ZS(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return QS(n,t,e);case"click":return JS(n,t,e)}}function QS(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 a=Xf(r,"leave",s,i);return Xf(r,"enter",i,s)||a}function Xf({state:n,event:t},e,i,s){let r;for(const a of i)s.indexOf(a)<0&&(r=Gf(a.options[e]||n.listeners[e],a,t)||r);return r}function JS(n,t,e){const i=n.listeners,s=ml(n.visibleElements,t,e.interaction);let r;for(const a of s)r=Gf(a.options.click||i.click,a,t)||r;return r}function Gf(n,t,e){return St(n,[t.$context,e])===!0}const aa=["afterDraw","beforeDraw"];function tk(n,t,e){const i=t.visibleElements;t.hooked=Nf(e,aa,t.hooks),t.hooked||i.forEach(s=>{t.hooked||aa.forEach(r=>{pe(s.options[r])&&(t.hooked=!0)})})}function Kf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return St(i,[t.$context])}}function ek(n,t,e){const i=ak(n.scales,t,e);let s=Zf(t,i,"min","suggestedMin");s=Zf(t,i,"max","suggestedMax")||s,s&&pe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function nk(n,t){for(const e of n)sk(e,t)}function Zf(n,t,e,i){if(At(t[e])&&!ik(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function ik(n,t,e){return ge(n[t])||ge(n[e])}function sk(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ni(t,n,e);i&&!t[i]&&rk(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function rk(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ge(n[e+i]))return!0;return!1}function ak(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",a={min:st(t.min,Number.NEGATIVE_INFINITY),max:st(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===s?Qf(o,t,["value","endValue"],a):ni(n,o,r)===s&&Qf(o,t,[i+"Min",i+"Max",i+"Value"],a);return a}function Qf(n,t,e,i){for(const s of e){const r=n[s];if(ge(r)){const a=t.parse(r);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Ai extends Zt{inRange(t,e,i,s){const{x:r,y:a}=Jn({x:t,y:e},this.getCenterPoint(s),Vt(-this.options.rotation));return Df({x:r,y:a},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return ei(this,t)}draw(t){t.save(),sa(t,this.getCenterPoint(),this.options.rotation),Bf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return jf(t,e)}}Ai.id="boxAnnotation",Ai.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},Ai.defaultRoutes={borderColor:"color",backgroundColor:"color"},Ai.descriptors={label:{_fallback:!0}};class oa extends Zt{inRange(t,e,i,s){return Tf({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 ei(this,t)}draw(t){const e=this.options;!e.display||!e.content||(hk(t,this),t.save(),sa(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:a}=ck(t,e,i);let o=ra(t.ctx,e);const l=uk(o,a);Af(e,l)&&(o={width:o.width*l,height:o.height*l});const{position:c,xAdjust:u,yAdjust:h}=e,f=Pf(r,o,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Ei(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}oa.id="doughnutLabelAnnotation",oa.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},oa.defaultRoutes={};function ok(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof nn&&lk(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function lk(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 ck({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:a}=n,{innerRadius:o,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,h=(s+a)/2+c,f={left:Math.max(u-o,i),right:Math.min(u+o,r),top:Math.max(h-o,s),bottom:Math.min(h+o,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},g=t.spacing+t.borderWidth/2,_=o-g,x=m.y>h,v=x?s+g:a-g,S=dk(v,u,h,_);return{controllerMeta:{_centerX:u,_centerY:h,_radius:_,_counterclockwise:x,...S},point:m,radius:Math.min(o,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function uk({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function dk(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),a=t*-2,o=Math.pow(t,2)+s-r,l=Math.pow(a,2)-4*o;if(l<=0)return{_startAngle:0,_endAngle:Ct};const c=(-a-Math.sqrt(l))/2,u=(-a+Math.sqrt(l))/2;return{_startAngle:or({x:t,y:e},{x:c,y:n}).angle,_endAngle:or({x:t,y:e},{x:u,y:n}).angle}}function hk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:a,_counterclockwise:o,options:l}=t;n.save();const c=ln(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,a,o),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Ns extends Zt{inRange(t,e,i,s){return Tf({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 ei(this,t)}draw(t){const e=this.options,i=!ge(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),sa(t,this.getCenterPoint(),this.rotation),LS(t,this),Bf(t,this,e),zf(t,fk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(If(e))i=Vf(t,e);else{const{centerX:o,centerY:l}=bl(t,e);i={x:o,y:l}}const s=$t(e.padding),r=ra(t.ctx,e),a=Pf(i,r,e,s);return{initProperties:Ei(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}Ns.id="labelAnnotation",Ns.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},Ns.defaultRoutes={borderColor:"color"};function fk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,a=$t(s.padding);return{x:n+a.left+r,y:t+a.top+r,width:e-a.left-a.right-s.borderWidth,height:i-a.top-a.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,Jf=(n,t,e)=>wl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Fs=n=>n*n,mk=(n,t,{x:e,y:i,x2:s,y2:r},a)=>a==="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},tm=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Ml=(n,t,e,i)=>({x:tm(n.x,t.x,e.x,i),y:tm(n.y,t.y,e.y,i)}),em=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),nm=(n,t,e,i)=>-Math.atan2(em(n.x,t.x,e.x,i),em(n.y,t.y,e.y,i))+.5*ut;class Bs extends Zt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,m=l.isPointInStroke(o,h,f)||Sl(this,a,s);return l.restore(),m}const c=Fs(r);return bk(this,a,c,s)||Sl(this,a,s)}return gk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return ei(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:a,options:o}=this;if(t.save(),!ln(t,o))return t.restore();Oi(t,o);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(o.curve&&a)return Dk(t,this,a,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=o.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:a,y2:o}=i,l=pk(i,t.chartArea),c=l?yk({x:s,y:r},{x:a,y:o},t.chartArea):{x:s,y:r,x2:a,y2:o,width:Math.abs(a-s),height:Math.abs(o-r)};if(c.centerX=(a+s)/2,c.centerY=(o+r)/2,c.initProperties=Ei(t,c,e),e.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=kk(c,e,fi(h,f))}const u=_k(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Bs.id="lineAnnotation";const im={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};Bs.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},im),fill:!1,length:12,start:Object.assign({},im),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({},Ns.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},Bs.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Bs.defaultRoutes={borderColor:"color"};function gk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const a=mk(t,e,n.getProps(["x","y","x2","y2"],r),i);return kf(a,s)||Sl(n,{mouseX:t,mouseY:e},r,i)}function pk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:a,left:o}){return!(n<o&&e<o||n>r&&e>r||t<s&&i<s||t>a&&i>a)}function sm({x:n,y:t},e,{top:i,right:s,bottom:r,left:a}){return n<a&&(t=Jf(a,{x:n,y:t},e),n=a),n>s&&(t=Jf(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 yk(n,t,e){const{x:i,y:s}=sm(n,t,e),{x:r,y:a}=sm(t,n,e);return{x:i,y:s,x2:r,y2:a,width:Math.abs(r-i),height:Math.abs(a-s)}}function bk(n,{mouseX:t,mouseY:e},i=ti,s){const{x:r,y:a,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],s),c=o-r,u=l-a,h=Fs(c)+Fs(u),f=h===0?-1:((t-r)*c+(e-a)*u)/h;let m,g;return f<0?(m=r,g=a):f>1?(m=o,g=l):(m=r+f*c,g=a+f*u),Fs(t-m)+Fs(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 _k(n,t,e){const i=e.borderWidth,s=$t(e.padding),r=ra(n.ctx,e),a=r.width+s.width+i,o=r.height+s.height+i;return wk(t,e,{width:a,height:o,padding:s},n.chartArea)}function xk(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ut/2?r-ut:r<ut/-2?r+ut:r}function wk(n,t,e,i){const{width:s,height:r,padding:a}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},h=t.rotation==="auto"?xk(n):Vt(t.rotation),f=vk(s,r,h),m=Mk(n,t,{labelSize:f,padding:a},i),g=n.cp?Ml(c,n.cp,u,m):wl(c,u,m),_={size:f.w,min:i.left,max:i.right,padding:a.left},x={size:f.h,min:i.top,max:i.bottom,padding:a.top},v=am(g.x,_)+o,S=am(g.y,x)+l;return{x:v-s/2,y:S-r/2,x2:v+s/2,y2:S+r/2,centerX:v,centerY:S,pointX:g.x,pointY:g.y,width:s,height:r,rotation:ar(h)}}function vk(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 Mk(n,t,e,i){let s;const r=Sk(n,i);return t.position==="start"?s=rm({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-rm({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=gl(1,t.position),s}function rm(n,t,e,i){const{labelSize:s,padding:r}=t,a=n.w*i.dx,o=n.h*i.dy,l=a>0&&(s.w/2+r.left-i.x)/a,c=o>0&&(s.h/2+r.top-i.y)/o;return na(Math.max(l,c),0,.25)}function Sk(n,t){const{x:e,x2:i,y:s,y2:r}=n,a=Math.min(s,r)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(a,l),dx:o<=c?1:-1,dy:a<=l?1:-1}}function am(n,t){const{size:e,min:i,max:s,padding:r}=t,a=e/2;return e>s-i?(s+i)/2:(i>=n-r-a&&(n=i+r+a),s<=n+r+a&&(n=s-r-a),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:lm(n,e),endAdjust:lm(n,i)}}function lm(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:a,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Oi(n,i),ln(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),a===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function kk(n,t,e){const{x:i,y:s,x2:r,y2:a,centerX:o,centerY:l}=n,c=Math.atan2(a-s,r-i),u=pl(t.controlPoint,0),h={x:o+On(e,u.x,!1),y:l+On(e,u.y,!1)};return Jn(h,{x:o,y:l},c)}function cm(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 Dk(n,t,e,i){const{x:s,y:r,x2:a,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=om(t),m={x:s,y:r},g={x:a,y:o},_=nm(m,e,g,0),x=nm(m,e,g,1)-ut,v=Ml(m,e,g,h/i),S=Ml(m,e,g,1-f/i),k=new Path2D;n.beginPath(),k.moveTo(v.x,v.y),k.quadraticCurveTo(e.x,e.y,S.x,S.y),n.shadowColor=l.borderShadowColor,n.stroke(k),t.path=k,t.ctx=n,cm(n,v,{angle:_,adjust:h},c),cm(n,S,{angle:x,adjust:f},u)}class zs extends Zt{inRange(t,e,i,s){const r=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Tk({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,a);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:o,end:c},f=Jn({x:t,y:e},this.getCenterPoint(s),Vt(-r));return f[i]>=h.start-a-ti&&f[i]<=h.end+a+ti}getCenterPoint(t){return ei(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:a}=this;t.save(),sa(t,this.getCenterPoint(),a.rotation),Oi(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const o=ln(t,a);t.ellipse(s,r,i/2,e/2,ut/2,0,2*ut),t.fill(),o&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return jf(t,e)}}zs.id="ellipseAnnotation",zs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Ai.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},zs.defaultRoutes={borderColor:"color",backgroundColor:"color"},zs.descriptors={label:{_fallback:!0}};function Tk(n,t,e,i){const{width:s,height:r,centerX:a,centerY:o}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=Vt(e||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(n.x-a)+f*(n.y-o),2),g=Math.pow(f*(n.x-a)-h*(n.y-o),2);return m/Math.pow(l+i,2)+g/Math.pow(c+i,2)<=1.0001}class la extends Zt{inRange(t,e,i,s){const{x:r,y:a,x2:o,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"?wS({x:t,y:e},this.getCenterPoint(s),c/2,u):kf(i==="y"?{start:a,end:l,value:e}:{start:r,end:o,value:t},u)}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Oi(t,e);const s=ln(t,e);ES(t,this,this.centerX,this.centerY),s&&!ia(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=$f(t,e);return i.initProperties=Ei(t,i,e),i}}la.id="pointAnnotation",la.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},la.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ca extends Zt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Ek(this.elements,t,e,s);const r=Jn({x:t,y:e},this.getCenterPoint(s),Vt(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...a),l=Math.max(...a);return r[i]>=o&&r[i]<=l}getCenterPoint(t){return ei(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Oi(t,i);const s=ln(t,i);let r=!0;for(const a of e)r?(t.moveTo(a.x,a.y),r=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=$f(t,e),{sides:s,rotation:r}=e,a=[],o=2*ut/s;let l=r*La;for(let c=0;c<s;c++,l+=o){const u=Ck(i,e,l);u.initProperties=Ei(t,i,e),a.push(u)}return i.elements=a,i}}ca.id="polygonAnnotation",ca.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},ca.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Ck({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const a=(i+s)/2,o=Math.sin(r),l=Math.cos(r),c={x:n+o*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+o*(e+a),bY:t-l*(e+a)}}}function Ek(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const o=a.getProps(["bX","bY"],i);o.bY>e!=r.bY>e&&t<(r.bX-o.bX)*(e-o.bY)/(r.bY-o.bY)+o.bX&&(s=!s),r=o}return s}const Pn={box:Ai,doughnutLabel:oa,ellipse:zs,label:Ns,line:Bs,point:la,polygon:ca};Object.keys(Pn).forEach(n=>{Pt.describe(`elements.${Pn[n].id}`,{_fallback:"plugins.annotation.common"})});const Ok={update:Object.assign},Pk=xl.concat(aa),um=(n,t)=>ft(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 Ak(n,t,e,i){const s=Ik(n,e.animations,i),r=t.annotations,a=Fk(t.elements,r);for(let o=0;o<r.length;o++){const l=r[o],c=dm(a,o,l.type),u=l.setContext(Nk(n,c,a,l)),h=c.resolveElementProperties(n,u);h.skip=Rk(h),"elements"in h&&(Lk(c,h.elements,u,s),delete h.elements),ge(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=hm(u),s.update(c,h)}}function Rk(n){return isNaN(n.x)||isNaN(n.y)}function Ik(n,t,e){return e==="reset"||e==="none"||e==="resize"?Ok:new Ga(n,t)}function Lk(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const a=t[r],o=a.properties,l=dm(s,r,a.type,a.initProperties),c=e[a.optionScope].override(a);o.options=hm(c),i.update(l,o)}}function dm(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 hm(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 Pk)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)&&wt(r)?e[i]=r.map(a=>um(a,s)):e[i]=um(r,s)}return e}function Nk(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 Fk(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 Bk="3.1.0";const An=new Map,fm=n=>n.type!=="doughnutLabel",zk=xl.concat(aa);var mm={id:"annotation",version:Bk,beforeRegister(){vS("chart.js","4.0",ye.version)},afterRegister(){ye.register(Pn)},afterUnregister(){ye.unregister(Pn)},beforeInit(n){An.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=An.get(n),s=i.annotations=[];let r=e.annotations;ft(r)?Object.keys(r).forEach(a=>{const o=r[a];ft(o)&&(o.id=a,s.push(o))}):wt(r)&&s.push(...r),nk(s.filter(fm),n.scales)},afterDataLimits(n,t){const e=An.get(n);ek(n,t.scale,e.annotations.filter(fm).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=An.get(n);KS(n,i,e),Ak(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),tk(n,i,e)},beforeDatasetsDraw(n,t,e){Hs(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Hs(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Hs(n,t.index,e.clip)},beforeDraw(n,t,e){Hs(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Hs(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=An.get(n);ZS(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){An.delete(n)},getAnnotations(n){const t=An.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 Hs(n,t,e){const{ctx:i,chartArea:s}=n,r=An.get(n);e&&Ji(i,s);const a=Hk(r.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of a)Wk(i,s,r,o);e&&ts(i)}function Hk(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 Wk(n,t,e,i){const s=i.element;i.main?(Kf(e,s,"beforeDraw"),s.draw(n,t),Kf(e,s,"afterDraw")):s.draw(n,t)}const Yk={class:"zoom-timerange-container"},Vk={class:"zoom-timerange-details"},$k={class:"label","data-testid":"zoom-timerange-from"},jk={class:"label","data-testid":"zoom-timerange-to"},Uk=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.ref(As({tickValue:t.start,granularity:t.granularity})),s=d.ref(As({tickValue:t.end,granularity:t.granularity})),r=(a,o)=>{jh(()=>{i.value=As({tickValue:a,granularity:t.granularity}),s.value=As({tickValue:o,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([a,o])=>{r(a,o)},{immediate:!0}),(a,o)=>(d.openBlock(),d.createElementBlock("div",Yk,[d.createElementVNode("div",Vk,[d.createElementVNode("div",$k,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)])]))}}),Ce=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},gm=Ce(Uk,[["__scopeId","data-v-0e972e3c"]]),qk={class:"zoom-actions-container"},Xk={class:"zoom-actions-heading"},Gk={class:"zoom-action-select"},Kk=["data-testid"],Zk=["aria-disabled","href"],Qk=["onClick"],Jk=Ce(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,a)=>(d.openBlock(),d.createElementBlock("div",qk,[d.createElementVNode("div",Xk,[d.createVNode(gm,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Qs.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(Go),size:d.unref(Ko),onClick:a[0]||(a[0]=o=>r.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",Gk,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.zoomActionItems,o=>(d.openBlock(),d.createElementBlock("div",{key:o.key,class:d.normalizeClass(["zoom-action-item",{disabled:o.disabled}]),"data-testid":`zoom-action-item-${o.key}`},[o.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":o.disabled,class:"zoom-action-link",href:o.href,onClick:a[1]||(a[1]=l=>r.$emit("onAction"))},d.toDisplayString(o.label),9,Zk)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(o)},d.toDisplayString(o.label),9,Qk))],10,Kk))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),tD={key:2},eD={class:"tooltip-title"},nD={class:"title"},iD={key:0,class:"subtitle"},sD={class:"context"},rD={class:"metric"},aD={class:"tooltip"},oD={key:0},lD={class:"display-value"},ua=Ce(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:a,isDragging:o}=lS(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${a.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])=>{o.value||(r.value=parseFloat(m),a.value=parseFloat(g))}),d.watch(o,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 n.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity?(d.openBlock(),d.createBlock(gm,{key:0,end:(_=n.zoomTimeRange)==null?void 0:_.end,granularity:n.granularity,start:(x=n.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(d.openBlock(),d.createBlock(Jk,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:g[0]||(g[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",tD,[d.createElementVNode("div",eD,[d.createElementVNode("div",nD,[d.createElementVNode("div",null,d.toDisplayString(n.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Qs.DragIcon),{key:0,class:"drag-icon",color:d.unref(Go),size:d.unref(Ko)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",iD,[d.createElementVNode("div",sD,d.toDisplayString(u.value),1),d.createElementVNode("div",rD,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",aD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:k,value:C,isSegmentEmpty:A},O)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:k+O},[n.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",oD,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:v,"border-color":S})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:A}])},d.toDisplayString(k),3),d.createElementVNode("span",lD,d.toDisplayString(C),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-078294a6"]]),cD=["onClick"],uD=["title"],dD={class:"label truncate-label"},hD={key:0,class:"sub-label"},fD={class:"tooltip-content"},El=Ce(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.ref(),s=d.inject("showLegendValues",!1),r=d.inject("legendPosition",d.ref(we.Bottom)),a=(l=0,c)=>{if(t.chartInstance===null)return;const u=t.chartInstance instanceof ye?t.chartInstance:t.chartInstance.chart;o(l,c)?u.hide(l,c):u.show(l,c),u.update()},o=(l=0,c)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const u=t.chartInstance instanceof ye?t.chartInstance:t.chartInstance.chart,h=u.getDatasetMeta(l);return h.dataset||c===void 0?u.isDatasetVisible(l):!(h.data.length&&h.data[c].hidden)};return(l,c)=>{const u=d.resolveComponent("KTooltip");return d.unref(r)!==d.unref(we).Hidden?(d.openBlock(),d.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:"legend-container","data-testid":"legend"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.items,({fillStyle:h,strokeStyle:f,text:m,datasetIndex:g,index:_,value:x,isSegmentEmpty:v})=>(d.openBlock(),d.createElementBlock("li",{key:m,onClick:S=>a(g,_)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:h,"border-color":f})},null,4),d.createVNode(u,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!o(g,_)}]),title:x&&d.unref(s)?`${m}: ${x.formatted}`:m},[d.createElementVNode("div",dD,d.toDisplayString(m),1),x&&d.unref(s)?(d.openBlock(),d.createElementBlock("div",hD,d.toDisplayString(x.formatted),1)):d.createCommentVNode("",!0)],10,uD)]),_:2},[v?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",fD,d.toDisplayString(d.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,cD))),128))],512)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-1d512515"]]),Jt=[];for(let n=0;n<256;++n)Jt.push((n+256).toString(16).slice(1));function mD(n,t=0){return(Jt[n[t+0]]+Jt[n[t+1]]+Jt[n[t+2]]+Jt[n[t+3]]+"-"+Jt[n[t+4]]+Jt[n[t+5]]+"-"+Jt[n[t+6]]+Jt[n[t+7]]+"-"+Jt[n[t+8]]+Jt[n[t+9]]+"-"+Jt[n[t+10]]+Jt[n[t+11]]+Jt[n[t+12]]+Jt[n[t+13]]+Jt[n[t+14]]+Jt[n[t+15]]).toLowerCase()}let Ol;const gD=new Uint8Array(16);function pD(){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(gD)}const pm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pl(n,t,e){var s;if(pm.randomUUID&&!n)return pm.randomUUID();n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??pD();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,mD(i)}const ym=(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 bm{constructor(){P(this,"id","highlightPlugin");P(this,"_clickedElements");P(this,"_previousHoverOption");P(this,"_clicked",!1);P(this,"_pause",!1);P(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&ym(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,ym(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 yD=["id"],bD=["id"],_D={class:"axis-tooltip-content"},xD="100%",wD="100%",vD=20,MD=20,_m=6,SD=0,kD=10,DD=10,TD=1,CD=Ce(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}=mt.useI18n(),{translateUnit:i}=mt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),a=new bm,o=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:V},H)=>{var Q;const X=V.data,Z=(Q=X.labels)==null?void 0:Q.indexOf(H);return X.datasets.reduce((G,gt,vt)=>{if(V.isDatasetVisible(vt)){const rt=gt.data[Z];return isNaN(rt)?G:G+rt}else return G},0)},u=(V,H,X,Z)=>{const Q=Z==="horizontal";H===null&&(H=e.t("entityNoName"));const G={type:"label",yValue:rt=>Q?H:c(rt,H),xValue:rt=>Q?c(rt,H):H},gt={...G,position:Q?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>Q?0:-Math.abs(Z1()),content:rt=>ef(c(rt,H),X)},vt={...G,content:rt=>J1(c(rt,H),Q1(rt.chart,V)),position:Q?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:rt=>Q?K1(ef(c(rt,H),X)):0,color:Qh};return{[`${H}-value`]:gt,[`${H}-percent`]:vt}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=Pl(),g=Pl(),_=d.ref([]),x=d.inject("legendPosition",we.Bottom),v=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),S=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:A,tooltipAbsoluteTop:O}=mt.useTooltipAbsolutePosition(l,C),T=d.ref(0),p=()=>{var V;return t.annotations&&((V=t.chartData.labels)==null?void 0:V.reduce((H,X)=>Object.assign(H,u(t.chartData,X,S.value,t.orientation)),{}))},b={id:m,afterUpdate(V){T.value+=1,_.value=Uh(V,t.legendValues,t.chartLegendSortFn)}},M={id:g,afterUpdate(V){V.options.plugins.annotation.annotations=t.annotations?p():{}}},R=[b,{id:"axisHover",afterEvent(V,H){var X;if(v.show=!1,H.event.type==="mousemove"){const Z=H.event,Q=V.options.indexAxis,G=V.scales,gt=V.scales[Q].getLabelForValue(Number(V.scales[Q].getValueForPixel(Z[Q]))),rt=V.scales[Q].getLabels().indexOf(gt),bt=(X=t.chartData.isLabelEmpty)==null?void 0:X[rt];if((jt=>jt==="x"?Z.y>G.x.top:Z.x<G.y.right)(Q)){C.interactionMode!=="interactive"&&(C.showTooltip=!1);const ot=V.canvas.getContext("2d").measureText(gt).width,Mt=Math.abs(Math.round(Z.x-ot*.5)),te=Math.round(Z.x+ot*.5),oe=V.canvas.getBoundingClientRect(),Ut=40;v.left=Q==="x"?`${(Mt>0?Mt:te)-v.offset+oe.left}px`:`${Z.x-ot*.5-v.offset+oe.left}px`,v.top=`${Z.y-Ut+oe.top}px`,gt.length>qr?(v.show=!0,v.text=gt):bt?(v.text=e.t("emptyEntityInfo"),v.show=!0):v.show=!1}else v.show=!1}}},a,...t.annotations?[M]:[]],I=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),B=d.ref(0),U=d.ref(0),J=new ResizeObserver(jh(V=>{B.value=V[0].contentRect.width,U.value=V[0].contentRect.height},100)),$=d.computed(()=>{var H,X;const V=(X=(H=t.chartData)==null?void 0:H.labels)==null?void 0:X.length;return h.value&&V&&!k.value?`${Math.max(V*(vD+_m),B.value)}px`:xD}),lt=d.computed(()=>{var H,X;const V=(X=(H=t.chartData)==null?void 0:H.labels)==null?void 0:X.length;return h.value&&V&&k.value?`${Math.max(V*(MD+_m),U.value)}px`:wD});mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&ye.register(mm),o.value&&(B.value=o.value.offsetWidth,U.value=o.value.offsetHeight,J.observe(o.value))}),d.onUnmounted(()=>{o.value&&J.unobserve(o.value)});const q=d.computed(()=>{const V=mt.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:I});return{...V.value,plugins:{...V.value.plugins,annotation:{annotations:p(),clip:!1}}}}),K=mt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),R,q);d.onBeforeUnmount(()=>{ye.unregister(mm)});const z={[we.Bottom]:"column"},j=d.computed(()=>{if(f.value&&K.value){const V=window.devicePixelRatio,H=K.value,X=H.scales.y.width*V+TD,Z=(H.scales.y.height+H.scales.y.top+H.scales.x.height)*V,Q=f.value.getContext("2d");return Q.scale(V,V),Q.canvas.width=X,Q.canvas.height=Z,Q.canvas.style.width=`${X/V}px`,Q.canvas.style.height=`${Z/V}px`,{scale:V,width:X*V,height:Z*V,targetCtx:Q}}return null}),Y=V=>{const H=V.target;if(j.value&&K.value&&!k.value){const X=j.value.scale,Z=j.value.targetCtx,Q=j.value.width,G=j.value.height,gt=K.value,vt=gt.canvas;Z.fillStyle="white",H.scrollLeft>=SD&&H.scrollLeft<=kD?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,Q,G),Z.drawImage(vt,0,0,Q,G,0,0,Q,G),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,Q,G)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(gt.scales.y.height+gt.scales.y.top+DD)*X,Q,gt.scales.x.height*X))}C.offsetY=H.scrollTop,C.offsetX=H.scrollLeft,v.offset=H.scrollLeft},yt=({width:V,height:H})=>{C.width=V,C.height=H};d.watch(()=>t.orientation,()=>{var V;if(f.value&&j.value){const H=j.value.width,X=j.value.height;((V=f.value)==null?void 0:V.getContext("2d")).clearRect(0,0,H,X)}C.showTooltip=!1,C.interactionMode="idle"}),d.watch(()=>t.annotations,V=>{K.value&&(V?K.value.options.plugins.annotation.annotations=p(t.chartData):delete K.value.options.plugins.annotation.annotations)});const _t=()=>{C.showTooltip&&(C.interactionMode!=="idle"?C.interactionMode="idle":C.interactionMode="interactive")};return(V,H)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",z[d.unref(x)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,yD),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:H[0]||(H[0]=X=>_t()),onScroll:Y},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:$.value,height:lt.value})},[d.createElementVNode("canvas",{id:d.unref(r),ref:"canvas",class:"chart-canvas"},null,8,bD)],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",_D,d.toDisplayString(v.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(ua,{"absolute-left":d.unref(A),"absolute-top":d.unref(O),"chart-parent-ref":l.value,state:C,"tooltip-title":n.tooltipTitle,onDimensions:yt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(El,{id:d.unref(m),"chart-instance":d.unref(K),items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3fd2579c"]]);/*!
23
+ */const Yf={modes:{point(e,t){return ua(e,t,{intersect:!0})},nearest(e,t,n){return nM(e,t,n)},x(e,t,n){return ua(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return ua(e,t,{intersect:n.intersect,axis:"y"})}}};function kl(e,t,n){return(Yf.modes[n.mode]||Yf.modes.nearest)(e,t,n)}function tM(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function eM(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function ua(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):tM(i,t,n.axis))}function nM(e,t,n){let i=Number.POSITIVE_INFINITY;return ua(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),o=eM(t,a,n.axis),c=bi(t,o);return c<i?(r=[s],i=c):c===i&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function ri(e,t,n){const i=Math.cos(n),r=Math.sin(n),s=t.x,a=t.y;return{x:s+i*(e.x-s)-r*(e.y-a),y:a+r*(e.x-s)+i*(e.y-a)}}const iM=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,si=.001,da=(e,t,n)=>Math.min(n,Math.max(t,e)),jf=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function rM(e,t,n){for(const i of Object.keys(e))e[i]=da(e[i],t,n);return e}function sM(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function Uf(e,{x:t,y:n,x2:i,y2:r},s,{borderWidth:a,hitTolerance:o}){const c=(a+o)/2,l=e.x>=t-c-si&&e.x<=i+c+si,u=e.y>=n-c-si&&e.y<=r+c+si;return s==="x"?l:(s==="y"||l)&&u}function qf(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const o=ri(e,n,Wt(-r));return Uf(o,t,i,{borderWidth:s,hitTolerance:a})}function ai(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function aM(e,t,n,i=!0){const r=n.split(".");let s=0;for(const a of t.split(".")){const o=r[s++];if(parseInt(a,10)<parseInt(o,10))break;if(iM(o,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const Xf=e=>typeof e=="string"&&e.endsWith("%"),Gf=e=>parseFloat(e)/100,Kf=e=>da(Gf(e),0,1),jr=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),oM={box:e=>jr(e.centerX,e.centerY),doughnutLabel:e=>jr(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>jr(e.centerX,e.centerY),line:e=>jr(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>jr(e.centerX,e.centerY)};function Ml(e,t){return t==="start"?0:t==="end"?e:Xf(t)?Kf(t)*e:e/2}function Ln(e,t,n=!0){return typeof t=="number"?t:Xf(t)?(n?Kf(t):Gf(t))*e:e}function lM(e,t){const{x:n,width:i}=e,r=t.textAlign;return r==="center"?n+i/2:r==="end"||r==="right"?n+i:n}function Zf(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const o=ft(a),c=t.width+(o?a.width:0)+n,l=t.height+(o?a.height:0)+n,u=Tl(i),h=em(e.x,c,r,u.x),f=em(e.y,l,s,u.y);return{x:h,y:f,x2:h+c,y2:f+l,width:c,height:l,centerX:h+c/2,centerY:f+l/2}}function Tl(e,t="center"){return ft(e)?{x:rt(e.x,t),y:rt(e.y,t)}:(e=rt(e,t),{x:e,y:e})}const Qf=(e,t)=>e&&e.autoFit&&t<1;function Jf(e,t){const n=e.font,i=wt(n)?n:[n];return Qf(e,t)?i.map(function(r){const s=At(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,At(s)}):i.map(r=>At(r))}function tm(e){return e&&(pe(e.xValue)||pe(e.yValue))}function em(e,t,n=0,i){return e-Ml(t,i)+n}function Ii(e,t,n){const i=n.init;if(i){if(i===!0)return im(t,n)}else return;return cM(e,t,n)}function nm(e,t,n){let i=!1;return t.forEach(r=>{ye(e[r])?(i=!0,n[r]=e[r]):pe(n[r])&&delete n[r]}),i}function im(e,t){const n=t.type||"line";return oM[n](e)}function cM(e,t,n){const i=kt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return im(t,n);if(ft(i))return i}const Dl=new Map,uM=e=>isNaN(e)||e<=0,dM=e=>e.reduce(function(t,n){return t+=n.string,t},"");function ha(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function fa(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(Wt(i)),e.translate(-t,-n))}function dn(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function Li(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function ma(e,t){const n=t.content;if(ha(n))return{width:Ln(n.width,t.width),height:Ln(n.height,t.height)};const i=Jf(t),r=t.textStrokeWidth,s=wt(n)?n:[n],a=s.join()+dM(i)+r+(e._measureText?"-spriting":"");return Dl.has(a)||Dl.set(a,gM(e,s,i,r)),Dl.get(a)}function rm(e,t,n){const{x:i,y:r,width:s,height:a}=t;e.save(),Li(e,n);const o=dn(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),_i(e,{x:i,y:r,w:s,h:a,radius:rM(Dn(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),o&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function sm(e,t,n,i){const r=n.content;if(ha(r)){e.save(),e.globalAlpha=bM(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=wt(r)?r:[r],a=Jf(n,i),o=n.color,c=wt(o)?o:[o],l=lM(t,n),u=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,hM(e,n)&&pM(e,{x:l,y:u},s,a),yM(e,{x:l,y:u},s,{fonts:a,colors:c}),e.restore()}function hM(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function fM(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,o=s.rotation;let c=(o||0)*Ua;if(ha(a)){e.save(),e.translate(n,i),e.rotate(c),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}uM(r)||mM(e,{x:n,y:i,radius:r,rotation:o,style:a,rad:c})}function mM(e,{x:t,y:n,radius:i,rotation:r,style:s,rad:a}){let o,c,l,u;switch(e.beginPath(),s){default:e.arc(t,n,i,0,Ct),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=ms,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=ms,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),e.closePath();break;case"rectRounded":u=i*.516,l=i-u,o=Math.cos(a+Pe)*l,c=Math.sin(a+Pe)*l,e.arc(t-o,n-c,u,a-ut,a-Ot),e.arc(t+c,n-o,u,a-Ot,a),e.arc(t+o,n+c,u,a,a+Ot),e.arc(t-c,n+o,u,a+Ot,a+ut),e.closePath();break;case"rect":if(!r){l=Math.SQRT1_2*i,e.rect(t-l,n-l,2*l,2*l);break}a+=Pe;case"rectRot":o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+c,n-o),e.lineTo(t+o,n+c),e.lineTo(t-c,n+o),e.closePath();break;case"crossRot":a+=Pe;case"cross":o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+o,n+c),e.moveTo(t+c,n-o),e.lineTo(t-c,n+o);break;case"star":o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+o,n+c),e.moveTo(t+c,n-o),e.lineTo(t-c,n+o),a+=Pe,o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+o,n+c),e.moveTo(t+c,n-o),e.lineTo(t-c,n+o);break;case"line":o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+o,n+c);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i);break}e.fill()}function gM(e,t,n,i){e.save();const r=t.length;let s=0,a=i;for(let o=0;o<r;o++){const c=n[Math.min(o,n.length-1)];e.font=c.string;const l=t[o];s=Math.max(s,e.measureText(l).width+i),a+=c.lineHeight}return e.restore(),{width:s,height:a}}function pM(e,{x:t,y:n},i,r){e.beginPath();let s=0;i.forEach(function(a,o){const c=r[Math.min(o,r.length-1)],l=c.lineHeight;e.font=c.string,e.strokeText(a,t,n+l/2+s),s+=l}),e.stroke()}function yM(e,{x:t,y:n},i,{fonts:r,colors:s}){let a=0;i.forEach(function(o,c){const l=s[Math.min(c,s.length-1)],u=r[Math.min(c,r.length-1)],h=u.lineHeight;e.beginPath(),e.font=u.string,e.fillStyle=l,e.fillText(o,t,n+h/2+a),a+=h,e.fill()})}function bM(e,t){const n=Tn(e)?e:t;return Tn(n)?da(n,0,1):1}const am=["left","bottom","top","right"];function _M(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&kM(t,s);if(!a||TM(t,s,a))return;if(e.save(),e.beginPath(),!dn(e,s))return e.restore();const{separatorStart:c,separatorEnd:l}=xM(t,a),{sideStart:u,sideEnd:h}=vM(t,a,c);(s.margin>0||r.borderWidth===0)&&(e.moveTo(c.x,c.y),e.lineTo(l.x,l.y)),e.moveTo(u.x,u.y),e.lineTo(h.x,h.y);const f=ri({x:n,y:i},t.getCenterPoint(),Wt(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function xM(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=wM(e,t);let o,c;return t==="left"||t==="right"?(o={x:n+a,y:i},c={x:o.x,y:s}):(o={x:n,y:i+a},c={x:r,y:o.y}),{separatorStart:o,separatorEnd:c}}function wM(e,t){const{width:n,height:i,options:r}=e,s=r.callout.margin+r.borderWidth/2;return t==="right"?n+s:t==="bottom"?i+s:-s}function vM(e,t,n){const{y:i,width:r,height:s,options:a}=e,o=a.callout.start,c=SM(t,a.callout);let l,u;return t==="left"||t==="right"?(l={x:n.x,y:i+Ln(s,o)},u={x:l.x+c,y:l.y}):(l={x:n.x+Ln(r,o),y:n.y},u={x:l.x,y:l.y+c}),{sideStart:l,sideEnd:u}}function SM(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function kM(e,t){const n=t.position;return am.includes(n)?n:MM(e,t)}function MM(e,t){const{x:n,y:i,x2:r,y2:s,width:a,height:o,pointX:c,pointY:l,centerX:u,centerY:h,rotation:f}=e,m={x:u,y:h},g=t.start,y=Ln(a,g),x=Ln(o,g),v=[n,n+y,n+y,r],S=[i+x,s,i,s],k=[];for(let C=0;C<4;C++){const E=ri({x:v[C],y:S[C]},m,Wt(f));k.push({position:am[C],distance:bi(E,{x:c,y:l})})}return k.sort((C,E)=>C.distance-E.distance)[0].position}function TM(e,t,n){const{pointX:i,pointY:r}=e,s=t.margin;let a=i,o=r;return n==="left"?a+=s:n==="right"?a-=s:n==="top"?o+=s:n==="bottom"&&(o-=s),e.inRange(a,o)}const om={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 Ni(e,t,n){return t=typeof t=="number"?t:e.parse(t),Rt(t)?e.getPixelForValue(t):n}function oi(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const r=n.charAt(0),s=Object.values(e).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function lm(e,t){if(e){const n=e.options.reverse,i=Ni(e,t.min,n?t.end:t.start),r=Ni(e,t.max,n?t.start:t.end);return{start:i,end:r}}}function cm(e,t){const{chartArea:n,scales:i}=e,r=i[oi(i,t,"xScaleID")],s=i[oi(i,t,"yScaleID")];let a=n.width/2,o=n.height/2;return r&&(a=Ni(r,t.xValue,r.left+r.width/2)),s&&(o=Ni(s,t.yValue,s.top+s.height/2)),{x:a,y:o}}function Cl(e,t){const n=e.scales,i=n[oi(n,t,"xScaleID")],r=n[oi(n,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||e.chartArea,{top:o,bottom:c}=r||e.chartArea;const l=hm(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=l.start,a=l.end;const u=hm(r,{min:t.yMin,max:t.yMax,start:c,end:o});return o=u.start,c=u.end,{x:s,y:o,x2:a,y2:c,width:a-s,height:c-o,centerX:s+(a-s)/2,centerY:o+(c-o)/2}}function um(e,t){if(!tm(t)){const n=Cl(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const r=i*2,s=n.centerX+t.xAdjust,a=n.centerY+t.yAdjust;return{x:s-i,y:a-i,x2:s+i,y2:a+i,centerX:s,centerY:a,width:r,height:r,radius:i}}return CM(e,t)}function DM(e,t){const{scales:n,chartArea:i}=e,r=n[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?EM(r,s,t):OM(n,s,t),s}function dm(e,t){const n=Cl(e,t);return n.initProperties=Ii(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:AM(e,n,t),initProperties:n.initProperties}],n}function CM(e,t){const n=cm(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function hm(e,t){const n=lm(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function EM(e,t,n){const i=Ni(e,n.value,NaN),r=Ni(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function OM(e,t,n){for(const i of Object.keys(om)){const r=e[oi(e,n,i)];if(r){const{min:s,max:a,start:o,end:c,startProp:l,endProp:u}=om[i],h=lm(r,{min:n[s],max:n[a],start:r[o],end:r[c]});t[l]=h.start,t[u]=h.end}}}function PM({properties:e,options:t},n,i,r){const{x:s,x2:a,width:o}=e;return fm({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:n.width})}function RM({properties:e,options:t},n,i,r){const{y:s,y2:a,height:o}=e;return fm({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:n.height})}function fm(e,t){const{start:n,end:i,borderWidth:r}=e,{position:s,padding:{start:a,end:o},adjust:c}=t,l=i-r-n-a-o-t.size;return n+r/2+c+Ml(l,s)}function AM(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Tl(i.position),s=Yt(i.padding),a=ma(e.ctx,i),o=PM({properties:t,options:n},a,r,s),c=RM({properties:t,options:n},a,r,s),l=a.width+s.width,u=a.height+s.height;return{x:o,y:c,x2:o+l,y2:c+u,width:l,height:u,centerX:o+l/2,centerY:c+u/2,rotation:i.rotation}}const El=["enter","leave"],Ol=El.concat("click");function IM(e,t,n){t.listened=nm(n,Ol,t.listeners),t.moveListened=!1,El.forEach(i=>{ye(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&ye(i.click)&&(t.listened=!0),t.moveListened||El.forEach(r=>{ye(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function LM(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return NM(e,t,n);case"click":return FM(e,t,n)}}function NM(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=kl(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=mm(s,"leave",r,i);return mm(s,"enter",i,r)||a}function mm({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=gm(a.options[n]||e.listeners[n],a,t)||s);return s}function FM(e,t,n){const i=e.listeners,r=kl(e.visibleElements,t,n.interaction);let s;for(const a of r)s=gm(a.options.click||i.click,a,t)||s;return s}function gm(e,t,n){return kt(e,[t.$context,n])===!0}const ga=["afterDraw","beforeDraw"];function BM(e,t,n){const i=t.visibleElements;t.hooked=nm(n,ga,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ga.forEach(s=>{ye(r.options[s])&&(t.hooked=!0)})})}function pm(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return kt(i,[t.$context])}}function zM(e,t,n){const i=YM(e.scales,t,n);let r=ym(t,i,"min","suggestedMin");r=ym(t,i,"max","suggestedMax")||r,r&&ye(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function HM(e,t){for(const n of e)$M(n,t)}function ym(e,t,n,i){if(Rt(t[n])&&!VM(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function VM(e,t,n){return pe(e[t])||pe(e[n])}function $M(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=oi(t,e,n);i&&!t[i]&&WM(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function WM(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(pe(e[n+i]))return!0;return!1}function YM(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const o of n)o.scaleID===r?bm(o,t,["value","endValue"],a):oi(e,o,s)===r&&bm(o,t,[i+"Min",i+"Max",i+"Value"],a);return a}function bm(e,t,n,i){for(const r of n){const s=e[r];if(pe(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Fi extends Zt{inRange(t,n,i,r){const{x:s,y:a}=ri({x:t,y:n},this.getCenterPoint(r),Wt(-this.options.rotation));return Uf({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return ai(this,t)}draw(t){t.save(),fa(t,this.getCenterPoint(),this.options.rotation),rm(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return dm(t,n)}}Fi.id="boxAnnotation",Fi.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},Fi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Fi.descriptors={label:{_fallback:!0}};class pa extends Zt{inRange(t,n,i,r){return qf({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ai(this,t)}draw(t){const n=this.options;!n.display||!n.content||(KM(t,this),t.save(),fa(t,this.getCenterPoint(),this.rotation),sm(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=jM(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=qM(t,n,i);let o=ma(t.ctx,n);const c=XM(o,a);Qf(n,c)&&(o={width:o.width*c,height:o.height*c});const{position:l,xAdjust:u,yAdjust:h}=n,f=Zf(s,o,{borderWidth:0,position:l,xAdjust:u,yAdjust:h});return{initProperties:Ii(t,f,n),...f,...r,rotation:n.rotation,_fitRatio:c}}}pa.id="doughnutLabelAnnotation",pa.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},pa.defaultRoutes={};function jM(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof an&&UM(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function UM(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function qM({chartArea:e},t,n){const{left:i,top:r,right:s,bottom:a}=e,{innerRadius:o,offsetX:c,offsetY:l}=n.controller,u=(i+s)/2+c,h=(r+a)/2+l,f={left:Math.max(u-o,i),right:Math.min(u+o,s),top:Math.max(h-o,r),bottom:Math.min(h+o,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},g=t.spacing+t.borderWidth/2,y=o-g,x=m.y>h,v=x?r+g:a-g,S=GM(v,u,h,y);return{controllerMeta:{_centerX:u,_centerY:h,_radius:y,_counterclockwise:x,...S},point:m,radius:Math.min(o,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function XM({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function GM(e,t,n,i){const r=Math.pow(n-e,2),s=Math.pow(i,2),a=t*-2,o=Math.pow(t,2)+r-s,c=Math.pow(a,2)-4*o;if(c<=0)return{_startAngle:0,_endAngle:Ct};const l=(-a-Math.sqrt(c))/2,u=(-a+Math.sqrt(c))/2;return{_startAngle:ps({x:t,y:n},{x:l,y:e}).angle,_endAngle:ps({x:t,y:n},{x:u,y:e}).angle}}function KM(e,t){const{_centerX:n,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:o,options:c}=t;e.save();const l=dn(e,c);e.fillStyle=c.backgroundColor,e.beginPath(),e.arc(n,i,r,s,a,o),e.closePath(),e.fill(),l&&e.stroke(),e.restore()}class Ur extends Zt{inRange(t,n,i,r){return qf({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ai(this,t)}draw(t){const n=this.options,i=!pe(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),fa(t,this.getCenterPoint(),this.rotation),_M(t,this),rm(t,this,n),sm(t,ZM(this),n),t.restore())}resolveElementProperties(t,n){let i;if(tm(n))i=cm(t,n);else{const{centerX:o,centerY:c}=Cl(t,n);i={x:o,y:c}}const r=Yt(n.padding),s=ma(t.ctx,n),a=Zf(i,s,n,r);return{initProperties:Ii(t,a,n),pointX:i.x,pointY:i.y,...a,rotation:n.rotation}}}Ur.id="labelAnnotation",Ur.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},Ur.defaultRoutes={borderColor:"color"};function ZM({x:e,y:t,width:n,height:i,options:r}){const s=r.borderWidth/2,a=Yt(r.padding);return{x:e+a.left+s,y:t+a.top+s,width:n-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const Pl=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),Rl=(e,t,n)=>Pl(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,_m=(e,t,n)=>Pl(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,qr=e=>e*e,QM=(e,t,{x:n,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(n,r),end:Math.max(n,r),value:e},xm=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,Al=(e,t,n,i)=>({x:xm(e.x,t.x,n.x,i),y:xm(e.y,t.y,n.y,i)}),wm=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),vm=(e,t,n,i)=>-Math.atan2(wm(e.x,t.x,n.x,i),wm(e.y,t.y,n.y,i))+.5*ut;class Xr extends Zt{inRange(t,n,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:n},{path:o,ctx:c}=this;if(o){dn(c,this.options),c.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=n*u.currentDevicePixelRatio,m=c.isPointInStroke(o,h,f)||Il(this,a,r);return c.restore(),m}const l=qr(s);return nT(this,a,l,r)||Il(this,a,r)}return JM(this,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return ai(this,t)}draw(t){const{x:n,y:i,x2:r,y2:s,cp:a,options:o}=this;if(t.save(),!dn(t,o))return t.restore();Li(t,o);const c=Math.sqrt(Math.pow(r-n,2)+Math.pow(s-i,2));if(o.curve&&a)return uT(t,this,a,c),t.restore();const{startOpts:l,endOpts:u,startAdjust:h,endAdjust:f}=Dm(this),m=Math.atan2(s-i,r-n);t.translate(n,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(c-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),Ll(t,0,h,l),Ll(t,c,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=DM(t,n),{x:r,y:s,x2:a,y2:o}=i,c=tT(i,t.chartArea),l=c?eT({x:r,y:s},{x:a,y:o},t.chartArea):{x:r,y:s,x2:a,y2:o,width:Math.abs(a-r),height:Math.abs(o-s)};if(l.centerX=(a+r)/2,l.centerY=(o+s)/2,l.initProperties=Ii(t,l,n),n.curve){const h={x:l.x,y:l.y},f={x:l.x2,y:l.y2};l.cp=cT(l,n,bi(h,f))}const u=iT(t,l,n.label);return u._visible=c,l.elements=[{type:"label",optionScope:"label",properties:u,initProperties:l.initProperties}],l}}Xr.id="lineAnnotation";const Sm={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};Xr.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Sm),fill:!1,length:12,start:Object.assign({},Sm),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({},Ur.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},Xr.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Xr.defaultRoutes={borderColor:"color"};function JM(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=QM(t,n,e.getProps(["x","y","x2","y2"],s),i);return jf(a,r)||Il(e,{mouseX:t,mouseY:n},s,i)}function tT({x:e,y:t,x2:n,y2:i},{top:r,right:s,bottom:a,left:o}){return!(e<o&&n<o||e>s&&n>s||t<r&&i<r||t>a&&i>a)}function km({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=_m(a,{x:e,y:t},n),e=a),e>r&&(t=_m(r,{x:e,y:t},n),e=r),t<i&&(e=Rl(i,{x:e,y:t},n),t=i),t>s&&(e=Rl(s,{x:e,y:t},n),t=s),{x:e,y:t}}function eT(e,t,n){const{x:i,y:r}=km(e,t,n),{x:s,y:a}=km(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function nT(e,{mouseX:t,mouseY:n},i=si,r){const{x:s,y:a,x2:o,y2:c}=e.getProps(["x","y","x2","y2"],r),l=o-s,u=c-a,h=qr(l)+qr(u),f=h===0?-1:((t-s)*l+(n-a)*u)/h;let m,g;return f<0?(m=s,g=a):f>1?(m=o,g=c):(m=s+f*l,g=a+f*u),qr(t-m)+qr(n-g)<=i}function Il(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function iT(e,t,n){const i=n.borderWidth,r=Yt(n.padding),s=ma(e.ctx,n),a=s.width+r.width+i,o=s.height+r.height+i;return sT(t,n,{width:a,height:o,padding:r},e.chartArea)}function rT(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>ut/2?s-ut:s<ut/-2?s+ut:s}function sT(e,t,n,i){const{width:r,height:s,padding:a}=n,{xAdjust:o,yAdjust:c}=t,l={x:e.x,y:e.y},u={x:e.x2,y:e.y2},h=t.rotation==="auto"?rT(e):Wt(t.rotation),f=aT(r,s,h),m=oT(e,t,{labelSize:f,padding:a},i),g=e.cp?Al(l,e.cp,u,m):Pl(l,u,m),y={size:f.w,min:i.left,max:i.right,padding:a.left},x={size:f.h,min:i.top,max:i.bottom,padding:a.top},v=Tm(g.x,y)+o,S=Tm(g.y,x)+c;return{x:v-r/2,y:S-s/2,x2:v+r/2,y2:S+s/2,centerX:v,centerY:S,pointX:g.x,pointY:g.y,width:r,height:s,rotation:gs(h)}}function aT(e,t,n){const i=Math.cos(n),r=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*r),h:Math.abs(e*r)+Math.abs(t*i)}}function oT(e,t,n,i){let r;const s=lT(e,i);return t.position==="start"?r=Mm({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-Mm({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=Ml(1,t.position),r}function Mm(e,t,n,i){const{labelSize:r,padding:s}=t,a=e.w*i.dx,o=e.h*i.dy,c=a>0&&(r.w/2+s.left-i.x)/a,l=o>0&&(r.h/2+s.top-i.y)/o;return da(Math.max(c,l),0,.25)}function lT(e,t){const{x:n,x2:i,y:r,y2:s}=e,a=Math.min(r,s)-t.top,o=Math.min(n,i)-t.left,c=t.bottom-Math.max(r,s),l=t.right-Math.max(n,i);return{x:Math.min(o,l),y:Math.min(a,c),dx:o<=l?1:-1,dy:a<=c?1:-1}}function Tm(e,t){const{size:n,min:i,max:r,padding:s}=t,a=n/2;return n>r-i?(r+i)/2:(i>=e-s-a&&(e=i+s+a),r<=e+s+a&&(e=r-s-a),e)}function Dm(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:Cm(e,n),endAdjust:Cm(e,i)}}function Cm(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,r=e.options.borderWidth/2,s={x:n,y:i+r};return Math.abs(Rl(0,s,{x:0,y:r}))}function Ll(e,t,n,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:o,borderColor:c}=i,l=Math.abs(t-r)+n;e.beginPath(),Li(e,i),dn(e,i),e.moveTo(l,-s),e.lineTo(t+n,0),e.lineTo(l,s),a===!0?(e.fillStyle=o||c,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function cT(e,t,n){const{x:i,y:r,x2:s,y2:a,centerX:o,centerY:c}=e,l=Math.atan2(a-r,s-i),u=Tl(t.controlPoint,0),h={x:o+Ln(n,u.x,!1),y:c+Ln(n,u.y,!1)};return ri(h,{x:o,y:c},l)}function Em(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),Ll(e,0,-r,s),e.restore())}function uT(e,t,n,i){const{x:r,y:s,x2:a,y2:o,options:c}=t,{startOpts:l,endOpts:u,startAdjust:h,endAdjust:f}=Dm(t),m={x:r,y:s},g={x:a,y:o},y=vm(m,n,g,0),x=vm(m,n,g,1)-ut,v=Al(m,n,g,h/i),S=Al(m,n,g,1-f/i),k=new Path2D;e.beginPath(),k.moveTo(v.x,v.y),k.quadraticCurveTo(n.x,n.y,S.x,S.y),e.shadowColor=c.borderShadowColor,e.stroke(k),t.path=k,t.ctx=e,Em(e,v,{angle:y,adjust:h},l),Em(e,S,{angle:x,adjust:f},u)}class Gr extends Zt{inRange(t,n,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return dT({x:t,y:n},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:o,y:c,x2:l,y2:u}=this.getProps(["x","y","x2","y2"],r),h=i==="y"?{start:c,end:u}:{start:o,end:l},f=ri({x:t,y:n},this.getCenterPoint(r),Wt(-s));return f[i]>=h.start-a-si&&f[i]<=h.end+a+si}getCenterPoint(t){return ai(this,t)}draw(t){const{width:n,height:i,centerX:r,centerY:s,options:a}=this;t.save(),fa(t,this.getCenterPoint(),a.rotation),Li(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const o=dn(t,a);t.ellipse(r,s,i/2,n/2,ut/2,0,2*ut),t.fill(),o&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return dm(t,n)}}Gr.id="ellipseAnnotation",Gr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Fi.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},Gr.defaultRoutes={borderColor:"color",backgroundColor:"color"},Gr.descriptors={label:{_fallback:!0}};function dT(e,t,n,i){const{width:r,height:s,centerX:a,centerY:o}=t,c=r/2,l=s/2;if(c<=0||l<=0)return!1;const u=Wt(n||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(e.x-a)+f*(e.y-o),2),g=Math.pow(f*(e.x-a)-h*(e.y-o),2);return m/Math.pow(c+i,2)+g/Math.pow(l+i,2)<=1.0001}class ya extends Zt{inRange(t,n,i,r){const{x:s,y:a,x2:o,y2:c,width:l}=this.getProps(["x","y","x2","y2","width"],r),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?sM({x:t,y:n},this.getCenterPoint(r),l/2,u):jf(i==="y"?{start:a,end:c,value:n}:{start:s,end:o,value:t},u)}getCenterPoint(t){return ai(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,Li(t,n);const r=dn(t,n);fM(t,this,this.centerX,this.centerY),r&&!ha(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=um(t,n);return i.initProperties=Ii(t,i,n),i}}ya.id="pointAnnotation",ya.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},ya.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ba extends Zt{inRange(t,n,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&fT(this.elements,t,n,r);const s=ri({x:t,y:n},this.getCenterPoint(r),Wt(-this.options.rotation)),a=this.elements.map(l=>i==="y"?l.bY:l.bX),o=Math.min(...a),c=Math.max(...a);return s[i]>=o&&s[i]<=c}getCenterPoint(t){return ai(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Li(t,i);const r=dn(t,i);let s=!0;for(const a of n)s?(t.moveTo(a.x,a.y),s=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=um(t,n),{sides:r,rotation:s}=n,a=[],o=2*ut/r;let c=s*Ua;for(let l=0;l<r;l++,c+=o){const u=hT(i,n,c);u.initProperties=Ii(t,i,n),a.push(u)}return i.elements=a,i}}ba.id="polygonAnnotation",ba.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},ba.defaultRoutes={borderColor:"color",backgroundColor:"color"};function hT({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,o=Math.sin(s),c=Math.cos(s),l={x:e+o*n,y:t-c*n};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:e+o*(n+a),bY:t-c*(n+a)}}}function fT(e,t,n,i){let r=!1,s=e[e.length-1].getProps(["bX","bY"],i);for(const a of e){const o=a.getProps(["bX","bY"],i);o.bY>n!=s.bY>n&&t<(s.bX-o.bX)*(n-o.bY)/(s.bY-o.bY)+o.bX&&(r=!r),s=o}return r}const Nn={box:Fi,doughnutLabel:pa,ellipse:Gr,label:Ur,line:Xr,point:ya,polygon:ba};Object.keys(Nn).forEach(e=>{Pt.describe(`elements.${Nn[e].id}`,{_fallback:"plugins.annotation.common"})});const mT={update:Object.assign},gT=Ol.concat(ga),Om=(e,t)=>ft(t)?Bl(e,t):e,Nl=e=>e==="color"||e==="font";function Fl(e="line"){return Nn[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function pT(e,t,n,i){const r=bT(e,n.animations,i),s=t.annotations,a=wT(t.elements,s);for(let o=0;o<s.length;o++){const c=s[o],l=Pm(a,o,c.type),u=c.setContext(xT(e,l,a,c)),h=l.resolveElementProperties(e,u);h.skip=yT(h),"elements"in h&&(_T(l,h.elements,u,r),delete h.elements),pe(l.x)||Object.assign(l,h),Object.assign(l,h.initProperties),h.options=Rm(u),r.update(l,h)}}function yT(e){return isNaN(e.x)||isNaN(e.y)}function bT(e,t,n){return n==="reset"||n==="none"||n==="resize"?mT:new ao(e,t)}function _T(e,t,n,i){const r=e.elements||(e.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],o=a.properties,c=Pm(r,s,a.type,a.initProperties),l=n[a.optionScope].override(a);o.options=Rm(l),i.update(c,o)}}function Pm(e,t,n,i){const r=Nn[Fl(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function Rm(e){const t=Nn[Fl(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,Bl(e,t.defaults),Bl(e,t.defaultRoutes));for(const i of gT)n[i]=e[i];return n}function Bl(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];Nl(i)&&wt(s)?n[i]=s.map(a=>Om(a,r)):n[i]=Om(s,r)}return n}function xT(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function wT(e,t){const n=t.length,i=e.length;if(i<n){const r=n-i;e.splice(i,0,...new Array(r))}else i>n&&e.splice(n,i-n);return e}var vT="3.1.0";const Fn=new Map,Am=e=>e.type!=="doughnutLabel",ST=Ol.concat(ga);var Im={id:"annotation",version:vT,beforeRegister(){aM("chart.js","4.0",be.version)},afterRegister(){be.register(Nn)},afterUnregister(){be.unregister(Nn)},beforeInit(e){Fn.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=Fn.get(e),r=i.annotations=[];let s=n.annotations;ft(s)?Object.keys(s).forEach(a=>{const o=s[a];ft(o)&&(o.id=a,r.push(o))}):wt(s)&&r.push(...s),HM(r.filter(Am),e.scales)},afterDataLimits(e,t){const n=Fn.get(e);zM(e,t.scale,n.annotations.filter(Am).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=Fn.get(e);IM(e,i,n),pT(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),BM(e,i,n)},beforeDatasetsDraw(e,t,n){Kr(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Kr(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Kr(e,t.index,n.clip)},beforeDraw(e,t,n){Kr(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Kr(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=Fn.get(e);LM(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){Fn.delete(e)},getAnnotations(e){const t=Fn.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return kl(e,t,n)},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:e=>!ST.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${Nn[Fl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Nl,_fallback:!0},_indexable:Nl}},additionalOptionScopes:[""]};function Kr(e,t,n){const{ctx:i,chartArea:r}=e,s=Fn.get(e);n&&lr(i,r);const a=kT(s.visibleElements,t).sort((o,c)=>o.element.options.z-c.element.options.z);for(const o of a)MT(i,r,s,o);n&&cr(i)}function kT(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&n.push({element:r});return n}function MT(e,t,n,i){const r=i.element;i.main?(pm(n,r,"beforeDraw"),r.draw(e,t),pm(n,r,"afterDraw")):r.draw(e,t)}const TT={class:"zoom-timerange-container"},DT={class:"zoom-timerange-details"},CT={class:"label","data-testid":"zoom-timerange-from"},ET={class:"label","data-testid":"zoom-timerange-to"},OT=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.ref($r({tickValue:t.start,granularity:t.granularity})),r=d.ref($r({tickValue:t.end,granularity:t.granularity})),s=(a,o)=>{df(()=>{i.value=$r({tickValue:a,granularity:t.granularity}),r.value=$r({tickValue:o,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([a,o])=>{s(a,o)},{immediate:!0}),(a,o)=>(d.openBlock(),d.createElementBlock("div",TT,[d.createElementVNode("div",DT,[d.createElementVNode("div",CT,d.toDisplayString(d.unref(n).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",ET,d.toDisplayString(d.unref(n).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(r.value),1)])]))}}),Ee=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},Lm=Ee(OT,[["__scopeId","data-v-0e972e3c"]]),PT={class:"zoom-actions-container"},RT={class:"zoom-actions-heading"},AT={class:"zoom-action-select"},IT=["data-testid"],LT=["aria-disabled","href"],NT=["onClick"],FT=Ee(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,r=s=>{s.action&&(s.action(n.newTimeRange),i("onAction"))};return(s,a)=>(d.openBlock(),d.createElementBlock("div",PT,[d.createElementVNode("div",RT,[d.createVNode(Lm,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Jt.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(al),size:d.unref(zr),onClick:a[0]||(a[0]=o=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",AT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.zoomActionItems,o=>(d.openBlock(),d.createElementBlock("div",{key:o.key,class:d.normalizeClass(["zoom-action-item",{disabled:o.disabled}]),"data-testid":`zoom-action-item-${o.key}`},[o.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":o.disabled,class:"zoom-action-link",href:o.href,onClick:a[1]||(a[1]=c=>s.$emit("onAction"))},d.toDisplayString(o.label),9,LT)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:c=>r(o)},d.toDisplayString(o.label),9,NT))],10,IT))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),BT={key:2},zT={class:"tooltip-title"},HT={class:"title"},VT={key:0,class:"subtitle"},$T={class:"context"},WT={class:"metric"},YT={class:"tooltip"},jT={key:0},UT={class:"display-value"},_a=Ee(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(e,{emit:t}){const n=t,i=e,r=d.ref(null),{x:s,y:a,isDragging:o}=Uk(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),c=d.computed(()=>`${a.value}px`),l=d.computed(()=>`${s.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])=>{o.value||(s.value=parseFloat(m),a.value=parseFloat(g))}),d.watch(o,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(r,m=>{if(m){const{width:g,height:y}=m.getBoundingClientRect();n("dimensions",{width:g,height:y})}}),(m,g)=>{var y,x;return e.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:d.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${l.value}, ${c.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity?(d.openBlock(),d.createBlock(Lm,{key:0,end:(y=e.zoomTimeRange)==null?void 0:y.end,granularity:e.granularity,start:(x=e.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(d.openBlock(),d.createBlock(FT,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:g[0]||(g[0]=v=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",BT,[d.createElementVNode("div",zT,[d.createElementVNode("div",HT,[d.createElementVNode("div",null,d.toDisplayString(e.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Jt.DragIcon),{key:0,class:"drag-icon",color:d.unref(al),size:d.unref(zr)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",VT,[d.createElementVNode("div",$T,d.toDisplayString(u.value),1),d.createElementVNode("div",WT,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",YT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:k,value:C,isSegmentEmpty:E},P)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:k+P},[e.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",jT,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:v,"border-color":S})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:E}])},d.toDisplayString(k),3),d.createElementVNode("span",UT,d.toDisplayString(C),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-078294a6"]]),qT=["onClick"],XT=["title"],GT={class:"label truncate-label"},KT={key:0,class:"sub-label"},ZT={class:"tooltip-content"},zl=Ee(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.ref(),r=d.inject("showLegendValues",!1),s=d.inject("legendPosition",d.ref(ve.Bottom)),a=(c=0,l)=>{if(t.chartInstance===null)return;const u=t.chartInstance instanceof be?t.chartInstance:t.chartInstance.chart;o(c,l)?u.hide(c,l):u.show(c,l),u.update()},o=(c=0,l)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const u=t.chartInstance instanceof be?t.chartInstance:t.chartInstance.chart,h=u.getDatasetMeta(c);return h.dataset||l===void 0?u.isDatasetVisible(c):!(h.data.length&&h.data[l].hidden)};return(c,l)=>{const u=d.resolveComponent("KTooltip");return d.unref(s)!==d.unref(ve).Hidden?(d.openBlock(),d.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:"legend-container","data-testid":"legend"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.items,({fillStyle:h,strokeStyle:f,text:m,datasetIndex:g,index:y,value:x,isSegmentEmpty:v})=>(d.openBlock(),d.createElementBlock("li",{key:m,onClick:S=>a(g,y)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:h,"border-color":f})},null,4),d.createVNode(u,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!o(g,y)}]),title:x&&d.unref(r)?`${m}: ${x.formatted}`:m},[d.createElementVNode("div",GT,d.toDisplayString(m),1),x&&d.unref(r)?(d.openBlock(),d.createElementBlock("div",KT,d.toDisplayString(x.formatted),1)):d.createCommentVNode("",!0)],10,XT)]),_:2},[v?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",ZT,d.toDisplayString(d.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,qT))),128))],512)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-1d512515"]]),te=[];for(let e=0;e<256;++e)te.push((e+256).toString(16).slice(1));function QT(e,t=0){return(te[e[t+0]]+te[e[t+1]]+te[e[t+2]]+te[e[t+3]]+"-"+te[e[t+4]]+te[e[t+5]]+"-"+te[e[t+6]]+te[e[t+7]]+"-"+te[e[t+8]]+te[e[t+9]]+"-"+te[e[t+10]]+te[e[t+11]]+te[e[t+12]]+te[e[t+13]]+te[e[t+14]]+te[e[t+15]]).toLowerCase()}let Hl;const JT=new Uint8Array(16);function tD(){if(!Hl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Hl=crypto.getRandomValues.bind(crypto)}return Hl(JT)}const Nm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Vl(e,t,n){var r;if(Nm.randomUUID&&!e)return Nm.randomUUID();e=e||{};const i=e.random??((r=e.rng)==null?void 0:r.call(e))??tD();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,QT(i)}const Fm=(e,t)=>{const n=e.ctx,i=e.scales.y,r=e.scales.x,s=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):n.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),n.restore()};class Bm{constructor(){R(this,"id","highlightPlugin");R(this,"_clickedElements");R(this,"_previousHoverOption");R(this,"_clicked",!1);R(this,"_pause",!1);R(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Fm(t,this._clickedElements)}afterEvent(t,{event:n}){var s;if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=((s=t.options.interaction)==null?void 0:s.mode)||"index",r=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,Fm(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 eD=["id"],nD=["id"],iD={class:"axis-tooltip-content"},rD="100%",sD="100%",aD=20,oD=20,zm=6,lD=0,cD=10,uD=10,dD=1,hD=Ee(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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{i18n:n}=mt.useI18n(),{translateUnit:i}=mt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new Bm,o=d.useTemplateRef("chartContainer"),c=d.useTemplateRef("chartParent"),l=({chart:Y},H)=>{var J;const X=Y.data,Q=(J=X.labels)==null?void 0:J.indexOf(H);return X.datasets.reduce((K,gt,vt)=>{if(Y.isDatasetVisible(vt)){const st=gt.data[Q];return isNaN(st)?K:K+st}else return K},0)},u=(Y,H,X,Q)=>{const J=Q==="horizontal";H===null&&(H=n.t("entityNoName"));const K={type:"label",yValue:st=>J?H:l(st,H),xValue:st=>J?l(st,H):H},gt={...K,position:J?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>J?0:-Math.abs(LS()),content:st=>vf(l(st,H),X)},vt={...K,content:st=>FS(l(st,H),NS(st.chart,Y)),position:J?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:st=>J?IS(vf(l(st,H),X)):0,color:_f};return{[`${H}-value`]:gt,[`${H}-percent`]:vt}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=Vl(),g=Vl(),y=d.ref([]),x=d.inject("legendPosition",ve.Bottom),v=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),S=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:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:E,tooltipAbsoluteTop:P}=mt.useTooltipAbsolutePosition(c,C),T=d.ref(0),p=()=>{var Y;return t.annotations&&((Y=t.chartData.labels)==null?void 0:Y.reduce((H,X)=>Object.assign(H,u(t.chartData,X,S.value,t.orientation)),{}))},_={id:m,afterUpdate(Y){T.value+=1,y.value=hf(Y,t.legendValues,t.chartLegendSortFn)}},M={id:g,afterUpdate(Y){Y.options.plugins.annotation.annotations=t.annotations?p():{}}},A=[_,{id:"axisHover",afterEvent(Y,H){var X;if(v.show=!1,H.event.type==="mousemove"){const Q=H.event,J=Y.options.indexAxis,K=Y.scales,gt=Y.scales[J].getLabelForValue(Number(Y.scales[J].getValueForPixel(Q[J]))),st=Y.scales[J].getLabels().indexOf(gt),bt=(X=t.chartData.isLabelEmpty)==null?void 0:X[st];if((jt=>jt==="x"?Q.y>K.x.top:Q.x<K.y.right)(J)){C.interactionMode!=="interactive"&&(C.showTooltip=!1);const ot=Y.canvas.getContext("2d").measureText(gt).width,St=Math.abs(Math.round(Q.x-ot*.5)),ee=Math.round(Q.x+ot*.5),le=Y.canvas.getBoundingClientRect(),Ut=40;v.left=J==="x"?`${(St>0?St:ee)-v.offset+le.left}px`:`${Q.x-ot*.5-v.offset+le.left}px`,v.top=`${Q.y-Ut+le.top}px`,gt.length>na?(v.show=!0,v.text=gt):bt?(v.text=n.t("emptyEntityInfo"),v.show=!0):v.show=!1}else v.show=!1}}},a,...t.annotations?[M]:[]],I=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),B=d.ref(0),j=d.ref(0),G=new ResizeObserver(df(Y=>{B.value=Y[0].contentRect.width,j.value=Y[0].contentRect.height},100)),$=d.computed(()=>{var H,X;const Y=(X=(H=t.chartData)==null?void 0:H.labels)==null?void 0:X.length;return h.value&&Y&&!k.value?`${Math.max(Y*(aD+zm),B.value)}px`:rD}),lt=d.computed(()=>{var H,X;const Y=(X=(H=t.chartData)==null?void 0:H.labels)==null?void 0:X.length;return h.value&&Y&&k.value?`${Math.max(Y*(oD+zm),j.value)}px`:sD});mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&be.register(Im),o.value&&(B.value=o.value.offsetWidth,j.value=o.value.offsetHeight,G.observe(o.value))}),d.onUnmounted(()=>{o.value&&G.unobserve(o.value)});const q=d.computed(()=>{const Y=mt.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:I});return{...Y.value,plugins:{...Y.value.plugins,annotation:{annotations:p(),clip:!1}}}}),Z=mt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),A,q);d.onBeforeUnmount(()=>{be.unregister(Im)});const z={[ve.Bottom]:"column"},U=d.computed(()=>{if(f.value&&Z.value){const Y=window.devicePixelRatio,H=Z.value,X=H.scales.y.width*Y+dD,Q=(H.scales.y.height+H.scales.y.top+H.scales.x.height)*Y,J=f.value.getContext("2d");return J.scale(Y,Y),J.canvas.width=X,J.canvas.height=Q,J.canvas.style.width=`${X/Y}px`,J.canvas.style.height=`${Q/Y}px`,{scale:Y,width:X*Y,height:Q*Y,targetCtx:J}}return null}),W=Y=>{const H=Y.target;if(U.value&&Z.value&&!k.value){const X=U.value.scale,Q=U.value.targetCtx,J=U.value.width,K=U.value.height,gt=Z.value,vt=gt.canvas;Q.fillStyle="white",H.scrollLeft>=lD&&H.scrollLeft<=cD?(Q.globalCompositeOperation="source-over",Q.clearRect(0,0,J,K),Q.drawImage(vt,0,0,J,K,0,0,J,K),Q.globalCompositeOperation="destination-over",Q.fillRect(0,0,J,K)):(Q.globalCompositeOperation="source-over",Q.fillRect(0,(gt.scales.y.height+gt.scales.y.top+uD)*X,J,gt.scales.x.height*X))}C.offsetY=H.scrollTop,C.offsetX=H.scrollLeft,v.offset=H.scrollLeft},yt=({width:Y,height:H})=>{C.width=Y,C.height=H};d.watch(()=>t.orientation,()=>{var Y;if(f.value&&U.value){const H=U.value.width,X=U.value.height;((Y=f.value)==null?void 0:Y.getContext("2d")).clearRect(0,0,H,X)}C.showTooltip=!1,C.interactionMode="idle"}),d.watch(()=>t.annotations,Y=>{Z.value&&(Y?Z.value.options.plugins.annotation.annotations=p(t.chartData):delete Z.value.options.plugins.annotation.annotations)});const _t=()=>{C.showTooltip&&(C.interactionMode!=="idle"?C.interactionMode="idle":C.interactionMode="interactive")};return(Y,H)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",z[d.unref(x)]])},[d.createElementVNode("canvas",{id:d.unref(r),ref:"axis",class:"axis"},null,8,eD),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:H[0]||(H[0]=X=>_t()),onScroll:W},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:$.value,height:lt.value})},[d.createElementVNode("canvas",{id:d.unref(s),ref:"canvas",class:"chart-canvas"},null,8,nD)],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",iD,d.toDisplayString(v.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(_a,{"absolute-left":d.unref(E),"absolute-top":d.unref(P),"chart-parent-ref":c.value,state:C,"tooltip-title":e.tooltipTitle,onDimensions:yt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(zl,{id:d.unref(m),"chart-instance":d.unref(Z),items:y.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3fd2579c"]]);/*!
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 ED={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"};Su._date.override({_id:"date-fns",formats:function(){return ED},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=ct(n):e==="string"&&(typeof t=="string"?n=ew(n,t,new Date,this.options):n=oh(n,this.options)),Do(n)?n.getTime():null},format:function(n,t){return Fr(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return So(n,t);case"second":return K0(n,t);case"minute":return X0(n,t);case"hour":return j0(n,t);case"day":return Lr(n,t);case"week":return Z0(n,t);case"month":return Mo(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 To(n,t);case"second":return a_(n,t);case"minute":return i_(n,t);case"hour":return n_(n,t);case"day":return Hd(n,t);case"week":return o_(n,t);case"month":return $d(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 ko(n);case"week":return $e(n);case"isoWeek":return $e(n,{weekStartsOn:+e});case"month":return u_(n);case"quarter":return c_(n);case"year":return jd(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 Yd(n);case"week":return f_(n);case"month":return Vd(n);case"quarter":return g_(n);case"year":return d_(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}},OD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...xm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},PD=d.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ri(n){return d.isProxy(n)?d.toRaw(n):n}function AD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return d.isProxy(t)?new Proxy(n,{}):n}function RD(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(a=>a[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function ID(n,t){const e={labels:[],datasets:[]};return wm(e,n.labels),vm(e,n.datasets,t),e}const LD=d.defineComponent({props:OD,setup(n,t){let{expose:e,slots:i}=t;const s=d.ref(null),r=d.shallowRef(null);e({chart:r});const a=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=n,g=ID(u,m),_=AD(g,u);r.value=new ye(s.value,{type:c,data:_,options:{...h},plugins:f})},o=()=>{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(a),d.onUnmounted(o),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 v=Ri(h),S=Ri(m);v&&v!==S&&(RD(_,v),x=!0)}if(f){const v=Ri(f.labels),S=Ri(g.labels),k=Ri(f.datasets),C=Ri(g.datasets);v!==S&&(wm(_.config.data,v),x=!0),k&&k!==C&&(vm(_.config.data,k,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 Al(n,t){return ye.register(t),d.defineComponent({props:xm,setup(e,i){let{expose:s}=i;const r=d.shallowRef(null),a=o=>{r.value=o==null?void 0:o.chart};return s({chart:r}),()=>d.h(LD,PD({ref:a},{type:n,...e}))}})}const Mm=Al("bar",is),Sm=Al("doughnut",nn),km=Al("line",ss),ND={class:"chart-container"},FD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:we.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>on},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=mt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=d.ref([]),a=d.useTemplateRef("chartParent"),o=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}=mt.useTooltipAbsolutePosition(a,o),u={id:i,afterUpdate(S){r.value=S.options.plugins.legend.labels.generateLabels(S).map(k=>({...k,value:t.legendValues&&t.legendValues[k.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((k,C)=>(k.labels.push(C.label),k.backgroundColor.push(C.backgroundColor),k.borderColor.push(Zh(C.backgroundColor,50)),k.data.push(C.data.reduce((A,O)=>A+O,0)),k),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=mt.useDonutChartOptions({tooltipState:o,legendID:i}),_=d.ref(),x=S=>({[we.Bottom]:"column",[we.Hidden]:"hidden"})[S],v=({width:S,height:k})=>{o.width=S,o.height=k};return(S,k)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(n.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",ND,[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(ua,{"absolute-left":d.unref(l),"absolute-top":d.unref(c),state:o,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:v},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(El,{id:d.unref(i),"chart-instance":_.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),BD=Ce(FD,[["__scopeId","data-v-9503582a"]]),Rl=(n,t,e,i,s="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=s,n.stroke(),n.restore()},fe={},zD=()=>{fe.x=void 0,fe.chart=void 0,fe.strategy=void 0,fe.group=void 0},HD=10;class Dm{constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){P(this,"id","verticalLinePlugin");P(this,"_clickedSegment");P(this,"_pause",!1);P(this,"_useBrushingState",!1);P(this,"_brushStrategy");P(this,"_brushGroup");P(this,"_lastMouseBrushEvent",0);let s=!1;e==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<HD)return;const s=()=>{fe.chart=e,fe.strategy=this._brushStrategy,fe.group=this._brushGroup;for(const r of Object.values(ye.instances))r!==e&&r.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(fe.x=e.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(fe.x=void 0,s()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:s}=this._clickedSegment.element;Rl(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:s}=t.tooltip.dataPoints[0].element;Rl(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(fe.x===void 0)return;const e=fe.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&fe.group===this._brushGroup&&Rl(t.ctx,fe.x,t.scales.y.top,t.scales.y.bottom,e)}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(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&fe.chart===t){const e=fe.x!==void 0;if(zD(),e)for(const i of Object.values(ye.instances))i!==t&&i.update("none")}}}const WD=(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()},YD=(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()},Tm=(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 VD{constructor(){P(this,"id","dragSelectPlugin");P(this,"_isDragging",!1);P(this,"_startX",0);P(this,"_endX",0);P(this,"_dragTimeout");P(this,"_clearSelectionArea",!0);P(this,"_chart",null);P(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=o=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=o.clientX-l.left},150)},r=o=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=o.clientX-l.left,Tm("dragSelectMove",t,this))},a=o=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=o.clientX-l.left,Tm("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:a}}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)&&(YD(t,this._startX,this._endX),WD(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const $D=["hidden","single","full"];var ii=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ii||{});const jD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],UD=["gauge","top_n","single_value"],qD=20,XD="rgba(255, 171, 171, 0.4)",GD="rgba(255, 196, 0, 0.2)",Cm=(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)},KD=(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(a=>a.highlightIntersections).forEach(a=>{const o=r.map(c=>({ts:c.x,aboveThreshold:c.y>=a.value}));let l=o[0].aboveThreshold?r[0].x:void 0;for(let c=1;c<o.length;c++)!o[c-1].aboveThreshold&&o[c].aboveThreshold?l=Cm(r[c-1],r[c],a.value):o[c-1].aboveThreshold&&!o[c].aboveThreshold&&l!==void 0&&(e.push({start:l,end:Cm(r[c-1],r[c],a.value),type:a.type}),l=void 0);l!==void 0&&e.push({start:l,end:o[o.length-1].ts,type:a.type})})}),e},ZD=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){P(this,"id","thresholdPlugin");P(this,"_thresholds");P(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(a=>({...a,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=a=>{var o;if(t){const l=a.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=(o=this._thresholds)==null?void 0:o[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<qD})}}};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 a=(s=this._thresholds)==null?void 0:s[r];if(a){a.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=Gr(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=Gr(c.type),i.font=H1,i.fillText(f,t.chartArea.left,h-4),i.restore())});const o=KD(t,a);ZD(o).forEach(c=>{const u=t.scales.x.getPixelForValue(c.start),h=t.scales.x.getPixelForValue(c.end);i.save(),i.fillStyle=c.type==="error"?XD:GD,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=Gr(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const JD=Ce(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}=mt.useI18n(),r=new Dm,a=new bm,o=new VD,l=new QD(s),{translateUnit:c}=mt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),_=d.inject("legendPosition",we.Bottom),x=d.useTemplateRef("chartParent"),v=d.ref(void 0),S=d.ref(!1),k=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:C,tooltipAbsoluteTop:A}=mt.useTooltipAbsolutePosition(x,k),O={id:h,afterUpdate(z){m.value=Uh(z,e.legendValues,e.chartLegendSortFn)}},T=d.computed(()=>[O,a,...e.brush?[o]:[],...e.type==="timeseries_line"?[r]:[],...e.threshold?[l]:[]]),p=d.computed(()=>`line-${T.value.map(z=>z.id).join("-")}`),b=d.computed(()=>`bar-${T.value.map(z=>z.id).join("-")}`),M=d.computed(()=>e.chartData&&A1(e.chartData)),{options:E}=mt.useLineChartOptions({tooltipState:k,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:M,threshold:d.toRef(e,"threshold")});mt.useReportChartDataForSynthetics(d.toRef(e,"chartData"),d.toRef(e,"syntheticsDataKey"));const R=z=>({[we.Bottom]:"column",[we.Hidden]:"hidden"})[z],I=({width:z,height:j})=>{k.width=z,k.height=j},B=(z=!0)=>{k.interactionMode="idle",k.showTooltip=!1,o.clearSelectionArea(),a.isPaused&&a.resume(z),r.isPaused&&r.resume()},U=()=>{k.interactionMode="interactive"},J=()=>{var z,j;!u.value||!((j=(z=u.value.chart.tooltip)==null?void 0:z.dataPoints)!=null&&j.length)||(k.interactionMode==="interactive"?r.clickedSegment=u.value.chart.tooltip.dataPoints[0]:r.destroyClickedSegment())},$=()=>{if(S.value){S.value=!1;return}k.interactionMode!=="idle"?B():U(),J()};d.watch(()=>e.type,()=>{k.interactionMode="idle",k.showTooltip=!1,r.destroyClickedSegment()});const lt=z=>{z.preventDefault(),z.stopPropagation();const{xStart:j,xEnd:Y}=z.detail;j&&Y&&(v.value={start:new Date(j),end:new Date(Y),type:"absolute"},k.interactionMode="zoom-interactive",i("select-chart-range",v.value))},q=z=>{k.interactionMode="selecting-chart-area",S.value=!0,r.pause(),a.pause();const{xStart:j,xEnd:Y}=z.detail;j&&Y&&(v.value={start:new Date(j),end:new Date(Y),type:"absolute"})},K=z=>{if(!x.value||k.interactionMode==="idle")return;const j=z.target;j&&x.value.contains(j)||S.value||B(!1)};return d.watch(()=>{var z;return(z=u.value)==null?void 0:z.chart},()=>{var z;(z=u.value)!=null&&z.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",q),u.value.chart.canvas.addEventListener("dragSelect",lt),u.value.chart.canvas.addEventListener("dragSelectMove",q))}),d.onMounted(()=>{document.addEventListener("click",K,!0)}),d.onUnmounted(()=>{var z;(z=u.value)!=null&&z.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",q)),document.removeEventListener("click",K,!0)}),(z,j)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",R(d.unref(_))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:j[0]||(j[0]=Y=>$())},[n.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(km),{key:p.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:d.unref(E),plugins:T.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Mm),{key:b.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:d.unref(E),plugins:T.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(ua,{ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(C),"absolute-top":d.unref(A),"data-testid":"tooltip",granularity:n.granularity,state:k,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":v.value,onDimensions:I,onOnAction:j[1]||(j[1]=()=>B(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(El,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-0a32a7ca"]]),tT={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},eT={class:"tooltip-content"},nT={key:2,class:"analytics-chart-parent"},iT=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:we.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},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}=mt.useI18n(),r=d.computed(()=>_.value?mt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Kr},d.toRef(i,"chartData")).value:mt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Kr},d.toRef(i,"chartData")).value),a=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),o=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!==we.Hidden),{legendValues:u}=mt.useChartLegendValues(r,i.chartOptions.type,l),h=d.computed(()=>{var I,B,U;return((U=(B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.limit)==null?void 0:U.toString())||null}),f=d.computed(()=>{var I,B;return i.chartOptions.hideTruncationWarning?!1:((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)),_=d.computed(()=>["timeseries_bar","timeseries_line"].some(I=>I===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),v=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),S=d.computed(()=>{var U,J;if(!((U=i.chartData)!=null&&U.meta.metric_names)||!((J=i.chartData)!=null&&J.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}),k=d.computed(()=>{var U,J,$,lt;if((U=i.chartOptions)!=null&&U.metricAxesTitle)return(J=i.chartOptions)==null?void 0:J.metricAxesTitle;if(!(($=i.chartData)!=null&&$.meta.metric_names)||!((lt=i.chartData)!=null&&lt.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}),C=d.computed(()=>{var B;if((B=i.chartOptions)!=null&&B.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const I=_.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}),A=d.computed(()=>{const I=jo(Number(i.chartData.meta.granularity_ms));if(I)return s.te(`granularityAxisTitles.${I}`)?s.t(`granularityAxisTitles.${I}`):I}),O=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),T=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),p=d.computed(()=>_.value?R1(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),b=d.computed(()=>i.chartData.meta.granularity_ms?jo(i.chartData.meta.granularity_ms)||"hourly":jo(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),M=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),E=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),R=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 U=d.resolveComponent("KTooltip"),J=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["analytics-chart-shell",{"show-values":c.value}])},[p.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",tT,[d.createVNode(U,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",eT,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Qs.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(F1)})`,size:d.unref(z1)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),p.value?(d.openBlock(),d.createElementBlock("div",nT,[_.value?(d.openBlock(),d.createBlock(JD,{key:0,brush:a.value,"chart-data":r.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":E.value,"dimension-axes-title":A.value,fill:n.chartOptions.stacked,granularity:b.value,"legend-values":d.unref(u),"metric-axes-title":k.value,"metric-unit":l.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.chartOptions.threshold,"time-range-ms":o.value,"tooltip-metric-display":S.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":R.value,onSelectChartRange:B[0]||(B[0]=$=>e("select-chart-range",$)),onZoomTimeRange:B[1]||(B[1]=$=>e("zoom-time-range",$))},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(CD,{key:1,annotations:n.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":E.value,"data-testid":"bar-chart-container","dimension-axes-title":C.value,"legend-values":d.unref(u),"metric-axes-title":k.value,"metric-unit":l.value,orientation:v.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":S.value,"tooltip-title":n.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(BD,{key:2,"chart-data":r.value,"dataset-colors":n.chartOptions.chartDatasetColors||d.unref(Kr),"legend-position":n.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":C.value,"tooltip-metric-display":S.value,"tooltip-title":n.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(J,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(O.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(T.value),1)]),_:1}))],2)}}}),sT=Ce(iT,[["__scopeId","data-v-b2eeb763"]]),rT={class:"chart-parent","data-testid":"gauge-chart-parent"},aT={class:"chart-totals-flex"},oT={key:1,class:"metric-small","data-testid":"gauge-chart-total"},lT=Ce(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:on},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}=mt.useI18n(),i=d.ref(Pl()),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,v)=>x+v,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=d.computed(()=>({...t.chartData,datasets:s.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=d.ref(),l=d.computed(()=>{var m;return Qr((m=s==null?void 0:s.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),c=d.computed(()=>{var m,g;return Qr(((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",rT,[d.createElementVNode("div",aT,[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",oT,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:o,"chart-id":i.value,data:r.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]),cT={class:"chart-parent","data-testid":"single-value-parent"},uT={key:1,class:"single-value-wrapper"},dT={class:"single-value","data-testid":"single-value-chart"},hT={key:0,class:"single-value-unit"},fT=Ce(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:xf}},setup(n){const{i18n:t}=mt.useI18n(),{formatBytes:e}=ki({i18n:t}),i=n,s=d.computed(()=>i.data.data[0]),r=d.computed(()=>{var u,h;return(h=(u=i.data.meta)==null?void 0:u.metric_names)==null?void 0:h[0]}),a=d.computed(()=>{var h,f;const u=r.value?(f=(h=i.data.meta)==null?void 0:h.metric_units)==null?void 0:f[r.value]:void 0;if(u)return t.t(`chartUnits.${u}`,{plural:""})}),o=d.computed(()=>{var u;return r.value==="request_per_minute"||!!((u=r.value)!=null&&u.includes("_latency_"))}),l=d.computed(()=>!s.value||!r.value||typeof s.value.event[r.value]!="number"?null:s.value.event[r.value]),c=d.computed(()=>{var f;const u=l.value;if(u===null)return"";if((f=r.value)!=null&&f.includes("_size_"))return e(u);if(u>=1e9){const m=(u/1e9).toFixed(1);return m.endsWith(".0")?`${Math.floor(u/1e9)}B`:`${m}B`}if(u>=1e7){const m=(u/1e6).toFixed(1);return m.endsWith(".0")?`${Math.floor(u/1e6)}M`:`${m}M`}const h=i.decimalPoints&&typeof i.decimalPoints=="number"?i.decimalPoints:xf;return u.toLocaleString("en-US",{maximumFractionDigits:h})});return d.onMounted(()=>{var u,h;((h=(u=i.data)==null?void 0:u.data)==null?void 0:h.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",i.data.data.length)}),(u,h)=>{const f=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",cT,[l.value===null?(d.openBlock(),d.createBlock(f,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t).t("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",uT,[d.createElementVNode("span",dT,d.toDisplayString(c.value),1),o.value?(d.openBlock(),d.createElementBlock("span",hT,"  "+d.toDisplayString(a.value),1)):d.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-8fd9e5ef"]]),mT={class:"simple-chart-shell"},gT={key:1,class:"analytics-chart-parent"},pT=Ce(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}=mt.useI18n(),i=d.computed(()=>{var u;const c=mt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},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"),a=d.computed(()=>t.chartOptions.type==="single_value"),o=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(a.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",mT,[l.value?(d.openBlock(),d.createElementBlock("div",gT,[r.value?(d.openBlock(),d.createBlock(lT,{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),a.value?(d.openBlock(),d.createBlock(fT,{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(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),yT={class:"top-n-card-title","data-testid":"top-n-card-title"},bT={class:"top-n-card-description","data-testid":"top-n-card-description"},_T={key:3,class:"top-n-table","data-testid":"top-n-table"},xT={class:"top-n-table-table"},wT={"data-testid":"top-n-table-header"},vT={class:"top-n-table-header-row"},MT={class:"table-header-label"},ST={class:"top-n-table-cell top-n-table-cell--name"},kT=["data-testid"],DT=["data-testid"],TT=["data-testid"],CT=Ce(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}=mt.useI18n(),{formatUnit:i}=ki({i18n:e}),s=d.computed(()=>t.data.data),r=d.computed(()=>{var O;return!!((O=s.value)!=null&&O.length)}),a=d.computed(()=>{var O,T;return(O=t.data.meta)!=null&&O.display&&((T=Object.keys(t.data.meta.display))==null?void 0:T[0])||""}),o=d.computed(()=>a.value?t.data.meta.display[a.value]:{}),l=d.computed(()=>{var O,T;return(T=(O=t.data.meta)==null?void 0:O.metric_names)!=null&&T.length?t.data.meta.metric_names:[]}),c=d.computed(()=>l.value[0]),u=d.computed(()=>c.value?e.t(`chartLabels.${c.value}`)||c.value:""),h=d.computed(()=>{const O=[{key:"name",label:e.t("topNTable.nameLabel")}];return c.value&&O.push({key:"value",label:u.value}),l.value.forEach((T,p)=>{if(p===0)return;const b=e.t(`chartLabels.${T}`)||T;O.push({key:T,label:b})}),O}),f=d.computed(()=>h.value.filter(O=>O.key!=="name")),m=O=>{const T=O.event;return String(T[a.value])},g=O=>{const T=m(O),p=o.value&&o.value[T];return p?p.name:"-"},_=O=>{const T=m(O),p=o.value&&o.value[T];return p?!!p.deleted:!1},x=(O,T)=>{var R,I;const p=O.event[T];if(p==null)return"–";const b=typeof p=="number"?p:Number(p);if(Number.isNaN(b))return"–";const M=((I=(R=t.data.meta)==null?void 0:R.metric_units)==null?void 0:I[T])||"count",E=["count","count/minute","token count"].includes(M);return i(b,M,{approximate:E,isBytes1024:!0,translateUnit:B=>A(B,b)})},v=O=>c.value?x(O,c.value):"–",S=d.computed(()=>{var O;return(O=s.value)!=null&&O.length?s.value.map(T=>{const b={id:m(T),name:g(T),deleted:_(T),original:T};return c.value&&(b.value=v(T)),l.value.forEach((M,E)=>{E!==0&&(b[M]=x(T,M))}),b}):[]}),k=d.computed(()=>{if(!r.value)return"";if(t.data.meta){if(a.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!c.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),C=(O,T)=>{const p=O[T];return typeof p=="string"?p:p==null?"–":String(p)},A=(O,T)=>{if(O==="count"||O==="requests")return"";const p=T===1?"":"s";return e.te(`chartUnits.${O}`)?e.t(`chartUnits.${O}`,{plural:p}):O};return(O,T)=>{const p=d.resolveComponent("KEmptyState"),b=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},d.createSlots({default:d.withCtx(()=>[k.value?(d.openBlock(),d.createBlock(p,{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(k.value),1)]),_:1})):n.isLoading?(d.openBlock(),d.createBlock(b,{key:1,"table-columns":2,type:"table"})):r.value?(d.openBlock(),d.createElementBlock("div",_T,[d.createElementVNode("table",xT,[d.createElementVNode("thead",wT,[d.createElementVNode("tr",vT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(h.value,E=>(d.openBlock(),d.createElementBlock("th",{key:E.key,class:d.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":E.key!=="name"}]),"data-testid":"top-n-table-header-column"},[d.createElementVNode("span",MT,d.toDisplayString(E.label),1)],2))),128))])]),d.createElementVNode("tbody",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(S.value,E=>(d.openBlock(),d.createElementBlock("tr",{key:E.id,class:"top-n-table-row"},[d.createElementVNode("td",ST,[d.createElementVNode("span",{"data-testid":`row-${E.id}`},[d.renderSlot(O.$slots,"name",{record:{id:E.id,name:E.name,deleted:E.deleted,dimension:a.value}},()=>[d.createTextVNode(d.toDisplayString(E.name),1)],!0)],8,kT)]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,R=>(d.openBlock(),d.createElementBlock("td",{key:R.key,class:"top-n-table-cell top-n-table-cell-metric"},[R.key==="value"?(d.openBlock(),d.createElementBlock("span",{key:0,"data-testid":`row-${E.id}`},d.toDisplayString(C(E,R.key)),9,DT)):(d.openBlock(),d.createElementBlock("span",{key:1,"data-testid":`row-${E.id}-${R.key}`},d.toDisplayString(C(E,R.key)),9,TT))]))),128))]))),128))])])])):(d.openBlock(),d.createBlock(p,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(n.emptyStateTitle||d.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",yT,d.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",bT,d.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-27e5b22c"]]);var da={exports:{}};da.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,a=2,o=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]",v="[object Object]",S="[object Promise]",k="[object RegExp]",C="[object Set]",A="[object String]",O="[object Symbol]",T="[object WeakMap]",p="[object ArrayBuffer]",b="[object DataView]",M="[object Float32Array]",E="[object Float64Array]",R="[object Int8Array]",I="[object Int16Array]",B="[object Int32Array]",U="[object Uint8Array]",J="[object Uint8ClampedArray]",$="[object Uint16Array]",lt="[object Uint32Array]",q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/,z=/^\./,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,yt=/\\(\\)?/g,_t=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,H={};H[M]=H[E]=H[R]=H[I]=H[B]=H[U]=H[J]=H[$]=H[lt]=!0,H[l]=H[c]=H[p]=H[u]=H[b]=H[h]=H[f]=H[m]=H[_]=H[x]=H[v]=H[k]=H[C]=H[A]=H[T]=!1;var X=typeof xe=="object"&&xe&&xe.Object===Object&&xe,Z=typeof self=="object"&&self&&self.Object===Object&&self,Q=X||Z||Function("return this")(),G=t&&!t.nodeType&&t,gt=G&&!0&&n&&!n.nodeType&&n,vt=gt&&gt.exports===G,rt=vt&&X.process,bt=function(){try{return rt&&rt.binding("util")}catch{}}(),dt=bt&&bt.isTypedArray;function jt(y,D){for(var N=-1,W=y?y.length:0;++N<W;)if(D(y[N],N,y))return!0;return!1}function ot(y){return function(D){return D==null?void 0:D[y]}}function Mt(y,D){for(var N=-1,W=Array(y);++N<y;)W[N]=D(N);return W}function te(y){return function(D){return y(D)}}function oe(y,D){return y==null?void 0:y[D]}function Ut(y){var D=!1;if(y!=null&&typeof y.toString!="function")try{D=!!(y+"")}catch{}return D}function qe(y){var D=-1,N=Array(y.size);return y.forEach(function(W,ht){N[++D]=[ht,W]}),N}function Et(y,D){return function(N){return y(D(N))}}function ee(y){var D=-1,N=Array(y.size);return y.forEach(function(W){N[++D]=W}),N}var Ft=Array.prototype,qt=Function.prototype,ne=Object.prototype,Xe=Q["__core-js_shared__"],si=function(){var y=/[^.]+$/.exec(Xe&&Xe.keys&&Xe.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),Fe=qt.toString,Bt=ne.hasOwnProperty,ve=ne.toString,ri=RegExp("^"+Fe.call(Bt).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ha=Q.Symbol,fa=Q.Uint8Array,Ws=ne.propertyIsEnumerable,ai=Ft.splice,Ys=Et(Object.keys,Object),oi=fn(Q,"DataView"),cn=fn(Q,"Map"),un=fn(Q,"Promise"),Vs=fn(Q,"Set"),$s=fn(Q,"WeakMap"),li=fn(Object,"create"),Nl=gn(oi),Fl=gn(cn),ma=gn(un),ga=gn(Vs),dn=gn($s),Ii=ha?ha.prototype:void 0,js=Ii?Ii.valueOf:void 0,pa=Ii?Ii.toString:void 0;function hn(y){var D=-1,N=y?y.length:0;for(this.clear();++D<N;){var W=y[D];this.set(W[0],W[1])}}function Bl(){this.__data__=li?li(null):{}}function Be(y){return this.has(y)&&delete this.__data__[y]}function zl(y){var D=this.__data__;if(li){var N=D[y];return N===s?void 0:N}return Bt.call(D,y)?D[y]:void 0}function Hl(y){var D=this.__data__;return li?D[y]!==void 0:Bt.call(D,y)}function Wl(y,D){var N=this.__data__;return N[y]=li&&D===void 0?s:D,this}hn.prototype.clear=Bl,hn.prototype.delete=Be,hn.prototype.get=zl,hn.prototype.has=Hl,hn.prototype.set=Wl;function ze(y){var D=-1,N=y?y.length:0;for(this.clear();++D<N;){var W=y[D];this.set(W[0],W[1])}}function Yl(){this.__data__=[]}function In(y){var D=this.__data__,N=Fi(D,y);if(N<0)return!1;var W=D.length-1;return N==W?D.pop():ai.call(D,N,1),!0}function Vl(y){var D=this.__data__,N=Fi(D,y);return N<0?void 0:D[N][1]}function $l(y){return Fi(this.__data__,y)>-1}function jl(y,D){var N=this.__data__,W=Fi(N,y);return W<0?N.push([y,D]):N[W][1]=D,this}ze.prototype.clear=Yl,ze.prototype.delete=In,ze.prototype.get=Vl,ze.prototype.has=$l,ze.prototype.set=jl;function He(y){var D=-1,N=y?y.length:0;for(this.clear();++D<N;){var W=y[D];this.set(W[0],W[1])}}function Ul(){this.__data__={hash:new hn,map:new(cn||ze),string:new hn}}function Ln(y){return Hi(this,y).delete(y)}function ql(y){return Hi(this,y).get(y)}function Xl(y){return Hi(this,y).has(y)}function Gl(y,D){return Hi(this,y).set(y,D),this}He.prototype.clear=Ul,He.prototype.delete=Ln,He.prototype.get=ql,He.prototype.has=Xl,He.prototype.set=Gl;function Li(y){var D=-1,N=y?y.length:0;for(this.__data__=new He;++D<N;)this.add(y[D])}function Kl(y){return this.__data__.set(y,s),this}function Zl(y){return this.__data__.has(y)}Li.prototype.add=Li.prototype.push=Kl,Li.prototype.has=Zl;function Re(y){this.__data__=new ze(y)}function Ni(){this.__data__=new ze}function Ql(y){return this.__data__.delete(y)}function Us(y){return this.__data__.get(y)}function Jl(y){return this.__data__.has(y)}function tc(y,D){var N=this.__data__;if(N instanceof ze){var W=N.__data__;if(!cn||W.length<e-1)return W.push([y,D]),this;N=this.__data__=new He(W)}return N.set(y,D),this}Re.prototype.clear=Ni,Re.prototype.delete=Ql,Re.prototype.get=Us,Re.prototype.has=Jl,Re.prototype.set=tc;function ec(y,D){var N=w(y)||Ma(y)?Mt(y.length,String):[],W=N.length,ht=!!W;for(var et in y)Bt.call(y,et)&&!(ht&&(et=="length"||Xs(et,W)))&&N.push(et);return N}function Fi(y,D){for(var N=y.length;N--;)if(va(y[N][0],D))return N;return-1}var nc=hc();function ic(y,D){return y&&nc(y,D,ui)}function Bi(y,D){D=Wi(D,y)?[D]:Ge(D);for(var N=0,W=D.length;y!=null&&N<W;)y=y[mn(D[N++])];return N&&N==W?y:void 0}function sc(y){return ve.call(y)}function rc(y,D){return y!=null&&D in Object(y)}function qs(y,D,N,W,ht){return y===D?!0:y==null||D==null||!Xt(y)&&!Me(D)?y!==y&&D!==D:ac(y,D,qs,N,W,ht)}function ac(y,D,N,W,ht,et){var pt=w(y),Gt=w(D),zt=c,ce=c;pt||(zt=le(y),zt=zt==l?v:zt),Gt||(ce=le(D),ce=ce==l?v:ce);var Se=zt==v&&!Ut(y),ke=ce==v&&!Ut(D),me=zt==ce;if(me&&!Se)return et||(et=new Re),pt||Sa(y)?_a(y,D,N,W,ht,et):fc(y,D,zt,N,W,ht,et);if(!(ht&a)){var Ie=Se&&Bt.call(y,"__wrapped__"),Le=ke&&Bt.call(D,"__wrapped__");if(Ie||Le){var Bn=Ie?y.value():y,pn=Le?D.value():D;return et||(et=new Re),N(Bn,pn,W,ht,et)}}return me?(et||(et=new Re),mc(y,D,N,W,ht,et)):!1}function oc(y,D,N,W){var ht=N.length,et=ht;if(y==null)return!et;for(y=Object(y);ht--;){var pt=N[ht];if(pt[2]?pt[1]!==y[pt[0]]:!(pt[0]in y))return!1}for(;++ht<et;){pt=N[ht];var Gt=pt[0],zt=y[Gt],ce=pt[1];if(pt[2]){if(zt===void 0&&!(Gt in y))return!1}else{var Se=new Re,ke;if(!(ke===void 0?qs(ce,zt,W,r|a,Se):ke))return!1}}return!0}function lc(y){if(!Xt(y)||xa(y))return!1;var D=tt(y)||Ut(y)?ri:_t;return D.test(gn(y))}function cc(y){return Me(y)&&Yt(y.length)&&!!H[ve.call(y)]}function ya(y){return typeof y=="function"?y:y==null?Yi:typeof y=="object"?w(y)?zi(y[0],y[1]):dc(y):xC(y)}function uc(y){if(!yc(y))return Ys(y);var D=[];for(var N in Object(y))Bt.call(y,N)&&N!="constructor"&&D.push(N);return D}function dc(y){var D=gc(y);return D.length==1&&D[0][2]?Ks(D[0][0],D[0][1]):function(N){return N===y||oc(N,y,D)}}function zi(y,D){return Wi(y)&&wa(D)?Ks(mn(y),D):function(N){var W=ka(N,y);return W===void 0&&W===D?Da(N,y):qs(D,W,void 0,r|a)}}function Nn(y){return function(D){return Bi(D,y)}}function ba(y){if(typeof y=="string")return y;if(Qt(y))return pa?pa.call(y):"";var D=y+"";return D=="0"&&1/y==-1/0?"-0":D}function Ge(y){return w(y)?y:bc(y)}function hc(y){return function(D,N,W){for(var ht=-1,et=Object(D),pt=W(D),Gt=pt.length;Gt--;){var zt=pt[++ht];if(N(et[zt],zt,et)===!1)break}return D}}function _a(y,D,N,W,ht,et){var pt=ht&a,Gt=y.length,zt=D.length;if(Gt!=zt&&!(pt&&zt>Gt))return!1;var ce=et.get(y);if(ce&&et.get(D))return ce==D;var Se=-1,ke=!0,me=ht&r?new Li:void 0;for(et.set(y,D),et.set(D,y);++Se<Gt;){var Ie=y[Se],Le=D[Se];if(W)var Bn=pt?W(Le,Ie,Se,D,y,et):W(Ie,Le,Se,y,D,et);if(Bn!==void 0){if(Bn)continue;ke=!1;break}if(me){if(!jt(D,function(pn,di){if(!me.has(di)&&(Ie===pn||N(Ie,pn,W,ht,et)))return me.add(di)})){ke=!1;break}}else if(!(Ie===Le||N(Ie,Le,W,ht,et))){ke=!1;break}}return et.delete(y),et.delete(D),ke}function fc(y,D,N,W,ht,et,pt){switch(N){case b:if(y.byteLength!=D.byteLength||y.byteOffset!=D.byteOffset)return!1;y=y.buffer,D=D.buffer;case p:return!(y.byteLength!=D.byteLength||!W(new fa(y),new fa(D)));case u:case h:case x:return va(+y,+D);case f:return y.name==D.name&&y.message==D.message;case k:case A:return y==D+"";case _:var Gt=qe;case C:var zt=et&a;if(Gt||(Gt=ee),y.size!=D.size&&!zt)return!1;var ce=pt.get(y);if(ce)return ce==D;et|=r,pt.set(y,D);var Se=_a(Gt(y),Gt(D),W,ht,et,pt);return pt.delete(y),Se;case O:if(js)return js.call(y)==js.call(D)}return!1}function mc(y,D,N,W,ht,et){var pt=ht&a,Gt=ui(y),zt=Gt.length,ce=ui(D),Se=ce.length;if(zt!=Se&&!pt)return!1;for(var ke=zt;ke--;){var me=Gt[ke];if(!(pt?me in D:Bt.call(D,me)))return!1}var Ie=et.get(y);if(Ie&&et.get(D))return Ie==D;var Le=!0;et.set(y,D),et.set(D,y);for(var Bn=pt;++ke<zt;){me=Gt[ke];var pn=y[me],di=D[me];if(W)var Nm=pt?W(di,pn,me,D,y,et):W(pn,di,me,y,D,et);if(!(Nm===void 0?pn===di||N(pn,di,W,ht,et):Nm)){Le=!1;break}Bn||(Bn=me=="constructor")}if(Le&&!Bn){var Ta=y.constructor,Ca=D.constructor;Ta!=Ca&&"constructor"in y&&"constructor"in D&&!(typeof Ta=="function"&&Ta instanceof Ta&&typeof Ca=="function"&&Ca instanceof Ca)&&(Le=!1)}return et.delete(y),et.delete(D),Le}function Hi(y,D){var N=y.__data__;return Gs(D)?N[typeof D=="string"?"string":"hash"]:N.map}function gc(y){for(var D=ui(y),N=D.length;N--;){var W=D[N],ht=y[W];D[N]=[W,ht,wa(ht)]}return D}function fn(y,D){var N=oe(y,D);return lc(N)?N:void 0}var le=sc;(oi&&le(new oi(new ArrayBuffer(1)))!=b||cn&&le(new cn)!=_||un&&le(un.resolve())!=S||Vs&&le(new Vs)!=C||$s&&le(new $s)!=T)&&(le=function(y){var D=ve.call(y),N=D==v?y.constructor:void 0,W=N?gn(N):void 0;if(W)switch(W){case Nl:return b;case Fl:return _;case ma:return S;case ga:return C;case dn:return T}return D});function pc(y,D,N){D=Wi(D,y)?[D]:Ge(D);for(var W,ht=-1,pt=D.length;++ht<pt;){var et=mn(D[ht]);if(!(W=y!=null&&N(y,et)))break;y=y[et]}if(W)return W;var pt=y?y.length:0;return!!pt&&Yt(pt)&&Xs(et,pt)&&(w(y)||Ma(y))}function Xs(y,D){return D=D??o,!!D&&(typeof y=="number"||V.test(y))&&y>-1&&y%1==0&&y<D}function Wi(y,D){if(w(y))return!1;var N=typeof y;return N=="number"||N=="symbol"||N=="boolean"||y==null||Qt(y)?!0:K.test(y)||!q.test(y)||D!=null&&y in Object(D)}function Gs(y){var D=typeof y;return D=="string"||D=="number"||D=="symbol"||D=="boolean"?y!=="__proto__":y===null}function xa(y){return!!si&&si in y}function yc(y){var D=y&&y.constructor,N=typeof D=="function"&&D.prototype||ne;return y===N}function wa(y){return y===y&&!Xt(y)}function Ks(y,D){return function(N){return N==null?!1:N[y]===D&&(D!==void 0||y in Object(N))}}var bc=ci(function(y){y=Fn(y);var D=[];return z.test(y)&&D.push(""),y.replace(j,function(N,W,ht,et){D.push(ht?et.replace(yt,"$1"):W||N)}),D});function mn(y){if(typeof y=="string"||Qt(y))return y;var D=y+"";return D=="0"&&1/y==-1/0?"-0":D}function gn(y){if(y!=null){try{return Fe.call(y)}catch{}try{return y+""}catch{}}return""}function ci(y,D){if(typeof y!="function"||D&&typeof D!="function")throw new TypeError(i);var N=function(){var W=arguments,ht=D?D.apply(this,W):W[0],et=N.cache;if(et.has(ht))return et.get(ht);var pt=y.apply(this,W);return N.cache=et.set(ht,pt),pt};return N.cache=new(ci.Cache||He),N}ci.Cache=He;function va(y,D){return y===D||y!==y&&D!==D}function Ma(y){return F(y)&&Bt.call(y,"callee")&&(!Ws.call(y,"callee")||ve.call(y)==l)}var w=Array.isArray;function L(y){return y!=null&&Yt(y.length)&&!tt(y)}function F(y){return Me(y)&&L(y)}function tt(y){var D=Xt(y)?ve.call(y):"";return D==m||D==g}function Yt(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=o}function Xt(y){var D=typeof y;return!!y&&(D=="object"||D=="function")}function Me(y){return!!y&&typeof y=="object"}function Qt(y){return typeof y=="symbol"||Me(y)&&ve.call(y)==O}var Sa=dt?te(dt):cc;function Fn(y){return y==null?"":ba(y)}function ka(y,D,N){var W=y==null?void 0:Bi(y,D);return W===void 0?N:W}function Da(y,D){return y!=null&&pc(y,D,rc)}function ui(y){return L(y)?ec(y):uc(y)}function Zs(y,D){var N={};return D=ya(D),ic(y,function(W,ht,et){N[D(W,ht,et)]=W}),N}function Yi(y){return y}function xC(y){return Wi(y)?ot(mn(y)):Nn(y)}n.exports=Zs}(da,da.exports);var ET=da.exports;const OT=hl(ET);var PT=9007199254740991,AT="[object Arguments]",RT="[object Function]",IT="[object GeneratorFunction]",LT="[object Symbol]",NT=typeof xe=="object"&&xe&&xe.Object===Object&&xe,FT=typeof self=="object"&&self&&self.Object===Object&&self,BT=NT||FT||Function("return this")();function zT(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 HT(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 WT(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var Il=Object.prototype,YT=Il.hasOwnProperty,Ll=Il.toString,Em=BT.Symbol,VT=Il.propertyIsEnumerable,Om=Em?Em.isConcatSpreadable:void 0,Pm=Math.max;function $T(n,t,e,i,s){var r=-1,a=n.length;for(e||(e=XT),s||(s=[]);++r<a;){var o=n[r];e(o)?WT(s,o):s[s.length]=o}return s}function jT(n,t){return n=Object(n),UT(n,t,function(e,i){return i in n})}function UT(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var a=t[i],o=n[a];e(o,a)&&(r[a]=o)}return r}function qT(n,t){return t=Pm(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Pm(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=e[i];return a[t]=r,zT(n,this,a)}}function XT(n){return ZT(n)||KT(n)||!!(Om&&n&&n[Om])}function GT(n){if(typeof n=="string"||iC(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function KT(n){return JT(n)&&YT.call(n,"callee")&&(!VT.call(n,"callee")||Ll.call(n)==AT)}var ZT=Array.isArray;function QT(n){return n!=null&&eC(n.length)&&!tC(n)}function JT(n){return Am(n)&&QT(n)}function tC(n){var t=nC(n)?Ll.call(n):"";return t==RT||t==IT}function eC(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=PT}function nC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Am(n){return!!n&&typeof n=="object"}function iC(n){return typeof n=="symbol"||Am(n)&&Ll.call(n)==LT}var sC=qT(function(n,t){return n==null?{}:jT(n,HT($T(t),GT))}),rC=sC;const aC=hl(rC);var Rm={exports:{}};(function(n,t){(function(e,i){i()})(xe,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 a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof xe=="object"&&xe.global===xe?xe:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,h){var f=a.URL||a.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(a.HTMLElement)||a.safari,_=/CriOS\/[\d]+/.test(navigator.userAgent);if((_||m&&g||o)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var k=x.result;k=_?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=k:location=k,f=null},x.readAsDataURL(c)}else{var v=a.URL||a.webkitURL,S=v.createObjectURL(c);f?f.location=S:location.href=S,f=null,setTimeout(function(){v.revokeObjectURL(S)},4e4)}});a.saveAs=l.saveAs=l,n.exports=l})})(Rm);var oC=Rm.exports,Im={exports:{}};/* @license
28
+ */const fD={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 fD},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=ct(e):n==="string"&&(typeof t=="string"?e=Fw(e,t,new Date,this.options):e=Th(e,this.options)),Fo(e)?e.getTime():null},format:function(e,t){return Us(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return Lo(e,t);case"second":return R_(e,t);case"minute":return O_(e,t);case"hour":return D_(e,t);case"day":return Ys(e,t);case"week":return A_(e,t);case"month":return Io(e,t);case"quarter":return P_(e,t);case"year":return I_(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return Bo(e,t);case"second":return $_(e,t);case"minute":return z_(e,t);case"hour":return B_(e,t);case"day":return sh(e,t);case"week":return W_(e,t);case"month":return ch(e,t);case"quarter":return V_(e,t);case"year":return Y_(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return Vw(e);case"minute":return Hw(e);case"hour":return zw(e);case"day":return No(e);case"week":return je(e);case"isoWeek":return je(e,{weekStartsOn:+n});case"month":return U_(e);case"quarter":return j_(e);case"year":return uh(e);default:return e}},endOf:function(e,t){switch(t){case"second":return Q_(e);case"minute":return K_(e);case"hour":return X_(e);case"day":return oh(e);case"week":return G_(e);case"month":return lh(e);case"quarter":return Z_(e);case"year":return q_(e);default:return e}}});const Hm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},mD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Hm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},gD=d.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Bi(e){return d.isProxy(e)?d.toRaw(e):e}function pD(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return d.isProxy(t)?new Proxy(e,{}):e}function yD(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Vm(e,t){e.labels=t}function $m(e,t,n){const i=[];e.datasets=t.map(r=>{const s=e.datasets.find(a=>a[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function bD(e,t){const n={labels:[],datasets:[]};return Vm(n,e.labels),$m(n,e.datasets,t),n}const _D=d.defineComponent({props:mD,setup(e,t){let{expose:n,slots:i}=t;const r=d.ref(null),s=d.shallowRef(null);n({chart:s});const a=()=>{if(!r.value)return;const{type:l,data:u,options:h,plugins:f,datasetIdKey:m}=e,g=bD(u,m),y=pD(g,u);s.value=new be(r.value,{type:l,data:y,options:{...h},plugins:f})},o=()=>{const l=d.toRaw(s.value);l&&(e.destroyDelay>0?setTimeout(()=>{l.destroy(),s.value=null},e.destroyDelay):(l.destroy(),s.value=null))},c=l=>{l.update(e.updateMode)};return d.onMounted(a),d.onUnmounted(o),d.watch([()=>e.options,()=>e.data],(l,u)=>{let[h,f]=l,[m,g]=u;const y=d.toRaw(s.value);if(!y)return;let x=!1;if(h){const v=Bi(h),S=Bi(m);v&&v!==S&&(yD(y,v),x=!0)}if(f){const v=Bi(f.labels),S=Bi(g.labels),k=Bi(f.datasets),C=Bi(g.datasets);v!==S&&(Vm(y.config.data,v),x=!0),k&&k!==C&&($m(y.config.data,k,e.datasetIdKey),x=!0)}x&&d.nextTick(()=>{c(y)})},{deep:!0}),()=>d.h("canvas",{role:"img",ariaLabel:e.ariaLabel,ariaDescribedby:e.ariaDescribedby,ref:r},[d.h("p",{},[i.default?i.default():""])])}});function $l(e,t){return be.register(t),d.defineComponent({props:Hm,setup(n,i){let{expose:r}=i;const s=d.shallowRef(null),a=o=>{s.value=o==null?void 0:o.chart};return r({chart:s}),()=>d.h(_D,gD({ref:a},{type:e,...n}))}})}const Wm=$l("bar",hr),Ym=$l("doughnut",an),jm=$l("line",fr),xD={class:"chart-container"},wD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:ve.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>un},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{translateUnit:n}=mt.useTranslatedUnits(),i=crypto.randomUUID(),r=crypto.randomUUID(),s=d.ref([]),a=d.useTemplateRef("chartParent"),o=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:r,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:c,tooltipAbsoluteTop:l}=mt.useTooltipAbsolutePosition(a,o),u={id:i,afterUpdate(S){s.value=S.options.plugins.legend.labels.generateLabels(S).map(k=>({...k,value:t.legendValues&&t.legendValues[k.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((k,C)=>(k.labels.push(C.label),k.backgroundColor.push(C.backgroundColor),k.borderColor.push(bf(C.backgroundColor,50)),k.data.push(C.data.reduce((E,P)=>E+P,0)),k),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=mt.useDonutChartOptions({tooltipState:o,legendID:i}),y=d.ref(),x=S=>({[ve.Bottom]:"column",[ve.Hidden]:"hidden"})[S],v=({width:S,height:k})=>{o.width=S,o.height=k};return(S,k)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(e.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",xD,[d.createVNode(d.unref(Ym),{ref_key:"chartInstance",ref:y,"chart-id":d.unref(r),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(_a,{"absolute-left":d.unref(c),"absolute-top":d.unref(l),state:o,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:v},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(zl,{id:d.unref(i),"chart-instance":y.value,items:s.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),vD=Ee(wD,[["__scopeId","data-v-9503582a"]]),Wl=(e,t,n,i,r="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=r,e.stroke(),e.restore()},me={},SD=()=>{me.x=void 0,me.chart=void 0,me.strategy=void 0,me.group=void 0},kD=10;class Um{constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){R(this,"id","verticalLinePlugin");R(this,"_clickedSegment");R(this,"_pause",!1);R(this,"_useBrushingState",!1);R(this,"_brushStrategy");R(this,"_brushGroup");R(this,"_lastMouseBrushEvent",0);let r=!1;n==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<kD)return;const r=()=>{me.chart=n,me.strategy=this._brushStrategy,me.group=this._brushGroup;for(const s of Object.values(be.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(me.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(me.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;Wl(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:r}=t.tooltip.dataPoints[0].element;Wl(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(me.x===void 0)return;const n=me.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&me.group===this._brushGroup&&Wl(t.ctx,me.x,t.scales.y.top,t.scales.y.bottom,n)}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(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&me.chart===t){const n=me.x!==void 0;if(SD(),n)for(const i of Object.values(be.instances))i!==t&&i.update("none")}}}const MD=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},TD=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},qm=(e,t,n)=>{const i=t.scales.x.getValueForPixel(n.startX),r=t.scales.x.getValueForPixel(n.endX);i&&r&&t.canvas.dispatchEvent(new CustomEvent(e,{detail:{xStart:Math.min(i,r),xEnd:Math.max(i,r)}}))};class DD{constructor(){R(this,"id","dragSelectPlugin");R(this,"_isDragging",!1);R(this,"_startX",0);R(this,"_endX",0);R(this,"_dragTimeout");R(this,"_clearSelectionArea",!0);R(this,"_chart",null);R(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const r=o=>{this._dragTimeout=window.setTimeout(()=>{const c=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=o.clientX-c.left},150)},s=o=>{const c=n.getBoundingClientRect();i&&this._isDragging&&(this._endX=o.clientX-c.left,qm("dragSelectMove",t,this))},a=o=>{const c=n.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=o.clientX-c.left,qm("dragSelect",t,this),i=!1,this._isDragging=!1)};n.addEventListener("mousedown",r),n.addEventListener("mousemove",s),n.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",r),n.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(TD(t,this._startX,this._endX),MD(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const CD=["hidden","single","full"];var li=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(li||{});const ED=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],OD=["gauge","top_n","single_value"],PD=20,RD="rgba(255, 171, 171, 0.4)",AD="rgba(255, 196, 0, 0.2)",Xm=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const r=(n-e.y)/i;return e.x+r*(t.x-e.x)},ID=(e,t)=>{const n=[];return e.data.datasets.forEach(i=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(i)).visible)return;const s=i.data;s!=null&&s.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const o=s.map(l=>({ts:l.x,aboveThreshold:l.y>=a.value}));let c=o[0].aboveThreshold?s[0].x:void 0;for(let l=1;l<o.length;l++)!o[l-1].aboveThreshold&&o[l].aboveThreshold?c=Xm(s[l-1],s[l],a.value):o[l-1].aboveThreshold&&!o[l].aboveThreshold&&c!==void 0&&(n.push({start:c,end:Xm(s[l-1],s[l],a.value),type:a.type}),c=void 0);c!==void 0&&n.push({start:c,end:o[o.length-1].ts,type:a.type})})}),n},LD=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:r})=>r===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class ND{constructor(t){R(this,"id","thresholdPlugin");R(this,"_thresholds");R(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var n,i;for(const r of Object.keys(t.threshold||{})){const s=(n=t.threshold)==null?void 0:n[r];s&&(this._thresholds={...this._thresholds,[r]:s.map(a=>({...a,hovered:!1}))})}if(this._thresholds)for(const r of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[r]||delete this._thresholds[r]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{var o;if(t){const c=a.clientY,l=t.scales.y,u=r.getBoundingClientRect(),h=l.getValueForPixel(c-u.top);if(h)for(const f of Object.keys(this._thresholds||{})){const m=(o=this._thresholds)==null?void 0:o[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<PD})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,n){var r;const i=t.ctx;for(const s of Object.keys(this._thresholds||{})){const a=(r=this._thresholds)==null?void 0:r[s];if(a){a.forEach(l=>{const h=t.scales.y.getPixelForValue(l.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=ra(l.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";l.label?f=`${l.label}: ${l.value}`:l.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:l.value}):l.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:l.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:l.value}),l.hovered&&(i.save(),i.fillStyle=ra(l.type),i.font=kS,i.fillText(f,t.chartArea.left,h-4),i.restore())});const o=ID(t,a);LD(o).forEach(l=>{const u=t.scales.x.getPixelForValue(l.start),h=t.scales.x.getPixelForValue(l.end);i.save(),i.fillStyle=l.type==="error"?RD:AD,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=ra(l.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const FD=Ee(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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:r}=mt.useI18n(),s=new Um,a=new Bm,o=new DD,c=new ND(r),{translateUnit:l}=mt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),y=d.inject("legendPosition",ve.Bottom),x=d.useTemplateRef("chartParent"),v=d.ref(void 0),S=d.ref(!1),k=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:n.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:n.metricUnit,translateUnit:l,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:f,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:C,tooltipAbsoluteTop:E}=mt.useTooltipAbsolutePosition(x,k),P={id:h,afterUpdate(z){m.value=hf(z,n.legendValues,n.chartLegendSortFn)}},T=d.computed(()=>[P,a,...n.brush?[o]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[c]:[]]),p=d.computed(()=>`line-${T.value.map(z=>z.id).join("-")}`),_=d.computed(()=>`bar-${T.value.map(z=>z.id).join("-")}`),M=d.computed(()=>n.chartData&&mS(n.chartData)),{options:O}=mt.useLineChartOptions({tooltipState:k,timeRangeMs:d.toRef(n,"timeRangeMs"),granularity:d.toRef(n,"granularity"),legendID:h,stacked:d.toRef(n,"stacked"),metricAxesTitle:d.toRef(n,"metricAxesTitle"),dimensionAxesTitle:d.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:M,threshold:d.toRef(n,"threshold")});mt.useReportChartDataForSynthetics(d.toRef(n,"chartData"),d.toRef(n,"syntheticsDataKey"));const A=z=>({[ve.Bottom]:"column",[ve.Hidden]:"hidden"})[z],I=({width:z,height:U})=>{k.width=z,k.height=U},B=(z=!0)=>{k.interactionMode="idle",k.showTooltip=!1,o.clearSelectionArea(),a.isPaused&&a.resume(z),s.isPaused&&s.resume()},j=()=>{k.interactionMode="interactive"},G=()=>{var z,U;!u.value||!((U=(z=u.value.chart.tooltip)==null?void 0:z.dataPoints)!=null&&U.length)||(k.interactionMode==="interactive"?s.clickedSegment=u.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},$=()=>{if(S.value){S.value=!1;return}k.interactionMode!=="idle"?B():j(),G()};d.watch(()=>n.type,()=>{k.interactionMode="idle",k.showTooltip=!1,s.destroyClickedSegment()});const lt=z=>{z.preventDefault(),z.stopPropagation();const{xStart:U,xEnd:W}=z.detail;U&&W&&(v.value={start:new Date(U),end:new Date(W),type:"absolute"},k.interactionMode="zoom-interactive",i("select-chart-range",v.value))},q=z=>{k.interactionMode="selecting-chart-area",S.value=!0,s.pause(),a.pause();const{xStart:U,xEnd:W}=z.detail;U&&W&&(v.value={start:new Date(U),end:new Date(W),type:"absolute"})},Z=z=>{if(!x.value||k.interactionMode==="idle")return;const U=z.target;U&&x.value.contains(U)||S.value||B(!1)};return d.watch(()=>{var z;return(z=u.value)==null?void 0:z.chart},()=>{var z;(z=u.value)!=null&&z.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",q),u.value.chart.canvas.addEventListener("dragSelect",lt),u.value.chart.canvas.addEventListener("dragSelectMove",q))}),d.onMounted(()=>{document.addEventListener("click",Z,!0)}),d.onUnmounted(()=>{var z;(z=u.value)!=null&&z.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",q)),document.removeEventListener("click",Z,!0)}),(z,U)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",A(d.unref(y))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:U[0]||(U[0]=W=>$())},[e.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(jm),{key:p.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:d.unref(O),plugins:T.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Wm),{key:_.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:d.unref(O),plugins:T.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(_a,{ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(C),"absolute-top":d.unref(E),"data-testid":"tooltip",granularity:e.granularity,state:k,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":v.value,onDimensions:I,onOnAction:U[1]||(U[1]=()=>B(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(zl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-0a32a7ca"]]),BD={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},zD={class:"tooltip-content"},HD={key:2,class:"analytics-chart-parent"},VD=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:ve.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},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(e,{emit:t}){const n=t,i=e,{i18n:r}=mt.useI18n(),s=d.computed(()=>y.value?mt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||sa},d.toRef(i,"chartData")).value:mt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||sa},d.toRef(i,"chartData")).value),a=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),o=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}),c=d.computed(()=>{var I;return(I=i.chartData.meta)!=null&&I.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),l=d.computed(()=>i.showLegendValues&&i.legendPosition!==ve.Hidden),{legendValues:u}=mt.useChartLegendValues(s,i.chartOptions.type,c),h=d.computed(()=>{var I,B,j;return((j=(B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.limit)==null?void 0:j.toString())||null}),f=d.computed(()=>{var I,B;return i.chartOptions.hideTruncationWarning?!1:((B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.truncated)||!1}),m=r.t("limitedResultsShown",{maxReturned:h.value}),g=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),y=d.computed(()=>["timeseries_bar","timeseries_line"].some(I=>I===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),v=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),S=d.computed(()=>{var j,G;if(!((j=i.chartData)!=null&&j.meta.metric_names)||!((G=i.chartData)!=null&&G.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 r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})})}if(I)return r.te(`chartLabels.${I}`)?r.t(`chartLabels.${I}`):I}),k=d.computed(()=>{var j,G,$,lt;if((j=i.chartOptions)!=null&&j.metricAxesTitle)return(G=i.chartOptions)==null?void 0:G.metricAxesTitle;if(!(($=i.chartData)!=null&&$.meta.metric_names)||!((lt=i.chartData)!=null&&lt.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 r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})})}return r.te(`metricAxisTitles.${I}`)&&r.te(`chartUnits.${B}`)?r.t(`metricAxisTitles.${I}`,{unit:r.t(`chartUnits.${B}`,{plural:"s"})})||void 0:I||void 0}),C=d.computed(()=>{var B;if((B=i.chartOptions)!=null&&B.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const I=y.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(I)return r.te(`chartLabels.${I}`)?r.t(`chartLabels.${I}`):I}),E=d.computed(()=>{const I=nl(Number(i.chartData.meta.granularity_ms));if(I)return r.te(`granularityAxisTitles.${I}`)?r.t(`granularityAxisTitles.${I}`):I}),P=d.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),T=d.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),p=d.computed(()=>y.value?gS(s.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=d.computed(()=>i.chartData.meta.granularity_ms?nl(i.chartData.meta.granularity_ms)||"hourly":nl(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),M=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(I,B)=>I.text===r.t("chartLabels.____OTHER____")?1:B.text===r.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),O=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(I,B)=>I.label===r.t("chartLabels.____OTHER____")?1:B.label===r.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),A=d.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:I=>n("zoom-time-range",I)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",l),d.provide("legendPosition",d.toRef(i,"legendPosition")),(I,B)=>{const j=d.resolveComponent("KTooltip"),G=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["analytics-chart-shell",{"show-values":l.value}])},[p.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",BD,[d.createVNode(j,{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(Jt.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(wS)})`,size:d.unref(SS)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),p.value?(d.openBlock(),d.createElementBlock("div",HD,[y.value?(d.openBlock(),d.createBlock(FD,{key:0,brush:a.value,"chart-data":s.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":O.value,"dimension-axes-title":E.value,fill:e.chartOptions.stacked,granularity:_.value,"legend-values":d.unref(u),"metric-axes-title":k.value,"metric-unit":c.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:e.chartOptions.threshold,"time-range-ms":o.value,"tooltip-metric-display":S.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":A.value,onSelectChartRange:B[0]||(B[0]=$=>n("select-chart-range",$)),onZoomTimeRange:B[1]||(B[1]=$=>n("zoom-time-range",$))},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(hD,{key:1,annotations:e.showAnnotations,"chart-data":s.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":O.value,"data-testid":"bar-chart-container","dimension-axes-title":C.value,"legend-values":d.unref(u),"metric-axes-title":k.value,"metric-unit":c.value,orientation:v.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":S.value,"tooltip-title":e.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(vD,{key:2,"chart-data":s.value,"dataset-colors":e.chartOptions.chartDatasetColors||d.unref(sa),"legend-position":e.legendPosition,"legend-values":d.unref(u),"metric-unit":c.value,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":C.value,"tooltip-metric-display":S.value,"tooltip-title":e.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(G,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(P.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(T.value),1)]),_:1}))],2)}}}),$D=Ee(VD,[["__scopeId","data-v-b2eeb763"]]),WD={class:"chart-parent","data-testid":"gauge-chart-parent"},YD={class:"chart-totals-flex"},jD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},UD=Ee(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:un},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.ref(Vl()),r=d.computed(()=>[t.chartData.datasets.reduce((g,y)=>(g.labels.push(y.label),g.borderColor.push(y.backgroundColor),g.backgroundColor.push(y.backgroundColor),g.data.push(y.data.reduce((x,v)=>x+v,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=d.computed(()=>({...t.chartData,datasets:r.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=d.ref(),c=d.computed(()=>{var m;return oa((m=r==null?void 0:r.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),l=d.computed(()=>{var m,g;return oa(((m=r==null?void 0:r.value[0])==null?void 0:m.data[0])+((g=r==null?void 0:r.value[0])==null?void 0:g.data[1]),{capital:!0})}),u=d.computed(()=>{var m;return`color: ${(m=r==null?void 0:r.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",WD,[d.createElementVNode("div",YD,[h.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(u.value)},d.toDisplayString(c.value),5)):d.createCommentVNode("",!0),f.value?(d.openBlock(),d.createElementBlock("div",jD,d.toDisplayString(d.unref(n).t("total"))+": "+d.toDisplayString(l.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:e.height,width:e.width})},[d.createVNode(d.unref(Ym),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]);/*!
29
+ * pinia v2.1.7
30
+ * (c) 2023 Eduardo San Martin Morote
31
+ * @license MIT
32
+ */process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();var Gm;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Gm||(Gm={}));const qD=typeof window<"u";process.env.NODE_ENV!=="production"&&process.env.NODE_ENV,process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();const XD={notAvailable:"N/A"},GD={small:{traffic:"Requests",errorRate:"Error rate",averageLatency:"Avg. latency",p99Latency:"P99 latency"},short:{traffic:"Requests",errorRate:"Error rate",averageLatency:"Average latency",p99Latency:"P99 latency"},long:{traffic:"Number of requests",errorRate:"Average error rate",averageLatency:"Average latency",p99Latency:"P99 latency"}},KD={custom_days:"vs previous {numDays, plural, =1 {day} other {# days}}",custom_hours:"vs previous {numHours, plural, =1 {hour} other {# hours}}",custom_minutes:"vs previous {numMinutes, plural, =1 {minute} other {# minutes}}","15m":"vs previous 15 minutes","1h":"vs previous hour","6h":"vs previous 6 hours","12h":"vs previous 12 hours","24h":"vs previous 24 hours","7d":"vs previous 7 days","30d":"vs previous 30 days",current_week:"vs previous week",current_month:"vs previous month",current_quarter:"vs previous quarter",previous_week:"vs previous time period",previous_month:"vs previous time period",previous_quarter:"vs previous quarter"},ZD={general:XD,metricCard:GD,trendRange:KD};function QD(){const e=Qe.createI18n("en-us",ZD);return{i18n:e,i18nT:Qe.i18nTComponent(e)}}const JD=2,Yl=["1XX","2XX","3XX","4XX","5XX"],Km=["4XX","5XX"];var Zm=(e=>(e.VALIDATING="VALIDATING",e.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",e.ERROR="ERROR",e.STALE_IF_ERROR="STALE_IF_ERROR",e))(Zm||{});const tC=e=>{var t,n,i,r,s;return e?!!((t=Object.keys(e))!=null&&t.length||(n=e.data)!=null&&n.length||(r=(i=e.data)==null?void 0:i.data)!=null&&r.length||!((s=e.data)!=null&&s.data)&&typeof e.data=="object"&&Object.keys(e==null?void 0:e.data).length):!1};function eC(e=d.ref({}),t,n,i=tC){const r=d.ref("PENDING");return d.watchEffect(()=>{const s=i(e.value);if(e.value&&s&&n.value){r.value="VALIDATING_HAS_DATA";return}if(e.value&&n.value){r.value="VALIDATING";return}if(e.value&&t.value){r.value="STALE_IF_ERROR";return}if(e.value===void 0&&!t.value){r.value="PENDING";return}if(e.value&&!t.value&&s){r.value="SUCCESS_HAS_DATA";return}if(e.value&&!t.value){r.value="SUCCESS";return}e.value===void 0&&t&&(r.value="ERROR")}),{state:r,swrvState:Zm}}const Bn=Symbol("default"),jl="status_code_grouped",Qm=(e,t,n,i,r)=>{e[t][n]||(e[t][n]={}),e[t][n][i]=r};function nC(e,t){var n;const i=((n=e.meta.metric_names)==null?void 0:n[0])||"",r=e.meta.start_ms,s=Object.keys(e.meta.display||{}),a=!!s.find(c=>c===jl),o=s.find(c=>c!==jl);return s.length>2||s.length>1&&!a?(console.error("Don't know how to work with provided dimensions:",s),{previous:{[Bn]:{[Bn]:0}},current:{[Bn]:{[Bn]:0}}}):e.data.reduce((c,l)=>{const u=l.event[i],h=o?l.event[o]:Bn,f=a?l.event[jl]:Bn;return new Date(l.timestamp).getTime()===r&&t?Qm(c,"previous",h,f,u):Qm(c,"current",h,f,u),c},{previous:{},current:{}})}function iC(e){e.queryReady===void 0&&(e.queryReady=d.computed(()=>!0));const t=d.computed(()=>{var u,h;return{metrics:e.metrics.value,dimensions:[...(u=e.dimensions)!=null&&u.length?[...e.dimensions]:[],...e.withTrend.value?["time"]:[]],granularity:e.withTrend.value?"trend":void 0,...(h=e.filter.value)!=null&&h.length?{filters:e.filter.value}:{},time_range:e.timeRange.value}}),n=d.computed(()=>{var u,h,f,m;if(!((u=e.queryReady)!=null&&u.value))return null;const g=(h=e.filter)!=null&&h.value?JSON.stringify(e.filter.value):"";return`metric-fetcher-${JSON.stringify(e.timeRange.value)}-${(f=e.dimensions)==null?void 0:f.join("-")}-${(m=e.metrics.value)==null?void 0:m.join("-")}-${g}-${e.refreshCounter.value}`}),{response:i,error:r,isValidating:s}=$i.useRequest(()=>n.value,()=>e.queryFn({datasource:e.datasource.value,query:t.value},e.abortController??new AbortController),{refreshInterval:e.refreshInterval,revalidateOnFocus:!1,errorRetryCount:JD}),{state:a,swrvState:o}=eC(i,r,s),c=d.computed(()=>{var u,h,f,m,g,y,x;return!((h=(u=i.value)==null?void 0:u.data)!=null&&h.length)||!((m=(f=i.value)==null?void 0:f.meta)!=null&&m.display)||!((x=(y=(g=i.value)==null?void 0:g.meta)==null?void 0:y.metric_names)!=null&&x.length)?{current:{},previous:{}}:nC(i.value,e.withTrend.value)}),l=$i.useTrendRange(e.withTrend,e.timeRange,d.computed(()=>{var u;return(u=i.value)==null?void 0:u.meta}));return{isLoading:d.computed(()=>o.PENDING===a.value),hasError:d.computed(()=>o.ERROR===a.value),raw:i,mapped:c,trendRange:l}}const zi=(e,t,n=Bn,i)=>(i??[Bn]).reduce((r,s)=>{const a=e[t][n];return a?r+(a[s]||0):r},0);function rC(e){const{cardType:t,title:n,description:i,record:r,hasError:s,increaseIsBad:a,formatValueFn:o,trendRange:c}=e;return d.computed(()=>{let l=0,u=0;if(r!=null&&r.value)try{l=zi(r.value,"current",e.lookupKey,e.sumGroupedValues),u=zi(r.value,"previous",e.lookupKey,e.sumGroupedValues)}catch(h){console.error("Metric card data doesn't have the expected structure:",h)}return{cardType:t,hasError:s.value,currentValue:l,previousValue:u,title:n.value,description:i,increaseIsBad:!!a,formatValueFn:o,trendRange:c==null?void 0:c.value}})}function Jm(e,t,n){const{i18n:i}=$i.useI18n(),r=1e3*60,s=r*60,a=s*24,o=(l,u)=>{let h=u-l;e.value&&(h/=2);const f=h/a,m=h/s,g=h/r;return f>=1?i.t("trendRange.custom_days",{numDays:Math.round(f)}):m>=1?i.t("trendRange.custom_hours",{numHours:Math.round(m)}):g>=1?i.t("trendRange.custom_minutes",{numMinutes:Math.round(g)}):i.t("trendRange.custom_days",{numDays:Math.round(f)})},c=()=>{var l,u;if((l=n==null?void 0:n.value)!=null&&l.start_ms&&n.value.end_ms)return{startMs:n.value.start_ms,endMs:n.value.end_ms};if(((u=t==null?void 0:t.value)==null?void 0:u.type)==="absolute"&&t.value.start&&t.value.end)return{startMs:new Date(t.value.start).getTime(),endMs:new Date(t.value.end).getTime()}};return d.computed(()=>{var l,u;if(((l=t==null?void 0:t.value)==null?void 0:l.type)==="relative"&&e.value)return i.t(`trendRange.${t.value.time_range}`);if(e.value||((u=t==null?void 0:t.value)==null?void 0:u.type)==="absolute"){const h=c();if(h)return o(h.startMs,h.endMs)}return""})}var Ul=new WeakMap,tg=0;function sC(e){if(!e.length)return"";for(var t="arg",n=0;n<e.length;++n){var i=void 0;e[n]===null||typeof e[n]!="object"&&typeof e[n]!="function"?typeof e[n]=="string"?i='"'+e[n]+'"':i=String(e[n]):Ul.has(e[n])?i=Ul.get(e[n]):(i=tg,Ul.set(e[n],tg++)),t+="@"+i}return t}function aC(e){if(typeof e=="function")try{e=e()}catch{e=""}return Array.isArray(e)?e=sC(e):e=String(e||""),e}var ql=function(){function e(t){t===void 0&&(t=0),this.items=new Map,this.ttl=t}return e.prototype.serializeKey=function(t){return aC(t)},e.prototype.get=function(t){var n=this.serializeKey(t);return this.items.get(n)},e.prototype.set=function(t,n,i){var r=this.serializeKey(t),s=i||this.ttl,a=Date.now(),o={data:n,createdAt:a,expiresAt:s?a+s:1/0};this.dispatchExpire(s,o,r),this.items.set(r,o)},e.prototype.dispatchExpire=function(t,n,i){var r=this;t&&setTimeout(function(){var s=Date.now(),a=s>=n.expiresAt;a&&r.delete(i)},t)},e.prototype.delete=function(t){this.items.delete(t)},e}();function oC(){return typeof navigator.onLine<"u"?navigator.onLine:!0}function lC(){return typeof document<"u"&&typeof document.visibilityState<"u"?document.visibilityState!=="hidden":!0}var cC=function(e){return fetch(e).then(function(t){return t.json()})};const Xl={isOnline:oC,isDocumentVisible:lC,fetcher:cC};var hn=function(){return hn=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},hn.apply(this,arguments)},Hi=function(e,t,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(u){try{l(i.next(u))}catch(h){a(h)}}function c(u){try{l(i.throw(u))}catch(h){a(h)}}function l(u){u.done?s(u.value):r(u.value).then(o,c)}l((i=i.apply(e,[])).next())})},Vi=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(l){return function(u){return c([l,u])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(s=l[0]&2?r.return:l[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;switch(r=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,r=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1],s=l;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(l);break}s[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],r=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},uC=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,s=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(o){a={error:o}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},dC=function(e,t,n){if(arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},eg=new ql,xa=new ql,Gl=new ql,ng={cache:eg,refreshInterval:0,ttl:0,serverTTL:1e3,dedupingInterval:2e3,revalidateOnFocus:!0,revalidateDebounce:0,shouldRetryOnError:!0,errorRetryInterval:5e3,errorRetryCount:5,fetcher:Xl.fetcher,isOnline:Xl.isOnline,isDocumentVisible:Xl.isDocumentVisible};function hC(e,t,n){var i=xa.get(e);if(i)i.data.push(t);else{var r=5e3;xa.set(e,[t],n>0?n+r:n)}}function fC(e,t,n){if(n.isDocumentVisible()&&!(n.errorRetryCount!==void 0&&t>n.errorRetryCount)){var i=Math.min(t||0,n.errorRetryCount),r=i*n.errorRetryInterval;setTimeout(function(){e(null,{errorRetryCount:i+1,shouldRetryOnError:!0})},r)}}var ig=function(e,t,n,i){return n===void 0&&(n=eg),i===void 0&&(i=ng.ttl),Hi(void 0,void 0,void 0,function(){var r,s,a,o,c,l,u;return Vi(this,function(h){switch(h.label){case 0:if(!gC(t))return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,t];case 2:return r=h.sent(),[3,4];case 3:return o=h.sent(),s=o,[3,4];case 4:return[3,6];case 5:r=t,h.label=6;case 6:if(a=!1,c={data:r,error:s,isValidating:a},typeof r<"u")try{n.set(e,c,i)}catch(f){console.error("swrv(mutate): failed to set cache",f)}return l=xa.get(e),l&&l.data.length&&(u=l.data.filter(function(f){return f.key===e}),u.forEach(function(f,m){typeof c.data<"u"&&(f.data=c.data),f.error=c.error,f.isValidating=c.isValidating,f.isLoading=c.isValidating;var g=m===u.length-1;g||delete u[m]}),u=u.filter(Boolean)),[2,c]}})})};function mC(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i,r,s=hn({},ng),a=!1,o=!1,c=d.getCurrentInstance(),l=(c==null?void 0:c.proxy)||c;if(!l)return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."),null;var u=(l==null?void 0:l.$isServer)||!1;t.length>=1&&(i=t[0]),t.length>=2&&(r=t[1]),t.length>2&&(s=hn(hn({},s),t[2]));var h=u?s.serverTTL:s.ttl,f=typeof i=="function"?i:d.ref(i);typeof r>"u"&&(r=s.fetcher);var m=null;m||(m=d.reactive({data:void 0,error:void 0,isValidating:!0,isLoading:!0,key:null}));var g=function(S,k){return Hi(e,void 0,void 0,function(){var C,E,P,T,p,_,M,O=this;return Vi(this,function(A){switch(A.label){case 0:return C=m.data===void 0,E=f.value,E?(P=s.cache.get(E),T=P&&P.data,m.isValidating=!0,m.isLoading=!T,T&&(m.data=T.data,m.error=T.error),p=S||r,!p||!s.isDocumentVisible()&&!C||(k==null?void 0:k.forceRevalidate)!==void 0&&!(k!=null&&k.forceRevalidate)?(m.isValidating=!1,m.isLoading=!1,[2]):P&&(_=!!(Date.now()-P.createdAt>=s.dedupingInterval||k!=null&&k.forceRevalidate),!_)?(m.isValidating=!1,m.isLoading=!1,[2]):(M=function(){return Hi(O,void 0,void 0,function(){var I,B,j,G;return Vi(this,function($){switch($.label){case 0:return I=Gl.get(E),I?[3,2]:(B=Array.isArray(E)?E:[E],j=p.apply(void 0,dC([],uC(B),!1)),Gl.set(E,j,s.dedupingInterval),[4,ig(E,j,s.cache,h)]);case 1:return $.sent(),[3,4];case 2:return[4,ig(E,I.data,s.cache,h)];case 3:$.sent(),$.label=4;case 4:return m.isValidating=!1,m.isLoading=!1,Gl.delete(E),m.error!==void 0&&(G=!a&&s.shouldRetryOnError&&(k?k.shouldRetryOnError:!0),G&&fC(g,k?k.errorRetryCount:1,s)),[2]}})})},T&&s.revalidateDebounce?(setTimeout(function(){return Hi(O,void 0,void 0,function(){return Vi(this,function(I){switch(I.label){case 0:return a?[3,2]:[4,M()];case 1:I.sent(),I.label=2;case 2:return[2]}})})},s.revalidateDebounce),[3,3]):[3,1])):[2];case 1:return[4,M()];case 2:A.sent(),A.label=3;case 3:return[2]}})})},y=function(){return Hi(e,void 0,void 0,function(){return Vi(this,function(S){return[2,g(null,{shouldRetryOnError:!1})]})})},x=null;d.onMounted(function(){var S=function(){return Hi(e,void 0,void 0,function(){return Vi(this,function(k){switch(k.label){case 0:return!m.error&&s.isOnline()?[4,g()]:[3,2];case 1:return k.sent(),[3,3];case 2:x&&clearTimeout(x),k.label=3;case 3:return s.refreshInterval&&!a&&(x=setTimeout(S,s.refreshInterval)),[2]}})})};s.refreshInterval&&(x=setTimeout(S,s.refreshInterval)),s.revalidateOnFocus&&(document.addEventListener("visibilitychange",y,!1),window.addEventListener("focus",y,!1))}),d.onUnmounted(function(){a=!0,x&&clearTimeout(x),s.revalidateOnFocus&&(document.removeEventListener("visibilitychange",y,!1),window.removeEventListener("focus",y,!1));var S=xa.get(f.value);S&&(S.data=S.data.filter(function(k){return k!==m}))});try{d.watch(f,function(S){d.isReadonly(f)||(f.value=S),m.key=S,m.isValidating=!!S,hC(f.value,m,h),!u&&!o&&f.value&&g(),o=!1},{immediate:!0})}catch{}var v=hn(hn({},d.toRefs(m)),{mutate:function(S,k){return g(S,hn(hn({},k),{forceRevalidate:!0}))}});return v}function gC(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function pC(e,t,n){const{data:i,error:r,isValidating:s,mutate:a}=mC(e,t,{revalidateDebounce:500,revalidateOnFocus:!1,dedupingInterval:100,...n});return{data:d.computed(()=>i.value),response:i,error:r,isValidating:s,revalidate:a}}const $i={useI18n:QD,useMetricCardBuilder:rC,useMetricFetcher:iC,useTrendRange:Jm,useRequest:pC},yC=Symbol("METRICS_PROVIDER_KEY");function bC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rg={exports:{}};(function(e){(function(){function t(l,u){if(u.separator===!1||l<1e3)return l.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(l).toString().split("");return m.reverse().forEach(function(g,y){y&&y%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function n(l,u,h){var f=l/u,m=h.round?"round":"floor";return h.decimal===!1?(l=Math[m](f),l.toString()):(h.precision?l=f:l=f<10?Math[m](f*10)/10:Math[m](f),l=l.toString(),typeof h.decimal=="string"&&(l=l.replace(".",h.decimal)),l)}var i=1e3,r=1e4,s=1e6,a=1e9,o=1e12;function c(l,u){var h;u=u||{};var f=l<0;f&&(l=Math.abs(l)),u.precision&&(l=parseFloat(l.toPrecision(u.precision)));var m=u.min10k?r:i;return l<m||u.precision&&u.precision>Math.log10(l)?h=t(n(l,1,u),u):l<s?h=n(l,i,u)+"k":l<a?h=n(l,s,u)+"m":l<o?h=t(n(l,a,u),u)+"b":h=t(n(l,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}c.addCommas=t,e.exports=c})()})(rg);var _C=rg.exports;const xC=bC(_C);var fn=(e=>(e.GENERIC_COUNT="GenericCount",e.TRAFFIC="Traffic",e.ERROR_RATE="ErrorRate",e.LATENCY="Latency",e))(fn||{}),Xe=(e=>(e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xl",e))(Xe||{});const Kl=2,sg=Kl+2,ag=(e,t,n=!1)=>{let i=!t||Number(e.toFixed(sg))===0?0:Number(e.toFixed(sg))>0?1:-1;return n&&(i*=-1),i},og=(e,t,n)=>t?`${Math.abs(e*100).toFixed(Kl)}%`:n,lg=(e,t)=>t===0?0:e/t-1,cg=(e,t=!1)=>(t&&(e*=-1),e>0?Jt.TrendUpIcon:e<0?Jt.TrendDownIcon:Jt.IndeterminateSmallIcon),wC="#ad000e",Zl="#6c7489",ug="#52596e",vC="#007d60",wa="16px",SC="20px",kC={key:0,class:"metricscard-description"},MC={class:"metricscard-valuetrend"},TC={key:0,class:"metricscard-error"},DC={key:2,class:"metricscard-trend"},CC={"data-testid":"metric-trend-change"},EC={key:0,class:"metricscard-trend-range"},OC=d.defineComponent({__name:"MetricsCard",props:{cardType:{type:String,required:!0,default:fn.GENERIC_COUNT},title:{type:String,default:"0%",required:!0},description:{type:String,default:"",required:!1},tooltip:{type:String,required:!1,default:""},timeframe:{type:String,required:!1,default:""},metricValue:{type:String,default:""},metricChange:{type:String,required:!0},changePolarity:{type:Number,required:!0},trendIcon:{type:Object,default:Jt.IndeterminateSmallIcon},trendRange:{type:String,default:""},hasError:{type:Boolean,default:!1},errorMessage:{type:String,default:"Vitals data error"},cardSize:{type:String,required:!1,default:()=>Xe.Large},hasContainerTitle:{type:Boolean,required:!1,default:!1},titleTag:{type:String,default:"span"}},setup(e){const t=new Map([[fn.GENERIC_COUNT,Jt.VitalsIcon],[fn.TRAFFIC,Jt.CloudUploadIcon],[fn.ERROR_RATE,Jt.WarningOutlineIcon],[fn.LATENCY,Jt.ResponseIcon]]),n=e,i=o=>{const c={red:`var(--kui-color-text-danger-strong, ${wC})`,green:`var(--kui-color-text-success, ${vC})`,grey:`var(--kui-color-text-neutral-strong, ${ug})`};return o>0?c.green:o<0?c.red:c.grey},r=o=>o>0?"positive":o<0?"negative":"neutral",s=[Xe.Medium,Xe.Large].includes(n.cardSize),a=[Xe.Small].includes(n.cardSize);return(o,c)=>{const l=d.resolveComponent("KTooltip");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["metricscard",e.cardSize])},[d.createElementVNode("div",{class:d.normalizeClass(["metricscard-title",e.cardSize])},[d.unref(a)?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(t).get(e.cardType)),{key:0,class:"metricscard-icon",color:`var(--kui-color-text-neutral, ${d.unref(Zl)})`,size:d.unref(wa)},null,8,["color","size"])),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.titleTag),null,{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(e.title),1)]),_:1})),e.tooltip?(d.openBlock(),d.createBlock(l,{key:1,class:"metricscard-tooltip",placement:"right",text:e.tooltip},{default:d.withCtx(()=>[d.createVNode(d.unref(Jt.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Zl)})`,size:d.unref(wa)},null,8,["color","size"])]),_:1},8,["text"])):d.createCommentVNode("",!0)],2),e.description&&d.unref(s)?(d.openBlock(),d.createElementBlock("div",kC,[d.createElementVNode("span",null,d.toDisplayString(e.description),1)])):d.createCommentVNode("",!0),d.createElementVNode("div",MC,[e.hasError?(d.openBlock(),d.createElementBlock("div",TC,[d.createVNode(d.unref(Jt.WarningIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Zl)})`,size:d.unref(SC)},null,8,["color","size"]),d.createElementVNode("div",null," "+d.toDisplayString(e.errorMessage),1)])):(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["metricscard-value",e.cardSize]),"data-testid":"metric-value"},d.toDisplayString(e.metricValue),3)),d.unref(s)?(d.openBlock(),d.createElementBlock("div",DC,[d.createElementVNode("div",{class:d.normalizeClass(["metricscard-trend-change",r(e.changePolarity)]),"data-testid":"metric-trend-parent"},[e.changePolarity!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.trendIcon),{key:0,color:i(e.changePolarity),size:d.unref(wa)},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(Jt.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(ug)})`,size:d.unref(wa)},null,8,["color","size"])),d.createElementVNode("div",CC,d.toDisplayString(e.metricChange),1)],2),e.trendRange?(d.openBlock(),d.createElementBlock("div",EC,d.toDisplayString(e.trendRange),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)])],2)}}}),Ql=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},PC=Ql(OC,[["__scopeId","data-v-b1513f6f"]]),RC={},AC={class:"loading-tabs"};function IC(e,t){const n=d.resolveComponent("KSkeletonBox");return d.openBlock(),d.createElementBlock("div",AC,[d.createVNode(n,{width:"100"}),d.createVNode(n,{width:"75"})])}const LC=Ql(RC,[["render",IC],["__scopeId","data-v-9c7113d7"]]),NC={key:0,class:"container-title"},FC={key:0,class:"container-description"},BC={key:1,class:"error-display"},zC={key:0,class:"error-display-message"},HC={key:2,class:"cards-wrapper"},VC=d.defineComponent({__name:"MetricCardContainer",props:{fallbackDisplayText:{type:String,required:!0},cards:{type:Array,required:!0},errorMessage:{type:String,required:!1,default:""},loading:{type:Boolean,required:!1,default:!1},hasTrendAccess:{type:Boolean,required:!1,default:!0},cardSize:{type:String,required:!1,default:()=>Xe.Large},containerTitle:{type:String,required:!1,default:""},containerDescription:{type:String,required:!1,default:""}},setup(e){const t=e,n=d.computed(()=>t.cards.every(r=>(r==null?void 0:r.hasError)===!0)),i=r=>{const s=lg(r.currentValue,r.previousValue)||0,a=ag(s,t.hasTrendAccess,r.increaseIsBad);return{metricValue:r.formatValueFn?r.formatValueFn(r.currentValue):xC(r.currentValue,{capital:!0,round:!0})||"0",metricChange:r.formatChangeFn?r.formatChangeFn(s):og(s,t.hasTrendAccess,t.fallbackDisplayText),changePolarity:a,trendIcon:cg(a,r.increaseIsBad),cardSize:t.cardSize,hasContainerTitle:!!t.containerTitle}};return(r,s)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["kong-ui-public-metric-card-container",e.cardSize])},[t.containerTitle||t.containerDescription?(d.openBlock(),d.createElementBlock("div",NC,[d.createTextVNode(d.toDisplayString(t.containerTitle)+" ",1),t.containerDescription?(d.openBlock(),d.createElementBlock("div",FC,d.toDisplayString(t.containerDescription),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),n.value?(d.openBlock(),d.createElementBlock("div",BC,[d.createVNode(d.unref(Jt.WarningIcon),{class:"error-display-icon"}),e.errorMessage?(d.openBlock(),d.createElementBlock("div",zC,d.toDisplayString(e.errorMessage),1)):d.createCommentVNode("",!0)])):(d.openBlock(),d.createElementBlock("div",HC,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.cards,(a,o)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[e.loading?(d.openBlock(),d.createElementBlock("div",{key:`skeleton-${o}`,class:"loading-tab"},[d.createVNode(LC,{class:d.normalizeClass(e.cardSize===d.unref(Xe).Small?"loading-tabs-small":"loading-tabs-large")},null,8,["class"])])):(d.openBlock(),d.createBlock(PC,d.mergeProps({key:o},{ref_for:!0},i(a),{"card-size":e.cardSize,"card-type":a.cardType,description:a.description,"error-message":e.errorMessage,"has-error":a.hasError,title:a.title,"title-tag":a.titleTag,tooltip:a.tooltip,"trend-range":a.trendRange}),null,16,["card-size","card-type","description","error-message","has-error","title","title-tag","tooltip","trend-range"]))],64))),256))]))],2))}}),$C=Ql(VC,[["__scopeId","data-v-7080ba56"]]);Xe.Large;const WC={key:1,class:"single-value-wrapper"},YC={class:"single-value","data-testid":"single-value-chart"},jC={key:0,class:"single-value-unit"},UC={key:1,class:"single-value-trend"},qC={key:0,class:"single-value-trend-range"},XC=Ee(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Hf},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(e){const{i18n:t}=mt.useI18n(),{formatBytes:n}=Oi({i18n:t}),i=e,r={left:"flex-start",center:"center",right:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"},s=d.ref(i.leftAlign?"left":i.alignX),a=d.computed(()=>i.data.data),o=d.computed(()=>{var E,P;return(P=(E=i.data.meta)==null?void 0:E.metric_names)==null?void 0:P[0]}),c=d.computed(()=>{var P,T;const E=o.value?(T=(P=i.data.meta)==null?void 0:P.metric_units)==null?void 0:T[o.value]:void 0;if(E)return t.t(`chartUnits.${E}`,{plural:""})}),l=d.computed(()=>{var E;return o.value==="request_per_minute"||!!((E=o.value)!=null&&E.includes("_latency_"))}),u=d.computed(()=>!i.showTrend||a.value.length<2||!o.value?null:a.value[0].event[o.value]??null),h=d.computed(()=>{if(!o.value)return null;const E=i.showTrend?1:0;if(a.value.length<=E)return null;const P=a.value[E].event[o.value];return typeof P!="number"||isNaN(P)?null:P??null}),f=d.computed(()=>{var T;const E=h.value;if(E===null)return"";if((T=o.value)!=null&&T.includes("_size_"))return n(E);if(E>=1e9){const p=(E/1e9).toFixed(1);return p.endsWith(".0")?`${Math.floor(E/1e9)}B`:`${p}B`}if(E>=1e7){const p=(E/1e6).toFixed(1);return p.endsWith(".0")?`${Math.floor(E/1e6)}M`:`${p}M`}const P=i.decimalPoints&&typeof i.decimalPoints=="number"?i.decimalPoints:Hf;return E.toLocaleString("en-US",{maximumFractionDigits:P})}),m=d.computed(()=>lg(h.value??0,u.value??0)||0),g=d.computed(()=>ag(m.value,!0,i.increaseIsBad)),y=d.computed(()=>cg(g.value)),x=d.computed(()=>og(m.value,!0,t.t("singleValue.trend.not_available"))),v=d.computed(()=>({justifyContent:r[s.value]??"space-evenly"})),S=Jm(d.computed(()=>i.showTrend),void 0,d.computed(()=>i.data.meta)),k=E=>E>0?"positive":E<0?"negative":"neutral",C=E=>E>0?xS:E<0?_S:pf;return d.onMounted(()=>{var E,P,T,p;!i.showTrend&&((P=(E=i.data)==null?void 0:E.data)==null?void 0:P.length)>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",i.data.data.length):i.showTrend&&((p=(T=i.data)==null?void 0:T.data)==null?void 0:p.length)!==2&&console.warn("SingleValue with trend expects exactly 2 data points. Data length:",i.data.data.length)}),d.watch(d.toRef(i,"alignX"),E=>{E&&(s.value=E)}),(E,P)=>{const T=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:"chart-parent","data-testid":"single-value-parent",style:d.normalizeStyle(v.value)},[h.value===null?(d.openBlock(),d.createBlock(T,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t).t("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",WC,[d.createElementVNode("span",YC,d.toDisplayString(f.value),1),l.value?(d.openBlock(),d.createElementBlock("span",jC,"  "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0),e.showTrend?(d.openBlock(),d.createElementBlock("div",UC,[d.createElementVNode("div",{class:d.normalizeClass(["trend-change",k(g.value)]),"data-testid":"single-value-trend"},[g.value!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(y.value),{key:0,color:C(g.value),size:d.unref(zr)},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(Jt.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(pf)})`,size:d.unref(zr)},null,8,["color","size"])),d.createElementVNode("div",null,d.toDisplayString(x.value),1)],2),d.unref(S)?(d.openBlock(),d.createElementBlock("div",qC,d.toDisplayString(d.unref(S)),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))],4)}}}),[["__scopeId","data-v-8271dbc2"]]),GC={class:"simple-chart-shell"},KC={key:1,class:"analytics-chart-parent"},ZC=Ee(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:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.computed(()=>{var u;const l=mt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||un},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(l==null||l.datasets.reverse()),l}),r=d.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),s=d.computed(()=>t.chartOptions.type==="gauge"),a=d.computed(()=>t.chartOptions.type==="single_value"),o=d.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),c=d.computed(()=>{var u,h;const l=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const f=(h=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:h[0];return t.chartOptions.showTrend?l&&t.chartData.data.length>=2&&t.chartData.data[1].event[f]!==null:l&&t.chartData.data[0].event[f]!==null}return l});return(l,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",GC,[c.value?(d.openBlock(),d.createElementBlock("div",KC,[s.value?(d.openBlock(),d.createBlock(UD,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":r.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),a.value?(d.openBlock(),d.createBlock(XC,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):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(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-56837d34"]]),QC={class:"top-n-card-title","data-testid":"top-n-card-title"},JC={class:"top-n-card-description","data-testid":"top-n-card-description"},tE={key:3,class:"top-n-table","data-testid":"top-n-table"},eE={class:"top-n-table-table"},nE={"data-testid":"top-n-table-header"},iE={class:"top-n-table-header-row"},rE={class:"table-header-label"},sE={class:"top-n-table-cell top-n-table-cell--name"},aE=["data-testid"],oE=["data-testid"],lE=["data-testid"],cE=Ee(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(e){const t=e,{i18n:n}=mt.useI18n(),{formatUnit:i}=Oi({i18n:n}),r=d.computed(()=>t.data.data),s=d.computed(()=>{var P;return!!((P=r.value)!=null&&P.length)}),a=d.computed(()=>{var P,T;return(P=t.data.meta)!=null&&P.display&&((T=Object.keys(t.data.meta.display))==null?void 0:T[0])||""}),o=d.computed(()=>a.value?t.data.meta.display[a.value]:{}),c=d.computed(()=>{var P,T;return(T=(P=t.data.meta)==null?void 0:P.metric_names)!=null&&T.length?t.data.meta.metric_names:[]}),l=d.computed(()=>c.value[0]),u=d.computed(()=>l.value?n.t(`chartLabels.${l.value}`)||l.value:""),h=d.computed(()=>{const P=[{key:"name",label:n.t("topNTable.nameLabel")}];return l.value&&P.push({key:"value",label:u.value}),c.value.forEach((T,p)=>{if(p===0)return;const _=n.t(`chartLabels.${T}`)||T;P.push({key:T,label:_})}),P}),f=d.computed(()=>h.value.filter(P=>P.key!=="name")),m=P=>{const T=P.event;return String(T[a.value])},g=P=>{const T=m(P),p=o.value&&o.value[T];return p?p.name:"-"},y=P=>{const T=m(P),p=o.value&&o.value[T];return p?!!p.deleted:!1},x=(P,T)=>{var A,I;const p=P.event[T];if(p==null)return"–";const _=typeof p=="number"?p:Number(p);if(Number.isNaN(_))return"–";const M=((I=(A=t.data.meta)==null?void 0:A.metric_units)==null?void 0:I[T])||"count",O=["count","count/minute","token count"].includes(M);return i(_,M,{approximate:O,isBytes1024:!0,translateUnit:B=>E(B,_)})},v=P=>l.value?x(P,l.value):"–",S=d.computed(()=>{var P;return(P=r.value)!=null&&P.length?r.value.map(T=>{const _={id:m(T),name:g(T),deleted:y(T),original:T};return l.value&&(_.value=v(T)),c.value.forEach((M,O)=>{O!==0&&(_[M]=x(T,M))}),_}):[]}),k=d.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value&&!Object.keys(o.value).length)return n.t("topNTable.errors.display");if(!l.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),C=(P,T)=>{const p=P[T];return typeof p=="string"?p:p==null?"–":String(p)},E=(P,T)=>{if(P==="count"||P==="requests")return"";const p=T===1?"":"s";return n.te(`chartUnits.${P}`)?n.t(`chartUnits.${P}`,{plural:p}):P};return(P,T)=>{const p=d.resolveComponent("KEmptyState"),_=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},d.createSlots({default:d.withCtx(()=>[k.value?(d.openBlock(),d.createBlock(p,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(k.value),1)]),_:1})):e.isLoading?(d.openBlock(),d.createBlock(_,{key:1,"table-columns":2,type:"table"})):s.value?(d.openBlock(),d.createElementBlock("div",tE,[d.createElementVNode("table",eE,[d.createElementVNode("thead",nE,[d.createElementVNode("tr",iE,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(h.value,O=>(d.openBlock(),d.createElementBlock("th",{key:O.key,class:d.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":O.key!=="name"}]),"data-testid":"top-n-table-header-column"},[d.createElementVNode("span",rE,d.toDisplayString(O.label),1)],2))),128))])]),d.createElementVNode("tbody",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(S.value,O=>(d.openBlock(),d.createElementBlock("tr",{key:O.id,class:"top-n-table-row"},[d.createElementVNode("td",sE,[d.createElementVNode("span",{"data-testid":`row-${O.id}`},[d.renderSlot(P.$slots,"name",{record:{id:O.id,name:O.name,deleted:O.deleted,dimension:a.value}},()=>[d.createTextVNode(d.toDisplayString(O.name),1)],!0)],8,aE)]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,A=>(d.openBlock(),d.createElementBlock("td",{key:A.key,class:"top-n-table-cell top-n-table-cell-metric"},[A.key==="value"?(d.openBlock(),d.createElementBlock("span",{key:0,"data-testid":`row-${O.id}`},d.toDisplayString(C(O,A.key)),9,oE)):(d.openBlock(),d.createElementBlock("span",{key:1,"data-testid":`row-${O.id}-${A.key}`},d.toDisplayString(C(O,A.key)),9,lE))]))),128))]))),128))])])])):(d.openBlock(),d.createBlock(p,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(e.emptyStateTitle||d.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",QC,d.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",JC,d.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-27e5b22c"]]);var va={exports:{}};va.exports,function(e,t){var n=200,i="Expected a function",r="__lodash_hash_undefined__",s=1,a=2,o=9007199254740991,c="[object Arguments]",l="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",y="[object Map]",x="[object Number]",v="[object Object]",S="[object Promise]",k="[object RegExp]",C="[object Set]",E="[object String]",P="[object Symbol]",T="[object WeakMap]",p="[object ArrayBuffer]",_="[object DataView]",M="[object Float32Array]",O="[object Float64Array]",A="[object Int8Array]",I="[object Int16Array]",B="[object Int32Array]",j="[object Uint8Array]",G="[object Uint8ClampedArray]",$="[object Uint16Array]",lt="[object Uint32Array]",q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,z=/^\./,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W=/[\\^$.*+?()[\]{}|]/g,yt=/\\(\\)?/g,_t=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,H={};H[M]=H[O]=H[A]=H[I]=H[B]=H[j]=H[G]=H[$]=H[lt]=!0,H[c]=H[l]=H[p]=H[u]=H[_]=H[h]=H[f]=H[m]=H[y]=H[x]=H[v]=H[k]=H[C]=H[E]=H[T]=!1;var X=typeof we=="object"&&we&&we.Object===Object&&we,Q=typeof self=="object"&&self&&self.Object===Object&&self,J=X||Q||Function("return this")(),K=t&&!t.nodeType&&t,gt=K&&!0&&e&&!e.nodeType&&e,vt=gt&&gt.exports===K,st=vt&&X.process,bt=function(){try{return st&&st.binding("util")}catch{}}(),dt=bt&&bt.isTypedArray;function jt(b,D){for(var N=-1,V=b?b.length:0;++N<V;)if(D(b[N],N,b))return!0;return!1}function ot(b){return function(D){return D==null?void 0:D[b]}}function St(b,D){for(var N=-1,V=Array(b);++N<b;)V[N]=D(N);return V}function ee(b){return function(D){return b(D)}}function le(b,D){return b==null?void 0:b[D]}function Ut(b){var D=!1;if(b!=null&&typeof b.toString!="function")try{D=!!(b+"")}catch{}return D}function Ge(b){var D=-1,N=Array(b.size);return b.forEach(function(V,ht){N[++D]=[ht,V]}),N}function Et(b,D){return function(N){return b(D(N))}}function ne(b){var D=-1,N=Array(b.size);return b.forEach(function(V){N[++D]=V}),N}var Ft=Array.prototype,qt=Function.prototype,ie=Object.prototype,Ke=J["__core-js_shared__"],ci=function(){var b=/[^.]+$/.exec(Ke&&Ke.keys&&Ke.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""}(),Be=qt.toString,Bt=ie.hasOwnProperty,Se=ie.toString,ui=RegExp("^"+Be.call(Bt).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sa=J.Symbol,ka=J.Uint8Array,Zr=ie.propertyIsEnumerable,di=Ft.splice,Qr=Et(Object.keys,Object),hi=bn(J,"DataView"),mn=bn(J,"Map"),gn=bn(J,"Promise"),Jr=bn(J,"Set"),ts=bn(J,"WeakMap"),fi=bn(Object,"create"),ec=xn(hi),nc=xn(mn),Ma=xn(gn),Ta=xn(Jr),pn=xn(ts),Wi=Sa?Sa.prototype:void 0,es=Wi?Wi.valueOf:void 0,Da=Wi?Wi.toString:void 0;function yn(b){var D=-1,N=b?b.length:0;for(this.clear();++D<N;){var V=b[D];this.set(V[0],V[1])}}function ic(){this.__data__=fi?fi(null):{}}function ze(b){return this.has(b)&&delete this.__data__[b]}function rc(b){var D=this.__data__;if(fi){var N=D[b];return N===r?void 0:N}return Bt.call(D,b)?D[b]:void 0}function sc(b){var D=this.__data__;return fi?D[b]!==void 0:Bt.call(D,b)}function ac(b,D){var N=this.__data__;return N[b]=fi&&D===void 0?r:D,this}yn.prototype.clear=ic,yn.prototype.delete=ze,yn.prototype.get=rc,yn.prototype.has=sc,yn.prototype.set=ac;function He(b){var D=-1,N=b?b.length:0;for(this.clear();++D<N;){var V=b[D];this.set(V[0],V[1])}}function oc(){this.__data__=[]}function Hn(b){var D=this.__data__,N=Ui(D,b);if(N<0)return!1;var V=D.length-1;return N==V?D.pop():di.call(D,N,1),!0}function lc(b){var D=this.__data__,N=Ui(D,b);return N<0?void 0:D[N][1]}function cc(b){return Ui(this.__data__,b)>-1}function uc(b,D){var N=this.__data__,V=Ui(N,b);return V<0?N.push([b,D]):N[V][1]=D,this}He.prototype.clear=oc,He.prototype.delete=Hn,He.prototype.get=lc,He.prototype.has=cc,He.prototype.set=uc;function Ve(b){var D=-1,N=b?b.length:0;for(this.clear();++D<N;){var V=b[D];this.set(V[0],V[1])}}function dc(){this.__data__={hash:new yn,map:new(mn||He),string:new yn}}function Vn(b){return Gi(this,b).delete(b)}function hc(b){return Gi(this,b).get(b)}function fc(b){return Gi(this,b).has(b)}function mc(b,D){return Gi(this,b).set(b,D),this}Ve.prototype.clear=dc,Ve.prototype.delete=Vn,Ve.prototype.get=hc,Ve.prototype.has=fc,Ve.prototype.set=mc;function Yi(b){var D=-1,N=b?b.length:0;for(this.__data__=new Ve;++D<N;)this.add(b[D])}function gc(b){return this.__data__.set(b,r),this}function pc(b){return this.__data__.has(b)}Yi.prototype.add=Yi.prototype.push=gc,Yi.prototype.has=pc;function Ie(b){this.__data__=new He(b)}function ji(){this.__data__=new He}function yc(b){return this.__data__.delete(b)}function ns(b){return this.__data__.get(b)}function bc(b){return this.__data__.has(b)}function _c(b,D){var N=this.__data__;if(N instanceof He){var V=N.__data__;if(!mn||V.length<n-1)return V.push([b,D]),this;N=this.__data__=new Ve(V)}return N.set(b,D),this}Ie.prototype.clear=ji,Ie.prototype.delete=yc,Ie.prototype.get=ns,Ie.prototype.has=bc,Ie.prototype.set=_c;function xc(b,D){var N=w(b)||Ia(b)?St(b.length,String):[],V=N.length,ht=!!V;for(var et in b)Bt.call(b,et)&&!(ht&&(et=="length"||rs(et,V)))&&N.push(et);return N}function Ui(b,D){for(var N=b.length;N--;)if(Aa(b[N][0],D))return N;return-1}var wc=Pc();function vc(b,D){return b&&wc(b,D,gi)}function qi(b,D){D=Ki(D,b)?[D]:Ze(D);for(var N=0,V=D.length;b!=null&&N<V;)b=b[_n(D[N++])];return N&&N==V?b:void 0}function Sc(b){return Se.call(b)}function kc(b,D){return b!=null&&D in Object(b)}function is(b,D,N,V,ht){return b===D?!0:b==null||D==null||!Xt(b)&&!ke(D)?b!==b&&D!==D:Mc(b,D,is,N,V,ht)}function Mc(b,D,N,V,ht,et){var pt=w(b),Gt=w(D),zt=l,ue=l;pt||(zt=ce(b),zt=zt==c?v:zt),Gt||(ue=ce(D),ue=ue==c?v:ue);var Me=zt==v&&!Ut(b),Te=ue==v&&!Ut(D),ge=zt==ue;if(ge&&!Me)return et||(et=new Ie),pt||La(b)?Oa(b,D,N,V,ht,et):Rc(b,D,zt,N,V,ht,et);if(!(ht&a)){var Le=Me&&Bt.call(b,"__wrapped__"),Ne=Te&&Bt.call(D,"__wrapped__");if(Le||Ne){var Yn=Le?b.value():b,wn=Ne?D.value():D;return et||(et=new Ie),N(Yn,wn,V,ht,et)}}return ge?(et||(et=new Ie),Ac(b,D,N,V,ht,et)):!1}function Tc(b,D,N,V){var ht=N.length,et=ht;if(b==null)return!et;for(b=Object(b);ht--;){var pt=N[ht];if(pt[2]?pt[1]!==b[pt[0]]:!(pt[0]in b))return!1}for(;++ht<et;){pt=N[ht];var Gt=pt[0],zt=b[Gt],ue=pt[1];if(pt[2]){if(zt===void 0&&!(Gt in b))return!1}else{var Me=new Ie,Te;if(!(Te===void 0?is(ue,zt,V,s|a,Me):Te))return!1}}return!0}function Dc(b){if(!Xt(b)||Pa(b))return!1;var D=tt(b)||Ut(b)?ui:_t;return D.test(xn(b))}function Cc(b){return ke(b)&&$t(b.length)&&!!H[Se.call(b)]}function Ca(b){return typeof b=="function"?b:b==null?Zi:typeof b=="object"?w(b)?Xi(b[0],b[1]):Oc(b):eO(b)}function Ec(b){if(!Nc(b))return Qr(b);var D=[];for(var N in Object(b))Bt.call(b,N)&&N!="constructor"&&D.push(N);return D}function Oc(b){var D=Ic(b);return D.length==1&&D[0][2]?as(D[0][0],D[0][1]):function(N){return N===b||Tc(N,b,D)}}function Xi(b,D){return Ki(b)&&Ra(D)?as(_n(b),D):function(N){var V=Na(N,b);return V===void 0&&V===D?Fa(N,b):is(D,V,void 0,s|a)}}function $n(b){return function(D){return qi(D,b)}}function Ea(b){if(typeof b=="string")return b;if(Qt(b))return Da?Da.call(b):"";var D=b+"";return D=="0"&&1/b==-1/0?"-0":D}function Ze(b){return w(b)?b:Fc(b)}function Pc(b){return function(D,N,V){for(var ht=-1,et=Object(D),pt=V(D),Gt=pt.length;Gt--;){var zt=pt[++ht];if(N(et[zt],zt,et)===!1)break}return D}}function Oa(b,D,N,V,ht,et){var pt=ht&a,Gt=b.length,zt=D.length;if(Gt!=zt&&!(pt&&zt>Gt))return!1;var ue=et.get(b);if(ue&&et.get(D))return ue==D;var Me=-1,Te=!0,ge=ht&s?new Yi:void 0;for(et.set(b,D),et.set(D,b);++Me<Gt;){var Le=b[Me],Ne=D[Me];if(V)var Yn=pt?V(Ne,Le,Me,D,b,et):V(Le,Ne,Me,b,D,et);if(Yn!==void 0){if(Yn)continue;Te=!1;break}if(ge){if(!jt(D,function(wn,pi){if(!ge.has(pi)&&(Le===wn||N(Le,wn,V,ht,et)))return ge.add(pi)})){Te=!1;break}}else if(!(Le===Ne||N(Le,Ne,V,ht,et))){Te=!1;break}}return et.delete(b),et.delete(D),Te}function Rc(b,D,N,V,ht,et,pt){switch(N){case _:if(b.byteLength!=D.byteLength||b.byteOffset!=D.byteOffset)return!1;b=b.buffer,D=D.buffer;case p:return!(b.byteLength!=D.byteLength||!V(new ka(b),new ka(D)));case u:case h:case x:return Aa(+b,+D);case f:return b.name==D.name&&b.message==D.message;case k:case E:return b==D+"";case y:var Gt=Ge;case C:var zt=et&a;if(Gt||(Gt=ne),b.size!=D.size&&!zt)return!1;var ue=pt.get(b);if(ue)return ue==D;et|=s,pt.set(b,D);var Me=Oa(Gt(b),Gt(D),V,ht,et,pt);return pt.delete(b),Me;case P:if(es)return es.call(b)==es.call(D)}return!1}function Ac(b,D,N,V,ht,et){var pt=ht&a,Gt=gi(b),zt=Gt.length,ue=gi(D),Me=ue.length;if(zt!=Me&&!pt)return!1;for(var Te=zt;Te--;){var ge=Gt[Te];if(!(pt?ge in D:Bt.call(D,ge)))return!1}var Le=et.get(b);if(Le&&et.get(D))return Le==D;var Ne=!0;et.set(b,D),et.set(D,b);for(var Yn=pt;++Te<zt;){ge=Gt[Te];var wn=b[ge],pi=D[ge];if(V)var bg=pt?V(pi,wn,ge,D,b,et):V(wn,pi,ge,b,D,et);if(!(bg===void 0?wn===pi||N(wn,pi,V,ht,et):bg)){Ne=!1;break}Yn||(Yn=ge=="constructor")}if(Ne&&!Yn){var Ba=b.constructor,za=D.constructor;Ba!=za&&"constructor"in b&&"constructor"in D&&!(typeof Ba=="function"&&Ba instanceof Ba&&typeof za=="function"&&za instanceof za)&&(Ne=!1)}return et.delete(b),et.delete(D),Ne}function Gi(b,D){var N=b.__data__;return ss(D)?N[typeof D=="string"?"string":"hash"]:N.map}function Ic(b){for(var D=gi(b),N=D.length;N--;){var V=D[N],ht=b[V];D[N]=[V,ht,Ra(ht)]}return D}function bn(b,D){var N=le(b,D);return Dc(N)?N:void 0}var ce=Sc;(hi&&ce(new hi(new ArrayBuffer(1)))!=_||mn&&ce(new mn)!=y||gn&&ce(gn.resolve())!=S||Jr&&ce(new Jr)!=C||ts&&ce(new ts)!=T)&&(ce=function(b){var D=Se.call(b),N=D==v?b.constructor:void 0,V=N?xn(N):void 0;if(V)switch(V){case ec:return _;case nc:return y;case Ma:return S;case Ta:return C;case pn:return T}return D});function Lc(b,D,N){D=Ki(D,b)?[D]:Ze(D);for(var V,ht=-1,pt=D.length;++ht<pt;){var et=_n(D[ht]);if(!(V=b!=null&&N(b,et)))break;b=b[et]}if(V)return V;var pt=b?b.length:0;return!!pt&&$t(pt)&&rs(et,pt)&&(w(b)||Ia(b))}function rs(b,D){return D=D??o,!!D&&(typeof b=="number"||Y.test(b))&&b>-1&&b%1==0&&b<D}function Ki(b,D){if(w(b))return!1;var N=typeof b;return N=="number"||N=="symbol"||N=="boolean"||b==null||Qt(b)?!0:Z.test(b)||!q.test(b)||D!=null&&b in Object(D)}function ss(b){var D=typeof b;return D=="string"||D=="number"||D=="symbol"||D=="boolean"?b!=="__proto__":b===null}function Pa(b){return!!ci&&ci in b}function Nc(b){var D=b&&b.constructor,N=typeof D=="function"&&D.prototype||ie;return b===N}function Ra(b){return b===b&&!Xt(b)}function as(b,D){return function(N){return N==null?!1:N[b]===D&&(D!==void 0||b in Object(N))}}var Fc=mi(function(b){b=Wn(b);var D=[];return z.test(b)&&D.push(""),b.replace(U,function(N,V,ht,et){D.push(ht?et.replace(yt,"$1"):V||N)}),D});function _n(b){if(typeof b=="string"||Qt(b))return b;var D=b+"";return D=="0"&&1/b==-1/0?"-0":D}function xn(b){if(b!=null){try{return Be.call(b)}catch{}try{return b+""}catch{}}return""}function mi(b,D){if(typeof b!="function"||D&&typeof D!="function")throw new TypeError(i);var N=function(){var V=arguments,ht=D?D.apply(this,V):V[0],et=N.cache;if(et.has(ht))return et.get(ht);var pt=b.apply(this,V);return N.cache=et.set(ht,pt),pt};return N.cache=new(mi.Cache||Ve),N}mi.Cache=Ve;function Aa(b,D){return b===D||b!==b&&D!==D}function Ia(b){return F(b)&&Bt.call(b,"callee")&&(!Zr.call(b,"callee")||Se.call(b)==c)}var w=Array.isArray;function L(b){return b!=null&&$t(b.length)&&!tt(b)}function F(b){return ke(b)&&L(b)}function tt(b){var D=Xt(b)?Se.call(b):"";return D==m||D==g}function $t(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=o}function Xt(b){var D=typeof b;return!!b&&(D=="object"||D=="function")}function ke(b){return!!b&&typeof b=="object"}function Qt(b){return typeof b=="symbol"||ke(b)&&Se.call(b)==P}var La=dt?ee(dt):Cc;function Wn(b){return b==null?"":Ea(b)}function Na(b,D,N){var V=b==null?void 0:qi(b,D);return V===void 0?N:V}function Fa(b,D){return b!=null&&Lc(b,D,kc)}function gi(b){return L(b)?xc(b):Ec(b)}function os(b,D){var N={};return D=Ca(D),vc(b,function(V,ht,et){N[D(V,ht,et)]=V}),N}function Zi(b){return b}function eO(b){return Ki(b)?ot(_n(b)):$n(b)}e.exports=os}(va,va.exports);var uE=va.exports;const dE=vl(uE);var hE=9007199254740991,fE="[object Arguments]",mE="[object Function]",gE="[object GeneratorFunction]",pE="[object Symbol]",yE=typeof we=="object"&&we&&we.Object===Object&&we,bE=typeof self=="object"&&self&&self.Object===Object&&self,_E=yE||bE||Function("return this")();function xE(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function wE(e,t){for(var n=-1,i=e?e.length:0,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}function vE(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var Jl=Object.prototype,SE=Jl.hasOwnProperty,tc=Jl.toString,dg=_E.Symbol,kE=Jl.propertyIsEnumerable,hg=dg?dg.isConcatSpreadable:void 0,fg=Math.max;function ME(e,t,n,i,r){var s=-1,a=e.length;for(n||(n=EE),r||(r=[]);++s<a;){var o=e[s];n(o)?vE(r,o):r[r.length]=o}return r}function TE(e,t){return e=Object(e),DE(e,t,function(n,i){return i in e})}function DE(e,t,n){for(var i=-1,r=t.length,s={};++i<r;){var a=t[i],o=e[a];n(o,a)&&(s[a]=o)}return s}function CE(e,t){return t=fg(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,r=fg(n.length-t,0),s=Array(r);++i<r;)s[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=s,xE(e,this,a)}}function EE(e){return RE(e)||PE(e)||!!(hg&&e&&e[hg])}function OE(e){if(typeof e=="string"||BE(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function PE(e){return IE(e)&&SE.call(e,"callee")&&(!kE.call(e,"callee")||tc.call(e)==fE)}var RE=Array.isArray;function AE(e){return e!=null&&NE(e.length)&&!LE(e)}function IE(e){return mg(e)&&AE(e)}function LE(e){var t=FE(e)?tc.call(e):"";return t==mE||t==gE}function NE(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=hE}function FE(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function mg(e){return!!e&&typeof e=="object"}function BE(e){return typeof e=="symbol"||mg(e)&&tc.call(e)==pE}var zE=CE(function(e,t){return e==null?{}:TE(e,wE(ME(t),OE))}),HE=zE;const VE=vl(HE);var gg={exports:{}};(function(e,t){(function(n,i){i()})(we,function(){function n(l,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(l.type)?new Blob(["\uFEFF",l],{type:l.type}):l}function i(l,u,h){var f=new XMLHttpRequest;f.open("GET",l),f.responseType="blob",f.onload=function(){c(f.response,u,h)},f.onerror=function(){console.error("could not download file")},f.send()}function r(l){var u=new XMLHttpRequest;u.open("HEAD",l,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function s(l){try{l.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),l.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof we=="object"&&we.global===we?we:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(l,u,h){var f=a.URL||a.webkitURL,m=document.createElement("a");u=u||l.name||"download",m.download=u,m.rel="noopener",typeof l=="string"?(m.href=l,m.origin===location.origin?s(m):r(m.href)?i(l,u,h):s(m,m.target="_blank")):(m.href=f.createObjectURL(l),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){s(m)},0))}:"msSaveOrOpenBlob"in navigator?function(l,u,h){if(u=u||l.name||"download",typeof l!="string")navigator.msSaveOrOpenBlob(n(l,h),u);else if(r(l))i(l,u,h);else{var f=document.createElement("a");f.href=l,f.target="_blank",setTimeout(function(){s(f)})}}:function(l,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof l=="string")return i(l,u,h);var m=l.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||m&&g||o)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var k=x.result;k=y?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=k:location=k,f=null},x.readAsDataURL(l)}else{var v=a.URL||a.webkitURL,S=v.createObjectURL(l);f?f.location=S:location.href=S,f=null,setTimeout(function(){v.revokeObjectURL(S)},4e4)}});a.saveAs=c.saveAs=c,e.exports=c})})(gg);var $E=gg.exports,pg={exports:{}};/* @license
29
33
  Papa Parse
30
34
  v5.5.3
31
35
  https://github.com/mholt/PapaParse
32
36
  License: MIT
33
- */(function(n,t){((e,i)=>{n.exports=i()})(xe,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,r=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,o={},l=0,c={};function u(p){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 M=A(b);M.chunkSize=parseInt(M.chunkSize),b.step||b.chunk||(M.chunkSize=null),this._handle=new _(M),(this._handle.streamer=this)._config=M}).call(this,p),this.parseChunk=function(b,M){var E=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<E){let I=this._config.newline;I||(R=this._config.quoteChar||'"',I=this._handle.guessLineEndings(b,R)),b=[...b.split(I).slice(E)].join(I)}this.isFirstChunk&&T(this._config.beforeFirstChunk)&&(R=this._config.beforeFirstChunk(b))!==void 0&&(b=R),this.isFirstChunk=!1,this._halted=!1;var E=this._partialLine+b,R=(this._partialLine="",this._handle.parse(E,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(b=R.meta.cursor,E=(this._finished||(this._partialLine=E.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),a)i.postMessage({results:R,workerId:c.WORKER_ID,finished:E});else if(T(this._config.chunk)&&!M){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||!E||!T(this._config.complete)||R&&R.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),E||R&&R.meta.paused||this._nextChunk(),R}this._halted=!0},this._sendError=function(b){T(this._config.error)?this._config.error(b):a&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:b,finished:!1})}}function h(p){var b;(p=p||{}).chunkSize||(p.chunkSize=c.RemoteChunkSize),u.call(this,p),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(M){this._input=M,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=O(this._chunkLoaded,this),b.onerror=O(this._chunkError,this)),b.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var M,E=this._config.downloadRequestHeaders;for(M in E)b.setRequestHeader(M,E[M])}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(I){this._chunkError(I.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>=(M=>(M=M.getResponseHeader("Content-Range"))!==null?parseInt(M.substring(M.lastIndexOf("/")+1)):-1)(b),this.parseChunk(b.responseText)))},this._chunkError=function(M){M=b.statusText||M,this._sendError(new Error(M))}}function f(p){(p=p||{}).chunkSize||(p.chunkSize=c.LocalChunkSize),u.call(this,p);var b,M,E=typeof FileReader<"u";this.stream=function(R){this._input=R,M=R.slice||R.webkitSlice||R.mozSlice,E?((b=new FileReader).onload=O(this._chunkLoaded,this),b.onerror=O(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,I=(this._config.chunkSize&&(I=Math.min(this._start+this._config.chunkSize,this._input.size),R=M.call(R,this._start,I)),b.readAsText(R,this._config.encoding));E||this._chunkLoaded({target:{result:I}})},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(p){var b;u.call(this,p=p||{}),this.stream=function(M){return b=M,this._nextChunk()},this._nextChunk=function(){var M,E;if(!this._finished)return M=this._config.chunkSize,b=M?(E=b.substring(0,M),b.substring(M)):(E=b,""),this._finished=!b,this.parseChunk(E)}}function g(p){u.call(this,p=p||{});var b=[],M=!0,E=!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(){E&&b.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),b.length?this.parseChunk(b.shift()):M=!0},this._streamData=O(function(R){try{b.push(typeof R=="string"?R:R.toString(this._config.encoding)),M&&(M=!1,this._checkIsFinished(),this.parseChunk(b.shift()))}catch(I){this._streamError(I)}},this),this._streamError=O(function(R){this._streamCleanUp(),this._sendError(R)},this),this._streamEnd=O(function(){this._streamCleanUp(),E=!0,this._streamData("")},this),this._streamCleanUp=O(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function _(p){var b,M,E,R,I=Math.pow(2,53),B=-I,U=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,J=/^((\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)))$/,$=this,lt=0,q=0,K=!1,z=!1,j=[],Y={data:[],errors:[],meta:{}};function yt(X){return p.skipEmptyLines==="greedy"?X.join("").trim()==="":X.length===1&&X[0].length===0}function _t(){if(Y&&E&&(H("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),E=!1),p.skipEmptyLines&&(Y.data=Y.data.filter(function(G){return!yt(G)})),V()){let G=function(gt,vt){T(p.transformHeader)&&(gt=p.transformHeader(gt,vt)),j.push(gt)};if(Y)if(Array.isArray(Y.data[0])){for(var X=0;V()&&X<Y.data.length;X++)Y.data[X].forEach(G);Y.data.splice(0,1)}else Y.data.forEach(G)}function Z(G,gt){for(var vt=p.header?{}:[],rt=0;rt<G.length;rt++){var bt=rt,dt=G[rt],dt=((jt,ot)=>(Mt=>(p.dynamicTypingFunction&&p.dynamicTyping[Mt]===void 0&&(p.dynamicTyping[Mt]=p.dynamicTypingFunction(Mt)),(p.dynamicTyping[Mt]||p.dynamicTyping)===!0))(jt)?ot==="true"||ot==="TRUE"||ot!=="false"&&ot!=="FALSE"&&((Mt=>{if(U.test(Mt)&&(Mt=parseFloat(Mt),B<Mt&&Mt<I))return 1})(ot)?parseFloat(ot):J.test(ot)?new Date(ot):ot===""?null:ot):ot)(bt=p.header?rt>=j.length?"__parsed_extra":j[rt]:bt,dt=p.transform?p.transform(dt,bt):dt);bt==="__parsed_extra"?(vt[bt]=vt[bt]||[],vt[bt].push(dt)):vt[bt]=dt}return p.header&&(rt>j.length?H("FieldMismatch","TooManyFields","Too many fields: expected "+j.length+" fields but parsed "+rt,q+gt):rt<j.length&&H("FieldMismatch","TooFewFields","Too few fields: expected "+j.length+" fields but parsed "+rt,q+gt)),vt}var Q;Y&&(p.header||p.dynamicTyping||p.transform)&&(Q=1,!Y.data.length||Array.isArray(Y.data[0])?(Y.data=Y.data.map(Z),Q=Y.data.length):Y.data=Z(Y.data,0),p.header&&Y.meta&&(Y.meta.fields=j),q+=Q)}function V(){return p.header&&j.length===0}function H(X,Z,Q,G){X={type:X,code:Z,message:Q},G!==void 0&&(X.row=G),Y.errors.push(X)}T(p.step)&&(R=p.step,p.step=function(X){Y=X,V()?_t():(_t(),Y.data.length!==0&&(lt+=X.data.length,p.preview&&lt>p.preview?M.abort():(Y.data=Y.data[0],R(Y,$))))}),this.parse=function(X,Z,Q){var G=p.quoteChar||'"',G=(p.newline||(p.newline=this.guessLineEndings(X,G)),E=!1,p.delimiter?T(p.delimiter)&&(p.delimiter=p.delimiter(X),Y.meta.delimiter=p.delimiter):((G=((gt,vt,rt,bt,dt)=>{var jt,ot,Mt,te;dt=dt||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var oe=0;oe<dt.length;oe++){for(var Ut,qe=dt[oe],Et=0,ee=0,Ft=0,qt=(Mt=void 0,new v({comments:bt,delimiter:qe,newline:vt,preview:10}).parse(gt)),ne=0;ne<qt.data.length;ne++)rt&&yt(qt.data[ne])?Ft++:(Ut=qt.data[ne].length,ee+=Ut,Mt===void 0?Mt=Ut:0<Ut&&(Et+=Math.abs(Ut-Mt),Mt=Ut));0<qt.data.length&&(ee/=qt.data.length-Ft),(ot===void 0||Et<=ot)&&(te===void 0||te<ee)&&1.99<ee&&(ot=Et,jt=qe,te=ee)}return{successful:!!(p.delimiter=jt),bestDelimiter:jt}})(X,p.newline,p.skipEmptyLines,p.comments,p.delimitersToGuess)).successful?p.delimiter=G.bestDelimiter:(E=!0,p.delimiter=c.DefaultDelimiter),Y.meta.delimiter=p.delimiter),A(p));return p.preview&&p.header&&G.preview++,b=X,M=new v(G),Y=M.parse(b,Z,Q),_t(),K?{meta:{paused:!0}}:Y||{meta:{paused:!1}}},this.paused=function(){return K},this.pause=function(){K=!0,M.abort(),b=T(p.chunk)?"":b.substring(M.getCharIndex())},this.resume=function(){$.streamer._halted?(K=!1,$.streamer.parseChunk(b,!0)):setTimeout($.resume,3)},this.aborted=function(){return z},this.abort=function(){z=!0,M.abort(),Y.meta.aborted=!0,T(p.complete)&&p.complete(Y),b=""},this.guessLineEndings=function(gt,G){gt=gt.substring(0,1048576);var G=new RegExp(x(G)+"([^]*?)"+x(G),"gm"),Q=(gt=gt.replace(G,"")).split("\r"),G=gt.split(`
34
- `),gt=1<G.length&&G[0].length<Q[0].length;if(Q.length===1||gt)return`
35
- `;for(var vt=0,rt=0;rt<Q.length;rt++)Q[rt][0]===`
36
- `&&vt++;return vt>=Q.length/2?`\r
37
- `:"\r"}}function x(p){return p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(p){var b=(p=p||{}).delimiter,M=p.newline,E=p.comments,R=p.step,I=p.preview,B=p.fastMode,U=null,J=!1,$=p.quoteChar==null?'"':p.quoteChar,lt=$;if(p.escapeChar!==void 0&&(lt=p.escapeChar),(typeof b!="string"||-1<c.BAD_DELIMITERS.indexOf(b))&&(b=","),E===b)throw new Error("Comment character same as delimiter");E===!0?E="#":(typeof E!="string"||-1<c.BAD_DELIMITERS.indexOf(E))&&(E=!1),M!==`
37
+ */(function(e,t){((n,i)=>{e.exports=i()})(we,function n(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r,s=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,o={},c=0,l={};function u(p){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(_){var M=E(_);M.chunkSize=parseInt(M.chunkSize),_.step||_.chunk||(M.chunkSize=null),this._handle=new y(M),(this._handle.streamer=this)._config=M}).call(this,p),this.parseChunk=function(_,M){var O=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<O){let I=this._config.newline;I||(A=this._config.quoteChar||'"',I=this._handle.guessLineEndings(_,A)),_=[..._.split(I).slice(O)].join(I)}this.isFirstChunk&&T(this._config.beforeFirstChunk)&&(A=this._config.beforeFirstChunk(_))!==void 0&&(_=A),this.isFirstChunk=!1,this._halted=!1;var O=this._partialLine+_,A=(this._partialLine="",this._handle.parse(O,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(_=A.meta.cursor,O=(this._finished||(this._partialLine=O.substring(_-this._baseIndex),this._baseIndex=_),A&&A.data&&(this._rowCount+=A.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),a)i.postMessage({results:A,workerId:l.WORKER_ID,finished:O});else if(T(this._config.chunk)&&!M){if(this._config.chunk(A,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=A=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(A.data),this._completeResults.errors=this._completeResults.errors.concat(A.errors),this._completeResults.meta=A.meta),this._completed||!O||!T(this._config.complete)||A&&A.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),O||A&&A.meta.paused||this._nextChunk(),A}this._halted=!0},this._sendError=function(_){T(this._config.error)?this._config.error(_):a&&this._config.error&&i.postMessage({workerId:l.WORKER_ID,error:_,finished:!1})}}function h(p){var _;(p=p||{}).chunkSize||(p.chunkSize=l.RemoteChunkSize),u.call(this,p),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(M){this._input=M,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),s||(_.onload=P(this._chunkLoaded,this),_.onerror=P(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var M,O=this._config.downloadRequestHeaders;for(M in O)_.setRequestHeader(M,O[M])}var A;this._config.chunkSize&&(A=this._start+this._config.chunkSize-1,_.setRequestHeader("Range","bytes="+this._start+"-"+A));try{_.send(this._config.downloadRequestBody)}catch(I){this._chunkError(I.message)}s&&_.status===0&&this._chunkError()}},this._chunkLoaded=function(){_.readyState===4&&(_.status<200||400<=_.status?this._chunkError():(this._start+=this._config.chunkSize||_.responseText.length,this._finished=!this._config.chunkSize||this._start>=(M=>(M=M.getResponseHeader("Content-Range"))!==null?parseInt(M.substring(M.lastIndexOf("/")+1)):-1)(_),this.parseChunk(_.responseText)))},this._chunkError=function(M){M=_.statusText||M,this._sendError(new Error(M))}}function f(p){(p=p||{}).chunkSize||(p.chunkSize=l.LocalChunkSize),u.call(this,p);var _,M,O=typeof FileReader<"u";this.stream=function(A){this._input=A,M=A.slice||A.webkitSlice||A.mozSlice,O?((_=new FileReader).onload=P(this._chunkLoaded,this),_.onerror=P(this._chunkError,this)):_=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var A=this._input,I=(this._config.chunkSize&&(I=Math.min(this._start+this._config.chunkSize,this._input.size),A=M.call(A,this._start,I)),_.readAsText(A,this._config.encoding));O||this._chunkLoaded({target:{result:I}})},this._chunkLoaded=function(A){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(A.target.result)},this._chunkError=function(){this._sendError(_.error)}}function m(p){var _;u.call(this,p=p||{}),this.stream=function(M){return _=M,this._nextChunk()},this._nextChunk=function(){var M,O;if(!this._finished)return M=this._config.chunkSize,_=M?(O=_.substring(0,M),_.substring(M)):(O=_,""),this._finished=!_,this.parseChunk(O)}}function g(p){u.call(this,p=p||{});var _=[],M=!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(A){this._input=A,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){O&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):M=!0},this._streamData=P(function(A){try{_.push(typeof A=="string"?A:A.toString(this._config.encoding)),M&&(M=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(I){this._streamError(I)}},this),this._streamError=P(function(A){this._streamCleanUp(),this._sendError(A)},this),this._streamEnd=P(function(){this._streamCleanUp(),O=!0,this._streamData("")},this),this._streamCleanUp=P(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(p){var _,M,O,A,I=Math.pow(2,53),B=-I,j=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,G=/^((\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)))$/,$=this,lt=0,q=0,Z=!1,z=!1,U=[],W={data:[],errors:[],meta:{}};function yt(X){return p.skipEmptyLines==="greedy"?X.join("").trim()==="":X.length===1&&X[0].length===0}function _t(){if(W&&O&&(H("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),O=!1),p.skipEmptyLines&&(W.data=W.data.filter(function(K){return!yt(K)})),Y()){let K=function(gt,vt){T(p.transformHeader)&&(gt=p.transformHeader(gt,vt)),U.push(gt)};if(W)if(Array.isArray(W.data[0])){for(var X=0;Y()&&X<W.data.length;X++)W.data[X].forEach(K);W.data.splice(0,1)}else W.data.forEach(K)}function Q(K,gt){for(var vt=p.header?{}:[],st=0;st<K.length;st++){var bt=st,dt=K[st],dt=((jt,ot)=>(St=>(p.dynamicTypingFunction&&p.dynamicTyping[St]===void 0&&(p.dynamicTyping[St]=p.dynamicTypingFunction(St)),(p.dynamicTyping[St]||p.dynamicTyping)===!0))(jt)?ot==="true"||ot==="TRUE"||ot!=="false"&&ot!=="FALSE"&&((St=>{if(j.test(St)&&(St=parseFloat(St),B<St&&St<I))return 1})(ot)?parseFloat(ot):G.test(ot)?new Date(ot):ot===""?null:ot):ot)(bt=p.header?st>=U.length?"__parsed_extra":U[st]:bt,dt=p.transform?p.transform(dt,bt):dt);bt==="__parsed_extra"?(vt[bt]=vt[bt]||[],vt[bt].push(dt)):vt[bt]=dt}return p.header&&(st>U.length?H("FieldMismatch","TooManyFields","Too many fields: expected "+U.length+" fields but parsed "+st,q+gt):st<U.length&&H("FieldMismatch","TooFewFields","Too few fields: expected "+U.length+" fields but parsed "+st,q+gt)),vt}var J;W&&(p.header||p.dynamicTyping||p.transform)&&(J=1,!W.data.length||Array.isArray(W.data[0])?(W.data=W.data.map(Q),J=W.data.length):W.data=Q(W.data,0),p.header&&W.meta&&(W.meta.fields=U),q+=J)}function Y(){return p.header&&U.length===0}function H(X,Q,J,K){X={type:X,code:Q,message:J},K!==void 0&&(X.row=K),W.errors.push(X)}T(p.step)&&(A=p.step,p.step=function(X){W=X,Y()?_t():(_t(),W.data.length!==0&&(lt+=X.data.length,p.preview&&lt>p.preview?M.abort():(W.data=W.data[0],A(W,$))))}),this.parse=function(X,Q,J){var K=p.quoteChar||'"',K=(p.newline||(p.newline=this.guessLineEndings(X,K)),O=!1,p.delimiter?T(p.delimiter)&&(p.delimiter=p.delimiter(X),W.meta.delimiter=p.delimiter):((K=((gt,vt,st,bt,dt)=>{var jt,ot,St,ee;dt=dt||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var le=0;le<dt.length;le++){for(var Ut,Ge=dt[le],Et=0,ne=0,Ft=0,qt=(St=void 0,new v({comments:bt,delimiter:Ge,newline:vt,preview:10}).parse(gt)),ie=0;ie<qt.data.length;ie++)st&&yt(qt.data[ie])?Ft++:(Ut=qt.data[ie].length,ne+=Ut,St===void 0?St=Ut:0<Ut&&(Et+=Math.abs(Ut-St),St=Ut));0<qt.data.length&&(ne/=qt.data.length-Ft),(ot===void 0||Et<=ot)&&(ee===void 0||ee<ne)&&1.99<ne&&(ot=Et,jt=Ge,ee=ne)}return{successful:!!(p.delimiter=jt),bestDelimiter:jt}})(X,p.newline,p.skipEmptyLines,p.comments,p.delimitersToGuess)).successful?p.delimiter=K.bestDelimiter:(O=!0,p.delimiter=l.DefaultDelimiter),W.meta.delimiter=p.delimiter),E(p));return p.preview&&p.header&&K.preview++,_=X,M=new v(K),W=M.parse(_,Q,J),_t(),Z?{meta:{paused:!0}}:W||{meta:{paused:!1}}},this.paused=function(){return Z},this.pause=function(){Z=!0,M.abort(),_=T(p.chunk)?"":_.substring(M.getCharIndex())},this.resume=function(){$.streamer._halted?(Z=!1,$.streamer.parseChunk(_,!0)):setTimeout($.resume,3)},this.aborted=function(){return z},this.abort=function(){z=!0,M.abort(),W.meta.aborted=!0,T(p.complete)&&p.complete(W),_=""},this.guessLineEndings=function(gt,K){gt=gt.substring(0,1048576);var K=new RegExp(x(K)+"([^]*?)"+x(K),"gm"),J=(gt=gt.replace(K,"")).split("\r"),K=gt.split(`
38
+ `),gt=1<K.length&&K[0].length<J[0].length;if(J.length===1||gt)return`
39
+ `;for(var vt=0,st=0;st<J.length;st++)J[st][0]===`
40
+ `&&vt++;return vt>=J.length/2?`\r
41
+ `:"\r"}}function x(p){return p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(p){var _=(p=p||{}).delimiter,M=p.newline,O=p.comments,A=p.step,I=p.preview,B=p.fastMode,j=null,G=!1,$=p.quoteChar==null?'"':p.quoteChar,lt=$;if(p.escapeChar!==void 0&&(lt=p.escapeChar),(typeof _!="string"||-1<l.BAD_DELIMITERS.indexOf(_))&&(_=","),O===_)throw new Error("Comment character same as delimiter");O===!0?O="#":(typeof O!="string"||-1<l.BAD_DELIMITERS.indexOf(O))&&(O=!1),M!==`
38
42
  `&&M!=="\r"&&M!==`\r
39
43
  `&&(M=`
40
- `);var q=0,K=!1;this.parse=function(z,j,Y){if(typeof z!="string")throw new Error("Input must be a string");var yt=z.length,_t=b.length,V=M.length,H=E.length,X=T(R),Z=[],Q=[],G=[],gt=q=0;if(!z)return Et();if(B||B!==!1&&z.indexOf($)===-1){for(var vt=z.split(M),rt=0;rt<vt.length;rt++){if(G=vt[rt],q+=G.length,rt!==vt.length-1)q+=M.length;else if(Y)return Et();if(!E||G.substring(0,H)!==E){if(X){if(Z=[],te(G.split(b)),ee(),K)return Et()}else te(G.split(b));if(I&&I<=rt)return Z=Z.slice(0,I),Et(!0)}}return Et()}for(var bt=z.indexOf(b,q),dt=z.indexOf(M,q),jt=new RegExp(x(lt)+x($),"g"),ot=z.indexOf($,q);;)if(z[q]===$)for(ot=q,q++;;){if((ot=z.indexOf($,ot+1))===-1)return Y||Q.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Z.length,index:q}),Ut();if(ot===yt-1)return Ut(z.substring(q,ot).replace(jt,$));if($===lt&&z[ot+1]===lt)ot++;else if($===lt||ot===0||z[ot-1]!==lt){bt!==-1&&bt<ot+1&&(bt=z.indexOf(b,ot+1));var Mt=oe((dt=dt!==-1&&dt<ot+1?z.indexOf(M,ot+1):dt)===-1?bt:Math.min(bt,dt));if(z.substr(ot+1+Mt,_t)===b){G.push(z.substring(q,ot).replace(jt,$)),z[q=ot+1+Mt+_t]!==$&&(ot=z.indexOf($,q)),bt=z.indexOf(b,q),dt=z.indexOf(M,q);break}if(Mt=oe(dt),z.substring(ot+1+Mt,ot+1+Mt+V)===M){if(G.push(z.substring(q,ot).replace(jt,$)),qe(ot+1+Mt+V),bt=z.indexOf(b,q),ot=z.indexOf($,q),X&&(ee(),K))return Et();if(I&&Z.length>=I)return Et(!0);break}Q.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Z.length,index:q}),ot++}}else if(E&&G.length===0&&z.substring(q,q+H)===E){if(dt===-1)return Et();q=dt+V,dt=z.indexOf(M,q),bt=z.indexOf(b,q)}else if(bt!==-1&&(bt<dt||dt===-1))G.push(z.substring(q,bt)),q=bt+_t,bt=z.indexOf(b,q);else{if(dt===-1)break;if(G.push(z.substring(q,dt)),qe(dt+V),X&&(ee(),K))return Et();if(I&&Z.length>=I)return Et(!0)}return Ut();function te(Ft){Z.push(Ft),gt=q}function oe(Ft){var qt=0;return qt=Ft!==-1&&(Ft=z.substring(ot+1,Ft))&&Ft.trim()===""?Ft.length:qt}function Ut(Ft){return Y||(Ft===void 0&&(Ft=z.substring(q)),G.push(Ft),q=yt,te(G),X&&ee()),Et()}function qe(Ft){q=Ft,te(G),G=[],dt=z.indexOf(M,q)}function Et(Ft){if(p.header&&!j&&Z.length&&!J){var qt=Z[0],ne=Object.create(null),Xe=new Set(qt);let si=!1;for(let Fe=0;Fe<qt.length;Fe++){let Bt=qt[Fe];if(ne[Bt=T(p.transformHeader)?p.transformHeader(Bt,Fe):Bt]){let ve,ri=ne[Bt];for(;ve=Bt+"_"+ri,ri++,Xe.has(ve););Xe.add(ve),qt[Fe]=ve,ne[Bt]++,si=!0,(U=U===null?{}:U)[ve]=Bt}else ne[Bt]=1,qt[Fe]=Bt;Xe.add(Bt)}si&&console.warn("Duplicate headers found and renamed."),J=!0}return{data:Z,errors:Q,meta:{delimiter:b,linebreak:M,aborted:K,truncated:!!Ft,cursor:gt+(j||0),renamedHeaders:U}}}function ee(){R(Et()),Z=[],Q=[]}},this.abort=function(){K=!0},this.getCharIndex=function(){return q}}function S(p){var b=p.data,M=o[b.workerId],E=!1;if(b.error)M.userError(b.error,b.file);else if(b.results&&b.results.data){var R={abort:function(){E=!0,k(b.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:C,resume:C};if(T(M.userStep)){for(var I=0;I<b.results.data.length&&(M.userStep({data:b.results.data[I],errors:b.results.errors,meta:b.results.meta},R),!E);I++);delete b.results}else T(M.userChunk)&&(M.userChunk(b.results,R,b.file),delete b.results)}b.finished&&!E&&k(b.workerId,b.results)}function k(p,b){var M=o[p];T(M.userComplete)&&M.userComplete(b),M.terminate(),delete o[p]}function C(){throw new Error("Not implemented.")}function A(p){if(typeof p!="object"||p===null)return p;var b,M=Array.isArray(p)?[]:{};for(b in p)M[b]=A(p[b]);return M}function O(p,b){return function(){p.apply(b,arguments)}}function T(p){return typeof p=="function"}return c.parse=function(p,b){var M=(b=b||{}).dynamicTyping||!1;if(T(M)&&(b.dynamicTypingFunction=M,M={}),b.dynamicTyping=M,b.transform=!!T(b.transform)&&b.transform,!b.worker||!c.WORKERS_SUPPORTED)return M=null,c.NODE_STREAM_INPUT,typeof p=="string"?(p=(E=>E.charCodeAt(0)!==65279?E:E.slice(1))(p),M=new(b.download?h:m)(b)):p.readable===!0&&T(p.read)&&T(p.on)?M=new g(b):(i.File&&p instanceof File||p instanceof Object)&&(M=new f(b)),M.stream(p);(M=(()=>{var E;return!!c.WORKERS_SUPPORTED&&(E=(()=>{var R=i.URL||i.webkitURL||null,I=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; ","(",I,")();"],{type:"text/javascript"})))})(),(E=new i.Worker(E)).onmessage=S,E.id=l++,o[E.id]=E)})()).userStep=b.step,M.userChunk=b.chunk,M.userComplete=b.complete,M.userError=b.error,b.step=T(b.step),b.chunk=T(b.chunk),b.complete=T(b.complete),b.error=T(b.error),delete b.worker,M.postMessage({input:p,config:b,workerId:M.id})},c.unparse=function(p,b){var M=!1,E=!0,R=",",I=`\r
41
- `,B='"',U=B+B,J=!1,$=null,lt=!1,q=((()=>{if(typeof b=="object"){if(typeof b.delimiter!="string"||c.BAD_DELIMITERS.filter(function(j){return b.delimiter.indexOf(j)!==-1}).length||(R=b.delimiter),typeof b.quotes!="boolean"&&typeof b.quotes!="function"&&!Array.isArray(b.quotes)||(M=b.quotes),typeof b.skipEmptyLines!="boolean"&&typeof b.skipEmptyLines!="string"||(J=b.skipEmptyLines),typeof b.newline=="string"&&(I=b.newline),typeof b.quoteChar=="string"&&(B=b.quoteChar),typeof b.header=="boolean"&&(E=b.header),Array.isArray(b.columns)){if(b.columns.length===0)throw new Error("Option columns is empty");$=b.columns}b.escapeChar!==void 0&&(U=b.escapeChar+B),b.escapeFormulae instanceof RegExp?lt=b.escapeFormulae:typeof b.escapeFormulae=="boolean"&&b.escapeFormulae&&(lt=/^[=+\-@\t\r].*$/)}})(),new RegExp(x(B),"g"));if(typeof p=="string"&&(p=JSON.parse(p)),Array.isArray(p)){if(!p.length||Array.isArray(p[0]))return K(null,p,J);if(typeof p[0]=="object")return K($||Object.keys(p[0]),p,J)}else if(typeof p=="object")return typeof p.data=="string"&&(p.data=JSON.parse(p.data)),Array.isArray(p.data)&&(p.fields||(p.fields=p.meta&&p.meta.fields||$),p.fields||(p.fields=Array.isArray(p.data[0])?p.fields:typeof p.data[0]=="object"?Object.keys(p.data[0]):[]),Array.isArray(p.data[0])||typeof p.data[0]=="object"||(p.data=[p.data])),K(p.fields||[],p.data||[],J);throw new Error("Unable to serialize unrecognized input");function K(j,Y,yt){var _t="",V=(typeof j=="string"&&(j=JSON.parse(j)),typeof Y=="string"&&(Y=JSON.parse(Y)),Array.isArray(j)&&0<j.length),H=!Array.isArray(Y[0]);if(V&&E){for(var X=0;X<j.length;X++)0<X&&(_t+=R),_t+=z(j[X],X);0<Y.length&&(_t+=I)}for(var Z=0;Z<Y.length;Z++){var Q=(V?j:Y[Z]).length,G=!1,gt=V?Object.keys(Y[Z]).length===0:Y[Z].length===0;if(yt&&!V&&(G=yt==="greedy"?Y[Z].join("").trim()==="":Y[Z].length===1&&Y[Z][0].length===0),yt==="greedy"&&V){for(var vt=[],rt=0;rt<Q;rt++){var bt=H?j[rt]:rt;vt.push(Y[Z][bt])}G=vt.join("").trim()===""}if(!G){for(var dt=0;dt<Q;dt++){0<dt&&!gt&&(_t+=R);var jt=V&&H?j[dt]:dt;_t+=z(Y[Z][jt],dt)}Z<Y.length-1&&(!yt||0<Q&&!gt)&&(_t+=I)}}return _t}function z(j,Y){var yt,_t;return j==null?"":j.constructor===Date?JSON.stringify(j).slice(1,25):(_t=!1,lt&&typeof j=="string"&&lt.test(j)&&(j="'"+j,_t=!0),yt=j.toString().replace(q,U),(_t=_t||M===!0||typeof M=="function"&&M(j,Y)||Array.isArray(M)&&M[Y]||((V,H)=>{for(var X=0;X<H.length;X++)if(-1<V.indexOf(H[X]))return!0;return!1})(yt,c.BAD_DELIMITERS)||-1<yt.indexOf(R)||yt.charAt(0)===" "||yt.charAt(yt.length-1)===" ")?B+yt+B:yt)}},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=v,c.ParserHandle=_,c.NetworkStreamer=h,c.FileStreamer=f,c.StringStreamer=m,c.ReadableStreamStreamer=g,i.jQuery&&((s=i.jQuery).fn.parse=function(p){var b=p.config||{},M=[];return this.each(function(I){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 B=0;B<this.files.length;B++)M.push({file:this.files[B],inputElem:this,instanceConfig:s.extend({},b)})}),E(),this;function E(){if(M.length===0)T(p.complete)&&p.complete();else{var I,B,U,J,$=M[0];if(T(p.before)){var lt=p.before($.file,$.inputElem);if(typeof lt=="object"){if(lt.action==="abort")return I="AbortError",B=$.file,U=$.inputElem,J=lt.reason,void(T(p.error)&&p.error({name:I},B,U,J));if(lt.action==="skip")return void R();typeof lt.config=="object"&&($.instanceConfig=s.extend($.instanceConfig,lt.config))}else if(lt==="skip")return void R()}var q=$.instanceConfig.complete;$.instanceConfig.complete=function(K){T(q)&&q(K,$.file,$.inputElem),R()},c.parse($.file,$.instanceConfig)}}function R(){M.splice(0,1),E()}}),a&&(i.onmessage=function(p){p=p.data,c.WORKER_ID===void 0&&p&&(c.WORKER_ID=p.workerId),typeof p.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(p.input,p.config),finished:!0}):(i.File&&p.input instanceof File||p.input instanceof Object)&&(p=c.parse(p.input,p.config))&&i.postMessage({workerId:c.WORKER_ID,results:p,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})})(Im);var lC=Im.exports;const cC=["id"],uC=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}),a=()=>{const u=i.labels;if(typeof i.fields!==ii.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ii.Object?h=>OT(h,(f,m)=>u[m]||m):h=>h},o=()=>{const u=i.fields;if(typeof i.fields!==ii.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?h=>aC(h,u):h=>h},l=()=>{if(typeof i.fields===ii.Undefined&&typeof i.labels===ii.Undefined)return i.data;const u=a(),h=o();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=lC.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});oC.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,cC))}}),dC=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(uC,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),hC={class:"kong-ui-public-csv-export-modal"},fC={key:0,class:"selected-range"},mC={key:4,class:"text-muted",tag:"span"},Lm=3,gC=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=mt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=d.ref(1),o=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"?"":mt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(Lm,o.value),rowsTotal:o.value,plural:o.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{var A,O,T;if(i.exportState.status!=="success"||!l.value||!((A=i.exportState.chartData)!=null&&A.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const g=i.exportState.chartData,_=g.data.some(p=>p.timestamp!==g.data[0].timestamp),x=g.data.map(p=>{const b=new Date(p.timestamp);return{...Object.keys(p.event).reduce((E,R)=>{if(R in g.meta.display){const I=p.event[R],B=g.meta.display[R];E[R]=I&&B&&B[I].name||p.event[R]}else E[R]=p.event[R];return E},{}),..._?{timestamp:ll(b,"yyyy-MM-dd HH:mm:ss"),tzOffset:ll(b,"XXX")}:{}}});let v=[];_&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const S="display"in i.exportState.chartData.meta&&((O=i.exportState.chartData.meta)!=null&&O.display)?(T=i.exportState.chartData.meta)==null?void 0:T.display:{},k=[...v,...Object.keys(S).map(p=>({label:e.t(`chartLabels.${p}`),key:p})),...i.exportState.chartData.meta.metric_names.map(p=>({label:e.t(`chartLabels.${p}`),key:p}))],C=k.reduce((p,b)=>(p[b.key]=b.label,p),{});return{headers:k,csvHeaders:C,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,Lm)}};return d.watch(f,()=>{a.value++}),(g,_)=>{const x=d.resolveComponent("KSkeleton"),v=d.resolveComponent("KEmptyState"),S=d.resolveComponent("KTableData"),k=d.resolveComponent("KTooltip"),C=d.resolveComponent("KButton"),A=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",hC,[d.createVNode(A,{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 O;return[d.createElementVNode("div",null,[n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",fC,[d.createElementVNode("p",null,d.toDisplayString(n.modalDescription?n.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),n.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(d.openBlock(),d.createBlock(S,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(a.value),headers:((O=f.value)==null?void 0:O.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(v,{"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"])):n.exportState.status==="error"?(d.openBlock(),d.createBlock(v,{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),n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",mC,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(k,{class:"preview-tooltip",placement:"right",text:d.unref(e).t("csvExport.maximumRecordAmount",{value:d.unref(Sw)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Qs.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Go)})`,size:d.unref(Ko)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(C,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(dC,{class:"vitals-report-export-button",filename:r,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(C,{appearance:"primary","data-testid":"csv-download-button",disabled:n.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"])])}}}),pC={class:"container"},yC={key:0,class:"no-data","data-testId":"sparkline-empty"},bC=["title"],_C=Ce(d.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{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}=mt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:r,syncedMinCount:a,syncedMaxCount:o,syncedRenderPoints:l,syncedChartDatasets:c}=mt.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:T,height:p})=>{u.width=T,u.height=p},f=d.computed(()=>n.disableTooltip?[]:[new Dm({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),m=d.computed(()=>c.value.reduce((T,{data:p,label:b})=>({...T,[b]:p.reduce((M,{y:E})=>M+E,0)}),{})),g=d.computed(()=>c.value.map(({label:T})=>[m.value[T],`${T}: ${m.value[T]}`]).sort(([T],[p])=>p-T).map(([,T])=>T).join(", ")),_=d.computed(()=>Object.keys(m.value).map(T=>m.value[T]).reduce((T,p)=>T+p,0)),x=d.computed(()=>_.value>0),v=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),S=d.computed(()=>n.datasets.length>1),k=`SparklineTooltipPosition-${t}`,C=d.computed(()=>{const T=n.type==="sparkline_bar",p=T?s.value-1:s.value,b=T?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:T?0:2,right:T?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:k,external:M=>{Vh(u,M,"minutely",{contextFormatter:E=>{const R=E+i.value;let I="";return i.value>24*60*60*1e3?I=Fr(new Date(R),"MMM dd, yyy hh:mm a"):I=Fr(new Date(R),"hh:mm a"),`${$o(E)} - ${I}`}})}}},scales:{x:{min:p,max:b,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:S.value},y:{min:Math.max(a.value-1,0),max:o.value,grid:{display:!1},display:!1,stacked:S.value}}}}),A=d.ref("0"),O=d.ref("0");return d.onMounted(()=>{Te.positioners[k]=function(T,p){if(!T.length||u.interactionMode==="interactive")return!1;const b=10,M=this.chart.canvas.getBoundingClientRect(),E=u.width||this.width,R=u.height||this.height,I=M.top-R>0,B=I?M.top-R-b:M.top+M.height+b,U=M.left>E/2-p.x,J=Math.max(b,window.innerWidth-b-E),$=Math.min(J,U?Math.floor(M.left-E/2)+p.x:0+b);return A.value=`${B}px`,O.value=`${$}px`,{x:$,y:B,xAlign:"center",yAlign:I?"top":"bottom"}}}),d.onUnmounted(()=>{Te.positioners[k]&&delete Te.positioners[k]}),(T,p)=>(d.openBlock(),d.createElementBlock("div",pC,[x.value?n.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Mm),{key:1,"chart-id":d.unref(t),data:v.value,"data-testId":"sparkline-bar",options:C.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(km),{key:2,"chart-id":d.unref(t),data:v.value,"data-testId":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:C.value,plugins:f.value},null,8,["chart-id","data","data-testId","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",yC,[d.renderSlot(T.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(ua,{key:3,"absolute-left":O.value,"absolute-top":A.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":n.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),x.value&&n.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:T.$slots.label?"":g.value},[d.renderSlot(T.$slots,"label",{total:_.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(g.value),1)],!0)],8,bC)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-e18e899f"]]);at.AnalyticsChart=sT,at.ChartLegendPosition=we,at.CsvExportModal=gC,at.DECIMAL_DISPLAY=L1,at.EMPTY_COLOR=tf,at.FONT_SIZE_REGULAR=Xh,at.FONT_SIZE_SMALL=qh,at.MAX_LABEL_LENGTH=qr,at.OTHERS_COLOR=j1,at.SimpleChart=pT,at.SparklineChart=_C,at.TopNTable=CT,at.ValidType=ii,at.accessibleGrey=Qh,at.apiRequestStatusCodeColors=Jh,at.chartTypes=jD,at.codesInSpec=nf,at.darkenColor=Zh,at.datavisPalette=on,at.defaultStatusCodeColors=Kr,at.determineBaseColor=Zo,at.errorRateColors=V1,at.handleQueryError=IM,at.latencyColors=$1,at.lightGrey=Jo,at.lookupColor=U1,at.lookupDatavisColor=Xr,at.lookupStatusCodeCategoryColor=eM,at.lookupStatusCodeColor=tl,at.simpleChartMetricDisplay=$D,at.simpleChartTypes=UD,at.statusCodeBadgeBackgroundColor=W1,at.thresholdColor=Gr,at.trafficColors=Y1,Object.defineProperty(at,Symbol.toStringTag,{value:"Module"})});
44
+ `);var q=0,Z=!1;this.parse=function(z,U,W){if(typeof z!="string")throw new Error("Input must be a string");var yt=z.length,_t=_.length,Y=M.length,H=O.length,X=T(A),Q=[],J=[],K=[],gt=q=0;if(!z)return Et();if(B||B!==!1&&z.indexOf($)===-1){for(var vt=z.split(M),st=0;st<vt.length;st++){if(K=vt[st],q+=K.length,st!==vt.length-1)q+=M.length;else if(W)return Et();if(!O||K.substring(0,H)!==O){if(X){if(Q=[],ee(K.split(_)),ne(),Z)return Et()}else ee(K.split(_));if(I&&I<=st)return Q=Q.slice(0,I),Et(!0)}}return Et()}for(var bt=z.indexOf(_,q),dt=z.indexOf(M,q),jt=new RegExp(x(lt)+x($),"g"),ot=z.indexOf($,q);;)if(z[q]===$)for(ot=q,q++;;){if((ot=z.indexOf($,ot+1))===-1)return W||J.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Q.length,index:q}),Ut();if(ot===yt-1)return Ut(z.substring(q,ot).replace(jt,$));if($===lt&&z[ot+1]===lt)ot++;else if($===lt||ot===0||z[ot-1]!==lt){bt!==-1&&bt<ot+1&&(bt=z.indexOf(_,ot+1));var St=le((dt=dt!==-1&&dt<ot+1?z.indexOf(M,ot+1):dt)===-1?bt:Math.min(bt,dt));if(z.substr(ot+1+St,_t)===_){K.push(z.substring(q,ot).replace(jt,$)),z[q=ot+1+St+_t]!==$&&(ot=z.indexOf($,q)),bt=z.indexOf(_,q),dt=z.indexOf(M,q);break}if(St=le(dt),z.substring(ot+1+St,ot+1+St+Y)===M){if(K.push(z.substring(q,ot).replace(jt,$)),Ge(ot+1+St+Y),bt=z.indexOf(_,q),ot=z.indexOf($,q),X&&(ne(),Z))return Et();if(I&&Q.length>=I)return Et(!0);break}J.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Q.length,index:q}),ot++}}else if(O&&K.length===0&&z.substring(q,q+H)===O){if(dt===-1)return Et();q=dt+Y,dt=z.indexOf(M,q),bt=z.indexOf(_,q)}else if(bt!==-1&&(bt<dt||dt===-1))K.push(z.substring(q,bt)),q=bt+_t,bt=z.indexOf(_,q);else{if(dt===-1)break;if(K.push(z.substring(q,dt)),Ge(dt+Y),X&&(ne(),Z))return Et();if(I&&Q.length>=I)return Et(!0)}return Ut();function ee(Ft){Q.push(Ft),gt=q}function le(Ft){var qt=0;return qt=Ft!==-1&&(Ft=z.substring(ot+1,Ft))&&Ft.trim()===""?Ft.length:qt}function Ut(Ft){return W||(Ft===void 0&&(Ft=z.substring(q)),K.push(Ft),q=yt,ee(K),X&&ne()),Et()}function Ge(Ft){q=Ft,ee(K),K=[],dt=z.indexOf(M,q)}function Et(Ft){if(p.header&&!U&&Q.length&&!G){var qt=Q[0],ie=Object.create(null),Ke=new Set(qt);let ci=!1;for(let Be=0;Be<qt.length;Be++){let Bt=qt[Be];if(ie[Bt=T(p.transformHeader)?p.transformHeader(Bt,Be):Bt]){let Se,ui=ie[Bt];for(;Se=Bt+"_"+ui,ui++,Ke.has(Se););Ke.add(Se),qt[Be]=Se,ie[Bt]++,ci=!0,(j=j===null?{}:j)[Se]=Bt}else ie[Bt]=1,qt[Be]=Bt;Ke.add(Bt)}ci&&console.warn("Duplicate headers found and renamed."),G=!0}return{data:Q,errors:J,meta:{delimiter:_,linebreak:M,aborted:Z,truncated:!!Ft,cursor:gt+(U||0),renamedHeaders:j}}}function ne(){A(Et()),Q=[],J=[]}},this.abort=function(){Z=!0},this.getCharIndex=function(){return q}}function S(p){var _=p.data,M=o[_.workerId],O=!1;if(_.error)M.userError(_.error,_.file);else if(_.results&&_.results.data){var A={abort:function(){O=!0,k(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:C,resume:C};if(T(M.userStep)){for(var I=0;I<_.results.data.length&&(M.userStep({data:_.results.data[I],errors:_.results.errors,meta:_.results.meta},A),!O);I++);delete _.results}else T(M.userChunk)&&(M.userChunk(_.results,A,_.file),delete _.results)}_.finished&&!O&&k(_.workerId,_.results)}function k(p,_){var M=o[p];T(M.userComplete)&&M.userComplete(_),M.terminate(),delete o[p]}function C(){throw new Error("Not implemented.")}function E(p){if(typeof p!="object"||p===null)return p;var _,M=Array.isArray(p)?[]:{};for(_ in p)M[_]=E(p[_]);return M}function P(p,_){return function(){p.apply(_,arguments)}}function T(p){return typeof p=="function"}return l.parse=function(p,_){var M=(_=_||{}).dynamicTyping||!1;if(T(M)&&(_.dynamicTypingFunction=M,M={}),_.dynamicTyping=M,_.transform=!!T(_.transform)&&_.transform,!_.worker||!l.WORKERS_SUPPORTED)return M=null,l.NODE_STREAM_INPUT,typeof p=="string"?(p=(O=>O.charCodeAt(0)!==65279?O:O.slice(1))(p),M=new(_.download?h:m)(_)):p.readable===!0&&T(p.read)&&T(p.on)?M=new g(_):(i.File&&p instanceof File||p instanceof Object)&&(M=new f(_)),M.stream(p);(M=(()=>{var O;return!!l.WORKERS_SUPPORTED&&(O=(()=>{var A=i.URL||i.webkitURL||null,I=n.toString();return l.BLOB_URL||(l.BLOB_URL=A.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; ","(",I,")();"],{type:"text/javascript"})))})(),(O=new i.Worker(O)).onmessage=S,O.id=c++,o[O.id]=O)})()).userStep=_.step,M.userChunk=_.chunk,M.userComplete=_.complete,M.userError=_.error,_.step=T(_.step),_.chunk=T(_.chunk),_.complete=T(_.complete),_.error=T(_.error),delete _.worker,M.postMessage({input:p,config:_,workerId:M.id})},l.unparse=function(p,_){var M=!1,O=!0,A=",",I=`\r
45
+ `,B='"',j=B+B,G=!1,$=null,lt=!1,q=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||l.BAD_DELIMITERS.filter(function(U){return _.delimiter.indexOf(U)!==-1}).length||(A=_.delimiter),typeof _.quotes!="boolean"&&typeof _.quotes!="function"&&!Array.isArray(_.quotes)||(M=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(G=_.skipEmptyLines),typeof _.newline=="string"&&(I=_.newline),typeof _.quoteChar=="string"&&(B=_.quoteChar),typeof _.header=="boolean"&&(O=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");$=_.columns}_.escapeChar!==void 0&&(j=_.escapeChar+B),_.escapeFormulae instanceof RegExp?lt=_.escapeFormulae:typeof _.escapeFormulae=="boolean"&&_.escapeFormulae&&(lt=/^[=+\-@\t\r].*$/)}})(),new RegExp(x(B),"g"));if(typeof p=="string"&&(p=JSON.parse(p)),Array.isArray(p)){if(!p.length||Array.isArray(p[0]))return Z(null,p,G);if(typeof p[0]=="object")return Z($||Object.keys(p[0]),p,G)}else if(typeof p=="object")return typeof p.data=="string"&&(p.data=JSON.parse(p.data)),Array.isArray(p.data)&&(p.fields||(p.fields=p.meta&&p.meta.fields||$),p.fields||(p.fields=Array.isArray(p.data[0])?p.fields:typeof p.data[0]=="object"?Object.keys(p.data[0]):[]),Array.isArray(p.data[0])||typeof p.data[0]=="object"||(p.data=[p.data])),Z(p.fields||[],p.data||[],G);throw new Error("Unable to serialize unrecognized input");function Z(U,W,yt){var _t="",Y=(typeof U=="string"&&(U=JSON.parse(U)),typeof W=="string"&&(W=JSON.parse(W)),Array.isArray(U)&&0<U.length),H=!Array.isArray(W[0]);if(Y&&O){for(var X=0;X<U.length;X++)0<X&&(_t+=A),_t+=z(U[X],X);0<W.length&&(_t+=I)}for(var Q=0;Q<W.length;Q++){var J=(Y?U:W[Q]).length,K=!1,gt=Y?Object.keys(W[Q]).length===0:W[Q].length===0;if(yt&&!Y&&(K=yt==="greedy"?W[Q].join("").trim()==="":W[Q].length===1&&W[Q][0].length===0),yt==="greedy"&&Y){for(var vt=[],st=0;st<J;st++){var bt=H?U[st]:st;vt.push(W[Q][bt])}K=vt.join("").trim()===""}if(!K){for(var dt=0;dt<J;dt++){0<dt&&!gt&&(_t+=A);var jt=Y&&H?U[dt]:dt;_t+=z(W[Q][jt],dt)}Q<W.length-1&&(!yt||0<J&&!gt)&&(_t+=I)}}return _t}function z(U,W){var yt,_t;return U==null?"":U.constructor===Date?JSON.stringify(U).slice(1,25):(_t=!1,lt&&typeof U=="string"&&lt.test(U)&&(U="'"+U,_t=!0),yt=U.toString().replace(q,j),(_t=_t||M===!0||typeof M=="function"&&M(U,W)||Array.isArray(M)&&M[W]||((Y,H)=>{for(var X=0;X<H.length;X++)if(-1<Y.indexOf(H[X]))return!0;return!1})(yt,l.BAD_DELIMITERS)||-1<yt.indexOf(A)||yt.charAt(0)===" "||yt.charAt(yt.length-1)===" ")?B+yt+B:yt)}},l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
46
+ `,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!s&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=v,l.ParserHandle=y,l.NetworkStreamer=h,l.FileStreamer=f,l.StringStreamer=m,l.ReadableStreamStreamer=g,i.jQuery&&((r=i.jQuery).fn.parse=function(p){var _=p.config||{},M=[];return this.each(function(I){if(!(r(this).prop("tagName").toUpperCase()==="INPUT"&&r(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var B=0;B<this.files.length;B++)M.push({file:this.files[B],inputElem:this,instanceConfig:r.extend({},_)})}),O(),this;function O(){if(M.length===0)T(p.complete)&&p.complete();else{var I,B,j,G,$=M[0];if(T(p.before)){var lt=p.before($.file,$.inputElem);if(typeof lt=="object"){if(lt.action==="abort")return I="AbortError",B=$.file,j=$.inputElem,G=lt.reason,void(T(p.error)&&p.error({name:I},B,j,G));if(lt.action==="skip")return void A();typeof lt.config=="object"&&($.instanceConfig=r.extend($.instanceConfig,lt.config))}else if(lt==="skip")return void A()}var q=$.instanceConfig.complete;$.instanceConfig.complete=function(Z){T(q)&&q(Z,$.file,$.inputElem),A()},l.parse($.file,$.instanceConfig)}}function A(){M.splice(0,1),O()}}),a&&(i.onmessage=function(p){p=p.data,l.WORKER_ID===void 0&&p&&(l.WORKER_ID=p.workerId),typeof p.input=="string"?i.postMessage({workerId:l.WORKER_ID,results:l.parse(p.input,p.config),finished:!0}):(i.File&&p.input instanceof File||p.input instanceof Object)&&(p=l.parse(p.input,p.config))&&i.postMessage({workerId:l.WORKER_ID,results:p,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,l})})(pg);var WE=pg.exports;const YE=["id"],jE=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(e,{emit:t}){const n=t,i=e,r=d.computed(()=>`export_${new Date().getTime()}`),s=d.computed(()=>{const u=c();return u.length?u:null}),a=()=>{const u=i.labels;if(typeof i.fields!==li.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===li.Object?h=>dE(h,(f,m)=>u[m]||m):h=>h},o=()=>{const u=i.fields;if(typeof i.fields!==li.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?h=>VE(h,u):h=>h},c=()=>{if(typeof i.fields===li.Undefined&&typeof i.labels===li.Undefined)return i.data;const u=a(),h=o();return i.data.map(f=>u(h(f)))},l=()=>{if(!(s!=null&&s.value)){console.warn("No data to export");return}n("export-started",s.value);let u=WE.unparse(s.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
47
+ `+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),n("export-finished",i.filename),!i.testing){const h=new Blob([u],{type:"text/csv;charset="+i.encoding});$E.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:l},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(e.filename),1)])],8,YE))}}),UE=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(e){const t=e,n=d.computed(()=>Object.keys(t.headers));return(i,r)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(jE,{data:e.rows,fields:n.value,filename:e.filename,labels:e.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),qE={class:"kong-ui-public-csv-export-modal"},XE={key:0,class:"selected-range"},GE={key:4,class:"text-muted",tag:"span"},yg=3,KE=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(e,{emit:t}){const{i18n:n}=mt.useI18n(),i=e,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=d.ref(1),o=d.computed(()=>f.value.rows.length),c=d.computed(()=>{var g,y;return i.exportState.status==="success"&&!!((y=(g=i.exportState.chartData)==null?void 0:g.data)!=null&&y.length)}),l=d.computed(()=>i.exportState.status!=="success"?"":mt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":n.t("csvExport.previewRows",{rowsMax:Math.min(yg,o.value),rowsTotal:o.value,plural:o.value===1?"":"s"})),h=()=>{r("closeModal")},f=d.computed(()=>{var E,P,T;if(i.exportState.status!=="success"||!c.value||!((E=i.exportState.chartData)!=null&&E.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const g=i.exportState.chartData,y=g.data.some(p=>p.timestamp!==g.data[0].timestamp),x=g.data.map(p=>{const _=new Date(p.timestamp);return{...Object.keys(p.event).reduce((O,A)=>{if(A in g.meta.display){const I=p.event[A],B=g.meta.display[A];O[A]=I&&B&&B[I].name||p.event[A]}else O[A]=p.event[A];return O},{}),...y?{timestamp:bl(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:bl(_,"XXX")}:{}}});let v=[];y&&(v=[{label:n.t("csvExport.Timestamp"),key:"timestamp"},{label:n.t("csvExport.UtcOffset"),key:"tzOffset"}]);const S="display"in i.exportState.chartData.meta&&((P=i.exportState.chartData.meta)!=null&&P.display)?(T=i.exportState.chartData.meta)==null?void 0:T.display:{},k=[...v,...Object.keys(S).map(p=>({label:n.t(`chartLabels.${p}`),key:p})),...i.exportState.chartData.meta.metric_names.map(p=>({label:n.t(`chartLabels.${p}`),key:p}))],C=k.reduce((p,_)=>(p[_.key]=_.label,p),{});return{headers:k,csvHeaders:C,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,yg)}};return d.watch(f,()=>{a.value++}),(g,y)=>{const x=d.resolveComponent("KSkeleton"),v=d.resolveComponent("KEmptyState"),S=d.resolveComponent("KTableData"),k=d.resolveComponent("KTooltip"),C=d.resolveComponent("KButton"),E=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",qE,[d.createVNode(E,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(n).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>{var P;return[d.createElementVNode("div",null,[e.exportState.status==="success"&&c.value?(d.openBlock(),d.createElementBlock("div",XE,[d.createElementVNode("p",null,d.toDisplayString(e.modalDescription?e.modalDescription:d.unref(n).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(n).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(l.value),1)])):d.createCommentVNode("",!0),e.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):e.exportState.status==="success"?(d.openBlock(),d.createBlock(S,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(a.value),headers:((P=f.value)==null?void 0:P.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(v,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(n).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(n).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):e.exportState.status==="error"?(d.openBlock(),d.createBlock(v,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(n).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),e.exportState.status==="success"&&c.value?(d.openBlock(),d.createElementBlock("div",GE,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(k,{class:"preview-tooltip",placement:"right",text:d.unref(n).t("csvExport.maximumRecordAmount",{value:d.unref(av)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Jt.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(al)})`,size:d.unref(zr)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(C,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(UE,{class:"vitals-report-export-button",filename:s,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(C,{appearance:"primary","data-testid":"csv-download-button",disabled:e.exportState.status!=="success"||!c.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),ZE={class:"container"},QE={key:0,class:"no-data","data-testId":"sparkline-empty"},JE=["title"],tO=Ee(d.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{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(e){const t=crypto.randomUUID(),{i18n:n}=mt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:o,syncedRenderPoints:c,syncedChartDatasets:l}=mt.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),u=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:T,height:p})=>{u.width=T,u.height=p},f=d.computed(()=>e.disableTooltip?[]:[new Um({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),m=d.computed(()=>l.value.reduce((T,{data:p,label:_})=>({...T,[_]:p.reduce((M,{y:O})=>M+O,0)}),{})),g=d.computed(()=>l.value.map(({label:T})=>[m.value[T],`${T}: ${m.value[T]}`]).sort(([T],[p])=>p-T).map(([,T])=>T).join(", ")),y=d.computed(()=>Object.keys(m.value).map(T=>m.value[T]).reduce((T,p)=>T+p,0)),x=d.computed(()=>y.value>0),v=d.computed(()=>({labels:new Array(c.value).fill(""),datasets:l.value})),S=d.computed(()=>e.datasets.length>1),k=`SparklineTooltipPosition-${t}`,C=d.computed(()=>{const T=e.type==="sparkline_bar",p=T?r.value-1:r.value,_=T?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:T?0:2,right:T?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:k,external:M=>{cf(u,M,"minutely",{contextFormatter:O=>{const A=O+i.value;let I="";return i.value>24*60*60*1e3?I=Us(new Date(A),"MMM dd, yyy hh:mm a"):I=Us(new Date(A),"hh:mm a"),`${el(O)} - ${I}`}})}}},scales:{x:{min:p,max:_,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:S.value},y:{min:Math.max(a.value-1,0),max:o.value,grid:{display:!1},display:!1,stacked:S.value}}}}),E=d.ref("0"),P=d.ref("0");return d.onMounted(()=>{Ce.positioners[k]=function(T,p){if(!T.length||u.interactionMode==="interactive")return!1;const _=10,M=this.chart.canvas.getBoundingClientRect(),O=u.width||this.width,A=u.height||this.height,I=M.top-A>0,B=I?M.top-A-_:M.top+M.height+_,j=M.left>O/2-p.x,G=Math.max(_,window.innerWidth-_-O),$=Math.min(G,j?Math.floor(M.left-O/2)+p.x:0+_);return E.value=`${B}px`,P.value=`${$}px`,{x:$,y:B,xAlign:"center",yAlign:I?"top":"bottom"}}}),d.onUnmounted(()=>{Ce.positioners[k]&&delete Ce.positioners[k]}),(T,p)=>(d.openBlock(),d.createElementBlock("div",ZE,[x.value?e.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Wm),{key:1,"chart-id":d.unref(t),data:v.value,"data-testId":"sparkline-bar",options:C.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(jm),{key:2,"chart-id":d.unref(t),data:v.value,"data-testId":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:C.value,plugins:f.value},null,8,["chart-id","data","data-testId","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",QE,[d.renderSlot(T.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(_a,{key:3,"absolute-left":P.value,"absolute-top":E.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":e.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),x.value&&e.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:T.$slots.label?"":g.value},[d.renderSlot(T.$slots,"label",{total:y.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(g.value),1)],!0)],8,JE)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-e18e899f"]]);at.AnalyticsChart=$D,at.ChartLegendPosition=ve,at.CsvExportModal=KE,at.DECIMAL_DISPLAY=yS,at.EMPTY_COLOR=wf,at.FONT_SIZE_REGULAR=mf,at.FONT_SIZE_SMALL=ff,at.MAX_LABEL_LENGTH=na,at.OTHERS_COLOR=ES,at.SimpleChart=ZC,at.SparklineChart=tO,at.TopNTable=cE,at.ValidType=li,at.accessibleGrey=_f,at.apiRequestStatusCodeColors=xf,at.chartTypes=ED,at.codesInSpec=Sf,at.darkenColor=bf,at.datavisPalette=un,at.defaultStatusCodeColors=sa,at.determineBaseColor=ol,at.errorRateColors=DS,at.handleQueryError=bk,at.latencyColors=CS,at.lightGrey=cl,at.lookupColor=OS,at.lookupDatavisColor=ia,at.lookupStatusCodeCategoryColor=zS,at.lookupStatusCodeColor=ul,at.simpleChartMetricDisplay=CD,at.simpleChartTypes=OD,at.statusCodeBadgeBackgroundColor=MS,at.thresholdColor=ra,at.trafficColors=TS,Object.defineProperty(at,Symbol.toStringTag,{value:"Module"})});