@kong-ui-public/analytics-chart 10.21.7 → 10.21.8

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,17 +1,17 @@
1
- (function(kt,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","@kong-ui-public/analytics-metric-provider"],d):(kt=typeof globalThis<"u"?globalThis:kt||self,d(kt["kong-ui-publicvitals-chart"]={},kt.Vue,kt["kong-ui-public-i18n"],kt.KongIcons,kt["kong-ui-public-analytics-metric-provider"]))})(this,(function(kt,d,ic,Wi,Ln){"use strict";const Im={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",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."},canceled:{message:"Request canceled"},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",error_rate:"Error rate",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)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal 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_package:"API package",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",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_error:"MCP error",mcp_method:"MCP method",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key"},metricAxisTitles:{error_rate:"Error rate in {unit}",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) 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}",kong_internal_latency_average:"Kong internal latency (avg) in {unit}",kong_internal_latency_p99:"Kong internal latency (p99) in {unit}",kong_internal_latency_p95:"Kong internal latency (p95) in {unit}",kong_internal_latency_p50:"Kong internal 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_size_sum:"Request size (sum) 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",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A response size (sum) in {unit}",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_response_size_sum:"MCP response size (sum) in {unit}",mcp_response_body_size_sum:"MCP response body size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count"},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"},timestampAxisTitles:{platform:"@timestamp created at"},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 Lm(){const e=ic.createI18n("en-us",Im);return{i18n:e,i18nT:ic.i18nTComponent(e)}}function $i(e){return e+.5|0}const hn=(e,t,n)=>Math.max(Math.min(e,n),t);function Yi(e){return hn($i(e*2.55),0,255)}function fn(e){return hn($i(e*255),0,255)}function Ge(e){return hn($i(e/2.55)/100,0,1)}function sc(e){return hn($i(e*100),0,100)}const De={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},vr=[..."0123456789ABCDEF"],Nm=e=>vr[e&15],Fm=e=>vr[(e&240)>>4]+vr[e&15],Zs=e=>(e&240)>>4===(e&15),Bm=e=>Zs(e.r)&&Zs(e.g)&&Zs(e.b)&&Zs(e.a);function zm(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&De[e[1]]*17,g:255&De[e[2]]*17,b:255&De[e[3]]*17,a:t===5?De[e[4]]*17:255}:(t===7||t===9)&&(n={r:De[e[1]]<<4|De[e[2]],g:De[e[3]]<<4|De[e[4]],b:De[e[5]]<<4|De[e[6]],a:t===9?De[e[7]]<<4|De[e[8]]:255})),n}const Um=(e,t)=>e<255?t(e):"";function Hm(e){var t=Bm(e)?Nm:Fm;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Um(e.a,t):void 0}const Vm=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function oc(e,t,n){const i=t*Math.min(n,1-n),s=(o,r=(o+e/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Wm(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function $m(e,t,n){const i=oc(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function Ym(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function Mr(e){const n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),r=Math.min(n,i,s),a=(o+r)/2;let l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=Ym(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function kr(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(fn)}function Dr(e,t,n){return kr(oc,e,t,n)}function jm(e,t,n){return kr($m,e,t,n)}function qm(e,t,n){return kr(Wm,e,t,n)}function rc(e){return(e%360+360)%360}function Gm(e){const t=Vm.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Yi(+t[5]):fn(+t[5]));const s=rc(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=jm(s,o,r):t[1]==="hsv"?i=qm(s,o,r):i=Dr(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function Km(e,t){var n=Mr(e);n[0]=rc(n[0]+t),n=Dr(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Xm(e){if(!e)return;const t=Mr(e),n=t[0],i=sc(t[1]),s=sc(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Ge(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const ac={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"},lc={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 Zm(){const e={},t=Object.keys(lc),n=Object.keys(ac);let i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<n.length;s++)o=n[s],a=a.replace(o,ac[o]);o=parseInt(lc[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Qs;function Qm(e){Qs||(Qs=Zm(),Qs.transparent=[0,0,0,0]);const t=Qs[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Jm=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function tp(e){const t=Jm.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?Yi(r):hn(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?Yi(i):hn(i,0,255)),s=255&(t[4]?Yi(s):hn(s,0,255)),o=255&(t[6]?Yi(o):hn(o,0,255)),{r:i,g:s,b:o,a:n}}}function ep(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ge(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Cr=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ci=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function np(e,t,n){const i=ci(Ge(e.r)),s=ci(Ge(e.g)),o=ci(Ge(e.b));return{r:fn(Cr(i+n*(ci(Ge(t.r))-i))),g:fn(Cr(s+n*(ci(Ge(t.g))-s))),b:fn(Cr(o+n*(ci(Ge(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Js(e,t,n){if(e){let i=Mr(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Dr(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function cc(e,t){return e&&Object.assign(t||{},e)}function uc(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=fn(e[3]))):(t=cc(e,{r:0,g:0,b:0,a:1}),t.a=fn(t.a)),t}function ip(e){return e.charAt(0)==="r"?tp(e):Gm(e)}class ji{constructor(t){if(t instanceof ji)return t;const n=typeof t;let i;n==="object"?i=uc(t):n==="string"&&(i=zm(t)||Qm(t)||ip(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=cc(this._rgb);return t&&(t.a=Ge(t.a)),t}set rgb(t){this._rgb=uc(t)}rgbString(){return this._valid?ep(this._rgb):void 0}hexString(){return this._valid?Hm(this._rgb):void 0}hslString(){return this._valid?Xm(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const r=n===o?.5:n,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=np(this._rgb,t._rgb,n)),this}clone(){return new ji(this.rgb)}alpha(t){return this._rgb.a=fn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=$i(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 Js(this._rgb,2,t),this}darken(t){return Js(this._rgb,2,-t),this}saturate(t){return Js(this._rgb,1,t),this}desaturate(t){return Js(this._rgb,1,-t),this}rotate(t){return Km(this._rgb,t),this}}function Ke(){}const sp=(()=>{let e=0;return()=>e++})();function rt(e){return e==null}function xt(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 At(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ve(e,t){return At(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const op=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,dc=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function wt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function St(e,t,n,i){let s,o,r;if(xt(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(ft(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function to(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function eo(e){if(xt(e))return e.map(eo);if(ft(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=eo(e[n[s]]);return t}return e}function hc(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function rp(e,t,n,i){if(!hc(e))return;const s=t[e],o=n[e];ft(s)&&ft(o)?qi(s,o,i):t[e]=eo(o)}function qi(e,t,n){const i=xt(t)?t:[t],s=i.length;if(!ft(e))return e;n=n||{};const o=n.merger||rp;let r;for(let a=0;a<s;++a){if(r=i[a],!ft(r))continue;const l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function Gi(e,t){return qi(e,t,{merger:ap})}function ap(e,t,n){if(!hc(e))return;const i=t[e],s=n[e];ft(i)&&ft(s)?Gi(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=eo(s))}const fc={"":e=>e,x:e=>e.x,y:e=>e.y};function lp(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function cp(e){const t=lp(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function mn(e,t){return(fc[t]||(fc[t]=cp(t)))(e)}function Or(e){return e.charAt(0).toUpperCase()+e.slice(1)}const fe=e=>typeof e<"u",me=e=>typeof e=="function",mc=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function up(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const dt=Math.PI,Dt=2*dt,dp=Dt+dt,no=Number.POSITIVE_INFINITY,Er=dt/180,Ot=dt/2,Ce=dt/4,io=dt*2/3,pn=Math.log10,ze=Math.sign;function Ki(e,t,n){return Math.abs(e-t)<n}function pc(e){const t=Math.round(e);e=Ki(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(pn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function hp(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((s,o)=>s-o).pop(),t}function fp(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function gn(e){return!fp(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function mp(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function gc(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Vt(e){return e*(dt/180)}function so(e){return e*(180/dt)}function yc(e){if(!At(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function oo(e,t){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*dt&&(o+=Dt),{angle:o,distance:s}}function ui(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pp(e,t){return(e-t+dp)%Dt-dt}function ne(e){return(e%Dt+Dt)%Dt}function Xi(e,t,n,i){const s=ne(e),o=ne(t),r=ne(n),a=ne(o-s),l=ne(r-s),c=ne(s-o),u=ne(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function Kt(e,t,n){return Math.max(t,Math.min(n,e))}function gp(e){return Kt(e,-32768,32767)}function Xe(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Ar(e,t,n){n=n||(r=>e[r]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const Ze=(e,t,n,i)=>Ar(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),yp=(e,t,n)=>Ar(e,n,i=>e[i][t]>=n);function bp(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}const bc=["push","pop","shift","splice","unshift"];function _p(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),bc.forEach(n=>{const i="_onData"+Or(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function _c(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(bc.forEach(o=>{delete e[o]}),delete e._chartjs)}function xc(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const wc=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Sc(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,wc.call(window,()=>{i=!1,e.apply(t,n)}))}}function xp(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Pr=e=>e==="start"?"left":e==="end"?"right":"center",ie=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,wp=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function Tc(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:h,max:f,minDefined:m,maxDefined:p}=r.getUserBounds();if(m){if(s=Math.min(Ze(l,u,h).lo,n?i:Ze(t,u,r.getPixelForValue(h)).lo),c){const y=l.slice(0,s+1).reverse().findIndex(b=>!rt(b[a.axis]));s-=Math.max(0,y)}s=Kt(s,0,i-1)}if(p){let y=Math.max(Ze(l,r.axis,f,!0).hi+1,n?0:Ze(t,u,r.getPixelForValue(f),!0).hi+1);if(c){const b=l.slice(y-1).findIndex(S=>!rt(S[a.axis]));y+=Math.max(0,b)}o=Kt(y,s,i)-s}else o=i-s}return{start:s,count:o}}function vc(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const ro=e=>e===0||e===1,Mc=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Dt/n)),kc=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Dt/n)+1,Zi={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(dt*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=>ro(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=>ro(e)?e:Mc(e,.075,.3),easeOutElastic:e=>ro(e)?e:kc(e,.075,.3),easeInOutElastic(e){return ro(e)?e:e<.5?.5*Mc(e*2,.1125,.45):.5+.5*kc(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-Zi.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?Zi.easeInBounce(e*2)*.5:Zi.easeOutBounce(e*2-1)*.5+.5};function Rr(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ir(e){return Rr(e)?e:new ji(e)}function Lr(e){return Rr(e)?e:new ji(e).saturate(.5).darken(.1).hexString()}const Sp=["x","y","borderWidth","radius","tension"],Tp=["color","borderColor","backgroundColor"];function vp(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:Tp},numbers:{type:"number",properties:Sp}}),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 Mp(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Dc=new Map;function kp(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Dc.get(n);return i||(i=new Intl.NumberFormat(e,t),Dc.set(n,i)),i}function Qi(e,t,n){return kp(t,n).format(e)}const Cc={values(e){return xt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Dp(e,n)}const r=pn(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Qi(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(pn(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?Cc.numeric.call(this,e,t,n):""}};function Dp(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 ao={formatters:Cc};function Cp(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:ao.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 Nn=Object.create(null),Nr=Object.create(null);function Ji(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function Fr(e,t,n){return typeof t=="string"?qi(Ji(e,t),n):qi(Ji(e,""),t)}class Op{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,s)=>Lr(s.backgroundColor),this.hoverBorderColor=(i,s)=>Lr(s.borderColor),this.hoverColor=(i,s)=>Lr(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(n)}set(t,n){return Fr(this,t,n)}get(t){return Ji(this,t)}describe(t,n){return Fr(Nr,t,n)}override(t,n){return Fr(Nn,t,n)}route(t,n,i,s){const o=Ji(this,t),r=Ji(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=r[s];return ft(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Et=new Op({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[vp,Mp,Cp]);function Ep(e){return!e||rt(e.size)||rt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function lo(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function Ap(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let r=0;const a=n.length;let l,c,u,h,f;for(l=0;l<a;l++)if(h=n[l],h!=null&&!xt(h))r=lo(e,s,o,r,h);else if(xt(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!xt(f)&&(r=lo(e,s,o,r,f));e.restore();const m=o.length/2;if(m>n.length){for(l=0;l<m;l++)delete s[o[l]];o.splice(0,m)}return r}function Fn(e,t,n){const i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function Oc(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Br(e,t,n,i){Ec(e,t,n,i,null)}function Ec(e,t,n,i,s){let o,r,a,l,c,u,h,f;const m=t.pointStyle,p=t.rotation,y=t.radius;let b=(p||0)*Er;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(b),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:s?e.ellipse(n,i,s/2,y,0,0,Dt):e.arc(n,i,y,0,Dt),e.closePath();break;case"triangle":u=s?s/2:y,e.moveTo(n+Math.sin(b)*u,i-Math.cos(b)*y),b+=io,e.lineTo(n+Math.sin(b)*u,i-Math.cos(b)*y),b+=io,e.lineTo(n+Math.sin(b)*u,i-Math.cos(b)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,r=Math.cos(b+Ce)*l,h=Math.cos(b+Ce)*(s?s/2-c:l),a=Math.sin(b+Ce)*l,f=Math.sin(b+Ce)*(s?s/2-c:l),e.arc(n-h,i-a,c,b-dt,b-Ot),e.arc(n+f,i-r,c,b-Ot,b),e.arc(n+h,i+a,c,b,b+Ot),e.arc(n-f,i+r,c,b+Ot,b+dt),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}b+=Ce;case"rectRot":h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+f,i-r),e.lineTo(n+h,i+a),e.lineTo(n-f,i+r),e.closePath();break;case"crossRot":b+=Ce;case"cross":h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+h,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"star":h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+h,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r),b+=Ce,h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+h,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"line":r=s?s/2:Math.cos(b)*y,a=Math.sin(b)*y,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(b)*(s?s/2:y),i+Math.sin(b)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Qe(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 ts(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function es(e){e.restore()}function Pp(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Rp(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 Ip(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),rt(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 Lp(e,t,n,i,s){if(s.strikethrough||s.underline){const o=e.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,u),e.lineTo(a,u),e.stroke()}}function Np(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Bn(e,t,n,i,s,o={}){const r=xt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,Ip(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Np(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),rt(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Lp(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function di(e,t){const{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*dt,dt,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,dt,Ot,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Ot,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-Ot,!0),e.lineTo(n+r.topLeft,i)}const Fp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Bp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zp(e,t){const n=(""+e).match(Fp);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 Up=e=>+e||0;function zr(e,t){const n={},i=ft(t),s=i?Object.keys(t):t,o=ft(e)?i?r=>at(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=Up(o(r));return n}function Ac(e){return zr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function yn(e){return zr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Wt(e){const t=Ac(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Pt(e,t){e=e||{},t=t||Et.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=at(e.style,t.style);i&&!(""+i).match(Bp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:at(e.family,t.family),lineHeight:zp(at(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:at(e.weight,t.weight),string:""};return s.string=Ep(s),s}function ns(e,t,n,i){let s,o,r;for(s=0,o=e.length;s<o;++s)if(r=e[s],r!==void 0&&r!==void 0)return r}function Hp(e,t,n){const{min:i,max:s}=e,o=dc(t,(s-i)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function bn(e,t){return Object.assign(Object.create(e),t)}function Ur(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Nc("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>Ur([a,...e],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return Rc(a,l,()=>Kp(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Fc(a).includes(l)},ownKeys(a){return Fc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function hi(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Pc(e,i),setContext:o=>hi(e,o,n,i),override:o=>hi(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return Rc(o,r,()=>Wp(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function Pc(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:me(n)?n:()=>n,isIndexable:me(i)?i:()=>i}}const Vp=(e,t)=>e?e+Or(t):t,Hr=(e,t)=>ft(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Rc(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function Wp(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return me(a)&&r.isScriptable(t)&&(a=$p(t,a,e,n)),xt(a)&&a.length&&(a=Yp(t,a,e,r.isIndexable)),Hr(t,a)&&(a=hi(a,s,o&&o[t],r)),a}function $p(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||i);return a.delete(e),Hr(e,l)&&(l=Vr(s._scopes,s,e,l)),l}function Yp(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.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=Vr(c,s,e,u);t.push(hi(h,o,r&&r[e],a))}}return t}function Ic(e,t,n){return me(e)?e(t,n):e}const jp=(e,t)=>e===!0?t:typeof e=="string"?mn(t,e):void 0;function qp(e,t,n,i,s){for(const o of t){const r=jp(n,o);if(r){e.add(r);const a=Ic(r._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(r===!1&&typeof i<"u"&&n!==i)return null}return!1}function Vr(e,t,n,i){const s=t._rootScopes,o=Ic(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=Lc(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=Lc(a,r,o,l,i),l===null)?!1:Ur(Array.from(a),[""],s,o,()=>Gp(t,n,i))}function Lc(e,t,n,i,s){for(;n;)n=qp(e,t,n,i,s);return n}function Gp(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return xt(s)&&ft(n)?n:s||{}}function Kp(e,t,n,i){let s;for(const o of t)if(s=Nc(Vp(o,e),n),typeof s<"u")return Hr(e,s)?Vr(n,i,e,s):s}function Nc(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Fc(e){let t=e._keys;return t||(t=e._keys=Xp(e._scopes)),t}function Xp(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Bc(e,t,n,i){const{iScale:s}=e,{key:o="r"}=this._parsing,r=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+n,u=t[c],r[a]={r:s.parse(mn(u,o),c)};return r}const Zp=Number.EPSILON||1e-14,fi=(e,t)=>t<e.length&&!e[t].skip&&e[t],zc=e=>e==="x"?"y":"x";function Qp(e,t,n,i){const s=e.skip?t:e,o=t,r=n.skip?t:n,a=ui(o,s),l=ui(r,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,f=i*u;return{previous:{x:o.x-h*(r.x-s.x),y:o.y-h*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function Jp(e,t,n){const i=e.length;let s,o,r,a,l,c=fi(e,0);for(let u=0;u<i-1;++u)if(l=c,c=fi(e,u+1),!(!l||!c)){if(Ki(t[u],0,Zp)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=s*r*t[u],n[u+1]=o*r*t[u])}}function tg(e,t,n="x"){const i=zc(n),s=e.length;let o,r,a,l=fi(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=fi(e,c+1),!a)continue;const u=a[n],h=a[i];r&&(o=(u-r[n])/3,a[`cp1${n}`]=u-o,a[`cp1${i}`]=h-o*t[c]),l&&(o=(l[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${i}`]=h+o*t[c])}}function eg(e,t="x"){const n=zc(t),i=e.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=fi(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=fi(e,r+1),!!l){if(c){const u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?ze(s[r-1])!==ze(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Jp(e,s,o),tg(e,o,t)}function co(e,t,n){return Math.max(Math.min(e,n),t)}function ng(e,t){let n,i,s,o,r,a=Qe(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&Qe(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=co(s.cp1x,t.left,t.right),s.cp1y=co(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=co(s.cp2x,t.left,t.right),s.cp2y=co(s.cp2y,t.top,t.bottom)))}function ig(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")eg(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=Qp(c,a,e[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&ng(e,n)}function Wr(){return typeof window<"u"&&typeof document<"u"}function $r(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function uo(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 ho=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function sg(e,t){return ho(e).getPropertyValue(t)}const og=["top","right","bottom","left"];function zn(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=og[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const rg=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function ag(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(rg(s,o,e.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function _n(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=ho(n),o=s.boxSizing==="border-box",r=zn(s,"padding"),a=zn(s,"border","width"),{x:l,y:c,box:u}=ag(e,n),h=r.left+(u&&a.left),f=r.top+(u&&a.top);let{width:m,height:p}=t;return o&&(m-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-h)/m*n.width/i),y:Math.round((c-f)/p*n.height/i)}}function lg(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&$r(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=ho(o),l=zn(a,"border","width"),c=zn(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=uo(a.maxWidth,o,"clientWidth"),s=uo(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||no,maxHeight:s||no}}const xn=e=>Math.round(e*10)/10;function cg(e,t,n,i){const s=ho(e),o=zn(s,"margin"),r=uo(s.maxWidth,e,"clientWidth")||no,a=uo(s.maxHeight,e,"clientHeight")||no,l=lg(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=zn(s,"border","width"),m=zn(s,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=xn(Math.min(c,r,l.maxWidth)),u=xn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=xn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=xn(Math.floor(u*i))),{width:c,height:u}}function Uc(e,t,n){const i=t||1,s=xn(e.height*i),o=xn(e.width*i);e.height=xn(e.height),e.width=xn(e.width);const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const ug=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Wr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Hc(e,t){const n=sg(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Un(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function dg(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 hg(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Un(e,s,n),a=Un(s,o,n),l=Un(o,t,n),c=Un(r,a,n),u=Un(a,l,n);return Un(c,u,n)}const fg=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}}},mg=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function mi(e,t,n){return e?fg(t,n):mg()}function Vc(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 Wc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function $c(e){return e==="angle"?{between:Xi,compare:pp,normalize:ne}:{between:Xe,compare:(t,n)=>t-n,normalize:t=>t}}function Yc({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function pg(e,t,n){const{property:i,start:s,end:o}=n,{between:r,normalize:a}=$c(i),l=t.length;let{start:c,end:u,loop:h}=e,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&r(a(t[c%l][i]),s,o);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:e.style}}function jc(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=$c(i),{start:u,end:h,loop:f,style:m}=pg(e,t,n),p=[];let y=!1,b=null,S,M,E;const D=()=>l(s,E,S)&&a(s,E)!==0,C=()=>a(o,S)===0||l(o,E,S),A=()=>y||D(),O=()=>!y||C();for(let x=u,_=u;x<=h;++x)M=t[x%r],!M.skip&&(S=c(M[i]),S!==E&&(y=l(S,s,o),b===null&&A()&&(b=a(S,s)===0?x:_),b!==null&&O()&&(p.push(Yc({start:b,end:x,loop:f,count:r,style:m})),b=null),_=x,E=S));return b!==null&&p.push(Yc({start:b,end:h,loop:f,count:r,style:m})),p}function qc(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=jc(i[s],e.points,t);o.length&&n.push(...o)}return n}function gg(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function yg(e,t,n,i){const s=e.length,o=[];let r=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function bg(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:r,end:a}=gg(n,s,o,i);if(i===!0)return Gc(e,[{start:r,end:a,loop:o}],n,t);const l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Gc(e,yg(n,r,l,c),n,t)}function Gc(e,t,n,i){return!i||!i.setContext||!n?t:_g(e,t,n,i)}function _g(e,t,n,i){const s=e._chart.getContext(),o=Kc(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,h=t[0].start,f=h;function m(p,y,b,S){const M=a?-1:1;if(p!==y){for(p+=l;n[p%l].skip;)p-=M;for(;n[y%l].skip;)y+=M;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:b,style:S}),u=S,h=y%l)}}for(const p of t){h=a?h:p.start;let y=n[h%l],b;for(f=h+1;f<=p.end;f++){const S=n[f%l];b=Kc(i.setContext(bn(s,{type:"segment",p0:y,p1:S,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),xg(b,u)&&m(h,f-1,p.loop,u),y=S,u=b}h<f-1&&m(h,f-1,p.loop,u)}return c}function Kc(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function xg(e,t){if(!t)return!1;const n=[],i=function(s,o){return Rr(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function fo(e,t,n){return e.options.clip?e[n]:t[n]}function wg(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:fo(n,t,"left"),right:fo(n,t,"right"),top:fo(i,t,"top"),bottom:fo(i,t,"bottom")}:t}function Xc(e,t){const n=t._clip;if(n.disabled)return!1;const i=wg(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)}}class Sg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=wc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.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,s)=>Math.max(i,s._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 s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Je=new Sg;const Zc="transparent",Tg={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Ir(e||Zc),s=i.valid&&Ir(t||Zc);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class vg{constructor(t,n,i,s){const o=n[i];s=ns([t.to,s,o,t.from]);const r=ns([t.from,o,s]);this._active=!0,this._fn=t.fn||Tg[t.type||typeof r],this._easing=Zi[t.easing]||Zi.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=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ns([t.to,n,s,t.from]),this._from=ns([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}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 s=0;s<i.length;s++)i[s][n]()}}class Yr{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ft(t))return;const n=Object.keys(Et.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!ft(o))return;const r={};for(const a of n)r[a]=o[a];(xt(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=kg(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Mg(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let h=o[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,u,a);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=h=new vg(f,t,c,u),s.push(h)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Je.add(this._chart,i),!0}}function Mg(e,t){const n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function kg(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 Qc(e,t){const n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function Dg(e,t,n){if(n===!1)return!1;const i=Qc(e,n),s=Qc(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Cg(e){let t,n,i,s;return ft(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function Jc(e,t){const n=[],i=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function tu(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let r,a,l,c;if(t===null)return;let u=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(u=!0,i.all)continue;break}c=e.values[l],At(c)&&(o||t===0||ze(t)===ze(c))&&(t+=c)}return!u&&!i.all?0:t}function Og(e,t){const{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length);let l,c,u;for(l=0,c=r.length;l<c;++l)u=r[l],a[l]={[s]:u,[o]:e[u]};return a}function jr(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Eg(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Ag(e){const{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function Pg(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function eu(e,t,n,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function nu(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=Eg(o,r,i),h=t.length;let f;for(let m=0;m<h;++m){const p=t[m],{[l]:y,[c]:b}=p,S=p._stacks||(p._stacks={});f=S[c]=Pg(s,u,y),f[a]=b,f._top=eu(f,r,!0,i.type),f._bottom=eu(f,r,!1,i.type);const M=f._visualValues||(f._visualValues={});M[a]=b}}function qr(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Rg(e,t){return bn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ig(e,t,n){return bn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function is(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const Gr=e=>e==="reset"||e==="none",iu=(e,t)=>t?e:Object.assign({},e),Lg=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Jc(n,!0),values:null};class wn{static defaults={};static datasetElementType=null;static dataElementType=null;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=jr(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&&is(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,o=n.xAxisID=at(i.xAxisID,qr(t,"x")),r=n.yAxisID=at(i.yAxisID,qr(t,"y")),a=n.rAxisID=at(i.rAxisID,qr(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),u=n.vAxisID=s(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),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&&_c(this._data,this),t._stacked&&is(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(ft(n)){const s=this._cachedMeta;this._data=Og(n,s)}else if(i!==n){if(i){_c(i,this);const s=this._cachedMeta;is(s),s._parsed=[]}n&&Object.isExtensible(n)&&_p(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 s=!1;this._dataCheck();const o=n._stacked;n._stacked=jr(n.vScale,n),n.stack!==i.stack&&(s=!0,is(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(nu(this,n._parsed),n._stacked=jr(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:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&n===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{xt(s[t])?f=this.parseArrayData(i,s,t,n):ft(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);const m=()=>h[a]===null||c&&h[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}r&&nu(this,f)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,h=new Array(s);let f,m,p;for(f=0,m=s;f<m;++f)p=f+i,h[f]={[a]:u||o.parse(c[p],p),[l]:r.parse(n[p],p)};return h}parseArrayData(t,n,i,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=n[u],a[l]={x:o.parse(h[0],u),y:r.parse(h[1],u)};return a}parseObjectData(t,n,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=n[f],c[u]={x:o.parse(mn(m,a),f),y:r.parse(mn(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:Jc(s,!0),values:n._stacks[t.axis]._visualValues};return tu(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){const o=i[n.axis];let r=o===null?NaN:o;const a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=tu(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Lg(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Ag(a);let f,m;function p(){m=s[f];const y=m[a.axis];return!At(m[t.axis])||u>y||h<y}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(c,t,m,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],At(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Cg(at(this.options.clip,Dg(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const h=s[u];h.hidden||(h.active&&c?r.push(h):h.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}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 s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Ig(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Rg(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}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 s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&fe(i);if(a)return iu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(Et.elements[t]),p=()=>this.getContext(i,s,n),y=c.resolveNamedOptions(f,m,p,h);return y.$shared&&(y.$shared=l,o[r]=Object.freeze(iu(y,l))),y}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,n))}const c=new Yr(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Gr(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){Gr(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!Gr(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}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[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){const s=this._cachedMeta,o=s.data,r=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&is(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,s]=t;this[n](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,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])}}function Ng(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=n.length;s<o;s++)i=i.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=xc(i.sort((s,o)=>s-o))}return e._cache.$bar}function Fg(e){const t=e.iScale,n=Ng(t,e.type);let i=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(fe(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(s=0,o=n.length;s<o;++s)r=t.getPixelForValue(n[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return i}function Bg(e,t,n,i){const s=n.barThickness;let o,r;return rt(s)?(o=t.min*n.categoryPercentage,r=n.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[e]-o/2}}function zg(e,t,n,i){const s=t.pixels,o=s[e];let r=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const l=n.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:n.barPercentage,start:c}}function Ug(e,t,n,i){const s=n.parse(e[0],i),o=n.parse(e[1],i),r=Math.min(s,o),a=Math.max(s,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function su(e,t,n,i){return xt(e)?Ug(e,t,n,i):t[n.axis]=n.parse(e,i),t}function ou(e,t,n,i){const s=e.iScale,o=e.vScale,r=s.getLabels(),a=s===o,l=[];let c,u,h,f;for(c=n,u=n+i;c<u;++c)f=t[c],h={},h[s.axis]=a||s.parse(r[c],c),l.push(su(f,h,o,c));return l}function Kr(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Hg(e,t,n){return e!==0?ze(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Vg(e){let t,n,i,s,o;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:i,reverse:t,top:s,bottom:o}}function Wg(e,t,n,i){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:u}=Vg(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?s=c:(n._bottom||0)===i?s=u:(o[ru(u,r,a,l)]=!0,s=c)),o[ru(s,r,a,l)]=!0,e.borderSkipped=o}function ru(e,t,n,i){return i?(e=$g(e,t,n),e=au(e,n,t)):e=au(e,t,n),e}function $g(e,t,n){return e===t?n:e===n?t:e}function au(e,t,n){return e==="start"?t:e==="end"?n:e}function Yg(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class lu extends wn{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,i,s){return ou(t,n,i,s)}parseArrayData(t,n,i,s){return ou(t,n,i,s)}parseObjectData(t,n,i,s){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,u=r.axis==="x"?a:l,h=[];let f,m,p,y;for(f=i,m=i+s;f<m;++f)y=n[f],p={},p[o.axis]=o.parse(mn(y,c),f),h.push(su(mn(y,u),p,r,f));return h}updateRangeFromParsed(t,n,i,s){super.updateRangeFromParsed(t,n,i,s);const o=i._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:s}=n,o=this.getParsed(t),r=o._custom,a=Kr(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}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,s){const o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,s);for(let m=n;m<n+i;m++){const p=this.getParsed(m),y=o||rt(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,u),S=(p._stacks||{})[a.axis],M={horizontal:c,base:y.base,enableBorderRadius:!S||Kr(p._custom)||r===S._top||r===S._bottom,x:c?y.head:b.center,y:c?b.center:y.head,height:c?b.size:Math.abs(y.size),width:c?Math.abs(y.size):b.size};f&&(M.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const E=M.options||t[m].options;Wg(M,E,S,r),Yg(M,E,u.ratio),this.updateElement(t[m],m,M,s)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(rt(f)||isNaN(f))return!0};for(const u of s)if(!(n!==void 0&&c(u))&&((o===!1||r.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&r.push(u.stack),u.index===t))break;return r.length||r.push(void 0),r}_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[at(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const s=this._getStacks(t,i),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let o,r;for(o=0,r=n.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||Fg(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,u=Kr(c);let h=l[n.axis],f=0,m=i?this.applyStack(n,l,i):h,p,y;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&ze(h)!==ze(c.barEnd)&&(f=0),f+=h);const b=!rt(o)&&!u?o:f;let S=n.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+m):p=S,y=p-S,Math.abs(y)<r){y=Hg(y,n,a)*r,h===a&&(S-=y/2);const M=n.getPixelForDecimal(0),E=n.getPixelForDecimal(1),D=Math.min(M,E),C=Math.max(M,E);S=Math.max(Math.min(S,C),D),p=S+y,i&&!u&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(S))}if(S===n.getPixelForValue(a)){const M=ze(y)*n.getLineWidthForValue(a)/2;S+=M,y-=M}return{size:y,base:S,head:p,center:p+y/2}}_calculateBarIndexPixels(t,n){const i=n.scale,s=this.options,o=s.skipNull,r=at(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,h=s.barThickness==="flex"?zg(t,n,s,u*c):Bg(t,n,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(at(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;a=h.start+h.chunk*p+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}class jg extends wn{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,s){const o=super.parsePrimitiveData(t,n,i,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(t,n,i,s){const o=super.parseArrayData(t,n,i,s);for(let r=0;r<o.length;r++){const a=n[i+r];o[r]._custom=at(a[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(t,n,i,s){const o=super.parseObjectData(t,n,i,s);for(let r=0;r<o.length;r++){const a=n[i+r];o[r]._custom=at(a&&a.r&&+a.r,this.resolveDataElementOptions(r+i).radius)}return o}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:s,yScale:o}=n,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=r.axis,h=a.axis;for(let f=n;f<n+i;f++){const m=t[f],p=!o&&this.getParsed(f),y={},b=y[u]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[u]),S=y[h]=o?a.getBasePixel():a.getPixelForValue(p[h]);y.skip=isNaN(b)||isNaN(S),c&&(y.options=l||this.resolveDataElementOptions(f,m.active?"active":s),o&&(y.options.radius=0)),this.updateElement(m,f,y,s)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=at(i&&i._custom,o),s}}function qg(e,t,n){let i=1,s=1,o=0,r=0;if(t<Dt){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),h=Math.cos(l),f=Math.sin(l),m=(E,D,C)=>Xi(E,a,l,!0)?1:Math.max(D,D*n,C,C*n),p=(E,D,C)=>Xi(E,a,l,!0)?-1:Math.min(D,D*n,C,C*n),y=m(0,c,h),b=m(Ot,u,f),S=p(dt,c,h),M=p(dt+Ot,u,f);i=(y-S)/2,s=(b-M)/2,o=-(y+S)/2,r=-(b+M)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class ss extends wn{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:i,borderRadius:r&&(a||h.borderRadius),index:c}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};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,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(ft(i[t])){const{key:l="value"}=this._parsing;o=c=>+mn(i[c],l)}let r,a;for(r=t,a=t+n;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return Vt(this.options.rotation-90)}_getCircumference(){return Vt(this.options.circumference)}_getRotationExtents(){let t=Dt,n=-Dt;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,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+r)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(op(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:y}=qg(h,u,l),b=(i.width-r)/f,S=(i.height-r)/m,M=Math.max(Math.min(b,S)/2,0),E=dc(this.options.radius,M),D=Math.max(E*l,0),C=(E-D)/this._getVisibleDatasetWeightTotal();this.offsetX=p*E,this.offsetY=y*E,s.total=this.calculateTotal(),this.outerRadius=E-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/Dt)}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,u=(a.left+a.right)/2,h=(a.top+a.bottom)/2,f=o&&c.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:b}=this._getSharedOptions(n,s);let S=this._getRotation(),M;for(M=0;M<n;++M)S+=this._circumference(M,o);for(M=n;M<n+i;++M){const E=this._circumference(M,o),D=t[M],C={x:u+this.offsetX,y:h+this.offsetY,startAngle:S,endAngle:S+E,circumference:E,outerRadius:p,innerRadius:m};b&&(C.options=y||this.resolveDataElementOptions(M,D.active?"active":s)),S+=E,this.updateElement(D,M,C,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Dt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Qi(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.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(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class cu extends wn{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:a,count:l}=Tc(n,s,r);this._drawStart=a,this._drawCount=l,vc(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._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:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,s),f=r.axis,m=a.axis,{spanGaps:p,segment:y}=this.options,b=gn(p)?p:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||s==="none",M=n+i,E=t.length;let D=n>0&&this.getParsed(n-1);for(let C=0;C<E;++C){const A=t[C],O=S?A:{};if(C<n||C>=M){O.skip=!0;continue}const x=this.getParsed(C),_=rt(x[m]),T=O[f]=r.getPixelForValue(x[f],C),k=O[m]=o||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,x,l):x[m],C);O.skip=isNaN(T)||isNaN(k)||_,O.stop=C>0&&Math.abs(x[f]-D[f])>b,y&&(O.parsed=x,O.raw=c.data[C]),h&&(O.options=u||this.resolveDataElementOptions(C,A.active?"active":s)),S||this.updateElement(A,C,O,s),D=x}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class uu extends wn{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}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}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Qi(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,i,s){return Bc.bind(this)(t,n,i,s)}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,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*dt;let m=f,p;const y=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,y);for(p=n;p<n+i;p++){const b=t[p];let S=m,M=m+this._computeAngle(p,s,y),E=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=M,o&&(l.animateScale&&(E=0),l.animateRotate&&(S=M=f));const D={x:u,y:h,innerRadius:0,outerRadius:E,startAngle:S,endAngle:M,options:this.resolveDataElementOptions(p,b.active?"active":s)};this.updateElement(b,p,D,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Vt(this.resolveDataElementOptions(t,n).angle||i):0}}class Gg extends ss{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Kg extends wn{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};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,s){return Bc.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(i.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let a=n;a<n+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=o.getPointPositionForValue(a,this.getParsed(a).r),h=r?o.xCenter:u.x,f=r?o.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,a,m,s)}}}class Xg extends wn{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:r}=Tc(n,i,s);if(this._drawStart=o,this._drawCount=r,vc(n)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=r.axis,p=a.axis,{spanGaps:y,segment:b}=this.options,S=gn(y)?y:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||o||s==="none";let E=n>0&&this.getParsed(n-1);for(let D=n;D<n+i;++D){const C=t[D],A=this.getParsed(D),O=M?C:{},x=rt(A[p]),_=O[m]=r.getPixelForValue(A[m],D),T=O[p]=o||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[p],D);O.skip=isNaN(_)||isNaN(T)||x,O.stop=D>0&&Math.abs(A[m]-E[m])>S,b&&(O.parsed=A,O.raw=c.data[D]),f&&(O.options=h||this.resolveDataElementOptions(D,C.active?"active":s)),M||this.updateElement(C,D,O,s),E=A}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}}var Zg=Object.freeze({__proto__:null,BarController:lu,BubbleController:jg,DoughnutController:ss,LineController:cu,PieController:Gg,PolarAreaController:uu,RadarController:Kg,ScatterController:Xg});function Hn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Hn()}parse(){return Hn()}format(){return Hn()}add(){return Hn()}diff(){return Hn()}startOf(){return Hn()}endOf(){return Hn()}}var du={_date:Xr};function Qg(e,t,n,i){const{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?yp:Ze;if(i){if(s._sharedOptions){const u=o[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(o,t,n-h),m=c(o,t,n+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=e,m=f.slice(0,u.lo+1).reverse().findIndex(y=>!rt(y[h.axis]));u.lo-=Math.max(0,m);const p=f.slice(u.hi).findIndex(y=>!rt(y[h.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:o.length-1}}function os(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:h,hi:f}=Qg(o[a],t,r,s);for(let m=h;m<=f;++m){const p=u[m];p.skip||i(p,c,m)}}}function Jg(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Zr(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||os(e,n,t,function(a,l,c){!s&&!Qe(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function ty(e,t,n,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:h}=oo(r,{x:t.x,y:t.y});Xi(h,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return os(e,n,t,o),s}function ey(e,t,n,i,s,o){let r=[];const a=Jg(n);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!m)return;const b=a(t,p);b<l?(r=[{element:u,datasetIndex:h,index:f}],l=b):b===l&&r.push({element:u,datasetIndex:h,index:f})}return os(e,n,t,c),r}function Qr(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?ty(e,t,n,s):ey(e,t,n,i,s,o)}function hu(e,t,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return os(e,n,t,(l,c,u)=>{l[r]&&l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Jr={evaluateInteractionItems:os,modes:{index(e,t,n,i){const s=_n(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Zr(e,s,o,i,r):Qr(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=_n(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?Zr(e,s,o,i,r):Qr(e,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,i){const s=_n(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Zr(e,s,o,i,r)},nearest(e,t,n,i){const s=_n(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Qr(e,s,o,n.intersect,i,r)},x(e,t,n,i){const s=_n(t,e);return hu(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=_n(t,e);return hu(e,s,"y",n.intersect,i)}}};const fu=["left","top","right","bottom"];function rs(e,t){return e.filter(n=>n.pos===t)}function mu(e,t){return e.filter(n=>fu.indexOf(n.pos)===-1&&n.box.axis===t)}function as(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function ny(e){const t=[];let n,i,s,o,r,a;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function iy(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!fu.includes(s))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function sy(e,t){const n=iy(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return n}function oy(e){const t=ny(e),n=as(t.filter(c=>c.box.fullSize),!0),i=as(rs(t,"left"),!0),s=as(rs(t,"right")),o=as(rs(t,"top"),!0),r=as(rs(t,"bottom")),a=mu(t,"x"),l=mu(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:rs(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function pu(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function gu(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 ry(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!ft(s)){n.size&&(e[s]-=n.size);const h=i[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?o.height:o.width),n.size=h.size/h.count,e[s]+=n.size}o.getPadding&&gu(r,o.getPadding());const a=Math.max(0,t.outerWidth-pu(r,e,"left","right")),l=Math.max(0,t.outerHeight-pu(r,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function ay(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function ly(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return i(e?["left","right"]:["top","bottom"])}function ls(e,t,n,i){const s=[];let o,r,a,l,c,u;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,ly(a.horizontal,t));const{same:h,other:f}=ry(t,n,a,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&ls(s,t,n,i)||u}function mo(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function yu(e,t,n,i){const s=n.padding;let{x:o,y:r}=t;for(const a of e){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const h=t.w*u,f=c.size||l.height;fe(c.start)&&(r=c.start),l.fullSize?mo(l,s.left,r,n.outerWidth-s.right-s.left,f):mo(l,t.left+c.placed,r,h,f),c.start=r,c.placed+=h,r=l.bottom}else{const h=t.h*u,f=c.size||l.width;fe(c.start)&&(o=c.start),l.fullSize?mo(l,o,s.top,f,n.outerHeight-s.bottom-s.top):mo(l,o,t.top+c.placed,f,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=r}var se={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 s=Wt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=oy(e.boxes),l=a.vertical,c=a.horizontal;St(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,b)=>b.box.options&&b.box.options.display===!1?y:y+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},s);gu(f,Wt(i));const m=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),p=sy(l.concat(c),h);ls(a.fullSize,m,h,p),ls(l,m,h,p),ls(c,m,h,p)&&ls(l,m,h,p),ay(m),yu(a.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,yu(a.rightAndBottom,m,h,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},St(a.chartArea,y=>{const b=y.box;Object.assign(b,e.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class bu{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class cy extends bu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const po="$chartjs",uy={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},_u=e=>e===null||e==="";function dy(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[po]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",_u(s)){const o=Hc(e,"width");o!==void 0&&(e.width=o)}if(_u(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Hc(e,"height");o!==void 0&&(e.height=o)}return e}const xu=ug?{passive:!0}:!1;function hy(e,t,n){e&&e.addEventListener(t,n,xu)}function fy(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,xu)}function my(e,t){const n=uy[e.type]||e.type,{x:i,y:s}=_n(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function go(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function py(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||go(a.addedNodes,i),r=r&&!go(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function gy(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||go(a.removedNodes,i),r=r&&!go(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const cs=new Map;let wu=0;function Su(){const e=window.devicePixelRatio;e!==wu&&(wu=e,cs.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function yy(e,t){cs.size||window.addEventListener("resize",Su),cs.set(e,t)}function by(e){cs.delete(e),cs.size||window.removeEventListener("resize",Su)}function _y(e,t,n){const i=e.canvas,s=i&&$r(i);if(!s)return;const o=Sc((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),yy(e,o),r}function ta(e,t,n){n&&n.disconnect(),t==="resize"&&by(e)}function xy(e,t,n){const i=e.canvas,s=Sc(o=>{e.ctx!==null&&n(my(o,e))},e);return hy(i,t,s),s}class wy extends bu{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(dy(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[po])return!1;const i=n[po].initial;["height","width"].forEach(o=>{const r=i[o];rt(r)?n.removeAttribute(o):n.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[po],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:py,detach:gy,resize:_y}[n]||xy;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:ta,detach:ta,resize:ta}[n]||fy)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return cg(t,n,i,s)}isAttached(t){const n=t&&$r(t);return!!(n&&n.isConnected)}}function Sy(e){return!Wr()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?cy:wy}class oe{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return gn(this.x)&&gn(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function Ty(e,t){const n=e.options.ticks,i=vy(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?ky(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Dy(t,c,o,r/s),c;const u=My(o,t,s);if(r>0){let h,f;const m=r>1?Math.round((l-a)/(r-1)):null;for(yo(t,c,u,rt(m)?0:a-m,a),h=0,f=r-1;h<f;h++)yo(t,c,u,o[h],o[h+1]);return yo(t,c,u,l,rt(m)?t.length:l+m),c}return yo(t,c,u),c}function vy(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function My(e,t,n){const i=Cy(e),s=t.length/n;if(!i)return Math.max(s,1);const o=hp(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function ky(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function Dy(e,t,n,i){let s=0,o=n[0],r;for(i=Math.ceil(i),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=n[s*i])}function yo(e,t,n,i,s){const o=at(i,0),r=Math.min(at(s,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function Cy(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 Oy=e=>e==="left"?"right":e==="right"?"left":e,Tu=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,vu=(e,t)=>Math.min(t||e,e);function Mu(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function Ey(e,t,n){const i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6;let l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Ay(e,t){St(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function us(e){return e.drawTicks?e.tickLength:0}function ku(e,t){if(!e.display)return 0;const n=Pt(e.font,t),i=Wt(e.padding);return(xt(e.text)?e.text.length:1)*n.lineHeight+i.height}function Py(e,t){return bn(e,{scale:t,type:"scale"})}function Ry(e,t,n){return bn(e,{tick:n,index:t,type:"tick"})}function Iy(e,t,n){let i=Pr(e);return(n&&t!=="right"||!n&&t==="right")&&(i=Oy(i)),i}function Ly(e,t,n,i){const{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let h=0,f,m,p;const y=r-s,b=a-o;if(e.isHorizontal()){if(m=ie(i,o,a),ft(n)){const S=Object.keys(n)[0],M=n[S];p=u[S].getPixelForValue(M)+y-t}else n==="center"?p=(c.bottom+c.top)/2+y-t:p=Tu(e,n,t);f=a-o}else{if(ft(n)){const S=Object.keys(n)[0],M=n[S];m=u[S].getPixelForValue(M)-b+t}else n==="center"?m=(c.left+c.right)/2-b+t:m=Tu(e,n,t);p=ie(i,r,s),h=n==="left"?-Ot:Ot}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class Vn extends oe{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:s}=this;return t=ve(t,Number.POSITIVE_INFINITY),n=ve(n,Number.NEGATIVE_INFINITY),i=ve(i,Number.POSITIVE_INFINITY),s=ve(s,Number.NEGATIVE_INFINITY),{min:ve(t,i),max:ve(n,s),minDefined:At(t),maxDefined:At(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:ve(n,ve(i,n)),max:ve(i,ve(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(){wt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.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=Hp(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Mu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Ty(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,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(){wt(this.options.afterUpdate,[this])}beforeSetDimensions(){wt(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(){wt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),wt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){wt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=wt(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){wt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){wt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=vu(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||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);a=t.offset?this.maxWidth/i:m/(i-1),h+6>a&&(a=m/(i-(t.offset?.5:1)),l=this.maxHeight-us(t.grid)-n.padding-ku(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),r=so(Math.min(Math.asin(Kt((u.highest.height+6)/a,-1,1)),Math.asin(Kt(l/c,-1,1))-Math.asin(Kt(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){wt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){wt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=ku(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=us(o)+l):(t.height=this.maxHeight,t.width=us(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,p=Vt(this.labelRotation),y=Math.cos(p),b=Math.sin(p);if(a){const S=i.mirror?0:b*h.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+S+m)}else{const S=i.mirror?0:y*h.width+b*f.height;t.width=Math.min(this.maxWidth,t.width+S+m)}this._calculatePadding(c,u,b,y)}}this._handleMargins(),a?(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,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=s*t.width,m=i*n.height):(f=i*t.height,m=s*n.width):o==="start"?m=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,m=n.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+r)*this.width/(this.width-h),0)}else{let u=n.height/2,h=t.height/2;o==="start"?(u=0,h=t.height):o==="end"&&(u=n.height,h=0),this.paddingTop=u+r,this.paddingBottom=h+r}}_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(){wt(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++)rt(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=Mu(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/vu(n,i));let c=0,u=0,h,f,m,p,y,b,S,M,E,D,C;for(h=0;h<n;h+=l){if(p=t[h].label,y=this._resolveTickFontOptions(h),s.font=b=y.string,S=o[b]=o[b]||{data:{},gc:[]},M=y.lineHeight,E=D=0,!rt(p)&&!xt(p))E=lo(s,S.data,S.gc,E,p),D=M;else if(xt(p))for(f=0,m=p.length;f<m;++f)C=p[f],!rt(C)&&!xt(C)&&(E=lo(s,S.data,S.gc,E,C),D+=M);r.push(E),a.push(D),c=Math.max(E,c),u=Math.max(D,u)}Ay(o,n);const A=r.indexOf(c),O=a.indexOf(u),x=_=>({width:r[_]||0,height:a[_]||0});return{first:x(0),last:x(n-1),widest:x(A),highest:x(O),widths:r,heights:a}}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 gp(this._alignToPixels?Fn(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=Ry(this.getContext(),t,i))}return this.$context||(this.$context=Py(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Vt(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=us(o),m=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,b=y/2,S=function(H){return Fn(i,H,y)};let M,E,D,C,A,O,x,_,T,k,I,Y;if(r==="top")M=S(this.bottom),O=this.bottom-f,_=M-b,k=S(t.top)+b,Y=t.bottom;else if(r==="bottom")M=S(this.top),k=t.top,Y=S(t.bottom)-b,O=M+b,_=this.top+f;else if(r==="left")M=S(this.right),A=this.right-f,x=M-b,T=S(t.left)+b,I=t.right;else if(r==="right")M=S(this.left),T=t.left,I=S(t.right)-b,A=M+b,x=this.left+f;else if(n==="x"){if(r==="center")M=S((t.top+t.bottom)/2+.5);else if(ft(r)){const H=Object.keys(r)[0],$=r[H];M=S(this.chart.scales[H].getPixelForValue($))}k=t.top,Y=t.bottom,O=M+b,_=O+f}else if(n==="y"){if(r==="center")M=S((t.left+t.right)/2);else if(ft(r)){const H=Object.keys(r)[0],$=r[H];M=S(this.chart.scales[H].getPixelForValue($))}A=M-b,x=A-f,T=t.left,I=t.right}const U=at(s.ticks.maxTicksLimit,h),j=Math.max(1,Math.ceil(h/U));for(E=0;E<h;E+=j){const H=this.getContext(E),$=o.setContext(H),R=a.setContext(H),B=$.lineWidth,z=$.color,P=R.dash||[],N=R.dashOffset,V=$.tickWidth,Q=$.tickColor,X=$.tickBorderDash||[],q=$.tickBorderDashOffset;D=Ey(this,E,l),D!==void 0&&(C=Fn(i,D,B),c?A=x=T=I=C:O=_=k=Y=C,m.push({tx1:A,ty1:O,tx2:x,ty2:_,x1:T,y1:k,x2:I,y2:Y,width:B,color:z,borderDash:P,borderDashOffset:N,tickWidth:V,tickColor:Q,tickBorderDash:X,tickBorderDashOffset:q}))}return this._ticksLength=h,this._borderValue=M,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=o,f=us(i.grid),m=f+u,p=h?-u:m,y=-Vt(this.labelRotation),b=[];let S,M,E,D,C,A,O,x,_,T,k,I,Y="middle";if(s==="top")A=this.bottom-p,O=this._getXAxisLabelAlignment();else if(s==="bottom")A=this.top+p,O=this._getXAxisLabelAlignment();else if(s==="left"){const j=this._getYAxisLabelAlignment(f);O=j.textAlign,C=j.x}else if(s==="right"){const j=this._getYAxisLabelAlignment(f);O=j.textAlign,C=j.x}else if(n==="x"){if(s==="center")A=(t.top+t.bottom)/2+m;else if(ft(s)){const j=Object.keys(s)[0],H=s[j];A=this.chart.scales[j].getPixelForValue(H)+m}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")C=(t.left+t.right)/2-m;else if(ft(s)){const j=Object.keys(s)[0],H=s[j];C=this.chart.scales[j].getPixelForValue(H)}O=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?Y="top":l==="end"&&(Y="bottom"));const U=this._getLabelSizes();for(S=0,M=a.length;S<M;++S){E=a[S],D=E.label;const j=o.setContext(this.getContext(S));x=this.getPixelForTick(S)+o.labelOffset,_=this._resolveTickFontOptions(S),T=_.lineHeight,k=xt(D)?D.length:1;const H=k/2,$=j.color,R=j.textStrokeColor,B=j.textStrokeWidth;let z=O;r?(C=x,O==="inner"&&(S===M-1?z=this.options.reverse?"left":"right":S===0?z=this.options.reverse?"right":"left":z="center"),s==="top"?c==="near"||y!==0?I=-k*T+T/2:c==="center"?I=-U.highest.height/2-H*T+T:I=-U.highest.height+T/2:c==="near"||y!==0?I=T/2:c==="center"?I=U.highest.height/2-H*T:I=U.highest.height-k*T,h&&(I*=-1),y!==0&&!j.showLabelBackdrop&&(C+=T/2*Math.sin(y))):(A=x,I=(1-k)*T/2);let P;if(j.showLabelBackdrop){const N=Wt(j.backdropPadding),V=U.heights[S],Q=U.widths[S];let X=I-N.top,q=0-N.left;switch(Y){case"middle":X-=V/2;break;case"bottom":X-=V;break}switch(O){case"center":q-=Q/2;break;case"right":q-=Q;break;case"inner":S===M-1?q-=Q:S>0&&(q-=Q/2);break}P={left:q,top:X,width:Q+N.width,height:V+N.height,color:j.backdropColor}}b.push({label:D,font:_,textOffset:I,options:{rotation:y,color:$,strokeColor:R,strokeWidth:B,textAlign:z,textBaseline:Y,translation:[C,A],backdrop:P}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Vt(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,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:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o<r;++o){const l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Fn(t,this.left,r)-r/2,u=Fn(t,this.right,a)+a/2,h=f=l):(h=Fn(t,this.top,r)-r/2,f=Fn(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,h),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ts(i,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,u=r.textOffset;Bn(i,c,0,u,l,a)}s&&es(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=Pt(i.font),r=Wt(i.padding),a=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||ft(n)?(l+=r.bottom,xt(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=Ly(this,l,n,a);Bn(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:f,textAlign:Iy(a,n,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,n=t.ticks&&t.ticks.z||0,i=at(t.grid&&t.grid.z,-1),s=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Vn.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=n.length;o<r;++o){const a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Pt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class bo{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;By(n)&&(i=this.register(n));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Ny(t,r,i),this.override&&Et.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in Et[s]&&(delete Et[s][i],this.override&&delete Nn[i])}}function Ny(e,t,n){const i=qi(Object.create(null),[n?Et.get(n):{},Et.get(t),e.defaults]);Et.set(t,i),e.defaultRoutes&&Fy(t,e.defaultRoutes),e.descriptors&&Et.describe(t,e.descriptors)}function Fy(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");Et.route(o,s,l,a)})}function By(e){return"id"in e&&"defaults"in e}class zy{constructor(){this.controllers=new bo(wn,"datasets",!0),this.elements=new bo(oe,"elements"),this.plugins=new bo(Object,"plugins"),this.scales=new bo(Vn,"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(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):St(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=Or(t);wt(i["before"+s],[],i),n[t](i),wt(i["after"+s],[],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 s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ue=new zy;class Uy{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,n,i,s){s=s||{};for(const o of t){const r=o.plugin,a=r[i],l=[n,s,o.options];if(wt(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){rt(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,s=at(i.options&&i.options.plugins,{}),o=Hy(i);return s===!1&&!n?[]:Wy(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function Hy(e){const t={},n=[],i=Object.keys(Ue.plugins.items);for(let o=0;o<i.length;o++)n.push(Ue.getPlugin(i[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function Vy(e,t){return!t&&e===!1?null:e===!0?{}:e}function Wy(e,{plugins:t,localIds:n},i,s){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=Vy(i[l],s);c!==null&&o.push({plugin:a,options:$y(e.config,{plugin:a,local:n[l]},c,r)})}return o}function $y(e,{plugin:t,local:n},i,s){const o=e.pluginScopeKeys(t),r=e.getOptionScopes(i,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ea(e,t){const n=Et.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Yy(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function jy(e,t){return e===t?"_index_":"_value_"}function Du(e){if(e==="x"||e==="y"||e==="r")return e}function qy(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function na(e,...t){if(Du(e))return e;for(const n of t){const i=n.axis||qy(n.position)||e.length>1&&Du(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Cu(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Gy(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 Cu(e,"x",n[0])||Cu(e,"y",n[0])}return{}}function Ky(e,t){const n=Nn[e.type]||{scales:{}},i=t.scales||{},s=ea(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!ft(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=na(r,a,Gy(r,e),Et.scales[a.type]),c=jy(l,s),u=n.scales||{};o[r]=Gi(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||ea(a,t),u=(Nn[a]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Yy(h,l),m=r[f+"AxisID"]||f;o[m]=o[m]||Object.create(null),Gi(o[m],[{axis:f},i[m],u[h]])})}),Object.keys(o).forEach(r=>{const a=o[r];Gi(a,[Et.scales[a.type],Et.scale])}),o}function Ou(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=Ky(e,t)}function Eu(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Xy(e){return e=e||{},e.data=Eu(e.data),Ou(e),e}const Au=new Map,Pu=new Set;function _o(e,t){let n=Au.get(e);return n||(n=t(),Au.set(e,n),Pu.add(n)),n}const ds=(e,t,n)=>{const i=mn(t,n);i!==void 0&&e.add(i)};class Zy{constructor(t){this._config=Xy(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=Eu(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(),Ou(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _o(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return _o(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return _o(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return _o(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(h=>ds(l,t,h))),u.forEach(h=>ds(l,s,h)),u.forEach(h=>ds(l,Nn[o]||{},h)),u.forEach(h=>ds(l,Et,h)),u.forEach(h=>ds(l,Nr,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Pu.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Nn[n]||{},Et.datasets[n]||{},{type:n},Et,Nr]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ru(this._resolverCache,t,s);let l=r;if(Jy(r,n)){o.$shared=!1,i=me(i)?i():i;const c=this.createResolver(t,i,a);l=hi(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Ru(this._resolverCache,t,i);return ft(n)?hi(o,n,void 0,s):o}}function Ru(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:Ur(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const Qy=e=>ft(e)&&Object.getOwnPropertyNames(e).some(t=>me(e[t]));function Jy(e,t){const{isScriptable:n,isIndexable:i}=Pc(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(me(a)||Qy(a))||r&&xt(a))return!0}return!1}var tb="4.5.1";const eb=["top","bottom","left","right","chartArea"];function Iu(e,t){return e==="top"||e==="bottom"||eb.indexOf(e)===-1&&t==="x"}function Lu(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Nu(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),wt(n&&n.onComplete,[e],t)}function nb(e){const t=e.chart,n=t.options.animation;wt(n&&n.onProgress,[e],t)}function Fu(e){return Wr()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xo={},Bu=e=>{const t=Fu(e);return Object.values(xo).filter(n=>n.canvas===t).pop()};function ib(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function sb(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let pe=class{static defaults=Et;static instances=xo;static overrides=Nn;static registry=Ue;static version=tb;static getChart=Bu;static register(...t){Ue.add(...t),zu()}static unregister(...t){Ue.remove(...t),zu()}constructor(t,n){const i=this.config=new Zy(n),s=Fu(t),o=Bu(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Sy(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=sp(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,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 Uy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=xp(h=>this.update(h),r.resizeDelay||0),this._dataChanges=[],xo[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Je.listen(this,"complete",Nu),Je.listen(this,"progress",nb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return rt(t)?n&&o?o: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 Ue}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Uc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return Je.stop(this),this}resize(t,n){Je.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Uc(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),wt(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};St(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=na(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),St(o,r=>{const a=r.options,l=a.id,c=na(l,a),u=at(a.type,r.dtype);(a.position===void 0||Iu(a.position,c)!==Iu(r.dposition))&&(a.position=r.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ue.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(a,t)}),St(s,(r,a)=>{r||delete i[a]}),St(i,r=>{se.configure(this,r,r.options),se.addBox(this,r)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Lu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||ea(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=Ue.getController(a),{datasetElementType:c,dataElementType:u}=Et.datasets[a];Object.assign(l,{dataElementType:Ue.getElement(u),datasetElementType:c&&Ue.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){St(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()),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 o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(f),r=Math.max(+h.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||St(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Lu("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){St(this.scales,t=>{se.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!mc(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const r=i==="_removeElements"?-o:o;ib(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!mc(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;se.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],St(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),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,me(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Je.has(this)?this.attached&&!Je.running(this)&&Je.start(this):(this.draw(),Nu({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 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 s,o;for(s=0,o=n.length;s<o;++s){const r=n[s];(!t||r.visible)&&i.push(r)}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},s=Xc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&ts(n,s),t.controller.draw(),s&&es(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Qe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=Jr.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=bn(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 s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);fe(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Je.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(),Oc(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xo[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=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};St(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){St(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},St(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!to(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 s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),r=o(n,t),a=i?t:o(t,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=up(t),c=sb(t,this._lastEvent,i,l);i&&(this._lastEvent=null,wt(o.onHover,[t,a,this],this),l&&wt(o.onClick,[t,a,this],this));const u=!to(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function zu(){return St(pe.instances,e=>e._plugins.invalidate())}function ob(e,t,n){const{startAngle:i,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/r,ne(i-n));if(e.beginPath(),e.arc(s,o,r-c/2,i+h/2,n-h/2),a>0){const f=Math.min(c/a,ne(i-n));e.arc(s,o,a+c/2,n-f/2,i+f/2,!0)}else{const f=Math.min(c/2,r*ne(i-n));if(u==="round")e.arc(s,o,f,n-dt/2,i+dt/2,!0);else if(u==="bevel"){const m=2*f*f,p=-m*Math.cos(n+dt/2)+s,y=-m*Math.sin(n+dt/2)+o,b=m*Math.cos(i+dt/2)+s,S=m*Math.sin(i+dt/2)+o;e.lineTo(p,y),e.lineTo(b,S)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function rb(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(o,r,a,i-c,n+c),l>s?(c=s/l,e.arc(o,r,l,n+c,i-c,!0)):e.arc(o,r,s,n+Ot,i-Ot),e.closePath(),e.clip()}function ab(e){return zr(e,["outerStart","outerEnd","innerStart","innerEnd"])}function lb(e,t,n,i){const s=ab(e.options.borderRadius),o=(n-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(n-Math.min(o,l))*i/2;return Kt(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Kt(s.innerStart,0,r),innerEnd:Kt(s.innerEnd,0,r)}}function pi(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function wo(e,t,n,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+n-c,0),f=u>0?u+i+n+c:0;let m=0;const p=s-l;if(i){const j=u>0?u-i:0,H=h>0?h-i:0,$=(j+H)/2,R=$!==0?p*$/($+i):p;m=(p-R)/2}const y=Math.max(.001,p*h-n/dt)/h,b=(p-y)/2,S=l+b+m,M=s-b-m,{outerStart:E,outerEnd:D,innerStart:C,innerEnd:A}=lb(t,f,h,M-S),O=h-E,x=h-D,_=S+E/O,T=M-D/x,k=f+C,I=f+A,Y=S+C/k,U=M-A/I;if(e.beginPath(),o){const j=(_+T)/2;if(e.arc(r,a,h,_,j),e.arc(r,a,h,j,T),D>0){const B=pi(x,T,r,a);e.arc(B.x,B.y,D,T,M+Ot)}const H=pi(I,M,r,a);if(e.lineTo(H.x,H.y),A>0){const B=pi(I,U,r,a);e.arc(B.x,B.y,A,M+Ot,U+Math.PI)}const $=(M-A/f+(S+C/f))/2;if(e.arc(r,a,f,M-A/f,$,!0),e.arc(r,a,f,$,S+C/f,!0),C>0){const B=pi(k,Y,r,a);e.arc(B.x,B.y,C,Y+Math.PI,S-Ot)}const R=pi(O,S,r,a);if(e.lineTo(R.x,R.y),E>0){const B=pi(O,_,r,a);e.arc(B.x,B.y,E,S-Ot,_)}}else{e.moveTo(r,a);const j=Math.cos(_)*h+r,H=Math.sin(_)*h+a;e.lineTo(j,H);const $=Math.cos(T)*h+r,R=Math.sin(T)*h+a;e.lineTo($,R)}e.closePath()}function cb(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){wo(e,t,n,i,l,s);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=r+(a%Dt||Dt))}return wo(e,t,n,i,l,s),e.fill(),l}function ub(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(h||[]),e.lineDashOffset=f,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let y=t.endAngle;if(o){wo(e,t,n,i,y,s);for(let b=0;b<o;++b)e.stroke();isNaN(a)||(y=r+(a%Dt||Dt))}p&&rb(e,t,y),l.selfJoin&&y-r>=dt&&m===0&&u!=="miter"&&ob(e,t,y),o||(wo(e,t,n,i,y,s),e.stroke())}class db extends oe{static id="arc";static 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};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.getProps(["x","y"],i),{angle:o,distance:r}=oo(s,{x:t,y:n}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,m=at(h,l-a),p=Xi(o,a,l)&&a!==l,y=m>=Dt||p,b=Xe(r,c+f,u+f);return y&&b}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(s+o)/2,h=(r+a+c+l)/2;return{x:n+Math.cos(u)*h,y:i+Math.sin(u)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Dt?Math.floor(i/Dt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(dt,i||0)),c=s*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,cb(t,this,c,o,r),ub(t,this,c,o,r),t.restore()}}function Uu(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function hb(e,t,n){e.lineTo(n.x,n.y)}function fb(e){return e.stepped?Pp:e.tension||e.cubicInterpolationMode==="monotone"?Rp:hb}function Hu(e,t,n={}){const i=e.length,{start:s=0,end:o=i-1}=n,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function mb(e,t,n,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Hu(s,n,i),u=fb(o);let{move:h=!0,reverse:f}=i||{},m,p,y;for(m=0;m<=c;++m)p=s[(a+(f?c-m:m))%r],!p.skip&&(h?(e.moveTo(p.x,p.y),h=!1):u(e,y,p,f,o.stepped),y=p);return l&&(p=s[(a+(f?c:0))%r],u(e,y,p,f,o.stepped)),!!l}function pb(e,t,n,i){const s=t.points,{count:o,start:r,ilen:a}=Hu(s,n,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,p,y,b,S;const M=D=>(r+(c?a-D:D))%o,E=()=>{y!==b&&(e.lineTo(u,b),e.lineTo(u,y),e.lineTo(u,S))};for(l&&(m=s[M(0)],e.moveTo(m.x,m.y)),f=0;f<=a;++f){if(m=s[M(f)],m.skip)continue;const D=m.x,C=m.y,A=D|0;A===p?(C<y?y=C:C>b&&(b=C),u=(h*u+D)/++h):(E(),e.lineTo(D,C),p=A,h=0,y=b=C),S=C}E()}function ia(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?pb:mb}function gb(e){return e.stepped?dg:e.tension||e.cubicInterpolationMode==="monotone"?hg:Un}function yb(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Uu(e,t.options),e.stroke(s)}function bb(e,t,n,i){const{segments:s,options:o}=t,r=ia(t);for(const a of s)Uu(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const _b=typeof Path2D=="function";function xb(e,t,n,i){_b&&!t.options.segment?yb(e,t,n,i):bb(e,t,n,i)}class So extends oe{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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 s=i.spanGaps?this._loop:this._fullLoop;ig(this._points,i,t,s,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=bg(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,s=t[n],o=this.points,r=qc(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],l=gb(i);let c,u;for(c=0,u=r.length;c<u;++c){const{start:h,end:f}=r[c],m=o[h],p=o[f];if(m===p){a.push(m);continue}const y=Math.abs((s-m[n])/(p[n]-m[n])),b=l(m,p,y,i.stepped);b[n]=t[n],a.push(b)}return a.length===1?a[0]:a}pathSegment(t,n,i){return ia(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=ia(this);let r=this._loop;n=n||0,i=i||this.points.length-n;for(const a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),xb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Vu(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class wb extends oe{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(n-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Vu(this,t,"x",n)}inYRange(t,n){return Vu(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!Qe(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Br(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Wu(e,t){const{x:n,y:i,base:s,width:o,height:r}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,h;return e.horizontal?(h=r/2,a=Math.min(n,s),l=Math.max(n,s),c=i-h,u=i+h):(h=o/2,a=n-h,l=n+h,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function Sn(e,t,n,i){return e?0:Kt(t,n,i)}function Sb(e,t,n){const i=e.options.borderWidth,s=e.borderSkipped,o=Ac(i);return{t:Sn(s.top,o.top,0,n),r:Sn(s.right,o.right,0,t),b:Sn(s.bottom,o.bottom,0,n),l:Sn(s.left,o.left,0,t)}}function Tb(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=yn(s),r=Math.min(t,n),a=e.borderSkipped,l=i||ft(s);return{topLeft:Sn(!l||a.top||a.left,o.topLeft,0,r),topRight:Sn(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Sn(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Sn(!l||a.bottom||a.right,o.bottomRight,0,r)}}function vb(e){const t=Wu(e),n=t.right-t.left,i=t.bottom-t.top,s=Sb(e,n/2,i/2),o=Tb(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function sa(e,t,n,i){const s=t===null,o=n===null,a=e&&!(s&&o)&&Wu(e,i);return a&&(s||Xe(t,a.left,a.right))&&(o||Xe(n,a.top,a.bottom))}function Mb(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function kb(e,t){e.rect(t.x,t.y,t.w,t.h)}function oa(e,t,n={}){const i=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-i,r=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+i,y:e.y+s,w:e.w+o,h:e.h+r,radius:e.radius}}class Db extends oe{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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:s}}=this,{inner:o,outer:r}=vb(this),a=Mb(r.radius)?di:kb;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,oa(r,n,o)),t.clip(),a(t,oa(o,-n,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,oa(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,i){return sa(this,t,n,i)}inXRange(t,n){return sa(this,t,null,n)}inYRange(t,n){return sa(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var Cb=Object.freeze({__proto__:null,ArcElement:db,BarElement:Db,LineElement:So,PointElement:wb});const ra=["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)"],$u=ra.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Yu(e){return ra[e%ra.length]}function ju(e){return $u[e%$u.length]}function Ob(e,t){return e.borderColor=Yu(t),e.backgroundColor=ju(t),++t}function Eb(e,t){return e.backgroundColor=e.data.map(()=>Yu(t++)),t}function Ab(e,t){return e.backgroundColor=e.data.map(()=>ju(t++)),t}function Pb(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof ss?t=Eb(n,t):s instanceof uu?t=Ab(n,t):s&&(t=Ob(n,t))}}function qu(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Rb(e){return e&&(e.borderColor||e.backgroundColor)}function Ib(){return Et.borderColor!=="rgba(0,0,0,0.1)"||Et.backgroundColor!=="rgba(0,0,0,0.1)"}var Lb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:o}=s,r=qu(i)||Rb(s)||o&&qu(o)||Ib();if(!n.forceOverride&&r)return;const a=Pb(e);i.forEach(a)}};function Nb(e,t,n,i,s){const o=s.samples||i;if(o>=n)return e.slice(t,t+n);const r=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let u=t,h,f,m,p,y;for(r[l++]=e[u],h=0;h<o-2;h++){let b=0,S=0,M;const E=Math.floor((h+1)*a)+1+t,D=Math.min(Math.floor((h+2)*a)+1,n)+t,C=D-E;for(M=E;M<D;M++)b+=e[M].x,S+=e[M].y;b/=C,S/=C;const A=Math.floor(h*a)+1+t,O=Math.min(Math.floor((h+1)*a)+1,n)+t,{x,y:_}=e[u];for(m=p=-1,M=A;M<O;M++)p=.5*Math.abs((x-b)*(e[M].y-_)-(x-e[M].x)*(S-_)),p>m&&(m=p,f=e[M],y=M);r[l++]=f,u=y}return r[l++]=e[c],r}function Fb(e,t,n,i){let s=0,o=0,r,a,l,c,u,h,f,m,p,y;const b=[],S=t+n-1,M=e[t].x,D=e[S].x-M;for(r=t;r<t+n;++r){a=e[r],l=(a.x-M)/D*i,c=a.y;const C=l|0;if(C===u)c<p?(p=c,h=r):c>y&&(y=c,f=r),s=(o*s+a.x)/++o;else{const A=r-1;if(!rt(h)&&!rt(f)){const O=Math.min(h,f),x=Math.max(h,f);O!==m&&O!==A&&b.push({...e[O],x:s}),x!==m&&x!==A&&b.push({...e[x],x:s})}r>0&&A!==m&&b.push(e[A]),b.push(a),u=C,o=0,p=y=c,h=f=m=r}}return b}function Gu(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 Ku(e){e.data.datasets.forEach(t=>{Gu(t)})}function Bb(e,t){const n=t.length;let i=0,s;const{iScale:o}=e,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=Kt(Ze(t,o.axis,r).lo,0,n-1)),c?s=Kt(Ze(t,o.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var zb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ku(e);return}const i=e.width;e.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:a}=s,l=e.getDatasetMeta(o),c=r||s.data;if(ns([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:h,count:f}=Bb(l,c);const m=n.threshold||4*i;if(f<=m){Gu(s);return}rt(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(n.algorithm){case"lttb":p=Nb(c,h,f,i,n);break;case"min-max":p=Fb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Ku(e)}};function Ub(e,t,n){const i=e.segments,s=e.points,o=t.points,r=[];for(const a of i){let{start:l,end:c}=a;c=To(l,c,s);const u=aa(n,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:u,start:s[l],end:s[c]});continue}const h=qc(t,u);for(const f of h){const m=aa(n,o[f.start],o[f.end],f.loop),p=jc(a,s,m);for(const y of p)r.push({source:y,target:f,start:{[n]:Xu(u,m,"start",Math.max)},end:{[n]:Xu(u,m,"end",Math.min)}})}}return r}function aa(e,t,n,i){if(i)return;let s=t[e],o=n[e];return e==="angle"&&(s=ne(s),o=ne(o)),{property:e,start:s,end:o}}function Hb(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=To(r,a,s);const l=s[r],c=s[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function To(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Xu(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Zu(e,t){let n=[],i=!1;return xt(e)?(i=!0,n=e):n=Hb(e,t),n.length?new So({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Qu(e){return e&&e.fill!==!1}function Vb(e,t,n){let s=e[t].fill;const o=[t];let r;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!At(s))return s;if(r=e[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function Wb(e,t,n){const i=qb(e);if(ft(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return At(s)&&Math.floor(s)===s?$b(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function $b(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function Yb(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 jb(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 qb(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Gb(e){const{scale:t,index:n,line:i}=e,s=[],o=i.segments,r=i.points,a=Kb(t,n);a.push(Zu({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let u=c.start;u<=c.end;u++)Xb(s,r[u],a)}return new So({points:s,options:{}})}function Kb(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function Xb(e,t,n){const i=[];for(let s=0;s<n.length;s++){const o=n[s],{first:r,last:a,point:l}=Zb(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(e.push(l),!a)break}}e.push(...i)}function Zb(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const s=i[n],o=e.segments,r=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const u=o[c],h=r[u.start][n],f=r[u.end][n];if(Xe(s,h,f)){a=s===h,l=s===f;break}}return{first:a,last:l,point:i}}class Ju{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:s,y:o,radius:r}=this;return n=n||{start:0,end:Dt},t.arc(s,o,r,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function Qb(e){const{chart:t,fill:n,line:i}=e;if(At(n))return Jb(t,n);if(n==="stack")return Gb(e);if(n==="shape")return!0;const s=t0(e);return s instanceof Ju?s:Zu(s,i)}function Jb(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function t0(e){return(e.scale||{}).getPointPositionForValue?n0(e):e0(e)}function e0(e){const{scale:t={},fill:n}=e,i=Yb(n,t);if(At(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function n0(e){const{scale:t,fill:n}=e,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,r=jb(n,t,o),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new Ju({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function la(e,t,n){const i=Qb(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},p=s.getDatasetMeta(o),y=Xc(s,p);i&&r.points.length&&(ts(e,n),i0(e,{line:r,target:i,above:f,below:m,area:n,scale:a,axis:l,clip:y}),es(e))}function i0(e,t){const{line:n,target:i,above:s,below:o,area:r,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=o;o!==s&&(c==="x"?(td(e,i,r.top),ca(e,{line:n,target:i,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),td(e,i,r.bottom)):c==="y"&&(ed(e,i,r.left),ca(e,{line:n,target:i,color:o,scale:a,property:c,clip:l}),e.restore(),e.save(),ed(e,i,r.right),u=s)),ca(e,{line:n,target:i,color:u,scale:a,property:c,clip:l}),e.restore()}function td(e,t,n){const{segments:i,points:s}=t;let o=!0,r=!1;e.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[To(l,c,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function ed(e,t,n){const{segments:i,points:s}=t;let o=!0,r=!1;e.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[To(l,c,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function ca(e,t){const{line:n,target:i,property:s,color:o,scale:r,clip:a}=t,l=Ub(n,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=o}={}}=c,p=i!==!0;e.save(),e.fillStyle=m,s0(e,r,a,p&&aa(s,h,f)),e.beginPath();const y=!!n.pathSegment(e,c);let b;if(p){y?e.closePath():nd(e,i,f,s);const S=!!i.pathSegment(e,u,{move:y,reverse:!0});b=y&&S,b||nd(e,i,h,s)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function s0(e,t,n,i){const s=t.chart.chartArea,{property:o,start:r,end:a}=i||{};if(o==="x"||o==="y"){let l,c,u,h;o==="x"?(l=r,c=s.top,u=a,h=s.bottom):(l=s.left,c=r,u=s.right,h=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),h=Math.min(h,n.bottom)),e.rect(l,c,u-l,h-c),e.clip()}}function nd(e,t,n,i){const s=t.interpolate(n,i);s&&e.lineTo(s.x,s.y)}var o0={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<i;++r)o=e.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof So&&(l={visible:e.isDatasetVisible(r),index:r,fill:Wb(a,r,i),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<i;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=Vb(s,r,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&la(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Qu(o)&&la(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Qu(i)||n.drawTime!=="beforeDatasetDraw"||la(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const id=(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)}},r0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class sd extends oe{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=wt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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,s=Pt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=id(i,o);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let h=t;o.textAlign="left",o.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((p,y)=>{const b=i+n/2+o.measureText(p.text).width;(y===0||c[c.length-1]+b+2*a>r)&&(h+=u,c[c.length-(y>0?0:1)]=0,m+=u,f++),l[y]={left:0,top:m,row:f,width:b,height:s},c[c.length-1]+=b+a}),h}_fitCols(t,n,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t;let h=a,f=0,m=0,p=0,y=0;return this.legendItems.forEach((b,S)=>{const{itemWidth:M,itemHeight:E}=a0(i,n,o,b,s);S>0&&m+E+2*a>u&&(h+=f+a,c.push({width:f,height:m}),p+=f+a,y++,f=m=0),l[S]={left:p,top:m,col:y,width:M,height:E},f=Math.max(f,M),m+=E+a}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=mi(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ie(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=ie(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.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;ts(t,this),this._draw(),es(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Et.color,l=mi(t.rtl,this.left,this.width),c=Pt(r.font),{padding:u}=r,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:p,boxHeight:y,itemHeight:b}=id(r,h),S=function(A,O,x){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const _=at(x.lineWidth,1);if(s.fillStyle=at(x.fillStyle,a),s.lineCap=at(x.lineCap,"butt"),s.lineDashOffset=at(x.lineDashOffset,0),s.lineJoin=at(x.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=at(x.strokeStyle,a),s.setLineDash(at(x.lineDash,[])),r.usePointStyle){const T={radius:y*Math.SQRT2/2,pointStyle:x.pointStyle,rotation:x.rotation,borderWidth:_},k=l.xPlus(A,p/2),I=O+f;Ec(s,T,k,I,r.pointStyleWidth&&p)}else{const T=O+Math.max((h-y)/2,0),k=l.leftForLtr(A,p),I=yn(x.borderRadius);s.beginPath(),Object.values(I).some(Y=>Y!==0)?di(s,{x:k,y:T,w:p,h:y,radius:I}):s.rect(k,T,p,y),s.fill(),_!==0&&s.stroke()}s.restore()},M=function(A,O,x){Bn(s,x.text,A,O+b/2,c,{strikethrough:x.hidden,textAlign:l.textAlign(x.textAlign)})},E=this.isHorizontal(),D=this._computeTitleHeight();E?m={x:ie(o,this.left+u,this.right-i[0]),y:this.top+u+D,line:0}:m={x:this.left+u,y:ie(o,this.top+D+u,this.bottom-n[0].height),line:0},Vc(this.ctx,t.textDirection);const C=b+u;this.legendItems.forEach((A,O)=>{s.strokeStyle=A.fontColor,s.fillStyle=A.fontColor;const x=s.measureText(A.text).width,_=l.textAlign(A.textAlign||(A.textAlign=r.textAlign)),T=p+f+x;let k=m.x,I=m.y;l.setWidth(this.width),E?O>0&&k+T+u>this.right&&(I=m.y+=C,m.line++,k=m.x=ie(o,this.left+u,this.right-i[m.line])):O>0&&I+C>this.bottom&&(k=m.x=k+n[m.line].width+u,m.line++,I=m.y=ie(o,this.top+D+u,this.bottom-n[m.line].height));const Y=l.x(k);if(S(Y,I,A),k=wp(_,k+p+f,E?k+T:this.right,t.rtl),M(l.x(k),I,A),E)m.x+=T+u;else if(typeof A.text!="string"){const U=c.lineHeight;m.y+=od(A,U)+u}else m.y+=C}),Wc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=Pt(n.font),s=Wt(n.padding);if(!n.display)return;const o=mi(t.rtl,this.left,this.width),r=this.ctx,a=n.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=ie(t.align,h,this.right-f);else{const p=this.columnSizes.reduce((y,b)=>Math.max(y,b.height),0);u=c+ie(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=ie(a,h,h+f);r.textAlign=o.textAlign(Pr(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,Bn(r,n.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,n=Pt(t.font),i=Wt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Xe(t,this.left,this.right)&&Xe(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Xe(t,s.left,s.left+s.width)&&Xe(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!u0(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=r0(s,i);s&&!o&&wt(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&wt(n.onHover,[t,i,this],this)}else i&&wt(n.onClick,[t,i,this],this)}}function a0(e,t,n,i,s){const o=l0(i,e,t,n),r=c0(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function l0(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+n.size/2+i.measureText(s).width}function c0(e,t,n){let i=e;return typeof t.text!="string"&&(i=od(t,n)),i}function od(e,t){const n=e.text?e.text.length:0;return t*n}function u0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var d0={id:"legend",_element:sd,start(e,t,n){const i=e.legend=new sd({ctx:e.ctx,options:n,chart:e});se.configure(e,i,n),se.addBox(e,i)},stop(e){se.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;se.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,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.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:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Wt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,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:r&&(a||c.borderRadius),datasetIndex:l.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 ua extends oe{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 s=xt(i.text)?i.text.length:1;this._padding=Wt(i.padding);const o=s*Pt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,u,h;return this.isHorizontal()?(u=ie(a,i,o),h=n+t,c=o-i):(r.position==="left"?(u=i+t,h=ie(a,s,n),l=dt*-.5):(u=o-t,h=ie(a,n,s),l=dt*.5),c=s-n),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=Pt(n.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Bn(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Pr(n.align),textBaseline:"middle",translation:[r,a]})}}function h0(e,t){const n=new ua({ctx:e.ctx,options:t,chart:e});se.configure(e,n,t),se.addBox(e,n),e.titleBlock=n}var f0={id:"title",_element:ua,start(e,t,n){h0(e,n)},stop(e){const t=e.titleBlock;se.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;se.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 vo=new WeakMap;var m0={id:"subtitle",start(e,t,n){const i=new ua({ctx:e.ctx,options:n,chart:e});se.configure(e,i,n),se.addBox(e,i),vo.set(e,i)},stop(e){se.removeBox(e,vo.get(e)),vo.delete(e)},beforeUpdate(e,t,n){const i=vo.get(e);se.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 hs={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=ui(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function He(e,t){return t&&(xt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function tn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
1
+ (function(kt,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","@kong-ui-public/analytics-metric-provider"],d):(kt=typeof globalThis<"u"?globalThis:kt||self,d(kt["kong-ui-publicvitals-chart"]={},kt.Vue,kt["kong-ui-public-i18n"],kt.KongIcons,kt["kong-ui-public-analytics-metric-provider"]))})(this,(function(kt,d,ic,Wi,Ln){"use strict";const Im={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",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."},canceled:{message:"Request canceled"},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",error_rate:"Error rate",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)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal 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_package:"API package",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",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_error:"MCP error",mcp_method:"MCP method",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key"},metricAxisTitles:{error_rate:"Error rate in {unit}",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) 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}",kong_internal_latency_average:"Kong internal latency (avg) in {unit}",kong_internal_latency_p99:"Kong internal latency (p99) in {unit}",kong_internal_latency_p95:"Kong internal latency (p95) in {unit}",kong_internal_latency_p50:"Kong internal 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_size_sum:"Request size (sum) 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",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A response size (sum) in {unit}",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_response_size_sum:"MCP response size (sum) in {unit}",mcp_response_body_size_sum:"MCP response body size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count"},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"},timestampAxisTitles:{platform:"@timestamp created at"},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 Lm(){const e=ic.createI18n("en-us",Im);return{i18n:e,i18nT:ic.i18nTComponent(e)}}function $i(e){return e+.5|0}const hn=(e,t,n)=>Math.max(Math.min(e,n),t);function Yi(e){return hn($i(e*2.55),0,255)}function fn(e){return hn($i(e*255),0,255)}function Ge(e){return hn($i(e/2.55)/100,0,1)}function sc(e){return hn($i(e*100),0,100)}const De={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},vr=[..."0123456789ABCDEF"],Nm=e=>vr[e&15],Fm=e=>vr[(e&240)>>4]+vr[e&15],Zs=e=>(e&240)>>4===(e&15),Bm=e=>Zs(e.r)&&Zs(e.g)&&Zs(e.b)&&Zs(e.a);function zm(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&De[e[1]]*17,g:255&De[e[2]]*17,b:255&De[e[3]]*17,a:t===5?De[e[4]]*17:255}:(t===7||t===9)&&(n={r:De[e[1]]<<4|De[e[2]],g:De[e[3]]<<4|De[e[4]],b:De[e[5]]<<4|De[e[6]],a:t===9?De[e[7]]<<4|De[e[8]]:255})),n}const Um=(e,t)=>e<255?t(e):"";function Hm(e){var t=Bm(e)?Nm:Fm;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Um(e.a,t):void 0}const Vm=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function oc(e,t,n){const i=t*Math.min(n,1-n),s=(o,r=(o+e/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Wm(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function $m(e,t,n){const i=oc(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function Ym(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function Mr(e){const n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),r=Math.min(n,i,s),a=(o+r)/2;let l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=Ym(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function kr(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(fn)}function Dr(e,t,n){return kr(oc,e,t,n)}function jm(e,t,n){return kr($m,e,t,n)}function qm(e,t,n){return kr(Wm,e,t,n)}function rc(e){return(e%360+360)%360}function Gm(e){const t=Vm.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Yi(+t[5]):fn(+t[5]));const s=rc(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=jm(s,o,r):t[1]==="hsv"?i=qm(s,o,r):i=Dr(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function Km(e,t){var n=Mr(e);n[0]=rc(n[0]+t),n=Dr(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Xm(e){if(!e)return;const t=Mr(e),n=t[0],i=sc(t[1]),s=sc(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Ge(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const ac={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"},lc={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 Zm(){const e={},t=Object.keys(lc),n=Object.keys(ac);let i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<n.length;s++)o=n[s],a=a.replace(o,ac[o]);o=parseInt(lc[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Qs;function Qm(e){Qs||(Qs=Zm(),Qs.transparent=[0,0,0,0]);const t=Qs[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Jm=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function tp(e){const t=Jm.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?Yi(r):hn(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?Yi(i):hn(i,0,255)),s=255&(t[4]?Yi(s):hn(s,0,255)),o=255&(t[6]?Yi(o):hn(o,0,255)),{r:i,g:s,b:o,a:n}}}function ep(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ge(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Cr=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ui=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function np(e,t,n){const i=ui(Ge(e.r)),s=ui(Ge(e.g)),o=ui(Ge(e.b));return{r:fn(Cr(i+n*(ui(Ge(t.r))-i))),g:fn(Cr(s+n*(ui(Ge(t.g))-s))),b:fn(Cr(o+n*(ui(Ge(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Js(e,t,n){if(e){let i=Mr(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Dr(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function cc(e,t){return e&&Object.assign(t||{},e)}function uc(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=fn(e[3]))):(t=cc(e,{r:0,g:0,b:0,a:1}),t.a=fn(t.a)),t}function ip(e){return e.charAt(0)==="r"?tp(e):Gm(e)}class ji{constructor(t){if(t instanceof ji)return t;const n=typeof t;let i;n==="object"?i=uc(t):n==="string"&&(i=zm(t)||Qm(t)||ip(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=cc(this._rgb);return t&&(t.a=Ge(t.a)),t}set rgb(t){this._rgb=uc(t)}rgbString(){return this._valid?ep(this._rgb):void 0}hexString(){return this._valid?Hm(this._rgb):void 0}hslString(){return this._valid?Xm(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const r=n===o?.5:n,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=np(this._rgb,t._rgb,n)),this}clone(){return new ji(this.rgb)}alpha(t){return this._rgb.a=fn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=$i(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 Js(this._rgb,2,t),this}darken(t){return Js(this._rgb,2,-t),this}saturate(t){return Js(this._rgb,1,t),this}desaturate(t){return Js(this._rgb,1,-t),this}rotate(t){return Km(this._rgb,t),this}}function Ke(){}const sp=(()=>{let e=0;return()=>e++})();function rt(e){return e==null}function xt(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 At(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ve(e,t){return At(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const op=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,dc=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function wt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function St(e,t,n,i){let s,o,r;if(xt(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(ft(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function to(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function eo(e){if(xt(e))return e.map(eo);if(ft(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=eo(e[n[s]]);return t}return e}function hc(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function rp(e,t,n,i){if(!hc(e))return;const s=t[e],o=n[e];ft(s)&&ft(o)?qi(s,o,i):t[e]=eo(o)}function qi(e,t,n){const i=xt(t)?t:[t],s=i.length;if(!ft(e))return e;n=n||{};const o=n.merger||rp;let r;for(let a=0;a<s;++a){if(r=i[a],!ft(r))continue;const l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function Gi(e,t){return qi(e,t,{merger:ap})}function ap(e,t,n){if(!hc(e))return;const i=t[e],s=n[e];ft(i)&&ft(s)?Gi(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=eo(s))}const fc={"":e=>e,x:e=>e.x,y:e=>e.y};function lp(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function cp(e){const t=lp(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function mn(e,t){return(fc[t]||(fc[t]=cp(t)))(e)}function Or(e){return e.charAt(0).toUpperCase()+e.slice(1)}const fe=e=>typeof e<"u",me=e=>typeof e=="function",mc=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function up(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const dt=Math.PI,Dt=2*dt,dp=Dt+dt,no=Number.POSITIVE_INFINITY,Er=dt/180,Ot=dt/2,Ce=dt/4,io=dt*2/3,pn=Math.log10,ze=Math.sign;function Ki(e,t,n){return Math.abs(e-t)<n}function pc(e){const t=Math.round(e);e=Ki(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(pn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function hp(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((s,o)=>s-o).pop(),t}function fp(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function gn(e){return!fp(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function mp(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function gc(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Vt(e){return e*(dt/180)}function so(e){return e*(180/dt)}function yc(e){if(!At(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function oo(e,t){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*dt&&(o+=Dt),{angle:o,distance:s}}function di(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pp(e,t){return(e-t+dp)%Dt-dt}function ne(e){return(e%Dt+Dt)%Dt}function Xi(e,t,n,i){const s=ne(e),o=ne(t),r=ne(n),a=ne(o-s),l=ne(r-s),c=ne(s-o),u=ne(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function Kt(e,t,n){return Math.max(t,Math.min(n,e))}function gp(e){return Kt(e,-32768,32767)}function Xe(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Ar(e,t,n){n=n||(r=>e[r]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const Ze=(e,t,n,i)=>Ar(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),yp=(e,t,n)=>Ar(e,n,i=>e[i][t]>=n);function bp(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}const bc=["push","pop","shift","splice","unshift"];function _p(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),bc.forEach(n=>{const i="_onData"+Or(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function _c(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(bc.forEach(o=>{delete e[o]}),delete e._chartjs)}function xc(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const wc=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Sc(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,wc.call(window,()=>{i=!1,e.apply(t,n)}))}}function xp(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Pr=e=>e==="start"?"left":e==="end"?"right":"center",ie=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,wp=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function Tc(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:h,max:f,minDefined:m,maxDefined:p}=r.getUserBounds();if(m){if(s=Math.min(Ze(l,u,h).lo,n?i:Ze(t,u,r.getPixelForValue(h)).lo),c){const y=l.slice(0,s+1).reverse().findIndex(b=>!rt(b[a.axis]));s-=Math.max(0,y)}s=Kt(s,0,i-1)}if(p){let y=Math.max(Ze(l,r.axis,f,!0).hi+1,n?0:Ze(t,u,r.getPixelForValue(f),!0).hi+1);if(c){const b=l.slice(y-1).findIndex(S=>!rt(S[a.axis]));y+=Math.max(0,b)}o=Kt(y,s,i)-s}else o=i-s}return{start:s,count:o}}function vc(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const ro=e=>e===0||e===1,Mc=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Dt/n)),kc=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Dt/n)+1,Zi={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(dt*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=>ro(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=>ro(e)?e:Mc(e,.075,.3),easeOutElastic:e=>ro(e)?e:kc(e,.075,.3),easeInOutElastic(e){return ro(e)?e:e<.5?.5*Mc(e*2,.1125,.45):.5+.5*kc(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-Zi.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?Zi.easeInBounce(e*2)*.5:Zi.easeOutBounce(e*2-1)*.5+.5};function Rr(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ir(e){return Rr(e)?e:new ji(e)}function Lr(e){return Rr(e)?e:new ji(e).saturate(.5).darken(.1).hexString()}const Sp=["x","y","borderWidth","radius","tension"],Tp=["color","borderColor","backgroundColor"];function vp(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:Tp},numbers:{type:"number",properties:Sp}}),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 Mp(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Dc=new Map;function kp(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Dc.get(n);return i||(i=new Intl.NumberFormat(e,t),Dc.set(n,i)),i}function Qi(e,t,n){return kp(t,n).format(e)}const Cc={values(e){return xt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Dp(e,n)}const r=pn(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Qi(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(pn(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?Cc.numeric.call(this,e,t,n):""}};function Dp(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 ao={formatters:Cc};function Cp(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:ao.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 Nn=Object.create(null),Nr=Object.create(null);function Ji(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function Fr(e,t,n){return typeof t=="string"?qi(Ji(e,t),n):qi(Ji(e,""),t)}class Op{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,s)=>Lr(s.backgroundColor),this.hoverBorderColor=(i,s)=>Lr(s.borderColor),this.hoverColor=(i,s)=>Lr(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(n)}set(t,n){return Fr(this,t,n)}get(t){return Ji(this,t)}describe(t,n){return Fr(Nr,t,n)}override(t,n){return Fr(Nn,t,n)}route(t,n,i,s){const o=Ji(this,t),r=Ji(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=r[s];return ft(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Et=new Op({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[vp,Mp,Cp]);function Ep(e){return!e||rt(e.size)||rt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function lo(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function Ap(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let r=0;const a=n.length;let l,c,u,h,f;for(l=0;l<a;l++)if(h=n[l],h!=null&&!xt(h))r=lo(e,s,o,r,h);else if(xt(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!xt(f)&&(r=lo(e,s,o,r,f));e.restore();const m=o.length/2;if(m>n.length){for(l=0;l<m;l++)delete s[o[l]];o.splice(0,m)}return r}function Fn(e,t,n){const i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function Oc(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Br(e,t,n,i){Ec(e,t,n,i,null)}function Ec(e,t,n,i,s){let o,r,a,l,c,u,h,f;const m=t.pointStyle,p=t.rotation,y=t.radius;let b=(p||0)*Er;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(b),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:s?e.ellipse(n,i,s/2,y,0,0,Dt):e.arc(n,i,y,0,Dt),e.closePath();break;case"triangle":u=s?s/2:y,e.moveTo(n+Math.sin(b)*u,i-Math.cos(b)*y),b+=io,e.lineTo(n+Math.sin(b)*u,i-Math.cos(b)*y),b+=io,e.lineTo(n+Math.sin(b)*u,i-Math.cos(b)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,r=Math.cos(b+Ce)*l,h=Math.cos(b+Ce)*(s?s/2-c:l),a=Math.sin(b+Ce)*l,f=Math.sin(b+Ce)*(s?s/2-c:l),e.arc(n-h,i-a,c,b-dt,b-Ot),e.arc(n+f,i-r,c,b-Ot,b),e.arc(n+h,i+a,c,b,b+Ot),e.arc(n-f,i+r,c,b+Ot,b+dt),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}b+=Ce;case"rectRot":h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+f,i-r),e.lineTo(n+h,i+a),e.lineTo(n-f,i+r),e.closePath();break;case"crossRot":b+=Ce;case"cross":h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+h,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"star":h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+h,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r),b+=Ce,h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+h,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"line":r=s?s/2:Math.cos(b)*y,a=Math.sin(b)*y,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(b)*(s?s/2:y),i+Math.sin(b)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Qe(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 ts(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function es(e){e.restore()}function Pp(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Rp(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 Ip(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),rt(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 Lp(e,t,n,i,s){if(s.strikethrough||s.underline){const o=e.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,u),e.lineTo(a,u),e.stroke()}}function Np(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Bn(e,t,n,i,s,o={}){const r=xt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,Ip(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Np(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),rt(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Lp(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function hi(e,t){const{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*dt,dt,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,dt,Ot,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Ot,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-Ot,!0),e.lineTo(n+r.topLeft,i)}const Fp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Bp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zp(e,t){const n=(""+e).match(Fp);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 Up=e=>+e||0;function zr(e,t){const n={},i=ft(t),s=i?Object.keys(t):t,o=ft(e)?i?r=>at(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=Up(o(r));return n}function Ac(e){return zr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function yn(e){return zr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Wt(e){const t=Ac(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Pt(e,t){e=e||{},t=t||Et.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=at(e.style,t.style);i&&!(""+i).match(Bp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:at(e.family,t.family),lineHeight:zp(at(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:at(e.weight,t.weight),string:""};return s.string=Ep(s),s}function ns(e,t,n,i){let s,o,r;for(s=0,o=e.length;s<o;++s)if(r=e[s],r!==void 0&&r!==void 0)return r}function Hp(e,t,n){const{min:i,max:s}=e,o=dc(t,(s-i)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function bn(e,t){return Object.assign(Object.create(e),t)}function Ur(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Nc("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>Ur([a,...e],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return Rc(a,l,()=>Kp(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Fc(a).includes(l)},ownKeys(a){return Fc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function fi(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Pc(e,i),setContext:o=>fi(e,o,n,i),override:o=>fi(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return Rc(o,r,()=>Wp(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function Pc(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:me(n)?n:()=>n,isIndexable:me(i)?i:()=>i}}const Vp=(e,t)=>e?e+Or(t):t,Hr=(e,t)=>ft(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Rc(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function Wp(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return me(a)&&r.isScriptable(t)&&(a=$p(t,a,e,n)),xt(a)&&a.length&&(a=Yp(t,a,e,r.isIndexable)),Hr(t,a)&&(a=fi(a,s,o&&o[t],r)),a}function $p(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||i);return a.delete(e),Hr(e,l)&&(l=Vr(s._scopes,s,e,l)),l}function Yp(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.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=Vr(c,s,e,u);t.push(fi(h,o,r&&r[e],a))}}return t}function Ic(e,t,n){return me(e)?e(t,n):e}const jp=(e,t)=>e===!0?t:typeof e=="string"?mn(t,e):void 0;function qp(e,t,n,i,s){for(const o of t){const r=jp(n,o);if(r){e.add(r);const a=Ic(r._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(r===!1&&typeof i<"u"&&n!==i)return null}return!1}function Vr(e,t,n,i){const s=t._rootScopes,o=Ic(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=Lc(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=Lc(a,r,o,l,i),l===null)?!1:Ur(Array.from(a),[""],s,o,()=>Gp(t,n,i))}function Lc(e,t,n,i,s){for(;n;)n=qp(e,t,n,i,s);return n}function Gp(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return xt(s)&&ft(n)?n:s||{}}function Kp(e,t,n,i){let s;for(const o of t)if(s=Nc(Vp(o,e),n),typeof s<"u")return Hr(e,s)?Vr(n,i,e,s):s}function Nc(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Fc(e){let t=e._keys;return t||(t=e._keys=Xp(e._scopes)),t}function Xp(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Bc(e,t,n,i){const{iScale:s}=e,{key:o="r"}=this._parsing,r=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+n,u=t[c],r[a]={r:s.parse(mn(u,o),c)};return r}const Zp=Number.EPSILON||1e-14,mi=(e,t)=>t<e.length&&!e[t].skip&&e[t],zc=e=>e==="x"?"y":"x";function Qp(e,t,n,i){const s=e.skip?t:e,o=t,r=n.skip?t:n,a=di(o,s),l=di(r,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,f=i*u;return{previous:{x:o.x-h*(r.x-s.x),y:o.y-h*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function Jp(e,t,n){const i=e.length;let s,o,r,a,l,c=mi(e,0);for(let u=0;u<i-1;++u)if(l=c,c=mi(e,u+1),!(!l||!c)){if(Ki(t[u],0,Zp)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=s*r*t[u],n[u+1]=o*r*t[u])}}function tg(e,t,n="x"){const i=zc(n),s=e.length;let o,r,a,l=mi(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=mi(e,c+1),!a)continue;const u=a[n],h=a[i];r&&(o=(u-r[n])/3,a[`cp1${n}`]=u-o,a[`cp1${i}`]=h-o*t[c]),l&&(o=(l[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${i}`]=h+o*t[c])}}function eg(e,t="x"){const n=zc(t),i=e.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=mi(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=mi(e,r+1),!!l){if(c){const u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?ze(s[r-1])!==ze(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Jp(e,s,o),tg(e,o,t)}function co(e,t,n){return Math.max(Math.min(e,n),t)}function ng(e,t){let n,i,s,o,r,a=Qe(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&Qe(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=co(s.cp1x,t.left,t.right),s.cp1y=co(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=co(s.cp2x,t.left,t.right),s.cp2y=co(s.cp2y,t.top,t.bottom)))}function ig(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")eg(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=Qp(c,a,e[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&ng(e,n)}function Wr(){return typeof window<"u"&&typeof document<"u"}function $r(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function uo(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 ho=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function sg(e,t){return ho(e).getPropertyValue(t)}const og=["top","right","bottom","left"];function zn(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=og[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const rg=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function ag(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(rg(s,o,e.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function _n(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=ho(n),o=s.boxSizing==="border-box",r=zn(s,"padding"),a=zn(s,"border","width"),{x:l,y:c,box:u}=ag(e,n),h=r.left+(u&&a.left),f=r.top+(u&&a.top);let{width:m,height:p}=t;return o&&(m-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-h)/m*n.width/i),y:Math.round((c-f)/p*n.height/i)}}function lg(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&$r(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=ho(o),l=zn(a,"border","width"),c=zn(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=uo(a.maxWidth,o,"clientWidth"),s=uo(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||no,maxHeight:s||no}}const xn=e=>Math.round(e*10)/10;function cg(e,t,n,i){const s=ho(e),o=zn(s,"margin"),r=uo(s.maxWidth,e,"clientWidth")||no,a=uo(s.maxHeight,e,"clientHeight")||no,l=lg(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=zn(s,"border","width"),m=zn(s,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=xn(Math.min(c,r,l.maxWidth)),u=xn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=xn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=xn(Math.floor(u*i))),{width:c,height:u}}function Uc(e,t,n){const i=t||1,s=xn(e.height*i),o=xn(e.width*i);e.height=xn(e.height),e.width=xn(e.width);const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const ug=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Wr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Hc(e,t){const n=sg(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Un(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function dg(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 hg(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Un(e,s,n),a=Un(s,o,n),l=Un(o,t,n),c=Un(r,a,n),u=Un(a,l,n);return Un(c,u,n)}const fg=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}}},mg=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function pi(e,t,n){return e?fg(t,n):mg()}function Vc(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 Wc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function $c(e){return e==="angle"?{between:Xi,compare:pp,normalize:ne}:{between:Xe,compare:(t,n)=>t-n,normalize:t=>t}}function Yc({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function pg(e,t,n){const{property:i,start:s,end:o}=n,{between:r,normalize:a}=$c(i),l=t.length;let{start:c,end:u,loop:h}=e,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&r(a(t[c%l][i]),s,o);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:e.style}}function jc(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=$c(i),{start:u,end:h,loop:f,style:m}=pg(e,t,n),p=[];let y=!1,b=null,S,M,E;const D=()=>l(s,E,S)&&a(s,E)!==0,C=()=>a(o,S)===0||l(o,E,S),A=()=>y||D(),O=()=>!y||C();for(let x=u,_=u;x<=h;++x)M=t[x%r],!M.skip&&(S=c(M[i]),S!==E&&(y=l(S,s,o),b===null&&A()&&(b=a(S,s)===0?x:_),b!==null&&O()&&(p.push(Yc({start:b,end:x,loop:f,count:r,style:m})),b=null),_=x,E=S));return b!==null&&p.push(Yc({start:b,end:h,loop:f,count:r,style:m})),p}function qc(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=jc(i[s],e.points,t);o.length&&n.push(...o)}return n}function gg(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function yg(e,t,n,i){const s=e.length,o=[];let r=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function bg(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:r,end:a}=gg(n,s,o,i);if(i===!0)return Gc(e,[{start:r,end:a,loop:o}],n,t);const l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Gc(e,yg(n,r,l,c),n,t)}function Gc(e,t,n,i){return!i||!i.setContext||!n?t:_g(e,t,n,i)}function _g(e,t,n,i){const s=e._chart.getContext(),o=Kc(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,h=t[0].start,f=h;function m(p,y,b,S){const M=a?-1:1;if(p!==y){for(p+=l;n[p%l].skip;)p-=M;for(;n[y%l].skip;)y+=M;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:b,style:S}),u=S,h=y%l)}}for(const p of t){h=a?h:p.start;let y=n[h%l],b;for(f=h+1;f<=p.end;f++){const S=n[f%l];b=Kc(i.setContext(bn(s,{type:"segment",p0:y,p1:S,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),xg(b,u)&&m(h,f-1,p.loop,u),y=S,u=b}h<f-1&&m(h,f-1,p.loop,u)}return c}function Kc(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function xg(e,t){if(!t)return!1;const n=[],i=function(s,o){return Rr(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function fo(e,t,n){return e.options.clip?e[n]:t[n]}function wg(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:fo(n,t,"left"),right:fo(n,t,"right"),top:fo(i,t,"top"),bottom:fo(i,t,"bottom")}:t}function Xc(e,t){const n=t._clip;if(n.disabled)return!1;const i=wg(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)}}class Sg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=wc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.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,s)=>Math.max(i,s._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 s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Je=new Sg;const Zc="transparent",Tg={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Ir(e||Zc),s=i.valid&&Ir(t||Zc);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class vg{constructor(t,n,i,s){const o=n[i];s=ns([t.to,s,o,t.from]);const r=ns([t.from,o,s]);this._active=!0,this._fn=t.fn||Tg[t.type||typeof r],this._easing=Zi[t.easing]||Zi.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=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ns([t.to,n,s,t.from]),this._from=ns([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}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 s=0;s<i.length;s++)i[s][n]()}}class Yr{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ft(t))return;const n=Object.keys(Et.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!ft(o))return;const r={};for(const a of n)r[a]=o[a];(xt(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=kg(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Mg(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let h=o[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,u,a);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=h=new vg(f,t,c,u),s.push(h)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Je.add(this._chart,i),!0}}function Mg(e,t){const n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function kg(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 Qc(e,t){const n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function Dg(e,t,n){if(n===!1)return!1;const i=Qc(e,n),s=Qc(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Cg(e){let t,n,i,s;return ft(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function Jc(e,t){const n=[],i=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function tu(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let r,a,l,c;if(t===null)return;let u=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(u=!0,i.all)continue;break}c=e.values[l],At(c)&&(o||t===0||ze(t)===ze(c))&&(t+=c)}return!u&&!i.all?0:t}function Og(e,t){const{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length);let l,c,u;for(l=0,c=r.length;l<c;++l)u=r[l],a[l]={[s]:u,[o]:e[u]};return a}function jr(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Eg(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Ag(e){const{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function Pg(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function eu(e,t,n,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function nu(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=Eg(o,r,i),h=t.length;let f;for(let m=0;m<h;++m){const p=t[m],{[l]:y,[c]:b}=p,S=p._stacks||(p._stacks={});f=S[c]=Pg(s,u,y),f[a]=b,f._top=eu(f,r,!0,i.type),f._bottom=eu(f,r,!1,i.type);const M=f._visualValues||(f._visualValues={});M[a]=b}}function qr(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Rg(e,t){return bn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ig(e,t,n){return bn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function is(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const Gr=e=>e==="reset"||e==="none",iu=(e,t)=>t?e:Object.assign({},e),Lg=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Jc(n,!0),values:null};class wn{static defaults={};static datasetElementType=null;static dataElementType=null;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=jr(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&&is(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,o=n.xAxisID=at(i.xAxisID,qr(t,"x")),r=n.yAxisID=at(i.yAxisID,qr(t,"y")),a=n.rAxisID=at(i.rAxisID,qr(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),u=n.vAxisID=s(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),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&&_c(this._data,this),t._stacked&&is(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(ft(n)){const s=this._cachedMeta;this._data=Og(n,s)}else if(i!==n){if(i){_c(i,this);const s=this._cachedMeta;is(s),s._parsed=[]}n&&Object.isExtensible(n)&&_p(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 s=!1;this._dataCheck();const o=n._stacked;n._stacked=jr(n.vScale,n),n.stack!==i.stack&&(s=!0,is(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(nu(this,n._parsed),n._stacked=jr(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:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&n===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{xt(s[t])?f=this.parseArrayData(i,s,t,n):ft(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);const m=()=>h[a]===null||c&&h[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}r&&nu(this,f)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,h=new Array(s);let f,m,p;for(f=0,m=s;f<m;++f)p=f+i,h[f]={[a]:u||o.parse(c[p],p),[l]:r.parse(n[p],p)};return h}parseArrayData(t,n,i,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=n[u],a[l]={x:o.parse(h[0],u),y:r.parse(h[1],u)};return a}parseObjectData(t,n,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=n[f],c[u]={x:o.parse(mn(m,a),f),y:r.parse(mn(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:Jc(s,!0),values:n._stacks[t.axis]._visualValues};return tu(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){const o=i[n.axis];let r=o===null?NaN:o;const a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=tu(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Lg(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Ag(a);let f,m;function p(){m=s[f];const y=m[a.axis];return!At(m[t.axis])||u>y||h<y}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(c,t,m,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],At(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Cg(at(this.options.clip,Dg(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const h=s[u];h.hidden||(h.active&&c?r.push(h):h.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}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 s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Ig(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Rg(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}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 s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&fe(i);if(a)return iu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(Et.elements[t]),p=()=>this.getContext(i,s,n),y=c.resolveNamedOptions(f,m,p,h);return y.$shared&&(y.$shared=l,o[r]=Object.freeze(iu(y,l))),y}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,n))}const c=new Yr(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Gr(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){Gr(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!Gr(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}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[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){const s=this._cachedMeta,o=s.data,r=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&is(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,s]=t;this[n](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,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])}}function Ng(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=n.length;s<o;s++)i=i.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=xc(i.sort((s,o)=>s-o))}return e._cache.$bar}function Fg(e){const t=e.iScale,n=Ng(t,e.type);let i=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(fe(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(s=0,o=n.length;s<o;++s)r=t.getPixelForValue(n[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return i}function Bg(e,t,n,i){const s=n.barThickness;let o,r;return rt(s)?(o=t.min*n.categoryPercentage,r=n.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[e]-o/2}}function zg(e,t,n,i){const s=t.pixels,o=s[e];let r=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const l=n.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:n.barPercentage,start:c}}function Ug(e,t,n,i){const s=n.parse(e[0],i),o=n.parse(e[1],i),r=Math.min(s,o),a=Math.max(s,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function su(e,t,n,i){return xt(e)?Ug(e,t,n,i):t[n.axis]=n.parse(e,i),t}function ou(e,t,n,i){const s=e.iScale,o=e.vScale,r=s.getLabels(),a=s===o,l=[];let c,u,h,f;for(c=n,u=n+i;c<u;++c)f=t[c],h={},h[s.axis]=a||s.parse(r[c],c),l.push(su(f,h,o,c));return l}function Kr(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Hg(e,t,n){return e!==0?ze(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Vg(e){let t,n,i,s,o;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:i,reverse:t,top:s,bottom:o}}function Wg(e,t,n,i){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:u}=Vg(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?s=c:(n._bottom||0)===i?s=u:(o[ru(u,r,a,l)]=!0,s=c)),o[ru(s,r,a,l)]=!0,e.borderSkipped=o}function ru(e,t,n,i){return i?(e=$g(e,t,n),e=au(e,n,t)):e=au(e,t,n),e}function $g(e,t,n){return e===t?n:e===n?t:e}function au(e,t,n){return e==="start"?t:e==="end"?n:e}function Yg(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class lu extends wn{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,i,s){return ou(t,n,i,s)}parseArrayData(t,n,i,s){return ou(t,n,i,s)}parseObjectData(t,n,i,s){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,u=r.axis==="x"?a:l,h=[];let f,m,p,y;for(f=i,m=i+s;f<m;++f)y=n[f],p={},p[o.axis]=o.parse(mn(y,c),f),h.push(su(mn(y,u),p,r,f));return h}updateRangeFromParsed(t,n,i,s){super.updateRangeFromParsed(t,n,i,s);const o=i._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:s}=n,o=this.getParsed(t),r=o._custom,a=Kr(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}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,s){const o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,s);for(let m=n;m<n+i;m++){const p=this.getParsed(m),y=o||rt(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,u),S=(p._stacks||{})[a.axis],M={horizontal:c,base:y.base,enableBorderRadius:!S||Kr(p._custom)||r===S._top||r===S._bottom,x:c?y.head:b.center,y:c?b.center:y.head,height:c?b.size:Math.abs(y.size),width:c?Math.abs(y.size):b.size};f&&(M.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const E=M.options||t[m].options;Wg(M,E,S,r),Yg(M,E,u.ratio),this.updateElement(t[m],m,M,s)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(rt(f)||isNaN(f))return!0};for(const u of s)if(!(n!==void 0&&c(u))&&((o===!1||r.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&r.push(u.stack),u.index===t))break;return r.length||r.push(void 0),r}_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[at(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const s=this._getStacks(t,i),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let o,r;for(o=0,r=n.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||Fg(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,u=Kr(c);let h=l[n.axis],f=0,m=i?this.applyStack(n,l,i):h,p,y;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&ze(h)!==ze(c.barEnd)&&(f=0),f+=h);const b=!rt(o)&&!u?o:f;let S=n.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+m):p=S,y=p-S,Math.abs(y)<r){y=Hg(y,n,a)*r,h===a&&(S-=y/2);const M=n.getPixelForDecimal(0),E=n.getPixelForDecimal(1),D=Math.min(M,E),C=Math.max(M,E);S=Math.max(Math.min(S,C),D),p=S+y,i&&!u&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(S))}if(S===n.getPixelForValue(a)){const M=ze(y)*n.getLineWidthForValue(a)/2;S+=M,y-=M}return{size:y,base:S,head:p,center:p+y/2}}_calculateBarIndexPixels(t,n){const i=n.scale,s=this.options,o=s.skipNull,r=at(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,h=s.barThickness==="flex"?zg(t,n,s,u*c):Bg(t,n,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(at(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;a=h.start+h.chunk*p+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}class jg extends wn{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,s){const o=super.parsePrimitiveData(t,n,i,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(t,n,i,s){const o=super.parseArrayData(t,n,i,s);for(let r=0;r<o.length;r++){const a=n[i+r];o[r]._custom=at(a[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(t,n,i,s){const o=super.parseObjectData(t,n,i,s);for(let r=0;r<o.length;r++){const a=n[i+r];o[r]._custom=at(a&&a.r&&+a.r,this.resolveDataElementOptions(r+i).radius)}return o}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:s,yScale:o}=n,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=r.axis,h=a.axis;for(let f=n;f<n+i;f++){const m=t[f],p=!o&&this.getParsed(f),y={},b=y[u]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[u]),S=y[h]=o?a.getBasePixel():a.getPixelForValue(p[h]);y.skip=isNaN(b)||isNaN(S),c&&(y.options=l||this.resolveDataElementOptions(f,m.active?"active":s),o&&(y.options.radius=0)),this.updateElement(m,f,y,s)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=at(i&&i._custom,o),s}}function qg(e,t,n){let i=1,s=1,o=0,r=0;if(t<Dt){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),h=Math.cos(l),f=Math.sin(l),m=(E,D,C)=>Xi(E,a,l,!0)?1:Math.max(D,D*n,C,C*n),p=(E,D,C)=>Xi(E,a,l,!0)?-1:Math.min(D,D*n,C,C*n),y=m(0,c,h),b=m(Ot,u,f),S=p(dt,c,h),M=p(dt+Ot,u,f);i=(y-S)/2,s=(b-M)/2,o=-(y+S)/2,r=-(b+M)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class ss extends wn{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:i,borderRadius:r&&(a||h.borderRadius),index:c}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};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,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(ft(i[t])){const{key:l="value"}=this._parsing;o=c=>+mn(i[c],l)}let r,a;for(r=t,a=t+n;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return Vt(this.options.rotation-90)}_getCircumference(){return Vt(this.options.circumference)}_getRotationExtents(){let t=Dt,n=-Dt;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,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+r)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(op(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:y}=qg(h,u,l),b=(i.width-r)/f,S=(i.height-r)/m,M=Math.max(Math.min(b,S)/2,0),E=dc(this.options.radius,M),D=Math.max(E*l,0),C=(E-D)/this._getVisibleDatasetWeightTotal();this.offsetX=p*E,this.offsetY=y*E,s.total=this.calculateTotal(),this.outerRadius=E-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/Dt)}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,u=(a.left+a.right)/2,h=(a.top+a.bottom)/2,f=o&&c.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:b}=this._getSharedOptions(n,s);let S=this._getRotation(),M;for(M=0;M<n;++M)S+=this._circumference(M,o);for(M=n;M<n+i;++M){const E=this._circumference(M,o),D=t[M],C={x:u+this.offsetX,y:h+this.offsetY,startAngle:S,endAngle:S+E,circumference:E,outerRadius:p,innerRadius:m};b&&(C.options=y||this.resolveDataElementOptions(M,D.active?"active":s)),S+=E,this.updateElement(D,M,C,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Dt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Qi(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.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(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class cu extends wn{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:a,count:l}=Tc(n,s,r);this._drawStart=a,this._drawCount=l,vc(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._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:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,s),f=r.axis,m=a.axis,{spanGaps:p,segment:y}=this.options,b=gn(p)?p:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||s==="none",M=n+i,E=t.length;let D=n>0&&this.getParsed(n-1);for(let C=0;C<E;++C){const A=t[C],O=S?A:{};if(C<n||C>=M){O.skip=!0;continue}const x=this.getParsed(C),_=rt(x[m]),T=O[f]=r.getPixelForValue(x[f],C),k=O[m]=o||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,x,l):x[m],C);O.skip=isNaN(T)||isNaN(k)||_,O.stop=C>0&&Math.abs(x[f]-D[f])>b,y&&(O.parsed=x,O.raw=c.data[C]),h&&(O.options=u||this.resolveDataElementOptions(C,A.active?"active":s)),S||this.updateElement(A,C,O,s),D=x}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class uu extends wn{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}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}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Qi(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,i,s){return Bc.bind(this)(t,n,i,s)}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,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*dt;let m=f,p;const y=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,y);for(p=n;p<n+i;p++){const b=t[p];let S=m,M=m+this._computeAngle(p,s,y),E=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=M,o&&(l.animateScale&&(E=0),l.animateRotate&&(S=M=f));const D={x:u,y:h,innerRadius:0,outerRadius:E,startAngle:S,endAngle:M,options:this.resolveDataElementOptions(p,b.active?"active":s)};this.updateElement(b,p,D,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Vt(this.resolveDataElementOptions(t,n).angle||i):0}}class Gg extends ss{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Kg extends wn{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};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,s){return Bc.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(i.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let a=n;a<n+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=o.getPointPositionForValue(a,this.getParsed(a).r),h=r?o.xCenter:u.x,f=r?o.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,a,m,s)}}}class Xg extends wn{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:r}=Tc(n,i,s);if(this._drawStart=o,this._drawCount=r,vc(n)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=r.axis,p=a.axis,{spanGaps:y,segment:b}=this.options,S=gn(y)?y:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||o||s==="none";let E=n>0&&this.getParsed(n-1);for(let D=n;D<n+i;++D){const C=t[D],A=this.getParsed(D),O=M?C:{},x=rt(A[p]),_=O[m]=r.getPixelForValue(A[m],D),T=O[p]=o||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[p],D);O.skip=isNaN(_)||isNaN(T)||x,O.stop=D>0&&Math.abs(A[m]-E[m])>S,b&&(O.parsed=A,O.raw=c.data[D]),f&&(O.options=h||this.resolveDataElementOptions(D,C.active?"active":s)),M||this.updateElement(C,D,O,s),E=A}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}}var Zg=Object.freeze({__proto__:null,BarController:lu,BubbleController:jg,DoughnutController:ss,LineController:cu,PieController:Gg,PolarAreaController:uu,RadarController:Kg,ScatterController:Xg});function Hn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Hn()}parse(){return Hn()}format(){return Hn()}add(){return Hn()}diff(){return Hn()}startOf(){return Hn()}endOf(){return Hn()}}var du={_date:Xr};function Qg(e,t,n,i){const{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?yp:Ze;if(i){if(s._sharedOptions){const u=o[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(o,t,n-h),m=c(o,t,n+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=e,m=f.slice(0,u.lo+1).reverse().findIndex(y=>!rt(y[h.axis]));u.lo-=Math.max(0,m);const p=f.slice(u.hi).findIndex(y=>!rt(y[h.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:o.length-1}}function os(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:h,hi:f}=Qg(o[a],t,r,s);for(let m=h;m<=f;++m){const p=u[m];p.skip||i(p,c,m)}}}function Jg(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Zr(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||os(e,n,t,function(a,l,c){!s&&!Qe(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function ty(e,t,n,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:h}=oo(r,{x:t.x,y:t.y});Xi(h,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return os(e,n,t,o),s}function ey(e,t,n,i,s,o){let r=[];const a=Jg(n);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!m)return;const b=a(t,p);b<l?(r=[{element:u,datasetIndex:h,index:f}],l=b):b===l&&r.push({element:u,datasetIndex:h,index:f})}return os(e,n,t,c),r}function Qr(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?ty(e,t,n,s):ey(e,t,n,i,s,o)}function hu(e,t,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return os(e,n,t,(l,c,u)=>{l[r]&&l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Jr={evaluateInteractionItems:os,modes:{index(e,t,n,i){const s=_n(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Zr(e,s,o,i,r):Qr(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=_n(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?Zr(e,s,o,i,r):Qr(e,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,i){const s=_n(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Zr(e,s,o,i,r)},nearest(e,t,n,i){const s=_n(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Qr(e,s,o,n.intersect,i,r)},x(e,t,n,i){const s=_n(t,e);return hu(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=_n(t,e);return hu(e,s,"y",n.intersect,i)}}};const fu=["left","top","right","bottom"];function rs(e,t){return e.filter(n=>n.pos===t)}function mu(e,t){return e.filter(n=>fu.indexOf(n.pos)===-1&&n.box.axis===t)}function as(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function ny(e){const t=[];let n,i,s,o,r,a;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function iy(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!fu.includes(s))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function sy(e,t){const n=iy(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return n}function oy(e){const t=ny(e),n=as(t.filter(c=>c.box.fullSize),!0),i=as(rs(t,"left"),!0),s=as(rs(t,"right")),o=as(rs(t,"top"),!0),r=as(rs(t,"bottom")),a=mu(t,"x"),l=mu(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:rs(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function pu(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function gu(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 ry(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!ft(s)){n.size&&(e[s]-=n.size);const h=i[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?o.height:o.width),n.size=h.size/h.count,e[s]+=n.size}o.getPadding&&gu(r,o.getPadding());const a=Math.max(0,t.outerWidth-pu(r,e,"left","right")),l=Math.max(0,t.outerHeight-pu(r,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function ay(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function ly(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return i(e?["left","right"]:["top","bottom"])}function ls(e,t,n,i){const s=[];let o,r,a,l,c,u;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,ly(a.horizontal,t));const{same:h,other:f}=ry(t,n,a,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&ls(s,t,n,i)||u}function mo(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function yu(e,t,n,i){const s=n.padding;let{x:o,y:r}=t;for(const a of e){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const h=t.w*u,f=c.size||l.height;fe(c.start)&&(r=c.start),l.fullSize?mo(l,s.left,r,n.outerWidth-s.right-s.left,f):mo(l,t.left+c.placed,r,h,f),c.start=r,c.placed+=h,r=l.bottom}else{const h=t.h*u,f=c.size||l.width;fe(c.start)&&(o=c.start),l.fullSize?mo(l,o,s.top,f,n.outerHeight-s.bottom-s.top):mo(l,o,t.top+c.placed,f,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=r}var se={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 s=Wt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=oy(e.boxes),l=a.vertical,c=a.horizontal;St(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,b)=>b.box.options&&b.box.options.display===!1?y:y+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},s);gu(f,Wt(i));const m=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),p=sy(l.concat(c),h);ls(a.fullSize,m,h,p),ls(l,m,h,p),ls(c,m,h,p)&&ls(l,m,h,p),ay(m),yu(a.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,yu(a.rightAndBottom,m,h,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},St(a.chartArea,y=>{const b=y.box;Object.assign(b,e.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class bu{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class cy extends bu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const po="$chartjs",uy={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},_u=e=>e===null||e==="";function dy(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[po]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",_u(s)){const o=Hc(e,"width");o!==void 0&&(e.width=o)}if(_u(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Hc(e,"height");o!==void 0&&(e.height=o)}return e}const xu=ug?{passive:!0}:!1;function hy(e,t,n){e&&e.addEventListener(t,n,xu)}function fy(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,xu)}function my(e,t){const n=uy[e.type]||e.type,{x:i,y:s}=_n(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function go(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function py(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||go(a.addedNodes,i),r=r&&!go(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function gy(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||go(a.removedNodes,i),r=r&&!go(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const cs=new Map;let wu=0;function Su(){const e=window.devicePixelRatio;e!==wu&&(wu=e,cs.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function yy(e,t){cs.size||window.addEventListener("resize",Su),cs.set(e,t)}function by(e){cs.delete(e),cs.size||window.removeEventListener("resize",Su)}function _y(e,t,n){const i=e.canvas,s=i&&$r(i);if(!s)return;const o=Sc((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),yy(e,o),r}function ta(e,t,n){n&&n.disconnect(),t==="resize"&&by(e)}function xy(e,t,n){const i=e.canvas,s=Sc(o=>{e.ctx!==null&&n(my(o,e))},e);return hy(i,t,s),s}class wy extends bu{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(dy(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[po])return!1;const i=n[po].initial;["height","width"].forEach(o=>{const r=i[o];rt(r)?n.removeAttribute(o):n.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[po],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:py,detach:gy,resize:_y}[n]||xy;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:ta,detach:ta,resize:ta}[n]||fy)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return cg(t,n,i,s)}isAttached(t){const n=t&&$r(t);return!!(n&&n.isConnected)}}function Sy(e){return!Wr()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?cy:wy}class oe{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return gn(this.x)&&gn(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function Ty(e,t){const n=e.options.ticks,i=vy(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?ky(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Dy(t,c,o,r/s),c;const u=My(o,t,s);if(r>0){let h,f;const m=r>1?Math.round((l-a)/(r-1)):null;for(yo(t,c,u,rt(m)?0:a-m,a),h=0,f=r-1;h<f;h++)yo(t,c,u,o[h],o[h+1]);return yo(t,c,u,l,rt(m)?t.length:l+m),c}return yo(t,c,u),c}function vy(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function My(e,t,n){const i=Cy(e),s=t.length/n;if(!i)return Math.max(s,1);const o=hp(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function ky(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function Dy(e,t,n,i){let s=0,o=n[0],r;for(i=Math.ceil(i),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=n[s*i])}function yo(e,t,n,i,s){const o=at(i,0),r=Math.min(at(s,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function Cy(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 Oy=e=>e==="left"?"right":e==="right"?"left":e,Tu=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,vu=(e,t)=>Math.min(t||e,e);function Mu(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function Ey(e,t,n){const i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6;let l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Ay(e,t){St(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function us(e){return e.drawTicks?e.tickLength:0}function ku(e,t){if(!e.display)return 0;const n=Pt(e.font,t),i=Wt(e.padding);return(xt(e.text)?e.text.length:1)*n.lineHeight+i.height}function Py(e,t){return bn(e,{scale:t,type:"scale"})}function Ry(e,t,n){return bn(e,{tick:n,index:t,type:"tick"})}function Iy(e,t,n){let i=Pr(e);return(n&&t!=="right"||!n&&t==="right")&&(i=Oy(i)),i}function Ly(e,t,n,i){const{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let h=0,f,m,p;const y=r-s,b=a-o;if(e.isHorizontal()){if(m=ie(i,o,a),ft(n)){const S=Object.keys(n)[0],M=n[S];p=u[S].getPixelForValue(M)+y-t}else n==="center"?p=(c.bottom+c.top)/2+y-t:p=Tu(e,n,t);f=a-o}else{if(ft(n)){const S=Object.keys(n)[0],M=n[S];m=u[S].getPixelForValue(M)-b+t}else n==="center"?m=(c.left+c.right)/2-b+t:m=Tu(e,n,t);p=ie(i,r,s),h=n==="left"?-Ot:Ot}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class Vn extends oe{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:s}=this;return t=ve(t,Number.POSITIVE_INFINITY),n=ve(n,Number.NEGATIVE_INFINITY),i=ve(i,Number.POSITIVE_INFINITY),s=ve(s,Number.NEGATIVE_INFINITY),{min:ve(t,i),max:ve(n,s),minDefined:At(t),maxDefined:At(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:ve(n,ve(i,n)),max:ve(i,ve(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(){wt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.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=Hp(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Mu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Ty(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,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(){wt(this.options.afterUpdate,[this])}beforeSetDimensions(){wt(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(){wt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),wt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){wt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=wt(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){wt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){wt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=vu(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||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);a=t.offset?this.maxWidth/i:m/(i-1),h+6>a&&(a=m/(i-(t.offset?.5:1)),l=this.maxHeight-us(t.grid)-n.padding-ku(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),r=so(Math.min(Math.asin(Kt((u.highest.height+6)/a,-1,1)),Math.asin(Kt(l/c,-1,1))-Math.asin(Kt(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){wt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){wt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=ku(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=us(o)+l):(t.height=this.maxHeight,t.width=us(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,p=Vt(this.labelRotation),y=Math.cos(p),b=Math.sin(p);if(a){const S=i.mirror?0:b*h.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+S+m)}else{const S=i.mirror?0:y*h.width+b*f.height;t.width=Math.min(this.maxWidth,t.width+S+m)}this._calculatePadding(c,u,b,y)}}this._handleMargins(),a?(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,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=s*t.width,m=i*n.height):(f=i*t.height,m=s*n.width):o==="start"?m=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,m=n.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+r)*this.width/(this.width-h),0)}else{let u=n.height/2,h=t.height/2;o==="start"?(u=0,h=t.height):o==="end"&&(u=n.height,h=0),this.paddingTop=u+r,this.paddingBottom=h+r}}_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(){wt(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++)rt(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=Mu(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/vu(n,i));let c=0,u=0,h,f,m,p,y,b,S,M,E,D,C;for(h=0;h<n;h+=l){if(p=t[h].label,y=this._resolveTickFontOptions(h),s.font=b=y.string,S=o[b]=o[b]||{data:{},gc:[]},M=y.lineHeight,E=D=0,!rt(p)&&!xt(p))E=lo(s,S.data,S.gc,E,p),D=M;else if(xt(p))for(f=0,m=p.length;f<m;++f)C=p[f],!rt(C)&&!xt(C)&&(E=lo(s,S.data,S.gc,E,C),D+=M);r.push(E),a.push(D),c=Math.max(E,c),u=Math.max(D,u)}Ay(o,n);const A=r.indexOf(c),O=a.indexOf(u),x=_=>({width:r[_]||0,height:a[_]||0});return{first:x(0),last:x(n-1),widest:x(A),highest:x(O),widths:r,heights:a}}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 gp(this._alignToPixels?Fn(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=Ry(this.getContext(),t,i))}return this.$context||(this.$context=Py(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Vt(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=us(o),m=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,b=y/2,S=function(H){return Fn(i,H,y)};let M,E,D,C,A,O,x,_,T,k,I,Y;if(r==="top")M=S(this.bottom),O=this.bottom-f,_=M-b,k=S(t.top)+b,Y=t.bottom;else if(r==="bottom")M=S(this.top),k=t.top,Y=S(t.bottom)-b,O=M+b,_=this.top+f;else if(r==="left")M=S(this.right),A=this.right-f,x=M-b,T=S(t.left)+b,I=t.right;else if(r==="right")M=S(this.left),T=t.left,I=S(t.right)-b,A=M+b,x=this.left+f;else if(n==="x"){if(r==="center")M=S((t.top+t.bottom)/2+.5);else if(ft(r)){const H=Object.keys(r)[0],$=r[H];M=S(this.chart.scales[H].getPixelForValue($))}k=t.top,Y=t.bottom,O=M+b,_=O+f}else if(n==="y"){if(r==="center")M=S((t.left+t.right)/2);else if(ft(r)){const H=Object.keys(r)[0],$=r[H];M=S(this.chart.scales[H].getPixelForValue($))}A=M-b,x=A-f,T=t.left,I=t.right}const U=at(s.ticks.maxTicksLimit,h),j=Math.max(1,Math.ceil(h/U));for(E=0;E<h;E+=j){const H=this.getContext(E),$=o.setContext(H),R=a.setContext(H),B=$.lineWidth,z=$.color,P=R.dash||[],N=R.dashOffset,V=$.tickWidth,Q=$.tickColor,X=$.tickBorderDash||[],q=$.tickBorderDashOffset;D=Ey(this,E,l),D!==void 0&&(C=Fn(i,D,B),c?A=x=T=I=C:O=_=k=Y=C,m.push({tx1:A,ty1:O,tx2:x,ty2:_,x1:T,y1:k,x2:I,y2:Y,width:B,color:z,borderDash:P,borderDashOffset:N,tickWidth:V,tickColor:Q,tickBorderDash:X,tickBorderDashOffset:q}))}return this._ticksLength=h,this._borderValue=M,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=o,f=us(i.grid),m=f+u,p=h?-u:m,y=-Vt(this.labelRotation),b=[];let S,M,E,D,C,A,O,x,_,T,k,I,Y="middle";if(s==="top")A=this.bottom-p,O=this._getXAxisLabelAlignment();else if(s==="bottom")A=this.top+p,O=this._getXAxisLabelAlignment();else if(s==="left"){const j=this._getYAxisLabelAlignment(f);O=j.textAlign,C=j.x}else if(s==="right"){const j=this._getYAxisLabelAlignment(f);O=j.textAlign,C=j.x}else if(n==="x"){if(s==="center")A=(t.top+t.bottom)/2+m;else if(ft(s)){const j=Object.keys(s)[0],H=s[j];A=this.chart.scales[j].getPixelForValue(H)+m}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")C=(t.left+t.right)/2-m;else if(ft(s)){const j=Object.keys(s)[0],H=s[j];C=this.chart.scales[j].getPixelForValue(H)}O=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?Y="top":l==="end"&&(Y="bottom"));const U=this._getLabelSizes();for(S=0,M=a.length;S<M;++S){E=a[S],D=E.label;const j=o.setContext(this.getContext(S));x=this.getPixelForTick(S)+o.labelOffset,_=this._resolveTickFontOptions(S),T=_.lineHeight,k=xt(D)?D.length:1;const H=k/2,$=j.color,R=j.textStrokeColor,B=j.textStrokeWidth;let z=O;r?(C=x,O==="inner"&&(S===M-1?z=this.options.reverse?"left":"right":S===0?z=this.options.reverse?"right":"left":z="center"),s==="top"?c==="near"||y!==0?I=-k*T+T/2:c==="center"?I=-U.highest.height/2-H*T+T:I=-U.highest.height+T/2:c==="near"||y!==0?I=T/2:c==="center"?I=U.highest.height/2-H*T:I=U.highest.height-k*T,h&&(I*=-1),y!==0&&!j.showLabelBackdrop&&(C+=T/2*Math.sin(y))):(A=x,I=(1-k)*T/2);let P;if(j.showLabelBackdrop){const N=Wt(j.backdropPadding),V=U.heights[S],Q=U.widths[S];let X=I-N.top,q=0-N.left;switch(Y){case"middle":X-=V/2;break;case"bottom":X-=V;break}switch(O){case"center":q-=Q/2;break;case"right":q-=Q;break;case"inner":S===M-1?q-=Q:S>0&&(q-=Q/2);break}P={left:q,top:X,width:Q+N.width,height:V+N.height,color:j.backdropColor}}b.push({label:D,font:_,textOffset:I,options:{rotation:y,color:$,strokeColor:R,strokeWidth:B,textAlign:z,textBaseline:Y,translation:[C,A],backdrop:P}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Vt(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,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:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o<r;++o){const l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Fn(t,this.left,r)-r/2,u=Fn(t,this.right,a)+a/2,h=f=l):(h=Fn(t,this.top,r)-r/2,f=Fn(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,h),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ts(i,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,u=r.textOffset;Bn(i,c,0,u,l,a)}s&&es(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=Pt(i.font),r=Wt(i.padding),a=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||ft(n)?(l+=r.bottom,xt(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=Ly(this,l,n,a);Bn(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:f,textAlign:Iy(a,n,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,n=t.ticks&&t.ticks.z||0,i=at(t.grid&&t.grid.z,-1),s=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Vn.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=n.length;o<r;++o){const a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Pt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class bo{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;By(n)&&(i=this.register(n));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Ny(t,r,i),this.override&&Et.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in Et[s]&&(delete Et[s][i],this.override&&delete Nn[i])}}function Ny(e,t,n){const i=qi(Object.create(null),[n?Et.get(n):{},Et.get(t),e.defaults]);Et.set(t,i),e.defaultRoutes&&Fy(t,e.defaultRoutes),e.descriptors&&Et.describe(t,e.descriptors)}function Fy(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");Et.route(o,s,l,a)})}function By(e){return"id"in e&&"defaults"in e}class zy{constructor(){this.controllers=new bo(wn,"datasets",!0),this.elements=new bo(oe,"elements"),this.plugins=new bo(Object,"plugins"),this.scales=new bo(Vn,"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(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):St(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=Or(t);wt(i["before"+s],[],i),n[t](i),wt(i["after"+s],[],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 s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ue=new zy;class Uy{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,n,i,s){s=s||{};for(const o of t){const r=o.plugin,a=r[i],l=[n,s,o.options];if(wt(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){rt(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,s=at(i.options&&i.options.plugins,{}),o=Hy(i);return s===!1&&!n?[]:Wy(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function Hy(e){const t={},n=[],i=Object.keys(Ue.plugins.items);for(let o=0;o<i.length;o++)n.push(Ue.getPlugin(i[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function Vy(e,t){return!t&&e===!1?null:e===!0?{}:e}function Wy(e,{plugins:t,localIds:n},i,s){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=Vy(i[l],s);c!==null&&o.push({plugin:a,options:$y(e.config,{plugin:a,local:n[l]},c,r)})}return o}function $y(e,{plugin:t,local:n},i,s){const o=e.pluginScopeKeys(t),r=e.getOptionScopes(i,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ea(e,t){const n=Et.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Yy(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function jy(e,t){return e===t?"_index_":"_value_"}function Du(e){if(e==="x"||e==="y"||e==="r")return e}function qy(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function na(e,...t){if(Du(e))return e;for(const n of t){const i=n.axis||qy(n.position)||e.length>1&&Du(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Cu(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Gy(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 Cu(e,"x",n[0])||Cu(e,"y",n[0])}return{}}function Ky(e,t){const n=Nn[e.type]||{scales:{}},i=t.scales||{},s=ea(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!ft(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=na(r,a,Gy(r,e),Et.scales[a.type]),c=jy(l,s),u=n.scales||{};o[r]=Gi(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||ea(a,t),u=(Nn[a]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Yy(h,l),m=r[f+"AxisID"]||f;o[m]=o[m]||Object.create(null),Gi(o[m],[{axis:f},i[m],u[h]])})}),Object.keys(o).forEach(r=>{const a=o[r];Gi(a,[Et.scales[a.type],Et.scale])}),o}function Ou(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=Ky(e,t)}function Eu(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Xy(e){return e=e||{},e.data=Eu(e.data),Ou(e),e}const Au=new Map,Pu=new Set;function _o(e,t){let n=Au.get(e);return n||(n=t(),Au.set(e,n),Pu.add(n)),n}const ds=(e,t,n)=>{const i=mn(t,n);i!==void 0&&e.add(i)};class Zy{constructor(t){this._config=Xy(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=Eu(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(),Ou(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _o(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return _o(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return _o(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return _o(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(h=>ds(l,t,h))),u.forEach(h=>ds(l,s,h)),u.forEach(h=>ds(l,Nn[o]||{},h)),u.forEach(h=>ds(l,Et,h)),u.forEach(h=>ds(l,Nr,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Pu.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Nn[n]||{},Et.datasets[n]||{},{type:n},Et,Nr]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ru(this._resolverCache,t,s);let l=r;if(Jy(r,n)){o.$shared=!1,i=me(i)?i():i;const c=this.createResolver(t,i,a);l=fi(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Ru(this._resolverCache,t,i);return ft(n)?fi(o,n,void 0,s):o}}function Ru(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:Ur(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const Qy=e=>ft(e)&&Object.getOwnPropertyNames(e).some(t=>me(e[t]));function Jy(e,t){const{isScriptable:n,isIndexable:i}=Pc(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(me(a)||Qy(a))||r&&xt(a))return!0}return!1}var tb="4.5.1";const eb=["top","bottom","left","right","chartArea"];function Iu(e,t){return e==="top"||e==="bottom"||eb.indexOf(e)===-1&&t==="x"}function Lu(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Nu(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),wt(n&&n.onComplete,[e],t)}function nb(e){const t=e.chart,n=t.options.animation;wt(n&&n.onProgress,[e],t)}function Fu(e){return Wr()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xo={},Bu=e=>{const t=Fu(e);return Object.values(xo).filter(n=>n.canvas===t).pop()};function ib(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function sb(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let pe=class{static defaults=Et;static instances=xo;static overrides=Nn;static registry=Ue;static version=tb;static getChart=Bu;static register(...t){Ue.add(...t),zu()}static unregister(...t){Ue.remove(...t),zu()}constructor(t,n){const i=this.config=new Zy(n),s=Fu(t),o=Bu(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Sy(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=sp(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,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 Uy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=xp(h=>this.update(h),r.resizeDelay||0),this._dataChanges=[],xo[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Je.listen(this,"complete",Nu),Je.listen(this,"progress",nb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return rt(t)?n&&o?o: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 Ue}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Uc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return Je.stop(this),this}resize(t,n){Je.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Uc(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),wt(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};St(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=na(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),St(o,r=>{const a=r.options,l=a.id,c=na(l,a),u=at(a.type,r.dtype);(a.position===void 0||Iu(a.position,c)!==Iu(r.dposition))&&(a.position=r.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ue.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(a,t)}),St(s,(r,a)=>{r||delete i[a]}),St(i,r=>{se.configure(this,r,r.options),se.addBox(this,r)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Lu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||ea(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=Ue.getController(a),{datasetElementType:c,dataElementType:u}=Et.datasets[a];Object.assign(l,{dataElementType:Ue.getElement(u),datasetElementType:c&&Ue.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){St(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()),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 o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(f),r=Math.max(+h.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||St(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Lu("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){St(this.scales,t=>{se.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!mc(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const r=i==="_removeElements"?-o:o;ib(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!mc(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;se.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],St(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),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,me(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Je.has(this)?this.attached&&!Je.running(this)&&Je.start(this):(this.draw(),Nu({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 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 s,o;for(s=0,o=n.length;s<o;++s){const r=n[s];(!t||r.visible)&&i.push(r)}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},s=Xc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&ts(n,s),t.controller.draw(),s&&es(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Qe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=Jr.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=bn(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 s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);fe(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Je.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(),Oc(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xo[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=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};St(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){St(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},St(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!to(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 s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),r=o(n,t),a=i?t:o(t,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=up(t),c=sb(t,this._lastEvent,i,l);i&&(this._lastEvent=null,wt(o.onHover,[t,a,this],this),l&&wt(o.onClick,[t,a,this],this));const u=!to(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function zu(){return St(pe.instances,e=>e._plugins.invalidate())}function ob(e,t,n){const{startAngle:i,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/r,ne(i-n));if(e.beginPath(),e.arc(s,o,r-c/2,i+h/2,n-h/2),a>0){const f=Math.min(c/a,ne(i-n));e.arc(s,o,a+c/2,n-f/2,i+f/2,!0)}else{const f=Math.min(c/2,r*ne(i-n));if(u==="round")e.arc(s,o,f,n-dt/2,i+dt/2,!0);else if(u==="bevel"){const m=2*f*f,p=-m*Math.cos(n+dt/2)+s,y=-m*Math.sin(n+dt/2)+o,b=m*Math.cos(i+dt/2)+s,S=m*Math.sin(i+dt/2)+o;e.lineTo(p,y),e.lineTo(b,S)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function rb(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(o,r,a,i-c,n+c),l>s?(c=s/l,e.arc(o,r,l,n+c,i-c,!0)):e.arc(o,r,s,n+Ot,i-Ot),e.closePath(),e.clip()}function ab(e){return zr(e,["outerStart","outerEnd","innerStart","innerEnd"])}function lb(e,t,n,i){const s=ab(e.options.borderRadius),o=(n-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(n-Math.min(o,l))*i/2;return Kt(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Kt(s.innerStart,0,r),innerEnd:Kt(s.innerEnd,0,r)}}function gi(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function wo(e,t,n,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+n-c,0),f=u>0?u+i+n+c:0;let m=0;const p=s-l;if(i){const j=u>0?u-i:0,H=h>0?h-i:0,$=(j+H)/2,R=$!==0?p*$/($+i):p;m=(p-R)/2}const y=Math.max(.001,p*h-n/dt)/h,b=(p-y)/2,S=l+b+m,M=s-b-m,{outerStart:E,outerEnd:D,innerStart:C,innerEnd:A}=lb(t,f,h,M-S),O=h-E,x=h-D,_=S+E/O,T=M-D/x,k=f+C,I=f+A,Y=S+C/k,U=M-A/I;if(e.beginPath(),o){const j=(_+T)/2;if(e.arc(r,a,h,_,j),e.arc(r,a,h,j,T),D>0){const B=gi(x,T,r,a);e.arc(B.x,B.y,D,T,M+Ot)}const H=gi(I,M,r,a);if(e.lineTo(H.x,H.y),A>0){const B=gi(I,U,r,a);e.arc(B.x,B.y,A,M+Ot,U+Math.PI)}const $=(M-A/f+(S+C/f))/2;if(e.arc(r,a,f,M-A/f,$,!0),e.arc(r,a,f,$,S+C/f,!0),C>0){const B=gi(k,Y,r,a);e.arc(B.x,B.y,C,Y+Math.PI,S-Ot)}const R=gi(O,S,r,a);if(e.lineTo(R.x,R.y),E>0){const B=gi(O,_,r,a);e.arc(B.x,B.y,E,S-Ot,_)}}else{e.moveTo(r,a);const j=Math.cos(_)*h+r,H=Math.sin(_)*h+a;e.lineTo(j,H);const $=Math.cos(T)*h+r,R=Math.sin(T)*h+a;e.lineTo($,R)}e.closePath()}function cb(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){wo(e,t,n,i,l,s);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=r+(a%Dt||Dt))}return wo(e,t,n,i,l,s),e.fill(),l}function ub(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(h||[]),e.lineDashOffset=f,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let y=t.endAngle;if(o){wo(e,t,n,i,y,s);for(let b=0;b<o;++b)e.stroke();isNaN(a)||(y=r+(a%Dt||Dt))}p&&rb(e,t,y),l.selfJoin&&y-r>=dt&&m===0&&u!=="miter"&&ob(e,t,y),o||(wo(e,t,n,i,y,s),e.stroke())}class db extends oe{static id="arc";static 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};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.getProps(["x","y"],i),{angle:o,distance:r}=oo(s,{x:t,y:n}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,m=at(h,l-a),p=Xi(o,a,l)&&a!==l,y=m>=Dt||p,b=Xe(r,c+f,u+f);return y&&b}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(s+o)/2,h=(r+a+c+l)/2;return{x:n+Math.cos(u)*h,y:i+Math.sin(u)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Dt?Math.floor(i/Dt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(dt,i||0)),c=s*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,cb(t,this,c,o,r),ub(t,this,c,o,r),t.restore()}}function Uu(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function hb(e,t,n){e.lineTo(n.x,n.y)}function fb(e){return e.stepped?Pp:e.tension||e.cubicInterpolationMode==="monotone"?Rp:hb}function Hu(e,t,n={}){const i=e.length,{start:s=0,end:o=i-1}=n,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function mb(e,t,n,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Hu(s,n,i),u=fb(o);let{move:h=!0,reverse:f}=i||{},m,p,y;for(m=0;m<=c;++m)p=s[(a+(f?c-m:m))%r],!p.skip&&(h?(e.moveTo(p.x,p.y),h=!1):u(e,y,p,f,o.stepped),y=p);return l&&(p=s[(a+(f?c:0))%r],u(e,y,p,f,o.stepped)),!!l}function pb(e,t,n,i){const s=t.points,{count:o,start:r,ilen:a}=Hu(s,n,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,p,y,b,S;const M=D=>(r+(c?a-D:D))%o,E=()=>{y!==b&&(e.lineTo(u,b),e.lineTo(u,y),e.lineTo(u,S))};for(l&&(m=s[M(0)],e.moveTo(m.x,m.y)),f=0;f<=a;++f){if(m=s[M(f)],m.skip)continue;const D=m.x,C=m.y,A=D|0;A===p?(C<y?y=C:C>b&&(b=C),u=(h*u+D)/++h):(E(),e.lineTo(D,C),p=A,h=0,y=b=C),S=C}E()}function ia(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?pb:mb}function gb(e){return e.stepped?dg:e.tension||e.cubicInterpolationMode==="monotone"?hg:Un}function yb(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Uu(e,t.options),e.stroke(s)}function bb(e,t,n,i){const{segments:s,options:o}=t,r=ia(t);for(const a of s)Uu(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const _b=typeof Path2D=="function";function xb(e,t,n,i){_b&&!t.options.segment?yb(e,t,n,i):bb(e,t,n,i)}class So extends oe{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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 s=i.spanGaps?this._loop:this._fullLoop;ig(this._points,i,t,s,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=bg(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,s=t[n],o=this.points,r=qc(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],l=gb(i);let c,u;for(c=0,u=r.length;c<u;++c){const{start:h,end:f}=r[c],m=o[h],p=o[f];if(m===p){a.push(m);continue}const y=Math.abs((s-m[n])/(p[n]-m[n])),b=l(m,p,y,i.stepped);b[n]=t[n],a.push(b)}return a.length===1?a[0]:a}pathSegment(t,n,i){return ia(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=ia(this);let r=this._loop;n=n||0,i=i||this.points.length-n;for(const a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),xb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Vu(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class wb extends oe{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(n-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Vu(this,t,"x",n)}inYRange(t,n){return Vu(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!Qe(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Br(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Wu(e,t){const{x:n,y:i,base:s,width:o,height:r}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,h;return e.horizontal?(h=r/2,a=Math.min(n,s),l=Math.max(n,s),c=i-h,u=i+h):(h=o/2,a=n-h,l=n+h,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function Sn(e,t,n,i){return e?0:Kt(t,n,i)}function Sb(e,t,n){const i=e.options.borderWidth,s=e.borderSkipped,o=Ac(i);return{t:Sn(s.top,o.top,0,n),r:Sn(s.right,o.right,0,t),b:Sn(s.bottom,o.bottom,0,n),l:Sn(s.left,o.left,0,t)}}function Tb(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=yn(s),r=Math.min(t,n),a=e.borderSkipped,l=i||ft(s);return{topLeft:Sn(!l||a.top||a.left,o.topLeft,0,r),topRight:Sn(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Sn(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Sn(!l||a.bottom||a.right,o.bottomRight,0,r)}}function vb(e){const t=Wu(e),n=t.right-t.left,i=t.bottom-t.top,s=Sb(e,n/2,i/2),o=Tb(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function sa(e,t,n,i){const s=t===null,o=n===null,a=e&&!(s&&o)&&Wu(e,i);return a&&(s||Xe(t,a.left,a.right))&&(o||Xe(n,a.top,a.bottom))}function Mb(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function kb(e,t){e.rect(t.x,t.y,t.w,t.h)}function oa(e,t,n={}){const i=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-i,r=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+i,y:e.y+s,w:e.w+o,h:e.h+r,radius:e.radius}}class Db extends oe{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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:s}}=this,{inner:o,outer:r}=vb(this),a=Mb(r.radius)?hi:kb;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,oa(r,n,o)),t.clip(),a(t,oa(o,-n,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,oa(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,i){return sa(this,t,n,i)}inXRange(t,n){return sa(this,t,null,n)}inYRange(t,n){return sa(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var Cb=Object.freeze({__proto__:null,ArcElement:db,BarElement:Db,LineElement:So,PointElement:wb});const ra=["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)"],$u=ra.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Yu(e){return ra[e%ra.length]}function ju(e){return $u[e%$u.length]}function Ob(e,t){return e.borderColor=Yu(t),e.backgroundColor=ju(t),++t}function Eb(e,t){return e.backgroundColor=e.data.map(()=>Yu(t++)),t}function Ab(e,t){return e.backgroundColor=e.data.map(()=>ju(t++)),t}function Pb(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof ss?t=Eb(n,t):s instanceof uu?t=Ab(n,t):s&&(t=Ob(n,t))}}function qu(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Rb(e){return e&&(e.borderColor||e.backgroundColor)}function Ib(){return Et.borderColor!=="rgba(0,0,0,0.1)"||Et.backgroundColor!=="rgba(0,0,0,0.1)"}var Lb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:o}=s,r=qu(i)||Rb(s)||o&&qu(o)||Ib();if(!n.forceOverride&&r)return;const a=Pb(e);i.forEach(a)}};function Nb(e,t,n,i,s){const o=s.samples||i;if(o>=n)return e.slice(t,t+n);const r=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let u=t,h,f,m,p,y;for(r[l++]=e[u],h=0;h<o-2;h++){let b=0,S=0,M;const E=Math.floor((h+1)*a)+1+t,D=Math.min(Math.floor((h+2)*a)+1,n)+t,C=D-E;for(M=E;M<D;M++)b+=e[M].x,S+=e[M].y;b/=C,S/=C;const A=Math.floor(h*a)+1+t,O=Math.min(Math.floor((h+1)*a)+1,n)+t,{x,y:_}=e[u];for(m=p=-1,M=A;M<O;M++)p=.5*Math.abs((x-b)*(e[M].y-_)-(x-e[M].x)*(S-_)),p>m&&(m=p,f=e[M],y=M);r[l++]=f,u=y}return r[l++]=e[c],r}function Fb(e,t,n,i){let s=0,o=0,r,a,l,c,u,h,f,m,p,y;const b=[],S=t+n-1,M=e[t].x,D=e[S].x-M;for(r=t;r<t+n;++r){a=e[r],l=(a.x-M)/D*i,c=a.y;const C=l|0;if(C===u)c<p?(p=c,h=r):c>y&&(y=c,f=r),s=(o*s+a.x)/++o;else{const A=r-1;if(!rt(h)&&!rt(f)){const O=Math.min(h,f),x=Math.max(h,f);O!==m&&O!==A&&b.push({...e[O],x:s}),x!==m&&x!==A&&b.push({...e[x],x:s})}r>0&&A!==m&&b.push(e[A]),b.push(a),u=C,o=0,p=y=c,h=f=m=r}}return b}function Gu(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 Ku(e){e.data.datasets.forEach(t=>{Gu(t)})}function Bb(e,t){const n=t.length;let i=0,s;const{iScale:o}=e,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=Kt(Ze(t,o.axis,r).lo,0,n-1)),c?s=Kt(Ze(t,o.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var zb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ku(e);return}const i=e.width;e.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:a}=s,l=e.getDatasetMeta(o),c=r||s.data;if(ns([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:h,count:f}=Bb(l,c);const m=n.threshold||4*i;if(f<=m){Gu(s);return}rt(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(n.algorithm){case"lttb":p=Nb(c,h,f,i,n);break;case"min-max":p=Fb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Ku(e)}};function Ub(e,t,n){const i=e.segments,s=e.points,o=t.points,r=[];for(const a of i){let{start:l,end:c}=a;c=To(l,c,s);const u=aa(n,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:u,start:s[l],end:s[c]});continue}const h=qc(t,u);for(const f of h){const m=aa(n,o[f.start],o[f.end],f.loop),p=jc(a,s,m);for(const y of p)r.push({source:y,target:f,start:{[n]:Xu(u,m,"start",Math.max)},end:{[n]:Xu(u,m,"end",Math.min)}})}}return r}function aa(e,t,n,i){if(i)return;let s=t[e],o=n[e];return e==="angle"&&(s=ne(s),o=ne(o)),{property:e,start:s,end:o}}function Hb(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=To(r,a,s);const l=s[r],c=s[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function To(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Xu(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Zu(e,t){let n=[],i=!1;return xt(e)?(i=!0,n=e):n=Hb(e,t),n.length?new So({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Qu(e){return e&&e.fill!==!1}function Vb(e,t,n){let s=e[t].fill;const o=[t];let r;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!At(s))return s;if(r=e[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function Wb(e,t,n){const i=qb(e);if(ft(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return At(s)&&Math.floor(s)===s?$b(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function $b(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function Yb(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 jb(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 qb(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Gb(e){const{scale:t,index:n,line:i}=e,s=[],o=i.segments,r=i.points,a=Kb(t,n);a.push(Zu({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let u=c.start;u<=c.end;u++)Xb(s,r[u],a)}return new So({points:s,options:{}})}function Kb(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function Xb(e,t,n){const i=[];for(let s=0;s<n.length;s++){const o=n[s],{first:r,last:a,point:l}=Zb(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(e.push(l),!a)break}}e.push(...i)}function Zb(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const s=i[n],o=e.segments,r=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const u=o[c],h=r[u.start][n],f=r[u.end][n];if(Xe(s,h,f)){a=s===h,l=s===f;break}}return{first:a,last:l,point:i}}class Ju{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:s,y:o,radius:r}=this;return n=n||{start:0,end:Dt},t.arc(s,o,r,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function Qb(e){const{chart:t,fill:n,line:i}=e;if(At(n))return Jb(t,n);if(n==="stack")return Gb(e);if(n==="shape")return!0;const s=t0(e);return s instanceof Ju?s:Zu(s,i)}function Jb(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function t0(e){return(e.scale||{}).getPointPositionForValue?n0(e):e0(e)}function e0(e){const{scale:t={},fill:n}=e,i=Yb(n,t);if(At(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function n0(e){const{scale:t,fill:n}=e,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,r=jb(n,t,o),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new Ju({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function la(e,t,n){const i=Qb(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},p=s.getDatasetMeta(o),y=Xc(s,p);i&&r.points.length&&(ts(e,n),i0(e,{line:r,target:i,above:f,below:m,area:n,scale:a,axis:l,clip:y}),es(e))}function i0(e,t){const{line:n,target:i,above:s,below:o,area:r,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=o;o!==s&&(c==="x"?(td(e,i,r.top),ca(e,{line:n,target:i,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),td(e,i,r.bottom)):c==="y"&&(ed(e,i,r.left),ca(e,{line:n,target:i,color:o,scale:a,property:c,clip:l}),e.restore(),e.save(),ed(e,i,r.right),u=s)),ca(e,{line:n,target:i,color:u,scale:a,property:c,clip:l}),e.restore()}function td(e,t,n){const{segments:i,points:s}=t;let o=!0,r=!1;e.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[To(l,c,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function ed(e,t,n){const{segments:i,points:s}=t;let o=!0,r=!1;e.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[To(l,c,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function ca(e,t){const{line:n,target:i,property:s,color:o,scale:r,clip:a}=t,l=Ub(n,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=o}={}}=c,p=i!==!0;e.save(),e.fillStyle=m,s0(e,r,a,p&&aa(s,h,f)),e.beginPath();const y=!!n.pathSegment(e,c);let b;if(p){y?e.closePath():nd(e,i,f,s);const S=!!i.pathSegment(e,u,{move:y,reverse:!0});b=y&&S,b||nd(e,i,h,s)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function s0(e,t,n,i){const s=t.chart.chartArea,{property:o,start:r,end:a}=i||{};if(o==="x"||o==="y"){let l,c,u,h;o==="x"?(l=r,c=s.top,u=a,h=s.bottom):(l=s.left,c=r,u=s.right,h=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),h=Math.min(h,n.bottom)),e.rect(l,c,u-l,h-c),e.clip()}}function nd(e,t,n,i){const s=t.interpolate(n,i);s&&e.lineTo(s.x,s.y)}var o0={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<i;++r)o=e.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof So&&(l={visible:e.isDatasetVisible(r),index:r,fill:Wb(a,r,i),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<i;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=Vb(s,r,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&la(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Qu(o)&&la(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Qu(i)||n.drawTime!=="beforeDatasetDraw"||la(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const id=(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)}},r0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class sd extends oe{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=wt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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,s=Pt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=id(i,o);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let h=t;o.textAlign="left",o.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((p,y)=>{const b=i+n/2+o.measureText(p.text).width;(y===0||c[c.length-1]+b+2*a>r)&&(h+=u,c[c.length-(y>0?0:1)]=0,m+=u,f++),l[y]={left:0,top:m,row:f,width:b,height:s},c[c.length-1]+=b+a}),h}_fitCols(t,n,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t;let h=a,f=0,m=0,p=0,y=0;return this.legendItems.forEach((b,S)=>{const{itemWidth:M,itemHeight:E}=a0(i,n,o,b,s);S>0&&m+E+2*a>u&&(h+=f+a,c.push({width:f,height:m}),p+=f+a,y++,f=m=0),l[S]={left:p,top:m,col:y,width:M,height:E},f=Math.max(f,M),m+=E+a}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=pi(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ie(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=ie(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.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;ts(t,this),this._draw(),es(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Et.color,l=pi(t.rtl,this.left,this.width),c=Pt(r.font),{padding:u}=r,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:p,boxHeight:y,itemHeight:b}=id(r,h),S=function(A,O,x){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const _=at(x.lineWidth,1);if(s.fillStyle=at(x.fillStyle,a),s.lineCap=at(x.lineCap,"butt"),s.lineDashOffset=at(x.lineDashOffset,0),s.lineJoin=at(x.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=at(x.strokeStyle,a),s.setLineDash(at(x.lineDash,[])),r.usePointStyle){const T={radius:y*Math.SQRT2/2,pointStyle:x.pointStyle,rotation:x.rotation,borderWidth:_},k=l.xPlus(A,p/2),I=O+f;Ec(s,T,k,I,r.pointStyleWidth&&p)}else{const T=O+Math.max((h-y)/2,0),k=l.leftForLtr(A,p),I=yn(x.borderRadius);s.beginPath(),Object.values(I).some(Y=>Y!==0)?hi(s,{x:k,y:T,w:p,h:y,radius:I}):s.rect(k,T,p,y),s.fill(),_!==0&&s.stroke()}s.restore()},M=function(A,O,x){Bn(s,x.text,A,O+b/2,c,{strikethrough:x.hidden,textAlign:l.textAlign(x.textAlign)})},E=this.isHorizontal(),D=this._computeTitleHeight();E?m={x:ie(o,this.left+u,this.right-i[0]),y:this.top+u+D,line:0}:m={x:this.left+u,y:ie(o,this.top+D+u,this.bottom-n[0].height),line:0},Vc(this.ctx,t.textDirection);const C=b+u;this.legendItems.forEach((A,O)=>{s.strokeStyle=A.fontColor,s.fillStyle=A.fontColor;const x=s.measureText(A.text).width,_=l.textAlign(A.textAlign||(A.textAlign=r.textAlign)),T=p+f+x;let k=m.x,I=m.y;l.setWidth(this.width),E?O>0&&k+T+u>this.right&&(I=m.y+=C,m.line++,k=m.x=ie(o,this.left+u,this.right-i[m.line])):O>0&&I+C>this.bottom&&(k=m.x=k+n[m.line].width+u,m.line++,I=m.y=ie(o,this.top+D+u,this.bottom-n[m.line].height));const Y=l.x(k);if(S(Y,I,A),k=wp(_,k+p+f,E?k+T:this.right,t.rtl),M(l.x(k),I,A),E)m.x+=T+u;else if(typeof A.text!="string"){const U=c.lineHeight;m.y+=od(A,U)+u}else m.y+=C}),Wc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=Pt(n.font),s=Wt(n.padding);if(!n.display)return;const o=pi(t.rtl,this.left,this.width),r=this.ctx,a=n.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=ie(t.align,h,this.right-f);else{const p=this.columnSizes.reduce((y,b)=>Math.max(y,b.height),0);u=c+ie(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=ie(a,h,h+f);r.textAlign=o.textAlign(Pr(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,Bn(r,n.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,n=Pt(t.font),i=Wt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Xe(t,this.left,this.right)&&Xe(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Xe(t,s.left,s.left+s.width)&&Xe(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!u0(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=r0(s,i);s&&!o&&wt(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&wt(n.onHover,[t,i,this],this)}else i&&wt(n.onClick,[t,i,this],this)}}function a0(e,t,n,i,s){const o=l0(i,e,t,n),r=c0(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function l0(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+n.size/2+i.measureText(s).width}function c0(e,t,n){let i=e;return typeof t.text!="string"&&(i=od(t,n)),i}function od(e,t){const n=e.text?e.text.length:0;return t*n}function u0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var d0={id:"legend",_element:sd,start(e,t,n){const i=e.legend=new sd({ctx:e.ctx,options:n,chart:e});se.configure(e,i,n),se.addBox(e,i)},stop(e){se.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;se.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,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.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:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Wt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,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:r&&(a||c.borderRadius),datasetIndex:l.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 ua extends oe{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 s=xt(i.text)?i.text.length:1;this._padding=Wt(i.padding);const o=s*Pt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,u,h;return this.isHorizontal()?(u=ie(a,i,o),h=n+t,c=o-i):(r.position==="left"?(u=i+t,h=ie(a,s,n),l=dt*-.5):(u=o-t,h=ie(a,n,s),l=dt*.5),c=s-n),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=Pt(n.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Bn(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Pr(n.align),textBaseline:"middle",translation:[r,a]})}}function h0(e,t){const n=new ua({ctx:e.ctx,options:t,chart:e});se.configure(e,n,t),se.addBox(e,n),e.titleBlock=n}var f0={id:"title",_element:ua,start(e,t,n){h0(e,n)},stop(e){const t=e.titleBlock;se.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;se.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 vo=new WeakMap;var m0={id:"subtitle",start(e,t,n){const i=new ua({ctx:e.ctx,options:n,chart:e});se.configure(e,i,n),se.addBox(e,i),vo.set(e,i)},stop(e){se.removeBox(e,vo.get(e)),vo.delete(e)},beforeUpdate(e,t,n){const i=vo.get(e);se.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 hs={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=di(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function He(e,t){return t&&(xt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function tn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
2
2
  `)>-1?e.split(`
3
- `):e}function p0(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function rd(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=Pt(t.bodyFont),c=Pt(t.titleFont),u=Pt(t.footerFont),h=o.length,f=s.length,m=i.length,p=Wt(t.padding);let y=p.height,b=0,S=i.reduce((D,C)=>D+C.before.length+C.lines.length+C.after.length,0);if(S+=e.beforeBody.length+e.afterBody.length,h&&(y+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),S){const D=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=m*D+(S-m)*l.lineHeight+(S-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const E=function(D){b=Math.max(b,n.measureText(D).width+M)};return n.save(),n.font=c.string,St(e.title,E),n.font=l.string,St(e.beforeBody.concat(e.afterBody),E),M=t.displayColors?r+2+t.boxPadding:0,St(i,D=>{St(D.before,E),St(D.lines,E),St(D.after,E)}),M=0,n.font=u.string,St(e.footer,E),n.restore(),b+=p.width,{width:b,height:y}}function g0(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function y0(e,t,n,i){const{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function b0(e,t,n,i){const{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),y0(c,e,t,n)&&(c="center"),c}function ad(e,t,n){const i=n.yAlign||t.yAlign||g0(e,n);return{xAlign:n.xAlign||t.xAlign||b0(e,t,n,i),yAlign:i}}function _0(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function x0(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function ld(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=yn(r);let p=_0(t,a);const y=x0(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(h,m)+s),{x:Kt(p,0,i.width-t.width),y:Kt(y,0,i.height-t.height)}}function Mo(e,t,n){const i=Wt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function cd(e){return He([],tn(e))}function w0(e,t,n){return bn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function ud(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const dd={beforeTitle:Ke,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:Ke,beforeBody:Ke,beforeLabel:Ke,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 rt(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:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function ge(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?dd[t].call(n,i):s}class hd extends oe{static positioners=hs;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()),s=i.enabled&&n.options.animation&&i.animations,o=new Yr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=w0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=ge(i,"beforeTitle",this,t),o=ge(i,"title",this,t),r=ge(i,"afterTitle",this,t);let a=[];return a=He(a,tn(s)),a=He(a,tn(o)),a=He(a,tn(r)),a}getBeforeBody(t,n){return cd(ge(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return St(t,o=>{const r={before:[],lines:[],after:[]},a=ud(i,o);He(r.before,tn(ge(a,"beforeLabel",this,o))),He(r.lines,ge(a,"label",this,o)),He(r.after,tn(ge(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return cd(ge(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=ge(i,"beforeFooter",this,t),o=ge(i,"footer",this,t),r=ge(i,"afterFooter",this,t);let a=[];return a=He(a,tn(s)),a=He(a,tn(o)),a=He(a,tn(r)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(p0(this.chart,n[l]));return t.filter&&(a=a.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,i))),St(a,u=>{const h=ud(t.callbacks,u);s.push(ge(h,"labelColor",this,u)),o.push(ge(h,"labelPointStyle",this,u)),r.push(ge(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=hs[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=rd(this,i),c=Object.assign({},a,l),u=ad(this.chart,i,c),h=ld(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=yn(a),{x:f,y:m}=t,{width:p,height:y}=n;let b,S,M,E,D,C;return o==="center"?(D=m+y/2,s==="left"?(b=f,S=b-r,E=D+r,C=D-r):(b=f+p,S=b+r,E=D-r,C=D+r),M=b):(s==="left"?S=f+Math.max(l,u)+r:s==="right"?S=f+p-Math.max(c,h)-r:S=this.caretX,o==="top"?(E=m,D=E-r,b=S-r,M=S+r):(E=m+y,D=E+r,b=S+r,M=S-r),C=E),{x1:b,x2:S,x3:M,y1:E,y2:D,y3:C}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=mi(i.rtl,this.x,this.width);for(t.x=Mo(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=Pt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,s,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=Pt(o.bodyFont),h=Mo(this,"left",o),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+m;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,S=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Br(t,y,b,S),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Br(t,y,b,S)}else{t.lineWidth=ft(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const y=s.leftForLtr(f,c),b=s.leftForLtr(s.xPlus(f,1),c-2),S=yn(r.borderRadius);Object.values(S).some(M=>M!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,di(t,{x:y,y:p,w:c,h:l,radius:S}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),di(t,{x:b,y:p+1,w:c-2,h:l-2,radius:S}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=Pt(i.bodyFont);let f=h.lineHeight,m=0;const p=mi(i.rtl,this.x,this.width),y=function(x){n.fillText(x,p.x(t.x+m),t.y+f/2),t.y+=f+o},b=p.textAlign(r);let S,M,E,D,C,A,O;for(n.textAlign=r,n.textBaseline="middle",n.font=h.string,t.x=Mo(this,b,i),n.fillStyle=i.bodyColor,St(this.beforeBody,y),m=a&&b!=="right"?r==="center"?c/2+u:c+2+u:0,D=0,A=s.length;D<A;++D){for(S=s[D],M=this.labelTextColors[D],n.fillStyle=M,St(S.before,y),E=S.lines,a&&E.length&&(this._drawColorBox(n,t,D,p,i),f=Math.max(h.lineHeight,l)),C=0,O=E.length;C<O;++C)y(E[C]),f=h.lineHeight;St(S.after,y)}m=0,f=h.lineHeight,St(this.afterBody,y),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let r,a;if(o){const l=mi(i.rtl,this.x,this.width);for(t.x=Mo(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=Pt(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=yn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+h,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-p),n.quadraticCurveTo(a+c,l+u,a+c-p,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+m,l+u),n.quadraticCurveTo(a,l+u,a,l+u-m),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+h),n.quadraticCurveTo(a,l,a+h,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=hs[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=rd(this,t),l=Object.assign({},r,this._size),c=ad(n,t,l),u=ld(t,l,c,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.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 s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Wt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),Vc(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Wc(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!to(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!to(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,r=hs[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}var Me={id:"tooltip",_element:hd,positioners:hs,afterInit(e,t,n){n&&(e.tooltip=new hd({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:dd},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"]},S0=Object.freeze({__proto__:null,Colors:Lb,Decimation:zb,Filler:o0,Legend:d0,SubTitle:m0,Title:f0,Tooltip:Me});const T0=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function v0(e,t,n,i){const s=e.indexOf(t);if(s===-1)return T0(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const M0=(e,t)=>e===null?null:Kt(Math.round(e),0,t);function fd(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class k0 extends Vn{static id="category";static defaults={ticks:{callback:fd}};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:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(rt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:v0(i,t,at(n,t),this._addedLabels),M0(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=n;r++)s.push({value:r});return s}getLabelForValue(t){return fd.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}}function D0(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=e,m=o||1,p=u-1,{min:y,max:b}=t,S=!rt(r),M=!rt(a),E=!rt(c),D=(b-y)/(h+1);let C=pc((b-y)/p/m)*m,A,O,x,_;if(C<1e-14&&!S&&!M)return[{value:y},{value:b}];_=Math.ceil(b/C)-Math.floor(y/C),_>p&&(C=pc(_*C/p/m)*m),rt(l)||(A=Math.pow(10,l),C=Math.ceil(C*A)/A),s==="ticks"?(O=Math.floor(y/C)*C,x=Math.ceil(b/C)*C):(O=y,x=b),S&&M&&o&&mp((a-r)/o,C/1e3)?(_=Math.round(Math.min((a-r)/C,u)),C=(a-r)/_,O=r,x=a):E?(O=S?r:O,x=M?a:x,_=c-1,C=(x-O)/_):(_=(x-O)/C,Ki(_,Math.round(_),C/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(yc(C),yc(O));A=Math.pow(10,rt(l)?T:l),O=Math.round(O*A)/A,x=Math.round(x*A)/A;let k=0;for(S&&(f&&O!==r?(n.push({value:r}),O<r&&k++,Ki(Math.round((O+k*C)*A)/A,r,md(r,D,e))&&k++):O<r&&k++);k<_;++k){const I=Math.round((O+k*C)*A)/A;if(M&&I>a)break;n.push({value:I})}return M&&f&&x!==a?n.length&&Ki(n[n.length-1].value,a,md(a,D,e))?n[n.length-1].value=a:n.push({value:a}):(!M||x===a)&&n.push({value:x}),n}function md(e,t,{horizontal:n,minRotation:i}){const s=Vt(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class ko extends Vn{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 rt(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:s,max:o}=this;const r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){const l=ze(s),c=ze(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,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(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=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:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=D0(s,o);return t.bounds==="ticks"&&gc(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return Qi(t,this.chart.options.locale,this.options.ticks.format)}}class C0 extends ko{static id="linear";static defaults={ticks:{callback:ao.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Vt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.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}}const fs=e=>Math.floor(pn(e)),Wn=(e,t)=>Math.pow(10,fs(e)+t);function pd(e){return e/Math.pow(10,fs(e))===1}function gd(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function O0(e,t){const n=t-e;let i=fs(n);for(;gd(e,t,i)>10;)i++;for(;gd(e,t,i)<10;)i--;return Math.min(i,fs(e))}function E0(e,{min:t,max:n}){t=ve(e.min,t);const i=[],s=fs(t);let o=O0(t,n),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((c-u)/Math.pow(10,o)),f=ve(e.min,Math.round((l+u+h*Math.pow(10,o))*r)/r);for(;f<n;)i.push({value:f,major:pd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),f=Math.round((l+u+h*Math.pow(10,o))*r)/r;const m=ve(e.max,f);return i.push({value:m,major:pd(m),significand:h}),i}class A0 extends Vn{static id="logarithmic";static defaults={ticks:{callback:ao.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=ko.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===Wn(this.min,0)?Wn(this.min,-1):Wn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Wn(i,-1)),r(Wn(s,1)))),i<=0&&o(Wn(s,-1)),s<=0&&r(Wn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=E0(n,this);return t.bounds==="ticks"&&gc(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":Qi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=pn(t),this._valueRange=pn(this.max)-pn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(pn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function da(e){const t=e.ticks;if(t.display&&e.display){const n=Wt(t.backdropPadding);return at(t.font&&t.font.size,Et.font.size)+n.height}return 0}function P0(e,t,n){return n=xt(n)?n:[n],{w:Ap(e,t.string,n),h:n.length*t.lineHeight}}function yd(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function R0(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=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?dt/o:0;for(let l=0;l<o;l++){const c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+s[l],a),h=Pt(c.font),f=P0(e.ctx,h,e._pointLabels[l]);i[l]=f;const m=ne(e.getIndexAngle(l)+a),p=Math.round(so(m)),y=yd(p,u.x,f.w,0,180),b=yd(p,u.y,f.h,90,270);I0(n,t,m,y,b)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=F0(e,i,s)}function I0(e,t,n,i,s){const o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function L0(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=n,l=e.getPointPosition(t,i+s+r,o),c=Math.round(so(ne(l.angle+Ot))),u=U0(l.y,a.h,c),h=B0(c),f=z0(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+a.w,bottom:u+a.h}}function N0(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:o}=e;return!(Qe({x:n,y:i},t)||Qe({x:n,y:o},t)||Qe({x:s,y:i},t)||Qe({x:s,y:o},t))}function F0(e,t,n){const i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:da(o)/2,additionalAngle:r?dt/s:0};let c;for(let u=0;u<s;u++){l.padding=n[u],l.size=t[u];const h=L0(e,u,l);i.push(h),a==="auto"&&(h.visible=N0(h,c),h.visible&&(c=h))}return i}function B0(e){return e===0||e===180?"center":e<180?"left":"right"}function z0(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function U0(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function H0(e,t,n){const{left:i,top:s,right:o,bottom:r}=n,{backdropColor:a}=t;if(!rt(a)){const l=yn(t.borderRadius),c=Wt(t.backdropPadding);e.fillStyle=a;const u=i-c.left,h=s-c.top,f=o-i+c.width,m=r-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),di(e,{x:u,y:h,w:f,h:m,radius:l}),e.fill()):e.fillRect(u,h,f,m)}}function V0(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(e.getPointLabelContext(s));H0(n,r,o);const a=Pt(r.font),{x:l,y:c,textAlign:u}=o;Bn(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function bd(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Dt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function W0(e,t,n,i,s){const o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),bd(e,n,r,i),o.closePath(),o.stroke(),o.restore())}function $0(e,t,n){return bn(e,{label:n,index:t,type:"pointLabel"})}class Y0 extends ko{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ao.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=Wt(da(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=At(t)&&!isNaN(t)?t:0,this.max=At(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/da(this.options))}generateTickLabels(t){ko.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const s=wt(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?R0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Dt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ne(t*n+Vt(i))}getDistanceFromCenterForValue(t){if(rt(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(rt(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 $0(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const s=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}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:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),bd(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:s,border:o}=n,r=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&V0(this,r),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),p=o.setContext(f);W0(this,m,l,r,p)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=Pt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const h=Wt(c.backdropPadding);t.fillRect(-r/2-h.left,-o-u.size/2-h.top,r+h.width,u.size+h.height)}Bn(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Do={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ye=Object.keys(Do);function _d(e,t){return e-t}function xd(e,t){if(rt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),At(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(gn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function wd(e,t,n,i){const s=ye.length;for(let o=ye.indexOf(e);o<s-1;++o){const r=Do[ye[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return ye[o]}return ye[s-1]}function j0(e,t,n,i,s){for(let o=ye.length-1;o>=ye.indexOf(n);o--){const r=ye[o];if(Do[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return ye[n?ye.indexOf(n):0]}function q0(e){for(let t=ye.indexOf(e)+1,n=ye.length;t<n;++t)if(Do[ye[t]].common)return ye[t]}function Sd(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=Ar(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function G0(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function Td(e,t,n){const i=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!n?i:G0(e,i,s,n)}class ha extends Vn{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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={}),s=this._adapter=new du._date(t.adapters.date);s.init(n),Gi(i.displayFormats,s.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:xd(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:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=At(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=At(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_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,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 o=this.min,r=this.max,a=bp(s,o,r);return this._unit=n.unit||(i.autoSkip?wd(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):j0(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:q0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Td(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;n=Kt(n,0,r),i=Kt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||wd(o.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=gn(l)||l===!0,u={};let h=n,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":r),t.diff(i,n,r)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+r);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,a,r),m++)Sd(u,f,p);return(f===i||s.bounds==="ticks"||m===1)&&Sd(u,f,p),Object.keys(u).sort(_d).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 s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return wt(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],f=i[n],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.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,s=Vt(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Td(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,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(n=0,i=s.length;n<i;++n)t=t.concat(s[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 s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(xd(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return xc(t.sort(_d))}}function Co(e,t,n){let i=0,s=e.length-1,o,r,a,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Ze(e,"pos",t)),{pos:o,time:a}=e[i],{pos:r,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Ze(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class K0 extends ha{static id="timeseries";static defaults=ha.defaults;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=Co(n,this.min),this._tableRange=Co(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_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((s,o)=>s-o)}_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(Co(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Co(this._table,i*this._tableRange+this._minPos,!0)}}var X0=Object.freeze({__proto__:null,CategoryScale:k0,LinearScale:C0,LogarithmicScale:A0,RadialLinearScale:Y0,TimeScale:ha,TimeSeriesScale:K0});const Z0=[Zg,Cb,S0,X0],vd=6048e5,Q0=864e5,ms=6e4,gi=36e5,J0=1e3,Md=Symbol.for("constructDateFrom");function It(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Md in e?e[Md](t):e instanceof Date?new e.constructor(t):new Date(t)}function ut(e,t){return It(t||e,e)}function Oo(e,t,n){const i=ut(e,n?.in);return isNaN(t)?It(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function fa(e,t,n){const i=ut(e,n?.in);if(isNaN(t))return It(e,NaN);if(!t)return i;const s=i.getDate(),o=It(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function ma(e,t,n){return It(e,+ut(e)+t)}function t_(e,t,n){return ma(e,t*gi)}let e_={};function $n(){return e_}function Ve(e,t){const n=$n(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ut(e,t?.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function yi(e,t){return Ve(e,{...t,weekStartsOn:1})}function kd(e,t){const n=ut(e,t?.in),i=n.getFullYear(),s=It(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=yi(s),r=It(n,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const a=yi(r);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Eo(e){const t=ut(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 Yn(e,...t){const n=It.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function pa(e,t){const n=ut(e,t?.in);return n.setHours(0,0,0,0),n}function Dd(e,t,n){const[i,s]=Yn(n?.in,e,t),o=pa(i),r=pa(s),a=+o-Eo(o),l=+r-Eo(r);return Math.round((a-l)/Q0)}function n_(e,t){const n=kd(e,t),i=It(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),yi(i)}function i_(e,t,n){const i=ut(e,n?.in);return i.setTime(i.getTime()+t*ms),i}function s_(e,t,n){return fa(e,t*3,n)}function o_(e,t,n){return ma(e,t*1e3)}function r_(e,t,n){return Oo(e,t*7,n)}function a_(e,t,n){return fa(e,t*12,n)}function ps(e,t){const n=+ut(e)-+ut(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 ga(e){return!(!l_(e)&&typeof e!="number"||isNaN(+ut(e)))}function c_(e,t,n){const[i,s]=Yn(n?.in,e,t),o=i.getFullYear()-s.getFullYear(),r=i.getMonth()-s.getMonth();return o*12+r}function u_(e,t,n){const[i,s]=Yn(n?.in,e,t);return i.getFullYear()-s.getFullYear()}function Cd(e,t,n){const[i,s]=Yn(n?.in,e,t),o=Od(i,s),r=Math.abs(Dd(i,s));i.setDate(i.getDate()-o*r);const a=+(Od(i,s)===-o),l=o*(r-a);return l===0?0:l}function Od(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 gs(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function d_(e,t,n){const[i,s]=Yn(n?.in,e,t),o=(+i-+s)/gi;return gs(n?.roundingMethod)(o)}function ya(e,t){return+ut(e)-+ut(t)}function h_(e,t,n){const i=ya(e,t)/ms;return gs(n?.roundingMethod)(i)}function Ed(e,t){const n=ut(e,t?.in);return n.setHours(23,59,59,999),n}function Ad(e,t){const n=ut(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function f_(e,t){const n=ut(e,t?.in);return+Ed(n,t)==+Ad(n,t)}function Pd(e,t,n){const[i,s,o]=Yn(n?.in,e,e,t),r=ps(s,o),a=Math.abs(c_(s,o));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-r*a);let l=ps(s,o)===-r;f_(i)&&a===1&&ps(i,o)===1&&(l=!1);const c=r*(a-+l);return c===0?0:c}function m_(e,t,n){const i=Pd(e,t,n)/3;return gs(n?.roundingMethod)(i)}function p_(e,t,n){const i=ya(e,t)/1e3;return gs(n?.roundingMethod)(i)}function g_(e,t,n){const i=Cd(e,t,n)/7;return gs(n?.roundingMethod)(i)}function y_(e,t,n){const[i,s]=Yn(n?.in,e,t),o=ps(i,s),r=Math.abs(u_(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-o,l=o*(r-+a);return l===0?0:l}function b_(e,t){const n=ut(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function __(e,t){const n=ut(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function x_(e,t){const n=ut(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function Rd(e,t){const n=ut(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function w_(e,t){const n=ut(e,t?.in);return n.setMinutes(59,59,999),n}function S_(e,t){const n=$n(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ut(e,t?.in),o=s.getDay(),r=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+r),s.setHours(23,59,59,999),s}function T_(e,t){const n=ut(e,t?.in);return n.setSeconds(59,999),n}function v_(e,t){const n=ut(e,t?.in),i=n.getMonth(),s=i-i%3+3;return n.setMonth(s,0),n.setHours(23,59,59,999),n}function M_(e,t){const n=ut(e,t?.in);return n.setMilliseconds(999),n}const k_={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"}},D_=(e,t,n)=>{let i;const s=k_[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function ba(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const C_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},O_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},E_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},A_={date:ba({formats:C_,defaultWidth:"full"}),time:ba({formats:O_,defaultWidth:"full"}),dateTime:ba({formats:E_,defaultWidth:"full"})},P_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},R_=(e,t,n,i)=>P_[e];function ys(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const r=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):r;s=e.formattingValues[a]||e.formattingValues[r]}else{const r=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[r]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const I_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},L_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},N_={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"]},F_={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"]},B_={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"}},z_={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"}},U_={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:ys({values:I_,defaultWidth:"wide"}),quarter:ys({values:L_,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ys({values:N_,defaultWidth:"wide"}),day:ys({values:F_,defaultWidth:"wide"}),dayPeriod:ys({values:B_,defaultWidth:"wide",formattingValues:z_,defaultFormattingWidth:"wide"})};function bs(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],a=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?V_(a,h=>h.test(r)):H_(a,h=>h.test(r));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(r.length);return{value:c,rest:u}}}function H_(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function V_(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function W_(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let r=e.valueCallback?e.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;const a=t.slice(s.length);return{value:r,rest:a}}}const $_=/^(\d+)(th|st|nd|rd)?/i,Y_=/\d+/i,j_={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},q_={any:[/^b/i,/^(a|c)/i]},G_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},K_={any:[/1/i,/2/i,/3/i,/4/i]},X_={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},Z_={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]},Q_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},J_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},tx={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},ex={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}},nx={ordinalNumber:W_({matchPattern:$_,parsePattern:Y_,valueCallback:e=>parseInt(e,10)}),era:bs({matchPatterns:j_,defaultMatchWidth:"wide",parsePatterns:q_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:G_,defaultMatchWidth:"wide",parsePatterns:K_,defaultParseWidth:"any",valueCallback:e=>e+1}),month:bs({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:Z_,defaultParseWidth:"any"}),day:bs({matchPatterns:Q_,defaultMatchWidth:"wide",parsePatterns:J_,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:tx,defaultMatchWidth:"any",parsePatterns:ex,defaultParseWidth:"any"})},Id={code:"en-US",formatDistance:D_,formatLong:A_,formatRelative:R_,localize:U_,match:nx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ix(e,t){const n=ut(e,t?.in);return Dd(n,Rd(n))+1}function Ld(e,t){const n=ut(e,t?.in),i=+yi(n)-+n_(n);return Math.round(i/vd)+1}function _a(e,t){const n=ut(e,t?.in),i=n.getFullYear(),s=$n(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,r=It(t?.in||e,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=Ve(r,t),l=It(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=Ve(l,t);return+n>=+a?i+1:+n>=+c?i:i-1}function sx(e,t){const n=$n(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=_a(e,t),o=It(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),Ve(o,t)}function Nd(e,t){const n=ut(e,t?.in),i=+Ve(n,t)-+sx(n,t);return Math.round(i/vd)+1}function Tt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Tn={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];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(),s=Math.trunc(i*Math.pow(10,n-3));return Tt(s,t.length)}},bi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fd={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"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Tn.y(e,t)},Y:function(e,t,n,i){const s=_a(e,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return Tt(r,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Tt(o,t.length)},R:function(e,t){const n=kd(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"});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"});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 Tn.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"});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"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Nd(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(e,t,n){const i=Ld(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"}):Tn.d(e,t)},D:function(e,t,n){const i=ix(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"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Tt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Tt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return n.ordinalNumber(s,{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"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=bi.noon:i===0?s=bi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=bi.evening:i>=12?s=bi.afternoon:i>=4?s=bi.morning:s=bi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{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 Tn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Tn.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"}):Tn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Tn.s(e,t)},S:function(e,t){return Tn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return zd(i);case"XXXX":case"XX":return jn(i);default:return jn(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return zd(i);case"xxxx":case"xx":return jn(i);default:return jn(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Bd(i,":");default:return"GMT"+jn(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Bd(i,":");default:return"GMT"+jn(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 Bd(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Tt(o,2)}function zd(e,t){return e%60===0?(e>0?"-":"+")+Tt(Math.abs(e)/60,2):jn(e,t)}function jn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Tt(Math.trunc(i/60),2),o=Tt(i%60,2);return n+s+t+o}const Ud=(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"});default:return t.date({width:"full"})}},Hd=(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"});default:return t.time({width:"full"})}},xa={p:Hd,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ud(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Ud(i,t)).replace("{{time}}",Hd(s,t))}},ox=/^D+$/,rx=/^Y+$/,ax=["D","DD","YY","YYYY"];function Vd(e){return ox.test(e)}function Wd(e){return rx.test(e)}function wa(e,t,n){const i=lx(e,t,n);if(console.warn(i),ax.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 cx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ux=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dx=/^'([^]*?)'?$/,hx=/''/g,fx=/[a-zA-Z]/;function Ao(e,t,n){const i=$n(),s=n?.locale??i.locale??Id,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=ut(e,n?.in);if(!ga(a))throw new RangeError("Invalid time value");let l=t.match(ux).map(u=>{const h=u[0];if(h==="p"||h==="P"){const f=xa[h];return f(u,s.formatLong)}return u}).join("").match(cx).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const h=u[0];if(h==="'")return{isToken:!1,value:mx(u)};if(Fd[h])return{isToken:!0,value:u};if(h.match(fx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:u}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(u=>{if(!u.isToken)return u.value;const h=u.value;(!n?.useAdditionalWeekYearTokens&&Wd(h)||!n?.useAdditionalDayOfYearTokens&&Vd(h))&&wa(h,t,String(e));const f=Fd[h[0]];return f(a,h,s.localize,c)}).join("")}function mx(e){const t=e.match(dx);return t?t[1].replace(hx,"'"):e}function $d(){return Object.assign({},$n())}function px(e,t){const n=ut(e,t?.in).getDay();return n===0?7:n}function gx(e,t){const n=yx(t)?new t(0):It(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){return typeof e=="function"&&e.prototype?.constructor===e}const bx=10;class Yd{subPriority=0;validate(t,n){return!0}}class _x extends Yd{constructor(t,n,i,s,o){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=s,o&&(this.subPriority=o)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class xx extends Yd{priority=bx;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>It(n,i))}set(t,n){return n.timestampIsSet?t:It(t,gx(t,this.context))}}class _t{run(t,n,i,s){const o=this.parse(t,n,i,s);return o?{setter:new _x(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,i){return!0}}class wx extends _t{priority=140;parse(t,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,n,i){return n.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const zt={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}/},We={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 Ut(e,t){return e&&{value:t(e.value),rest:e.rest}}function Rt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function $e(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,s=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,r=n[5]?parseInt(n[5],10):0;return{value:i*(s*gi+o*ms+r*J0),rest:t.slice(n[0].length)}}function jd(e){return Rt(zt.anyDigitsSigned,e)}function Lt(e,t){switch(e){case 1:return Rt(zt.singleDigit,t);case 2:return Rt(zt.twoDigits,t);case 3:return Rt(zt.threeDigits,t);case 4:return Rt(zt.fourDigits,t);default:return Rt(new RegExp("^\\d{1,"+e+"}"),t)}}function Po(e,t){switch(e){case 1:return Rt(zt.singleDigitSigned,t);case 2:return Rt(zt.twoDigitsSigned,t);case 3:return Rt(zt.threeDigitsSigned,t);case 4:return Rt(zt.fourDigitsSigned,t);default:return Rt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Sa(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function qd(e,t){const n=t>0,i=n?t:1-t;let s;if(i<=50)s=e||100;else{const o=i+50,r=Math.trunc(o/100)*100,a=e>=o%100;s=e+r-(a?100:0)}return n?s:1-s}function Gd(e){return e%400===0||e%4===0&&e%100!==0}class Sx extends _t{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Ut(Lt(4,t),s);case"yo":return Ut(i.ordinalNumber(t,{unit:"year"}),s);default:return Ut(Lt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i){const s=t.getFullYear();if(i.isTwoDigitYear){const r=qd(i.year,s);return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Tx extends _t{priority=130;parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Ut(Lt(4,t),s);case"Yo":return Ut(i.ordinalNumber(t,{unit:"year"}),s);default:return Ut(Lt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i,s){const o=_a(t,s);if(i.isTwoDigitYear){const a=qd(i.year,o);return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Ve(t,s)}const r=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(r,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Ve(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class vx extends _t{priority=130;parse(t,n){return Po(n==="R"?4:n.length,t)}set(t,n,i){const s=It(t,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),yi(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class Mx extends _t{priority=130;parse(t,n){return Po(n==="u"?4:n.length,t)}set(t,n,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class kx extends _t{priority=120;parse(t,n,i){switch(n){case"Q":case"QQ":return Lt(n.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Dx extends _t{priority=120;parse(t,n,i){switch(n){case"q":case"qq":return Lt(n.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Cx extends _t{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"M":return Ut(Rt(zt.month,t),s);case"MM":return Ut(Lt(2,t),s);case"Mo":return Ut(i.ordinalNumber(t,{unit:"month"}),s);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class Ox extends _t{priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"L":return Ut(Rt(zt.month,t),s);case"LL":return Ut(Lt(2,t),s);case"Lo":return Ut(i.ordinalNumber(t,{unit:"month"}),s);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Ex(e,t,n){const i=ut(e,n?.in),s=Nd(i,n)-t;return i.setDate(i.getDate()-s*7),ut(i,n?.in)}class Ax extends _t{priority=100;parse(t,n,i){switch(n){case"w":return Rt(zt.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i,s){return Ve(Ex(t,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Px(e,t,n){const i=ut(e,n?.in),s=Ld(i,n)-t;return i.setDate(i.getDate()-s*7),i}class Rx extends _t{priority=100;parse(t,n,i){switch(n){case"I":return Rt(zt.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i){return yi(Px(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Ix=[31,28,31,30,31,30,31,31,30,31,30,31],Lx=[31,29,31,30,31,30,31,31,30,31,30,31];class Nx extends _t{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return Rt(zt.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return Lt(n.length,t)}}validate(t,n){const i=t.getFullYear(),s=Gd(i),o=t.getMonth();return s?n>=1&&n<=Lx[o]:n>=1&&n<=Ix[o]}set(t,n,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Fx extends _t{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return Rt(zt.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return Lt(n.length,t)}}validate(t,n){const i=t.getFullYear();return Gd(i)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Ta(e,t,n){const i=$n(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=ut(e,n?.in),r=o.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(r+c)%7:(l+c)%7-(r+c)%7;return Oo(o,u,n)}class Bx extends _t{priority=90;parse(t,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=Ta(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class zx extends _t{priority=90;parse(t,n,i,s){const o=r=>{const a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(n){case"e":case"ee":return Ut(Lt(n.length,t),o);case"eo":return Ut(i.ordinalNumber(t,{unit:"day"}),o);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=Ta(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Ux extends _t{priority=90;parse(t,n,i,s){const o=r=>{const a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(n){case"c":case"cc":return Ut(Lt(n.length,t),o);case"co":return Ut(i.ordinalNumber(t,{unit:"day"}),o);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=Ta(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Hx(e,t,n){const i=ut(e,n?.in),s=px(i,n),o=t-s;return Oo(i,o,n)}class Vx extends _t{priority=90;parse(t,n,i){const s=o=>o===0?7:o;switch(n){case"i":case"ii":return Lt(n.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return Ut(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return Ut(i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Ut(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);default:return Ut(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,n){return n>=1&&n<=7}set(t,n,i){return t=Hx(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Wx extends _t{priority=80;parse(t,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Sa(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class $x extends _t{priority=80;parse(t,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Sa(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class Yx extends _t{priority=80;parse(t,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Sa(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class jx extends _t{priority=70;parse(t,n,i){switch(n){case"h":return Rt(zt.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,i){const s=t.getHours()>=12;return s&&i<12?t.setHours(i+12,0,0,0):!s&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class qx extends _t{priority=70;parse(t,n,i){switch(n){case"H":return Rt(zt.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Gx extends _t{priority=70;parse(t,n,i){switch(n){case"K":return Rt(zt.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Kx extends _t{priority=70;parse(t,n,i){switch(n){case"k":return Rt(zt.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,i){const s=i<=24?i%24:i;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class Xx extends _t{priority=60;parse(t,n,i){switch(n){case"m":return Rt(zt.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class Zx extends _t{priority=50;parse(t,n,i){switch(n){case"s":return Rt(zt.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class Qx extends _t{priority=30;parse(t,n){const i=s=>Math.trunc(s*Math.pow(10,-n.length+3));return Ut(Lt(n.length,t),i)}set(t,n,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class Jx extends _t{priority=10;parse(t,n){switch(n){case"X":return $e(We.basicOptionalMinutes,t);case"XX":return $e(We.basic,t);case"XXXX":return $e(We.basicOptionalSeconds,t);case"XXXXX":return $e(We.extendedOptionalSeconds,t);default:return $e(We.extended,t)}}set(t,n,i){return n.timestampIsSet?t:It(t,t.getTime()-Eo(t)-i)}incompatibleTokens=["t","T","x"]}class tw extends _t{priority=10;parse(t,n){switch(n){case"x":return $e(We.basicOptionalMinutes,t);case"xx":return $e(We.basic,t);case"xxxx":return $e(We.basicOptionalSeconds,t);case"xxxxx":return $e(We.extendedOptionalSeconds,t);default:return $e(We.extended,t)}}set(t,n,i){return n.timestampIsSet?t:It(t,t.getTime()-Eo(t)-i)}incompatibleTokens=["t","T","X"]}class ew extends _t{priority=40;parse(t){return jd(t)}set(t,n,i){return[It(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class nw extends _t{priority=20;parse(t){return jd(t)}set(t,n,i){return[It(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const iw={G:new wx,y:new Sx,Y:new Tx,R:new vx,u:new Mx,Q:new kx,q:new Dx,M:new Cx,L:new Ox,w:new Ax,I:new Rx,d:new Nx,D:new Fx,E:new Bx,e:new zx,c:new Ux,i:new Vx,a:new Wx,b:new $x,B:new Yx,h:new jx,H:new qx,K:new Gx,k:new Kx,m:new Xx,s:new Zx,S:new Qx,X:new Jx,x:new tw,t:new ew,T:new nw},sw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ow=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rw=/^'([^]*?)'?$/,aw=/''/g,lw=/\S/,cw=/[a-zA-Z]/;function uw(e,t,n,i){const s=()=>It(i?.in||n,NaN),o=$d(),r=i?.locale??o.locale??Id,a=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return e?s():ut(n,i?.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:r},u=[new xx(i?.in,n)],h=t.match(ow).map(b=>{const S=b[0];if(S in xa){const M=xa[S];return M(b,r.formatLong)}return b}).join("").match(sw),f=[];for(let b of h){!i?.useAdditionalWeekYearTokens&&Wd(b)&&wa(b,t,e),!i?.useAdditionalDayOfYearTokens&&Vd(b)&&wa(b,t,e);const S=b[0],M=iw[S];if(M){const{incompatibleTokens:E}=M;if(Array.isArray(E)){const C=f.find(A=>E.includes(A.token)||A.token===S);if(C)throw new RangeError(`The format string mustn't contain \`${C.fullToken}\` and \`${b}\` at the same time`)}else if(M.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);f.push({token:S,fullToken:b});const D=M.run(e,b,r.match,c);if(!D)return s();u.push(D.setter),e=D.rest}else{if(S.match(cw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");if(b==="''"?b="'":S==="'"&&(b=dw(b)),e.indexOf(b)===0)e=e.slice(b.length);else return s()}}if(e.length>0&&lw.test(e))return s();const m=u.map(b=>b.priority).sort((b,S)=>S-b).filter((b,S,M)=>M.indexOf(b)===S).map(b=>u.filter(S=>S.priority===b).sort((S,M)=>M.subPriority-S.subPriority)).map(b=>b[0]);let p=ut(n,i?.in);if(isNaN(+p))return s();const y={};for(const b of m){if(!b.validate(p,c))return s();const S=b.set(p,y,c);Array.isArray(S)?(p=S[0],Object.assign(y,S[1])):p=S}return p}function dw(e){return e.match(rw)[1].replace(aw,"'")}function hw(e,t){const n=ut(e,t?.in);return n.setMinutes(0,0,0),n}function fw(e,t){const n=ut(e,t?.in);return n.setSeconds(0,0),n}function mw(e,t){const n=ut(e,t?.in);return n.setMilliseconds(0),n}function pw(e){const t=e/gi;return Math.trunc(t)}function Kd(e,t){const n=()=>It(t?.in,NaN),i=t?.additionalDigits??2,s=_w(e);let o;if(s.date){const c=xw(s.date,i);o=ww(c.restDateString,c.year)}if(!o||isNaN(+o))return n();const r=+o;let a=0,l;if(s.time&&(a=Sw(s.time),isNaN(a)))return n();if(s.timezone){if(l=Tw(s.timezone),isNaN(l))return n()}else{const c=new Date(r+a),u=ut(0,t?.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return ut(r+a+l,t?.in)}const Ro={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},gw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,yw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,bw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function _w(e){const t={},n=e.split(Ro.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],Ro.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Ro.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const s=Ro.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function xw(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 s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((i[1]||i[2]).length)}}function ww(e,t){if(t===null)return new Date(NaN);const n=e.match(gw);if(!n)return new Date(NaN);const i=!!n[4],s=_s(n[1]),o=_s(n[2])-1,r=_s(n[3]),a=_s(n[4]),l=_s(n[5])-1;if(i)return Cw(t,a,l)?vw(t,a,l):new Date(NaN);{const c=new Date(0);return!kw(t,o,r)||!Dw(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,r)),c)}}function _s(e){return e?parseInt(e):1}function Sw(e){const t=e.match(yw);if(!t)return NaN;const n=va(t[1]),i=va(t[2]),s=va(t[3]);return Ow(n,i,s)?n*gi+i*ms+s*1e3:NaN}function va(e){return e&&parseFloat(e.replace(",","."))||0}function Tw(e){if(e==="Z")return 0;const t=e.match(bw);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Ew(i,s)?n*(i*gi+s*ms):NaN}function vw(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=(t-1)*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const Mw=[31,null,31,30,31,30,31,31,30,31,30,31];function Xd(e){return e%400===0||e%4===0&&e%100!==0}function kw(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Mw[t]||(Xd(e)?29:28))}function Dw(e,t){return t>=1&&t<=(Xd(e)?366:365)}function Cw(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Ow(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Ew(e,t){return t>=0&&t<=59}const Aw=1e3;var et=(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))(et||{});const Pw=["in","not_in","selector"],Rw=["empty","not_empty"],Iw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],_i=e=>e.filter(t=>t!=="time"),Zd=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Qd=_i(Zd),Lw=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Jd=[...Zd,"application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","consumer","consumer_group","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],th=_i(Jd),Nw=[...Lw,"response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],Fw=["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","principal"],eh=_i(Fw);_i(["a2a_context_id","a2a_error","a2a_method","a2a_task_id","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_detection_reason","bot_info_ja4_fingerprint","bot_info_ban_type","bot_info_header_names","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","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","portal","principal","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"]),_i(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","latencies_kong_internal_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]);const Bw=["platform","platform_usage"],zw=e=>Bw.includes(e),Uw=[...Jd,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],nh=_i(Uw);[...Nw],new Set(Qd),new Set(th),new Set(eh),new Set(nh);const ih=[{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"}];ih.map(e=>e.code);const Hw=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Pw},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Rw}},required:["field","operator"],additionalProperties:!1}]}}),Vw=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Hw([...new Set([...th,...Qd,...eh,...nh,...Vw])]);const Ww={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"}},$w=(e,t,n)=>{let i;const s=Ww[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Ma(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Yw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},jw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Gw={date:Ma({formats:Yw,defaultWidth:"full"}),time:Ma({formats:jw,defaultWidth:"full"}),dateTime:Ma({formats:qw,defaultWidth:"full"})},Kw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Xw=(e,t,n,i)=>Kw[e];function xs(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const r=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):r;s=e.formattingValues[a]||e.formattingValues[r]}else{const r=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[r]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const Zw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Qw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Jw={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"]},tS={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"]},eS={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"}},nS={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"}},iS=(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"},sS={ordinalNumber:iS,era:xs({values:Zw,defaultWidth:"wide"}),quarter:xs({values:Qw,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xs({values:Jw,defaultWidth:"wide"}),day:xs({values:tS,defaultWidth:"wide"}),dayPeriod:xs({values:eS,defaultWidth:"wide",formattingValues:nS,defaultFormattingWidth:"wide"})};function ws(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],a=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?rS(a,h=>h.test(r)):oS(a,h=>h.test(r));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(r.length);return{value:c,rest:u}}}function oS(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function rS(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function aS(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let r=e.valueCallback?e.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;const a=t.slice(s.length);return{value:r,rest:a}}}const lS=/^(\d+)(th|st|nd|rd)?/i,cS=/\d+/i,uS={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},dS={any:[/^b/i,/^(a|c)/i]},hS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fS={any:[/1/i,/2/i,/3/i,/4/i]},mS={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},pS={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]},gS={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},yS={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]},bS={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},_S={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}},xS={ordinalNumber:aS({matchPattern:lS,parsePattern:cS,valueCallback:e=>parseInt(e,10)}),era:ws({matchPatterns:uS,defaultMatchWidth:"wide",parsePatterns:dS,defaultParseWidth:"any"}),quarter:ws({matchPatterns:hS,defaultMatchWidth:"wide",parsePatterns:fS,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ws({matchPatterns:mS,defaultMatchWidth:"wide",parsePatterns:pS,defaultParseWidth:"any"}),day:ws({matchPatterns:gS,defaultMatchWidth:"wide",parsePatterns:yS,defaultParseWidth:"any"}),dayPeriod:ws({matchPatterns:bS,defaultMatchWidth:"any",parsePatterns:_S,defaultParseWidth:"any"})},wS={code:"en-US",formatDistance:$w,formatLong:Gw,formatRelative:Xw,localize:sS,match:xS,options:{weekStartsOn:0,firstWeekContainsDate:1}};let SS={};function Ss(){return SS}const sh=6048e5,TS=864e5,vS=60,MS=3600,oh=Symbol.for("constructDateFrom");function Oe(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&oh in e?e[oh](t):e instanceof Date?new e.constructor(t):new Date(t)}function re(e,t){return Oe(t||e,e)}function rh(e){const t=re(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 kS(e,...t){const n=Oe.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function xi(e,t){const n=re(e,t?.in);return n.setHours(0,0,0,0),n}function DS(e,t,n){const[i,s]=kS(n?.in,e,t),o=xi(i),r=xi(s),a=+o-rh(o),l=+r-rh(r);return Math.round((a-l)/TS)}function CS(e,t){const n=re(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function OS(e,t){const n=re(e,t?.in);return DS(n,CS(n))+1}function en(e,t){const n=Ss(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=re(e,t?.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function Io(e,t){return en(e,{...t,weekStartsOn:1})}function ah(e,t){const n=re(e,t?.in),i=n.getFullYear(),s=Oe(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Io(s),r=Oe(n,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const a=Io(r);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function ES(e,t){const n=ah(e,t),i=Oe(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Io(i)}function AS(e,t){const n=re(e,t?.in),i=+Io(n)-+ES(n);return Math.round(i/sh)+1}function lh(e,t){const n=re(e,t?.in),i=n.getFullYear(),s=Ss(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,r=Oe(t?.in||e,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=en(r,t),l=Oe(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=en(l,t);return+n>=+a?i+1:+n>=+c?i:i-1}function PS(e,t){const n=Ss(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=lh(e,t),o=Oe(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),en(o,t)}function RS(e,t){const n=re(e,t?.in),i=+en(n,t)-+PS(n,t);return Math.round(i/sh)+1}function vt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const vn={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return vt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):vt(n+1,2)},d(e,t){return vt(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];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return vt(e.getHours()%12||12,t.length)},H(e,t){return vt(e.getHours(),t.length)},m(e,t){return vt(e.getMinutes(),t.length)},s(e,t){return vt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return vt(s,t.length)}},wi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ch={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"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return vn.y(e,t)},Y:function(e,t,n,i){const s=lh(e,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return vt(r,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):vt(o,t.length)},R:function(e,t){const n=ah(e);return vt(n,t.length)},u:function(e,t){const n=e.getFullYear();return vt(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 vt(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"});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 vt(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"});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 vn.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"});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 vt(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"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=RS(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):vt(s,t.length)},I:function(e,t,n){const i=AS(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):vt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):vn.d(e,t)},D:function(e,t,n){const i=OS(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):vt(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"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return vt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return vt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return vt(s,t.length);case"io":return n.ordinalNumber(s,{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"});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"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.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 n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.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 n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{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 vn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):vn.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):vn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):vn.s(e,t)},S:function(e,t){return vn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return dh(i);case"XXXX":case"XX":return qn(i);default:return qn(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return dh(i);case"xxxx":case"xx":return qn(i);default:return qn(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+uh(i,":");default:return"GMT"+qn(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+uh(i,":");default:return"GMT"+qn(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return vt(i,t.length)},T:function(e,t,n){return vt(+e,t.length)}};function uh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+vt(o,2)}function dh(e,t){return e%60===0?(e>0?"-":"+")+vt(Math.abs(e)/60,2):qn(e,t)}function qn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=vt(Math.trunc(i/60),2),o=vt(i%60,2);return n+s+t+o}const hh=(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"});default:return t.date({width:"full"})}},fh=(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"});default:return t.time({width:"full"})}},IS=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return hh(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",hh(i,t)).replace("{{time}}",fh(s,t))},LS={p:fh,P:IS},NS=/^D+$/,FS=/^Y+$/,BS=["D","DD","YY","YYYY"];function zS(e){return NS.test(e)}function US(e){return FS.test(e)}function HS(e,t,n){const i=VS(e,t,n);if(console.warn(i),BS.includes(e))throw new RangeError(i)}function VS(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 WS(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function $S(e){return!(!WS(e)&&typeof e!="number"||isNaN(+re(e)))}const YS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qS=/^'([^]*?)'?$/,GS=/''/g,KS=/[a-zA-Z]/;function XS(e,t,n){const i=Ss(),s=n?.locale??i.locale??wS,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=re(e,n?.in);if(!$S(a))throw new RangeError("Invalid time value");let l=t.match(jS).map(u=>{const h=u[0];if(h==="p"||h==="P"){const f=LS[h];return f(u,s.formatLong)}return u}).join("").match(YS).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const h=u[0];if(h==="'")return{isToken:!1,value:ZS(u)};if(ch[h])return{isToken:!0,value:u};if(h.match(KS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:u}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(u=>{if(!u.isToken)return u.value;const h=u.value;(!n?.useAdditionalWeekYearTokens&&US(h)||!n?.useAdditionalDayOfYearTokens&&zS(h))&&HS(h,t,String(e));const f=ch[h[0]];return f(a,h,s.localize,c)}).join("")}function ZS(e){const t=e.match(qS);return t?t[1].replace(GS,"'"):e}function Lo(e,t,n){const i=re(e,n?.in);return isNaN(t)?Oe(e,NaN):(i.setDate(i.getDate()+t),i)}function mh(e,t,n){const i=re(e,n?.in);if(isNaN(t))return Oe(e,NaN);if(!t)return i;const s=i.getDate(),o=Oe(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function QS(e,t,n){return mh(e,t*3,n)}function Si(e,t){const n=re(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function Ti(e,t){const n=re(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function JS(e,t){const n=re(e,t?.in),i=n.getFullYear(),s=n.getMonth(),o=Oe(n,0);return o.setFullYear(i,s+1,0),o.setHours(0,0,0,0),o.getDate()}function tT(){return Object.assign({},Ss())}function ph(e){return Math.trunc(e*MS)}function eT(e){const t=e/vS;return Math.trunc(t)}function gh(e,t,n){return mh(e,-1,n)}function yh(e,t,n){return QS(e,-1,n)}function bh(e,t,n){const i=tT(),s=sT(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?nT(s,t):iT(s,t)}function nT(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 iT(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function sT(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function oT(e,t){const n=uT(t);return"formatToParts"in n?aT(n,e):lT(n,e)}const rT={year:0,month:1,day:2,hour:3,minute:4,second:5};function aT(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=rT[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function lT(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 ka={},_h=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")),cT=_h==="06/25/2014, 00:00:00"||_h==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function uT(e){return ka[e]||(ka[e]=cT?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"})),ka[e]}function Da(e,t,n,i,s,o,r){const a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(i,s,o,r),a}const xh=36e5,dT=6e4,Ca={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ts(e,t,n){if(!e)return 0;let i=Ca.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=Ca.timezoneHH.exec(e),i)return s=parseInt(i[1],10),wh(s)?-(s*xh):NaN;if(i=Ca.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const r=parseInt(i[3],10);return wh(s,r)?(o=Math.abs(s)*xh+r*dT,i[1]==="+"?-o:o):NaN}if(mT(e)){t=new Date(t||Date.now());const r=n?t:hT(t),a=Oa(r,e);return-(n?a:fT(t,a,e))}return NaN}function hT(e){return Da(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Oa(e,t){const n=oT(e,t),i=Da(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function fT(e,t,n){let i=e.getTime()-t;const s=Oa(new Date(i),n);if(t===s)return t;i-=s-t;const o=Oa(new Date(i),n);return s===o?s:Math.max(s,o)}function wh(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Sh={};function mT(e){if(Sh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Sh[e]=!0,!0}catch{return!1}}const pT=60*1e3,gT={X:function(e,t,n){const i=Ea(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Th(i);case"XXXX":case"XX":return vi(i);default:return vi(i,":")}},x:function(e,t,n){const i=Ea(n.timeZone,e);switch(t){case"x":return Th(i);case"xxxx":case"xx":return vi(i);default:return vi(i,":")}},O:function(e,t,n){const i=Ea(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+yT(i,":");default:return"GMT"+vi(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return bh("short",e,n);default:return bh("long",e,n)}}};function Ea(e,t){const n=e?Ts(e,t,!0)/pT:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function No(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function vi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=No(Math.floor(i/60),2),o=No(Math.floor(i%60),2);return n+s+t+o}function Th(e,t){return e%60===0?(e>0?"-":"+")+No(Math.abs(e)/60,2):vi(e,t)}function yT(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+No(o,2)}function vh(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 Mh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Aa=36e5,kh=6e4,bT=2,ce={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:Mh};function Fo(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?bT: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=_T(e),{year:s,restDateString:o}=xT(i.date,n),r=wT(o,s);if(r===null||isNaN(r.getTime()))return new Date(NaN);if(r){const a=r.getTime();let l=0,c;if(i.time&&(l=ST(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ts(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=vh(new Date(a+l)),c=vh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function _T(e){const t={};let n=ce.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=ce.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=ce.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function xT(e,t){if(e){const n=ce.YYY[t],i=ce.YYYYY[t];let s=ce.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=ce.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function wT(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=ce.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,Oh(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=ce.DDD.exec(e),o){n=new Date(0);const r=parseInt(o[1],10);return MT(t,r)?(n.setUTCFullYear(t,0,r),n):new Date(NaN)}if(o=ce.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const r=parseInt(o[2],10);return Oh(t,i,r)?(n.setUTCFullYear(t,i,r),n):new Date(NaN)}if(o=ce.Www.exec(e),o)return s=parseInt(o[1],10)-1,Eh(s)?Dh(t,s):new Date(NaN);if(o=ce.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const r=parseInt(o[2],10)-1;return Eh(s,r)?Dh(t,s,r):new Date(NaN)}return null}function ST(e){let t,n,i=ce.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Pa(t)?t%24*Aa:NaN;if(i=ce.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Pa(t,n)?t%24*Aa+n*kh:NaN;if(i=ce.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Pa(t,n,s)?t%24*Aa+n*kh+s*1e3:NaN}return null}function Dh(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const TT=[31,28,31,30,31,30,31,31,30,31,30,31],vT=[31,29,31,30,31,30,31,31,30,31,30,31];function Ch(e){return e%400===0||e%4===0&&e%100!==0}function Oh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Ch(e);if(i&&n>vT[t]||!i&&n>TT[t])return!1}return!0}function MT(e,t){if(t<1)return!1;const n=Ch(e);return!(n&&t>366||!n&&t>365)}function Eh(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Pa(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const kT=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function DT(e,t,n={}){t=String(t);const i=t.match(kT);if(i){const s=Fo(n.originalDate||e,n);t=i.reduce(function(o,r){if(r[0]==="'")return o;const a=o.indexOf(r),l=o[a-1]==="'",c=o.replace(r,"'"+gT[r[0]](s,r,n)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return XS(e,t,n)}function Ah(e,t,n){e=Fo(e,n);const i=Ts(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Ph(e,t,n,i){return i={...i,timeZone:t,originalDate:e},DT(Ah(e,t,{timeZone:i.timeZone}),n,i)}function CT(e,t,n){if(typeof e=="string"&&!e.match(Mh))return Fo(e,{...n,timeZone:t});e=Fo(e,n);const i=Da(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),s=Ts(t,new Date(i));return new Date(i+s)}function OT(e,t){return-Ts(e,t)}function Rh(e,t={}){const n=t?.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;let i="MMM dd, yyy hh:mm a";switch(t.format){case"short":i="MMM dd, yyyy";break;case"default":i="MMM dd, yyyy hh:mm a";break;case"full":i="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(i+=" (z)"),Ph(e,n,i)}function ET(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 s=new Date(e);return Ph(s,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const AT={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:300*1e3,tenMinutely:600*1e3,thirtyMinutely:1800*1e3,hourly:3600*1e3,twoHourly:7200*1e3,twelveHourly:720*60*1e3,daily:3600*24*1e3,weekly:3600*24*7*1e3,trend:0};function Ra(e){return e&&Iw.find(t=>e<=AT[t])||null}var Bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},zo={exports:{}};zo.exports;var Ih;function PT(){return Ih||(Ih=1,(function(e,t){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",r="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",p="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",M="[object String]",E="[object Symbol]",D="[object WeakMap]",C="[object ArrayBuffer]",A="[object DataView]",O="[object Float32Array]",x="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",k="[object Int32Array]",I="[object Uint8Array]",Y="[object Uint8ClampedArray]",U="[object Uint16Array]",j="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,$=/\w*$/,R=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,z={};z[o]=z[r]=z[C]=z[A]=z[a]=z[l]=z[O]=z[x]=z[_]=z[T]=z[k]=z[f]=z[m]=z[p]=z[b]=z[S]=z[M]=z[E]=z[I]=z[Y]=z[U]=z[j]=!0,z[c]=z[u]=z[D]=!1;var P=typeof Bo=="object"&&Bo&&Bo.Object===Object&&Bo,N=typeof self=="object"&&self&&self.Object===Object&&self,V=P||N||Function("return this")(),Q=t&&!t.nodeType&&t,X=Q&&!0&&e&&!e.nodeType&&e,q=X&&X.exports===Q;function G(w,L){return w.set(L[0],L[1]),w}function J(w,L){return w.add(L),w}function nt(w,L){for(var W=-1,it=w?w.length:0;++W<it&&L(w[W],W,w)!==!1;);return w}function tt(w,L){for(var W=-1,it=L.length,Ht=w.length;++W<it;)w[Ht+W]=L[W];return w}function Z(w,L,W,it){for(var Ht=-1,qt=w?w.length:0;++Ht<qt;)W=L(W,w[Ht],Ht,w);return W}function pt(w,L){for(var W=-1,it=Array(w);++W<w;)it[W]=L(W);return it}function bt(w,L){return w?.[L]}function ot(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function gt(w){var L=-1,W=Array(w.size);return w.forEach(function(it,Ht){W[++L]=[Ht,it]}),W}function ct(w,L){return function(W){return w(L(W))}}function $t(w){var L=-1,W=Array(w.size);return w.forEach(function(it){W[++L]=it}),W}var lt=Array.prototype,Mt=Function.prototype,Yt=Object.prototype,_e=V["__core-js_shared__"],Jt=(function(){var w=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""})(),Ye=Mt.toString,Ct=Yt.hasOwnProperty,te=Yt.toString,Nt=RegExp("^"+Ye.call(Ct).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jt=q?V.Buffer:void 0,ee=V.Symbol,je=V.Uint8Array,ei=ct(Object.getPrototypeOf,Object),Le=Object.create,Ft=Yt.propertyIsEnumerable,xe=lt.splice,ni=Object.getOwnPropertySymbols,ar=jt?jt.isBuffer:void 0,lr=ct(Object.keys,Object),Us=Pn(V,"DataView"),ii=Pn(V,"Map"),Hs=Pn(V,"Promise"),si=Pn(V,"Set"),sn=Pn(V,"WeakMap"),on=Pn(Object,"create"),Vs=ae(Us),Ws=ae(ii),oi=ae(Hs),xl=ae(si),wl=ae(sn),cr=ee?ee.prototype:void 0,ur=cr?cr.valueOf:void 0;function rn(w){var L=-1,W=w?w.length:0;for(this.clear();++L<W;){var it=w[L];this.set(it[0],it[1])}}function Ii(){this.__data__=on?on(null):{}}function $s(w){return this.has(w)&&delete this.__data__[w]}function dr(w){var L=this.__data__;if(on){var W=L[w];return W===i?void 0:W}return Ct.call(L,w)?L[w]:void 0}function an(w){var L=this.__data__;return on?L[w]!==void 0:Ct.call(L,w)}function Sl(w,L){var W=this.__data__;return W[w]=on&&L===void 0?i:L,this}rn.prototype.clear=Ii,rn.prototype.delete=$s,rn.prototype.get=dr,rn.prototype.has=an,rn.prototype.set=Sl;function Ne(w){var L=-1,W=w?w.length:0;for(this.clear();++L<W;){var it=w[L];this.set(it[0],it[1])}}function Tl(){this.__data__=[]}function vl(w){var L=this.__data__,W=Ni(L,w);if(W<0)return!1;var it=L.length-1;return W==it?L.pop():xe.call(L,W,1),!0}function Ml(w){var L=this.__data__,W=Ni(L,w);return W<0?void 0:L[W][1]}function Fe(w){return Ni(this.__data__,w)>-1}function kl(w,L){var W=this.__data__,it=Ni(W,w);return it<0?W.push([w,L]):W[it][1]=L,this}Ne.prototype.clear=Tl,Ne.prototype.delete=vl,Ne.prototype.get=Ml,Ne.prototype.has=Fe,Ne.prototype.set=kl;function En(w){var L=-1,W=w?w.length:0;for(this.clear();++L<W;){var it=w[L];this.set(it[0],it[1])}}function Dl(){this.__data__={hash:new rn,map:new(ii||Ne),string:new rn}}function Cl(w){return zi(this,w).delete(w)}function Ol(w){return zi(this,w).get(w)}function Be(w){return zi(this,w).has(w)}function El(w,L){return zi(this,w).set(w,L),this}En.prototype.clear=Dl,En.prototype.delete=Cl,En.prototype.get=Ol,En.prototype.has=Be,En.prototype.set=El;function An(w){this.__data__=new Ne(w)}function Al(){this.__data__=new Ne}function Pl(w){return this.__data__.delete(w)}function Rl(w){return this.__data__.get(w)}function Li(w){return this.__data__.has(w)}function Il(w,L){var W=this.__data__;if(W instanceof Ne){var it=W.__data__;if(!ii||it.length<n-1)return it.push([w,L]),this;W=this.__data__=new En(it)}return W.set(w,L),this}An.prototype.clear=Al,An.prototype.delete=Pl,An.prototype.get=Rl,An.prototype.has=Li,An.prototype.set=Il;function Ll(w,L){var W=Gs(w)||Hi(w)?pt(w.length,String):[],it=W.length,Ht=!!it;for(var qt in w)Ct.call(w,qt)&&!(Ht&&(qt=="length"||Ql(qt,it)))&&W.push(qt);return W}function Pe(w,L,W){var it=w[L];(!(Ct.call(w,L)&&qs(it,W))||W===void 0&&!(L in w))&&(w[L]=W)}function Ni(w,L){for(var W=w.length;W--;)if(qs(w[W][0],L))return W;return-1}function Nl(w,L){return w&&hr(L,ri(L),w)}function Ys(w,L,W,it,Ht,qt,we){var Zt;if(it&&(Zt=qt?it(w,Ht,qt,we):it(w)),Zt!==void 0)return Zt;if(!cn(w))return w;var _r=Gs(w);if(_r){if(Zt=Xl(w),!L)return ql(w,Zt)}else{var Rn=qe(w),xr=Rn==u||Rn==h;if(gr(w))return Hl(w,L);if(Rn==p||Rn==o||xr&&!qt){if(ot(w))return qt?w:{};if(Zt=mr(xr?{}:w),!L)return Gl(w,Nl(Zt,w))}else{if(!z[Rn])return qt?w:{};Zt=Zl(w,Rn,Ys,L)}}we||(we=new An);var wr=we.get(w);if(wr)return wr;if(we.set(w,Zt),!_r)var ai=W?Kl(w):ri(w);return nt(ai||w,function(Xs,Vi){ai&&(Vi=Xs,Xs=w[Vi]),Pe(Zt,Vi,Ys(Xs,L,W,it,Vi,w,we))}),Zt}function Fl(w){return cn(w)?Le(w):{}}function Bl(w,L,W){var it=L(w);return Gs(w)?it:tt(it,W(w))}function zl(w){return te.call(w)}function Fi(w){if(!cn(w)||Jl(w))return!1;var L=Ks(w)||ot(w)?Nt:R;return L.test(ae(w))}function Ul(w){if(!ln(w))return lr(w);var L=[];for(var W in Object(w))Ct.call(w,W)&&W!="constructor"&&L.push(W);return L}function Hl(w,L){if(L)return w.slice();var W=new w.constructor(w.length);return w.copy(W),W}function Bi(w){var L=new w.constructor(w.byteLength);return new je(L).set(new je(w)),L}function Vl(w,L){var W=L?Bi(w.buffer):w.buffer;return new w.constructor(W,w.byteOffset,w.byteLength)}function Wl(w,L,W){var it=L?W(gt(w),!0):gt(w);return Z(it,G,new w.constructor)}function js(w){var L=new w.constructor(w.source,$.exec(w));return L.lastIndex=w.lastIndex,L}function $l(w,L,W){var it=L?W($t(w),!0):$t(w);return Z(it,J,new w.constructor)}function Yl(w){return ur?Object(ur.call(w)):{}}function jl(w,L){var W=L?Bi(w.buffer):w.buffer;return new w.constructor(W,w.byteOffset,w.length)}function ql(w,L){var W=-1,it=w.length;for(L||(L=Array(it));++W<it;)L[W]=w[W];return L}function hr(w,L,W,it){W||(W={});for(var Ht=-1,qt=L.length;++Ht<qt;){var we=L[Ht],Zt=void 0;Pe(W,we,Zt===void 0?w[we]:Zt)}return W}function Gl(w,L){return hr(w,fr(w),L)}function Kl(w){return Bl(w,ri,fr)}function zi(w,L){var W=w.__data__;return Ui(L)?W[typeof L=="string"?"string":"hash"]:W.map}function Pn(w,L){var W=bt(w,L);return Fi(W)?W:void 0}var fr=ni?ct(ni,Object):yr,qe=zl;(Us&&qe(new Us(new ArrayBuffer(1)))!=A||ii&&qe(new ii)!=f||Hs&&qe(Hs.resolve())!=y||si&&qe(new si)!=S||sn&&qe(new sn)!=D)&&(qe=function(w){var L=te.call(w),W=L==p?w.constructor:void 0,it=W?ae(W):void 0;if(it)switch(it){case Vs:return A;case Ws:return f;case oi:return y;case xl:return S;case wl:return D}return L});function Xl(w){var L=w.length,W=w.constructor(L);return L&&typeof w[0]=="string"&&Ct.call(w,"index")&&(W.index=w.index,W.input=w.input),W}function mr(w){return typeof w.constructor=="function"&&!ln(w)?Fl(ei(w)):{}}function Zl(w,L,W,it){var Ht=w.constructor;switch(L){case C:return Bi(w);case a:case l:return new Ht(+w);case A:return Vl(w,it);case O:case x:case _:case T:case k:case I:case Y:case U:case j:return jl(w,it);case f:return Wl(w,it,W);case m:case M:return new Ht(w);case b:return js(w);case S:return $l(w,it,W);case E:return Yl(w)}}function Ql(w,L){return L=L??s,!!L&&(typeof w=="number"||B.test(w))&&w>-1&&w%1==0&&w<L}function Ui(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function Jl(w){return!!Jt&&Jt in w}function ln(w){var L=w&&w.constructor,W=typeof L=="function"&&L.prototype||Yt;return w===W}function ae(w){if(w!=null){try{return Ye.call(w)}catch{}try{return w+""}catch{}}return""}function tc(w){return Ys(w,!0,!0)}function qs(w,L){return w===L||w!==w&&L!==L}function Hi(w){return ec(w)&&Ct.call(w,"callee")&&(!Ft.call(w,"callee")||te.call(w)==o)}var Gs=Array.isArray;function pr(w){return w!=null&&nc(w.length)&&!Ks(w)}function ec(w){return un(w)&&pr(w)}var gr=ar||br;function Ks(w){var L=cn(w)?te.call(w):"";return L==u||L==h}function nc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function cn(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function un(w){return!!w&&typeof w=="object"}function ri(w){return pr(w)?Ll(w):Ul(w)}function yr(){return[]}function br(){return!1}e.exports=tc})(zo,zo.exports)),zo.exports}PT();const Ee=(e,t)=>new Date(e.getTime()-OT(t,e));class Xt{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){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<=168&&n.add("hourly"),i>=48&&n.add("daily"),i>=672&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const n=CT(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Ah(n,t)}}class RT extends Xt{rawStart(t){let n=en(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class IT extends Xt{rawStart(t){let n=Ti(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class LT extends Xt{rawStart(t){let n=Si(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class NT extends Xt{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class FT extends Xt{rawEnd(t){let n=en(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Ee(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=en(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=Ee(i,t)),i}}class BT extends Xt{rawEnd(t){let n=Si(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}rawStart(t){let n=Si(yh(this.tzAdjustedDate(t)));return t&&(n=Ee(n,t)),n}}class zT extends Xt{rawEnd(t){let n=Ti(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}rawStart(t){let n=Ti(gh(this.tzAdjustedDate(t)));return t&&(n=Ee(n,t)),n}}class UT extends Xt{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=Ee(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=Ee(n,t)),n}}et.FIFTEEN_MIN,new Xt({key:et.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>900,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),et.ONE_HOUR,new Xt({key:et.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>3600*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),et.SIX_HOUR,new Xt({key:et.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>3600*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),et.TWELVE_HOUR,new Xt({key:et.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>3600*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),et.ONE_DAY,new Xt({key:et.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>3600*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),et.SEVEN_DAY,new Xt({key:et.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),et.THIRTY_DAY,new Xt({key:et.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>3600*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),et.NINETY_DAY,new Xt({key:et.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>3600*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),et.ONE_HUNDRED_EIGHTY_DAY,new Xt({key:et.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>3600*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),et.ONE_YEAR,new Xt({key:et.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>3600*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),et.CURRENT_WEEK,new RT({key:et.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=en(new Date,{weekStartsOn:1});return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),et.CURRENT_MONTH,new IT({key:et.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=Ti(new Date);return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.CURRENT_QUARTER,new LT({key:et.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Si(new Date);return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.CURRENT_YEAR,new NT({key:et.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.PREVIOUS_WEEK,new FT({key:et.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),et.PREVIOUS_MONTH,new zT({key:et.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=Ti(new Date),n=Ti(gh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Lh(t,n)),3600*24*JS(new Date().setMonth(new Date().getMonth()-1))+ph(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.PREVIOUS_QUARTER,new BT({key:et.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Si(new Date),t=Si(yh(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.PREVIOUS_YEAR,new UT({key:et.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=Lh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+ph(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Lh(e,t){return eT(e.getTimezoneOffset()-t.getTimezoneOffset())}et.FIFTEEN_MIN,et.ONE_HOUR,et.SIX_HOUR,et.TWELVE_HOUR,et.ONE_DAY,et.SEVEN_DAY,et.FIFTEEN_MIN,et.ONE_HOUR,et.SIX_HOUR,et.TWELVE_HOUR,et.ONE_DAY,et.SEVEN_DAY,et.THIRTY_DAY,et.NINETY_DAY,et.ONE_HUNDRED_EIGHTY_DAY,et.ONE_YEAR,et.CURRENT_WEEK,et.CURRENT_MONTH,et.CURRENT_QUARTER,et.CURRENT_YEAR,et.PREVIOUS_WEEK,et.PREVIOUS_MONTH,et.PREVIOUS_QUARTER,et.PREVIOUS_YEAR;const HT=new Map(ih.map(e=>[e.code,{code:e.code,name:e.name}])),Ia=e=>HT.get(e)?.name||e,Nh=1e3,VT=1e4,Fh=1e6,Bh=1e9,zh=1e12,Uo=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((s,o)=>{o&&o%3===0&&i.push(n),i.push(s)}),i.reverse().join("")},vs=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let r=o.toString();return typeof n.decimal=="string"&&(r=r.replace(".",n.decimal)),r};function Ho(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?VT:Nh;return e<s||t.precision&&t.precision>Math.log10(e)?n=Uo(vs(e,1,t),t):e<Fh?n=`${vs(e,Nh,t)}k`:e<Bh?n=`${vs(e,Fh,t)}m`:e<zh?n=`${Uo(vs(e,Bh,t),t)}b`:n=`${Uo(vs(e,zh,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}Ho.addCommas=Uo;const WT=typeof document<"u"&&document.documentElement?.lang||"en-US",Vo=new Intl.NumberFormat(WT);function Gn({i18n:e}){const t=(i,s)=>{if(isNaN(i))return"0 B";const o=s?Math.pow(2,50):1e15,r=s?Math.pow(2,40):1e12,a=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=o?u=e.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=r?u=e.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=a?u=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=e.formatNumber(Number.parseFloat((i/c).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,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?e.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:o=!1,currency:r="USD",approximate:a=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,o);case"usd":return n(i,r);default:return isNaN(i)?`${i}`:a?`${Ho(i,{capital:!0})} ${c}`:i>=.01?`${Vo.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:n,formatRange:(i,s,o,{isBytes1024:r=!1,currency:a="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(o,s);switch(o){case"bytes":return`${t(i,r)} - ${t(s,r)}`;case"usd":return`${n(i,a)} - ${n(s,a)}`;default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${Ho(i,{capital:!0})} - ${Ho(s,{capital:!0})} ${u}`}const h=i>=.01?`${Vo.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${Vo.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const Wo=e=>["interactive","zoom-interactive"].includes(e),Uh=(e,t,n,i)=>{const{tooltip:s}=t;if(s.opacity===0&&!Wo(e.interactionMode)){e.showTooltip=!1;return}const{i18n:o}=mt.useI18n(),{formatUnit:r}=Gn({i18n:o}),a=e.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(s.body&&!Wo(e.interactionMode)){const l=s.labelColors,c=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=s.dataPoints[0].parsed.x??0;e.tooltipContext=i?.contextFormatter?i.contextFormatter(u,n):Ds({tickValue:new Date(u),granularity:n}),e.tooltipSeries=s.dataPoints.map((h,f)=>{const m=h.parsed[c],p=r(m??0,e.units,{translateUnit:e.translateUnit}),y=h.dataset.label;return{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:y,value:p,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(a),e.left=`${s.x}px`,e.top=`${s.y}px`,e.showTooltip=!0}},Hh=(e,t)=>{const{tooltip:n}=t,{i18n:i}=mt.useI18n(),{formatUnit:s}=Gn({i18n:i});if(n.opacity===0&&!Wo(e.interactionMode)){e.showTooltip=!1;return}const o=e.chartTooltipSortFn||((r,a)=>a.rawValue-r.rawValue);if(n.body&&!Wo(e.interactionMode)){const r=n.labelColors,a=t.chart.config?.options?.indexAxis==="y"?"x":"y",l=["gauge","donut"].includes(e.chartType);l?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((c,u)=>{const h=l?c.parsed:c.parsed[a],f=s(h??0,e.units,{translateUnit:e.translateUnit});let m;return l?m=c.dataset.labels[c.dataIndex]:m=c.dataset.label,{backgroundColor:r[u].backgroundColor,borderColor:r[u].borderColor,label:m,value:f,rawValue:h,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(o),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},$T=e=>e&&e.datasets&&e.datasets.length,YT=e=>$T(e)&&e.datasets.some(t=>t.data.length),jT=e=>e.datasets.some(t=>t.data[0]&&ga(t.data[0].x)),qT=e=>!!YT(e)&&e.datasets.some(t=>t.data.length==1),GT=e=>jT(e)&&e.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),La=(e,t,n)=>{const s=Math.min(t/1150,1),o=.15,r=1.15,a=e.x??0;return a<n?a+t*o*(1-s):a-t*r*(1-s)},KT=(e,t,n)=>{const o=e.y??0;return o<n?o+t*.15:o-t*.5};function Vh(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const Wh=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(s=>!t?.[s.text]?.isThreshold).map(((s,o)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[o].isSegmentEmpty}))).sort(n)},XT=2,$h=10,Yh=12,$o=10,ZT="#f1f0ff",QT="#e0e4ea",jh="#6c7489",JT="#afb7c5",t1="#d60027",e1="#ad000e",Na="#6c7489",qh="#52596e",n1="#007d60",i1="#995c00",s1="#ffc400",o1="'Inter', Roboto, Helvetica, sans-serif",Ms="16px",r1="20px",a1="#bee2ff",l1="#8fc1ff",c1="#5f9aff",u1="#306fff",d1="#b5ffee",h1="#00fabe",f1="#00d6a4",m1="#00a17b",p1="#007d60",g1="#005944",y1="#b5ffee",b1="#00fabe",_1="#b5ffee",x1="#00a17b",w1="#fff296",S1="#ffe04b",T1="#ffc400",v1="#b37600",M1="#995c00",k1="#804400",D1="#fff296",C1="#ffe04b",O1="#ffc2b3",E1="#ff9877",A1="#ff723c",P1="#f75008",R1="#d13500",I1="#a31f00",L1="#ffc2b3",N1="#ff9877",F1="#ff723c",B1="#f75008",z1="#d13500",U1="#a31f00",H1="#ffc2b3",V1="#ff9877",W1="#ff723c",$1="#f75008",Y1="#d13500",j1="#a31f00",q1="#ffc2b3",G1="#ff9877",K1="#ff723c",X1="#f75008",Z1="#d13500",Q1="#a31f00",J1="#ffc2b3",tv="#ff9877",ev="#ff723c",nv="#f75008",iv="#d13500",sv="#ffabab",ov="#ff7272",rv="#ff3954",av="#f50045",lv="#d60027",cv="#ad000e",uv="#ffabab",dv="#ff7272",hv="#ff3954",fv="#f50045",mv="#d60027",pv="#eefaff",gv="#ecfffb",yv="#fffce0",bv="#fff1ef",_v="#ffe5e5",xv="#5f9aff",wv="#00d6a4",Sv="#ffc400",Tv="#ff723c",vv="#ff3954",Mn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Fa=(e,t)=>(t||Mn)[e%Mn.length],Mv="#6f7787",kv={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"}},Dv=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return kv[t]?.background||"#fafafa"},Cv=JT,Gh=(e,t,n,i)=>{let s;return n?s=Cv:Array.isArray(i)?s=Fa(e,i):s=i[t],s||Fa(e)},Ba=e=>{switch(e){case"error":return t1;case"warning":return s1;case"neutral":return jh;default:return jh}},Ov={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},Ev=2,Av=0,za=new Map,Kh=(e,t)=>{const{i18n:n}=mt.useI18n(),{formatBytes:i}=Gn({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):Vo.format(e)},Pv=e=>{const n=document.createElement("canvas").getContext("2d"),i=Pt({});return n.font=i.string,n.measureText(e).width},Rv=()=>{const e="label_height";if(!za.has(e)){const t=Pt({});za.set(e,t.lineHeight)}return za.get(e)},Iv=(e,t)=>t.datasets.reduce((n,i,s)=>e.isDatasetVisible(s)?n+i.data.reduce((o,r)=>isNaN(r)?o:o+r,0):n,0),Lv=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,Nv=QT,Fv={100:a1,101:l1,102:c1,103:u1,200:d1,201:h1,202:f1,203:m1,204:p1,205:g1,206:y1,207:b1,208:_1,226:x1,300:w1,301:S1,302:T1,303:v1,304:M1,305:k1,307:D1,308:C1,400:O1,401:E1,402:A1,403:P1,404:R1,405:I1,406:L1,407:N1,408:F1,409:B1,410:z1,411:U1,412:H1,413:V1,414:W1,415:$1,416:Y1,417:j1,418:q1,421:G1,422:K1,423:X1,424:Z1,425:Q1,426:J1,428:tv,429:ev,431:nv,451:iv,500:sv,501:ov,502:rv,503:av,504:lv,505:cv,506:uv,507:dv,508:hv,510:fv,511:mv},Bv={100:pv,200:gv,300:yv,400:bv,500:_v},zv={"1XX":xv,"2XX":wv,"3XX":Sv,"4XX":Tv,"5XX":vv},Xh=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return Fv[t]??Bv[n]??Nv},Ua={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=Xh(`${t}`),e),{}),____OTHER____:ZT,...zv};function Zh(e,t,n){const i=$d(),s=Vv(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?Uv(s,t):Hv(s,t)}function Uv(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 Hv(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function Vv(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Wv(e,t){const n=Gv(t);return"formatToParts"in n?Yv(n,e):jv(n,e)}const $v={year:0,month:1,day:2,hour:3,minute:4,second:5};function Yv(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=$v[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function jv(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 Ha={},Qh=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")),qv=Qh==="06/25/2014, 00:00:00"||Qh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Gv(e){return Ha[e]||(Ha[e]=qv?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"})),Ha[e]}function Jh(e,t,n,i,s,o,r){const a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(i,s,o,r),a}const tf=36e5,Kv=6e4,Va={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Wa(e,t,n){if(!e)return 0;let i=Va.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=Va.timezoneHH.exec(e),i)return s=parseInt(i[1],10),ef(s)?-(s*tf):NaN;if(i=Va.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const r=parseInt(i[3],10);return ef(s,r)?(o=Math.abs(s)*tf+r*Kv,i[1]==="+"?-o:o):NaN}if(Qv(e)){t=new Date(t||Date.now());const r=n?t:Xv(t),a=$a(r,e);return-(n?a:Zv(t,a,e))}return NaN}function Xv(e){return Jh(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function $a(e,t){const n=Wv(e,t),i=Jh(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function Zv(e,t,n){let s=e.getTime()-t;const o=$a(new Date(s),n);if(t===o)return t;s-=o-t;const r=$a(new Date(s),n);return o===r?o:Math.max(o,r)}function ef(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const nf={};function Qv(e){if(nf[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),nf[e]=!0,!0}catch{return!1}}const Jv=60*1e3,tM={X:function(e,t,n){const i=Ya(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return sf(i);case"XXXX":case"XX":return Mi(i);default:return Mi(i,":")}},x:function(e,t,n){const i=Ya(n.timeZone,e);switch(t){case"x":return sf(i);case"xxxx":case"xx":return Mi(i);default:return Mi(i,":")}},O:function(e,t,n){const i=Ya(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+eM(i,":");default:return"GMT"+Mi(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Zh("short",e,n);default:return Zh("long",e,n)}}};function Ya(e,t){const n=e?Wa(e,t,!0)/Jv:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Yo(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Mi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Yo(Math.floor(i/60),2),o=Yo(Math.floor(i%60),2);return n+s+t+o}function sf(e,t){return e%60===0?(e>0?"-":"+")+Yo(Math.abs(e)/60,2):Mi(e,t)}function eM(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Yo(o,2)}function of(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 nM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ja=36e5,rf=6e4,iM=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:nM};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?iM: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=sM(e),{year:s,restDateString:o}=oM(i.date,n),r=rM(o,s);if(r===null||isNaN(r.getTime()))return new Date(NaN);if(r){const a=r.getTime();let l=0,c;if(i.time&&(l=aM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Wa(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=of(new Date(a+l)),c=of(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function sM(e){const t={};let n=ue.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=ue.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function oM(e,t){if(e){const n=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=ue.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function rM(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=ue.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,uf(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=ue.DDD.exec(e),o){n=new Date(0);const r=parseInt(o[1],10);return uM(t,r)?(n.setUTCFullYear(t,0,r),n):new Date(NaN)}if(o=ue.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const r=parseInt(o[2],10);return uf(t,i,r)?(n.setUTCFullYear(t,i,r),n):new Date(NaN)}if(o=ue.Www.exec(e),o)return s=parseInt(o[1],10)-1,df(s)?lf(t,s):new Date(NaN);if(o=ue.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const r=parseInt(o[2],10)-1;return df(s,r)?lf(t,s,r):new Date(NaN)}return null}function aM(e){let t,n,i=ue.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),qa(t)?t%24*ja:NaN;if(i=ue.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),qa(t,n)?t%24*ja+n*rf:NaN;if(i=ue.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return qa(t,n,s)?t%24*ja+n*rf+s*1e3:NaN}return null}function lf(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const lM=[31,28,31,30,31,30,31,31,30,31,30,31],cM=[31,29,31,30,31,30,31,31,30,31,30,31];function cf(e){return e%400===0||e%4===0&&e%100!==0}function uf(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=cf(e);if(i&&n>cM[t]||!i&&n>lM[t])return!1}return!0}function uM(e,t){if(t<1)return!1;const n=cf(e);return!(n&&t>366||!n&&t>365)}function df(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function qa(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const dM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ga(e,t,n={}){t=String(t);const i=t.match(dM);if(i){const s=af(n.originalDate||e,n);t=i.reduce(function(o,r){if(r[0]==="'")return o;const a=o.indexOf(r),l=o[a-1]==="'",c=o.replace(r,"'"+tM[r[0]](s,r,n)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Ao(e,t,n)}function hM(e,t,n){e=af(e,n);const i=Wa(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function ks(e,t,n,i){return i={...i,timeZone:t,originalDate:e},Ga(hM(e,t,{timeZone:i.timeZone}),n,i)}const fM=(e,t)=>`${ks(e,t,"yyyy")} W${ks(e,t,"II")}`,Ka="yyyy-MM-dd h:mm:ss a",Xa="h:mm:ss a",Kn="yyyy-MM-dd h:mm a",ki="h:mm a",mM="yyyy-MM-dd",Za="MMM dd, yyyy h:mm:ss a",kn="MMM dd, yyyy h:mm a",pM={secondly:e=>e?Ka:Xa,tenSecondly:e=>e?Ka:Xa,thirtySecondly:e=>e?Ka:Xa,minutely:e=>e?Kn:ki,fiveMinutely:e=>e?Kn:ki,tenMinutely:e=>e?Kn:ki,thirtyMinutely:e=>e?Kn:ki,hourly:e=>e?Kn:ki,twoHourly:e=>e?Kn:ki,twelveHourly:()=>Kn,daily:()=>mM},gM={secondly:()=>Za,tenSecondly:()=>Za,thirtySecondly:()=>Za,minutely:()=>kn,fiveMinutely:()=>kn,tenMinutely:()=>kn,thirtyMinutely:()=>kn,hourly:()=>kn,twoHourly:()=>kn,twelveHourly:()=>kn,daily:()=>kn};function hf({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:o,defaultFormat:r}){const a=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return fM(e,a);if(s&&s[t]){const l=s[t](i);return ks(e,a,l)}if(o&&o[t]){const l=o[t]();return ks(e,a,l)}return ks(e,a,r)}const yM=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>hf({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:pM,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Ds=({tickValue:e,granularity:t,timezone:n})=>hf({tickValue:e,granularity:t,timezone:n,tooltipMap:gM,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),ff=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",bM=e=>{const{i18n:t}=mt.useI18n();return ff(e)?{type:"canceled",message:t.t("query_errors.canceled.message")}:e?.status===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:e?.status===408||e?.message?.includes("timeout")?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:e?.response?.data?.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:e.response?.data?.invalid_parameters?.map(n=>n.reason).join(", ")||e?.message}},Cs=e=>e.toLocaleLowerCase().endsWith("count"),_M=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))};function xM(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Me.positioners[n]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=u.width/2,m=La(c,h,f),p=c.y,y=c.x<f?"left":"center";return{x:m-e.tooltipState.offsetX,y:p-e.tooltipState.offsetY,xAlign:y}},Jr.modes.customInteractionMode=function(l,c){const u=_n(c,l),h=[];return Jr.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p}),l.options.indexAxis==="x"&&u.x!==null&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p})}),h};const s=e.numLabels.value>25?$h:Yh,o=({chart:l,index:c})=>{const u=l.data;return{size:s,style:u?.isLabelEmpty?.[c]?"italic":"normal"}},r=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>$o?c.slice(0,$o)+"...":c):l.getLabelForValue(Number(c)),a=d.computed(()=>({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:o,callback:function(l,c){return r(this,l,c)}},title:{display:e.indexAxis==="y"?!rt(e.metricAxesTitle?.value):!rt(e.dimensionAxesTitle?.value),text:e.indexAxis==="y"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.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:o,callback:function(l,c){return r(this,l,c)}},title:{display:e.indexAxis==="x"?!rt(e.metricAxesTitle?.value):!rt(e.dimensionAxesTitle?.value),text:e.indexAxis==="x"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:l=>{Hh(e.tooltipState,l)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return d.getCurrentInstance()&&d.onUnmounted(()=>{Me.positioners[n]&&delete Me.positioners[n]}),a}pe.register(...Z0);const wM=(e,t)=>{const n=t.datasets.map(s=>s.label),i=e.datasets.map(s=>s.label);return e.datasets.length===t.datasets.length&&n.every((s,o)=>s===i[o])};function SM(e,t,n,i,s){const o=d.shallowRef(null),r=(a,l)=>{if(t.value)return new pe(t.value,{type:e,data:a,plugins:i,options:l})};return d.onMounted(()=>{o.value=r(n.value,s.value)}),d.onBeforeUnmount(()=>{rt(o.value)||o.value.destroy()}),d.watch(n,(a,l)=>{if(wM(l,a)&&!rt(o.value)){for(const[c,u]of a.datasets.entries())Object.assign(o.value.data.datasets[c],u);o.value.data.labels=a.labels,o.value.update()}else rt(o.value)||o.value.destroy(),o.value=r(a,s.value)}),d.watch(t,()=>{rt(o.value)||o.value.destroy(),o.value=r(n.value,s.value)}),d.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(rt(o.value)||o.value.destroy(),o.value=r(n.value,a))}),o}const mf=1e3,TM=1e4,pf=1e6,gf=1e9,yf=1e12,Os=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((o,r)=>{r&&r%3===0&&i.push(n),i.push(o)}),i.reverse().join("")},Di=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let r=o.toString();return typeof n.decimal=="string"&&(r=r.replace(".",n.decimal)),r};function Es(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?TM:mf;return e<s||t.precision&&t.precision>Math.log10(e)?n=Os(Di(e,1,t),t):e<pf?n=`${Di(e,mf,t)}k`:e<gf?n=`${Di(e,pf,t)}m`:e<yf?n=`${Os(Di(e,gf,t),t)}b`:n=`${Os(Di(e,yf,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}Es.addCommas=Os;function vM(e,t,n){const{i18n:i}=mt.useI18n(),{formatBytes:s}=Gn({i18n:i}),{translateUnit:o}=mt.useTranslatedUnits();return{legendValues:d.computed(()=>e.value.datasets.reduce((a,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(n.value==="bytes")u=s(c);else{const h=o(n.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:Es(c,{capital:!0}),unit:h})||`${Es(c,{capital:!0})} ${n.value}`}return{...a,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function MM(e){return d.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${Rh(new Date(n))} - ${Rh(new Date(i),{includeTZ:!0})}`:""})}function kM(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Me.positioners[n]=function(o,r){if(!o.length||r.x===null||r.y===null)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=e.tooltipState.width||this.width,c=a.width/2,u=La(r,l,c),h=r.y,f=r.x<c?"left":"center";return{x:u-e.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:o=>{Hh(e.tooltipState,o)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return d.onUnmounted(()=>{Me.positioners[n]&&delete Me.positioners[n]}),{options:s}}function DM(e){const t=d.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>{const c=new Date(l);return yM({tickValue:c,granularity:e.granularity.value,dayBoundaryCrossed:r.value})}},title:{display:!rt(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value})),n=d.computed(()=>({title:{display:!rt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.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})),s=`lineChartTooltipPosition-${e.tooltipState.chartID}`,o={enabled:!1,position:s};Me.positioners[s]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=e.tooltipState.height||this.height,m=u.width/2,p=u.height/2,y=La(c,h,m);let b=KT(c,f,p);const S=c.y<p?"top":"bottom",M=c.x<m?"left":"center";return f>u.height&&(b=0),{x:y,y:b,xAlign:M,yAlign:S}};const r=d.computed(()=>{const l=Number(e.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return pw(l)>24||u.getDate()!==c.getDate()}),a=d.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:e.pointsWithoutHover?.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:{...o,external:l=>{Uh(e.tooltipState,l,e.granularity.value)}},thresholdPlugin:{threshold:e.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return d.onUnmounted(()=>{Me.positioners[s]&&delete Me.positioners[s]}),{options:a}}function CM(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:s,pivotRecords:o,rowLabels:r,colorPalette:a}=e,{i18n:l}=mt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Fa(i.indexOf(u),Mn),data:r.map((h,f)=>n?o[`${h.id},${u}`]||0:o[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=Gh(h,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:r.map(m=>o[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function OM(e,t){const{i18n:n}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:o,metric_names:r}=t.value.meta,a=o&&Object.keys(o),l=r&&r.length>1,c=o&&a&&a.length>0,u=c&&a.length>1;if(!s.length||!r)return{datasets:[],labels:[]};const h=c&&a||r,f=h[0],m=h.length>1?h[1]:h[0],p=Object.fromEntries(l?s.flatMap(_=>r.map((T,k)=>{const I=_.event[f],Y=c?`${I},${T}`:`${k},${T}`,U=_.event[T];return[Y,U]})):s.map(_=>{const T=c?`${_.event[f]},${_.event[m]}`:`${f},${m}`,k=_.event[r[0]];return[T,k]})),y=Object.keys(p).reduce((_,T)=>{const[k]=T.split(","),I=p[T];return _[k]?_[k]+=I:_[k]=I,_},{}),b=Object.entries(y).sort(([,_],[,T])=>Number(T)-Number(_)).map(([_])=>_),S=o[f],M=o[m];let E=c&&S&&Object.entries(S).map(([_,T])=>({id:_,name:T.name}))||r.map(_=>({id:_,name:_})),D=c&&M&&Object.entries(M).map(([_,T])=>({id:_,name:T.name}))||r.map(_=>({id:_,name:_}));if(c&&f==="country_code"&&(E=E.map(_=>({..._,name:Ia(_.id)||_.name}))),c&&m==="country_code"&&(D=D.map(_=>({..._,name:Ia(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(E.sort((_,T)=>b.indexOf(_.id)-b.indexOf(T.id)),D.sort((_,T)=>b.indexOf(_.id)-b.indexOf(T.id))),!E||!D)return{labels:[],datasets:[]};const C=CM({isMultiMetric:l,hasDimensions:c,metricNames:r,dimensionFieldNames:h,barSegmentLabels:D,pivotRecords:p,rowLabels:E,colorPalette:e.colorPalette||Mn}),A=c?E.map(_=>n&&n.te(`chartLabels.${_.name}`)&&n.t(`chartLabels.${_.name}`)||_.name):r.map(_=>n&&n.te(`chartLabels.${_}`)&&n.t(`chartLabels.${_}`)||_),O=E.map(_=>_.id==="empty");return{labels:A,datasets:C,isLabelEmpty:O,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const EM=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,s)=>i+s*n),AM=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Kd(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},PM=(e,t,n,i,s)=>{const r=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((e-i)/n)*n+i,l=Math.floor((r-i)/n)*n+i+n;return EM(a,l,n)};function RM(e,t){const{i18n:n}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:o,metric_names:r,start:a,end:l}=t.value.meta,c=new Date(a).getTime(),u=new Date(l).getTime();if(!r)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const h=o&&Object.keys(o)||r,f=h&&h[0],m=o[f];let p=o&&m&&Object.keys(m).map(A=>({id:A,name:m[A].name}))||r.map(A=>({id:A,name:A}));f==="country_code"&&(p=p.map(A=>({...A,name:Ia(A.id)||A.name})));const y=t.value.meta.granularity_ms;if(typeof y!="number"||isNaN(y)||!isFinite(y)||y===0)return console.error("Invalid step value:",y),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const b=AM(c),S=PM(c,u,y,b,s),M=new Set,E=s?.length?s.reduce((A,O)=>{const x=new Date(O.timestamp).valueOf(),_=O.event;for(const T of r)M.add(T),x in A||(A[x]={}),T in A[x]||(A[x][T]={});for(const T of r)p.forEach(k=>{_[f]===k.id||T===k.id?(A[x][T]||(A[x][T]={}),A[x][T][k.id]=Math.round(Number(_[T])*1e3)/1e3):h.length||(A[x][T]||(A[x][T]={}),A[x][T][k.id]=Math.round(Number(_[k.id])*1e3)/1e3)});return A},{}):{},C=[...r.length===1?r.flatMap(A=>p.map(O=>[A,O.id,O.name,O.id==="empty"])):p.map(A=>[A.name,A.id,A.name,A.id==="empty"])].map(([A,O,x,_],T)=>{const k=S.map(j=>j in E&&A in E[j]?{x:j,y:E[j][A][O]||0}:{x:j,y:0});let{colorPalette:I,fill:Y}=e;rt(I)&&(I=Mn);const U=Gh(T,x,_,I);return{rawDimension:x,rawMetric:A,label:n&&n.te(`chartLabels.${x}`)&&n.t(`chartLabels.${x}`)||x,borderColor:U,backgroundColor:U,data:k,total:k.reduce((j,{y:H})=>j+Number(H),0),...Ov,fill:Y,borderWidth:Y?Av:Ev,isSegmentEmpty:_}});return f==="status_code"||f==="status_code_grouped"?C.sort((A,O)=>(A.label??"")<(O.label??"")?-1:1):C.sort((A,O)=>Number(A.total)<Number(O.total)?-1:1),{datasets:C}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const IM=(e,t)=>{d.watch([e,t],(n,i,s)=>{const[o,r]=n;!r||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(r,o),s(()=>{window._AnalyticsChartDataInternal?.delete(r)}))},{immediate:!0})};function LM(){const{i18n:e}=mt.useI18n();return{translateUnit:(n,i)=>{const s=i===1,o=`chartUnits.${n}`;return Cs(n)?"":e.te(o)?e.t(o,{plural:s?"":"s"}):n}}}const NM="analytics-query-provider",bf=2;function FM(){const e=d.inject(NM);return{evaluateFeatureFlag:(n,i)=>e?e.evaluateFeatureFlagFn(n,i):i}}function _f(e,t){return d.getCurrentScope()?(d.onScopeDispose(e,t),!0):!1}const xf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const BM=e=>e!=null,zM=Object.prototype.toString,UM=e=>zM.call(e)==="[object Object]";function jo(e){return Array.isArray(e)?e:[e]}function HM(e){return d.getCurrentInstance()}function VM(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(s){var o;if(!((o=d.toValue(t.replaceRef))!==null&&o!==void 0)||o)if(Array.isArray(e.value)){const r=[...e.value];r[i]=s,e.value=r}else{const r={...e.value,[i]:s};Object.setPrototypeOf(r,Object.getPrototypeOf(e.value)),e.value=r}else e.value[i]=s}}));return n}function WM(e,t=!0,n){HM()?d.onMounted(e,n):t?e():d.nextTick(e)}function $M(e,t,n){return d.watch(e,t,{...n,immediate:!0})}const qo=xf?window:void 0;function Ci(e){var t;const n=d.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function As(...e){const t=(i,s,o,r)=>(i.addEventListener(s,o,r),()=>i.removeEventListener(s,o,r)),n=d.computed(()=>{const i=jo(d.toValue(e[0])).filter(s=>s!=null);return i.every(s=>typeof s!="string")?i:void 0});return $M(()=>{var i,s;return[(i=(s=n.value)===null||s===void 0?void 0:s.map(o=>Ci(o)))!==null&&i!==void 0?i:[qo].filter(o=>o!=null),jo(d.toValue(n.value?e[1]:e[0])),jo(d.unref(n.value?e[2]:e[1])),d.toValue(n.value?e[3]:e[2])]},([i,s,o,r],a,l)=>{if(!i?.length||!s?.length||!o?.length)return;const c=UM(r)?{...r}:r,u=i.flatMap(h=>s.flatMap(f=>o.map(m=>t(h,f,m,c))));l(()=>{u.forEach(h=>h())})},{flush:"post"})}function YM(){const e=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{e.value=!0},t),e}function wf(e){const t=YM();return d.computed(()=>(t.value,!!e()))}function jM(e,t,n={}){const{window:i=qo,...s}=n;let o;const r=wf(()=>i&&"MutationObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},l=d.watch(d.computed(()=>{const h=jo(d.toValue(e)).map(Ci).filter(BM);return new Set(h)}),h=>{a(),r.value&&h.size&&(o=new MutationObserver(t),h.forEach(f=>o.observe(f,s)))},{immediate:!0,flush:"post"}),c=()=>o?.takeRecords(),u=()=>{l(),a()};return _f(u),{isSupported:r,stop:u,takeRecords:c}}const Go={speed:2,margin:30,direction:"both"};function qM(e){e.scrollLeft>e.scrollWidth-e.clientWidth&&(e.scrollLeft=Math.max(0,e.scrollWidth-e.clientWidth)),e.scrollTop>e.scrollHeight-e.clientHeight&&(e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight))}function GM(e,t={}){var n,i,s,o;const{pointerTypes:r,preventDefault:a,stopPropagation:l,exact:c,onMove:u,onEnd:h,onStart:f,initialValue:m,axis:p="both",draggingElement:y=qo,containerElement:b,handle:S=e,buttons:M=[0],restrictInView:E,autoScroll:D=!1}=t,C=d.ref((n=d.toValue(m))!==null&&n!==void 0?n:{x:0,y:0}),A=d.ref(),O=P=>r?r.includes(P.pointerType):!0,x=P=>{d.toValue(a)&&P.preventDefault(),d.toValue(l)&&P.stopPropagation()},_=d.toValue(D),T=typeof _=="object"?{speed:(i=d.toValue(_.speed))!==null&&i!==void 0?i:Go.speed,margin:(s=d.toValue(_.margin))!==null&&s!==void 0?s:Go.margin,direction:(o=_.direction)!==null&&o!==void 0?o:Go.direction}:Go,k=P=>typeof P=="number"?[P,P]:[P.x,P.y],I=(P,N,V)=>{const{clientWidth:Q,clientHeight:X,scrollLeft:q,scrollTop:G,scrollWidth:J,scrollHeight:nt}=P,[tt,Z]=k(T.margin),[pt,bt]=k(T.speed);let ot=0,gt=0;(T.direction==="x"||T.direction==="both")&&(V.x<tt&&q>0?ot=-pt:V.x+N.width>Q-tt&&q<J-Q&&(ot=pt)),(T.direction==="y"||T.direction==="both")&&(V.y<Z&&G>0?gt=-bt:V.y+N.height>X-Z&&G<nt-X&&(gt=bt)),(ot||gt)&&P.scrollBy({left:ot,top:gt,behavior:"auto"})};let Y=null;const U=()=>{const P=d.toValue(b);P&&!Y&&(Y=setInterval(()=>{const N=d.toValue(e).getBoundingClientRect(),{x:V,y:Q}=C.value,X={x:V-P.scrollLeft,y:Q-P.scrollTop};X.x>=0&&X.y>=0&&(I(P,N,X),X.x+=P.scrollLeft,X.y+=P.scrollTop,C.value=X)},1e3/60))},j=()=>{Y&&(clearInterval(Y),Y=null)},H=(P,N,V,Q)=>{const[X,q]=typeof V=="number"?[V,V]:[V.x,V.y],{clientWidth:G,clientHeight:J}=N;return P.x<X||P.x+Q.width>G-X||P.y<q||P.y+Q.height>J-q},$=()=>{if(d.toValue(t.disabled)||!A.value)return;const P=d.toValue(b);if(!P)return;const N=d.toValue(e).getBoundingClientRect(),{x:V,y:Q}=C.value;H({x:V-P.scrollLeft,y:Q-P.scrollTop},P,T.margin,N)?U():j()};d.toValue(D)&&d.watch(C,$);const R=P=>{var N;if(!d.toValue(M).includes(P.button)||d.toValue(t.disabled)||!O(P)||d.toValue(c)&&P.target!==d.toValue(e))return;const V=d.toValue(b),Q=V==null||(N=V.getBoundingClientRect)===null||N===void 0?void 0:N.call(V),X=d.toValue(e).getBoundingClientRect(),q={x:P.clientX-(V?X.left-Q.left+(D?0:V.scrollLeft):X.left),y:P.clientY-(V?X.top-Q.top+(D?0:V.scrollTop):X.top)};f?.(q,P)!==!1&&(A.value=q,x(P))},B=P=>{if(d.toValue(t.disabled)||!O(P)||!A.value)return;const N=d.toValue(b);N instanceof HTMLElement&&qM(N);const V=d.toValue(e).getBoundingClientRect();let{x:Q,y:X}=C.value;if((p==="x"||p==="both")&&(Q=P.clientX-A.value.x,N&&(Q=Math.min(Math.max(0,Q),N.scrollWidth-V.width))),(p==="y"||p==="both")&&(X=P.clientY-A.value.y,N&&(X=Math.min(Math.max(0,X),N.scrollHeight-V.height))),d.toValue(D)&&N&&(Y===null&&I(N,V,{x:Q,y:X}),Q+=N.scrollLeft,X+=N.scrollTop),N&&(E||D)){if(p!=="y"){const q=Q-N.scrollLeft;q<0?Q=N.scrollLeft:q>N.clientWidth-V.width&&(Q=N.clientWidth-V.width+N.scrollLeft)}if(p!=="x"){const q=X-N.scrollTop;q<0?X=N.scrollTop:q>N.clientHeight-V.height&&(X=N.clientHeight-V.height+N.scrollTop)}}C.value={x:Q,y:X},u?.(C.value,P),x(P)},z=P=>{d.toValue(t.disabled)||!O(P)||A.value&&(A.value=void 0,D&&j(),h?.(C.value,P),x(P))};if(xf){const P=()=>{var N;return{capture:(N=t.capture)!==null&&N!==void 0?N:!0,passive:!d.toValue(a)}};As(S,"pointerdown",R,P),As(y,"pointermove",B,P),As(y,"pointerup",z,P)}return{...VM(C),position:C,isDragging:d.computed(()=>!!A.value),style:d.computed(()=>`
3
+ `):e}function p0(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function rd(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=Pt(t.bodyFont),c=Pt(t.titleFont),u=Pt(t.footerFont),h=o.length,f=s.length,m=i.length,p=Wt(t.padding);let y=p.height,b=0,S=i.reduce((D,C)=>D+C.before.length+C.lines.length+C.after.length,0);if(S+=e.beforeBody.length+e.afterBody.length,h&&(y+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),S){const D=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=m*D+(S-m)*l.lineHeight+(S-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const E=function(D){b=Math.max(b,n.measureText(D).width+M)};return n.save(),n.font=c.string,St(e.title,E),n.font=l.string,St(e.beforeBody.concat(e.afterBody),E),M=t.displayColors?r+2+t.boxPadding:0,St(i,D=>{St(D.before,E),St(D.lines,E),St(D.after,E)}),M=0,n.font=u.string,St(e.footer,E),n.restore(),b+=p.width,{width:b,height:y}}function g0(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function y0(e,t,n,i){const{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function b0(e,t,n,i){const{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),y0(c,e,t,n)&&(c="center"),c}function ad(e,t,n){const i=n.yAlign||t.yAlign||g0(e,n);return{xAlign:n.xAlign||t.xAlign||b0(e,t,n,i),yAlign:i}}function _0(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function x0(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function ld(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=yn(r);let p=_0(t,a);const y=x0(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(h,m)+s),{x:Kt(p,0,i.width-t.width),y:Kt(y,0,i.height-t.height)}}function Mo(e,t,n){const i=Wt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function cd(e){return He([],tn(e))}function w0(e,t,n){return bn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function ud(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const dd={beforeTitle:Ke,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:Ke,beforeBody:Ke,beforeLabel:Ke,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 rt(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:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function ge(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?dd[t].call(n,i):s}class hd extends oe{static positioners=hs;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()),s=i.enabled&&n.options.animation&&i.animations,o=new Yr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=w0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=ge(i,"beforeTitle",this,t),o=ge(i,"title",this,t),r=ge(i,"afterTitle",this,t);let a=[];return a=He(a,tn(s)),a=He(a,tn(o)),a=He(a,tn(r)),a}getBeforeBody(t,n){return cd(ge(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return St(t,o=>{const r={before:[],lines:[],after:[]},a=ud(i,o);He(r.before,tn(ge(a,"beforeLabel",this,o))),He(r.lines,ge(a,"label",this,o)),He(r.after,tn(ge(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return cd(ge(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=ge(i,"beforeFooter",this,t),o=ge(i,"footer",this,t),r=ge(i,"afterFooter",this,t);let a=[];return a=He(a,tn(s)),a=He(a,tn(o)),a=He(a,tn(r)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(p0(this.chart,n[l]));return t.filter&&(a=a.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,i))),St(a,u=>{const h=ud(t.callbacks,u);s.push(ge(h,"labelColor",this,u)),o.push(ge(h,"labelPointStyle",this,u)),r.push(ge(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=hs[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=rd(this,i),c=Object.assign({},a,l),u=ad(this.chart,i,c),h=ld(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=yn(a),{x:f,y:m}=t,{width:p,height:y}=n;let b,S,M,E,D,C;return o==="center"?(D=m+y/2,s==="left"?(b=f,S=b-r,E=D+r,C=D-r):(b=f+p,S=b+r,E=D-r,C=D+r),M=b):(s==="left"?S=f+Math.max(l,u)+r:s==="right"?S=f+p-Math.max(c,h)-r:S=this.caretX,o==="top"?(E=m,D=E-r,b=S-r,M=S+r):(E=m+y,D=E+r,b=S+r,M=S-r),C=E),{x1:b,x2:S,x3:M,y1:E,y2:D,y3:C}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=pi(i.rtl,this.x,this.width);for(t.x=Mo(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=Pt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,s,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=Pt(o.bodyFont),h=Mo(this,"left",o),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+m;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,S=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Br(t,y,b,S),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Br(t,y,b,S)}else{t.lineWidth=ft(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const y=s.leftForLtr(f,c),b=s.leftForLtr(s.xPlus(f,1),c-2),S=yn(r.borderRadius);Object.values(S).some(M=>M!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,hi(t,{x:y,y:p,w:c,h:l,radius:S}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),hi(t,{x:b,y:p+1,w:c-2,h:l-2,radius:S}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=Pt(i.bodyFont);let f=h.lineHeight,m=0;const p=pi(i.rtl,this.x,this.width),y=function(x){n.fillText(x,p.x(t.x+m),t.y+f/2),t.y+=f+o},b=p.textAlign(r);let S,M,E,D,C,A,O;for(n.textAlign=r,n.textBaseline="middle",n.font=h.string,t.x=Mo(this,b,i),n.fillStyle=i.bodyColor,St(this.beforeBody,y),m=a&&b!=="right"?r==="center"?c/2+u:c+2+u:0,D=0,A=s.length;D<A;++D){for(S=s[D],M=this.labelTextColors[D],n.fillStyle=M,St(S.before,y),E=S.lines,a&&E.length&&(this._drawColorBox(n,t,D,p,i),f=Math.max(h.lineHeight,l)),C=0,O=E.length;C<O;++C)y(E[C]),f=h.lineHeight;St(S.after,y)}m=0,f=h.lineHeight,St(this.afterBody,y),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let r,a;if(o){const l=pi(i.rtl,this.x,this.width);for(t.x=Mo(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=Pt(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=yn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+h,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-p),n.quadraticCurveTo(a+c,l+u,a+c-p,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+m,l+u),n.quadraticCurveTo(a,l+u,a,l+u-m),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+h),n.quadraticCurveTo(a,l,a+h,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=hs[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=rd(this,t),l=Object.assign({},r,this._size),c=ad(n,t,l),u=ld(t,l,c,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.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 s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Wt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),Vc(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Wc(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!to(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!to(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,r=hs[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}var Me={id:"tooltip",_element:hd,positioners:hs,afterInit(e,t,n){n&&(e.tooltip=new hd({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:dd},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"]},S0=Object.freeze({__proto__:null,Colors:Lb,Decimation:zb,Filler:o0,Legend:d0,SubTitle:m0,Title:f0,Tooltip:Me});const T0=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function v0(e,t,n,i){const s=e.indexOf(t);if(s===-1)return T0(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const M0=(e,t)=>e===null?null:Kt(Math.round(e),0,t);function fd(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class k0 extends Vn{static id="category";static defaults={ticks:{callback:fd}};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:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(rt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:v0(i,t,at(n,t),this._addedLabels),M0(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=n;r++)s.push({value:r});return s}getLabelForValue(t){return fd.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}}function D0(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=e,m=o||1,p=u-1,{min:y,max:b}=t,S=!rt(r),M=!rt(a),E=!rt(c),D=(b-y)/(h+1);let C=pc((b-y)/p/m)*m,A,O,x,_;if(C<1e-14&&!S&&!M)return[{value:y},{value:b}];_=Math.ceil(b/C)-Math.floor(y/C),_>p&&(C=pc(_*C/p/m)*m),rt(l)||(A=Math.pow(10,l),C=Math.ceil(C*A)/A),s==="ticks"?(O=Math.floor(y/C)*C,x=Math.ceil(b/C)*C):(O=y,x=b),S&&M&&o&&mp((a-r)/o,C/1e3)?(_=Math.round(Math.min((a-r)/C,u)),C=(a-r)/_,O=r,x=a):E?(O=S?r:O,x=M?a:x,_=c-1,C=(x-O)/_):(_=(x-O)/C,Ki(_,Math.round(_),C/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(yc(C),yc(O));A=Math.pow(10,rt(l)?T:l),O=Math.round(O*A)/A,x=Math.round(x*A)/A;let k=0;for(S&&(f&&O!==r?(n.push({value:r}),O<r&&k++,Ki(Math.round((O+k*C)*A)/A,r,md(r,D,e))&&k++):O<r&&k++);k<_;++k){const I=Math.round((O+k*C)*A)/A;if(M&&I>a)break;n.push({value:I})}return M&&f&&x!==a?n.length&&Ki(n[n.length-1].value,a,md(a,D,e))?n[n.length-1].value=a:n.push({value:a}):(!M||x===a)&&n.push({value:x}),n}function md(e,t,{horizontal:n,minRotation:i}){const s=Vt(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class ko extends Vn{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 rt(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:s,max:o}=this;const r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){const l=ze(s),c=ze(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,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(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=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:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=D0(s,o);return t.bounds==="ticks"&&gc(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return Qi(t,this.chart.options.locale,this.options.ticks.format)}}class C0 extends ko{static id="linear";static defaults={ticks:{callback:ao.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Vt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.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}}const fs=e=>Math.floor(pn(e)),Wn=(e,t)=>Math.pow(10,fs(e)+t);function pd(e){return e/Math.pow(10,fs(e))===1}function gd(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function O0(e,t){const n=t-e;let i=fs(n);for(;gd(e,t,i)>10;)i++;for(;gd(e,t,i)<10;)i--;return Math.min(i,fs(e))}function E0(e,{min:t,max:n}){t=ve(e.min,t);const i=[],s=fs(t);let o=O0(t,n),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((c-u)/Math.pow(10,o)),f=ve(e.min,Math.round((l+u+h*Math.pow(10,o))*r)/r);for(;f<n;)i.push({value:f,major:pd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),f=Math.round((l+u+h*Math.pow(10,o))*r)/r;const m=ve(e.max,f);return i.push({value:m,major:pd(m),significand:h}),i}class A0 extends Vn{static id="logarithmic";static defaults={ticks:{callback:ao.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=ko.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===Wn(this.min,0)?Wn(this.min,-1):Wn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Wn(i,-1)),r(Wn(s,1)))),i<=0&&o(Wn(s,-1)),s<=0&&r(Wn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=E0(n,this);return t.bounds==="ticks"&&gc(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":Qi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=pn(t),this._valueRange=pn(this.max)-pn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(pn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function da(e){const t=e.ticks;if(t.display&&e.display){const n=Wt(t.backdropPadding);return at(t.font&&t.font.size,Et.font.size)+n.height}return 0}function P0(e,t,n){return n=xt(n)?n:[n],{w:Ap(e,t.string,n),h:n.length*t.lineHeight}}function yd(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function R0(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=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?dt/o:0;for(let l=0;l<o;l++){const c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+s[l],a),h=Pt(c.font),f=P0(e.ctx,h,e._pointLabels[l]);i[l]=f;const m=ne(e.getIndexAngle(l)+a),p=Math.round(so(m)),y=yd(p,u.x,f.w,0,180),b=yd(p,u.y,f.h,90,270);I0(n,t,m,y,b)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=F0(e,i,s)}function I0(e,t,n,i,s){const o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function L0(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=n,l=e.getPointPosition(t,i+s+r,o),c=Math.round(so(ne(l.angle+Ot))),u=U0(l.y,a.h,c),h=B0(c),f=z0(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+a.w,bottom:u+a.h}}function N0(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:o}=e;return!(Qe({x:n,y:i},t)||Qe({x:n,y:o},t)||Qe({x:s,y:i},t)||Qe({x:s,y:o},t))}function F0(e,t,n){const i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:da(o)/2,additionalAngle:r?dt/s:0};let c;for(let u=0;u<s;u++){l.padding=n[u],l.size=t[u];const h=L0(e,u,l);i.push(h),a==="auto"&&(h.visible=N0(h,c),h.visible&&(c=h))}return i}function B0(e){return e===0||e===180?"center":e<180?"left":"right"}function z0(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function U0(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function H0(e,t,n){const{left:i,top:s,right:o,bottom:r}=n,{backdropColor:a}=t;if(!rt(a)){const l=yn(t.borderRadius),c=Wt(t.backdropPadding);e.fillStyle=a;const u=i-c.left,h=s-c.top,f=o-i+c.width,m=r-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),hi(e,{x:u,y:h,w:f,h:m,radius:l}),e.fill()):e.fillRect(u,h,f,m)}}function V0(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(e.getPointLabelContext(s));H0(n,r,o);const a=Pt(r.font),{x:l,y:c,textAlign:u}=o;Bn(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function bd(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Dt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function W0(e,t,n,i,s){const o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),bd(e,n,r,i),o.closePath(),o.stroke(),o.restore())}function $0(e,t,n){return bn(e,{label:n,index:t,type:"pointLabel"})}class Y0 extends ko{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ao.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=Wt(da(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=At(t)&&!isNaN(t)?t:0,this.max=At(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/da(this.options))}generateTickLabels(t){ko.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const s=wt(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?R0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Dt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ne(t*n+Vt(i))}getDistanceFromCenterForValue(t){if(rt(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(rt(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 $0(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const s=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}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:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),bd(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:s,border:o}=n,r=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&V0(this,r),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),p=o.setContext(f);W0(this,m,l,r,p)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=Pt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const h=Wt(c.backdropPadding);t.fillRect(-r/2-h.left,-o-u.size/2-h.top,r+h.width,u.size+h.height)}Bn(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Do={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ye=Object.keys(Do);function _d(e,t){return e-t}function xd(e,t){if(rt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),At(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(gn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function wd(e,t,n,i){const s=ye.length;for(let o=ye.indexOf(e);o<s-1;++o){const r=Do[ye[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return ye[o]}return ye[s-1]}function j0(e,t,n,i,s){for(let o=ye.length-1;o>=ye.indexOf(n);o--){const r=ye[o];if(Do[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return ye[n?ye.indexOf(n):0]}function q0(e){for(let t=ye.indexOf(e)+1,n=ye.length;t<n;++t)if(Do[ye[t]].common)return ye[t]}function Sd(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=Ar(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function G0(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function Td(e,t,n){const i=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!n?i:G0(e,i,s,n)}class ha extends Vn{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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={}),s=this._adapter=new du._date(t.adapters.date);s.init(n),Gi(i.displayFormats,s.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:xd(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:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=At(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=At(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_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,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 o=this.min,r=this.max,a=bp(s,o,r);return this._unit=n.unit||(i.autoSkip?wd(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):j0(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:q0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Td(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;n=Kt(n,0,r),i=Kt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||wd(o.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=gn(l)||l===!0,u={};let h=n,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":r),t.diff(i,n,r)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+r);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,a,r),m++)Sd(u,f,p);return(f===i||s.bounds==="ticks"||m===1)&&Sd(u,f,p),Object.keys(u).sort(_d).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 s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return wt(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],f=i[n],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.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,s=Vt(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Td(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,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(n=0,i=s.length;n<i;++n)t=t.concat(s[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 s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(xd(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return xc(t.sort(_d))}}function Co(e,t,n){let i=0,s=e.length-1,o,r,a,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Ze(e,"pos",t)),{pos:o,time:a}=e[i],{pos:r,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Ze(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class K0 extends ha{static id="timeseries";static defaults=ha.defaults;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=Co(n,this.min),this._tableRange=Co(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_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((s,o)=>s-o)}_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(Co(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Co(this._table,i*this._tableRange+this._minPos,!0)}}var X0=Object.freeze({__proto__:null,CategoryScale:k0,LinearScale:C0,LogarithmicScale:A0,RadialLinearScale:Y0,TimeScale:ha,TimeSeriesScale:K0});const Z0=[Zg,Cb,S0,X0],vd=6048e5,Q0=864e5,ms=6e4,yi=36e5,J0=1e3,Md=Symbol.for("constructDateFrom");function It(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Md in e?e[Md](t):e instanceof Date?new e.constructor(t):new Date(t)}function ut(e,t){return It(t||e,e)}function Oo(e,t,n){const i=ut(e,n?.in);return isNaN(t)?It(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function fa(e,t,n){const i=ut(e,n?.in);if(isNaN(t))return It(e,NaN);if(!t)return i;const s=i.getDate(),o=It(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function ma(e,t,n){return It(e,+ut(e)+t)}function t_(e,t,n){return ma(e,t*yi)}let e_={};function $n(){return e_}function Ve(e,t){const n=$n(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ut(e,t?.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function bi(e,t){return Ve(e,{...t,weekStartsOn:1})}function kd(e,t){const n=ut(e,t?.in),i=n.getFullYear(),s=It(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=bi(s),r=It(n,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const a=bi(r);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Eo(e){const t=ut(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 Yn(e,...t){const n=It.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function pa(e,t){const n=ut(e,t?.in);return n.setHours(0,0,0,0),n}function Dd(e,t,n){const[i,s]=Yn(n?.in,e,t),o=pa(i),r=pa(s),a=+o-Eo(o),l=+r-Eo(r);return Math.round((a-l)/Q0)}function n_(e,t){const n=kd(e,t),i=It(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),bi(i)}function i_(e,t,n){const i=ut(e,n?.in);return i.setTime(i.getTime()+t*ms),i}function s_(e,t,n){return fa(e,t*3,n)}function o_(e,t,n){return ma(e,t*1e3)}function r_(e,t,n){return Oo(e,t*7,n)}function a_(e,t,n){return fa(e,t*12,n)}function ps(e,t){const n=+ut(e)-+ut(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 ga(e){return!(!l_(e)&&typeof e!="number"||isNaN(+ut(e)))}function c_(e,t,n){const[i,s]=Yn(n?.in,e,t),o=i.getFullYear()-s.getFullYear(),r=i.getMonth()-s.getMonth();return o*12+r}function u_(e,t,n){const[i,s]=Yn(n?.in,e,t);return i.getFullYear()-s.getFullYear()}function Cd(e,t,n){const[i,s]=Yn(n?.in,e,t),o=Od(i,s),r=Math.abs(Dd(i,s));i.setDate(i.getDate()-o*r);const a=+(Od(i,s)===-o),l=o*(r-a);return l===0?0:l}function Od(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 gs(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function d_(e,t,n){const[i,s]=Yn(n?.in,e,t),o=(+i-+s)/yi;return gs(n?.roundingMethod)(o)}function ya(e,t){return+ut(e)-+ut(t)}function h_(e,t,n){const i=ya(e,t)/ms;return gs(n?.roundingMethod)(i)}function Ed(e,t){const n=ut(e,t?.in);return n.setHours(23,59,59,999),n}function Ad(e,t){const n=ut(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function f_(e,t){const n=ut(e,t?.in);return+Ed(n,t)==+Ad(n,t)}function Pd(e,t,n){const[i,s,o]=Yn(n?.in,e,e,t),r=ps(s,o),a=Math.abs(c_(s,o));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-r*a);let l=ps(s,o)===-r;f_(i)&&a===1&&ps(i,o)===1&&(l=!1);const c=r*(a-+l);return c===0?0:c}function m_(e,t,n){const i=Pd(e,t,n)/3;return gs(n?.roundingMethod)(i)}function p_(e,t,n){const i=ya(e,t)/1e3;return gs(n?.roundingMethod)(i)}function g_(e,t,n){const i=Cd(e,t,n)/7;return gs(n?.roundingMethod)(i)}function y_(e,t,n){const[i,s]=Yn(n?.in,e,t),o=ps(i,s),r=Math.abs(u_(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-o,l=o*(r-+a);return l===0?0:l}function b_(e,t){const n=ut(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function __(e,t){const n=ut(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function x_(e,t){const n=ut(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function Rd(e,t){const n=ut(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function w_(e,t){const n=ut(e,t?.in);return n.setMinutes(59,59,999),n}function S_(e,t){const n=$n(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ut(e,t?.in),o=s.getDay(),r=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+r),s.setHours(23,59,59,999),s}function T_(e,t){const n=ut(e,t?.in);return n.setSeconds(59,999),n}function v_(e,t){const n=ut(e,t?.in),i=n.getMonth(),s=i-i%3+3;return n.setMonth(s,0),n.setHours(23,59,59,999),n}function M_(e,t){const n=ut(e,t?.in);return n.setMilliseconds(999),n}const k_={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"}},D_=(e,t,n)=>{let i;const s=k_[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function ba(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const C_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},O_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},E_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},A_={date:ba({formats:C_,defaultWidth:"full"}),time:ba({formats:O_,defaultWidth:"full"}),dateTime:ba({formats:E_,defaultWidth:"full"})},P_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},R_=(e,t,n,i)=>P_[e];function ys(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const r=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):r;s=e.formattingValues[a]||e.formattingValues[r]}else{const r=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[r]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const I_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},L_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},N_={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"]},F_={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"]},B_={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"}},z_={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"}},U_={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:ys({values:I_,defaultWidth:"wide"}),quarter:ys({values:L_,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ys({values:N_,defaultWidth:"wide"}),day:ys({values:F_,defaultWidth:"wide"}),dayPeriod:ys({values:B_,defaultWidth:"wide",formattingValues:z_,defaultFormattingWidth:"wide"})};function bs(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],a=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?V_(a,h=>h.test(r)):H_(a,h=>h.test(r));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(r.length);return{value:c,rest:u}}}function H_(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function V_(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function W_(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let r=e.valueCallback?e.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;const a=t.slice(s.length);return{value:r,rest:a}}}const $_=/^(\d+)(th|st|nd|rd)?/i,Y_=/\d+/i,j_={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},q_={any:[/^b/i,/^(a|c)/i]},G_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},K_={any:[/1/i,/2/i,/3/i,/4/i]},X_={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},Z_={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]},Q_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},J_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},tx={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},ex={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}},nx={ordinalNumber:W_({matchPattern:$_,parsePattern:Y_,valueCallback:e=>parseInt(e,10)}),era:bs({matchPatterns:j_,defaultMatchWidth:"wide",parsePatterns:q_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:G_,defaultMatchWidth:"wide",parsePatterns:K_,defaultParseWidth:"any",valueCallback:e=>e+1}),month:bs({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:Z_,defaultParseWidth:"any"}),day:bs({matchPatterns:Q_,defaultMatchWidth:"wide",parsePatterns:J_,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:tx,defaultMatchWidth:"any",parsePatterns:ex,defaultParseWidth:"any"})},Id={code:"en-US",formatDistance:D_,formatLong:A_,formatRelative:R_,localize:U_,match:nx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ix(e,t){const n=ut(e,t?.in);return Dd(n,Rd(n))+1}function Ld(e,t){const n=ut(e,t?.in),i=+bi(n)-+n_(n);return Math.round(i/vd)+1}function _a(e,t){const n=ut(e,t?.in),i=n.getFullYear(),s=$n(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,r=It(t?.in||e,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=Ve(r,t),l=It(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=Ve(l,t);return+n>=+a?i+1:+n>=+c?i:i-1}function sx(e,t){const n=$n(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=_a(e,t),o=It(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),Ve(o,t)}function Nd(e,t){const n=ut(e,t?.in),i=+Ve(n,t)-+sx(n,t);return Math.round(i/vd)+1}function Tt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Tn={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];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(),s=Math.trunc(i*Math.pow(10,n-3));return Tt(s,t.length)}},_i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fd={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"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Tn.y(e,t)},Y:function(e,t,n,i){const s=_a(e,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return Tt(r,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Tt(o,t.length)},R:function(e,t){const n=kd(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"});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"});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 Tn.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"});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"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Nd(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(e,t,n){const i=Ld(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"}):Tn.d(e,t)},D:function(e,t,n){const i=ix(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"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Tt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Tt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return n.ordinalNumber(s,{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"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=_i.noon:i===0?s=_i.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=_i.evening:i>=12?s=_i.afternoon:i>=4?s=_i.morning:s=_i.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{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 Tn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Tn.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"}):Tn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Tn.s(e,t)},S:function(e,t){return Tn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return zd(i);case"XXXX":case"XX":return jn(i);default:return jn(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return zd(i);case"xxxx":case"xx":return jn(i);default:return jn(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Bd(i,":");default:return"GMT"+jn(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Bd(i,":");default:return"GMT"+jn(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 Bd(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Tt(o,2)}function zd(e,t){return e%60===0?(e>0?"-":"+")+Tt(Math.abs(e)/60,2):jn(e,t)}function jn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Tt(Math.trunc(i/60),2),o=Tt(i%60,2);return n+s+t+o}const Ud=(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"});default:return t.date({width:"full"})}},Hd=(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"});default:return t.time({width:"full"})}},xa={p:Hd,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ud(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Ud(i,t)).replace("{{time}}",Hd(s,t))}},ox=/^D+$/,rx=/^Y+$/,ax=["D","DD","YY","YYYY"];function Vd(e){return ox.test(e)}function Wd(e){return rx.test(e)}function wa(e,t,n){const i=lx(e,t,n);if(console.warn(i),ax.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 cx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ux=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dx=/^'([^]*?)'?$/,hx=/''/g,fx=/[a-zA-Z]/;function Ao(e,t,n){const i=$n(),s=n?.locale??i.locale??Id,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=ut(e,n?.in);if(!ga(a))throw new RangeError("Invalid time value");let l=t.match(ux).map(u=>{const h=u[0];if(h==="p"||h==="P"){const f=xa[h];return f(u,s.formatLong)}return u}).join("").match(cx).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const h=u[0];if(h==="'")return{isToken:!1,value:mx(u)};if(Fd[h])return{isToken:!0,value:u};if(h.match(fx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:u}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(u=>{if(!u.isToken)return u.value;const h=u.value;(!n?.useAdditionalWeekYearTokens&&Wd(h)||!n?.useAdditionalDayOfYearTokens&&Vd(h))&&wa(h,t,String(e));const f=Fd[h[0]];return f(a,h,s.localize,c)}).join("")}function mx(e){const t=e.match(dx);return t?t[1].replace(hx,"'"):e}function $d(){return Object.assign({},$n())}function px(e,t){const n=ut(e,t?.in).getDay();return n===0?7:n}function gx(e,t){const n=yx(t)?new t(0):It(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){return typeof e=="function"&&e.prototype?.constructor===e}const bx=10;class Yd{subPriority=0;validate(t,n){return!0}}class _x extends Yd{constructor(t,n,i,s,o){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=s,o&&(this.subPriority=o)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class xx extends Yd{priority=bx;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>It(n,i))}set(t,n){return n.timestampIsSet?t:It(t,gx(t,this.context))}}class _t{run(t,n,i,s){const o=this.parse(t,n,i,s);return o?{setter:new _x(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,i){return!0}}class wx extends _t{priority=140;parse(t,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,n,i){return n.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const zt={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}/},We={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 Ut(e,t){return e&&{value:t(e.value),rest:e.rest}}function Rt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function $e(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,s=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,r=n[5]?parseInt(n[5],10):0;return{value:i*(s*yi+o*ms+r*J0),rest:t.slice(n[0].length)}}function jd(e){return Rt(zt.anyDigitsSigned,e)}function Lt(e,t){switch(e){case 1:return Rt(zt.singleDigit,t);case 2:return Rt(zt.twoDigits,t);case 3:return Rt(zt.threeDigits,t);case 4:return Rt(zt.fourDigits,t);default:return Rt(new RegExp("^\\d{1,"+e+"}"),t)}}function Po(e,t){switch(e){case 1:return Rt(zt.singleDigitSigned,t);case 2:return Rt(zt.twoDigitsSigned,t);case 3:return Rt(zt.threeDigitsSigned,t);case 4:return Rt(zt.fourDigitsSigned,t);default:return Rt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Sa(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function qd(e,t){const n=t>0,i=n?t:1-t;let s;if(i<=50)s=e||100;else{const o=i+50,r=Math.trunc(o/100)*100,a=e>=o%100;s=e+r-(a?100:0)}return n?s:1-s}function Gd(e){return e%400===0||e%4===0&&e%100!==0}class Sx extends _t{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Ut(Lt(4,t),s);case"yo":return Ut(i.ordinalNumber(t,{unit:"year"}),s);default:return Ut(Lt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i){const s=t.getFullYear();if(i.isTwoDigitYear){const r=qd(i.year,s);return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Tx extends _t{priority=130;parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Ut(Lt(4,t),s);case"Yo":return Ut(i.ordinalNumber(t,{unit:"year"}),s);default:return Ut(Lt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i,s){const o=_a(t,s);if(i.isTwoDigitYear){const a=qd(i.year,o);return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Ve(t,s)}const r=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(r,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Ve(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class vx extends _t{priority=130;parse(t,n){return Po(n==="R"?4:n.length,t)}set(t,n,i){const s=It(t,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),bi(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class Mx extends _t{priority=130;parse(t,n){return Po(n==="u"?4:n.length,t)}set(t,n,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class kx extends _t{priority=120;parse(t,n,i){switch(n){case"Q":case"QQ":return Lt(n.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Dx extends _t{priority=120;parse(t,n,i){switch(n){case"q":case"qq":return Lt(n.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Cx extends _t{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"M":return Ut(Rt(zt.month,t),s);case"MM":return Ut(Lt(2,t),s);case"Mo":return Ut(i.ordinalNumber(t,{unit:"month"}),s);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class Ox extends _t{priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"L":return Ut(Rt(zt.month,t),s);case"LL":return Ut(Lt(2,t),s);case"Lo":return Ut(i.ordinalNumber(t,{unit:"month"}),s);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Ex(e,t,n){const i=ut(e,n?.in),s=Nd(i,n)-t;return i.setDate(i.getDate()-s*7),ut(i,n?.in)}class Ax extends _t{priority=100;parse(t,n,i){switch(n){case"w":return Rt(zt.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i,s){return Ve(Ex(t,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Px(e,t,n){const i=ut(e,n?.in),s=Ld(i,n)-t;return i.setDate(i.getDate()-s*7),i}class Rx extends _t{priority=100;parse(t,n,i){switch(n){case"I":return Rt(zt.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i){return bi(Px(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Ix=[31,28,31,30,31,30,31,31,30,31,30,31],Lx=[31,29,31,30,31,30,31,31,30,31,30,31];class Nx extends _t{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return Rt(zt.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return Lt(n.length,t)}}validate(t,n){const i=t.getFullYear(),s=Gd(i),o=t.getMonth();return s?n>=1&&n<=Lx[o]:n>=1&&n<=Ix[o]}set(t,n,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Fx extends _t{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return Rt(zt.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return Lt(n.length,t)}}validate(t,n){const i=t.getFullYear();return Gd(i)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Ta(e,t,n){const i=$n(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=ut(e,n?.in),r=o.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(r+c)%7:(l+c)%7-(r+c)%7;return Oo(o,u,n)}class Bx extends _t{priority=90;parse(t,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=Ta(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class zx extends _t{priority=90;parse(t,n,i,s){const o=r=>{const a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(n){case"e":case"ee":return Ut(Lt(n.length,t),o);case"eo":return Ut(i.ordinalNumber(t,{unit:"day"}),o);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=Ta(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Ux extends _t{priority=90;parse(t,n,i,s){const o=r=>{const a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(n){case"c":case"cc":return Ut(Lt(n.length,t),o);case"co":return Ut(i.ordinalNumber(t,{unit:"day"}),o);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=Ta(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Hx(e,t,n){const i=ut(e,n?.in),s=px(i,n),o=t-s;return Oo(i,o,n)}class Vx extends _t{priority=90;parse(t,n,i){const s=o=>o===0?7:o;switch(n){case"i":case"ii":return Lt(n.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return Ut(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return Ut(i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Ut(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);default:return Ut(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,n){return n>=1&&n<=7}set(t,n,i){return t=Hx(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Wx extends _t{priority=80;parse(t,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Sa(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class $x extends _t{priority=80;parse(t,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Sa(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class Yx extends _t{priority=80;parse(t,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Sa(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class jx extends _t{priority=70;parse(t,n,i){switch(n){case"h":return Rt(zt.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,i){const s=t.getHours()>=12;return s&&i<12?t.setHours(i+12,0,0,0):!s&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class qx extends _t{priority=70;parse(t,n,i){switch(n){case"H":return Rt(zt.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Gx extends _t{priority=70;parse(t,n,i){switch(n){case"K":return Rt(zt.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Kx extends _t{priority=70;parse(t,n,i){switch(n){case"k":return Rt(zt.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,i){const s=i<=24?i%24:i;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class Xx extends _t{priority=60;parse(t,n,i){switch(n){case"m":return Rt(zt.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class Zx extends _t{priority=50;parse(t,n,i){switch(n){case"s":return Rt(zt.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class Qx extends _t{priority=30;parse(t,n){const i=s=>Math.trunc(s*Math.pow(10,-n.length+3));return Ut(Lt(n.length,t),i)}set(t,n,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class Jx extends _t{priority=10;parse(t,n){switch(n){case"X":return $e(We.basicOptionalMinutes,t);case"XX":return $e(We.basic,t);case"XXXX":return $e(We.basicOptionalSeconds,t);case"XXXXX":return $e(We.extendedOptionalSeconds,t);default:return $e(We.extended,t)}}set(t,n,i){return n.timestampIsSet?t:It(t,t.getTime()-Eo(t)-i)}incompatibleTokens=["t","T","x"]}class tw extends _t{priority=10;parse(t,n){switch(n){case"x":return $e(We.basicOptionalMinutes,t);case"xx":return $e(We.basic,t);case"xxxx":return $e(We.basicOptionalSeconds,t);case"xxxxx":return $e(We.extendedOptionalSeconds,t);default:return $e(We.extended,t)}}set(t,n,i){return n.timestampIsSet?t:It(t,t.getTime()-Eo(t)-i)}incompatibleTokens=["t","T","X"]}class ew extends _t{priority=40;parse(t){return jd(t)}set(t,n,i){return[It(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class nw extends _t{priority=20;parse(t){return jd(t)}set(t,n,i){return[It(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const iw={G:new wx,y:new Sx,Y:new Tx,R:new vx,u:new Mx,Q:new kx,q:new Dx,M:new Cx,L:new Ox,w:new Ax,I:new Rx,d:new Nx,D:new Fx,E:new Bx,e:new zx,c:new Ux,i:new Vx,a:new Wx,b:new $x,B:new Yx,h:new jx,H:new qx,K:new Gx,k:new Kx,m:new Xx,s:new Zx,S:new Qx,X:new Jx,x:new tw,t:new ew,T:new nw},sw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ow=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rw=/^'([^]*?)'?$/,aw=/''/g,lw=/\S/,cw=/[a-zA-Z]/;function uw(e,t,n,i){const s=()=>It(i?.in||n,NaN),o=$d(),r=i?.locale??o.locale??Id,a=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return e?s():ut(n,i?.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:r},u=[new xx(i?.in,n)],h=t.match(ow).map(b=>{const S=b[0];if(S in xa){const M=xa[S];return M(b,r.formatLong)}return b}).join("").match(sw),f=[];for(let b of h){!i?.useAdditionalWeekYearTokens&&Wd(b)&&wa(b,t,e),!i?.useAdditionalDayOfYearTokens&&Vd(b)&&wa(b,t,e);const S=b[0],M=iw[S];if(M){const{incompatibleTokens:E}=M;if(Array.isArray(E)){const C=f.find(A=>E.includes(A.token)||A.token===S);if(C)throw new RangeError(`The format string mustn't contain \`${C.fullToken}\` and \`${b}\` at the same time`)}else if(M.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);f.push({token:S,fullToken:b});const D=M.run(e,b,r.match,c);if(!D)return s();u.push(D.setter),e=D.rest}else{if(S.match(cw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");if(b==="''"?b="'":S==="'"&&(b=dw(b)),e.indexOf(b)===0)e=e.slice(b.length);else return s()}}if(e.length>0&&lw.test(e))return s();const m=u.map(b=>b.priority).sort((b,S)=>S-b).filter((b,S,M)=>M.indexOf(b)===S).map(b=>u.filter(S=>S.priority===b).sort((S,M)=>M.subPriority-S.subPriority)).map(b=>b[0]);let p=ut(n,i?.in);if(isNaN(+p))return s();const y={};for(const b of m){if(!b.validate(p,c))return s();const S=b.set(p,y,c);Array.isArray(S)?(p=S[0],Object.assign(y,S[1])):p=S}return p}function dw(e){return e.match(rw)[1].replace(aw,"'")}function hw(e,t){const n=ut(e,t?.in);return n.setMinutes(0,0,0),n}function fw(e,t){const n=ut(e,t?.in);return n.setSeconds(0,0),n}function mw(e,t){const n=ut(e,t?.in);return n.setMilliseconds(0),n}function pw(e){const t=e/yi;return Math.trunc(t)}function Kd(e,t){const n=()=>It(t?.in,NaN),i=t?.additionalDigits??2,s=_w(e);let o;if(s.date){const c=xw(s.date,i);o=ww(c.restDateString,c.year)}if(!o||isNaN(+o))return n();const r=+o;let a=0,l;if(s.time&&(a=Sw(s.time),isNaN(a)))return n();if(s.timezone){if(l=Tw(s.timezone),isNaN(l))return n()}else{const c=new Date(r+a),u=ut(0,t?.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return ut(r+a+l,t?.in)}const Ro={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},gw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,yw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,bw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function _w(e){const t={},n=e.split(Ro.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],Ro.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Ro.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const s=Ro.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function xw(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 s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((i[1]||i[2]).length)}}function ww(e,t){if(t===null)return new Date(NaN);const n=e.match(gw);if(!n)return new Date(NaN);const i=!!n[4],s=_s(n[1]),o=_s(n[2])-1,r=_s(n[3]),a=_s(n[4]),l=_s(n[5])-1;if(i)return Cw(t,a,l)?vw(t,a,l):new Date(NaN);{const c=new Date(0);return!kw(t,o,r)||!Dw(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,r)),c)}}function _s(e){return e?parseInt(e):1}function Sw(e){const t=e.match(yw);if(!t)return NaN;const n=va(t[1]),i=va(t[2]),s=va(t[3]);return Ow(n,i,s)?n*yi+i*ms+s*1e3:NaN}function va(e){return e&&parseFloat(e.replace(",","."))||0}function Tw(e){if(e==="Z")return 0;const t=e.match(bw);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Ew(i,s)?n*(i*yi+s*ms):NaN}function vw(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=(t-1)*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const Mw=[31,null,31,30,31,30,31,31,30,31,30,31];function Xd(e){return e%400===0||e%4===0&&e%100!==0}function kw(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Mw[t]||(Xd(e)?29:28))}function Dw(e,t){return t>=1&&t<=(Xd(e)?366:365)}function Cw(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Ow(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Ew(e,t){return t>=0&&t<=59}const Aw=1e3;var et=(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))(et||{});const Pw=["in","not_in","selector"],Rw=["empty","not_empty"],Iw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],qn=e=>e.filter(t=>t!=="time"),Zd=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Qd=qn(Zd),Lw=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Jd=[...Zd,"application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","consumer","consumer_group","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],th=qn(Jd),Nw=[...Lw,"response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],Fw=["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","principal"],eh=qn(Fw);qn(["a2a_context_id","a2a_error","a2a_method","a2a_task_id","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_detection_reason","bot_info_ja4_fingerprint","bot_info_ban_type","bot_info_header_names","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","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","portal","principal","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"]),qn(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","latencies_kong_internal_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]);const Bw=["platform","platform_usage"],zw=e=>Bw.includes(e),Uw=[...Jd,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],nh=qn(Uw);[...Nw];const Hw=["control_plane","data_plane_group","managed_cache","network","provider","region","time"],Vw=qn(Hw);new Set(Qd),new Set(th),new Set(eh),new Set(nh),new Set(Vw);const ih=[{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"}];ih.map(e=>e.code);const Ww=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Pw},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Rw}},required:["field","operator"],additionalProperties:!1}]}}),$w=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Ww([...new Set([...th,...Qd,...eh,...nh,...$w])]);const Yw={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"}},jw=(e,t,n)=>{let i;const s=Yw[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Ma(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const qw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xw={date:Ma({formats:qw,defaultWidth:"full"}),time:Ma({formats:Gw,defaultWidth:"full"}),dateTime:Ma({formats:Kw,defaultWidth:"full"})},Zw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qw=(e,t,n,i)=>Zw[e];function xs(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const r=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):r;s=e.formattingValues[a]||e.formattingValues[r]}else{const r=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[r]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const Jw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},eS={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"]},nS={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"]},iS={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"}},sS={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"}},oS=(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"},rS={ordinalNumber:oS,era:xs({values:Jw,defaultWidth:"wide"}),quarter:xs({values:tS,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xs({values:eS,defaultWidth:"wide"}),day:xs({values:nS,defaultWidth:"wide"}),dayPeriod:xs({values:iS,defaultWidth:"wide",formattingValues:sS,defaultFormattingWidth:"wide"})};function ws(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],a=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?lS(a,h=>h.test(r)):aS(a,h=>h.test(r));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(r.length);return{value:c,rest:u}}}function aS(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lS(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function cS(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let r=e.valueCallback?e.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;const a=t.slice(s.length);return{value:r,rest:a}}}const uS=/^(\d+)(th|st|nd|rd)?/i,dS=/\d+/i,hS={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},fS={any:[/^b/i,/^(a|c)/i]},mS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pS={any:[/1/i,/2/i,/3/i,/4/i]},gS={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},yS={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]},bS={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},_S={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]},xS={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},wS={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}},SS={ordinalNumber:cS({matchPattern:uS,parsePattern:dS,valueCallback:e=>parseInt(e,10)}),era:ws({matchPatterns:hS,defaultMatchWidth:"wide",parsePatterns:fS,defaultParseWidth:"any"}),quarter:ws({matchPatterns:mS,defaultMatchWidth:"wide",parsePatterns:pS,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ws({matchPatterns:gS,defaultMatchWidth:"wide",parsePatterns:yS,defaultParseWidth:"any"}),day:ws({matchPatterns:bS,defaultMatchWidth:"wide",parsePatterns:_S,defaultParseWidth:"any"}),dayPeriod:ws({matchPatterns:xS,defaultMatchWidth:"any",parsePatterns:wS,defaultParseWidth:"any"})},TS={code:"en-US",formatDistance:jw,formatLong:Xw,formatRelative:Qw,localize:rS,match:SS,options:{weekStartsOn:0,firstWeekContainsDate:1}};let vS={};function Ss(){return vS}const sh=6048e5,MS=864e5,kS=60,DS=3600,oh=Symbol.for("constructDateFrom");function Oe(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&oh in e?e[oh](t):e instanceof Date?new e.constructor(t):new Date(t)}function re(e,t){return Oe(t||e,e)}function rh(e){const t=re(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 CS(e,...t){const n=Oe.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function xi(e,t){const n=re(e,t?.in);return n.setHours(0,0,0,0),n}function OS(e,t,n){const[i,s]=CS(n?.in,e,t),o=xi(i),r=xi(s),a=+o-rh(o),l=+r-rh(r);return Math.round((a-l)/MS)}function ES(e,t){const n=re(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function AS(e,t){const n=re(e,t?.in);return OS(n,ES(n))+1}function en(e,t){const n=Ss(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=re(e,t?.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function Io(e,t){return en(e,{...t,weekStartsOn:1})}function ah(e,t){const n=re(e,t?.in),i=n.getFullYear(),s=Oe(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Io(s),r=Oe(n,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const a=Io(r);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function PS(e,t){const n=ah(e,t),i=Oe(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Io(i)}function RS(e,t){const n=re(e,t?.in),i=+Io(n)-+PS(n);return Math.round(i/sh)+1}function lh(e,t){const n=re(e,t?.in),i=n.getFullYear(),s=Ss(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,r=Oe(t?.in||e,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=en(r,t),l=Oe(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=en(l,t);return+n>=+a?i+1:+n>=+c?i:i-1}function IS(e,t){const n=Ss(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=lh(e,t),o=Oe(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),en(o,t)}function LS(e,t){const n=re(e,t?.in),i=+en(n,t)-+IS(n,t);return Math.round(i/sh)+1}function vt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const vn={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return vt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):vt(n+1,2)},d(e,t){return vt(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];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return vt(e.getHours()%12||12,t.length)},H(e,t){return vt(e.getHours(),t.length)},m(e,t){return vt(e.getMinutes(),t.length)},s(e,t){return vt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return vt(s,t.length)}},wi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ch={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"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return vn.y(e,t)},Y:function(e,t,n,i){const s=lh(e,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return vt(r,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):vt(o,t.length)},R:function(e,t){const n=ah(e);return vt(n,t.length)},u:function(e,t){const n=e.getFullYear();return vt(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 vt(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"});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 vt(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"});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 vn.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"});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 vt(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"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=LS(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):vt(s,t.length)},I:function(e,t,n){const i=RS(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):vt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):vn.d(e,t)},D:function(e,t,n){const i=AS(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):vt(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"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return vt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return vt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return vt(s,t.length);case"io":return n.ordinalNumber(s,{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"});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"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.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 n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.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 n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{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 vn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):vn.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):vn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):vn.s(e,t)},S:function(e,t){return vn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return dh(i);case"XXXX":case"XX":return Gn(i);default:return Gn(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return dh(i);case"xxxx":case"xx":return Gn(i);default:return Gn(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+uh(i,":");default:return"GMT"+Gn(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+uh(i,":");default:return"GMT"+Gn(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return vt(i,t.length)},T:function(e,t,n){return vt(+e,t.length)}};function uh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+vt(o,2)}function dh(e,t){return e%60===0?(e>0?"-":"+")+vt(Math.abs(e)/60,2):Gn(e,t)}function Gn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=vt(Math.trunc(i/60),2),o=vt(i%60,2);return n+s+t+o}const hh=(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"});default:return t.date({width:"full"})}},fh=(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"});default:return t.time({width:"full"})}},NS=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return hh(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",hh(i,t)).replace("{{time}}",fh(s,t))},FS={p:fh,P:NS},BS=/^D+$/,zS=/^Y+$/,US=["D","DD","YY","YYYY"];function HS(e){return BS.test(e)}function VS(e){return zS.test(e)}function WS(e,t,n){const i=$S(e,t,n);if(console.warn(i),US.includes(e))throw new RangeError(i)}function $S(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 YS(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function jS(e){return!(!YS(e)&&typeof e!="number"||isNaN(+re(e)))}const qS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,GS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,KS=/^'([^]*?)'?$/,XS=/''/g,ZS=/[a-zA-Z]/;function QS(e,t,n){const i=Ss(),s=n?.locale??i.locale??TS,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=re(e,n?.in);if(!jS(a))throw new RangeError("Invalid time value");let l=t.match(GS).map(u=>{const h=u[0];if(h==="p"||h==="P"){const f=FS[h];return f(u,s.formatLong)}return u}).join("").match(qS).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const h=u[0];if(h==="'")return{isToken:!1,value:JS(u)};if(ch[h])return{isToken:!0,value:u};if(h.match(ZS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:u}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(u=>{if(!u.isToken)return u.value;const h=u.value;(!n?.useAdditionalWeekYearTokens&&VS(h)||!n?.useAdditionalDayOfYearTokens&&HS(h))&&WS(h,t,String(e));const f=ch[h[0]];return f(a,h,s.localize,c)}).join("")}function JS(e){const t=e.match(KS);return t?t[1].replace(XS,"'"):e}function Lo(e,t,n){const i=re(e,n?.in);return isNaN(t)?Oe(e,NaN):(i.setDate(i.getDate()+t),i)}function mh(e,t,n){const i=re(e,n?.in);if(isNaN(t))return Oe(e,NaN);if(!t)return i;const s=i.getDate(),o=Oe(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function tT(e,t,n){return mh(e,t*3,n)}function Si(e,t){const n=re(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function Ti(e,t){const n=re(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function eT(e,t){const n=re(e,t?.in),i=n.getFullYear(),s=n.getMonth(),o=Oe(n,0);return o.setFullYear(i,s+1,0),o.setHours(0,0,0,0),o.getDate()}function nT(){return Object.assign({},Ss())}function ph(e){return Math.trunc(e*DS)}function iT(e){const t=e/kS;return Math.trunc(t)}function gh(e,t,n){return mh(e,-1,n)}function yh(e,t,n){return tT(e,-1,n)}function bh(e,t,n){const i=nT(),s=rT(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?sT(s,t):oT(s,t)}function sT(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 oT(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function rT(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function aT(e,t){const n=hT(t);return"formatToParts"in n?cT(n,e):uT(n,e)}const lT={year:0,month:1,day:2,hour:3,minute:4,second:5};function cT(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=lT[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function uT(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 ka={},_h=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")),dT=_h==="06/25/2014, 00:00:00"||_h==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function hT(e){return ka[e]||(ka[e]=dT?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"})),ka[e]}function Da(e,t,n,i,s,o,r){const a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(i,s,o,r),a}const xh=36e5,fT=6e4,Ca={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ts(e,t,n){if(!e)return 0;let i=Ca.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=Ca.timezoneHH.exec(e),i)return s=parseInt(i[1],10),wh(s)?-(s*xh):NaN;if(i=Ca.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const r=parseInt(i[3],10);return wh(s,r)?(o=Math.abs(s)*xh+r*fT,i[1]==="+"?-o:o):NaN}if(gT(e)){t=new Date(t||Date.now());const r=n?t:mT(t),a=Oa(r,e);return-(n?a:pT(t,a,e))}return NaN}function mT(e){return Da(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Oa(e,t){const n=aT(e,t),i=Da(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function pT(e,t,n){let i=e.getTime()-t;const s=Oa(new Date(i),n);if(t===s)return t;i-=s-t;const o=Oa(new Date(i),n);return s===o?s:Math.max(s,o)}function wh(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Sh={};function gT(e){if(Sh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Sh[e]=!0,!0}catch{return!1}}const yT=60*1e3,bT={X:function(e,t,n){const i=Ea(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Th(i);case"XXXX":case"XX":return vi(i);default:return vi(i,":")}},x:function(e,t,n){const i=Ea(n.timeZone,e);switch(t){case"x":return Th(i);case"xxxx":case"xx":return vi(i);default:return vi(i,":")}},O:function(e,t,n){const i=Ea(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+_T(i,":");default:return"GMT"+vi(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return bh("short",e,n);default:return bh("long",e,n)}}};function Ea(e,t){const n=e?Ts(e,t,!0)/yT:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function No(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function vi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=No(Math.floor(i/60),2),o=No(Math.floor(i%60),2);return n+s+t+o}function Th(e,t){return e%60===0?(e>0?"-":"+")+No(Math.abs(e)/60,2):vi(e,t)}function _T(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+No(o,2)}function vh(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 Mh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Aa=36e5,kh=6e4,xT=2,ce={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:Mh};function Fo(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?xT: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=wT(e),{year:s,restDateString:o}=ST(i.date,n),r=TT(o,s);if(r===null||isNaN(r.getTime()))return new Date(NaN);if(r){const a=r.getTime();let l=0,c;if(i.time&&(l=vT(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ts(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=vh(new Date(a+l)),c=vh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function wT(e){const t={};let n=ce.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=ce.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=ce.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function ST(e,t){if(e){const n=ce.YYY[t],i=ce.YYYYY[t];let s=ce.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=ce.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function TT(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=ce.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,Oh(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=ce.DDD.exec(e),o){n=new Date(0);const r=parseInt(o[1],10);return DT(t,r)?(n.setUTCFullYear(t,0,r),n):new Date(NaN)}if(o=ce.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const r=parseInt(o[2],10);return Oh(t,i,r)?(n.setUTCFullYear(t,i,r),n):new Date(NaN)}if(o=ce.Www.exec(e),o)return s=parseInt(o[1],10)-1,Eh(s)?Dh(t,s):new Date(NaN);if(o=ce.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const r=parseInt(o[2],10)-1;return Eh(s,r)?Dh(t,s,r):new Date(NaN)}return null}function vT(e){let t,n,i=ce.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Pa(t)?t%24*Aa:NaN;if(i=ce.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Pa(t,n)?t%24*Aa+n*kh:NaN;if(i=ce.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Pa(t,n,s)?t%24*Aa+n*kh+s*1e3:NaN}return null}function Dh(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const MT=[31,28,31,30,31,30,31,31,30,31,30,31],kT=[31,29,31,30,31,30,31,31,30,31,30,31];function Ch(e){return e%400===0||e%4===0&&e%100!==0}function Oh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Ch(e);if(i&&n>kT[t]||!i&&n>MT[t])return!1}return!0}function DT(e,t){if(t<1)return!1;const n=Ch(e);return!(n&&t>366||!n&&t>365)}function Eh(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Pa(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const CT=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function OT(e,t,n={}){t=String(t);const i=t.match(CT);if(i){const s=Fo(n.originalDate||e,n);t=i.reduce(function(o,r){if(r[0]==="'")return o;const a=o.indexOf(r),l=o[a-1]==="'",c=o.replace(r,"'"+bT[r[0]](s,r,n)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return QS(e,t,n)}function Ah(e,t,n){e=Fo(e,n);const i=Ts(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Ph(e,t,n,i){return i={...i,timeZone:t,originalDate:e},OT(Ah(e,t,{timeZone:i.timeZone}),n,i)}function ET(e,t,n){if(typeof e=="string"&&!e.match(Mh))return Fo(e,{...n,timeZone:t});e=Fo(e,n);const i=Da(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),s=Ts(t,new Date(i));return new Date(i+s)}function AT(e,t){return-Ts(e,t)}function Rh(e,t={}){const n=t?.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;let i="MMM dd, yyy hh:mm a";switch(t.format){case"short":i="MMM dd, yyyy";break;case"default":i="MMM dd, yyyy hh:mm a";break;case"full":i="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(i+=" (z)"),Ph(e,n,i)}function PT(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 s=new Date(e);return Ph(s,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const RT={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:300*1e3,tenMinutely:600*1e3,thirtyMinutely:1800*1e3,hourly:3600*1e3,twoHourly:7200*1e3,twelveHourly:720*60*1e3,daily:3600*24*1e3,weekly:3600*24*7*1e3,trend:0};function Ra(e){return e&&Iw.find(t=>e<=RT[t])||null}var Bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},zo={exports:{}};zo.exports;var Ih;function IT(){return Ih||(Ih=1,(function(e,t){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",r="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",p="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",M="[object String]",E="[object Symbol]",D="[object WeakMap]",C="[object ArrayBuffer]",A="[object DataView]",O="[object Float32Array]",x="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",k="[object Int32Array]",I="[object Uint8Array]",Y="[object Uint8ClampedArray]",U="[object Uint16Array]",j="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,$=/\w*$/,R=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,z={};z[o]=z[r]=z[C]=z[A]=z[a]=z[l]=z[O]=z[x]=z[_]=z[T]=z[k]=z[f]=z[m]=z[p]=z[b]=z[S]=z[M]=z[E]=z[I]=z[Y]=z[U]=z[j]=!0,z[c]=z[u]=z[D]=!1;var P=typeof Bo=="object"&&Bo&&Bo.Object===Object&&Bo,N=typeof self=="object"&&self&&self.Object===Object&&self,V=P||N||Function("return this")(),Q=t&&!t.nodeType&&t,X=Q&&!0&&e&&!e.nodeType&&e,q=X&&X.exports===Q;function G(w,L){return w.set(L[0],L[1]),w}function J(w,L){return w.add(L),w}function nt(w,L){for(var W=-1,it=w?w.length:0;++W<it&&L(w[W],W,w)!==!1;);return w}function tt(w,L){for(var W=-1,it=L.length,Ht=w.length;++W<it;)w[Ht+W]=L[W];return w}function Z(w,L,W,it){for(var Ht=-1,qt=w?w.length:0;++Ht<qt;)W=L(W,w[Ht],Ht,w);return W}function pt(w,L){for(var W=-1,it=Array(w);++W<w;)it[W]=L(W);return it}function bt(w,L){return w?.[L]}function ot(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function gt(w){var L=-1,W=Array(w.size);return w.forEach(function(it,Ht){W[++L]=[Ht,it]}),W}function ct(w,L){return function(W){return w(L(W))}}function $t(w){var L=-1,W=Array(w.size);return w.forEach(function(it){W[++L]=it}),W}var lt=Array.prototype,Mt=Function.prototype,Yt=Object.prototype,_e=V["__core-js_shared__"],Jt=(function(){var w=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""})(),Ye=Mt.toString,Ct=Yt.hasOwnProperty,te=Yt.toString,Nt=RegExp("^"+Ye.call(Ct).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jt=q?V.Buffer:void 0,ee=V.Symbol,je=V.Uint8Array,ni=ct(Object.getPrototypeOf,Object),Le=Object.create,Ft=Yt.propertyIsEnumerable,xe=lt.splice,ii=Object.getOwnPropertySymbols,ar=jt?jt.isBuffer:void 0,lr=ct(Object.keys,Object),Us=Pn(V,"DataView"),si=Pn(V,"Map"),Hs=Pn(V,"Promise"),oi=Pn(V,"Set"),sn=Pn(V,"WeakMap"),on=Pn(Object,"create"),Vs=ae(Us),Ws=ae(si),ri=ae(Hs),xl=ae(oi),wl=ae(sn),cr=ee?ee.prototype:void 0,ur=cr?cr.valueOf:void 0;function rn(w){var L=-1,W=w?w.length:0;for(this.clear();++L<W;){var it=w[L];this.set(it[0],it[1])}}function Ii(){this.__data__=on?on(null):{}}function $s(w){return this.has(w)&&delete this.__data__[w]}function dr(w){var L=this.__data__;if(on){var W=L[w];return W===i?void 0:W}return Ct.call(L,w)?L[w]:void 0}function an(w){var L=this.__data__;return on?L[w]!==void 0:Ct.call(L,w)}function Sl(w,L){var W=this.__data__;return W[w]=on&&L===void 0?i:L,this}rn.prototype.clear=Ii,rn.prototype.delete=$s,rn.prototype.get=dr,rn.prototype.has=an,rn.prototype.set=Sl;function Ne(w){var L=-1,W=w?w.length:0;for(this.clear();++L<W;){var it=w[L];this.set(it[0],it[1])}}function Tl(){this.__data__=[]}function vl(w){var L=this.__data__,W=Ni(L,w);if(W<0)return!1;var it=L.length-1;return W==it?L.pop():xe.call(L,W,1),!0}function Ml(w){var L=this.__data__,W=Ni(L,w);return W<0?void 0:L[W][1]}function Fe(w){return Ni(this.__data__,w)>-1}function kl(w,L){var W=this.__data__,it=Ni(W,w);return it<0?W.push([w,L]):W[it][1]=L,this}Ne.prototype.clear=Tl,Ne.prototype.delete=vl,Ne.prototype.get=Ml,Ne.prototype.has=Fe,Ne.prototype.set=kl;function En(w){var L=-1,W=w?w.length:0;for(this.clear();++L<W;){var it=w[L];this.set(it[0],it[1])}}function Dl(){this.__data__={hash:new rn,map:new(si||Ne),string:new rn}}function Cl(w){return zi(this,w).delete(w)}function Ol(w){return zi(this,w).get(w)}function Be(w){return zi(this,w).has(w)}function El(w,L){return zi(this,w).set(w,L),this}En.prototype.clear=Dl,En.prototype.delete=Cl,En.prototype.get=Ol,En.prototype.has=Be,En.prototype.set=El;function An(w){this.__data__=new Ne(w)}function Al(){this.__data__=new Ne}function Pl(w){return this.__data__.delete(w)}function Rl(w){return this.__data__.get(w)}function Li(w){return this.__data__.has(w)}function Il(w,L){var W=this.__data__;if(W instanceof Ne){var it=W.__data__;if(!si||it.length<n-1)return it.push([w,L]),this;W=this.__data__=new En(it)}return W.set(w,L),this}An.prototype.clear=Al,An.prototype.delete=Pl,An.prototype.get=Rl,An.prototype.has=Li,An.prototype.set=Il;function Ll(w,L){var W=Gs(w)||Hi(w)?pt(w.length,String):[],it=W.length,Ht=!!it;for(var qt in w)Ct.call(w,qt)&&!(Ht&&(qt=="length"||Ql(qt,it)))&&W.push(qt);return W}function Pe(w,L,W){var it=w[L];(!(Ct.call(w,L)&&qs(it,W))||W===void 0&&!(L in w))&&(w[L]=W)}function Ni(w,L){for(var W=w.length;W--;)if(qs(w[W][0],L))return W;return-1}function Nl(w,L){return w&&hr(L,ai(L),w)}function Ys(w,L,W,it,Ht,qt,we){var Zt;if(it&&(Zt=qt?it(w,Ht,qt,we):it(w)),Zt!==void 0)return Zt;if(!cn(w))return w;var _r=Gs(w);if(_r){if(Zt=Xl(w),!L)return ql(w,Zt)}else{var Rn=qe(w),xr=Rn==u||Rn==h;if(gr(w))return Hl(w,L);if(Rn==p||Rn==o||xr&&!qt){if(ot(w))return qt?w:{};if(Zt=mr(xr?{}:w),!L)return Gl(w,Nl(Zt,w))}else{if(!z[Rn])return qt?w:{};Zt=Zl(w,Rn,Ys,L)}}we||(we=new An);var wr=we.get(w);if(wr)return wr;if(we.set(w,Zt),!_r)var li=W?Kl(w):ai(w);return nt(li||w,function(Xs,Vi){li&&(Vi=Xs,Xs=w[Vi]),Pe(Zt,Vi,Ys(Xs,L,W,it,Vi,w,we))}),Zt}function Fl(w){return cn(w)?Le(w):{}}function Bl(w,L,W){var it=L(w);return Gs(w)?it:tt(it,W(w))}function zl(w){return te.call(w)}function Fi(w){if(!cn(w)||Jl(w))return!1;var L=Ks(w)||ot(w)?Nt:R;return L.test(ae(w))}function Ul(w){if(!ln(w))return lr(w);var L=[];for(var W in Object(w))Ct.call(w,W)&&W!="constructor"&&L.push(W);return L}function Hl(w,L){if(L)return w.slice();var W=new w.constructor(w.length);return w.copy(W),W}function Bi(w){var L=new w.constructor(w.byteLength);return new je(L).set(new je(w)),L}function Vl(w,L){var W=L?Bi(w.buffer):w.buffer;return new w.constructor(W,w.byteOffset,w.byteLength)}function Wl(w,L,W){var it=L?W(gt(w),!0):gt(w);return Z(it,G,new w.constructor)}function js(w){var L=new w.constructor(w.source,$.exec(w));return L.lastIndex=w.lastIndex,L}function $l(w,L,W){var it=L?W($t(w),!0):$t(w);return Z(it,J,new w.constructor)}function Yl(w){return ur?Object(ur.call(w)):{}}function jl(w,L){var W=L?Bi(w.buffer):w.buffer;return new w.constructor(W,w.byteOffset,w.length)}function ql(w,L){var W=-1,it=w.length;for(L||(L=Array(it));++W<it;)L[W]=w[W];return L}function hr(w,L,W,it){W||(W={});for(var Ht=-1,qt=L.length;++Ht<qt;){var we=L[Ht],Zt=void 0;Pe(W,we,Zt===void 0?w[we]:Zt)}return W}function Gl(w,L){return hr(w,fr(w),L)}function Kl(w){return Bl(w,ai,fr)}function zi(w,L){var W=w.__data__;return Ui(L)?W[typeof L=="string"?"string":"hash"]:W.map}function Pn(w,L){var W=bt(w,L);return Fi(W)?W:void 0}var fr=ii?ct(ii,Object):yr,qe=zl;(Us&&qe(new Us(new ArrayBuffer(1)))!=A||si&&qe(new si)!=f||Hs&&qe(Hs.resolve())!=y||oi&&qe(new oi)!=S||sn&&qe(new sn)!=D)&&(qe=function(w){var L=te.call(w),W=L==p?w.constructor:void 0,it=W?ae(W):void 0;if(it)switch(it){case Vs:return A;case Ws:return f;case ri:return y;case xl:return S;case wl:return D}return L});function Xl(w){var L=w.length,W=w.constructor(L);return L&&typeof w[0]=="string"&&Ct.call(w,"index")&&(W.index=w.index,W.input=w.input),W}function mr(w){return typeof w.constructor=="function"&&!ln(w)?Fl(ni(w)):{}}function Zl(w,L,W,it){var Ht=w.constructor;switch(L){case C:return Bi(w);case a:case l:return new Ht(+w);case A:return Vl(w,it);case O:case x:case _:case T:case k:case I:case Y:case U:case j:return jl(w,it);case f:return Wl(w,it,W);case m:case M:return new Ht(w);case b:return js(w);case S:return $l(w,it,W);case E:return Yl(w)}}function Ql(w,L){return L=L??s,!!L&&(typeof w=="number"||B.test(w))&&w>-1&&w%1==0&&w<L}function Ui(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function Jl(w){return!!Jt&&Jt in w}function ln(w){var L=w&&w.constructor,W=typeof L=="function"&&L.prototype||Yt;return w===W}function ae(w){if(w!=null){try{return Ye.call(w)}catch{}try{return w+""}catch{}}return""}function tc(w){return Ys(w,!0,!0)}function qs(w,L){return w===L||w!==w&&L!==L}function Hi(w){return ec(w)&&Ct.call(w,"callee")&&(!Ft.call(w,"callee")||te.call(w)==o)}var Gs=Array.isArray;function pr(w){return w!=null&&nc(w.length)&&!Ks(w)}function ec(w){return un(w)&&pr(w)}var gr=ar||br;function Ks(w){var L=cn(w)?te.call(w):"";return L==u||L==h}function nc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function cn(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function un(w){return!!w&&typeof w=="object"}function ai(w){return pr(w)?Ll(w):Ul(w)}function yr(){return[]}function br(){return!1}e.exports=tc})(zo,zo.exports)),zo.exports}IT();const Ee=(e,t)=>new Date(e.getTime()-AT(t,e));class Xt{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){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<=168&&n.add("hourly"),i>=48&&n.add("daily"),i>=672&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const n=ET(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Ah(n,t)}}class LT extends Xt{rawStart(t){let n=en(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class NT extends Xt{rawStart(t){let n=Ti(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class FT extends Xt{rawStart(t){let n=Si(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class BT extends Xt{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class zT extends Xt{rawEnd(t){let n=en(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Ee(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=en(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=Ee(i,t)),i}}class UT extends Xt{rawEnd(t){let n=Si(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}rawStart(t){let n=Si(yh(this.tzAdjustedDate(t)));return t&&(n=Ee(n,t)),n}}class HT extends Xt{rawEnd(t){let n=Ti(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}rawStart(t){let n=Ti(gh(this.tzAdjustedDate(t)));return t&&(n=Ee(n,t)),n}}class VT extends Xt{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=Ee(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=Ee(n,t)),n}}et.FIFTEEN_MIN,new Xt({key:et.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>900,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),et.ONE_HOUR,new Xt({key:et.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>3600*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),et.SIX_HOUR,new Xt({key:et.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>3600*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),et.TWELVE_HOUR,new Xt({key:et.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>3600*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),et.ONE_DAY,new Xt({key:et.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>3600*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),et.SEVEN_DAY,new Xt({key:et.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),et.THIRTY_DAY,new Xt({key:et.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>3600*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),et.NINETY_DAY,new Xt({key:et.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>3600*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),et.ONE_HUNDRED_EIGHTY_DAY,new Xt({key:et.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>3600*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),et.ONE_YEAR,new Xt({key:et.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>3600*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),et.CURRENT_WEEK,new LT({key:et.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=en(new Date,{weekStartsOn:1});return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),et.CURRENT_MONTH,new NT({key:et.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=Ti(new Date);return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.CURRENT_QUARTER,new FT({key:et.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Si(new Date);return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.CURRENT_YEAR,new BT({key:et.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.PREVIOUS_WEEK,new zT({key:et.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),et.PREVIOUS_MONTH,new HT({key:et.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=Ti(new Date),n=Ti(gh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Lh(t,n)),3600*24*eT(new Date().setMonth(new Date().getMonth()-1))+ph(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.PREVIOUS_QUARTER,new UT({key:et.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Si(new Date),t=Si(yh(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.PREVIOUS_YEAR,new VT({key:et.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=Lh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+ph(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Lh(e,t){return iT(e.getTimezoneOffset()-t.getTimezoneOffset())}et.FIFTEEN_MIN,et.ONE_HOUR,et.SIX_HOUR,et.TWELVE_HOUR,et.ONE_DAY,et.SEVEN_DAY,et.FIFTEEN_MIN,et.ONE_HOUR,et.SIX_HOUR,et.TWELVE_HOUR,et.ONE_DAY,et.SEVEN_DAY,et.THIRTY_DAY,et.NINETY_DAY,et.ONE_HUNDRED_EIGHTY_DAY,et.ONE_YEAR,et.CURRENT_WEEK,et.CURRENT_MONTH,et.CURRENT_QUARTER,et.CURRENT_YEAR,et.PREVIOUS_WEEK,et.PREVIOUS_MONTH,et.PREVIOUS_QUARTER,et.PREVIOUS_YEAR;const WT=new Map(ih.map(e=>[e.code,{code:e.code,name:e.name}])),Ia=e=>WT.get(e)?.name||e,Nh=1e3,$T=1e4,Fh=1e6,Bh=1e9,zh=1e12,Uo=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((s,o)=>{o&&o%3===0&&i.push(n),i.push(s)}),i.reverse().join("")},vs=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let r=o.toString();return typeof n.decimal=="string"&&(r=r.replace(".",n.decimal)),r};function Ho(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?$T:Nh;return e<s||t.precision&&t.precision>Math.log10(e)?n=Uo(vs(e,1,t),t):e<Fh?n=`${vs(e,Nh,t)}k`:e<Bh?n=`${vs(e,Fh,t)}m`:e<zh?n=`${Uo(vs(e,Bh,t),t)}b`:n=`${Uo(vs(e,zh,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}Ho.addCommas=Uo;const YT=typeof document<"u"&&document.documentElement?.lang||"en-US",Vo=new Intl.NumberFormat(YT);function Kn({i18n:e}){const t=(i,s)=>{if(isNaN(i))return"0 B";const o=s?Math.pow(2,50):1e15,r=s?Math.pow(2,40):1e12,a=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=o?u=e.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=r?u=e.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=a?u=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=e.formatNumber(Number.parseFloat((i/c).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,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?e.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:o=!1,currency:r="USD",approximate:a=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,o);case"usd":return n(i,r);default:return isNaN(i)?`${i}`:a?`${Ho(i,{capital:!0})} ${c}`:i>=.01?`${Vo.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:n,formatRange:(i,s,o,{isBytes1024:r=!1,currency:a="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(o,s);switch(o){case"bytes":return`${t(i,r)} - ${t(s,r)}`;case"usd":return`${n(i,a)} - ${n(s,a)}`;default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${Ho(i,{capital:!0})} - ${Ho(s,{capital:!0})} ${u}`}const h=i>=.01?`${Vo.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${Vo.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const Wo=e=>["interactive","zoom-interactive"].includes(e),Uh=(e,t,n,i)=>{const{tooltip:s}=t;if(s.opacity===0&&!Wo(e.interactionMode)){e.showTooltip=!1;return}const{i18n:o}=mt.useI18n(),{formatUnit:r}=Kn({i18n:o}),a=e.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(s.body&&!Wo(e.interactionMode)){const l=s.labelColors,c=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=s.dataPoints[0].parsed.x??0;e.tooltipContext=i?.contextFormatter?i.contextFormatter(u,n):Ds({tickValue:new Date(u),granularity:n}),e.tooltipSeries=s.dataPoints.map((h,f)=>{const m=h.parsed[c],p=r(m??0,e.units,{translateUnit:e.translateUnit}),y=h.dataset.label;return{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:y,value:p,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(a),e.left=`${s.x}px`,e.top=`${s.y}px`,e.showTooltip=!0}},Hh=(e,t)=>{const{tooltip:n}=t,{i18n:i}=mt.useI18n(),{formatUnit:s}=Kn({i18n:i});if(n.opacity===0&&!Wo(e.interactionMode)){e.showTooltip=!1;return}const o=e.chartTooltipSortFn||((r,a)=>a.rawValue-r.rawValue);if(n.body&&!Wo(e.interactionMode)){const r=n.labelColors,a=t.chart.config?.options?.indexAxis==="y"?"x":"y",l=["gauge","donut"].includes(e.chartType);l?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((c,u)=>{const h=l?c.parsed:c.parsed[a],f=s(h??0,e.units,{translateUnit:e.translateUnit});let m;return l?m=c.dataset.labels[c.dataIndex]:m=c.dataset.label,{backgroundColor:r[u].backgroundColor,borderColor:r[u].borderColor,label:m,value:f,rawValue:h,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(o),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},jT=e=>e&&e.datasets&&e.datasets.length,qT=e=>jT(e)&&e.datasets.some(t=>t.data.length),GT=e=>e.datasets.some(t=>t.data[0]&&ga(t.data[0].x)),KT=e=>!!qT(e)&&e.datasets.some(t=>t.data.length==1),XT=e=>GT(e)&&e.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),La=(e,t,n)=>{const s=Math.min(t/1150,1),o=.15,r=1.15,a=e.x??0;return a<n?a+t*o*(1-s):a-t*r*(1-s)},ZT=(e,t,n)=>{const o=e.y??0;return o<n?o+t*.15:o-t*.5};function Vh(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const Wh=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(s=>!t?.[s.text]?.isThreshold).map(((s,o)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[o].isSegmentEmpty}))).sort(n)},QT=2,$h=10,Yh=12,$o=10,JT="#f1f0ff",t1="#e0e4ea",jh="#6c7489",e1="#afb7c5",n1="#d60027",i1="#ad000e",Na="#6c7489",qh="#52596e",s1="#007d60",o1="#995c00",r1="#ffc400",a1="'Inter', Roboto, Helvetica, sans-serif",Ms="16px",l1="20px",c1="#bee2ff",u1="#8fc1ff",d1="#5f9aff",h1="#306fff",f1="#b5ffee",m1="#00fabe",p1="#00d6a4",g1="#00a17b",y1="#007d60",b1="#005944",_1="#b5ffee",x1="#00fabe",w1="#b5ffee",S1="#00a17b",T1="#fff296",v1="#ffe04b",M1="#ffc400",k1="#b37600",D1="#995c00",C1="#804400",O1="#fff296",E1="#ffe04b",A1="#ffc2b3",P1="#ff9877",R1="#ff723c",I1="#f75008",L1="#d13500",N1="#a31f00",F1="#ffc2b3",B1="#ff9877",z1="#ff723c",U1="#f75008",H1="#d13500",V1="#a31f00",W1="#ffc2b3",$1="#ff9877",Y1="#ff723c",j1="#f75008",q1="#d13500",G1="#a31f00",K1="#ffc2b3",X1="#ff9877",Z1="#ff723c",Q1="#f75008",J1="#d13500",tv="#a31f00",ev="#ffc2b3",nv="#ff9877",iv="#ff723c",sv="#f75008",ov="#d13500",rv="#ffabab",av="#ff7272",lv="#ff3954",cv="#f50045",uv="#d60027",dv="#ad000e",hv="#ffabab",fv="#ff7272",mv="#ff3954",pv="#f50045",gv="#d60027",yv="#eefaff",bv="#ecfffb",_v="#fffce0",xv="#fff1ef",wv="#ffe5e5",Sv="#5f9aff",Tv="#00d6a4",vv="#ffc400",Mv="#ff723c",kv="#ff3954",Mn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Fa=(e,t)=>(t||Mn)[e%Mn.length],Dv="#6f7787",Cv={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"}},Ov=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return Cv[t]?.background||"#fafafa"},Ev=e1,Gh=(e,t,n,i)=>{let s;return n?s=Ev:Array.isArray(i)?s=Fa(e,i):s=i[t],s||Fa(e)},Ba=e=>{switch(e){case"error":return n1;case"warning":return r1;case"neutral":return jh;default:return jh}},Av={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},Pv=2,Rv=0,za=new Map,Kh=(e,t)=>{const{i18n:n}=mt.useI18n(),{formatBytes:i}=Kn({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):Vo.format(e)},Iv=e=>{const n=document.createElement("canvas").getContext("2d"),i=Pt({});return n.font=i.string,n.measureText(e).width},Lv=()=>{const e="label_height";if(!za.has(e)){const t=Pt({});za.set(e,t.lineHeight)}return za.get(e)},Nv=(e,t)=>t.datasets.reduce((n,i,s)=>e.isDatasetVisible(s)?n+i.data.reduce((o,r)=>isNaN(r)?o:o+r,0):n,0),Fv=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,Bv=t1,zv={100:c1,101:u1,102:d1,103:h1,200:f1,201:m1,202:p1,203:g1,204:y1,205:b1,206:_1,207:x1,208:w1,226:S1,300:T1,301:v1,302:M1,303:k1,304:D1,305:C1,307:O1,308:E1,400:A1,401:P1,402:R1,403:I1,404:L1,405:N1,406:F1,407:B1,408:z1,409:U1,410:H1,411:V1,412:W1,413:$1,414:Y1,415:j1,416:q1,417:G1,418:K1,421:X1,422:Z1,423:Q1,424:J1,425:tv,426:ev,428:nv,429:iv,431:sv,451:ov,500:rv,501:av,502:lv,503:cv,504:uv,505:dv,506:hv,507:fv,508:mv,510:pv,511:gv},Uv={100:yv,200:bv,300:_v,400:xv,500:wv},Hv={"1XX":Sv,"2XX":Tv,"3XX":vv,"4XX":Mv,"5XX":kv},Xh=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return zv[t]??Uv[n]??Bv},Ua={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=Xh(`${t}`),e),{}),____OTHER____:JT,...Hv};function Zh(e,t,n){const i=$d(),s=$v(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?Vv(s,t):Wv(s,t)}function Vv(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 Wv(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function $v(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Yv(e,t){const n=Xv(t);return"formatToParts"in n?qv(n,e):Gv(n,e)}const jv={year:0,month:1,day:2,hour:3,minute:4,second:5};function qv(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=jv[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function Gv(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 Ha={},Qh=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")),Kv=Qh==="06/25/2014, 00:00:00"||Qh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Xv(e){return Ha[e]||(Ha[e]=Kv?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"})),Ha[e]}function Jh(e,t,n,i,s,o,r){const a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(i,s,o,r),a}const tf=36e5,Zv=6e4,Va={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Wa(e,t,n){if(!e)return 0;let i=Va.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=Va.timezoneHH.exec(e),i)return s=parseInt(i[1],10),ef(s)?-(s*tf):NaN;if(i=Va.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const r=parseInt(i[3],10);return ef(s,r)?(o=Math.abs(s)*tf+r*Zv,i[1]==="+"?-o:o):NaN}if(tM(e)){t=new Date(t||Date.now());const r=n?t:Qv(t),a=$a(r,e);return-(n?a:Jv(t,a,e))}return NaN}function Qv(e){return Jh(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function $a(e,t){const n=Yv(e,t),i=Jh(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function Jv(e,t,n){let s=e.getTime()-t;const o=$a(new Date(s),n);if(t===o)return t;s-=o-t;const r=$a(new Date(s),n);return o===r?o:Math.max(o,r)}function ef(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const nf={};function tM(e){if(nf[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),nf[e]=!0,!0}catch{return!1}}const eM=60*1e3,nM={X:function(e,t,n){const i=Ya(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return sf(i);case"XXXX":case"XX":return Mi(i);default:return Mi(i,":")}},x:function(e,t,n){const i=Ya(n.timeZone,e);switch(t){case"x":return sf(i);case"xxxx":case"xx":return Mi(i);default:return Mi(i,":")}},O:function(e,t,n){const i=Ya(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+iM(i,":");default:return"GMT"+Mi(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Zh("short",e,n);default:return Zh("long",e,n)}}};function Ya(e,t){const n=e?Wa(e,t,!0)/eM:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Yo(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Mi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Yo(Math.floor(i/60),2),o=Yo(Math.floor(i%60),2);return n+s+t+o}function sf(e,t){return e%60===0?(e>0?"-":"+")+Yo(Math.abs(e)/60,2):Mi(e,t)}function iM(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Yo(o,2)}function of(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 sM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ja=36e5,rf=6e4,oM=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:sM};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?oM: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=rM(e),{year:s,restDateString:o}=aM(i.date,n),r=lM(o,s);if(r===null||isNaN(r.getTime()))return new Date(NaN);if(r){const a=r.getTime();let l=0,c;if(i.time&&(l=cM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Wa(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=of(new Date(a+l)),c=of(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function rM(e){const t={};let n=ue.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=ue.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function aM(e,t){if(e){const n=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=ue.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function lM(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=ue.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,uf(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=ue.DDD.exec(e),o){n=new Date(0);const r=parseInt(o[1],10);return hM(t,r)?(n.setUTCFullYear(t,0,r),n):new Date(NaN)}if(o=ue.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const r=parseInt(o[2],10);return uf(t,i,r)?(n.setUTCFullYear(t,i,r),n):new Date(NaN)}if(o=ue.Www.exec(e),o)return s=parseInt(o[1],10)-1,df(s)?lf(t,s):new Date(NaN);if(o=ue.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const r=parseInt(o[2],10)-1;return df(s,r)?lf(t,s,r):new Date(NaN)}return null}function cM(e){let t,n,i=ue.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),qa(t)?t%24*ja:NaN;if(i=ue.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),qa(t,n)?t%24*ja+n*rf:NaN;if(i=ue.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return qa(t,n,s)?t%24*ja+n*rf+s*1e3:NaN}return null}function lf(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const uM=[31,28,31,30,31,30,31,31,30,31,30,31],dM=[31,29,31,30,31,30,31,31,30,31,30,31];function cf(e){return e%400===0||e%4===0&&e%100!==0}function uf(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=cf(e);if(i&&n>dM[t]||!i&&n>uM[t])return!1}return!0}function hM(e,t){if(t<1)return!1;const n=cf(e);return!(n&&t>366||!n&&t>365)}function df(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function qa(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const fM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ga(e,t,n={}){t=String(t);const i=t.match(fM);if(i){const s=af(n.originalDate||e,n);t=i.reduce(function(o,r){if(r[0]==="'")return o;const a=o.indexOf(r),l=o[a-1]==="'",c=o.replace(r,"'"+nM[r[0]](s,r,n)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Ao(e,t,n)}function mM(e,t,n){e=af(e,n);const i=Wa(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function ks(e,t,n,i){return i={...i,timeZone:t,originalDate:e},Ga(mM(e,t,{timeZone:i.timeZone}),n,i)}const pM=(e,t)=>`${ks(e,t,"yyyy")} W${ks(e,t,"II")}`,Ka="yyyy-MM-dd h:mm:ss a",Xa="h:mm:ss a",Xn="yyyy-MM-dd h:mm a",ki="h:mm a",gM="yyyy-MM-dd",Za="MMM dd, yyyy h:mm:ss a",kn="MMM dd, yyyy h:mm a",yM={secondly:e=>e?Ka:Xa,tenSecondly:e=>e?Ka:Xa,thirtySecondly:e=>e?Ka:Xa,minutely:e=>e?Xn:ki,fiveMinutely:e=>e?Xn:ki,tenMinutely:e=>e?Xn:ki,thirtyMinutely:e=>e?Xn:ki,hourly:e=>e?Xn:ki,twoHourly:e=>e?Xn:ki,twelveHourly:()=>Xn,daily:()=>gM},bM={secondly:()=>Za,tenSecondly:()=>Za,thirtySecondly:()=>Za,minutely:()=>kn,fiveMinutely:()=>kn,tenMinutely:()=>kn,thirtyMinutely:()=>kn,hourly:()=>kn,twoHourly:()=>kn,twelveHourly:()=>kn,daily:()=>kn};function hf({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:o,defaultFormat:r}){const a=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return pM(e,a);if(s&&s[t]){const l=s[t](i);return ks(e,a,l)}if(o&&o[t]){const l=o[t]();return ks(e,a,l)}return ks(e,a,r)}const _M=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>hf({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:yM,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Ds=({tickValue:e,granularity:t,timezone:n})=>hf({tickValue:e,granularity:t,timezone:n,tooltipMap:bM,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),ff=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",xM=e=>{const{i18n:t}=mt.useI18n();return ff(e)?{type:"canceled",message:t.t("query_errors.canceled.message")}:e?.status===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:e?.status===408||e?.message?.includes("timeout")?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:e?.response?.data?.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:e.response?.data?.invalid_parameters?.map(n=>n.reason).join(", ")||e?.message}},Cs=e=>e.toLocaleLowerCase().endsWith("count"),wM=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))};function SM(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Me.positioners[n]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=u.width/2,m=La(c,h,f),p=c.y,y=c.x<f?"left":"center";return{x:m-e.tooltipState.offsetX,y:p-e.tooltipState.offsetY,xAlign:y}},Jr.modes.customInteractionMode=function(l,c){const u=_n(c,l),h=[];return Jr.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p}),l.options.indexAxis==="x"&&u.x!==null&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p})}),h};const s=e.numLabels.value>25?$h:Yh,o=({chart:l,index:c})=>{const u=l.data;return{size:s,style:u?.isLabelEmpty?.[c]?"italic":"normal"}},r=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>$o?c.slice(0,$o)+"...":c):l.getLabelForValue(Number(c)),a=d.computed(()=>({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:o,callback:function(l,c){return r(this,l,c)}},title:{display:e.indexAxis==="y"?!rt(e.metricAxesTitle?.value):!rt(e.dimensionAxesTitle?.value),text:e.indexAxis==="y"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.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:o,callback:function(l,c){return r(this,l,c)}},title:{display:e.indexAxis==="x"?!rt(e.metricAxesTitle?.value):!rt(e.dimensionAxesTitle?.value),text:e.indexAxis==="x"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:l=>{Hh(e.tooltipState,l)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return d.getCurrentInstance()&&d.onUnmounted(()=>{Me.positioners[n]&&delete Me.positioners[n]}),a}pe.register(...Z0);const TM=(e,t)=>{const n=t.datasets.map(s=>s.label),i=e.datasets.map(s=>s.label);return e.datasets.length===t.datasets.length&&n.every((s,o)=>s===i[o])};function vM(e,t,n,i,s){const o=d.shallowRef(null),r=(a,l)=>{if(t.value)return new pe(t.value,{type:e,data:a,plugins:i,options:l})};return d.onMounted(()=>{o.value=r(n.value,s.value)}),d.onBeforeUnmount(()=>{rt(o.value)||o.value.destroy()}),d.watch(n,(a,l)=>{if(TM(l,a)&&!rt(o.value)){for(const[c,u]of a.datasets.entries())Object.assign(o.value.data.datasets[c],u);o.value.data.labels=a.labels,o.value.update()}else rt(o.value)||o.value.destroy(),o.value=r(a,s.value)}),d.watch(t,()=>{rt(o.value)||o.value.destroy(),o.value=r(n.value,s.value)}),d.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(rt(o.value)||o.value.destroy(),o.value=r(n.value,a))}),o}const mf=1e3,MM=1e4,pf=1e6,gf=1e9,yf=1e12,Os=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((o,r)=>{r&&r%3===0&&i.push(n),i.push(o)}),i.reverse().join("")},Di=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let r=o.toString();return typeof n.decimal=="string"&&(r=r.replace(".",n.decimal)),r};function Es(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?MM:mf;return e<s||t.precision&&t.precision>Math.log10(e)?n=Os(Di(e,1,t),t):e<pf?n=`${Di(e,mf,t)}k`:e<gf?n=`${Di(e,pf,t)}m`:e<yf?n=`${Os(Di(e,gf,t),t)}b`:n=`${Os(Di(e,yf,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}Es.addCommas=Os;function kM(e,t,n){const{i18n:i}=mt.useI18n(),{formatBytes:s}=Kn({i18n:i}),{translateUnit:o}=mt.useTranslatedUnits();return{legendValues:d.computed(()=>e.value.datasets.reduce((a,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(n.value==="bytes")u=s(c);else{const h=o(n.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:Es(c,{capital:!0}),unit:h})||`${Es(c,{capital:!0})} ${n.value}`}return{...a,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function DM(e){return d.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${Rh(new Date(n))} - ${Rh(new Date(i),{includeTZ:!0})}`:""})}function CM(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Me.positioners[n]=function(o,r){if(!o.length||r.x===null||r.y===null)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=e.tooltipState.width||this.width,c=a.width/2,u=La(r,l,c),h=r.y,f=r.x<c?"left":"center";return{x:u-e.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:o=>{Hh(e.tooltipState,o)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return d.onUnmounted(()=>{Me.positioners[n]&&delete Me.positioners[n]}),{options:s}}function OM(e){const t=d.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>{const c=new Date(l);return _M({tickValue:c,granularity:e.granularity.value,dayBoundaryCrossed:r.value})}},title:{display:!rt(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value})),n=d.computed(()=>({title:{display:!rt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.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})),s=`lineChartTooltipPosition-${e.tooltipState.chartID}`,o={enabled:!1,position:s};Me.positioners[s]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=e.tooltipState.height||this.height,m=u.width/2,p=u.height/2,y=La(c,h,m);let b=ZT(c,f,p);const S=c.y<p?"top":"bottom",M=c.x<m?"left":"center";return f>u.height&&(b=0),{x:y,y:b,xAlign:M,yAlign:S}};const r=d.computed(()=>{const l=Number(e.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return pw(l)>24||u.getDate()!==c.getDate()}),a=d.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:e.pointsWithoutHover?.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:{...o,external:l=>{Uh(e.tooltipState,l,e.granularity.value)}},thresholdPlugin:{threshold:e.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return d.onUnmounted(()=>{Me.positioners[s]&&delete Me.positioners[s]}),{options:a}}function EM(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:s,pivotRecords:o,rowLabels:r,colorPalette:a}=e,{i18n:l}=mt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Fa(i.indexOf(u),Mn),data:r.map((h,f)=>n?o[`${h.id},${u}`]||0:o[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=Gh(h,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:r.map(m=>o[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function AM(e,t){const{i18n:n}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:o,metric_names:r}=t.value.meta,a=o&&Object.keys(o),l=r&&r.length>1,c=o&&a&&a.length>0,u=c&&a.length>1;if(!s.length||!r)return{datasets:[],labels:[]};const h=c&&a||r,f=h[0],m=h.length>1?h[1]:h[0],p=Object.fromEntries(l?s.flatMap(_=>r.map((T,k)=>{const I=_.event[f],Y=c?`${I},${T}`:`${k},${T}`,U=_.event[T];return[Y,U]})):s.map(_=>{const T=c?`${_.event[f]},${_.event[m]}`:`${f},${m}`,k=_.event[r[0]];return[T,k]})),y=Object.keys(p).reduce((_,T)=>{const[k]=T.split(","),I=p[T];return _[k]?_[k]+=I:_[k]=I,_},{}),b=Object.entries(y).sort(([,_],[,T])=>Number(T)-Number(_)).map(([_])=>_),S=o[f],M=o[m];let E=c&&S&&Object.entries(S).map(([_,T])=>({id:_,name:T.name}))||r.map(_=>({id:_,name:_})),D=c&&M&&Object.entries(M).map(([_,T])=>({id:_,name:T.name}))||r.map(_=>({id:_,name:_}));if(c&&f==="country_code"&&(E=E.map(_=>({..._,name:Ia(_.id)||_.name}))),c&&m==="country_code"&&(D=D.map(_=>({..._,name:Ia(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(E.sort((_,T)=>b.indexOf(_.id)-b.indexOf(T.id)),D.sort((_,T)=>b.indexOf(_.id)-b.indexOf(T.id))),!E||!D)return{labels:[],datasets:[]};const C=EM({isMultiMetric:l,hasDimensions:c,metricNames:r,dimensionFieldNames:h,barSegmentLabels:D,pivotRecords:p,rowLabels:E,colorPalette:e.colorPalette||Mn}),A=c?E.map(_=>n&&n.te(`chartLabels.${_.name}`)&&n.t(`chartLabels.${_.name}`)||_.name):r.map(_=>n&&n.te(`chartLabels.${_}`)&&n.t(`chartLabels.${_}`)||_),O=E.map(_=>_.id==="empty");return{labels:A,datasets:C,isLabelEmpty:O,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const PM=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,s)=>i+s*n),RM=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Kd(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},IM=(e,t,n,i,s)=>{const r=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((e-i)/n)*n+i,l=Math.floor((r-i)/n)*n+i+n;return PM(a,l,n)};function LM(e,t){const{i18n:n}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:o,metric_names:r,start:a,end:l}=t.value.meta,c=new Date(a).getTime(),u=new Date(l).getTime();if(!r)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const h=o&&Object.keys(o)||r,f=h&&h[0],m=o[f];let p=o&&m&&Object.keys(m).map(A=>({id:A,name:m[A].name}))||r.map(A=>({id:A,name:A}));f==="country_code"&&(p=p.map(A=>({...A,name:Ia(A.id)||A.name})));const y=t.value.meta.granularity_ms;if(typeof y!="number"||isNaN(y)||!isFinite(y)||y===0)return console.error("Invalid step value:",y),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const b=RM(c),S=IM(c,u,y,b,s),M=new Set,E=s?.length?s.reduce((A,O)=>{const x=new Date(O.timestamp).valueOf(),_=O.event;for(const T of r)M.add(T),x in A||(A[x]={}),T in A[x]||(A[x][T]={});for(const T of r)p.forEach(k=>{_[f]===k.id||T===k.id?(A[x][T]||(A[x][T]={}),A[x][T][k.id]=Math.round(Number(_[T])*1e3)/1e3):h.length||(A[x][T]||(A[x][T]={}),A[x][T][k.id]=Math.round(Number(_[k.id])*1e3)/1e3)});return A},{}):{},C=[...r.length===1?r.flatMap(A=>p.map(O=>[A,O.id,O.name,O.id==="empty"])):p.map(A=>[A.name,A.id,A.name,A.id==="empty"])].map(([A,O,x,_],T)=>{const k=S.map(j=>j in E&&A in E[j]?{x:j,y:E[j][A][O]||0}:{x:j,y:0});let{colorPalette:I,fill:Y}=e;rt(I)&&(I=Mn);const U=Gh(T,x,_,I);return{rawDimension:x,rawMetric:A,label:n&&n.te(`chartLabels.${x}`)&&n.t(`chartLabels.${x}`)||x,borderColor:U,backgroundColor:U,data:k,total:k.reduce((j,{y:H})=>j+Number(H),0),...Av,fill:Y,borderWidth:Y?Rv:Pv,isSegmentEmpty:_}});return f==="status_code"||f==="status_code_grouped"?C.sort((A,O)=>(A.label??"")<(O.label??"")?-1:1):C.sort((A,O)=>Number(A.total)<Number(O.total)?-1:1),{datasets:C}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const NM=(e,t)=>{d.watch([e,t],(n,i,s)=>{const[o,r]=n;!r||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(r,o),s(()=>{window._AnalyticsChartDataInternal?.delete(r)}))},{immediate:!0})};function FM(){const{i18n:e}=mt.useI18n();return{translateUnit:(n,i)=>{const s=i===1,o=`chartUnits.${n}`;return Cs(n)?"":e.te(o)?e.t(o,{plural:s?"":"s"}):n}}}const BM="analytics-query-provider",bf=2;function zM(){const e=d.inject(BM);return{evaluateFeatureFlag:(n,i)=>e?e.evaluateFeatureFlagFn(n,i):i}}function _f(e,t){return d.getCurrentScope()?(d.onScopeDispose(e,t),!0):!1}const xf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const UM=e=>e!=null,HM=Object.prototype.toString,VM=e=>HM.call(e)==="[object Object]";function jo(e){return Array.isArray(e)?e:[e]}function WM(e){return d.getCurrentInstance()}function $M(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(s){var o;if(!((o=d.toValue(t.replaceRef))!==null&&o!==void 0)||o)if(Array.isArray(e.value)){const r=[...e.value];r[i]=s,e.value=r}else{const r={...e.value,[i]:s};Object.setPrototypeOf(r,Object.getPrototypeOf(e.value)),e.value=r}else e.value[i]=s}}));return n}function YM(e,t=!0,n){WM()?d.onMounted(e,n):t?e():d.nextTick(e)}function jM(e,t,n){return d.watch(e,t,{...n,immediate:!0})}const qo=xf?window:void 0;function Ci(e){var t;const n=d.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function As(...e){const t=(i,s,o,r)=>(i.addEventListener(s,o,r),()=>i.removeEventListener(s,o,r)),n=d.computed(()=>{const i=jo(d.toValue(e[0])).filter(s=>s!=null);return i.every(s=>typeof s!="string")?i:void 0});return jM(()=>{var i,s;return[(i=(s=n.value)===null||s===void 0?void 0:s.map(o=>Ci(o)))!==null&&i!==void 0?i:[qo].filter(o=>o!=null),jo(d.toValue(n.value?e[1]:e[0])),jo(d.unref(n.value?e[2]:e[1])),d.toValue(n.value?e[3]:e[2])]},([i,s,o,r],a,l)=>{if(!i?.length||!s?.length||!o?.length)return;const c=VM(r)?{...r}:r,u=i.flatMap(h=>s.flatMap(f=>o.map(m=>t(h,f,m,c))));l(()=>{u.forEach(h=>h())})},{flush:"post"})}function qM(){const e=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{e.value=!0},t),e}function wf(e){const t=qM();return d.computed(()=>(t.value,!!e()))}function GM(e,t,n={}){const{window:i=qo,...s}=n;let o;const r=wf(()=>i&&"MutationObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},l=d.watch(d.computed(()=>{const h=jo(d.toValue(e)).map(Ci).filter(UM);return new Set(h)}),h=>{a(),r.value&&h.size&&(o=new MutationObserver(t),h.forEach(f=>o.observe(f,s)))},{immediate:!0,flush:"post"}),c=()=>o?.takeRecords(),u=()=>{l(),a()};return _f(u),{isSupported:r,stop:u,takeRecords:c}}const Go={speed:2,margin:30,direction:"both"};function KM(e){e.scrollLeft>e.scrollWidth-e.clientWidth&&(e.scrollLeft=Math.max(0,e.scrollWidth-e.clientWidth)),e.scrollTop>e.scrollHeight-e.clientHeight&&(e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight))}function XM(e,t={}){var n,i,s,o;const{pointerTypes:r,preventDefault:a,stopPropagation:l,exact:c,onMove:u,onEnd:h,onStart:f,initialValue:m,axis:p="both",draggingElement:y=qo,containerElement:b,handle:S=e,buttons:M=[0],restrictInView:E,autoScroll:D=!1}=t,C=d.ref((n=d.toValue(m))!==null&&n!==void 0?n:{x:0,y:0}),A=d.ref(),O=P=>r?r.includes(P.pointerType):!0,x=P=>{d.toValue(a)&&P.preventDefault(),d.toValue(l)&&P.stopPropagation()},_=d.toValue(D),T=typeof _=="object"?{speed:(i=d.toValue(_.speed))!==null&&i!==void 0?i:Go.speed,margin:(s=d.toValue(_.margin))!==null&&s!==void 0?s:Go.margin,direction:(o=_.direction)!==null&&o!==void 0?o:Go.direction}:Go,k=P=>typeof P=="number"?[P,P]:[P.x,P.y],I=(P,N,V)=>{const{clientWidth:Q,clientHeight:X,scrollLeft:q,scrollTop:G,scrollWidth:J,scrollHeight:nt}=P,[tt,Z]=k(T.margin),[pt,bt]=k(T.speed);let ot=0,gt=0;(T.direction==="x"||T.direction==="both")&&(V.x<tt&&q>0?ot=-pt:V.x+N.width>Q-tt&&q<J-Q&&(ot=pt)),(T.direction==="y"||T.direction==="both")&&(V.y<Z&&G>0?gt=-bt:V.y+N.height>X-Z&&G<nt-X&&(gt=bt)),(ot||gt)&&P.scrollBy({left:ot,top:gt,behavior:"auto"})};let Y=null;const U=()=>{const P=d.toValue(b);P&&!Y&&(Y=setInterval(()=>{const N=d.toValue(e).getBoundingClientRect(),{x:V,y:Q}=C.value,X={x:V-P.scrollLeft,y:Q-P.scrollTop};X.x>=0&&X.y>=0&&(I(P,N,X),X.x+=P.scrollLeft,X.y+=P.scrollTop,C.value=X)},1e3/60))},j=()=>{Y&&(clearInterval(Y),Y=null)},H=(P,N,V,Q)=>{const[X,q]=typeof V=="number"?[V,V]:[V.x,V.y],{clientWidth:G,clientHeight:J}=N;return P.x<X||P.x+Q.width>G-X||P.y<q||P.y+Q.height>J-q},$=()=>{if(d.toValue(t.disabled)||!A.value)return;const P=d.toValue(b);if(!P)return;const N=d.toValue(e).getBoundingClientRect(),{x:V,y:Q}=C.value;H({x:V-P.scrollLeft,y:Q-P.scrollTop},P,T.margin,N)?U():j()};d.toValue(D)&&d.watch(C,$);const R=P=>{var N;if(!d.toValue(M).includes(P.button)||d.toValue(t.disabled)||!O(P)||d.toValue(c)&&P.target!==d.toValue(e))return;const V=d.toValue(b),Q=V==null||(N=V.getBoundingClientRect)===null||N===void 0?void 0:N.call(V),X=d.toValue(e).getBoundingClientRect(),q={x:P.clientX-(V?X.left-Q.left+(D?0:V.scrollLeft):X.left),y:P.clientY-(V?X.top-Q.top+(D?0:V.scrollTop):X.top)};f?.(q,P)!==!1&&(A.value=q,x(P))},B=P=>{if(d.toValue(t.disabled)||!O(P)||!A.value)return;const N=d.toValue(b);N instanceof HTMLElement&&KM(N);const V=d.toValue(e).getBoundingClientRect();let{x:Q,y:X}=C.value;if((p==="x"||p==="both")&&(Q=P.clientX-A.value.x,N&&(Q=Math.min(Math.max(0,Q),N.scrollWidth-V.width))),(p==="y"||p==="both")&&(X=P.clientY-A.value.y,N&&(X=Math.min(Math.max(0,X),N.scrollHeight-V.height))),d.toValue(D)&&N&&(Y===null&&I(N,V,{x:Q,y:X}),Q+=N.scrollLeft,X+=N.scrollTop),N&&(E||D)){if(p!=="y"){const q=Q-N.scrollLeft;q<0?Q=N.scrollLeft:q>N.clientWidth-V.width&&(Q=N.clientWidth-V.width+N.scrollLeft)}if(p!=="x"){const q=X-N.scrollTop;q<0?X=N.scrollTop:q>N.clientHeight-V.height&&(X=N.clientHeight-V.height+N.scrollTop)}}C.value={x:Q,y:X},u?.(C.value,P),x(P)},z=P=>{d.toValue(t.disabled)||!O(P)||A.value&&(A.value=void 0,D&&j(),h?.(C.value,P),x(P))};if(xf){const P=()=>{var N;return{capture:(N=t.capture)!==null&&N!==void 0?N:!0,passive:!d.toValue(a)}};As(S,"pointerdown",R,P),As(y,"pointermove",B,P),As(y,"pointerup",z,P)}return{...$M(C),position:C,isDragging:d.computed(()=>!!A.value),style:d.computed(()=>`
4
4
  left: ${C.value.x}px;
5
5
  top: ${C.value.y}px;
6
6
  ${D?"text-wrap: nowrap;":""}
7
- `)}}function KM(e,t,n={}){const{window:i=qo,...s}=n;let o;const r=wf(()=>i&&"ResizeObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},l=d.watch(d.computed(()=>{const u=d.toValue(e);return Array.isArray(u)?u.map(h=>Ci(h)):[Ci(u)]}),u=>{if(a(),r.value&&i){o=new ResizeObserver(t);for(const h of u)h&&o.observe(h,s)}},{immediate:!0,flush:"post"}),c=()=>{a(),l()};return _f(c),{isSupported:r,stop:c}}function XM(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:s=!0,immediate:o=!0,updateTiming:r="sync"}=t,a=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),p=d.shallowRef(0);function y(){const S=Ci(e);if(!S){n&&(a.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,p.value=0);return}const M=S.getBoundingClientRect();a.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,h.value=M.top,f.value=M.width,m.value=M.x,p.value=M.y}function b(){r==="sync"?y():r==="next-frame"&&requestAnimationFrame(()=>y())}return KM(e,b),d.watch(()=>Ci(e),S=>!S&&b()),jM(e,b,{attributeFilter:["style","class"]}),s&&As("scroll",b,{capture:!0,passive:!0}),i&&As("resize",b,{passive:!0}),WM(()=>{o&&b()}),{height:a,bottom:l,left:c,right:u,top:h,width:f,x:m,y:p,update:b}}function ZM(e,t){const{top:n,left:i}=XM(e),s=d.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),o=d.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:o}}const QM=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=n).sort((l,c)=>l-c),o=[];if(n-t<e-2)return[];const r=(n-t)/e;let a=0;for(let l=0;l<e;l++){const c=t+l*r,u=t+(l+1)*r;let h=0;for(;a<s.length&&s[a]>=c&&s[a]<=u;)h++,a++;o.push([Math.ceil(c),h])}return o},Sf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Ps=d.ref({}),JM=e=>(Ps.value[e]||(Ps.value[e]=Sf()),Ps.value[e]),tk=(e,t)=>{const n=Ps.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 Ps.value[t])};function ek({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:s=void 0,minCount:o=void 0,maxCount:r=void 0,renderPoints:a=void 0,type:l}){const u=n!==void 0&&e!==void 0?JM(n):Sf(),h=e!==void 0?e:"static-chart-key",f=d.computed(()=>t.reduce((T,{timestamps:k})=>[...T,...k],[])),m=d.computed(()=>i||f.value.reduce((T,k)=>T===0?k:Math.min(T,k),0)),p=d.computed(()=>s||f.value.reduce((T,k)=>Math.max(T,k),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=p.value,a!==void 0&&(u.renderPoints[h]=a)});const y=d.computed(()=>Object.values(u.minStamps).reduce((T,k)=>T===0?k:Math.min(T,k),0)),b=d.computed(()=>Object.values(u.maxStamps).reduce((T,k)=>Math.max(T,k),0)),S=d.computed(()=>{const T=Object.values(u.renderPoints);return T.length===0?24:T.reduce((k,I)=>Math.max(k,I),2)}),M=d.computed(()=>{const T=b.value-y.value;return Math.ceil(T/S.value)}),E=d.computed(()=>t.length>1),D=d.computed(()=>t.map(({timestamps:T,color:k,label:I})=>({data:QM({bucketCount:S.value,minStamp:y.value,maxStamp:b.value,timestamps:T}).map(([j,H])=>({x:j,y:H})),label:I,...(l==="sparkline_bar"||E.value)&&k&&{backgroundColor:k},...l!=="sparkline_bar"&&k&&{borderColor:k},...E.value&&l!=="sparkline_bar"&&{fill:!0}}))),C=d.computed(()=>{const T=D.value[0]?.data?.length??0,k=[];for(let I=0;I<T;I++){let Y=0;for(let U=0;U<D.value.length;U++)Y+=D.value[U].data[I].y;k.push(Y)}return k}),A=d.computed(()=>{const T=C.value.reduce((k,I)=>Math.max(k,I),0);return Math.max(T,r??0)}),O=d.computed(()=>{const T=D.value.reduce((Y,{data:U})=>[...Y,...U.map(({y:j})=>j)],[]),k=T.length?T[0]:0,I=T.reduce((Y,U)=>Math.min(Y,U),k);return o===void 0?I:Math.min(I,o)});d.watchEffect(()=>{u.maxCounts[h]=A.value,u.minCounts[h]=O.value});const x=d.computed(()=>{const T=Object.values(u.minCounts),k=T.length?T[0]:0;return T.reduce((I,Y)=>Math.min(I,Y),k)}),_=d.computed(()=>Object.values(u.maxCounts).reduce((T,k)=>Math.max(T,k),0));return d.onUnmounted(()=>{e!==void 0&&n!==void 0&&tk(e,n)}),{syncedMinStamp:y,syncedMaxStamp:b,syncedRenderPoints:S,syncedChartDatasets:D,syncedGroupSizeMs:M,syncedMinCount:x,syncedMaxCount:_}}const mt={useBarChartOptions:xM,useChartJSCommon:SM,useChartLegendValues:vM,useChartSelectedRange:MM,useExploreResultToDatasets:OM,useExploreResultToTimeDataset:RM,useDonutChartOptions:kM,useLineChartOptions:DM,useI18n:Lm,useReportChartDataForSynthetics:IM,useTranslatedUnits:LM,useEvaluateFeatureFlag:FM,useTooltipAbsolutePosition:ZM,useSparklineSync:ek};var be=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(be||{});const Tf={modes:{point(e,t){return Ko(e,t,{intersect:!0})},nearest(e,t,n){return sk(e,t,n)},x(e,t,n){return Ko(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return Ko(e,t,{intersect:n.intersect,axis:"y"})}}};function Qa(e,t,n){return(Tf.modes[n.mode]||Tf.modes.nearest)(e,t,n)}function nk(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 ik(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function Ko(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):nk(i,t,n.axis))}function sk(e,t,n){let i=Number.POSITIVE_INFINITY;return Ko(e,t,n).reduce((s,o)=>{const r=o.getCenterPoint(),a=ik(t,r,n.axis),l=ui(t,a);return l<i?(s=[o],i=l):l===i&&s.push(o),s},[]).sort((s,o)=>s._index-o._index).slice(0,1)}function Xn(e,t,n){const i=Math.cos(n),s=Math.sin(n),o=t.x,r=t.y;return{x:o+i*(e.x-o)-s*(e.y-r),y:r+s*(e.x-o)+i*(e.y-r)}}const ok=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,Zn=.001,Xo=(e,t,n)=>Math.min(n,Math.max(t,e)),vf=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function rk(e,t,n){for(const i of Object.keys(e))e[i]=Xo(e[i],t,n);return e}function ak(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 Mf(e,{x:t,y:n,x2:i,y2:s},o,{borderWidth:r,hitTolerance:a}){const l=(r+a)/2,c=e.x>=t-l-Zn&&e.x<=i+l+Zn,u=e.y>=n-l-Zn&&e.y<=s+l+Zn;return o==="x"?c:(o==="y"||c)&&u}function kf(e,{rect:t,center:n},i,{rotation:s,borderWidth:o,hitTolerance:r}){const a=Xn(e,n,Vt(-s));return Mf(a,t,i,{borderWidth:o,hitTolerance:r})}function Qn(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function lk(e,t,n,i=!0){const s=n.split(".");let o=0;for(const r of t.split(".")){const a=s[o++];if(parseInt(r,10)<parseInt(a,10))break;if(ok(a,r)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const Df=e=>typeof e=="string"&&e.endsWith("%"),Cf=e=>parseFloat(e)/100,Of=e=>Xo(Cf(e),0,1),Rs=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),ck={box:e=>Rs(e.centerX,e.centerY),doughnutLabel:e=>Rs(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>Rs(e.centerX,e.centerY),line:e=>Rs(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>Rs(e.centerX,e.centerY)};function Ja(e,t){return t==="start"?0:t==="end"?e:Df(t)?Of(t)*e:e/2}function Dn(e,t,n=!0){return typeof t=="number"?t:Df(t)?(n?Of(t):Cf(t))*e:e}function uk(e,t){const{x:n,width:i}=e,s=t.textAlign;return s==="center"?n+i/2:s==="end"||s==="right"?n+i:n}function Ef(e,t,{borderWidth:n,position:i,xAdjust:s,yAdjust:o},r){const a=ft(r),l=t.width+(a?r.width:0)+n,c=t.height+(a?r.height:0)+n,u=tl(i),h=If(e.x,l,s,u.x),f=If(e.y,c,o,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 tl(e,t="center"){return ft(e)?{x:at(e.x,t),y:at(e.y,t)}:(e=at(e,t),{x:e,y:e})}const Af=(e,t)=>e&&e.autoFit&&t<1;function Pf(e,t){const n=e.font,i=xt(n)?n:[n];return Af(e,t)?i.map(function(s){const o=Pt(s);return o.size=Math.floor(s.size*t),o.lineHeight=s.lineHeight,Pt(o)}):i.map(s=>Pt(s))}function Rf(e){return e&&(fe(e.xValue)||fe(e.yValue))}function If(e,t,n=0,i){return e-Ja(t,i)+n}function Oi(e,t,n){const i=n.init;if(i){if(i===!0)return Nf(t,n)}else return;return dk(e,t,n)}function Lf(e,t,n){let i=!1;return t.forEach(s=>{me(e[s])?(i=!0,n[s]=e[s]):fe(n[s])&&delete n[s]}),i}function Nf(e,t){const n=t.type||"line";return ck[n](e)}function dk(e,t,n){const i=wt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return Nf(t,n);if(ft(i))return i}const el=new Map,hk=e=>isNaN(e)||e<=0,fk=e=>e.reduce(function(t,n){return t+=n.string,t},"");function Zo(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Qo(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(Vt(i)),e.translate(-t,-n))}function nn(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 Ei(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function Jo(e,t){const n=t.content;if(Zo(n))return{width:Dn(n.width,t.width),height:Dn(n.height,t.height)};const i=Pf(t),s=t.textStrokeWidth,o=xt(n)?n:[n],r=o.join()+fk(i)+s+(e._measureText?"-spriting":"");return el.has(r)||el.set(r,yk(e,o,i,s)),el.get(r)}function Ff(e,t,n){const{x:i,y:s,width:o,height:r}=t;e.save(),Ei(e,n);const a=nn(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),di(e,{x:i,y:s,w:o,h:r,radius:rk(yn(n.borderRadius),0,Math.min(o,r)/2)}),e.closePath(),e.fill(),a&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function Bf(e,t,n,i){const s=n.content;if(Zo(s)){e.save(),e.globalAlpha=xk(n.opacity,s.style.opacity),e.drawImage(s,t.x,t.y,t.width,t.height),e.restore();return}const o=xt(s)?s:[s],r=Pf(n,i),a=n.color,l=xt(a)?a:[a],c=uk(t,n),u=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,mk(e,n)&&bk(e,{x:c,y:u},o,r),_k(e,{x:c,y:u},o,{fonts:r,colors:l}),e.restore()}function mk(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function pk(e,t,n,i){const{radius:s,options:o}=t,r=o.pointStyle,a=o.rotation;let l=(a||0)*Er;if(Zo(r)){e.save(),e.translate(n,i),e.rotate(l),e.drawImage(r,-r.width/2,-r.height/2,r.width,r.height),e.restore();return}hk(s)||gk(e,{x:n,y:i,radius:s,rotation:a,style:r,rad:l})}function gk(e,{x:t,y:n,radius:i,rotation:s,style:o,rad:r}){let a,l,c,u;switch(e.beginPath(),o){default:e.arc(t,n,i,0,Dt),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(r)*i,n-Math.cos(r)*i),r+=io,e.lineTo(t+Math.sin(r)*i,n-Math.cos(r)*i),r+=io,e.lineTo(t+Math.sin(r)*i,n-Math.cos(r)*i),e.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(r+Ce)*c,l=Math.sin(r+Ce)*c,e.arc(t-a,n-l,u,r-dt,r-Ot),e.arc(t+l,n-a,u,r-Ot,r),e.arc(t+a,n+l,u,r,r+Ot),e.arc(t-l,n+a,u,r+Ot,r+dt),e.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,e.rect(t-c,n-c,2*c,2*c);break}r+=Ce;case"rectRot":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+l,n-a),e.lineTo(t+a,n+l),e.lineTo(t-l,n+a),e.closePath();break;case"crossRot":r+=Ce;case"cross":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a);break;case"star":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a),r+=Ce,a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a);break;case"line":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(r)*i,n+Math.sin(r)*i);break}e.fill()}function yk(e,t,n,i){e.save();const s=t.length;let o=0,r=i;for(let a=0;a<s;a++){const l=n[Math.min(a,n.length-1)];e.font=l.string;const c=t[a];o=Math.max(o,e.measureText(c).width+i),r+=l.lineHeight}return e.restore(),{width:o,height:r}}function bk(e,{x:t,y:n},i,s){e.beginPath();let o=0;i.forEach(function(r,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(r,t,n+c/2+o),o+=c}),e.stroke()}function _k(e,{x:t,y:n},i,{fonts:s,colors:o}){let r=0;i.forEach(function(a,l){const c=o[Math.min(l,o.length-1)],u=s[Math.min(l,s.length-1)],h=u.lineHeight;e.beginPath(),e.font=u.string,e.fillStyle=c,e.fillText(a,t,n+h/2+r),r+=h,e.fill()})}function xk(e,t){const n=gn(e)?e:t;return gn(n)?Xo(n,0,1):1}const zf=["left","bottom","top","right"];function wk(e,t){const{pointX:n,pointY:i,options:s}=t,o=s.callout,r=o&&o.display&&kk(t,o);if(!r||Ck(t,o,r))return;if(e.save(),e.beginPath(),!nn(e,o))return e.restore();const{separatorStart:l,separatorEnd:c}=Sk(t,r),{sideStart:u,sideEnd:h}=vk(t,r,l);(o.margin>0||s.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(u.x,u.y),e.lineTo(h.x,h.y);const f=Xn({x:n,y:i},t.getCenterPoint(),Vt(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function Sk(e,t){const{x:n,y:i,x2:s,y2:o}=e,r=Tk(e,t);let a,l;return t==="left"||t==="right"?(a={x:n+r,y:i},l={x:a.x,y:o}):(a={x:n,y:i+r},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function Tk(e,t){const{width:n,height:i,options:s}=e,o=s.callout.margin+s.borderWidth/2;return t==="right"?n+o:t==="bottom"?i+o:-o}function vk(e,t,n){const{y:i,width:s,height:o,options:r}=e,a=r.callout.start,l=Mk(t,r.callout);let c,u;return t==="left"||t==="right"?(c={x:n.x,y:i+Dn(o,a)},u={x:c.x+l,y:c.y}):(c={x:n.x+Dn(s,a),y:n.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function Mk(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function kk(e,t){const n=t.position;return zf.includes(n)?n:Dk(e,t)}function Dk(e,t){const{x:n,y:i,x2:s,y2:o,width:r,height:a,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=e,m={x:u,y:h},p=t.start,y=Dn(r,p),b=Dn(a,p),S=[n,n+y,n+y,s],M=[i+b,o,i,o],E=[];for(let D=0;D<4;D++){const C=Xn({x:S[D],y:M[D]},m,Vt(f));E.push({position:zf[D],distance:ui(C,{x:l,y:c})})}return E.sort((D,C)=>D.distance-C.distance)[0].position}function Ck(e,t,n){const{pointX:i,pointY:s}=e,o=t.margin;let r=i,a=s;return n==="left"?r+=o:n==="right"?r-=o:n==="top"?a+=o:n==="bottom"&&(a-=o),e.inRange(r,a)}const Uf={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 Ai(e,t,n){return t=typeof t=="number"?t:e.parse(t),At(t)?e.getPixelForValue(t):n}function Jn(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const s=n.charAt(0),o=Object.values(e).filter(r=>r.axis&&r.axis===s);return o.length?o[0].id:s}function Hf(e,t){if(e){const n=e.options.reverse,i=Ai(e,t.min,n?t.end:t.start),s=Ai(e,t.max,n?t.start:t.end);return{start:i,end:s}}}function Vf(e,t){const{chartArea:n,scales:i}=e,s=i[Jn(i,t,"xScaleID")],o=i[Jn(i,t,"yScaleID")];let r=n.width/2,a=n.height/2;return s&&(r=Ai(s,t.xValue,s.left+s.width/2)),o&&(a=Ai(o,t.yValue,o.top+o.height/2)),{x:r,y:a}}function nl(e,t){const n=e.scales,i=n[Jn(n,t,"xScaleID")],s=n[Jn(n,t,"yScaleID")];if(!i&&!s)return{};let{left:o,right:r}=i||e.chartArea,{top:a,bottom:l}=s||e.chartArea;const c=Yf(i,{min:t.xMin,max:t.xMax,start:o,end:r});o=c.start,r=c.end;const u=Yf(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:o,y:a,x2:r,y2:l,width:r-o,height:l-a,centerX:o+(r-o)/2,centerY:a+(l-a)/2}}function Wf(e,t){if(!Rf(t)){const n=nl(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const s=i*2,o=n.centerX+t.xAdjust,r=n.centerY+t.yAdjust;return{x:o-i,y:r-i,x2:o+i,y2:r+i,centerX:o,centerY:r,width:s,height:s,radius:i}}return Ek(e,t)}function Ok(e,t){const{scales:n,chartArea:i}=e,s=n[t.scaleID],o={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?Ak(s,o,t):Pk(n,o,t),o}function $f(e,t){const n=nl(e,t);return n.initProperties=Oi(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:Lk(e,n,t),initProperties:n.initProperties}],n}function Ek(e,t){const n=Vf(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 Yf(e,t){const n=Hf(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function Ak(e,t,n){const i=Ai(e,n.value,NaN),s=Ai(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function Pk(e,t,n){for(const i of Object.keys(Uf)){const s=e[Jn(e,n,i)];if(s){const{min:o,max:r,start:a,end:l,startProp:c,endProp:u}=Uf[i],h=Hf(s,{min:n[o],max:n[r],start:s[a],end:s[l]});t[c]=h.start,t[u]=h.end}}}function Rk({properties:e,options:t},n,i,s){const{x:o,x2:r,width:a}=e;return jf({start:o,end:r,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:n.width})}function Ik({properties:e,options:t},n,i,s){const{y:o,y2:r,height:a}=e;return jf({start:o,end:r,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:n.height})}function jf(e,t){const{start:n,end:i,borderWidth:s}=e,{position:o,padding:{start:r,end:a},adjust:l}=t,c=i-s-n-r-a-t.size;return n+s/2+l+Ja(c,o)}function Lk(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const s=tl(i.position),o=Wt(i.padding),r=Jo(e.ctx,i),a=Rk({properties:t,options:n},r,s,o),l=Ik({properties:t,options:n},r,s,o),c=r.width+o.width,u=r.height+o.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const il=["enter","leave"],sl=il.concat("click");function Nk(e,t,n){t.listened=Lf(n,sl,t.listeners),t.moveListened=!1,il.forEach(i=>{me(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&me(i.click)&&(t.listened=!0),t.moveListened||il.forEach(s=>{me(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function Fk(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return Bk(e,t,n);case"click":return zk(e,t,n)}}function Bk(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=Qa(e.visibleElements,t,n.interaction):i=[];const s=e.hovered;e.hovered=i;const o={state:e,event:t};let r=qf(o,"leave",s,i);return qf(o,"enter",i,s)||r}function qf({state:e,event:t},n,i,s){let o;for(const r of i)s.indexOf(r)<0&&(o=Gf(r.options[n]||e.listeners[n],r,t)||o);return o}function zk(e,t,n){const i=e.listeners,s=Qa(e.visibleElements,t,n.interaction);let o;for(const r of s)o=Gf(r.options.click||i.click,r,t)||o;return o}function Gf(e,t,n){return wt(e,[t.$context,n])===!0}const tr=["afterDraw","beforeDraw"];function Uk(e,t,n){const i=t.visibleElements;t.hooked=Lf(n,tr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||tr.forEach(o=>{me(s.options[o])&&(t.hooked=!0)})})}function Kf(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return wt(i,[t.$context])}}function Hk(e,t,n){const i=jk(e.scales,t,n);let s=Xf(t,i,"min","suggestedMin");s=Xf(t,i,"max","suggestedMax")||s,s&&me(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function Vk(e,t){for(const n of e)$k(n,t)}function Xf(e,t,n,i){if(At(t[n])&&!Wk(e.options,n,i)){const s=e[n]!==t[n];return e[n]=t[n],s}}function Wk(e,t,n){return fe(e[t])||fe(e[n])}function $k(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=Jn(t,e,n);i&&!t[i]&&Yk(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function Yk(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(fe(e[n+i]))return!0;return!1}function jk(e,t,n){const i=t.axis,s=t.id,o=i+"ScaleID",r={min:at(t.min,Number.NEGATIVE_INFINITY),max:at(t.max,Number.POSITIVE_INFINITY)};for(const a of n)a.scaleID===s?Zf(a,t,["value","endValue"],r):Jn(e,a,o)===s&&Zf(a,t,[i+"Min",i+"Max",i+"Value"],r);return r}function Zf(e,t,n,i){for(const s of n){const o=e[s];if(fe(o)){const r=t.parse(o);i.min=Math.min(i.min,r),i.max=Math.max(i.max,r)}}}class Pi extends oe{inRange(t,n,i,s){const{x:o,y:r}=Xn({x:t,y:n},this.getCenterPoint(s),Vt(-this.options.rotation));return Mf({x:o,y:r},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return Qn(this,t)}draw(t){t.save(),Qo(t,this.getCenterPoint(),this.options.rotation),Ff(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return $f(t,n)}}Pi.id="boxAnnotation",Pi.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},Pi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Pi.descriptors={label:{_fallback:!0}};class er extends oe{inRange(t,n,i,s){return kf({x:t,y:n},{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 Qn(this,t)}draw(t){const n=this.options;!n.display||!n.content||(Qk(t,this),t.save(),Qo(t,this.getCenterPoint(),this.rotation),Bf(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=qk(t,n);if(!i)return{};const{controllerMeta:s,point:o,radius:r}=Kk(t,n,i);let a=Jo(t.ctx,n);const l=Xk(a,r);Af(n,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:h}=n,f=Ef(o,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Oi(t,f,n),...f,...s,rotation:n.rotation,_fitRatio:l}}}er.id="doughnutLabelAnnotation",er.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},er.defaultRoutes={};function qk(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const s=i.controller;return s instanceof ss&&Gk(e,t,i.data)&&(!n||s.innerRadius<n.controller.innerRadius)&&s.options.circumference>=90?i:n},void 0)}function Gk(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 Kk({chartArea:e},t,n){const{left:i,top:s,right:o,bottom:r}=e,{innerRadius:a,offsetX:l,offsetY:c}=n.controller,u=(i+o)/2+l,h=(s+r)/2+c,f={left:Math.max(u-a,i),right:Math.min(u+a,o),top:Math.max(h-a,s),bottom:Math.min(h+a,r)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,y=a-p,b=m.y>h,S=b?s+p:r-p,M=Zk(S,u,h,y);return{controllerMeta:{_centerX:u,_centerY:h,_radius:y,_counterclockwise:b,...M},point:m,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function Xk({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function Zk(e,t,n,i){const s=Math.pow(n-e,2),o=Math.pow(i,2),r=t*-2,a=Math.pow(t,2)+s-o,l=Math.pow(r,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Dt};const c=(-r-Math.sqrt(l))/2,u=(-r+Math.sqrt(l))/2;return{_startAngle:oo({x:t,y:n},{x:c,y:e}).angle,_endAngle:oo({x:t,y:n},{x:u,y:e}).angle}}function Qk(e,t){const{_centerX:n,_centerY:i,_radius:s,_startAngle:o,_endAngle:r,_counterclockwise:a,options:l}=t;e.save();const c=nn(e,l);e.fillStyle=l.backgroundColor,e.beginPath(),e.arc(n,i,s,o,r,a),e.closePath(),e.fill(),c&&e.stroke(),e.restore()}class Is extends oe{inRange(t,n,i,s){return kf({x:t,y:n},{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 Qn(this,t)}draw(t){const n=this.options,i=!fe(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),Qo(t,this.getCenterPoint(),this.rotation),wk(t,this),Ff(t,this,n),Bf(t,Jk(this),n),t.restore())}resolveElementProperties(t,n){let i;if(Rf(n))i=Vf(t,n);else{const{centerX:a,centerY:l}=nl(t,n);i={x:a,y:l}}const s=Wt(n.padding),o=Jo(t.ctx,n),r=Ef(i,o,n,s);return{initProperties:Oi(t,r,n),pointX:i.x,pointY:i.y,...r,rotation:n.rotation}}}Is.id="labelAnnotation",Is.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Is.defaultRoutes={borderColor:"color"};function Jk({x:e,y:t,width:n,height:i,options:s}){const o=s.borderWidth/2,r=Wt(s.padding);return{x:e+r.left+o,y:t+r.top+o,width:n-r.left-r.right-s.borderWidth,height:i-r.top-r.bottom-s.borderWidth}}const ol=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),rl=(e,t,n)=>ol(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Qf=(e,t,n)=>ol(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,Ls=e=>e*e,tD=(e,t,{x:n,y:i,x2:s,y2:o},r)=>r==="y"?{start:Math.min(i,o),end:Math.max(i,o),value:t}:{start:Math.min(n,s),end:Math.max(n,s),value:e},Jf=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,al=(e,t,n,i)=>({x:Jf(e.x,t.x,n.x,i),y:Jf(e.y,t.y,n.y,i)}),tm=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),em=(e,t,n,i)=>-Math.atan2(tm(e.x,t.x,n.x,i),tm(e.y,t.y,n.y,i))+.5*dt;class Ns extends oe{inRange(t,n,i,s){const o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const r={mouseX:t,mouseY:n},{path:a,ctx:l}=this;if(a){nn(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=n*u.currentDevicePixelRatio,m=l.isPointInStroke(a,h,f)||ll(this,r,s);return l.restore(),m}const c=Ls(o);return sD(this,r,c,s)||ll(this,r,s)}return eD(this,{mouseX:t,mouseY:n},i,{hitSize:o,useFinalPosition:s})}getCenterPoint(t){return Qn(this,t)}draw(t){const{x:n,y:i,x2:s,y2:o,cp:r,options:a}=this;if(t.save(),!nn(t,a))return t.restore();Ei(t,a);const l=Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2));if(a.curve&&r)return hD(t,this,r,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=rm(this),m=Math.atan2(o-i,s-n);t.translate(n,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),cl(t,0,h,c),cl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=Ok(t,n),{x:s,y:o,x2:r,y2:a}=i,l=nD(i,t.chartArea),c=l?iD({x:s,y:o},{x:r,y:a},t.chartArea):{x:s,y:o,x2:r,y2:a,width:Math.abs(r-s),height:Math.abs(a-o)};if(c.centerX=(r+s)/2,c.centerY=(a+o)/2,c.initProperties=Oi(t,c,n),n.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=dD(c,n,ui(h,f))}const u=oD(t,c,n.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Ns.id="lineAnnotation";const nm={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};Ns.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},nm),fill:!1,length:12,start:Object.assign({},nm),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Is.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Ns.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Ns.defaultRoutes={borderColor:"color"};function eD(e,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:o}){const r=tD(t,n,e.getProps(["x","y","x2","y2"],o),i);return vf(r,s)||ll(e,{mouseX:t,mouseY:n},o,i)}function nD({x:e,y:t,x2:n,y2:i},{top:s,right:o,bottom:r,left:a}){return!(e<a&&n<a||e>o&&n>o||t<s&&i<s||t>r&&i>r)}function im({x:e,y:t},n,{top:i,right:s,bottom:o,left:r}){return e<r&&(t=Qf(r,{x:e,y:t},n),e=r),e>s&&(t=Qf(s,{x:e,y:t},n),e=s),t<i&&(e=rl(i,{x:e,y:t},n),t=i),t>o&&(e=rl(o,{x:e,y:t},n),t=o),{x:e,y:t}}function iD(e,t,n){const{x:i,y:s}=im(e,t,n),{x:o,y:r}=im(t,e,n);return{x:i,y:s,x2:o,y2:r,width:Math.abs(o-i),height:Math.abs(r-s)}}function sD(e,{mouseX:t,mouseY:n},i=Zn,s){const{x:o,y:r,x2:a,y2:l}=e.getProps(["x","y","x2","y2"],s),c=a-o,u=l-r,h=Ls(c)+Ls(u),f=h===0?-1:((t-o)*c+(n-r)*u)/h;let m,p;return f<0?(m=o,p=r):f>1?(m=a,p=l):(m=o+f*c,p=r+f*u),Ls(t-m)+Ls(n-p)<=i}function ll(e,{mouseX:t,mouseY:n},i,s){const o=e.label;return o.options.display&&o.inRange(t,n,s,i)}function oD(e,t,n){const i=n.borderWidth,s=Wt(n.padding),o=Jo(e.ctx,n),r=o.width+s.width+i,a=o.height+s.height+i;return aD(t,n,{width:r,height:a,padding:s},e.chartArea)}function rD(e){const{x:t,y:n,x2:i,y2:s}=e,o=Math.atan2(s-n,i-t);return o>dt/2?o-dt:o<dt/-2?o+dt:o}function aD(e,t,n,i){const{width:s,height:o,padding:r}=n,{xAdjust:a,yAdjust:l}=t,c={x:e.x,y:e.y},u={x:e.x2,y:e.y2},h=t.rotation==="auto"?rD(e):Vt(t.rotation),f=lD(s,o,h),m=cD(e,t,{labelSize:f,padding:r},i),p=e.cp?al(c,e.cp,u,m):ol(c,u,m),y={size:f.w,min:i.left,max:i.right,padding:r.left},b={size:f.h,min:i.top,max:i.bottom,padding:r.top},S=om(p.x,y)+a,M=om(p.y,b)+l;return{x:S-s/2,y:M-o/2,x2:S+s/2,y2:M+o/2,centerX:S,centerY:M,pointX:p.x,pointY:p.y,width:s,height:o,rotation:so(h)}}function lD(e,t,n){const i=Math.cos(n),s=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*s),h:Math.abs(e*s)+Math.abs(t*i)}}function cD(e,t,n,i){let s;const o=uD(e,i);return t.position==="start"?s=sm({w:e.x2-e.x,h:e.y2-e.y},n,t,o):t.position==="end"?s=1-sm({w:e.x-e.x2,h:e.y-e.y2},n,t,o):s=Ja(1,t.position),s}function sm(e,t,n,i){const{labelSize:s,padding:o}=t,r=e.w*i.dx,a=e.h*i.dy,l=r>0&&(s.w/2+o.left-i.x)/r,c=a>0&&(s.h/2+o.top-i.y)/a;return Xo(Math.max(l,c),0,.25)}function uD(e,t){const{x:n,x2:i,y:s,y2:o}=e,r=Math.min(s,o)-t.top,a=Math.min(n,i)-t.left,l=t.bottom-Math.max(s,o),c=t.right-Math.max(n,i);return{x:Math.min(a,c),y:Math.min(r,l),dx:a<=c?1:-1,dy:r<=l?1:-1}}function om(e,t){const{size:n,min:i,max:s,padding:o}=t,r=n/2;return n>s-i?(s+i)/2:(i>=e-o-r&&(e=i+o+r),s<=e+o+r&&(e=s-o-r),e)}function rm(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:am(e,n),endAdjust:am(e,i)}}function am(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,s=e.options.borderWidth/2,o={x:n,y:i+s};return Math.abs(rl(0,o,{x:0,y:s}))}function cl(e,t,n,i){if(!i||!i.display)return;const{length:s,width:o,fill:r,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+n;e.beginPath(),Ei(e,i),nn(e,i),e.moveTo(c,-o),e.lineTo(t+n,0),e.lineTo(c,o),r===!0?(e.fillStyle=a||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function dD(e,t,n){const{x:i,y:s,x2:o,y2:r,centerX:a,centerY:l}=e,c=Math.atan2(r-s,o-i),u=tl(t.controlPoint,0),h={x:a+Dn(n,u.x,!1),y:l+Dn(n,u.y,!1)};return Xn(h,{x:a,y:l},c)}function lm(e,{x:t,y:n},{angle:i,adjust:s},o){!o||!o.display||(e.save(),e.translate(t,n),e.rotate(i),cl(e,0,-s,o),e.restore())}function hD(e,t,n,i){const{x:s,y:o,x2:r,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=rm(t),m={x:s,y:o},p={x:r,y:a},y=em(m,n,p,0),b=em(m,n,p,1)-dt,S=al(m,n,p,h/i),M=al(m,n,p,1-f/i),E=new Path2D;e.beginPath(),E.moveTo(S.x,S.y),E.quadraticCurveTo(n.x,n.y,M.x,M.y),e.shadowColor=l.borderShadowColor,e.stroke(E),t.path=E,t.ctx=e,lm(e,S,{angle:y,adjust:h},c),lm(e,M,{angle:b,adjust:f},u)}class Fs extends oe{inRange(t,n,i,s){const o=this.options.rotation,r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return fD({x:t,y:n},this.getProps(["width","height","centerX","centerY"],s),o,r);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:a,end:c},f=Xn({x:t,y:n},this.getCenterPoint(s),Vt(-o));return f[i]>=h.start-r-Zn&&f[i]<=h.end+r+Zn}getCenterPoint(t){return Qn(this,t)}draw(t){const{width:n,height:i,centerX:s,centerY:o,options:r}=this;t.save(),Qo(t,this.getCenterPoint(),r.rotation),Ei(t,this.options),t.beginPath(),t.fillStyle=r.backgroundColor;const a=nn(t,r);t.ellipse(s,o,i/2,n/2,dt/2,0,2*dt),t.fill(),a&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return $f(t,n)}}Fs.id="ellipseAnnotation",Fs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Pi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Fs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Fs.descriptors={label:{_fallback:!0}};function fD(e,t,n,i){const{width:s,height:o,centerX:r,centerY:a}=t,l=s/2,c=o/2;if(l<=0||c<=0)return!1;const u=Vt(n||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(e.x-r)+f*(e.y-a),2),p=Math.pow(f*(e.x-r)-h*(e.y-a),2);return m/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class nr extends oe{inRange(t,n,i,s){const{x:o,y:r,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?ak({x:t,y:n},this.getCenterPoint(s),c/2,u):vf(i==="y"?{start:r,end:l,value:n}:{start:o,end:a,value:t},u)}getCenterPoint(t){return Qn(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,Ei(t,n);const s=nn(t,n);pk(t,this,this.centerX,this.centerY),s&&!Zo(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=Wf(t,n);return i.initProperties=Oi(t,i,n),i}}nr.id="pointAnnotation",nr.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},nr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ir extends oe{inRange(t,n,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&pD(this.elements,t,n,s);const o=Xn({x:t,y:n},this.getCenterPoint(s),Vt(-this.options.rotation)),r=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...r),l=Math.max(...r);return o[i]>=a&&o[i]<=l}getCenterPoint(t){return Qn(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ei(t,i);const s=nn(t,i);let o=!0;for(const r of n)o?(t.moveTo(r.x,r.y),o=!1):t.lineTo(r.x,r.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=Wf(t,n),{sides:s,rotation:o}=n,r=[],a=2*dt/s;let l=o*Er;for(let c=0;c<s;c++,l+=a){const u=mD(i,n,l);u.initProperties=Oi(t,i,n),r.push(u)}return i.elements=r,i}}ir.id="polygonAnnotation",ir.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},ir.defaultRoutes={borderColor:"color",backgroundColor:"color"};function mD({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:s},o){const r=(i+s)/2,a=Math.sin(o),l=Math.cos(o),c={x:e+a*n,y:t-l*n};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:e+a*(n+r),bY:t-l*(n+r)}}}function pD(e,t,n,i){let s=!1,o=e[e.length-1].getProps(["bX","bY"],i);for(const r of e){const a=r.getProps(["bX","bY"],i);a.bY>n!=o.bY>n&&t<(o.bX-a.bX)*(n-a.bY)/(o.bY-a.bY)+a.bX&&(s=!s),o=a}return s}const Cn={box:Pi,doughnutLabel:er,ellipse:Fs,label:Is,line:Ns,point:nr,polygon:ir};Object.keys(Cn).forEach(e=>{Et.describe(`elements.${Cn[e].id}`,{_fallback:"plugins.annotation.common"})});const gD={update:Object.assign},yD=sl.concat(tr),cm=(e,t)=>ft(t)?hl(e,t):e,ul=e=>e==="color"||e==="font";function dl(e="line"){return Cn[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function bD(e,t,n,i){const s=xD(e,n.animations,i),o=t.annotations,r=TD(t.elements,o);for(let a=0;a<o.length;a++){const l=o[a],c=um(r,a,l.type),u=l.setContext(SD(e,c,r,l)),h=c.resolveElementProperties(e,u);h.skip=_D(h),"elements"in h&&(wD(c,h.elements,u,s),delete h.elements),fe(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=dm(u),s.update(c,h)}}function _D(e){return isNaN(e.x)||isNaN(e.y)}function xD(e,t,n){return n==="reset"||n==="none"||n==="resize"?gD:new Yr(e,t)}function wD(e,t,n,i){const s=e.elements||(e.elements=[]);s.length=t.length;for(let o=0;o<t.length;o++){const r=t[o],a=r.properties,l=um(s,o,r.type,r.initProperties),c=n[r.optionScope].override(r);a.options=dm(c),i.update(l,a)}}function um(e,t,n,i){const s=Cn[dl(n)];let o=e[t];return(!o||!(o instanceof s))&&(o=e[t]=new s,Object.assign(o,i)),o}function dm(e){const t=Cn[dl(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,hl(e,t.defaults),hl(e,t.defaultRoutes));for(const i of yD)n[i]=e[i];return n}function hl(e,t){const n={};for(const i of Object.keys(t)){const s=t[i],o=e[i];ul(i)&&xt(o)?n[i]=o.map(r=>cm(r,s)):n[i]=cm(o,s)}return n}function SD(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function TD(e,t){const n=t.length,i=e.length;if(i<n){const s=n-i;e.splice(i,0,...new Array(s))}else i>n&&e.splice(n,i-n);return e}var vD="3.1.0";const On=new Map,hm=e=>e.type!=="doughnutLabel",MD=sl.concat(tr);var fm={id:"annotation",version:vD,beforeRegister(){lk("chart.js","4.0",pe.version)},afterRegister(){pe.register(Cn)},afterUnregister(){pe.unregister(Cn)},beforeInit(e){On.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=On.get(e),s=i.annotations=[];let o=n.annotations;ft(o)?Object.keys(o).forEach(r=>{const a=o[r];ft(a)&&(a.id=r,s.push(a))}):xt(o)&&s.push(...o),Vk(s.filter(hm),e.scales)},afterDataLimits(e,t){const n=On.get(e);Hk(e,t.scale,n.annotations.filter(hm).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=On.get(e);Nk(e,i,n),bD(e,i,n,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),Uk(e,i,n)},beforeDatasetsDraw(e,t,n){Bs(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Bs(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Bs(e,t.index,n.clip)},beforeDraw(e,t,n){Bs(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Bs(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=On.get(e);Fk(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){On.delete(e)},getAnnotations(e){const t=On.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return Qa(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=>!MD.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${Cn[dl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:ul,_fallback:!0},_indexable:ul}},additionalOptionScopes:[""]};function Bs(e,t,n){const{ctx:i,chartArea:s}=e,o=On.get(e);n&&ts(i,s);const r=kD(o.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of r)DD(i,s,o,a);n&&es(i)}function kD(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 s of i.elements)s.options.display&&s.options.drawTime===t&&n.push({element:s});return n}function DD(e,t,n,i){const s=i.element;i.main?(Kf(n,s,"beforeDraw"),s.draw(e,t),Kf(n,s,"afterDraw")):s.draw(e,t)}const CD={class:"zoom-timerange-container"},OD={class:"zoom-timerange-details"},ED={class:"label","data-testid":"zoom-timerange-from"},AD={class:"label","data-testid":"zoom-timerange-to"},PD=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.ref(Ds({tickValue:t.start,granularity:t.granularity})),s=d.ref(Ds({tickValue:t.end,granularity:t.granularity})),o=(r,a)=>{Vh(()=>{i.value=Ds({tickValue:r,granularity:t.granularity}),s.value=Ds({tickValue:a,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([r,a])=>{o(r,a)},{immediate:!0}),(r,a)=>(d.openBlock(),d.createElementBlock("div",CD,[d.createElementVNode("div",OD,[d.createElementVNode("div",ED,d.toDisplayString(d.unref(n).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",AD,d.toDisplayString(d.unref(n).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(s.value),1)])]))}}),ke=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},mm=ke(PD,[["__scopeId","data-v-4fa681cf"]]),RD={class:"zoom-actions-container"},ID={class:"zoom-actions-heading"},LD={class:"zoom-action-select"},ND=["data-testid"],FD=["aria-disabled","href"],BD=["onClick"],zD=ke(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,s=o=>{o.action&&(o.action(n.newTimeRange),i("onAction"))};return(o,r)=>(d.openBlock(),d.createElementBlock("div",RD,[d.createElementVNode("div",ID,[d.createVNode(mm,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Wi.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`,onClick:r[0]||(r[0]=a=>o.$emit("onAction"))},null,8,["color","size"])]),r[2]||(r[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",LD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.zoomActionItems,a=>(d.openBlock(),d.createElementBlock("div",{key:a.key,class:d.normalizeClass(["zoom-action-item",{disabled:a.disabled}]),"data-testid":`zoom-action-item-${a.key}`},[a.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":a.disabled,class:"zoom-action-link",href:a.href,onClick:r[1]||(r[1]=l=>o.$emit("onAction"))},d.toDisplayString(a.label),9,FD)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(a)},d.toDisplayString(a.label),9,BD))],10,ND))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),UD={key:2},HD={class:"tooltip-title"},VD={class:"title"},WD={key:0,class:"subtitle"},$D={class:"context"},YD={class:"metric"},jD={class:"tooltip"},qD={key:0},GD={class:"display-value"},sr=ke(d.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(e,{emit:t}){const n=t,i=e,s=d.ref(null),{x:o,y:r,isDragging:a}=GM(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${r.value}px`),c=d.computed(()=>`${o.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,p])=>{a.value||(o.value=parseFloat(m),r.value=parseFloat(p))}),d.watch(a,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(s,m=>{if(m){const{width:p,height:y}=m.getBoundingClientRect();n("dimensions",{width:p,height:y})}}),(m,p)=>e.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity&&e.zoomTimeRange&&e.zoomTimeRange.end&&e.zoomTimeRange.start?(d.openBlock(),d.createBlock(mm,{key:0,end:e.zoomTimeRange?.end,granularity:e.granularity,start:e.zoomTimeRange?.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(d.openBlock(),d.createBlock(zD,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:p[0]||(p[0]=y=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",UD,[d.createElementVNode("div",HD,[d.createElementVNode("div",VD,[d.createElementVNode("div",null,d.toDisplayString(e.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Wi.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",WD,[d.createElementVNode("div",$D,d.toDisplayString(u.value),1),d.createElementVNode("div",YD,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",jD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.state.tooltipSeries,({backgroundColor:y,borderColor:b,label:S,value:M,isSegmentEmpty:E},D)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:S+D},[e.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",qD,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:String(y),borderColor:String(b)})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:E}])},d.toDisplayString(S),3),d.createElementVNode("span",GD,d.toDisplayString(M),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),KD={key:0,class:"legend-container","data-testid":"legend"},XD=["onClick"],ZD=["title"],QD={class:"label truncate-label"},JD={key:0,class:"sub-label"},tC={class:"tooltip-content"},fl=ke(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.inject("showLegendValues",!1),s=d.inject("legendPosition",d.ref(be.Bottom)),o=(a=0,l)=>{if(t.chartInstance===null)return;const c=t.chartInstance instanceof pe?t.chartInstance:t.chartInstance.chart;r(a,l)?c.hide(a,l):c.show(a,l),c.update()},r=(a=0,l)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const c=t.chartInstance instanceof pe?t.chartInstance:t.chartInstance.chart;return c.getDatasetMeta(a).dataset||l===void 0?c.isDatasetVisible(a):c.getDataVisibility(l)};return(a,l)=>{const c=d.resolveComponent("KTooltip");return d.unref(s)!==d.unref(be).Hidden?(d.openBlock(),d.createElementBlock("ul",KD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.items,({fillStyle:u,strokeStyle:h,text:f,datasetIndex:m,index:p,value:y,isSegmentEmpty:b})=>(d.openBlock(),d.createElementBlock("li",{key:f,onClick:S=>o(m,p)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:u,"border-color":h})},null,4),d.createVNode(c,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!r(m,p)}]),title:y&&d.unref(i)?`${f}: ${y.formatted}`:f},[d.createElementVNode("div",QD,d.toDisplayString(f),1),y&&d.unref(i)?(d.openBlock(),d.createElementBlock("div",JD,d.toDisplayString(y.formatted),1)):d.createCommentVNode("",!0)],10,ZD)]),_:2},[b?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",tC,d.toDisplayString(d.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,XD))),128))])):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-e6664c85"]]),Qt=[];for(let e=0;e<256;++e)Qt.push((e+256).toString(16).slice(1));function eC(e,t=0){return(Qt[e[t+0]]+Qt[e[t+1]]+Qt[e[t+2]]+Qt[e[t+3]]+"-"+Qt[e[t+4]]+Qt[e[t+5]]+"-"+Qt[e[t+6]]+Qt[e[t+7]]+"-"+Qt[e[t+8]]+Qt[e[t+9]]+"-"+Qt[e[t+10]]+Qt[e[t+11]]+Qt[e[t+12]]+Qt[e[t+13]]+Qt[e[t+14]]+Qt[e[t+15]]).toLowerCase()}const nC=new Uint8Array(16);function iC(){return crypto.getRandomValues(nC)}function ml(e,t,n){return crypto.randomUUID?crypto.randomUUID():sC(e)}function sC(e,t,n){e=e||{};const i=e.random??e.rng?.()??iC();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,eC(i)}const pm=(e,t)=>{const n=e.ctx,i=e.scales.y,s=e.scales.x,o=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(o.x-o.width/2,o.y,o.width,i.bottom-o.y):n.strokeRect(s.left,o.y-o.height/2,o.x-s.left,o.height),n.restore()};class gm{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&pm(t,this._clickedElements)}afterEvent(t,{event:n}){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=t.options.interaction?.mode||"index",s=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,pm(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const oC=["id"],rC=["id"],aC={class:"axis-tooltip-content"},lC="100%",cC="100%",uC=20,dC=20,ym=6,hC=0,fC=10,mC=10,pC=1,gC=ke(d.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(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(),s=crypto.randomUUID(),o=crypto.randomUUID(),r=new gm,a=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:q},G)=>{const J=q.data,nt=J.labels?.indexOf(G);return J.datasets.reduce((tt,Z,pt)=>{if(q.isDatasetVisible(pt)){const bt=Z.data[nt];return isNaN(bt)?tt:tt+bt}else return tt},0)},u=(q,G,J,nt)=>{const tt=nt==="horizontal";G===null&&(G=n.t("entityNoName"));const Z={type:"label",yValue:ot=>tt?G:c(ot,G),xValue:ot=>tt?c(ot,G):G},pt={...Z,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(Rv()),content:ot=>Kh(c(ot,G),J)},bt={...Z,content:ot=>Lv(c(ot,G),Iv(ot.chart,q)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:ot=>tt?Pv(Kh(c(ot,G),J)):0,color:Mv};return{[`${G}-value`]:pt,[`${G}-percent`]:bt}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=ml(),p=ml(),y=d.ref([]),b=d.inject("legendPosition",be.Bottom),S=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),M=d.toRef(t,"metricUnit"),E=d.computed(()=>t.orientation==="horizontal"),D=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:E.value?"horizontal_bar":"vertical_bar",chartID:o,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:C,tooltipAbsoluteTop:A}=mt.useTooltipAbsolutePosition(l,D),O=d.ref(0),x=()=>t.annotations&&t.chartData.labels?.reduce((q,G)=>Object.assign(q,u(t.chartData,G,M.value,t.orientation)),{}),_={id:m,afterUpdate(q){O.value+=1,y.value=Wh(q,t.legendValues,t.chartLegendSortFn)}},T={id:p,afterUpdate(q){q.options.plugins.annotation.annotations=t.annotations?x():{}}},I=[_,{id:"axisHover",afterEvent(q,G){if(S.show=!1,G.event.type==="mousemove"){const J=G.event,nt=q.options.indexAxis,tt=q.scales,Z=q.scales[nt].getLabelForValue(Number(q.scales[nt].getValueForPixel(J[nt]))),bt=q.scales[nt].getLabels().indexOf(Z),ot=t.chartData.isLabelEmpty?.[bt];if((ct=>ct==="x"?J.y>tt.x.top:J.x<tt.y.right)(nt)){D.interactionMode!=="interactive"&&(D.showTooltip=!1);const $t=q.canvas.getContext("2d").measureText(Z).width,lt=Math.abs(Math.round(J.x-$t*.5)),Mt=Math.round(J.x+$t*.5),Yt=q.canvas.getBoundingClientRect(),_e=40;S.left=nt==="x"?`${(lt>0?lt:Mt)-S.offset+Yt.left}px`:`${J.x-$t*.5-S.offset+Yt.left}px`,S.top=`${J.y-_e+Yt.top}px`,Z.length>$o?(S.show=!0,S.text=Z):ot?(S.text=n.t("emptyEntityInfo"),S.show=!0):S.show=!1}else S.show=!1}}},r,...t.annotations?[T]:[]],Y=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),U=d.ref(0),j=d.ref(0),H=new ResizeObserver(Vh(q=>{U.value=q[0].contentRect.width,j.value=q[0].contentRect.height},100)),$=d.computed(()=>{const q=t.chartData?.labels?.length;return h.value&&q&&!E.value?`${Math.max(q*(uC+ym),U.value)}px`:lC}),R=d.computed(()=>{const q=t.chartData?.labels?.length;return h.value&&q&&E.value?`${Math.max(q*(dC+ym),j.value)}px`:cC});mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&pe.register(fm),a.value&&(U.value=a.value.offsetWidth,j.value=a.value.offsetHeight,H.observe(a.value))}),d.onUnmounted(()=>{a.value&&H.unobserve(a.value)});const B=d.computed(()=>{const q=mt.useBarChartOptions({tooltipState:D,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:E.value?"y":"x",numLabels:Y});return{...q.value,plugins:{...q.value.plugins,annotation:{annotations:x(),clip:!1}}}}),z=mt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),I,B);d.onBeforeUnmount(()=>{pe.unregister(fm)});const P={[be.Bottom]:"column"},N=d.computed(()=>{if(f.value&&z.value){const q=window.devicePixelRatio,G=z.value,J=G.scales.y.width*q+pC,nt=(G.scales.y.height+G.scales.y.top+G.scales.x.height)*q,tt=f.value.getContext("2d");return tt.scale(q,q),tt.canvas.width=J,tt.canvas.height=nt,tt.canvas.style.width=`${J/q}px`,tt.canvas.style.height=`${nt/q}px`,{scale:q,width:J*q,height:nt*q,targetCtx:tt}}return null}),V=q=>{const G=q.target;if(N.value&&z.value&&!E.value){const J=N.value.scale,nt=N.value.targetCtx,tt=N.value.width,Z=N.value.height,pt=z.value,bt=pt.canvas;nt.fillStyle="white",G.scrollLeft>=hC&&G.scrollLeft<=fC?(nt.globalCompositeOperation="source-over",nt.clearRect(0,0,tt,Z),nt.drawImage(bt,0,0,tt,Z,0,0,tt,Z),nt.globalCompositeOperation="destination-over",nt.fillRect(0,0,tt,Z)):(nt.globalCompositeOperation="source-over",nt.fillRect(0,(pt.scales.y.height+pt.scales.y.top+mC)*J,tt,pt.scales.x.height*J))}D.offsetY=G.scrollTop,D.offsetX=G.scrollLeft,S.offset=G.scrollLeft},Q=({width:q,height:G})=>{D.width=q,D.height=G};d.watch(()=>t.orientation,()=>{if(f.value&&N.value){const q=N.value.width,G=N.value.height;(f.value?.getContext("2d")).clearRect(0,0,q,G)}D.showTooltip=!1,D.interactionMode="idle"}),d.watch(()=>t.annotations,q=>{z.value&&(q?z.value.options.plugins.annotation.annotations=x(t.chartData):delete z.value.options.plugins.annotation.annotations)});const X=()=>{D.showTooltip&&(D.interactionMode!=="idle"?D.interactionMode="idle":D.interactionMode="interactive")};return(q,G)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",P[d.unref(b)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,oC),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:G[0]||(G[0]=J=>X()),onScroll:V},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:$.value,height:R.value})},[d.createElementVNode("canvas",{id:d.unref(o),ref:"canvas",class:"chart-canvas"},null,8,rC)],4)],544),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[S.show?(d.openBlock(),d.createElementBlock("div",{key:0,class:"axis-tooltip",style:d.normalizeStyle({top:S.top,left:S.left}),width:"auto"},[d.createElementVNode("div",aC,d.toDisplayString(S.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(sr,{"absolute-left":d.unref(C),"absolute-top":d.unref(A),"chart-parent-ref":l.value,state:D,"tooltip-title":e.tooltipTitle,onDimensions:Q},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(fl,{id:d.unref(m),"chart-instance":d.unref(z),items:y.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const yC={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"};du._date.override({_id:"date-fns",formats:function(){return yC},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=ut(e):n==="string"&&(typeof t=="string"?e=uw(e,t,new Date,this.options):e=Kd(e,this.options)),ga(e)?e.getTime():null},format:function(e,t){return Ao(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return ma(e,t);case"second":return o_(e,t);case"minute":return i_(e,t);case"hour":return t_(e,t);case"day":return Oo(e,t);case"week":return r_(e,t);case"month":return fa(e,t);case"quarter":return s_(e,t);case"year":return a_(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return ya(e,t);case"second":return p_(e,t);case"minute":return h_(e,t);case"hour":return d_(e,t);case"day":return Cd(e,t);case"week":return g_(e,t);case"month":return Pd(e,t);case"quarter":return m_(e,t);case"year":return y_(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return mw(e);case"minute":return fw(e);case"hour":return hw(e);case"day":return pa(e);case"week":return Ve(e);case"isoWeek":return Ve(e,{weekStartsOn:+n});case"month":return __(e);case"quarter":return b_(e);case"year":return Rd(e);default:return e}},endOf:function(e,t){switch(t){case"second":return M_(e);case"minute":return T_(e);case"hour":return w_(e);case"day":return Ed(e);case"week":return S_(e);case"month":return Ad(e);case"quarter":return v_(e);case"year":return x_(e);default:return e}}});const bm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},bC={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...bm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},_C=d.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Ri(e){return d.isProxy(e)?d.toRaw(e):e}function xC(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return d.isProxy(t)?new Proxy(e,{}):e}function wC(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function _m(e,t){e.labels=t}function xm(e,t,n){const i=[];e.datasets=t.map(s=>{const o=e.datasets.find(r=>r[n]===s[n]);return!o||!s.data||i.includes(o)?{...s}:(i.push(o),Object.assign(o,s),o)})}function SC(e,t){const n={labels:[],datasets:[]};return _m(n,e.labels),xm(n,e.datasets,t),n}const TC=d.defineComponent({props:bC,setup(e,t){let{expose:n,slots:i}=t;const s=d.ref(null),o=d.shallowRef(null);n({chart:o});const r=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=e,p=SC(u,m),y=xC(p,u);o.value=new pe(s.value,{type:c,data:y,options:{...h},plugins:f})},a=()=>{const c=d.toRaw(o.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},e.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(e.updateMode)};return d.onMounted(r),d.onUnmounted(a),d.watch([()=>e.options,()=>e.data],(c,u)=>{let[h,f]=c,[m,p]=u;const y=d.toRaw(o.value);if(!y)return;let b=!1;if(h){const S=Ri(h),M=Ri(m);S&&S!==M&&(wC(y,S),b=!0)}if(f){const S=Ri(f.labels),M=Ri(p.labels),E=Ri(f.datasets),D=Ri(p.datasets);S!==M&&(_m(y.config.data,S),b=!0),E&&E!==D&&(xm(y.config.data,E,e.datasetIdKey),b=!0)}b&&d.nextTick(()=>{l(y)})},{deep:!0}),()=>d.h("canvas",{role:"img","aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function pl(e,t){return pe.register(t),d.defineComponent({props:bm,setup(n,i){let{expose:s}=i;const o=d.shallowRef(null),r=a=>{o.value=a?.chart};return s({chart:o}),()=>d.h(TC,_C({ref:r},{type:e,...n}))}})}const wm=pl("bar",lu),Sm=pl("doughnut",ss),Tm=pl("line",cu),vC={class:"chart-container"},MC={key:0,class:"chart-center-metric"},kC={class:"chart-center-total"},DC={key:0,class:"chart-center-unit"},CC=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:be.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>Mn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(e){const t=e,{translateUnit:n}=mt.useTranslatedUnits(),{i18n:i}=mt.useI18n(),s=crypto.randomUUID(),o=crypto.randomUUID(),r=d.ref([]),a=d.useTemplateRef("chartParent"),l=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:o,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:c,tooltipAbsoluteTop:u}=mt.useTooltipAbsolutePosition(a,l),h={id:s,afterUpdate(O){r.value=O.options.plugins.legend.labels.generateLabels(O).map(x=>({...x,value:t.legendValues&&t.legendValues[x.text],hidden:!1}))}},f=d.computed(()=>[h]),m=d.computed(()=>[t.chartData.datasets.reduce((x,_)=>(x.labels.push(_.label),x.backgroundColor.push(_.backgroundColor),x.hoverBorderColor.push(Ir(_.backgroundColor).saturate(.5).darken(.15).hexString()),x.data.push(_.data.reduce((T,k)=>T+k,0)),x),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:p}=Gn({i18n:i}),y=d.computed(()=>_M(t.metricName??"")),b=d.computed(()=>{const O=m.value[0]?.data.reduce((x,_)=>x+_,0)??0;return p(O,t.metricUnit,{approximate:!0,translateUnit:(x,_)=>n(x,_)}).trim()}),S=d.computed(()=>t.tooltipMetricDisplay||""),M=d.computed(()=>({...t.chartData,datasets:m.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:E}=mt.useDonutChartOptions({tooltipState:l,legendID:s}),D=d.ref(),C=O=>({[be.Bottom]:"column",[be.Hidden]:"hidden"})[O],A=({width:O,height:x})=>{l.width=O,l.height=x};return(O,x)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",C(e.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",vC,[d.createVNode(d.unref(Sm),{ref_key:"chartInstance",ref:D,"chart-id":d.unref(o),data:M.value,options:d.unref(E),plugins:f.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&y.value?(d.openBlock(),d.createElementBlock("div",MC,[d.createElementVNode("span",kC,d.toDisplayString(b.value),1),S.value?(d.openBlock(),d.createElementBlock("span",DC,d.toDisplayString(S.value),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(sr,{"absolute-left":d.unref(c),"absolute-top":d.unref(u),state:l,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:A},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(fl,{id:d.unref(s),"chart-instance":D.value,items:r.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),OC=ke(CC,[["__scopeId","data-v-48b16272"]]),gl=(e,t,n,i,s="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=s,e.stroke(),e.restore()},de={},EC=()=>{de.x=void 0,de.chart=void 0,de.strategy=void 0,de.group=void 0},AC=10;class vm{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){let s=!1;n==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}_lastMouseBrushEvent=0;onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<AC)return;const s=()=>{de.chart=n,de.strategy=this._brushStrategy,de.group=this._brushGroup;for(const o of Object.values(pe.instances))o!==n&&o.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(de.x=n.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(de.x=void 0,s()),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:s}=this._clickedSegment.element;gl(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:s}=t.tooltip.dataPoints[0].element;gl(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(de.x===void 0)return;const n=de.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&de.group===this._brushGroup&&gl(t.ctx,de.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&&de.chart===t){const n=de.x!==void 0;if(EC(),n)for(const i of Object.values(pe.instances))i!==t&&i.update("none")}}}const PC=(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()},RC=(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()},Mm=(e,t,n)=>{const i=t.scales.x.getValueForPixel(n.startX),s=t.scales.x.getValueForPixel(n.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(e,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class IC{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},o=a=>{const l=n.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,Mm("dragSelectMove",t,this))},r=a=>{const l=n.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,Mm("dragSelect",t,this),i=!1,this._isDragging=!1)};n.addEventListener("mousedown",s),n.addEventListener("mousemove",o),n.addEventListener("mouseup",r),this._dragSelectHandlers={onMouseDown:s,onMouseMove:o,onMouseUp:r}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:o}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",s),n.removeEventListener("mouseup",o)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(RC(t,this._startX,this._endX),PC(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const LC=["hidden","single","full"];var ti=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(ti||{});const NC=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],FC=["gauge","top_n","single_value"],BC=20,zC="rgba(255, 171, 171, 0.4)",UC="rgba(255, 196, 0, 0.2)",km=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const s=(n-e.y)/i;return e.x+s*(t.x-e.x)},HC=(e,t)=>{const n=[];return e.data.datasets.forEach(i=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(i)).visible)return;const o=i.data;o?.length&&t.filter(r=>r.highlightIntersections).forEach(r=>{const a=o.map(c=>({ts:c.x,aboveThreshold:c.y>=r.value}));let l=a[0].aboveThreshold?o[0].x:void 0;for(let c=1;c<a.length;c++)!a[c-1].aboveThreshold&&a[c].aboveThreshold?l=km(o[c-1],o[c],r.value):a[c-1].aboveThreshold&&!a[c].aboveThreshold&&l!==void 0&&(n.push({start:l,end:km(o[c-1],o[c],r.value),type:r.type}),l=void 0);l!==void 0&&n.push({start:l,end:a[a.length-1].ts,type:r.type})})}),n},VC=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:s})=>s===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class WC{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const n of Object.keys(t.threshold||{})){const i=t.threshold?.[n];i&&(this._thresholds={...this._thresholds,[n]:i.map(s=>({...s,hovered:!1}))})}if(this._thresholds)for(const n of Object.keys(this._thresholds))t.threshold?.[n]||delete this._thresholds[n]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const s=t.canvas;this._syncThresholds(i);const o=r=>{if(t){const a=r.clientY,l=t.scales.y,c=s.getBoundingClientRect(),u=l.getValueForPixel(a-c.top);if(u)for(const h of Object.keys(this._thresholds||{})){const f=this._thresholds?.[h];f&&f.forEach(m=>{m.hovered=Math.abs(m.value-u)<BC})}}};s.addEventListener("mousemove",o),this._mouseMoveHandler=o}afterDatasetsDraw(t,n){const i=t.ctx;for(const s of Object.keys(this._thresholds||{})){const o=this._thresholds?.[s];if(o){o.forEach(l=>{const u=t.scales.y.getPixelForValue(l.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,u),i.lineTo(t.chartArea.right,u),i.lineWidth=1,i.strokeStyle=Ba(l.type),i.setLineDash([5,5]),i.stroke(),i.restore();let h="";l.label?h=`${l.label}: ${l.value}`:l.type==="warning"?h=this.i18n.t("chartLabels.threshold-warning",{value:l.value}):l.type==="error"?h=this.i18n.t("chartLabels.threshold-error",{value:l.value}):h=this.i18n.t("chartLabels.thatreshold-neutral",{value:l.value}),l.hovered&&(i.save(),i.fillStyle=Ba(l.type),i.font=o1,i.fillText(h,t.chartArea.left,u-4),i.restore())});const r=HC(t,o);VC(r).forEach(l=>{const c=t.scales.x.getPixelForValue(l.start),u=t.scales.x.getPixelForValue(l.end);i.save(),i.fillStyle=l.type==="error"?zC:UC,i.fillRect(c,t.chartArea.top,u-c,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(c,t.chartArea.bottom),i.lineTo(u,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Ba(l.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const $C=ke(d.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(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:s}=mt.useI18n(),o=new vm,r=new gm,a=new IC,l=new WC(s),{translateUnit:c}=mt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),p=d.inject("legendPosition",be.Bottom),y=d.useTemplateRef("chartParent"),b=d.ref(void 0),S=d.ref(!1),M=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:d.toRef(n,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(n,"metricUnit"),translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:f,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:E,tooltipAbsoluteTop:D}=mt.useTooltipAbsolutePosition(y,M),C={id:h,afterUpdate(z){m.value=Wh(z,n.legendValues,n.chartLegendSortFn)}},A=d.computed(()=>[C,r,...n.brush?[a]:[],...n.type==="timeseries_line"?[o]:[],...n.threshold?[l]:[]]),O=d.computed(()=>`line-${A.value.map(z=>z.id).join("-")}`),x=d.computed(()=>`bar-${A.value.map(z=>z.id).join("-")}`),_=d.computed(()=>n.chartData&&qT(n.chartData)),{options:T}=mt.useLineChartOptions({tooltipState:M,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:_,threshold:d.toRef(n,"threshold")});mt.useReportChartDataForSynthetics(d.toRef(n,"chartData"),d.toRef(n,"syntheticsDataKey"));const k=z=>({[be.Bottom]:"column",[be.Hidden]:"hidden"})[z],I=({width:z,height:P})=>{M.width=z,M.height=P},Y=(z=!0)=>{M.interactionMode="idle",M.showTooltip=!1,a.clearSelectionArea(),r.isPaused&&r.resume(z),o.isPaused&&o.resume()},U=()=>{M.interactionMode="interactive"},j=()=>{!u.value||!u.value.chart.tooltip?.dataPoints?.length||(M.interactionMode==="interactive"?o.clickedSegment=u.value.chart.tooltip.dataPoints[0]:o.destroyClickedSegment())},H=()=>{if(S.value){S.value=!1;return}M.interactionMode!=="idle"?Y():U(),j()};d.watch(()=>n.type,()=>{M.interactionMode="idle",M.showTooltip=!1,o.destroyClickedSegment()});const $=z=>{z.preventDefault(),z.stopPropagation();const{xStart:P,xEnd:N}=z.detail;P&&N&&(b.value={start:new Date(P),end:new Date(N),type:"absolute"},M.interactionMode="zoom-interactive",i("select-chart-range",b.value))},R=z=>{M.interactionMode="selecting-chart-area",S.value=!0,o.pause(),r.pause();const{xStart:P,xEnd:N}=z.detail;P&&N&&(b.value={start:new Date(P),end:new Date(N),type:"absolute"})},B=z=>{if(!y.value||M.interactionMode==="idle")return;const P=z.target;P&&y.value.contains(P)||S.value||Y(!1)};return d.watch(()=>u.value?.chart,()=>{u.value?.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",$),u.value.chart.canvas.removeEventListener("dragSelectMove",R),u.value.chart.canvas.addEventListener("dragSelect",$),u.value.chart.canvas.addEventListener("dragSelectMove",R))}),d.onMounted(()=>{document.addEventListener("click",B,!0)}),d.onUnmounted(()=>{u.value?.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",$),u.value.chart.canvas.removeEventListener("dragSelectMove",R)),document.removeEventListener("click",B,!0)}),(z,P)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",k(d.unref(p))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:P[0]||(P[0]=N=>H())},[e.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Tm),{key:O.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(T),plugins:A.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(wm),{key:x.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(T),plugins:A.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(sr,{"absolute-left":d.unref(E),"absolute-top":d.unref(D),"data-testid":"tooltip",granularity:e.granularity,state:M,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":b.value,onDimensions:I,onOnAction:P[1]||(P[1]=()=>Y(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(fl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-ac6e8bbc"]]),YC={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},jC={class:"tooltip-content"},qC={key:2,class:"analytics-chart-parent"},GC=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:be.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:s}=mt.useI18n(),o=d.computed(()=>b.value?mt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ua},d.toRef(i,"chartData")).value:mt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ua},d.toRef(i,"chartData")).value),r=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),a=d.computed(()=>{if(!i.chartData?.meta)return 0;if(i.chartData.meta.start&&i.chartData.meta.end){const U=new Date(i.chartData.meta.start).getTime();return new Date(i.chartData.meta.end).getTime()-U}}),l=d.computed(()=>i.chartData.meta?.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""),c=d.computed(()=>i.chartData.meta?.metric_units?Object.keys(i.chartData.meta.metric_units)[0]??"":""),u=d.computed(()=>i.showLegendValues&&i.legendPosition!==be.Hidden),{legendValues:h}=mt.useChartLegendValues(o,i.chartOptions.type,l),f=d.computed(()=>i.chartData?.meta?.limit?.toString()||null),m=d.computed(()=>i.chartOptions.hideTruncationWarning?!1:i.chartData?.meta?.truncated||!1),p=d.computed(()=>s.t("limitedResultsShown",{maxReturned:f.value})),y=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),b=d.computed(()=>["timeseries_bar","timeseries_line"].some(U=>U===i.chartOptions.type)),S=d.computed(()=>i.chartOptions.type==="donut"),M=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),E=d.computed(()=>{if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const U=i.chartData.meta.metric_names[0],j=i.chartData.meta.metric_units[U]||"";if(i.chartData.meta.metric_names.length>1){if(U.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})});if(U.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})})}if(U)return Cs(j)&&s.te(`metricAxisTitles.${U}`)?s.t(`metricAxisTitles.${U}`)||void 0:s.te(`chartLabels.${U}`)?s.t(`chartLabels.${U}`):U}),D=d.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const U=i.chartData.meta.metric_names[0],j=i.chartData.meta.metric_units[U]||"";if(i.chartData.meta.metric_names.length>1){if(U.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})});if(U.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})})}return s.te(`metricAxisTitles.${U}`)&&(Cs(j)||s.te(`chartUnits.${j}`))?Cs(j)?s.t(`metricAxisTitles.${U}`)||void 0:s.t(`metricAxisTitles.${U}`,{unit:s.t(`chartUnits.${j}`,{plural:"s"})})||void 0:U||void 0}),C=d.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const U=b.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(U)return s.te(`chartLabels.${U}`)?s.t(`chartLabels.${U}`):U}),A=d.computed(()=>{if(zw(i.chartData.meta.datasource))return s.t("timestampAxisTitles.platform");const U=Ra(Number(i.chartData.meta.granularity_ms));if(U)return s.te(`granularityAxisTitles.${U}`)?s.t(`granularityAxisTitles.${U}`):U}),O=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),x=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),_=d.computed(()=>b.value?GT(o.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),T=d.computed(()=>i.chartData.meta.granularity_ms?Ra(i.chartData.meta.granularity_ms)||"hourly":Ra(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),k=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(U,j)=>U.text===s.t("chartLabels.____OTHER____")?1:j.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(U.text,10))&&!isNaN(parseInt(j.text,10))?U.text<j.text?-1:1:U.value&&j.value?j.value.raw-U.value.raw:0),I=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(U,j)=>U.label===s.t("chartLabels.____OTHER____")?1:j.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(U.label,10))&&!isNaN(parseInt(j.label,10))?U.label<j.label?-1:1:U.value&&j.value?j.rawValue-U.rawValue:0),Y=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:U=>n("zoom-time-range",U)}]:[],...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",u),d.provide("legendPosition",d.toRef(i,"legendPosition")),(U,j)=>{const H=d.resolveComponent("KTooltip"),$=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["analytics-chart-shell",{"show-values":u.value}])},[_.value&&m.value&&f.value?(d.openBlock(),d.createElementBlock("div",YC,[d.createVNode(H,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",jC,d.toDisplayString(p.value),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Wi.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(i1)})`,size:`var(--kui-icon-size-40, ${d.unref(r1)})`},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),_.value?(d.openBlock(),d.createElementBlock("div",qC,[b.value?(d.openBlock(),d.createBlock($C,{key:0,brush:r.value,"chart-data":o.value,"chart-legend-sort-fn":k.value,"chart-tooltip-sort-fn":I.value,"dimension-axes-title":A.value,fill:e.chartOptions.stacked,granularity:T.value,"legend-values":d.unref(h),"metric-axes-title":D.value,"metric-unit":l.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:e.chartOptions.threshold,"time-range-ms":a.value,"tooltip-metric-display":E.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":Y.value,onSelectChartRange:j[0]||(j[0]=R=>n("select-chart-range",R)),onZoomTimeRange:j[1]||(j[1]=R=>n("zoom-time-range",R))},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"])):y.value?(d.openBlock(),d.createBlock(gC,{key:1,annotations:e.showAnnotations,"chart-data":o.value,"chart-legend-sort-fn":k.value,"chart-tooltip-sort-fn":I.value,"data-testid":"bar-chart-container","dimension-axes-title":C.value,"legend-values":d.unref(h),"metric-axes-title":D.value,"metric-unit":l.value,orientation:M.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":E.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"])):S.value?(d.openBlock(),d.createBlock(OC,{key:2,"chart-data":o.value,"dataset-colors":e.chartOptions.chartDatasetColors||d.unref(Ua),"legend-position":e.legendPosition,"legend-values":d.unref(h),"metric-name":c.value,"metric-unit":l.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":C.value,"tooltip-metric-display":E.value,"tooltip-title":e.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock($,{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(x.value),1)]),_:1}))],2)}}}),KC=ke(GC,[["__scopeId","data-v-346b2111"]]),XC={class:"chart-parent","data-testid":"gauge-chart-parent"},ZC={class:"chart-totals-flex"},QC={key:1,class:"metric-small","data-testid":"gauge-chart-total"},JC=ke(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Mn},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(ml()),s=d.computed(()=>[t.chartData.datasets.reduce((m,p)=>(m.labels.push(p.label),m.borderColor.push(p.backgroundColor),m.backgroundColor.push(p.backgroundColor),m.data.push(p.data.reduce((y,b)=>y+b,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),o=d.computed(()=>({...t.chartData,datasets:s.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const r={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=d.computed(()=>Es(s?.value[0]?.data[t.numerator],{capital:!0})),l=d.computed(()=>Es(s?.value[0]?.data[0]+s?.value[0]?.data[1],{capital:!0})),c=d.computed(()=>`color: ${s?.value[0]?.backgroundColor[t.numerator]}`),u=d.computed(()=>["full","single"].includes(t.metricDisplay)),h=d.computed(()=>t.metricDisplay==="full");return(f,m)=>(d.openBlock(),d.createElementBlock("div",XC,[d.createElementVNode("div",ZC,[u.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(c.value)},d.toDisplayString(a.value),5)):d.createCommentVNode("",!0),h.value?(d.openBlock(),d.createElementBlock("div",QC,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(Sm),{"chart-id":i.value,data:o.value,options:r},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),tO={key:1,class:"single-value-wrapper"},eO={class:"single-value-metric"},nO={class:"name-unit-alignment"},iO={class:"single-value","data-testid":"single-value-chart"},sO={key:0,class:"single-value-unit"},oO={class:"single-value-metric-name"},rO={key:0,class:"single-value-trend"},aO={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},yl="t1",bl="t2",lO=ke(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:bf},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,formatCost:i}=Gn({i18n:t}),s=e,o=d.computed(()=>`align-${s.leftAlign?"left":s.alignX}`),r=d.computed(()=>Ln.buildDeltaMapping(s.data,s.showTrend,{topLevelKey:yl,secondLevelKey:bl})),a=d.computed(()=>r.value?.previous?.[yl]?.[bl]),l=d.computed(()=>r.value?.current?.[yl]?.[bl]),c=d.computed(()=>s.data.data),u=d.computed(()=>s.data.meta?.metric_names?.[0]),h=d.computed(()=>t.te(`chartLabels.${u.value}`)?t.t(`chartLabels.${u.value}`):""),f=d.computed(()=>{const T=u.value?s.data.meta?.metric_units?.[u.value]:void 0;if(T){const k=`chartUnits.${T}`;return t.te(k)?t.t(k,{plural:""}):""}}),m=d.computed(()=>u.value==="request_per_minute"||!!u.value?.includes("_latency_")||u.value==="error_rate"),p=d.computed(()=>s.showTrend&&a.value!==void 0?a.value:null),y=d.computed(()=>{if(s.showTrend)return l.value??null;if(c.value.length<1||!u.value)return null;const T=c.value[0].event[u.value];return typeof T!="number"||isNaN(T)?null:T}),b=d.computed(()=>s.data?.data?.length===void 0||s.data?.data?.length===0||!s.showTrend&&y.value===null||s.showTrend&&p.value===null&&y.value===null),S=d.computed(()=>{const T=y.value;if(T===null)return"-";const k=u.value?s.data.meta?.metric_units?.[u.value]:void 0;if(k==="usd")return i(T);if(k==="bytes")return n(T);if(T>=1e9){const Y=(T/1e9).toFixed(1);return Y.endsWith(".0")?`${Math.floor(T/1e9)}B`:`${Y}B`}if(T>=1e7){const Y=(T/1e6).toFixed(1);return Y.endsWith(".0")?`${Math.floor(T/1e6)}M`:`${Y}M`}const I=s.decimalPoints&&typeof s.decimalPoints=="number"?s.decimalPoints:bf;return T.toLocaleString("en-US",{maximumFractionDigits:I})}),M=d.computed(()=>s.showTrend&&s.data?.data?.length<2),E=d.computed(()=>Ln.calculateChange(y.value??0,p.value??0)||0),D=d.computed(()=>{if(!s.showTrend)return 0;if(s.data?.data?.length<2){if(a.value===void 0)return 0;if(l.value===void 0)return s.increaseIsBad?1:-1}return Ln.changePolarity(E.value,!0,s.increaseIsBad)}),C=d.computed(()=>Ln.defineIcon(D.value,s.increaseIsBad)),A=d.computed(()=>{if(s.showTrend&&s.data?.data?.length<2){if(a.value===void 0)return t.t("singleValue.trend.not_available");if(l.value===void 0)return Ln.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return Ln.metricChange(E.value,s.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),O=Ln.useTrendRange(d.computed(()=>s.showTrend),void 0,d.computed(()=>s.data.meta)),x=T=>T>0?"positive":T<0?"negative":"neutral",_=T=>T>0?n1:T<0?e1:qh;return d.onMounted(()=>{!s.showTrend&&s.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",s.data.data.length):s.showTrend&&s.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",s.data.data.length)}),(T,k)=>{const I=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["chart-parent",o.value]),"data-testid":"single-value-parent"},[b.value?(d.openBlock(),d.createBlock(I,{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",tO,[d.createElementVNode("div",eO,[d.createElementVNode("div",nO,[d.createElementVNode("span",iO,d.toDisplayString(S.value),1),m.value&&f.value?(d.openBlock(),d.createElementBlock("span",sO,"  "+d.toDisplayString(f.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",oO,d.toDisplayString(h.value),1)]),e.showTrend?(d.openBlock(),d.createElementBlock("div",rO,[d.createElementVNode("div",{class:d.normalizeClass(["trend-change",x(D.value)]),"data-testid":"single-value-trend"},[M.value||D.value!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C.value),{key:0,color:_(D.value),size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(Wi.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(qh)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])),d.createElementVNode("div",null,d.toDisplayString(A.value),1)],2),d.unref(O)?(d.openBlock(),d.createElementBlock("div",aO,d.toDisplayString(d.unref(O)),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-0203459f"]]),cO={class:"simple-chart-shell"},uO={key:1,class:"analytics-chart-parent"},dO=ke(d.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator: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(()=>{const c=mt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Mn},d.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&c?.datasets.reverse(),c}),s=d.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),o=d.computed(()=>t.chartOptions.type==="gauge"),r=d.computed(()=>t.chartOptions.type==="single_value"),a=d.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),l=d.computed(()=>{const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(r.value){const u=t.chartData.meta?.metric_names?.[0];return c&&t.chartData.data[0].event[u]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",cO,[l.value?(d.openBlock(),d.createElementBlock("div",uO,[o.value?(d.openBlock(),d.createBlock(JC,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":s.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),r.value?(d.openBlock(),d.createBlock(lO,{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(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),hO={class:"top-n-card-title","data-testid":"top-n-card-title"},fO={class:"top-n-card-description","data-testid":"top-n-card-description"},mO={key:3,class:"top-n-table","data-testid":"top-n-table"},pO={"data-testid":"top-n-table-header"},gO={class:"top-n-table-header-row"},yO={class:"table-header-label"},bO=["data-testid"],_O=["data-testid"],xO=["data-testid"],wO=3,SO=ke(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}=Gn({i18n:n}),s=d.computed(()=>t.data.data),o=d.computed(()=>!!s.value?.length),r=d.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,wO):[]),a=d.computed(()=>r.value[0]||""),l=d.computed(()=>r.value.length>1),c=d.computed(()=>r.value[r.value.length-1]||""),u=d.computed(()=>a.value?t.data.meta.display[a.value]:{}),h=d.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),f=d.computed(()=>h.value[0]),m=d.computed(()=>f.value?U(f.value):""),p=d.computed(()=>{const H=r.value.map($=>({key:$,label:l.value?U($):n.t("topNTable.nameLabel"),type:"dimension"}));return f.value&&H.push({key:"value",label:m.value,type:"metric"}),h.value.forEach(($,R)=>{R!==0&&H.push({key:$,label:U($),type:"metric"})}),H}),y=d.computed(()=>p.value.filter(H=>H.type==="metric")),b=d.computed(()=>p.value.filter(H=>H.type==="dimension").slice(1)),S=H=>H.type==="dimension"&&H.key===c.value,M=H=>l.value&&H.type==="dimension"&&!S(H),E=H=>{const $=H.event;return String($[a.value])},D=(H,$)=>{const R=String(H.event[$]),B=t.data.meta?.display?.[$]?.[R];return{dimension:$,id:R,name:B?.name||"-",deleted:!!B?.deleted}},C=H=>{const $=E(H),R=u.value&&u.value[$];return R?R.name:"-"},A=H=>{const $=E(H),R=u.value&&u.value[$];return R?!!R.deleted:!1},O=(H,$)=>{const R=H.event[$];if(R==null)return"–";const B=typeof R=="number"?R:Number(R);if(Number.isNaN(B))return"–";const z=t.data.meta?.metric_units?.[$]||"count",P=["count","count/minute","token count"].includes(z);return i(B,z,{approximate:P,isBytes1024:!0,translateUnit:N=>j(N,B)})},x=H=>f.value?O(H,f.value):"–",_=d.computed(()=>s.value?.length?s.value.map(H=>{const $=r.value.map(P=>D(H,P)),R=$[0],B=R?.id||E(H),z={id:B,rowKey:$.map(P=>`${P.dimension}:${P.id}`).join("|")||B,name:R?.name||C(H),deleted:A(H),dimensions:$,original:H};return f.value&&(z.value=x(H)),h.value.forEach((P,N)=>{N!==0&&(z[P]=O(H,P))}),z}):[]),T=d.computed(()=>{if(!o.value)return"";if(t.data.meta){if(r.value.some(H=>!Object.keys(t.data.meta.display[H]||{}).length))return n.t("topNTable.errors.display");if(!f.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),k=(H,$)=>{const R=H[$];return typeof R=="string"?R:R==null?"–":String(R)},I=(H,$)=>H.dimensions.find(R=>R.dimension===$)?.name||"–",Y=(H,$)=>{const R=H.dimensions.find(B=>B.dimension===$);return{id:R?.id||"",name:R?.name||"–",deleted:R?.deleted||!1,dimension:$,dimensions:H.dimensions,isEmpty:R?.id==="empty"}},U=H=>n.te(`chartLabels.${H}`)?n.t(`chartLabels.${H}`):H,j=(H,$)=>{if(Cs(H)||H==="count"||H==="requests")return"";const R=$===1?"":"s";return n.te(`chartUnits.${H}`)?n.t(`chartUnits.${H}`,{plural:R}):H};return(H,$)=>{const R=d.resolveComponent("KEmptyState"),B=d.resolveComponent("KSkeleton"),z=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(z,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},d.createSlots({default:d.withCtx(()=>[T.value?(d.openBlock(),d.createBlock(R,{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(T.value),1)]),_:1})):e.isLoading?(d.openBlock(),d.createBlock(B,{key:1,"table-columns":2,type:"table"})):o.value?(d.openBlock(),d.createElementBlock("div",mO,[d.createElementVNode("table",{class:d.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":l.value}])},[d.createElementVNode("thead",pO,[d.createElementVNode("tr",gO,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(p.value,P=>(d.openBlock(),d.createElementBlock("th",{key:P.key,class:d.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":P.type==="metric","top-n-table-header-cell-dimension-compact":M(P)}]),"data-testid":"top-n-table-header-column"},[d.createElementVNode("span",yO,d.toDisplayString(P.label),1)],2))),128))])]),d.createElementVNode("tbody",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(_.value,P=>(d.openBlock(),d.createElementBlock("tr",{key:P.rowKey,class:"top-n-table-row"},[d.createElementVNode("td",{class:d.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":l.value}])},[d.createElementVNode("span",{"data-testid":`row-${P.id}`},[d.renderSlot(H.$slots,"name",{record:{id:P.id,name:P.name,deleted:P.deleted,dimension:a.value,dimensions:P.dimensions,isEmpty:P.id==="empty"}},()=>[d.createTextVNode(d.toDisplayString(P.name),1)],!0)],8,bO)],2),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(b.value,N=>(d.openBlock(),d.createElementBlock("td",{key:N.key,class:d.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!S(N)}])},[d.renderSlot(H.$slots,"name",{record:Y(P,N.key)},()=>[d.createTextVNode(d.toDisplayString(I(P,N.key)),1)],!0)],2))),128)),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(y.value,N=>(d.openBlock(),d.createElementBlock("td",{key:N.key,class:"top-n-table-cell top-n-table-cell-metric"},[N.key==="value"?(d.openBlock(),d.createElementBlock("span",{key:0,"data-testid":`row-${P.id}`},d.toDisplayString(k(P,N.key)),9,_O)):(d.openBlock(),d.createElementBlock("span",{key:1,"data-testid":`row-${P.id}-${N.key}`},d.toDisplayString(k(P,N.key)),9,xO))]))),128))]))),128))])],2)])):(d.openBlock(),d.createBlock(R,{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",hO,d.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",fO,d.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-bd2cedcf"]]);var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zs={exports:{}};zs.exports;var Cm;function TO(){return Cm||(Cm=1,(function(e,t){var n=200,i="Expected a function",s="__lodash_hash_undefined__",o=1,r=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",p="[object GeneratorFunction]",y="[object Map]",b="[object Number]",S="[object Object]",M="[object Promise]",E="[object RegExp]",D="[object Set]",C="[object String]",A="[object Symbol]",O="[object WeakMap]",x="[object ArrayBuffer]",_="[object DataView]",T="[object Float32Array]",k="[object Float64Array]",I="[object Int8Array]",Y="[object Int16Array]",U="[object Int32Array]",j="[object Uint8Array]",H="[object Uint8ClampedArray]",$="[object Uint16Array]",R="[object Uint32Array]",B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,P=/^\./,N=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,Q=/\\(\\)?/g,X=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,G={};G[T]=G[k]=G[I]=G[Y]=G[U]=G[j]=G[H]=G[$]=G[R]=!0,G[l]=G[c]=G[x]=G[u]=G[_]=G[h]=G[f]=G[m]=G[y]=G[b]=G[S]=G[E]=G[D]=G[C]=G[O]=!1;var J=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,nt=typeof self=="object"&&self&&self.Object===Object&&self,tt=J||nt||Function("return this")(),Z=t&&!t.nodeType&&t,pt=Z&&!0&&e&&!e.nodeType&&e,bt=pt&&pt.exports===Z,ot=bt&&J.process,gt=(function(){try{return ot&&ot.binding("util")}catch{}})(),ct=gt&&gt.isTypedArray;function $t(g,v){for(var F=-1,K=g?g.length:0;++F<K;)if(v(g[F],F,g))return!0;return!1}function lt(g){return function(v){return v?.[g]}}function Mt(g,v){for(var F=-1,K=Array(g);++F<g;)K[F]=v(F);return K}function Yt(g){return function(v){return g(v)}}function _e(g,v){return g?.[v]}function Jt(g){var v=!1;if(g!=null&&typeof g.toString!="function")try{v=!!(g+"")}catch{}return v}function Ye(g){var v=-1,F=Array(g.size);return g.forEach(function(K,ht){F[++v]=[ht,K]}),F}function Ct(g,v){return function(F){return g(v(F))}}function te(g){var v=-1,F=Array(g.size);return g.forEach(function(K){F[++v]=K}),F}var Nt=Array.prototype,jt=Function.prototype,ee=Object.prototype,je=tt["__core-js_shared__"],ei=(function(){var g=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""})(),Le=jt.toString,Ft=ee.hasOwnProperty,xe=ee.toString,ni=RegExp("^"+Le.call(Ft).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=tt.Symbol,lr=tt.Uint8Array,Us=ee.propertyIsEnumerable,ii=Nt.splice,Hs=Ct(Object.keys,Object),si=ln(tt,"DataView"),sn=ln(tt,"Map"),on=ln(tt,"Promise"),Vs=ln(tt,"Set"),Ws=ln(tt,"WeakMap"),oi=ln(Object,"create"),xl=un(si),wl=un(sn),cr=un(on),ur=un(Vs),rn=un(Ws),Ii=ar?ar.prototype:void 0,$s=Ii?Ii.valueOf:void 0,dr=Ii?Ii.toString:void 0;function an(g){var v=-1,F=g?g.length:0;for(this.clear();++v<F;){var K=g[v];this.set(K[0],K[1])}}function Sl(){this.__data__=oi?oi(null):{}}function Ne(g){return this.has(g)&&delete this.__data__[g]}function Tl(g){var v=this.__data__;if(oi){var F=v[g];return F===s?void 0:F}return Ft.call(v,g)?v[g]:void 0}function vl(g){var v=this.__data__;return oi?v[g]!==void 0:Ft.call(v,g)}function Ml(g,v){var F=this.__data__;return F[g]=oi&&v===void 0?s:v,this}an.prototype.clear=Sl,an.prototype.delete=Ne,an.prototype.get=Tl,an.prototype.has=vl,an.prototype.set=Ml;function Fe(g){var v=-1,F=g?g.length:0;for(this.clear();++v<F;){var K=g[v];this.set(K[0],K[1])}}function kl(){this.__data__=[]}function En(g){var v=this.__data__,F=Fi(v,g);if(F<0)return!1;var K=v.length-1;return F==K?v.pop():ii.call(v,F,1),!0}function Dl(g){var v=this.__data__,F=Fi(v,g);return F<0?void 0:v[F][1]}function Cl(g){return Fi(this.__data__,g)>-1}function Ol(g,v){var F=this.__data__,K=Fi(F,g);return K<0?F.push([g,v]):F[K][1]=v,this}Fe.prototype.clear=kl,Fe.prototype.delete=En,Fe.prototype.get=Dl,Fe.prototype.has=Cl,Fe.prototype.set=Ol;function Be(g){var v=-1,F=g?g.length:0;for(this.clear();++v<F;){var K=g[v];this.set(K[0],K[1])}}function El(){this.__data__={hash:new an,map:new(sn||Fe),string:new an}}function An(g){return Ui(this,g).delete(g)}function Al(g){return Ui(this,g).get(g)}function Pl(g){return Ui(this,g).has(g)}function Rl(g,v){return Ui(this,g).set(g,v),this}Be.prototype.clear=El,Be.prototype.delete=An,Be.prototype.get=Al,Be.prototype.has=Pl,Be.prototype.set=Rl;function Li(g){var v=-1,F=g?g.length:0;for(this.__data__=new Be;++v<F;)this.add(g[v])}function Il(g){return this.__data__.set(g,s),this}function Ll(g){return this.__data__.has(g)}Li.prototype.add=Li.prototype.push=Il,Li.prototype.has=Ll;function Pe(g){this.__data__=new Fe(g)}function Ni(){this.__data__=new Fe}function Nl(g){return this.__data__.delete(g)}function Ys(g){return this.__data__.get(g)}function Fl(g){return this.__data__.has(g)}function Bl(g,v){var F=this.__data__;if(F instanceof Fe){var K=F.__data__;if(!sn||K.length<n-1)return K.push([g,v]),this;F=this.__data__=new Be(K)}return F.set(g,v),this}Pe.prototype.clear=Ni,Pe.prototype.delete=Nl,Pe.prototype.get=Ys,Pe.prototype.has=Fl,Pe.prototype.set=Bl;function zl(g,v){var F=w(g)||br(g)?Mt(g.length,String):[],K=F.length,ht=!!K;for(var st in g)Ft.call(g,st)&&!(ht&&(st=="length"||qs(st,K)))&&F.push(st);return F}function Fi(g,v){for(var F=g.length;F--;)if(yr(g[F][0],v))return F;return-1}var Ul=Xl();function Hl(g,v){return g&&Ul(g,v,ai)}function Bi(g,v){v=Hi(v,g)?[v]:qe(v);for(var F=0,K=v.length;g!=null&&F<K;)g=g[cn(v[F++])];return F&&F==K?g:void 0}function Vl(g){return xe.call(g)}function Wl(g,v){return g!=null&&v in Object(g)}function js(g,v,F,K,ht){return g===v?!0:g==null||v==null||!qt(g)&&!we(v)?g!==g&&v!==v:$l(g,v,js,F,K,ht)}function $l(g,v,F,K,ht,st){var yt=w(g),Gt=w(v),Bt=c,le=c;yt||(Bt=ae(g),Bt=Bt==l?S:Bt),Gt||(le=ae(v),le=le==l?S:le);var Se=Bt==S&&!Jt(g),Te=le==S&&!Jt(v),he=Bt==le;if(he&&!Se)return st||(st=new Pe),yt||_r(g)?mr(g,v,F,K,ht,st):Zl(g,v,Bt,F,K,ht,st);if(!(ht&r)){var Re=Se&&Ft.call(g,"__wrapped__"),Ie=Te&&Ft.call(v,"__wrapped__");if(Re||Ie){var In=Re?g.value():g,dn=Ie?v.value():v;return st||(st=new Pe),F(In,dn,K,ht,st)}}return he?(st||(st=new Pe),Ql(g,v,F,K,ht,st)):!1}function Yl(g,v,F,K){var ht=F.length,st=ht;if(g==null)return!st;for(g=Object(g);ht--;){var yt=F[ht];if(yt[2]?yt[1]!==g[yt[0]]:!(yt[0]in g))return!1}for(;++ht<st;){yt=F[ht];var Gt=yt[0],Bt=g[Gt],le=yt[1];if(yt[2]){if(Bt===void 0&&!(Gt in g))return!1}else{var Se=new Pe,Te;if(!(Te===void 0?js(le,Bt,K,o|r,Se):Te))return!1}}return!0}function jl(g){if(!qt(g)||pr(g))return!1;var v=it(g)||Jt(g)?ni:X;return v.test(un(g))}function ql(g){return we(g)&&Ht(g.length)&&!!G[xe.call(g)]}function hr(g){return typeof g=="function"?g:g==null?Vi:typeof g=="object"?w(g)?zi(g[0],g[1]):Kl(g):jO(g)}function Gl(g){if(!ec(g))return Hs(g);var v=[];for(var F in Object(g))Ft.call(g,F)&&F!="constructor"&&v.push(F);return v}function Kl(g){var v=Jl(g);return v.length==1&&v[0][2]?Ks(v[0][0],v[0][1]):function(F){return F===g||Yl(F,g,v)}}function zi(g,v){return Hi(g)&&gr(v)?Ks(cn(g),v):function(F){var K=xr(F,g);return K===void 0&&K===v?wr(F,g):js(v,K,void 0,o|r)}}function Pn(g){return function(v){return Bi(v,g)}}function fr(g){if(typeof g=="string")return g;if(Zt(g))return dr?dr.call(g):"";var v=g+"";return v=="0"&&1/g==-1/0?"-0":v}function qe(g){return w(g)?g:nc(g)}function Xl(g){return function(v,F,K){for(var ht=-1,st=Object(v),yt=K(v),Gt=yt.length;Gt--;){var Bt=yt[++ht];if(F(st[Bt],Bt,st)===!1)break}return v}}function mr(g,v,F,K,ht,st){var yt=ht&r,Gt=g.length,Bt=v.length;if(Gt!=Bt&&!(yt&&Bt>Gt))return!1;var le=st.get(g);if(le&&st.get(v))return le==v;var Se=-1,Te=!0,he=ht&o?new Li:void 0;for(st.set(g,v),st.set(v,g);++Se<Gt;){var Re=g[Se],Ie=v[Se];if(K)var In=yt?K(Ie,Re,Se,v,g,st):K(Re,Ie,Se,g,v,st);if(In!==void 0){if(In)continue;Te=!1;break}if(he){if(!$t(v,function(dn,li){if(!he.has(li)&&(Re===dn||F(Re,dn,K,ht,st)))return he.add(li)})){Te=!1;break}}else if(!(Re===Ie||F(Re,Ie,K,ht,st))){Te=!1;break}}return st.delete(g),st.delete(v),Te}function Zl(g,v,F,K,ht,st,yt){switch(F){case _:if(g.byteLength!=v.byteLength||g.byteOffset!=v.byteOffset)return!1;g=g.buffer,v=v.buffer;case x:return!(g.byteLength!=v.byteLength||!K(new lr(g),new lr(v)));case u:case h:case b:return yr(+g,+v);case f:return g.name==v.name&&g.message==v.message;case E:case C:return g==v+"";case y:var Gt=Ye;case D:var Bt=st&r;if(Gt||(Gt=te),g.size!=v.size&&!Bt)return!1;var le=yt.get(g);if(le)return le==v;st|=o,yt.set(g,v);var Se=mr(Gt(g),Gt(v),K,ht,st,yt);return yt.delete(g),Se;case A:if($s)return $s.call(g)==$s.call(v)}return!1}function Ql(g,v,F,K,ht,st){var yt=ht&r,Gt=ai(g),Bt=Gt.length,le=ai(v),Se=le.length;if(Bt!=Se&&!yt)return!1;for(var Te=Bt;Te--;){var he=Gt[Te];if(!(yt?he in v:Ft.call(v,he)))return!1}var Re=st.get(g);if(Re&&st.get(v))return Re==v;var Ie=!0;st.set(g,v),st.set(v,g);for(var In=yt;++Te<Bt;){he=Gt[Te];var dn=g[he],li=v[he];if(K)var Rm=yt?K(li,dn,he,v,g,st):K(dn,li,he,g,v,st);if(!(Rm===void 0?dn===li||F(dn,li,K,ht,st):Rm)){Ie=!1;break}In||(In=he=="constructor")}if(Ie&&!In){var Sr=g.constructor,Tr=v.constructor;Sr!=Tr&&"constructor"in g&&"constructor"in v&&!(typeof Sr=="function"&&Sr instanceof Sr&&typeof Tr=="function"&&Tr instanceof Tr)&&(Ie=!1)}return st.delete(g),st.delete(v),Ie}function Ui(g,v){var F=g.__data__;return Gs(v)?F[typeof v=="string"?"string":"hash"]:F.map}function Jl(g){for(var v=ai(g),F=v.length;F--;){var K=v[F],ht=g[K];v[F]=[K,ht,gr(ht)]}return v}function ln(g,v){var F=_e(g,v);return jl(F)?F:void 0}var ae=Vl;(si&&ae(new si(new ArrayBuffer(1)))!=_||sn&&ae(new sn)!=y||on&&ae(on.resolve())!=M||Vs&&ae(new Vs)!=D||Ws&&ae(new Ws)!=O)&&(ae=function(g){var v=xe.call(g),F=v==S?g.constructor:void 0,K=F?un(F):void 0;if(K)switch(K){case xl:return _;case wl:return y;case cr:return M;case ur:return D;case rn:return O}return v});function tc(g,v,F){v=Hi(v,g)?[v]:qe(v);for(var K,ht=-1,yt=v.length;++ht<yt;){var st=cn(v[ht]);if(!(K=g!=null&&F(g,st)))break;g=g[st]}if(K)return K;var yt=g?g.length:0;return!!yt&&Ht(yt)&&qs(st,yt)&&(w(g)||br(g))}function qs(g,v){return v=v??a,!!v&&(typeof g=="number"||q.test(g))&&g>-1&&g%1==0&&g<v}function Hi(g,v){if(w(g))return!1;var F=typeof g;return F=="number"||F=="symbol"||F=="boolean"||g==null||Zt(g)?!0:z.test(g)||!B.test(g)||v!=null&&g in Object(v)}function Gs(g){var v=typeof g;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?g!=="__proto__":g===null}function pr(g){return!!ei&&ei in g}function ec(g){var v=g&&g.constructor,F=typeof v=="function"&&v.prototype||ee;return g===F}function gr(g){return g===g&&!qt(g)}function Ks(g,v){return function(F){return F==null?!1:F[g]===v&&(v!==void 0||g in Object(F))}}var nc=ri(function(g){g=Rn(g);var v=[];return P.test(g)&&v.push(""),g.replace(N,function(F,K,ht,st){v.push(ht?st.replace(Q,"$1"):K||F)}),v});function cn(g){if(typeof g=="string"||Zt(g))return g;var v=g+"";return v=="0"&&1/g==-1/0?"-0":v}function un(g){if(g!=null){try{return Le.call(g)}catch{}try{return g+""}catch{}}return""}function ri(g,v){if(typeof g!="function"||v&&typeof v!="function")throw new TypeError(i);var F=function(){var K=arguments,ht=v?v.apply(this,K):K[0],st=F.cache;if(st.has(ht))return st.get(ht);var yt=g.apply(this,K);return F.cache=st.set(ht,yt),yt};return F.cache=new(ri.Cache||Be),F}ri.Cache=Be;function yr(g,v){return g===v||g!==g&&v!==v}function br(g){return W(g)&&Ft.call(g,"callee")&&(!Us.call(g,"callee")||xe.call(g)==l)}var w=Array.isArray;function L(g){return g!=null&&Ht(g.length)&&!it(g)}function W(g){return we(g)&&L(g)}function it(g){var v=qt(g)?xe.call(g):"";return v==m||v==p}function Ht(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=a}function qt(g){var v=typeof g;return!!g&&(v=="object"||v=="function")}function we(g){return!!g&&typeof g=="object"}function Zt(g){return typeof g=="symbol"||we(g)&&xe.call(g)==A}var _r=ct?Yt(ct):ql;function Rn(g){return g==null?"":fr(g)}function xr(g,v,F){var K=g==null?void 0:Bi(g,v);return K===void 0?F:K}function wr(g,v){return g!=null&&tc(g,v,Wl)}function ai(g){return L(g)?zl(g):Gl(g)}function Xs(g,v){var F={};return v=hr(v),Hl(g,function(K,ht,st){F[v(K,ht,st)]=K}),F}function Vi(g){return g}function jO(g){return Hi(g)?lt(cn(g)):Pn(g)}e.exports=Xs})(zs,zs.exports)),zs.exports}var vO=TO();const MO=Dm(vO);var _l,Om;function kO(){if(Om)return _l;Om=1;var e=9007199254740991,t="[object Arguments]",n="[object Function]",i="[object GeneratorFunction]",s="[object Symbol]",o=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,r=typeof self=="object"&&self&&self.Object===Object&&self,a=o||r||Function("return this")();function l(R,B,z){switch(z.length){case 0:return R.call(B);case 1:return R.call(B,z[0]);case 2:return R.call(B,z[0],z[1]);case 3:return R.call(B,z[0],z[1],z[2])}return R.apply(B,z)}function c(R,B){for(var z=-1,P=R?R.length:0,N=Array(P);++z<P;)N[z]=B(R[z],z,R);return N}function u(R,B){for(var z=-1,P=B.length,N=R.length;++z<P;)R[N+z]=B[z];return R}var h=Object.prototype,f=h.hasOwnProperty,m=h.toString,p=a.Symbol,y=h.propertyIsEnumerable,b=p?p.isConcatSpreadable:void 0,S=Math.max;function M(R,B,z,P,N){var V=-1,Q=R.length;for(z||(z=A),N||(N=[]);++V<Q;){var X=R[V];z(X)?u(N,X):N[N.length]=X}return N}function E(R,B){return R=Object(R),D(R,B,function(z,P){return P in R})}function D(R,B,z){for(var P=-1,N=B.length,V={};++P<N;){var Q=B[P],X=R[Q];z(X,Q)&&(V[Q]=X)}return V}function C(R,B){return B=S(B===void 0?R.length-1:B,0),function(){for(var z=arguments,P=-1,N=S(z.length-B,0),V=Array(N);++P<N;)V[P]=z[B+P];P=-1;for(var Q=Array(B+1);++P<B;)Q[P]=z[P];return Q[B]=V,l(R,this,Q)}}function A(R){return _(R)||x(R)||!!(b&&R&&R[b])}function O(R){if(typeof R=="string"||H(R))return R;var B=R+"";return B=="0"&&1/R==-1/0?"-0":B}function x(R){return k(R)&&f.call(R,"callee")&&(!y.call(R,"callee")||m.call(R)==t)}var _=Array.isArray;function T(R){return R!=null&&Y(R.length)&&!I(R)}function k(R){return j(R)&&T(R)}function I(R){var B=U(R)?m.call(R):"";return B==n||B==i}function Y(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=e}function U(R){var B=typeof R;return!!R&&(B=="object"||B=="function")}function j(R){return!!R&&typeof R=="object"}function H(R){return typeof R=="symbol"||j(R)&&m.call(R)==s}var $=C(function(R,B){return R==null?{}:E(R,c(M(B),O))});return _l=$,_l}var DO=kO();const CO=Dm(DO);var or={exports:{}},OO=or.exports,Em;function EO(){return Em||(Em=1,(function(e,t){(function(n,i){i()})(OO,function(){function n(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 o(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 r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ae=="object"&&Ae.global===Ae?Ae:void 0,a=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,h){var f=r.URL||r.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?o(m):s(m.href)?i(c,u,h):o(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){o(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(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(){o(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",p=/constructor/i.test(r.HTMLElement)||r.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||m&&p||a)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var E=b.result;E=y?E:E.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=E:location=E,f=null},b.readAsDataURL(c)}else{var S=r.URL||r.webkitURL,M=S.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){S.revokeObjectURL(M)},4e4)}});r.saveAs=l.saveAs=l,e.exports=l})})(or)),or.exports}var AO=EO(),rr={exports:{}};var PO=rr.exports,Am;function RO(){return Am||(Am=1,(function(e,t){((n,i)=>{e.exports=i()})(PO,function n(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,o=!i.document&&!!i.postMessage,r=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(x){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 T=C(_);T.chunkSize=parseInt(T.chunkSize),_.step||_.chunk||(T.chunkSize=null),this._handle=new y(T),(this._handle.streamer=this)._config=T}).call(this,x),this.parseChunk=function(_,T){var k=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<k){let Y=this._config.newline;Y||(I=this._config.quoteChar||'"',Y=this._handle.guessLineEndings(_,I)),_=[..._.split(Y).slice(k)].join(Y)}this.isFirstChunk&&O(this._config.beforeFirstChunk)&&(I=this._config.beforeFirstChunk(_))!==void 0&&(_=I),this.isFirstChunk=!1,this._halted=!1;var k=this._partialLine+_,I=(this._partialLine="",this._handle.parse(k,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(_=I.meta.cursor,k=(this._finished||(this._partialLine=k.substring(_-this._baseIndex),this._baseIndex=_),I&&I.data&&(this._rowCount+=I.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),r)i.postMessage({results:I,workerId:c.WORKER_ID,finished:k});else if(O(this._config.chunk)&&!T){if(this._config.chunk(I,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=I=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(I.data),this._completeResults.errors=this._completeResults.errors.concat(I.errors),this._completeResults.meta=I.meta),this._completed||!k||!O(this._config.complete)||I&&I.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),k||I&&I.meta.paused||this._nextChunk(),I}this._halted=!0},this._sendError=function(_){O(this._config.error)?this._config.error(_):r&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:_,finished:!1})}}function h(x){var _;(x=x||{}).chunkSize||(x.chunkSize=c.RemoteChunkSize),u.call(this,x),this._nextChunk=o?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(T){this._input=T,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),o||(_.onload=A(this._chunkLoaded,this),_.onerror=A(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!o),this._config.downloadRequestHeaders){var T,k=this._config.downloadRequestHeaders;for(T in k)_.setRequestHeader(T,k[T])}var I;this._config.chunkSize&&(I=this._start+this._config.chunkSize-1,_.setRequestHeader("Range","bytes="+this._start+"-"+I));try{_.send(this._config.downloadRequestBody)}catch(Y){this._chunkError(Y.message)}o&&_.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>=(T=>(T=T.getResponseHeader("Content-Range"))!==null?parseInt(T.substring(T.lastIndexOf("/")+1)):-1)(_),this.parseChunk(_.responseText)))},this._chunkError=function(T){T=_.statusText||T,this._sendError(new Error(T))}}function f(x){(x=x||{}).chunkSize||(x.chunkSize=c.LocalChunkSize),u.call(this,x);var _,T,k=typeof FileReader<"u";this.stream=function(I){this._input=I,T=I.slice||I.webkitSlice||I.mozSlice,k?((_=new FileReader).onload=A(this._chunkLoaded,this),_.onerror=A(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 I=this._input,Y=(this._config.chunkSize&&(Y=Math.min(this._start+this._config.chunkSize,this._input.size),I=T.call(I,this._start,Y)),_.readAsText(I,this._config.encoding));k||this._chunkLoaded({target:{result:Y}})},this._chunkLoaded=function(I){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(I.target.result)},this._chunkError=function(){this._sendError(_.error)}}function m(x){var _;u.call(this,x=x||{}),this.stream=function(T){return _=T,this._nextChunk()},this._nextChunk=function(){var T,k;if(!this._finished)return T=this._config.chunkSize,_=T?(k=_.substring(0,T),_.substring(T)):(k=_,""),this._finished=!_,this.parseChunk(k)}}function p(x){u.call(this,x=x||{});var _=[],T=!0,k=!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(I){this._input=I,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){k&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):T=!0},this._streamData=A(function(I){try{_.push(typeof I=="string"?I:I.toString(this._config.encoding)),T&&(T=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(Y){this._streamError(Y)}},this),this._streamError=A(function(I){this._streamCleanUp(),this._sendError(I)},this),this._streamEnd=A(function(){this._streamCleanUp(),k=!0,this._streamData("")},this),this._streamCleanUp=A(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(x){var _,T,k,I,Y=Math.pow(2,53),U=-Y,j=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,H=/^((\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,R=0,B=0,z=!1,P=!1,N=[],V={data:[],errors:[],meta:{}};function Q(J){return x.skipEmptyLines==="greedy"?J.join("").trim()==="":J.length===1&&J[0].length===0}function X(){if(V&&k&&(G("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),k=!1),x.skipEmptyLines&&(V.data=V.data.filter(function(Z){return!Q(Z)})),q()){let Z=function(pt,bt){O(x.transformHeader)&&(pt=x.transformHeader(pt,bt)),N.push(pt)};if(V)if(Array.isArray(V.data[0])){for(var J=0;q()&&J<V.data.length;J++)V.data[J].forEach(Z);V.data.splice(0,1)}else V.data.forEach(Z)}function nt(Z,pt){for(var bt=x.header?{}:[],ot=0;ot<Z.length;ot++){var gt=ot,ct=Z[ot],ct=(($t,lt)=>(Mt=>(x.dynamicTypingFunction&&x.dynamicTyping[Mt]===void 0&&(x.dynamicTyping[Mt]=x.dynamicTypingFunction(Mt)),(x.dynamicTyping[Mt]||x.dynamicTyping)===!0))($t)?lt==="true"||lt==="TRUE"||lt!=="false"&&lt!=="FALSE"&&((Mt=>{if(j.test(Mt)&&(Mt=parseFloat(Mt),U<Mt&&Mt<Y))return 1})(lt)?parseFloat(lt):H.test(lt)?new Date(lt):lt===""?null:lt):lt)(gt=x.header?ot>=N.length?"__parsed_extra":N[ot]:gt,ct=x.transform?x.transform(ct,gt):ct);gt==="__parsed_extra"?(bt[gt]=bt[gt]||[],bt[gt].push(ct)):bt[gt]=ct}return x.header&&(ot>N.length?G("FieldMismatch","TooManyFields","Too many fields: expected "+N.length+" fields but parsed "+ot,B+pt):ot<N.length&&G("FieldMismatch","TooFewFields","Too few fields: expected "+N.length+" fields but parsed "+ot,B+pt)),bt}var tt;V&&(x.header||x.dynamicTyping||x.transform)&&(tt=1,!V.data.length||Array.isArray(V.data[0])?(V.data=V.data.map(nt),tt=V.data.length):V.data=nt(V.data,0),x.header&&V.meta&&(V.meta.fields=N),B+=tt)}function q(){return x.header&&N.length===0}function G(J,nt,tt,Z){J={type:J,code:nt,message:tt},Z!==void 0&&(J.row=Z),V.errors.push(J)}O(x.step)&&(I=x.step,x.step=function(J){V=J,q()?X():(X(),V.data.length!==0&&(R+=J.data.length,x.preview&&R>x.preview?T.abort():(V.data=V.data[0],I(V,$))))}),this.parse=function(J,nt,tt){var Z=x.quoteChar||'"',Z=(x.newline||(x.newline=this.guessLineEndings(J,Z)),k=!1,x.delimiter?O(x.delimiter)&&(x.delimiter=x.delimiter(J),V.meta.delimiter=x.delimiter):((Z=((pt,bt,ot,gt,ct)=>{var $t,lt,Mt,Yt;ct=ct||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var _e=0;_e<ct.length;_e++){for(var Jt,Ye=ct[_e],Ct=0,te=0,Nt=0,jt=(Mt=void 0,new S({comments:gt,delimiter:Ye,newline:bt,preview:10}).parse(pt)),ee=0;ee<jt.data.length;ee++)ot&&Q(jt.data[ee])?Nt++:(Jt=jt.data[ee].length,te+=Jt,Mt===void 0?Mt=Jt:0<Jt&&(Ct+=Math.abs(Jt-Mt),Mt=Jt));0<jt.data.length&&(te/=jt.data.length-Nt),(lt===void 0||Ct<=lt)&&(Yt===void 0||Yt<te)&&1.99<te&&(lt=Ct,$t=Ye,Yt=te)}return{successful:!!(x.delimiter=$t),bestDelimiter:$t}})(J,x.newline,x.skipEmptyLines,x.comments,x.delimitersToGuess)).successful?x.delimiter=Z.bestDelimiter:(k=!0,x.delimiter=c.DefaultDelimiter),V.meta.delimiter=x.delimiter),C(x));return x.preview&&x.header&&Z.preview++,_=J,T=new S(Z),V=T.parse(_,nt,tt),X(),z?{meta:{paused:!0}}:V||{meta:{paused:!1}}},this.paused=function(){return z},this.pause=function(){z=!0,T.abort(),_=O(x.chunk)?"":_.substring(T.getCharIndex())},this.resume=function(){$.streamer._halted?(z=!1,$.streamer.parseChunk(_,!0)):setTimeout($.resume,3)},this.aborted=function(){return P},this.abort=function(){P=!0,T.abort(),V.meta.aborted=!0,O(x.complete)&&x.complete(V),_=""},this.guessLineEndings=function(pt,Z){pt=pt.substring(0,1048576);var Z=new RegExp(b(Z)+"([^]*?)"+b(Z),"gm"),tt=(pt=pt.replace(Z,"")).split("\r"),Z=pt.split(`
7
+ `)}}function ZM(e,t,n={}){const{window:i=qo,...s}=n;let o;const r=wf(()=>i&&"ResizeObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},l=d.watch(d.computed(()=>{const u=d.toValue(e);return Array.isArray(u)?u.map(h=>Ci(h)):[Ci(u)]}),u=>{if(a(),r.value&&i){o=new ResizeObserver(t);for(const h of u)h&&o.observe(h,s)}},{immediate:!0,flush:"post"}),c=()=>{a(),l()};return _f(c),{isSupported:r,stop:c}}function QM(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:s=!0,immediate:o=!0,updateTiming:r="sync"}=t,a=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),p=d.shallowRef(0);function y(){const S=Ci(e);if(!S){n&&(a.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,p.value=0);return}const M=S.getBoundingClientRect();a.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,h.value=M.top,f.value=M.width,m.value=M.x,p.value=M.y}function b(){r==="sync"?y():r==="next-frame"&&requestAnimationFrame(()=>y())}return ZM(e,b),d.watch(()=>Ci(e),S=>!S&&b()),GM(e,b,{attributeFilter:["style","class"]}),s&&As("scroll",b,{capture:!0,passive:!0}),i&&As("resize",b,{passive:!0}),YM(()=>{o&&b()}),{height:a,bottom:l,left:c,right:u,top:h,width:f,x:m,y:p,update:b}}function JM(e,t){const{top:n,left:i}=QM(e),s=d.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),o=d.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:o}}const tk=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=n).sort((l,c)=>l-c),o=[];if(n-t<e-2)return[];const r=(n-t)/e;let a=0;for(let l=0;l<e;l++){const c=t+l*r,u=t+(l+1)*r;let h=0;for(;a<s.length&&s[a]>=c&&s[a]<=u;)h++,a++;o.push([Math.ceil(c),h])}return o},Sf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Ps=d.ref({}),ek=e=>(Ps.value[e]||(Ps.value[e]=Sf()),Ps.value[e]),nk=(e,t)=>{const n=Ps.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 Ps.value[t])};function ik({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:s=void 0,minCount:o=void 0,maxCount:r=void 0,renderPoints:a=void 0,type:l}){const u=n!==void 0&&e!==void 0?ek(n):Sf(),h=e!==void 0?e:"static-chart-key",f=d.computed(()=>t.reduce((T,{timestamps:k})=>[...T,...k],[])),m=d.computed(()=>i||f.value.reduce((T,k)=>T===0?k:Math.min(T,k),0)),p=d.computed(()=>s||f.value.reduce((T,k)=>Math.max(T,k),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=p.value,a!==void 0&&(u.renderPoints[h]=a)});const y=d.computed(()=>Object.values(u.minStamps).reduce((T,k)=>T===0?k:Math.min(T,k),0)),b=d.computed(()=>Object.values(u.maxStamps).reduce((T,k)=>Math.max(T,k),0)),S=d.computed(()=>{const T=Object.values(u.renderPoints);return T.length===0?24:T.reduce((k,I)=>Math.max(k,I),2)}),M=d.computed(()=>{const T=b.value-y.value;return Math.ceil(T/S.value)}),E=d.computed(()=>t.length>1),D=d.computed(()=>t.map(({timestamps:T,color:k,label:I})=>({data:tk({bucketCount:S.value,minStamp:y.value,maxStamp:b.value,timestamps:T}).map(([j,H])=>({x:j,y:H})),label:I,...(l==="sparkline_bar"||E.value)&&k&&{backgroundColor:k},...l!=="sparkline_bar"&&k&&{borderColor:k},...E.value&&l!=="sparkline_bar"&&{fill:!0}}))),C=d.computed(()=>{const T=D.value[0]?.data?.length??0,k=[];for(let I=0;I<T;I++){let Y=0;for(let U=0;U<D.value.length;U++)Y+=D.value[U].data[I].y;k.push(Y)}return k}),A=d.computed(()=>{const T=C.value.reduce((k,I)=>Math.max(k,I),0);return Math.max(T,r??0)}),O=d.computed(()=>{const T=D.value.reduce((Y,{data:U})=>[...Y,...U.map(({y:j})=>j)],[]),k=T.length?T[0]:0,I=T.reduce((Y,U)=>Math.min(Y,U),k);return o===void 0?I:Math.min(I,o)});d.watchEffect(()=>{u.maxCounts[h]=A.value,u.minCounts[h]=O.value});const x=d.computed(()=>{const T=Object.values(u.minCounts),k=T.length?T[0]:0;return T.reduce((I,Y)=>Math.min(I,Y),k)}),_=d.computed(()=>Object.values(u.maxCounts).reduce((T,k)=>Math.max(T,k),0));return d.onUnmounted(()=>{e!==void 0&&n!==void 0&&nk(e,n)}),{syncedMinStamp:y,syncedMaxStamp:b,syncedRenderPoints:S,syncedChartDatasets:D,syncedGroupSizeMs:M,syncedMinCount:x,syncedMaxCount:_}}const mt={useBarChartOptions:SM,useChartJSCommon:vM,useChartLegendValues:kM,useChartSelectedRange:DM,useExploreResultToDatasets:AM,useExploreResultToTimeDataset:LM,useDonutChartOptions:CM,useLineChartOptions:OM,useI18n:Lm,useReportChartDataForSynthetics:NM,useTranslatedUnits:FM,useEvaluateFeatureFlag:zM,useTooltipAbsolutePosition:JM,useSparklineSync:ik};var be=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(be||{});const Tf={modes:{point(e,t){return Ko(e,t,{intersect:!0})},nearest(e,t,n){return rk(e,t,n)},x(e,t,n){return Ko(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return Ko(e,t,{intersect:n.intersect,axis:"y"})}}};function Qa(e,t,n){return(Tf.modes[n.mode]||Tf.modes.nearest)(e,t,n)}function sk(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 ok(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function Ko(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):sk(i,t,n.axis))}function rk(e,t,n){let i=Number.POSITIVE_INFINITY;return Ko(e,t,n).reduce((s,o)=>{const r=o.getCenterPoint(),a=ok(t,r,n.axis),l=di(t,a);return l<i?(s=[o],i=l):l===i&&s.push(o),s},[]).sort((s,o)=>s._index-o._index).slice(0,1)}function Zn(e,t,n){const i=Math.cos(n),s=Math.sin(n),o=t.x,r=t.y;return{x:o+i*(e.x-o)-s*(e.y-r),y:r+s*(e.x-o)+i*(e.y-r)}}const ak=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,Qn=.001,Xo=(e,t,n)=>Math.min(n,Math.max(t,e)),vf=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function lk(e,t,n){for(const i of Object.keys(e))e[i]=Xo(e[i],t,n);return e}function ck(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 Mf(e,{x:t,y:n,x2:i,y2:s},o,{borderWidth:r,hitTolerance:a}){const l=(r+a)/2,c=e.x>=t-l-Qn&&e.x<=i+l+Qn,u=e.y>=n-l-Qn&&e.y<=s+l+Qn;return o==="x"?c:(o==="y"||c)&&u}function kf(e,{rect:t,center:n},i,{rotation:s,borderWidth:o,hitTolerance:r}){const a=Zn(e,n,Vt(-s));return Mf(a,t,i,{borderWidth:o,hitTolerance:r})}function Jn(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function uk(e,t,n,i=!0){const s=n.split(".");let o=0;for(const r of t.split(".")){const a=s[o++];if(parseInt(r,10)<parseInt(a,10))break;if(ak(a,r)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const Df=e=>typeof e=="string"&&e.endsWith("%"),Cf=e=>parseFloat(e)/100,Of=e=>Xo(Cf(e),0,1),Rs=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),dk={box:e=>Rs(e.centerX,e.centerY),doughnutLabel:e=>Rs(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>Rs(e.centerX,e.centerY),line:e=>Rs(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>Rs(e.centerX,e.centerY)};function Ja(e,t){return t==="start"?0:t==="end"?e:Df(t)?Of(t)*e:e/2}function Dn(e,t,n=!0){return typeof t=="number"?t:Df(t)?(n?Of(t):Cf(t))*e:e}function hk(e,t){const{x:n,width:i}=e,s=t.textAlign;return s==="center"?n+i/2:s==="end"||s==="right"?n+i:n}function Ef(e,t,{borderWidth:n,position:i,xAdjust:s,yAdjust:o},r){const a=ft(r),l=t.width+(a?r.width:0)+n,c=t.height+(a?r.height:0)+n,u=tl(i),h=If(e.x,l,s,u.x),f=If(e.y,c,o,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 tl(e,t="center"){return ft(e)?{x:at(e.x,t),y:at(e.y,t)}:(e=at(e,t),{x:e,y:e})}const Af=(e,t)=>e&&e.autoFit&&t<1;function Pf(e,t){const n=e.font,i=xt(n)?n:[n];return Af(e,t)?i.map(function(s){const o=Pt(s);return o.size=Math.floor(s.size*t),o.lineHeight=s.lineHeight,Pt(o)}):i.map(s=>Pt(s))}function Rf(e){return e&&(fe(e.xValue)||fe(e.yValue))}function If(e,t,n=0,i){return e-Ja(t,i)+n}function Oi(e,t,n){const i=n.init;if(i){if(i===!0)return Nf(t,n)}else return;return fk(e,t,n)}function Lf(e,t,n){let i=!1;return t.forEach(s=>{me(e[s])?(i=!0,n[s]=e[s]):fe(n[s])&&delete n[s]}),i}function Nf(e,t){const n=t.type||"line";return dk[n](e)}function fk(e,t,n){const i=wt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return Nf(t,n);if(ft(i))return i}const el=new Map,mk=e=>isNaN(e)||e<=0,pk=e=>e.reduce(function(t,n){return t+=n.string,t},"");function Zo(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Qo(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(Vt(i)),e.translate(-t,-n))}function nn(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 Ei(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function Jo(e,t){const n=t.content;if(Zo(n))return{width:Dn(n.width,t.width),height:Dn(n.height,t.height)};const i=Pf(t),s=t.textStrokeWidth,o=xt(n)?n:[n],r=o.join()+pk(i)+s+(e._measureText?"-spriting":"");return el.has(r)||el.set(r,_k(e,o,i,s)),el.get(r)}function Ff(e,t,n){const{x:i,y:s,width:o,height:r}=t;e.save(),Ei(e,n);const a=nn(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),hi(e,{x:i,y:s,w:o,h:r,radius:lk(yn(n.borderRadius),0,Math.min(o,r)/2)}),e.closePath(),e.fill(),a&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function Bf(e,t,n,i){const s=n.content;if(Zo(s)){e.save(),e.globalAlpha=Sk(n.opacity,s.style.opacity),e.drawImage(s,t.x,t.y,t.width,t.height),e.restore();return}const o=xt(s)?s:[s],r=Pf(n,i),a=n.color,l=xt(a)?a:[a],c=hk(t,n),u=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,gk(e,n)&&xk(e,{x:c,y:u},o,r),wk(e,{x:c,y:u},o,{fonts:r,colors:l}),e.restore()}function gk(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function yk(e,t,n,i){const{radius:s,options:o}=t,r=o.pointStyle,a=o.rotation;let l=(a||0)*Er;if(Zo(r)){e.save(),e.translate(n,i),e.rotate(l),e.drawImage(r,-r.width/2,-r.height/2,r.width,r.height),e.restore();return}mk(s)||bk(e,{x:n,y:i,radius:s,rotation:a,style:r,rad:l})}function bk(e,{x:t,y:n,radius:i,rotation:s,style:o,rad:r}){let a,l,c,u;switch(e.beginPath(),o){default:e.arc(t,n,i,0,Dt),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(r)*i,n-Math.cos(r)*i),r+=io,e.lineTo(t+Math.sin(r)*i,n-Math.cos(r)*i),r+=io,e.lineTo(t+Math.sin(r)*i,n-Math.cos(r)*i),e.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(r+Ce)*c,l=Math.sin(r+Ce)*c,e.arc(t-a,n-l,u,r-dt,r-Ot),e.arc(t+l,n-a,u,r-Ot,r),e.arc(t+a,n+l,u,r,r+Ot),e.arc(t-l,n+a,u,r+Ot,r+dt),e.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,e.rect(t-c,n-c,2*c,2*c);break}r+=Ce;case"rectRot":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+l,n-a),e.lineTo(t+a,n+l),e.lineTo(t-l,n+a),e.closePath();break;case"crossRot":r+=Ce;case"cross":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a);break;case"star":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a),r+=Ce,a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a);break;case"line":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(r)*i,n+Math.sin(r)*i);break}e.fill()}function _k(e,t,n,i){e.save();const s=t.length;let o=0,r=i;for(let a=0;a<s;a++){const l=n[Math.min(a,n.length-1)];e.font=l.string;const c=t[a];o=Math.max(o,e.measureText(c).width+i),r+=l.lineHeight}return e.restore(),{width:o,height:r}}function xk(e,{x:t,y:n},i,s){e.beginPath();let o=0;i.forEach(function(r,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(r,t,n+c/2+o),o+=c}),e.stroke()}function wk(e,{x:t,y:n},i,{fonts:s,colors:o}){let r=0;i.forEach(function(a,l){const c=o[Math.min(l,o.length-1)],u=s[Math.min(l,s.length-1)],h=u.lineHeight;e.beginPath(),e.font=u.string,e.fillStyle=c,e.fillText(a,t,n+h/2+r),r+=h,e.fill()})}function Sk(e,t){const n=gn(e)?e:t;return gn(n)?Xo(n,0,1):1}const zf=["left","bottom","top","right"];function Tk(e,t){const{pointX:n,pointY:i,options:s}=t,o=s.callout,r=o&&o.display&&Ck(t,o);if(!r||Ek(t,o,r))return;if(e.save(),e.beginPath(),!nn(e,o))return e.restore();const{separatorStart:l,separatorEnd:c}=vk(t,r),{sideStart:u,sideEnd:h}=kk(t,r,l);(o.margin>0||s.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(u.x,u.y),e.lineTo(h.x,h.y);const f=Zn({x:n,y:i},t.getCenterPoint(),Vt(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function vk(e,t){const{x:n,y:i,x2:s,y2:o}=e,r=Mk(e,t);let a,l;return t==="left"||t==="right"?(a={x:n+r,y:i},l={x:a.x,y:o}):(a={x:n,y:i+r},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function Mk(e,t){const{width:n,height:i,options:s}=e,o=s.callout.margin+s.borderWidth/2;return t==="right"?n+o:t==="bottom"?i+o:-o}function kk(e,t,n){const{y:i,width:s,height:o,options:r}=e,a=r.callout.start,l=Dk(t,r.callout);let c,u;return t==="left"||t==="right"?(c={x:n.x,y:i+Dn(o,a)},u={x:c.x+l,y:c.y}):(c={x:n.x+Dn(s,a),y:n.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function Dk(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function Ck(e,t){const n=t.position;return zf.includes(n)?n:Ok(e,t)}function Ok(e,t){const{x:n,y:i,x2:s,y2:o,width:r,height:a,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=e,m={x:u,y:h},p=t.start,y=Dn(r,p),b=Dn(a,p),S=[n,n+y,n+y,s],M=[i+b,o,i,o],E=[];for(let D=0;D<4;D++){const C=Zn({x:S[D],y:M[D]},m,Vt(f));E.push({position:zf[D],distance:di(C,{x:l,y:c})})}return E.sort((D,C)=>D.distance-C.distance)[0].position}function Ek(e,t,n){const{pointX:i,pointY:s}=e,o=t.margin;let r=i,a=s;return n==="left"?r+=o:n==="right"?r-=o:n==="top"?a+=o:n==="bottom"&&(a-=o),e.inRange(r,a)}const Uf={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 Ai(e,t,n){return t=typeof t=="number"?t:e.parse(t),At(t)?e.getPixelForValue(t):n}function ti(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const s=n.charAt(0),o=Object.values(e).filter(r=>r.axis&&r.axis===s);return o.length?o[0].id:s}function Hf(e,t){if(e){const n=e.options.reverse,i=Ai(e,t.min,n?t.end:t.start),s=Ai(e,t.max,n?t.start:t.end);return{start:i,end:s}}}function Vf(e,t){const{chartArea:n,scales:i}=e,s=i[ti(i,t,"xScaleID")],o=i[ti(i,t,"yScaleID")];let r=n.width/2,a=n.height/2;return s&&(r=Ai(s,t.xValue,s.left+s.width/2)),o&&(a=Ai(o,t.yValue,o.top+o.height/2)),{x:r,y:a}}function nl(e,t){const n=e.scales,i=n[ti(n,t,"xScaleID")],s=n[ti(n,t,"yScaleID")];if(!i&&!s)return{};let{left:o,right:r}=i||e.chartArea,{top:a,bottom:l}=s||e.chartArea;const c=Yf(i,{min:t.xMin,max:t.xMax,start:o,end:r});o=c.start,r=c.end;const u=Yf(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:o,y:a,x2:r,y2:l,width:r-o,height:l-a,centerX:o+(r-o)/2,centerY:a+(l-a)/2}}function Wf(e,t){if(!Rf(t)){const n=nl(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const s=i*2,o=n.centerX+t.xAdjust,r=n.centerY+t.yAdjust;return{x:o-i,y:r-i,x2:o+i,y2:r+i,centerX:o,centerY:r,width:s,height:s,radius:i}}return Pk(e,t)}function Ak(e,t){const{scales:n,chartArea:i}=e,s=n[t.scaleID],o={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?Rk(s,o,t):Ik(n,o,t),o}function $f(e,t){const n=nl(e,t);return n.initProperties=Oi(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:Fk(e,n,t),initProperties:n.initProperties}],n}function Pk(e,t){const n=Vf(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 Yf(e,t){const n=Hf(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function Rk(e,t,n){const i=Ai(e,n.value,NaN),s=Ai(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function Ik(e,t,n){for(const i of Object.keys(Uf)){const s=e[ti(e,n,i)];if(s){const{min:o,max:r,start:a,end:l,startProp:c,endProp:u}=Uf[i],h=Hf(s,{min:n[o],max:n[r],start:s[a],end:s[l]});t[c]=h.start,t[u]=h.end}}}function Lk({properties:e,options:t},n,i,s){const{x:o,x2:r,width:a}=e;return jf({start:o,end:r,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:n.width})}function Nk({properties:e,options:t},n,i,s){const{y:o,y2:r,height:a}=e;return jf({start:o,end:r,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:n.height})}function jf(e,t){const{start:n,end:i,borderWidth:s}=e,{position:o,padding:{start:r,end:a},adjust:l}=t,c=i-s-n-r-a-t.size;return n+s/2+l+Ja(c,o)}function Fk(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const s=tl(i.position),o=Wt(i.padding),r=Jo(e.ctx,i),a=Lk({properties:t,options:n},r,s,o),l=Nk({properties:t,options:n},r,s,o),c=r.width+o.width,u=r.height+o.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const il=["enter","leave"],sl=il.concat("click");function Bk(e,t,n){t.listened=Lf(n,sl,t.listeners),t.moveListened=!1,il.forEach(i=>{me(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&me(i.click)&&(t.listened=!0),t.moveListened||il.forEach(s=>{me(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function zk(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return Uk(e,t,n);case"click":return Hk(e,t,n)}}function Uk(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=Qa(e.visibleElements,t,n.interaction):i=[];const s=e.hovered;e.hovered=i;const o={state:e,event:t};let r=qf(o,"leave",s,i);return qf(o,"enter",i,s)||r}function qf({state:e,event:t},n,i,s){let o;for(const r of i)s.indexOf(r)<0&&(o=Gf(r.options[n]||e.listeners[n],r,t)||o);return o}function Hk(e,t,n){const i=e.listeners,s=Qa(e.visibleElements,t,n.interaction);let o;for(const r of s)o=Gf(r.options.click||i.click,r,t)||o;return o}function Gf(e,t,n){return wt(e,[t.$context,n])===!0}const tr=["afterDraw","beforeDraw"];function Vk(e,t,n){const i=t.visibleElements;t.hooked=Lf(n,tr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||tr.forEach(o=>{me(s.options[o])&&(t.hooked=!0)})})}function Kf(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return wt(i,[t.$context])}}function Wk(e,t,n){const i=Gk(e.scales,t,n);let s=Xf(t,i,"min","suggestedMin");s=Xf(t,i,"max","suggestedMax")||s,s&&me(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function $k(e,t){for(const n of e)jk(n,t)}function Xf(e,t,n,i){if(At(t[n])&&!Yk(e.options,n,i)){const s=e[n]!==t[n];return e[n]=t[n],s}}function Yk(e,t,n){return fe(e[t])||fe(e[n])}function jk(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=ti(t,e,n);i&&!t[i]&&qk(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function qk(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(fe(e[n+i]))return!0;return!1}function Gk(e,t,n){const i=t.axis,s=t.id,o=i+"ScaleID",r={min:at(t.min,Number.NEGATIVE_INFINITY),max:at(t.max,Number.POSITIVE_INFINITY)};for(const a of n)a.scaleID===s?Zf(a,t,["value","endValue"],r):ti(e,a,o)===s&&Zf(a,t,[i+"Min",i+"Max",i+"Value"],r);return r}function Zf(e,t,n,i){for(const s of n){const o=e[s];if(fe(o)){const r=t.parse(o);i.min=Math.min(i.min,r),i.max=Math.max(i.max,r)}}}class Pi extends oe{inRange(t,n,i,s){const{x:o,y:r}=Zn({x:t,y:n},this.getCenterPoint(s),Vt(-this.options.rotation));return Mf({x:o,y:r},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return Jn(this,t)}draw(t){t.save(),Qo(t,this.getCenterPoint(),this.options.rotation),Ff(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return $f(t,n)}}Pi.id="boxAnnotation",Pi.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},Pi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Pi.descriptors={label:{_fallback:!0}};class er extends oe{inRange(t,n,i,s){return kf({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Jn(this,t)}draw(t){const n=this.options;!n.display||!n.content||(tD(t,this),t.save(),Qo(t,this.getCenterPoint(),this.rotation),Bf(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=Kk(t,n);if(!i)return{};const{controllerMeta:s,point:o,radius:r}=Zk(t,n,i);let a=Jo(t.ctx,n);const l=Qk(a,r);Af(n,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:h}=n,f=Ef(o,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Oi(t,f,n),...f,...s,rotation:n.rotation,_fitRatio:l}}}er.id="doughnutLabelAnnotation",er.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},er.defaultRoutes={};function Kk(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const s=i.controller;return s instanceof ss&&Xk(e,t,i.data)&&(!n||s.innerRadius<n.controller.innerRadius)&&s.options.circumference>=90?i:n},void 0)}function Xk(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 Zk({chartArea:e},t,n){const{left:i,top:s,right:o,bottom:r}=e,{innerRadius:a,offsetX:l,offsetY:c}=n.controller,u=(i+o)/2+l,h=(s+r)/2+c,f={left:Math.max(u-a,i),right:Math.min(u+a,o),top:Math.max(h-a,s),bottom:Math.min(h+a,r)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,y=a-p,b=m.y>h,S=b?s+p:r-p,M=Jk(S,u,h,y);return{controllerMeta:{_centerX:u,_centerY:h,_radius:y,_counterclockwise:b,...M},point:m,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function Qk({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function Jk(e,t,n,i){const s=Math.pow(n-e,2),o=Math.pow(i,2),r=t*-2,a=Math.pow(t,2)+s-o,l=Math.pow(r,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Dt};const c=(-r-Math.sqrt(l))/2,u=(-r+Math.sqrt(l))/2;return{_startAngle:oo({x:t,y:n},{x:c,y:e}).angle,_endAngle:oo({x:t,y:n},{x:u,y:e}).angle}}function tD(e,t){const{_centerX:n,_centerY:i,_radius:s,_startAngle:o,_endAngle:r,_counterclockwise:a,options:l}=t;e.save();const c=nn(e,l);e.fillStyle=l.backgroundColor,e.beginPath(),e.arc(n,i,s,o,r,a),e.closePath(),e.fill(),c&&e.stroke(),e.restore()}class Is extends oe{inRange(t,n,i,s){return kf({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Jn(this,t)}draw(t){const n=this.options,i=!fe(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),Qo(t,this.getCenterPoint(),this.rotation),Tk(t,this),Ff(t,this,n),Bf(t,eD(this),n),t.restore())}resolveElementProperties(t,n){let i;if(Rf(n))i=Vf(t,n);else{const{centerX:a,centerY:l}=nl(t,n);i={x:a,y:l}}const s=Wt(n.padding),o=Jo(t.ctx,n),r=Ef(i,o,n,s);return{initProperties:Oi(t,r,n),pointX:i.x,pointY:i.y,...r,rotation:n.rotation}}}Is.id="labelAnnotation",Is.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Is.defaultRoutes={borderColor:"color"};function eD({x:e,y:t,width:n,height:i,options:s}){const o=s.borderWidth/2,r=Wt(s.padding);return{x:e+r.left+o,y:t+r.top+o,width:n-r.left-r.right-s.borderWidth,height:i-r.top-r.bottom-s.borderWidth}}const ol=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),rl=(e,t,n)=>ol(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Qf=(e,t,n)=>ol(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,Ls=e=>e*e,nD=(e,t,{x:n,y:i,x2:s,y2:o},r)=>r==="y"?{start:Math.min(i,o),end:Math.max(i,o),value:t}:{start:Math.min(n,s),end:Math.max(n,s),value:e},Jf=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,al=(e,t,n,i)=>({x:Jf(e.x,t.x,n.x,i),y:Jf(e.y,t.y,n.y,i)}),tm=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),em=(e,t,n,i)=>-Math.atan2(tm(e.x,t.x,n.x,i),tm(e.y,t.y,n.y,i))+.5*dt;class Ns extends oe{inRange(t,n,i,s){const o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const r={mouseX:t,mouseY:n},{path:a,ctx:l}=this;if(a){nn(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=n*u.currentDevicePixelRatio,m=l.isPointInStroke(a,h,f)||ll(this,r,s);return l.restore(),m}const c=Ls(o);return rD(this,r,c,s)||ll(this,r,s)}return iD(this,{mouseX:t,mouseY:n},i,{hitSize:o,useFinalPosition:s})}getCenterPoint(t){return Jn(this,t)}draw(t){const{x:n,y:i,x2:s,y2:o,cp:r,options:a}=this;if(t.save(),!nn(t,a))return t.restore();Ei(t,a);const l=Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2));if(a.curve&&r)return mD(t,this,r,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=rm(this),m=Math.atan2(o-i,s-n);t.translate(n,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),cl(t,0,h,c),cl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=Ak(t,n),{x:s,y:o,x2:r,y2:a}=i,l=sD(i,t.chartArea),c=l?oD({x:s,y:o},{x:r,y:a},t.chartArea):{x:s,y:o,x2:r,y2:a,width:Math.abs(r-s),height:Math.abs(a-o)};if(c.centerX=(r+s)/2,c.centerY=(a+o)/2,c.initProperties=Oi(t,c,n),n.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=fD(c,n,di(h,f))}const u=aD(t,c,n.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Ns.id="lineAnnotation";const nm={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};Ns.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},nm),fill:!1,length:12,start:Object.assign({},nm),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Is.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Ns.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Ns.defaultRoutes={borderColor:"color"};function iD(e,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:o}){const r=nD(t,n,e.getProps(["x","y","x2","y2"],o),i);return vf(r,s)||ll(e,{mouseX:t,mouseY:n},o,i)}function sD({x:e,y:t,x2:n,y2:i},{top:s,right:o,bottom:r,left:a}){return!(e<a&&n<a||e>o&&n>o||t<s&&i<s||t>r&&i>r)}function im({x:e,y:t},n,{top:i,right:s,bottom:o,left:r}){return e<r&&(t=Qf(r,{x:e,y:t},n),e=r),e>s&&(t=Qf(s,{x:e,y:t},n),e=s),t<i&&(e=rl(i,{x:e,y:t},n),t=i),t>o&&(e=rl(o,{x:e,y:t},n),t=o),{x:e,y:t}}function oD(e,t,n){const{x:i,y:s}=im(e,t,n),{x:o,y:r}=im(t,e,n);return{x:i,y:s,x2:o,y2:r,width:Math.abs(o-i),height:Math.abs(r-s)}}function rD(e,{mouseX:t,mouseY:n},i=Qn,s){const{x:o,y:r,x2:a,y2:l}=e.getProps(["x","y","x2","y2"],s),c=a-o,u=l-r,h=Ls(c)+Ls(u),f=h===0?-1:((t-o)*c+(n-r)*u)/h;let m,p;return f<0?(m=o,p=r):f>1?(m=a,p=l):(m=o+f*c,p=r+f*u),Ls(t-m)+Ls(n-p)<=i}function ll(e,{mouseX:t,mouseY:n},i,s){const o=e.label;return o.options.display&&o.inRange(t,n,s,i)}function aD(e,t,n){const i=n.borderWidth,s=Wt(n.padding),o=Jo(e.ctx,n),r=o.width+s.width+i,a=o.height+s.height+i;return cD(t,n,{width:r,height:a,padding:s},e.chartArea)}function lD(e){const{x:t,y:n,x2:i,y2:s}=e,o=Math.atan2(s-n,i-t);return o>dt/2?o-dt:o<dt/-2?o+dt:o}function cD(e,t,n,i){const{width:s,height:o,padding:r}=n,{xAdjust:a,yAdjust:l}=t,c={x:e.x,y:e.y},u={x:e.x2,y:e.y2},h=t.rotation==="auto"?lD(e):Vt(t.rotation),f=uD(s,o,h),m=dD(e,t,{labelSize:f,padding:r},i),p=e.cp?al(c,e.cp,u,m):ol(c,u,m),y={size:f.w,min:i.left,max:i.right,padding:r.left},b={size:f.h,min:i.top,max:i.bottom,padding:r.top},S=om(p.x,y)+a,M=om(p.y,b)+l;return{x:S-s/2,y:M-o/2,x2:S+s/2,y2:M+o/2,centerX:S,centerY:M,pointX:p.x,pointY:p.y,width:s,height:o,rotation:so(h)}}function uD(e,t,n){const i=Math.cos(n),s=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*s),h:Math.abs(e*s)+Math.abs(t*i)}}function dD(e,t,n,i){let s;const o=hD(e,i);return t.position==="start"?s=sm({w:e.x2-e.x,h:e.y2-e.y},n,t,o):t.position==="end"?s=1-sm({w:e.x-e.x2,h:e.y-e.y2},n,t,o):s=Ja(1,t.position),s}function sm(e,t,n,i){const{labelSize:s,padding:o}=t,r=e.w*i.dx,a=e.h*i.dy,l=r>0&&(s.w/2+o.left-i.x)/r,c=a>0&&(s.h/2+o.top-i.y)/a;return Xo(Math.max(l,c),0,.25)}function hD(e,t){const{x:n,x2:i,y:s,y2:o}=e,r=Math.min(s,o)-t.top,a=Math.min(n,i)-t.left,l=t.bottom-Math.max(s,o),c=t.right-Math.max(n,i);return{x:Math.min(a,c),y:Math.min(r,l),dx:a<=c?1:-1,dy:r<=l?1:-1}}function om(e,t){const{size:n,min:i,max:s,padding:o}=t,r=n/2;return n>s-i?(s+i)/2:(i>=e-o-r&&(e=i+o+r),s<=e+o+r&&(e=s-o-r),e)}function rm(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:am(e,n),endAdjust:am(e,i)}}function am(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,s=e.options.borderWidth/2,o={x:n,y:i+s};return Math.abs(rl(0,o,{x:0,y:s}))}function cl(e,t,n,i){if(!i||!i.display)return;const{length:s,width:o,fill:r,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+n;e.beginPath(),Ei(e,i),nn(e,i),e.moveTo(c,-o),e.lineTo(t+n,0),e.lineTo(c,o),r===!0?(e.fillStyle=a||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function fD(e,t,n){const{x:i,y:s,x2:o,y2:r,centerX:a,centerY:l}=e,c=Math.atan2(r-s,o-i),u=tl(t.controlPoint,0),h={x:a+Dn(n,u.x,!1),y:l+Dn(n,u.y,!1)};return Zn(h,{x:a,y:l},c)}function lm(e,{x:t,y:n},{angle:i,adjust:s},o){!o||!o.display||(e.save(),e.translate(t,n),e.rotate(i),cl(e,0,-s,o),e.restore())}function mD(e,t,n,i){const{x:s,y:o,x2:r,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=rm(t),m={x:s,y:o},p={x:r,y:a},y=em(m,n,p,0),b=em(m,n,p,1)-dt,S=al(m,n,p,h/i),M=al(m,n,p,1-f/i),E=new Path2D;e.beginPath(),E.moveTo(S.x,S.y),E.quadraticCurveTo(n.x,n.y,M.x,M.y),e.shadowColor=l.borderShadowColor,e.stroke(E),t.path=E,t.ctx=e,lm(e,S,{angle:y,adjust:h},c),lm(e,M,{angle:b,adjust:f},u)}class Fs extends oe{inRange(t,n,i,s){const o=this.options.rotation,r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return pD({x:t,y:n},this.getProps(["width","height","centerX","centerY"],s),o,r);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:a,end:c},f=Zn({x:t,y:n},this.getCenterPoint(s),Vt(-o));return f[i]>=h.start-r-Qn&&f[i]<=h.end+r+Qn}getCenterPoint(t){return Jn(this,t)}draw(t){const{width:n,height:i,centerX:s,centerY:o,options:r}=this;t.save(),Qo(t,this.getCenterPoint(),r.rotation),Ei(t,this.options),t.beginPath(),t.fillStyle=r.backgroundColor;const a=nn(t,r);t.ellipse(s,o,i/2,n/2,dt/2,0,2*dt),t.fill(),a&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return $f(t,n)}}Fs.id="ellipseAnnotation",Fs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Pi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Fs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Fs.descriptors={label:{_fallback:!0}};function pD(e,t,n,i){const{width:s,height:o,centerX:r,centerY:a}=t,l=s/2,c=o/2;if(l<=0||c<=0)return!1;const u=Vt(n||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(e.x-r)+f*(e.y-a),2),p=Math.pow(f*(e.x-r)-h*(e.y-a),2);return m/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class nr extends oe{inRange(t,n,i,s){const{x:o,y:r,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?ck({x:t,y:n},this.getCenterPoint(s),c/2,u):vf(i==="y"?{start:r,end:l,value:n}:{start:o,end:a,value:t},u)}getCenterPoint(t){return Jn(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,Ei(t,n);const s=nn(t,n);yk(t,this,this.centerX,this.centerY),s&&!Zo(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=Wf(t,n);return i.initProperties=Oi(t,i,n),i}}nr.id="pointAnnotation",nr.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},nr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ir extends oe{inRange(t,n,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&yD(this.elements,t,n,s);const o=Zn({x:t,y:n},this.getCenterPoint(s),Vt(-this.options.rotation)),r=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...r),l=Math.max(...r);return o[i]>=a&&o[i]<=l}getCenterPoint(t){return Jn(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ei(t,i);const s=nn(t,i);let o=!0;for(const r of n)o?(t.moveTo(r.x,r.y),o=!1):t.lineTo(r.x,r.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=Wf(t,n),{sides:s,rotation:o}=n,r=[],a=2*dt/s;let l=o*Er;for(let c=0;c<s;c++,l+=a){const u=gD(i,n,l);u.initProperties=Oi(t,i,n),r.push(u)}return i.elements=r,i}}ir.id="polygonAnnotation",ir.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},ir.defaultRoutes={borderColor:"color",backgroundColor:"color"};function gD({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:s},o){const r=(i+s)/2,a=Math.sin(o),l=Math.cos(o),c={x:e+a*n,y:t-l*n};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:e+a*(n+r),bY:t-l*(n+r)}}}function yD(e,t,n,i){let s=!1,o=e[e.length-1].getProps(["bX","bY"],i);for(const r of e){const a=r.getProps(["bX","bY"],i);a.bY>n!=o.bY>n&&t<(o.bX-a.bX)*(n-a.bY)/(o.bY-a.bY)+a.bX&&(s=!s),o=a}return s}const Cn={box:Pi,doughnutLabel:er,ellipse:Fs,label:Is,line:Ns,point:nr,polygon:ir};Object.keys(Cn).forEach(e=>{Et.describe(`elements.${Cn[e].id}`,{_fallback:"plugins.annotation.common"})});const bD={update:Object.assign},_D=sl.concat(tr),cm=(e,t)=>ft(t)?hl(e,t):e,ul=e=>e==="color"||e==="font";function dl(e="line"){return Cn[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function xD(e,t,n,i){const s=SD(e,n.animations,i),o=t.annotations,r=MD(t.elements,o);for(let a=0;a<o.length;a++){const l=o[a],c=um(r,a,l.type),u=l.setContext(vD(e,c,r,l)),h=c.resolveElementProperties(e,u);h.skip=wD(h),"elements"in h&&(TD(c,h.elements,u,s),delete h.elements),fe(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=dm(u),s.update(c,h)}}function wD(e){return isNaN(e.x)||isNaN(e.y)}function SD(e,t,n){return n==="reset"||n==="none"||n==="resize"?bD:new Yr(e,t)}function TD(e,t,n,i){const s=e.elements||(e.elements=[]);s.length=t.length;for(let o=0;o<t.length;o++){const r=t[o],a=r.properties,l=um(s,o,r.type,r.initProperties),c=n[r.optionScope].override(r);a.options=dm(c),i.update(l,a)}}function um(e,t,n,i){const s=Cn[dl(n)];let o=e[t];return(!o||!(o instanceof s))&&(o=e[t]=new s,Object.assign(o,i)),o}function dm(e){const t=Cn[dl(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,hl(e,t.defaults),hl(e,t.defaultRoutes));for(const i of _D)n[i]=e[i];return n}function hl(e,t){const n={};for(const i of Object.keys(t)){const s=t[i],o=e[i];ul(i)&&xt(o)?n[i]=o.map(r=>cm(r,s)):n[i]=cm(o,s)}return n}function vD(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function MD(e,t){const n=t.length,i=e.length;if(i<n){const s=n-i;e.splice(i,0,...new Array(s))}else i>n&&e.splice(n,i-n);return e}var kD="3.1.0";const On=new Map,hm=e=>e.type!=="doughnutLabel",DD=sl.concat(tr);var fm={id:"annotation",version:kD,beforeRegister(){uk("chart.js","4.0",pe.version)},afterRegister(){pe.register(Cn)},afterUnregister(){pe.unregister(Cn)},beforeInit(e){On.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=On.get(e),s=i.annotations=[];let o=n.annotations;ft(o)?Object.keys(o).forEach(r=>{const a=o[r];ft(a)&&(a.id=r,s.push(a))}):xt(o)&&s.push(...o),$k(s.filter(hm),e.scales)},afterDataLimits(e,t){const n=On.get(e);Wk(e,t.scale,n.annotations.filter(hm).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=On.get(e);Bk(e,i,n),xD(e,i,n,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),Vk(e,i,n)},beforeDatasetsDraw(e,t,n){Bs(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Bs(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Bs(e,t.index,n.clip)},beforeDraw(e,t,n){Bs(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Bs(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=On.get(e);zk(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){On.delete(e)},getAnnotations(e){const t=On.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return Qa(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=>!DD.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${Cn[dl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:ul,_fallback:!0},_indexable:ul}},additionalOptionScopes:[""]};function Bs(e,t,n){const{ctx:i,chartArea:s}=e,o=On.get(e);n&&ts(i,s);const r=CD(o.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of r)OD(i,s,o,a);n&&es(i)}function CD(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 s of i.elements)s.options.display&&s.options.drawTime===t&&n.push({element:s});return n}function OD(e,t,n,i){const s=i.element;i.main?(Kf(n,s,"beforeDraw"),s.draw(e,t),Kf(n,s,"afterDraw")):s.draw(e,t)}const ED={class:"zoom-timerange-container"},AD={class:"zoom-timerange-details"},PD={class:"label","data-testid":"zoom-timerange-from"},RD={class:"label","data-testid":"zoom-timerange-to"},ID=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.ref(Ds({tickValue:t.start,granularity:t.granularity})),s=d.ref(Ds({tickValue:t.end,granularity:t.granularity})),o=(r,a)=>{Vh(()=>{i.value=Ds({tickValue:r,granularity:t.granularity}),s.value=Ds({tickValue:a,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([r,a])=>{o(r,a)},{immediate:!0}),(r,a)=>(d.openBlock(),d.createElementBlock("div",ED,[d.createElementVNode("div",AD,[d.createElementVNode("div",PD,d.toDisplayString(d.unref(n).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",RD,d.toDisplayString(d.unref(n).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(s.value),1)])]))}}),ke=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},mm=ke(ID,[["__scopeId","data-v-4fa681cf"]]),LD={class:"zoom-actions-container"},ND={class:"zoom-actions-heading"},FD={class:"zoom-action-select"},BD=["data-testid"],zD=["aria-disabled","href"],UD=["onClick"],HD=ke(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,s=o=>{o.action&&(o.action(n.newTimeRange),i("onAction"))};return(o,r)=>(d.openBlock(),d.createElementBlock("div",LD,[d.createElementVNode("div",ND,[d.createVNode(mm,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Wi.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`,onClick:r[0]||(r[0]=a=>o.$emit("onAction"))},null,8,["color","size"])]),r[2]||(r[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",FD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.zoomActionItems,a=>(d.openBlock(),d.createElementBlock("div",{key:a.key,class:d.normalizeClass(["zoom-action-item",{disabled:a.disabled}]),"data-testid":`zoom-action-item-${a.key}`},[a.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":a.disabled,class:"zoom-action-link",href:a.href,onClick:r[1]||(r[1]=l=>o.$emit("onAction"))},d.toDisplayString(a.label),9,zD)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(a)},d.toDisplayString(a.label),9,UD))],10,BD))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),VD={key:2},WD={class:"tooltip-title"},$D={class:"title"},YD={key:0,class:"subtitle"},jD={class:"context"},qD={class:"metric"},GD={class:"tooltip"},KD={key:0},XD={class:"display-value"},sr=ke(d.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(e,{emit:t}){const n=t,i=e,s=d.ref(null),{x:o,y:r,isDragging:a}=XM(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${r.value}px`),c=d.computed(()=>`${o.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,p])=>{a.value||(o.value=parseFloat(m),r.value=parseFloat(p))}),d.watch(a,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(s,m=>{if(m){const{width:p,height:y}=m.getBoundingClientRect();n("dimensions",{width:p,height:y})}}),(m,p)=>e.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity&&e.zoomTimeRange&&e.zoomTimeRange.end&&e.zoomTimeRange.start?(d.openBlock(),d.createBlock(mm,{key:0,end:e.zoomTimeRange?.end,granularity:e.granularity,start:e.zoomTimeRange?.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(d.openBlock(),d.createBlock(HD,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:p[0]||(p[0]=y=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",VD,[d.createElementVNode("div",WD,[d.createElementVNode("div",$D,[d.createElementVNode("div",null,d.toDisplayString(e.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Wi.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",YD,[d.createElementVNode("div",jD,d.toDisplayString(u.value),1),d.createElementVNode("div",qD,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",GD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.state.tooltipSeries,({backgroundColor:y,borderColor:b,label:S,value:M,isSegmentEmpty:E},D)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:S+D},[e.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",KD,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:String(y),borderColor:String(b)})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:E}])},d.toDisplayString(S),3),d.createElementVNode("span",XD,d.toDisplayString(M),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),ZD={key:0,class:"legend-container","data-testid":"legend"},QD=["onClick"],JD=["title"],tC={class:"label truncate-label"},eC={key:0,class:"sub-label"},nC={class:"tooltip-content"},fl=ke(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.inject("showLegendValues",!1),s=d.inject("legendPosition",d.ref(be.Bottom)),o=(a=0,l)=>{if(t.chartInstance===null)return;const c=t.chartInstance instanceof pe?t.chartInstance:t.chartInstance.chart;r(a,l)?c.hide(a,l):c.show(a,l),c.update()},r=(a=0,l)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const c=t.chartInstance instanceof pe?t.chartInstance:t.chartInstance.chart;return c.getDatasetMeta(a).dataset||l===void 0?c.isDatasetVisible(a):c.getDataVisibility(l)};return(a,l)=>{const c=d.resolveComponent("KTooltip");return d.unref(s)!==d.unref(be).Hidden?(d.openBlock(),d.createElementBlock("ul",ZD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.items,({fillStyle:u,strokeStyle:h,text:f,datasetIndex:m,index:p,value:y,isSegmentEmpty:b})=>(d.openBlock(),d.createElementBlock("li",{key:f,onClick:S=>o(m,p)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:u,"border-color":h})},null,4),d.createVNode(c,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!r(m,p)}]),title:y&&d.unref(i)?`${f}: ${y.formatted}`:f},[d.createElementVNode("div",tC,d.toDisplayString(f),1),y&&d.unref(i)?(d.openBlock(),d.createElementBlock("div",eC,d.toDisplayString(y.formatted),1)):d.createCommentVNode("",!0)],10,JD)]),_:2},[b?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",nC,d.toDisplayString(d.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,QD))),128))])):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-e6664c85"]]),Qt=[];for(let e=0;e<256;++e)Qt.push((e+256).toString(16).slice(1));function iC(e,t=0){return(Qt[e[t+0]]+Qt[e[t+1]]+Qt[e[t+2]]+Qt[e[t+3]]+"-"+Qt[e[t+4]]+Qt[e[t+5]]+"-"+Qt[e[t+6]]+Qt[e[t+7]]+"-"+Qt[e[t+8]]+Qt[e[t+9]]+"-"+Qt[e[t+10]]+Qt[e[t+11]]+Qt[e[t+12]]+Qt[e[t+13]]+Qt[e[t+14]]+Qt[e[t+15]]).toLowerCase()}const sC=new Uint8Array(16);function oC(){return crypto.getRandomValues(sC)}function ml(e,t,n){return crypto.randomUUID?crypto.randomUUID():rC(e)}function rC(e,t,n){e=e||{};const i=e.random??e.rng?.()??oC();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,iC(i)}const pm=(e,t)=>{const n=e.ctx,i=e.scales.y,s=e.scales.x,o=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(o.x-o.width/2,o.y,o.width,i.bottom-o.y):n.strokeRect(s.left,o.y-o.height/2,o.x-s.left,o.height),n.restore()};class gm{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&pm(t,this._clickedElements)}afterEvent(t,{event:n}){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=t.options.interaction?.mode||"index",s=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,pm(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const aC=["id"],lC=["id"],cC={class:"axis-tooltip-content"},uC="100%",dC="100%",hC=20,fC=20,ym=6,mC=0,pC=10,gC=10,yC=1,bC=ke(d.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(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(),s=crypto.randomUUID(),o=crypto.randomUUID(),r=new gm,a=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:q},G)=>{const J=q.data,nt=J.labels?.indexOf(G);return J.datasets.reduce((tt,Z,pt)=>{if(q.isDatasetVisible(pt)){const bt=Z.data[nt];return isNaN(bt)?tt:tt+bt}else return tt},0)},u=(q,G,J,nt)=>{const tt=nt==="horizontal";G===null&&(G=n.t("entityNoName"));const Z={type:"label",yValue:ot=>tt?G:c(ot,G),xValue:ot=>tt?c(ot,G):G},pt={...Z,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(Lv()),content:ot=>Kh(c(ot,G),J)},bt={...Z,content:ot=>Fv(c(ot,G),Nv(ot.chart,q)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:ot=>tt?Iv(Kh(c(ot,G),J)):0,color:Dv};return{[`${G}-value`]:pt,[`${G}-percent`]:bt}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=ml(),p=ml(),y=d.ref([]),b=d.inject("legendPosition",be.Bottom),S=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),M=d.toRef(t,"metricUnit"),E=d.computed(()=>t.orientation==="horizontal"),D=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:E.value?"horizontal_bar":"vertical_bar",chartID:o,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:C,tooltipAbsoluteTop:A}=mt.useTooltipAbsolutePosition(l,D),O=d.ref(0),x=()=>t.annotations&&t.chartData.labels?.reduce((q,G)=>Object.assign(q,u(t.chartData,G,M.value,t.orientation)),{}),_={id:m,afterUpdate(q){O.value+=1,y.value=Wh(q,t.legendValues,t.chartLegendSortFn)}},T={id:p,afterUpdate(q){q.options.plugins.annotation.annotations=t.annotations?x():{}}},I=[_,{id:"axisHover",afterEvent(q,G){if(S.show=!1,G.event.type==="mousemove"){const J=G.event,nt=q.options.indexAxis,tt=q.scales,Z=q.scales[nt].getLabelForValue(Number(q.scales[nt].getValueForPixel(J[nt]))),bt=q.scales[nt].getLabels().indexOf(Z),ot=t.chartData.isLabelEmpty?.[bt];if((ct=>ct==="x"?J.y>tt.x.top:J.x<tt.y.right)(nt)){D.interactionMode!=="interactive"&&(D.showTooltip=!1);const $t=q.canvas.getContext("2d").measureText(Z).width,lt=Math.abs(Math.round(J.x-$t*.5)),Mt=Math.round(J.x+$t*.5),Yt=q.canvas.getBoundingClientRect(),_e=40;S.left=nt==="x"?`${(lt>0?lt:Mt)-S.offset+Yt.left}px`:`${J.x-$t*.5-S.offset+Yt.left}px`,S.top=`${J.y-_e+Yt.top}px`,Z.length>$o?(S.show=!0,S.text=Z):ot?(S.text=n.t("emptyEntityInfo"),S.show=!0):S.show=!1}else S.show=!1}}},r,...t.annotations?[T]:[]],Y=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),U=d.ref(0),j=d.ref(0),H=new ResizeObserver(Vh(q=>{U.value=q[0].contentRect.width,j.value=q[0].contentRect.height},100)),$=d.computed(()=>{const q=t.chartData?.labels?.length;return h.value&&q&&!E.value?`${Math.max(q*(hC+ym),U.value)}px`:uC}),R=d.computed(()=>{const q=t.chartData?.labels?.length;return h.value&&q&&E.value?`${Math.max(q*(fC+ym),j.value)}px`:dC});mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&pe.register(fm),a.value&&(U.value=a.value.offsetWidth,j.value=a.value.offsetHeight,H.observe(a.value))}),d.onUnmounted(()=>{a.value&&H.unobserve(a.value)});const B=d.computed(()=>{const q=mt.useBarChartOptions({tooltipState:D,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:E.value?"y":"x",numLabels:Y});return{...q.value,plugins:{...q.value.plugins,annotation:{annotations:x(),clip:!1}}}}),z=mt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),I,B);d.onBeforeUnmount(()=>{pe.unregister(fm)});const P={[be.Bottom]:"column"},N=d.computed(()=>{if(f.value&&z.value){const q=window.devicePixelRatio,G=z.value,J=G.scales.y.width*q+yC,nt=(G.scales.y.height+G.scales.y.top+G.scales.x.height)*q,tt=f.value.getContext("2d");return tt.scale(q,q),tt.canvas.width=J,tt.canvas.height=nt,tt.canvas.style.width=`${J/q}px`,tt.canvas.style.height=`${nt/q}px`,{scale:q,width:J*q,height:nt*q,targetCtx:tt}}return null}),V=q=>{const G=q.target;if(N.value&&z.value&&!E.value){const J=N.value.scale,nt=N.value.targetCtx,tt=N.value.width,Z=N.value.height,pt=z.value,bt=pt.canvas;nt.fillStyle="white",G.scrollLeft>=mC&&G.scrollLeft<=pC?(nt.globalCompositeOperation="source-over",nt.clearRect(0,0,tt,Z),nt.drawImage(bt,0,0,tt,Z,0,0,tt,Z),nt.globalCompositeOperation="destination-over",nt.fillRect(0,0,tt,Z)):(nt.globalCompositeOperation="source-over",nt.fillRect(0,(pt.scales.y.height+pt.scales.y.top+gC)*J,tt,pt.scales.x.height*J))}D.offsetY=G.scrollTop,D.offsetX=G.scrollLeft,S.offset=G.scrollLeft},Q=({width:q,height:G})=>{D.width=q,D.height=G};d.watch(()=>t.orientation,()=>{if(f.value&&N.value){const q=N.value.width,G=N.value.height;(f.value?.getContext("2d")).clearRect(0,0,q,G)}D.showTooltip=!1,D.interactionMode="idle"}),d.watch(()=>t.annotations,q=>{z.value&&(q?z.value.options.plugins.annotation.annotations=x(t.chartData):delete z.value.options.plugins.annotation.annotations)});const X=()=>{D.showTooltip&&(D.interactionMode!=="idle"?D.interactionMode="idle":D.interactionMode="interactive")};return(q,G)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",P[d.unref(b)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,aC),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:G[0]||(G[0]=J=>X()),onScroll:V},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:$.value,height:R.value})},[d.createElementVNode("canvas",{id:d.unref(o),ref:"canvas",class:"chart-canvas"},null,8,lC)],4)],544),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[S.show?(d.openBlock(),d.createElementBlock("div",{key:0,class:"axis-tooltip",style:d.normalizeStyle({top:S.top,left:S.left}),width:"auto"},[d.createElementVNode("div",cC,d.toDisplayString(S.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(sr,{"absolute-left":d.unref(C),"absolute-top":d.unref(A),"chart-parent-ref":l.value,state:D,"tooltip-title":e.tooltipTitle,onDimensions:Q},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(fl,{id:d.unref(m),"chart-instance":d.unref(z),items:y.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const _C={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"};du._date.override({_id:"date-fns",formats:function(){return _C},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=ut(e):n==="string"&&(typeof t=="string"?e=uw(e,t,new Date,this.options):e=Kd(e,this.options)),ga(e)?e.getTime():null},format:function(e,t){return Ao(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return ma(e,t);case"second":return o_(e,t);case"minute":return i_(e,t);case"hour":return t_(e,t);case"day":return Oo(e,t);case"week":return r_(e,t);case"month":return fa(e,t);case"quarter":return s_(e,t);case"year":return a_(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return ya(e,t);case"second":return p_(e,t);case"minute":return h_(e,t);case"hour":return d_(e,t);case"day":return Cd(e,t);case"week":return g_(e,t);case"month":return Pd(e,t);case"quarter":return m_(e,t);case"year":return y_(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return mw(e);case"minute":return fw(e);case"hour":return hw(e);case"day":return pa(e);case"week":return Ve(e);case"isoWeek":return Ve(e,{weekStartsOn:+n});case"month":return __(e);case"quarter":return b_(e);case"year":return Rd(e);default:return e}},endOf:function(e,t){switch(t){case"second":return M_(e);case"minute":return T_(e);case"hour":return w_(e);case"day":return Ed(e);case"week":return S_(e);case"month":return Ad(e);case"quarter":return v_(e);case"year":return x_(e);default:return e}}});const bm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},xC={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...bm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},wC=d.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Ri(e){return d.isProxy(e)?d.toRaw(e):e}function SC(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return d.isProxy(t)?new Proxy(e,{}):e}function TC(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function _m(e,t){e.labels=t}function xm(e,t,n){const i=[];e.datasets=t.map(s=>{const o=e.datasets.find(r=>r[n]===s[n]);return!o||!s.data||i.includes(o)?{...s}:(i.push(o),Object.assign(o,s),o)})}function vC(e,t){const n={labels:[],datasets:[]};return _m(n,e.labels),xm(n,e.datasets,t),n}const MC=d.defineComponent({props:xC,setup(e,t){let{expose:n,slots:i}=t;const s=d.ref(null),o=d.shallowRef(null);n({chart:o});const r=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=e,p=vC(u,m),y=SC(p,u);o.value=new pe(s.value,{type:c,data:y,options:{...h},plugins:f})},a=()=>{const c=d.toRaw(o.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},e.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(e.updateMode)};return d.onMounted(r),d.onUnmounted(a),d.watch([()=>e.options,()=>e.data],(c,u)=>{let[h,f]=c,[m,p]=u;const y=d.toRaw(o.value);if(!y)return;let b=!1;if(h){const S=Ri(h),M=Ri(m);S&&S!==M&&(TC(y,S),b=!0)}if(f){const S=Ri(f.labels),M=Ri(p.labels),E=Ri(f.datasets),D=Ri(p.datasets);S!==M&&(_m(y.config.data,S),b=!0),E&&E!==D&&(xm(y.config.data,E,e.datasetIdKey),b=!0)}b&&d.nextTick(()=>{l(y)})},{deep:!0}),()=>d.h("canvas",{role:"img","aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function pl(e,t){return pe.register(t),d.defineComponent({props:bm,setup(n,i){let{expose:s}=i;const o=d.shallowRef(null),r=a=>{o.value=a?.chart};return s({chart:o}),()=>d.h(MC,wC({ref:r},{type:e,...n}))}})}const wm=pl("bar",lu),Sm=pl("doughnut",ss),Tm=pl("line",cu),kC={class:"chart-container"},DC={key:0,class:"chart-center-metric"},CC={class:"chart-center-total"},OC={key:0,class:"chart-center-unit"},EC=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:be.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>Mn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(e){const t=e,{translateUnit:n}=mt.useTranslatedUnits(),{i18n:i}=mt.useI18n(),s=crypto.randomUUID(),o=crypto.randomUUID(),r=d.ref([]),a=d.useTemplateRef("chartParent"),l=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:o,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:c,tooltipAbsoluteTop:u}=mt.useTooltipAbsolutePosition(a,l),h={id:s,afterUpdate(O){r.value=O.options.plugins.legend.labels.generateLabels(O).map(x=>({...x,value:t.legendValues&&t.legendValues[x.text],hidden:!1}))}},f=d.computed(()=>[h]),m=d.computed(()=>[t.chartData.datasets.reduce((x,_)=>(x.labels.push(_.label),x.backgroundColor.push(_.backgroundColor),x.hoverBorderColor.push(Ir(_.backgroundColor).saturate(.5).darken(.15).hexString()),x.data.push(_.data.reduce((T,k)=>T+k,0)),x),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:p}=Kn({i18n:i}),y=d.computed(()=>wM(t.metricName??"")),b=d.computed(()=>{const O=m.value[0]?.data.reduce((x,_)=>x+_,0)??0;return p(O,t.metricUnit,{approximate:!0,translateUnit:(x,_)=>n(x,_)}).trim()}),S=d.computed(()=>t.tooltipMetricDisplay||""),M=d.computed(()=>({...t.chartData,datasets:m.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:E}=mt.useDonutChartOptions({tooltipState:l,legendID:s}),D=d.ref(),C=O=>({[be.Bottom]:"column",[be.Hidden]:"hidden"})[O],A=({width:O,height:x})=>{l.width=O,l.height=x};return(O,x)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",C(e.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",kC,[d.createVNode(d.unref(Sm),{ref_key:"chartInstance",ref:D,"chart-id":d.unref(o),data:M.value,options:d.unref(E),plugins:f.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&y.value?(d.openBlock(),d.createElementBlock("div",DC,[d.createElementVNode("span",CC,d.toDisplayString(b.value),1),S.value?(d.openBlock(),d.createElementBlock("span",OC,d.toDisplayString(S.value),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(sr,{"absolute-left":d.unref(c),"absolute-top":d.unref(u),state:l,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:A},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(fl,{id:d.unref(s),"chart-instance":D.value,items:r.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),AC=ke(EC,[["__scopeId","data-v-48b16272"]]),gl=(e,t,n,i,s="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=s,e.stroke(),e.restore()},de={},PC=()=>{de.x=void 0,de.chart=void 0,de.strategy=void 0,de.group=void 0},RC=10;class vm{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){let s=!1;n==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}_lastMouseBrushEvent=0;onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<RC)return;const s=()=>{de.chart=n,de.strategy=this._brushStrategy,de.group=this._brushGroup;for(const o of Object.values(pe.instances))o!==n&&o.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(de.x=n.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(de.x=void 0,s()),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:s}=this._clickedSegment.element;gl(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:s}=t.tooltip.dataPoints[0].element;gl(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(de.x===void 0)return;const n=de.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&de.group===this._brushGroup&&gl(t.ctx,de.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&&de.chart===t){const n=de.x!==void 0;if(PC(),n)for(const i of Object.values(pe.instances))i!==t&&i.update("none")}}}const IC=(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()},LC=(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()},Mm=(e,t,n)=>{const i=t.scales.x.getValueForPixel(n.startX),s=t.scales.x.getValueForPixel(n.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(e,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class NC{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},o=a=>{const l=n.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,Mm("dragSelectMove",t,this))},r=a=>{const l=n.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,Mm("dragSelect",t,this),i=!1,this._isDragging=!1)};n.addEventListener("mousedown",s),n.addEventListener("mousemove",o),n.addEventListener("mouseup",r),this._dragSelectHandlers={onMouseDown:s,onMouseMove:o,onMouseUp:r}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:o}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",s),n.removeEventListener("mouseup",o)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(LC(t,this._startX,this._endX),IC(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const FC=["hidden","single","full"];var ei=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(ei||{});const BC=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],zC=["gauge","top_n","single_value"],UC=20,HC="rgba(255, 171, 171, 0.4)",VC="rgba(255, 196, 0, 0.2)",km=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const s=(n-e.y)/i;return e.x+s*(t.x-e.x)},WC=(e,t)=>{const n=[];return e.data.datasets.forEach(i=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(i)).visible)return;const o=i.data;o?.length&&t.filter(r=>r.highlightIntersections).forEach(r=>{const a=o.map(c=>({ts:c.x,aboveThreshold:c.y>=r.value}));let l=a[0].aboveThreshold?o[0].x:void 0;for(let c=1;c<a.length;c++)!a[c-1].aboveThreshold&&a[c].aboveThreshold?l=km(o[c-1],o[c],r.value):a[c-1].aboveThreshold&&!a[c].aboveThreshold&&l!==void 0&&(n.push({start:l,end:km(o[c-1],o[c],r.value),type:r.type}),l=void 0);l!==void 0&&n.push({start:l,end:a[a.length-1].ts,type:r.type})})}),n},$C=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:s})=>s===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class YC{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const n of Object.keys(t.threshold||{})){const i=t.threshold?.[n];i&&(this._thresholds={...this._thresholds,[n]:i.map(s=>({...s,hovered:!1}))})}if(this._thresholds)for(const n of Object.keys(this._thresholds))t.threshold?.[n]||delete this._thresholds[n]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const s=t.canvas;this._syncThresholds(i);const o=r=>{if(t){const a=r.clientY,l=t.scales.y,c=s.getBoundingClientRect(),u=l.getValueForPixel(a-c.top);if(u)for(const h of Object.keys(this._thresholds||{})){const f=this._thresholds?.[h];f&&f.forEach(m=>{m.hovered=Math.abs(m.value-u)<UC})}}};s.addEventListener("mousemove",o),this._mouseMoveHandler=o}afterDatasetsDraw(t,n){const i=t.ctx;for(const s of Object.keys(this._thresholds||{})){const o=this._thresholds?.[s];if(o){o.forEach(l=>{const u=t.scales.y.getPixelForValue(l.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,u),i.lineTo(t.chartArea.right,u),i.lineWidth=1,i.strokeStyle=Ba(l.type),i.setLineDash([5,5]),i.stroke(),i.restore();let h="";l.label?h=`${l.label}: ${l.value}`:l.type==="warning"?h=this.i18n.t("chartLabels.threshold-warning",{value:l.value}):l.type==="error"?h=this.i18n.t("chartLabels.threshold-error",{value:l.value}):h=this.i18n.t("chartLabels.thatreshold-neutral",{value:l.value}),l.hovered&&(i.save(),i.fillStyle=Ba(l.type),i.font=a1,i.fillText(h,t.chartArea.left,u-4),i.restore())});const r=WC(t,o);$C(r).forEach(l=>{const c=t.scales.x.getPixelForValue(l.start),u=t.scales.x.getPixelForValue(l.end);i.save(),i.fillStyle=l.type==="error"?HC:VC,i.fillRect(c,t.chartArea.top,u-c,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(c,t.chartArea.bottom),i.lineTo(u,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Ba(l.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const jC=ke(d.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(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:s}=mt.useI18n(),o=new vm,r=new gm,a=new NC,l=new YC(s),{translateUnit:c}=mt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),p=d.inject("legendPosition",be.Bottom),y=d.useTemplateRef("chartParent"),b=d.ref(void 0),S=d.ref(!1),M=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:d.toRef(n,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(n,"metricUnit"),translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:f,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:E,tooltipAbsoluteTop:D}=mt.useTooltipAbsolutePosition(y,M),C={id:h,afterUpdate(z){m.value=Wh(z,n.legendValues,n.chartLegendSortFn)}},A=d.computed(()=>[C,r,...n.brush?[a]:[],...n.type==="timeseries_line"?[o]:[],...n.threshold?[l]:[]]),O=d.computed(()=>`line-${A.value.map(z=>z.id).join("-")}`),x=d.computed(()=>`bar-${A.value.map(z=>z.id).join("-")}`),_=d.computed(()=>n.chartData&&KT(n.chartData)),{options:T}=mt.useLineChartOptions({tooltipState:M,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:_,threshold:d.toRef(n,"threshold")});mt.useReportChartDataForSynthetics(d.toRef(n,"chartData"),d.toRef(n,"syntheticsDataKey"));const k=z=>({[be.Bottom]:"column",[be.Hidden]:"hidden"})[z],I=({width:z,height:P})=>{M.width=z,M.height=P},Y=(z=!0)=>{M.interactionMode="idle",M.showTooltip=!1,a.clearSelectionArea(),r.isPaused&&r.resume(z),o.isPaused&&o.resume()},U=()=>{M.interactionMode="interactive"},j=()=>{!u.value||!u.value.chart.tooltip?.dataPoints?.length||(M.interactionMode==="interactive"?o.clickedSegment=u.value.chart.tooltip.dataPoints[0]:o.destroyClickedSegment())},H=()=>{if(S.value){S.value=!1;return}M.interactionMode!=="idle"?Y():U(),j()};d.watch(()=>n.type,()=>{M.interactionMode="idle",M.showTooltip=!1,o.destroyClickedSegment()});const $=z=>{z.preventDefault(),z.stopPropagation();const{xStart:P,xEnd:N}=z.detail;P&&N&&(b.value={start:new Date(P),end:new Date(N),type:"absolute"},M.interactionMode="zoom-interactive",i("select-chart-range",b.value))},R=z=>{M.interactionMode="selecting-chart-area",S.value=!0,o.pause(),r.pause();const{xStart:P,xEnd:N}=z.detail;P&&N&&(b.value={start:new Date(P),end:new Date(N),type:"absolute"})},B=z=>{if(!y.value||M.interactionMode==="idle")return;const P=z.target;P&&y.value.contains(P)||S.value||Y(!1)};return d.watch(()=>u.value?.chart,()=>{u.value?.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",$),u.value.chart.canvas.removeEventListener("dragSelectMove",R),u.value.chart.canvas.addEventListener("dragSelect",$),u.value.chart.canvas.addEventListener("dragSelectMove",R))}),d.onMounted(()=>{document.addEventListener("click",B,!0)}),d.onUnmounted(()=>{u.value?.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",$),u.value.chart.canvas.removeEventListener("dragSelectMove",R)),document.removeEventListener("click",B,!0)}),(z,P)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",k(d.unref(p))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:P[0]||(P[0]=N=>H())},[e.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Tm),{key:O.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(T),plugins:A.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(wm),{key:x.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(T),plugins:A.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(sr,{"absolute-left":d.unref(E),"absolute-top":d.unref(D),"data-testid":"tooltip",granularity:e.granularity,state:M,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":b.value,onDimensions:I,onOnAction:P[1]||(P[1]=()=>Y(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(fl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-ac6e8bbc"]]),qC={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},GC={class:"tooltip-content"},KC={key:2,class:"analytics-chart-parent"},XC=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:be.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:s}=mt.useI18n(),o=d.computed(()=>b.value?mt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ua},d.toRef(i,"chartData")).value:mt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ua},d.toRef(i,"chartData")).value),r=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),a=d.computed(()=>{if(!i.chartData?.meta)return 0;if(i.chartData.meta.start&&i.chartData.meta.end){const U=new Date(i.chartData.meta.start).getTime();return new Date(i.chartData.meta.end).getTime()-U}}),l=d.computed(()=>i.chartData.meta?.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""),c=d.computed(()=>i.chartData.meta?.metric_units?Object.keys(i.chartData.meta.metric_units)[0]??"":""),u=d.computed(()=>i.showLegendValues&&i.legendPosition!==be.Hidden),{legendValues:h}=mt.useChartLegendValues(o,i.chartOptions.type,l),f=d.computed(()=>i.chartData?.meta?.limit?.toString()||null),m=d.computed(()=>i.chartOptions.hideTruncationWarning?!1:i.chartData?.meta?.truncated||!1),p=d.computed(()=>s.t("limitedResultsShown",{maxReturned:f.value})),y=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),b=d.computed(()=>["timeseries_bar","timeseries_line"].some(U=>U===i.chartOptions.type)),S=d.computed(()=>i.chartOptions.type==="donut"),M=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),E=d.computed(()=>{if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const U=i.chartData.meta.metric_names[0],j=i.chartData.meta.metric_units[U]||"";if(i.chartData.meta.metric_names.length>1){if(U.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})});if(U.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})})}if(U)return Cs(j)&&s.te(`metricAxisTitles.${U}`)?s.t(`metricAxisTitles.${U}`)||void 0:s.te(`chartLabels.${U}`)?s.t(`chartLabels.${U}`):U}),D=d.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const U=i.chartData.meta.metric_names[0],j=i.chartData.meta.metric_units[U]||"";if(i.chartData.meta.metric_names.length>1){if(U.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})});if(U.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})})}return s.te(`metricAxisTitles.${U}`)&&(Cs(j)||s.te(`chartUnits.${j}`))?Cs(j)?s.t(`metricAxisTitles.${U}`)||void 0:s.t(`metricAxisTitles.${U}`,{unit:s.t(`chartUnits.${j}`,{plural:"s"})})||void 0:U||void 0}),C=d.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const U=b.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(U)return s.te(`chartLabels.${U}`)?s.t(`chartLabels.${U}`):U}),A=d.computed(()=>{if(zw(i.chartData.meta.datasource))return s.t("timestampAxisTitles.platform");const U=Ra(Number(i.chartData.meta.granularity_ms));if(U)return s.te(`granularityAxisTitles.${U}`)?s.t(`granularityAxisTitles.${U}`):U}),O=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),x=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),_=d.computed(()=>b.value?XT(o.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),T=d.computed(()=>i.chartData.meta.granularity_ms?Ra(i.chartData.meta.granularity_ms)||"hourly":Ra(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),k=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(U,j)=>U.text===s.t("chartLabels.____OTHER____")?1:j.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(U.text,10))&&!isNaN(parseInt(j.text,10))?U.text<j.text?-1:1:U.value&&j.value?j.value.raw-U.value.raw:0),I=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(U,j)=>U.label===s.t("chartLabels.____OTHER____")?1:j.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(U.label,10))&&!isNaN(parseInt(j.label,10))?U.label<j.label?-1:1:U.value&&j.value?j.rawValue-U.rawValue:0),Y=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:U=>n("zoom-time-range",U)}]:[],...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",u),d.provide("legendPosition",d.toRef(i,"legendPosition")),(U,j)=>{const H=d.resolveComponent("KTooltip"),$=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["analytics-chart-shell",{"show-values":u.value}])},[_.value&&m.value&&f.value?(d.openBlock(),d.createElementBlock("div",qC,[d.createVNode(H,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",GC,d.toDisplayString(p.value),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Wi.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(o1)})`,size:`var(--kui-icon-size-40, ${d.unref(l1)})`},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),_.value?(d.openBlock(),d.createElementBlock("div",KC,[b.value?(d.openBlock(),d.createBlock(jC,{key:0,brush:r.value,"chart-data":o.value,"chart-legend-sort-fn":k.value,"chart-tooltip-sort-fn":I.value,"dimension-axes-title":A.value,fill:e.chartOptions.stacked,granularity:T.value,"legend-values":d.unref(h),"metric-axes-title":D.value,"metric-unit":l.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:e.chartOptions.threshold,"time-range-ms":a.value,"tooltip-metric-display":E.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":Y.value,onSelectChartRange:j[0]||(j[0]=R=>n("select-chart-range",R)),onZoomTimeRange:j[1]||(j[1]=R=>n("zoom-time-range",R))},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"])):y.value?(d.openBlock(),d.createBlock(bC,{key:1,annotations:e.showAnnotations,"chart-data":o.value,"chart-legend-sort-fn":k.value,"chart-tooltip-sort-fn":I.value,"data-testid":"bar-chart-container","dimension-axes-title":C.value,"legend-values":d.unref(h),"metric-axes-title":D.value,"metric-unit":l.value,orientation:M.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":E.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"])):S.value?(d.openBlock(),d.createBlock(AC,{key:2,"chart-data":o.value,"dataset-colors":e.chartOptions.chartDatasetColors||d.unref(Ua),"legend-position":e.legendPosition,"legend-values":d.unref(h),"metric-name":c.value,"metric-unit":l.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":C.value,"tooltip-metric-display":E.value,"tooltip-title":e.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock($,{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(x.value),1)]),_:1}))],2)}}}),ZC=ke(XC,[["__scopeId","data-v-346b2111"]]),QC={class:"chart-parent","data-testid":"gauge-chart-parent"},JC={class:"chart-totals-flex"},tO={key:1,class:"metric-small","data-testid":"gauge-chart-total"},eO=ke(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Mn},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(ml()),s=d.computed(()=>[t.chartData.datasets.reduce((m,p)=>(m.labels.push(p.label),m.borderColor.push(p.backgroundColor),m.backgroundColor.push(p.backgroundColor),m.data.push(p.data.reduce((y,b)=>y+b,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),o=d.computed(()=>({...t.chartData,datasets:s.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const r={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=d.computed(()=>Es(s?.value[0]?.data[t.numerator],{capital:!0})),l=d.computed(()=>Es(s?.value[0]?.data[0]+s?.value[0]?.data[1],{capital:!0})),c=d.computed(()=>`color: ${s?.value[0]?.backgroundColor[t.numerator]}`),u=d.computed(()=>["full","single"].includes(t.metricDisplay)),h=d.computed(()=>t.metricDisplay==="full");return(f,m)=>(d.openBlock(),d.createElementBlock("div",QC,[d.createElementVNode("div",JC,[u.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(c.value)},d.toDisplayString(a.value),5)):d.createCommentVNode("",!0),h.value?(d.openBlock(),d.createElementBlock("div",tO,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(Sm),{"chart-id":i.value,data:o.value,options:r},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),nO={key:1,class:"single-value-wrapper"},iO={class:"single-value-metric"},sO={class:"name-unit-alignment"},oO={class:"single-value","data-testid":"single-value-chart"},rO={key:0,class:"single-value-unit"},aO={class:"single-value-metric-name"},lO={key:0,class:"single-value-trend"},cO={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},yl="t1",bl="t2",uO=ke(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:bf},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,formatCost:i}=Kn({i18n:t}),s=e,o=d.computed(()=>`align-${s.leftAlign?"left":s.alignX}`),r=d.computed(()=>Ln.buildDeltaMapping(s.data,s.showTrend,{topLevelKey:yl,secondLevelKey:bl})),a=d.computed(()=>r.value?.previous?.[yl]?.[bl]),l=d.computed(()=>r.value?.current?.[yl]?.[bl]),c=d.computed(()=>s.data.data),u=d.computed(()=>s.data.meta?.metric_names?.[0]),h=d.computed(()=>t.te(`chartLabels.${u.value}`)?t.t(`chartLabels.${u.value}`):""),f=d.computed(()=>{const T=u.value?s.data.meta?.metric_units?.[u.value]:void 0;if(T){const k=`chartUnits.${T}`;return t.te(k)?t.t(k,{plural:""}):""}}),m=d.computed(()=>u.value==="request_per_minute"||!!u.value?.includes("_latency_")||u.value==="error_rate"),p=d.computed(()=>s.showTrend&&a.value!==void 0?a.value:null),y=d.computed(()=>{if(s.showTrend)return l.value??null;if(c.value.length<1||!u.value)return null;const T=c.value[0].event[u.value];return typeof T!="number"||isNaN(T)?null:T}),b=d.computed(()=>s.data?.data?.length===void 0||s.data?.data?.length===0||!s.showTrend&&y.value===null||s.showTrend&&p.value===null&&y.value===null),S=d.computed(()=>{const T=y.value;if(T===null)return"-";const k=u.value?s.data.meta?.metric_units?.[u.value]:void 0;if(k==="usd")return i(T);if(k==="bytes")return n(T);if(T>=1e9){const Y=(T/1e9).toFixed(1);return Y.endsWith(".0")?`${Math.floor(T/1e9)}B`:`${Y}B`}if(T>=1e7){const Y=(T/1e6).toFixed(1);return Y.endsWith(".0")?`${Math.floor(T/1e6)}M`:`${Y}M`}const I=s.decimalPoints&&typeof s.decimalPoints=="number"?s.decimalPoints:bf;return T.toLocaleString("en-US",{maximumFractionDigits:I})}),M=d.computed(()=>s.showTrend&&s.data?.data?.length<2),E=d.computed(()=>Ln.calculateChange(y.value??0,p.value??0)||0),D=d.computed(()=>{if(!s.showTrend)return 0;if(s.data?.data?.length<2){if(a.value===void 0)return 0;if(l.value===void 0)return s.increaseIsBad?1:-1}return Ln.changePolarity(E.value,!0,s.increaseIsBad)}),C=d.computed(()=>Ln.defineIcon(D.value,s.increaseIsBad)),A=d.computed(()=>{if(s.showTrend&&s.data?.data?.length<2){if(a.value===void 0)return t.t("singleValue.trend.not_available");if(l.value===void 0)return Ln.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return Ln.metricChange(E.value,s.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),O=Ln.useTrendRange(d.computed(()=>s.showTrend),void 0,d.computed(()=>s.data.meta)),x=T=>T>0?"positive":T<0?"negative":"neutral",_=T=>T>0?s1:T<0?i1:qh;return d.onMounted(()=>{!s.showTrend&&s.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",s.data.data.length):s.showTrend&&s.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",s.data.data.length)}),(T,k)=>{const I=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["chart-parent",o.value]),"data-testid":"single-value-parent"},[b.value?(d.openBlock(),d.createBlock(I,{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",nO,[d.createElementVNode("div",iO,[d.createElementVNode("div",sO,[d.createElementVNode("span",oO,d.toDisplayString(S.value),1),m.value&&f.value?(d.openBlock(),d.createElementBlock("span",rO,"  "+d.toDisplayString(f.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",aO,d.toDisplayString(h.value),1)]),e.showTrend?(d.openBlock(),d.createElementBlock("div",lO,[d.createElementVNode("div",{class:d.normalizeClass(["trend-change",x(D.value)]),"data-testid":"single-value-trend"},[M.value||D.value!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C.value),{key:0,color:_(D.value),size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(Wi.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(qh)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])),d.createElementVNode("div",null,d.toDisplayString(A.value),1)],2),d.unref(O)?(d.openBlock(),d.createElementBlock("div",cO,d.toDisplayString(d.unref(O)),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-0203459f"]]),dO={class:"simple-chart-shell"},hO={key:1,class:"analytics-chart-parent"},fO=ke(d.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator: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(()=>{const c=mt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Mn},d.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&c?.datasets.reverse(),c}),s=d.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),o=d.computed(()=>t.chartOptions.type==="gauge"),r=d.computed(()=>t.chartOptions.type==="single_value"),a=d.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),l=d.computed(()=>{const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(r.value){const u=t.chartData.meta?.metric_names?.[0];return c&&t.chartData.data[0].event[u]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",dO,[l.value?(d.openBlock(),d.createElementBlock("div",hO,[o.value?(d.openBlock(),d.createBlock(eO,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":s.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),r.value?(d.openBlock(),d.createBlock(uO,{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(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),mO={class:"top-n-card-title","data-testid":"top-n-card-title"},pO={class:"top-n-card-description","data-testid":"top-n-card-description"},gO={key:3,class:"top-n-table","data-testid":"top-n-table"},yO={"data-testid":"top-n-table-header"},bO={class:"top-n-table-header-row"},_O={class:"table-header-label"},xO=["data-testid"],wO=["data-testid"],SO=["data-testid"],TO=3,vO=ke(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}=Kn({i18n:n}),s=d.computed(()=>t.data.data),o=d.computed(()=>!!s.value?.length),r=d.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,TO):[]),a=d.computed(()=>r.value[0]||""),l=d.computed(()=>r.value.length>1),c=d.computed(()=>r.value[r.value.length-1]||""),u=d.computed(()=>a.value?t.data.meta.display[a.value]:{}),h=d.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),f=d.computed(()=>h.value[0]),m=d.computed(()=>f.value?U(f.value):""),p=d.computed(()=>{const H=r.value.map($=>({key:$,label:l.value?U($):n.t("topNTable.nameLabel"),type:"dimension"}));return f.value&&H.push({key:"value",label:m.value,type:"metric"}),h.value.forEach(($,R)=>{R!==0&&H.push({key:$,label:U($),type:"metric"})}),H}),y=d.computed(()=>p.value.filter(H=>H.type==="metric")),b=d.computed(()=>p.value.filter(H=>H.type==="dimension").slice(1)),S=H=>H.type==="dimension"&&H.key===c.value,M=H=>l.value&&H.type==="dimension"&&!S(H),E=H=>{const $=H.event;return String($[a.value])},D=(H,$)=>{const R=String(H.event[$]),B=t.data.meta?.display?.[$]?.[R];return{dimension:$,id:R,name:B?.name||"-",deleted:!!B?.deleted}},C=H=>{const $=E(H),R=u.value&&u.value[$];return R?R.name:"-"},A=H=>{const $=E(H),R=u.value&&u.value[$];return R?!!R.deleted:!1},O=(H,$)=>{const R=H.event[$];if(R==null)return"–";const B=typeof R=="number"?R:Number(R);if(Number.isNaN(B))return"–";const z=t.data.meta?.metric_units?.[$]||"count",P=["count","count/minute","token count"].includes(z);return i(B,z,{approximate:P,isBytes1024:!0,translateUnit:N=>j(N,B)})},x=H=>f.value?O(H,f.value):"–",_=d.computed(()=>s.value?.length?s.value.map(H=>{const $=r.value.map(P=>D(H,P)),R=$[0],B=R?.id||E(H),z={id:B,rowKey:$.map(P=>`${P.dimension}:${P.id}`).join("|")||B,name:R?.name||C(H),deleted:A(H),dimensions:$,original:H};return f.value&&(z.value=x(H)),h.value.forEach((P,N)=>{N!==0&&(z[P]=O(H,P))}),z}):[]),T=d.computed(()=>{if(!o.value)return"";if(t.data.meta){if(r.value.some(H=>!Object.keys(t.data.meta.display[H]||{}).length))return n.t("topNTable.errors.display");if(!f.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),k=(H,$)=>{const R=H[$];return typeof R=="string"?R:R==null?"–":String(R)},I=(H,$)=>H.dimensions.find(R=>R.dimension===$)?.name||"–",Y=(H,$)=>{const R=H.dimensions.find(B=>B.dimension===$);return{id:R?.id||"",name:R?.name||"–",deleted:R?.deleted||!1,dimension:$,dimensions:H.dimensions,isEmpty:R?.id==="empty"}},U=H=>n.te(`chartLabels.${H}`)?n.t(`chartLabels.${H}`):H,j=(H,$)=>{if(Cs(H)||H==="count"||H==="requests")return"";const R=$===1?"":"s";return n.te(`chartUnits.${H}`)?n.t(`chartUnits.${H}`,{plural:R}):H};return(H,$)=>{const R=d.resolveComponent("KEmptyState"),B=d.resolveComponent("KSkeleton"),z=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(z,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},d.createSlots({default:d.withCtx(()=>[T.value?(d.openBlock(),d.createBlock(R,{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(T.value),1)]),_:1})):e.isLoading?(d.openBlock(),d.createBlock(B,{key:1,"table-columns":2,type:"table"})):o.value?(d.openBlock(),d.createElementBlock("div",gO,[d.createElementVNode("table",{class:d.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":l.value}])},[d.createElementVNode("thead",yO,[d.createElementVNode("tr",bO,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(p.value,P=>(d.openBlock(),d.createElementBlock("th",{key:P.key,class:d.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":P.type==="metric","top-n-table-header-cell-dimension-compact":M(P)}]),"data-testid":"top-n-table-header-column"},[d.createElementVNode("span",_O,d.toDisplayString(P.label),1)],2))),128))])]),d.createElementVNode("tbody",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(_.value,P=>(d.openBlock(),d.createElementBlock("tr",{key:P.rowKey,class:"top-n-table-row"},[d.createElementVNode("td",{class:d.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":l.value}])},[d.createElementVNode("span",{"data-testid":`row-${P.id}`},[d.renderSlot(H.$slots,"name",{record:{id:P.id,name:P.name,deleted:P.deleted,dimension:a.value,dimensions:P.dimensions,isEmpty:P.id==="empty"}},()=>[d.createTextVNode(d.toDisplayString(P.name),1)],!0)],8,xO)],2),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(b.value,N=>(d.openBlock(),d.createElementBlock("td",{key:N.key,class:d.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!S(N)}])},[d.renderSlot(H.$slots,"name",{record:Y(P,N.key)},()=>[d.createTextVNode(d.toDisplayString(I(P,N.key)),1)],!0)],2))),128)),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(y.value,N=>(d.openBlock(),d.createElementBlock("td",{key:N.key,class:"top-n-table-cell top-n-table-cell-metric"},[N.key==="value"?(d.openBlock(),d.createElementBlock("span",{key:0,"data-testid":`row-${P.id}`},d.toDisplayString(k(P,N.key)),9,wO)):(d.openBlock(),d.createElementBlock("span",{key:1,"data-testid":`row-${P.id}-${N.key}`},d.toDisplayString(k(P,N.key)),9,SO))]))),128))]))),128))])],2)])):(d.openBlock(),d.createBlock(R,{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",mO,d.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",pO,d.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-bd2cedcf"]]);var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zs={exports:{}};zs.exports;var Cm;function MO(){return Cm||(Cm=1,(function(e,t){var n=200,i="Expected a function",s="__lodash_hash_undefined__",o=1,r=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",p="[object GeneratorFunction]",y="[object Map]",b="[object Number]",S="[object Object]",M="[object Promise]",E="[object RegExp]",D="[object Set]",C="[object String]",A="[object Symbol]",O="[object WeakMap]",x="[object ArrayBuffer]",_="[object DataView]",T="[object Float32Array]",k="[object Float64Array]",I="[object Int8Array]",Y="[object Int16Array]",U="[object Int32Array]",j="[object Uint8Array]",H="[object Uint8ClampedArray]",$="[object Uint16Array]",R="[object Uint32Array]",B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,P=/^\./,N=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,Q=/\\(\\)?/g,X=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,G={};G[T]=G[k]=G[I]=G[Y]=G[U]=G[j]=G[H]=G[$]=G[R]=!0,G[l]=G[c]=G[x]=G[u]=G[_]=G[h]=G[f]=G[m]=G[y]=G[b]=G[S]=G[E]=G[D]=G[C]=G[O]=!1;var J=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,nt=typeof self=="object"&&self&&self.Object===Object&&self,tt=J||nt||Function("return this")(),Z=t&&!t.nodeType&&t,pt=Z&&!0&&e&&!e.nodeType&&e,bt=pt&&pt.exports===Z,ot=bt&&J.process,gt=(function(){try{return ot&&ot.binding("util")}catch{}})(),ct=gt&&gt.isTypedArray;function $t(g,v){for(var F=-1,K=g?g.length:0;++F<K;)if(v(g[F],F,g))return!0;return!1}function lt(g){return function(v){return v?.[g]}}function Mt(g,v){for(var F=-1,K=Array(g);++F<g;)K[F]=v(F);return K}function Yt(g){return function(v){return g(v)}}function _e(g,v){return g?.[v]}function Jt(g){var v=!1;if(g!=null&&typeof g.toString!="function")try{v=!!(g+"")}catch{}return v}function Ye(g){var v=-1,F=Array(g.size);return g.forEach(function(K,ht){F[++v]=[ht,K]}),F}function Ct(g,v){return function(F){return g(v(F))}}function te(g){var v=-1,F=Array(g.size);return g.forEach(function(K){F[++v]=K}),F}var Nt=Array.prototype,jt=Function.prototype,ee=Object.prototype,je=tt["__core-js_shared__"],ni=(function(){var g=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""})(),Le=jt.toString,Ft=ee.hasOwnProperty,xe=ee.toString,ii=RegExp("^"+Le.call(Ft).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=tt.Symbol,lr=tt.Uint8Array,Us=ee.propertyIsEnumerable,si=Nt.splice,Hs=Ct(Object.keys,Object),oi=ln(tt,"DataView"),sn=ln(tt,"Map"),on=ln(tt,"Promise"),Vs=ln(tt,"Set"),Ws=ln(tt,"WeakMap"),ri=ln(Object,"create"),xl=un(oi),wl=un(sn),cr=un(on),ur=un(Vs),rn=un(Ws),Ii=ar?ar.prototype:void 0,$s=Ii?Ii.valueOf:void 0,dr=Ii?Ii.toString:void 0;function an(g){var v=-1,F=g?g.length:0;for(this.clear();++v<F;){var K=g[v];this.set(K[0],K[1])}}function Sl(){this.__data__=ri?ri(null):{}}function Ne(g){return this.has(g)&&delete this.__data__[g]}function Tl(g){var v=this.__data__;if(ri){var F=v[g];return F===s?void 0:F}return Ft.call(v,g)?v[g]:void 0}function vl(g){var v=this.__data__;return ri?v[g]!==void 0:Ft.call(v,g)}function Ml(g,v){var F=this.__data__;return F[g]=ri&&v===void 0?s:v,this}an.prototype.clear=Sl,an.prototype.delete=Ne,an.prototype.get=Tl,an.prototype.has=vl,an.prototype.set=Ml;function Fe(g){var v=-1,F=g?g.length:0;for(this.clear();++v<F;){var K=g[v];this.set(K[0],K[1])}}function kl(){this.__data__=[]}function En(g){var v=this.__data__,F=Fi(v,g);if(F<0)return!1;var K=v.length-1;return F==K?v.pop():si.call(v,F,1),!0}function Dl(g){var v=this.__data__,F=Fi(v,g);return F<0?void 0:v[F][1]}function Cl(g){return Fi(this.__data__,g)>-1}function Ol(g,v){var F=this.__data__,K=Fi(F,g);return K<0?F.push([g,v]):F[K][1]=v,this}Fe.prototype.clear=kl,Fe.prototype.delete=En,Fe.prototype.get=Dl,Fe.prototype.has=Cl,Fe.prototype.set=Ol;function Be(g){var v=-1,F=g?g.length:0;for(this.clear();++v<F;){var K=g[v];this.set(K[0],K[1])}}function El(){this.__data__={hash:new an,map:new(sn||Fe),string:new an}}function An(g){return Ui(this,g).delete(g)}function Al(g){return Ui(this,g).get(g)}function Pl(g){return Ui(this,g).has(g)}function Rl(g,v){return Ui(this,g).set(g,v),this}Be.prototype.clear=El,Be.prototype.delete=An,Be.prototype.get=Al,Be.prototype.has=Pl,Be.prototype.set=Rl;function Li(g){var v=-1,F=g?g.length:0;for(this.__data__=new Be;++v<F;)this.add(g[v])}function Il(g){return this.__data__.set(g,s),this}function Ll(g){return this.__data__.has(g)}Li.prototype.add=Li.prototype.push=Il,Li.prototype.has=Ll;function Pe(g){this.__data__=new Fe(g)}function Ni(){this.__data__=new Fe}function Nl(g){return this.__data__.delete(g)}function Ys(g){return this.__data__.get(g)}function Fl(g){return this.__data__.has(g)}function Bl(g,v){var F=this.__data__;if(F instanceof Fe){var K=F.__data__;if(!sn||K.length<n-1)return K.push([g,v]),this;F=this.__data__=new Be(K)}return F.set(g,v),this}Pe.prototype.clear=Ni,Pe.prototype.delete=Nl,Pe.prototype.get=Ys,Pe.prototype.has=Fl,Pe.prototype.set=Bl;function zl(g,v){var F=w(g)||br(g)?Mt(g.length,String):[],K=F.length,ht=!!K;for(var st in g)Ft.call(g,st)&&!(ht&&(st=="length"||qs(st,K)))&&F.push(st);return F}function Fi(g,v){for(var F=g.length;F--;)if(yr(g[F][0],v))return F;return-1}var Ul=Xl();function Hl(g,v){return g&&Ul(g,v,li)}function Bi(g,v){v=Hi(v,g)?[v]:qe(v);for(var F=0,K=v.length;g!=null&&F<K;)g=g[cn(v[F++])];return F&&F==K?g:void 0}function Vl(g){return xe.call(g)}function Wl(g,v){return g!=null&&v in Object(g)}function js(g,v,F,K,ht){return g===v?!0:g==null||v==null||!qt(g)&&!we(v)?g!==g&&v!==v:$l(g,v,js,F,K,ht)}function $l(g,v,F,K,ht,st){var yt=w(g),Gt=w(v),Bt=c,le=c;yt||(Bt=ae(g),Bt=Bt==l?S:Bt),Gt||(le=ae(v),le=le==l?S:le);var Se=Bt==S&&!Jt(g),Te=le==S&&!Jt(v),he=Bt==le;if(he&&!Se)return st||(st=new Pe),yt||_r(g)?mr(g,v,F,K,ht,st):Zl(g,v,Bt,F,K,ht,st);if(!(ht&r)){var Re=Se&&Ft.call(g,"__wrapped__"),Ie=Te&&Ft.call(v,"__wrapped__");if(Re||Ie){var In=Re?g.value():g,dn=Ie?v.value():v;return st||(st=new Pe),F(In,dn,K,ht,st)}}return he?(st||(st=new Pe),Ql(g,v,F,K,ht,st)):!1}function Yl(g,v,F,K){var ht=F.length,st=ht;if(g==null)return!st;for(g=Object(g);ht--;){var yt=F[ht];if(yt[2]?yt[1]!==g[yt[0]]:!(yt[0]in g))return!1}for(;++ht<st;){yt=F[ht];var Gt=yt[0],Bt=g[Gt],le=yt[1];if(yt[2]){if(Bt===void 0&&!(Gt in g))return!1}else{var Se=new Pe,Te;if(!(Te===void 0?js(le,Bt,K,o|r,Se):Te))return!1}}return!0}function jl(g){if(!qt(g)||pr(g))return!1;var v=it(g)||Jt(g)?ii:X;return v.test(un(g))}function ql(g){return we(g)&&Ht(g.length)&&!!G[xe.call(g)]}function hr(g){return typeof g=="function"?g:g==null?Vi:typeof g=="object"?w(g)?zi(g[0],g[1]):Kl(g):GO(g)}function Gl(g){if(!ec(g))return Hs(g);var v=[];for(var F in Object(g))Ft.call(g,F)&&F!="constructor"&&v.push(F);return v}function Kl(g){var v=Jl(g);return v.length==1&&v[0][2]?Ks(v[0][0],v[0][1]):function(F){return F===g||Yl(F,g,v)}}function zi(g,v){return Hi(g)&&gr(v)?Ks(cn(g),v):function(F){var K=xr(F,g);return K===void 0&&K===v?wr(F,g):js(v,K,void 0,o|r)}}function Pn(g){return function(v){return Bi(v,g)}}function fr(g){if(typeof g=="string")return g;if(Zt(g))return dr?dr.call(g):"";var v=g+"";return v=="0"&&1/g==-1/0?"-0":v}function qe(g){return w(g)?g:nc(g)}function Xl(g){return function(v,F,K){for(var ht=-1,st=Object(v),yt=K(v),Gt=yt.length;Gt--;){var Bt=yt[++ht];if(F(st[Bt],Bt,st)===!1)break}return v}}function mr(g,v,F,K,ht,st){var yt=ht&r,Gt=g.length,Bt=v.length;if(Gt!=Bt&&!(yt&&Bt>Gt))return!1;var le=st.get(g);if(le&&st.get(v))return le==v;var Se=-1,Te=!0,he=ht&o?new Li:void 0;for(st.set(g,v),st.set(v,g);++Se<Gt;){var Re=g[Se],Ie=v[Se];if(K)var In=yt?K(Ie,Re,Se,v,g,st):K(Re,Ie,Se,g,v,st);if(In!==void 0){if(In)continue;Te=!1;break}if(he){if(!$t(v,function(dn,ci){if(!he.has(ci)&&(Re===dn||F(Re,dn,K,ht,st)))return he.add(ci)})){Te=!1;break}}else if(!(Re===Ie||F(Re,Ie,K,ht,st))){Te=!1;break}}return st.delete(g),st.delete(v),Te}function Zl(g,v,F,K,ht,st,yt){switch(F){case _:if(g.byteLength!=v.byteLength||g.byteOffset!=v.byteOffset)return!1;g=g.buffer,v=v.buffer;case x:return!(g.byteLength!=v.byteLength||!K(new lr(g),new lr(v)));case u:case h:case b:return yr(+g,+v);case f:return g.name==v.name&&g.message==v.message;case E:case C:return g==v+"";case y:var Gt=Ye;case D:var Bt=st&r;if(Gt||(Gt=te),g.size!=v.size&&!Bt)return!1;var le=yt.get(g);if(le)return le==v;st|=o,yt.set(g,v);var Se=mr(Gt(g),Gt(v),K,ht,st,yt);return yt.delete(g),Se;case A:if($s)return $s.call(g)==$s.call(v)}return!1}function Ql(g,v,F,K,ht,st){var yt=ht&r,Gt=li(g),Bt=Gt.length,le=li(v),Se=le.length;if(Bt!=Se&&!yt)return!1;for(var Te=Bt;Te--;){var he=Gt[Te];if(!(yt?he in v:Ft.call(v,he)))return!1}var Re=st.get(g);if(Re&&st.get(v))return Re==v;var Ie=!0;st.set(g,v),st.set(v,g);for(var In=yt;++Te<Bt;){he=Gt[Te];var dn=g[he],ci=v[he];if(K)var Rm=yt?K(ci,dn,he,v,g,st):K(dn,ci,he,g,v,st);if(!(Rm===void 0?dn===ci||F(dn,ci,K,ht,st):Rm)){Ie=!1;break}In||(In=he=="constructor")}if(Ie&&!In){var Sr=g.constructor,Tr=v.constructor;Sr!=Tr&&"constructor"in g&&"constructor"in v&&!(typeof Sr=="function"&&Sr instanceof Sr&&typeof Tr=="function"&&Tr instanceof Tr)&&(Ie=!1)}return st.delete(g),st.delete(v),Ie}function Ui(g,v){var F=g.__data__;return Gs(v)?F[typeof v=="string"?"string":"hash"]:F.map}function Jl(g){for(var v=li(g),F=v.length;F--;){var K=v[F],ht=g[K];v[F]=[K,ht,gr(ht)]}return v}function ln(g,v){var F=_e(g,v);return jl(F)?F:void 0}var ae=Vl;(oi&&ae(new oi(new ArrayBuffer(1)))!=_||sn&&ae(new sn)!=y||on&&ae(on.resolve())!=M||Vs&&ae(new Vs)!=D||Ws&&ae(new Ws)!=O)&&(ae=function(g){var v=xe.call(g),F=v==S?g.constructor:void 0,K=F?un(F):void 0;if(K)switch(K){case xl:return _;case wl:return y;case cr:return M;case ur:return D;case rn:return O}return v});function tc(g,v,F){v=Hi(v,g)?[v]:qe(v);for(var K,ht=-1,yt=v.length;++ht<yt;){var st=cn(v[ht]);if(!(K=g!=null&&F(g,st)))break;g=g[st]}if(K)return K;var yt=g?g.length:0;return!!yt&&Ht(yt)&&qs(st,yt)&&(w(g)||br(g))}function qs(g,v){return v=v??a,!!v&&(typeof g=="number"||q.test(g))&&g>-1&&g%1==0&&g<v}function Hi(g,v){if(w(g))return!1;var F=typeof g;return F=="number"||F=="symbol"||F=="boolean"||g==null||Zt(g)?!0:z.test(g)||!B.test(g)||v!=null&&g in Object(v)}function Gs(g){var v=typeof g;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?g!=="__proto__":g===null}function pr(g){return!!ni&&ni in g}function ec(g){var v=g&&g.constructor,F=typeof v=="function"&&v.prototype||ee;return g===F}function gr(g){return g===g&&!qt(g)}function Ks(g,v){return function(F){return F==null?!1:F[g]===v&&(v!==void 0||g in Object(F))}}var nc=ai(function(g){g=Rn(g);var v=[];return P.test(g)&&v.push(""),g.replace(N,function(F,K,ht,st){v.push(ht?st.replace(Q,"$1"):K||F)}),v});function cn(g){if(typeof g=="string"||Zt(g))return g;var v=g+"";return v=="0"&&1/g==-1/0?"-0":v}function un(g){if(g!=null){try{return Le.call(g)}catch{}try{return g+""}catch{}}return""}function ai(g,v){if(typeof g!="function"||v&&typeof v!="function")throw new TypeError(i);var F=function(){var K=arguments,ht=v?v.apply(this,K):K[0],st=F.cache;if(st.has(ht))return st.get(ht);var yt=g.apply(this,K);return F.cache=st.set(ht,yt),yt};return F.cache=new(ai.Cache||Be),F}ai.Cache=Be;function yr(g,v){return g===v||g!==g&&v!==v}function br(g){return W(g)&&Ft.call(g,"callee")&&(!Us.call(g,"callee")||xe.call(g)==l)}var w=Array.isArray;function L(g){return g!=null&&Ht(g.length)&&!it(g)}function W(g){return we(g)&&L(g)}function it(g){var v=qt(g)?xe.call(g):"";return v==m||v==p}function Ht(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=a}function qt(g){var v=typeof g;return!!g&&(v=="object"||v=="function")}function we(g){return!!g&&typeof g=="object"}function Zt(g){return typeof g=="symbol"||we(g)&&xe.call(g)==A}var _r=ct?Yt(ct):ql;function Rn(g){return g==null?"":fr(g)}function xr(g,v,F){var K=g==null?void 0:Bi(g,v);return K===void 0?F:K}function wr(g,v){return g!=null&&tc(g,v,Wl)}function li(g){return L(g)?zl(g):Gl(g)}function Xs(g,v){var F={};return v=hr(v),Hl(g,function(K,ht,st){F[v(K,ht,st)]=K}),F}function Vi(g){return g}function GO(g){return Hi(g)?lt(cn(g)):Pn(g)}e.exports=Xs})(zs,zs.exports)),zs.exports}var kO=MO();const DO=Dm(kO);var _l,Om;function CO(){if(Om)return _l;Om=1;var e=9007199254740991,t="[object Arguments]",n="[object Function]",i="[object GeneratorFunction]",s="[object Symbol]",o=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,r=typeof self=="object"&&self&&self.Object===Object&&self,a=o||r||Function("return this")();function l(R,B,z){switch(z.length){case 0:return R.call(B);case 1:return R.call(B,z[0]);case 2:return R.call(B,z[0],z[1]);case 3:return R.call(B,z[0],z[1],z[2])}return R.apply(B,z)}function c(R,B){for(var z=-1,P=R?R.length:0,N=Array(P);++z<P;)N[z]=B(R[z],z,R);return N}function u(R,B){for(var z=-1,P=B.length,N=R.length;++z<P;)R[N+z]=B[z];return R}var h=Object.prototype,f=h.hasOwnProperty,m=h.toString,p=a.Symbol,y=h.propertyIsEnumerable,b=p?p.isConcatSpreadable:void 0,S=Math.max;function M(R,B,z,P,N){var V=-1,Q=R.length;for(z||(z=A),N||(N=[]);++V<Q;){var X=R[V];z(X)?u(N,X):N[N.length]=X}return N}function E(R,B){return R=Object(R),D(R,B,function(z,P){return P in R})}function D(R,B,z){for(var P=-1,N=B.length,V={};++P<N;){var Q=B[P],X=R[Q];z(X,Q)&&(V[Q]=X)}return V}function C(R,B){return B=S(B===void 0?R.length-1:B,0),function(){for(var z=arguments,P=-1,N=S(z.length-B,0),V=Array(N);++P<N;)V[P]=z[B+P];P=-1;for(var Q=Array(B+1);++P<B;)Q[P]=z[P];return Q[B]=V,l(R,this,Q)}}function A(R){return _(R)||x(R)||!!(b&&R&&R[b])}function O(R){if(typeof R=="string"||H(R))return R;var B=R+"";return B=="0"&&1/R==-1/0?"-0":B}function x(R){return k(R)&&f.call(R,"callee")&&(!y.call(R,"callee")||m.call(R)==t)}var _=Array.isArray;function T(R){return R!=null&&Y(R.length)&&!I(R)}function k(R){return j(R)&&T(R)}function I(R){var B=U(R)?m.call(R):"";return B==n||B==i}function Y(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=e}function U(R){var B=typeof R;return!!R&&(B=="object"||B=="function")}function j(R){return!!R&&typeof R=="object"}function H(R){return typeof R=="symbol"||j(R)&&m.call(R)==s}var $=C(function(R,B){return R==null?{}:E(R,c(M(B),O))});return _l=$,_l}var OO=CO();const EO=Dm(OO);var or={exports:{}},AO=or.exports,Em;function PO(){return Em||(Em=1,(function(e,t){(function(n,i){i()})(AO,function(){function n(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 o(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 r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ae=="object"&&Ae.global===Ae?Ae:void 0,a=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,h){var f=r.URL||r.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?o(m):s(m.href)?i(c,u,h):o(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){o(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(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(){o(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",p=/constructor/i.test(r.HTMLElement)||r.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||m&&p||a)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var E=b.result;E=y?E:E.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=E:location=E,f=null},b.readAsDataURL(c)}else{var S=r.URL||r.webkitURL,M=S.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){S.revokeObjectURL(M)},4e4)}});r.saveAs=l.saveAs=l,e.exports=l})})(or)),or.exports}var RO=PO(),rr={exports:{}};var IO=rr.exports,Am;function LO(){return Am||(Am=1,(function(e,t){((n,i)=>{e.exports=i()})(IO,function n(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,o=!i.document&&!!i.postMessage,r=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(x){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 T=C(_);T.chunkSize=parseInt(T.chunkSize),_.step||_.chunk||(T.chunkSize=null),this._handle=new y(T),(this._handle.streamer=this)._config=T}).call(this,x),this.parseChunk=function(_,T){var k=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<k){let Y=this._config.newline;Y||(I=this._config.quoteChar||'"',Y=this._handle.guessLineEndings(_,I)),_=[..._.split(Y).slice(k)].join(Y)}this.isFirstChunk&&O(this._config.beforeFirstChunk)&&(I=this._config.beforeFirstChunk(_))!==void 0&&(_=I),this.isFirstChunk=!1,this._halted=!1;var k=this._partialLine+_,I=(this._partialLine="",this._handle.parse(k,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(_=I.meta.cursor,k=(this._finished||(this._partialLine=k.substring(_-this._baseIndex),this._baseIndex=_),I&&I.data&&(this._rowCount+=I.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),r)i.postMessage({results:I,workerId:c.WORKER_ID,finished:k});else if(O(this._config.chunk)&&!T){if(this._config.chunk(I,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=I=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(I.data),this._completeResults.errors=this._completeResults.errors.concat(I.errors),this._completeResults.meta=I.meta),this._completed||!k||!O(this._config.complete)||I&&I.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),k||I&&I.meta.paused||this._nextChunk(),I}this._halted=!0},this._sendError=function(_){O(this._config.error)?this._config.error(_):r&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:_,finished:!1})}}function h(x){var _;(x=x||{}).chunkSize||(x.chunkSize=c.RemoteChunkSize),u.call(this,x),this._nextChunk=o?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(T){this._input=T,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),o||(_.onload=A(this._chunkLoaded,this),_.onerror=A(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!o),this._config.downloadRequestHeaders){var T,k=this._config.downloadRequestHeaders;for(T in k)_.setRequestHeader(T,k[T])}var I;this._config.chunkSize&&(I=this._start+this._config.chunkSize-1,_.setRequestHeader("Range","bytes="+this._start+"-"+I));try{_.send(this._config.downloadRequestBody)}catch(Y){this._chunkError(Y.message)}o&&_.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>=(T=>(T=T.getResponseHeader("Content-Range"))!==null?parseInt(T.substring(T.lastIndexOf("/")+1)):-1)(_),this.parseChunk(_.responseText)))},this._chunkError=function(T){T=_.statusText||T,this._sendError(new Error(T))}}function f(x){(x=x||{}).chunkSize||(x.chunkSize=c.LocalChunkSize),u.call(this,x);var _,T,k=typeof FileReader<"u";this.stream=function(I){this._input=I,T=I.slice||I.webkitSlice||I.mozSlice,k?((_=new FileReader).onload=A(this._chunkLoaded,this),_.onerror=A(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 I=this._input,Y=(this._config.chunkSize&&(Y=Math.min(this._start+this._config.chunkSize,this._input.size),I=T.call(I,this._start,Y)),_.readAsText(I,this._config.encoding));k||this._chunkLoaded({target:{result:Y}})},this._chunkLoaded=function(I){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(I.target.result)},this._chunkError=function(){this._sendError(_.error)}}function m(x){var _;u.call(this,x=x||{}),this.stream=function(T){return _=T,this._nextChunk()},this._nextChunk=function(){var T,k;if(!this._finished)return T=this._config.chunkSize,_=T?(k=_.substring(0,T),_.substring(T)):(k=_,""),this._finished=!_,this.parseChunk(k)}}function p(x){u.call(this,x=x||{});var _=[],T=!0,k=!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(I){this._input=I,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){k&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):T=!0},this._streamData=A(function(I){try{_.push(typeof I=="string"?I:I.toString(this._config.encoding)),T&&(T=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(Y){this._streamError(Y)}},this),this._streamError=A(function(I){this._streamCleanUp(),this._sendError(I)},this),this._streamEnd=A(function(){this._streamCleanUp(),k=!0,this._streamData("")},this),this._streamCleanUp=A(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(x){var _,T,k,I,Y=Math.pow(2,53),U=-Y,j=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,H=/^((\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,R=0,B=0,z=!1,P=!1,N=[],V={data:[],errors:[],meta:{}};function Q(J){return x.skipEmptyLines==="greedy"?J.join("").trim()==="":J.length===1&&J[0].length===0}function X(){if(V&&k&&(G("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),k=!1),x.skipEmptyLines&&(V.data=V.data.filter(function(Z){return!Q(Z)})),q()){let Z=function(pt,bt){O(x.transformHeader)&&(pt=x.transformHeader(pt,bt)),N.push(pt)};if(V)if(Array.isArray(V.data[0])){for(var J=0;q()&&J<V.data.length;J++)V.data[J].forEach(Z);V.data.splice(0,1)}else V.data.forEach(Z)}function nt(Z,pt){for(var bt=x.header?{}:[],ot=0;ot<Z.length;ot++){var gt=ot,ct=Z[ot],ct=(($t,lt)=>(Mt=>(x.dynamicTypingFunction&&x.dynamicTyping[Mt]===void 0&&(x.dynamicTyping[Mt]=x.dynamicTypingFunction(Mt)),(x.dynamicTyping[Mt]||x.dynamicTyping)===!0))($t)?lt==="true"||lt==="TRUE"||lt!=="false"&&lt!=="FALSE"&&((Mt=>{if(j.test(Mt)&&(Mt=parseFloat(Mt),U<Mt&&Mt<Y))return 1})(lt)?parseFloat(lt):H.test(lt)?new Date(lt):lt===""?null:lt):lt)(gt=x.header?ot>=N.length?"__parsed_extra":N[ot]:gt,ct=x.transform?x.transform(ct,gt):ct);gt==="__parsed_extra"?(bt[gt]=bt[gt]||[],bt[gt].push(ct)):bt[gt]=ct}return x.header&&(ot>N.length?G("FieldMismatch","TooManyFields","Too many fields: expected "+N.length+" fields but parsed "+ot,B+pt):ot<N.length&&G("FieldMismatch","TooFewFields","Too few fields: expected "+N.length+" fields but parsed "+ot,B+pt)),bt}var tt;V&&(x.header||x.dynamicTyping||x.transform)&&(tt=1,!V.data.length||Array.isArray(V.data[0])?(V.data=V.data.map(nt),tt=V.data.length):V.data=nt(V.data,0),x.header&&V.meta&&(V.meta.fields=N),B+=tt)}function q(){return x.header&&N.length===0}function G(J,nt,tt,Z){J={type:J,code:nt,message:tt},Z!==void 0&&(J.row=Z),V.errors.push(J)}O(x.step)&&(I=x.step,x.step=function(J){V=J,q()?X():(X(),V.data.length!==0&&(R+=J.data.length,x.preview&&R>x.preview?T.abort():(V.data=V.data[0],I(V,$))))}),this.parse=function(J,nt,tt){var Z=x.quoteChar||'"',Z=(x.newline||(x.newline=this.guessLineEndings(J,Z)),k=!1,x.delimiter?O(x.delimiter)&&(x.delimiter=x.delimiter(J),V.meta.delimiter=x.delimiter):((Z=((pt,bt,ot,gt,ct)=>{var $t,lt,Mt,Yt;ct=ct||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var _e=0;_e<ct.length;_e++){for(var Jt,Ye=ct[_e],Ct=0,te=0,Nt=0,jt=(Mt=void 0,new S({comments:gt,delimiter:Ye,newline:bt,preview:10}).parse(pt)),ee=0;ee<jt.data.length;ee++)ot&&Q(jt.data[ee])?Nt++:(Jt=jt.data[ee].length,te+=Jt,Mt===void 0?Mt=Jt:0<Jt&&(Ct+=Math.abs(Jt-Mt),Mt=Jt));0<jt.data.length&&(te/=jt.data.length-Nt),(lt===void 0||Ct<=lt)&&(Yt===void 0||Yt<te)&&1.99<te&&(lt=Ct,$t=Ye,Yt=te)}return{successful:!!(x.delimiter=$t),bestDelimiter:$t}})(J,x.newline,x.skipEmptyLines,x.comments,x.delimitersToGuess)).successful?x.delimiter=Z.bestDelimiter:(k=!0,x.delimiter=c.DefaultDelimiter),V.meta.delimiter=x.delimiter),C(x));return x.preview&&x.header&&Z.preview++,_=J,T=new S(Z),V=T.parse(_,nt,tt),X(),z?{meta:{paused:!0}}:V||{meta:{paused:!1}}},this.paused=function(){return z},this.pause=function(){z=!0,T.abort(),_=O(x.chunk)?"":_.substring(T.getCharIndex())},this.resume=function(){$.streamer._halted?(z=!1,$.streamer.parseChunk(_,!0)):setTimeout($.resume,3)},this.aborted=function(){return P},this.abort=function(){P=!0,T.abort(),V.meta.aborted=!0,O(x.complete)&&x.complete(V),_=""},this.guessLineEndings=function(pt,Z){pt=pt.substring(0,1048576);var Z=new RegExp(b(Z)+"([^]*?)"+b(Z),"gm"),tt=(pt=pt.replace(Z,"")).split("\r"),Z=pt.split(`
8
8
  `),pt=1<Z.length&&Z[0].length<tt[0].length;if(tt.length===1||pt)return`
9
9
  `;for(var bt=0,ot=0;ot<tt.length;ot++)tt[ot][0]===`
10
10
  `&&bt++;return bt>=tt.length/2?`\r
11
11
  `:"\r"}}function b(x){return x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function S(x){var _=(x=x||{}).delimiter,T=x.newline,k=x.comments,I=x.step,Y=x.preview,U=x.fastMode,j=null,H=!1,$=x.quoteChar==null?'"':x.quoteChar,R=$;if(x.escapeChar!==void 0&&(R=x.escapeChar),(typeof _!="string"||-1<c.BAD_DELIMITERS.indexOf(_))&&(_=","),k===_)throw new Error("Comment character same as delimiter");k===!0?k="#":(typeof k!="string"||-1<c.BAD_DELIMITERS.indexOf(k))&&(k=!1),T!==`
12
12
  `&&T!=="\r"&&T!==`\r
13
13
  `&&(T=`
14
- `);var B=0,z=!1;this.parse=function(P,N,V){if(typeof P!="string")throw new Error("Input must be a string");var Q=P.length,X=_.length,q=T.length,G=k.length,J=O(I),nt=[],tt=[],Z=[],pt=B=0;if(!P)return Ct();if(U||U!==!1&&P.indexOf($)===-1){for(var bt=P.split(T),ot=0;ot<bt.length;ot++){if(Z=bt[ot],B+=Z.length,ot!==bt.length-1)B+=T.length;else if(V)return Ct();if(!k||Z.substring(0,G)!==k){if(J){if(nt=[],Yt(Z.split(_)),te(),z)return Ct()}else Yt(Z.split(_));if(Y&&Y<=ot)return nt=nt.slice(0,Y),Ct(!0)}}return Ct()}for(var gt=P.indexOf(_,B),ct=P.indexOf(T,B),$t=new RegExp(b(R)+b($),"g"),lt=P.indexOf($,B);;)if(P[B]===$)for(lt=B,B++;;){if((lt=P.indexOf($,lt+1))===-1)return V||tt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:nt.length,index:B}),Jt();if(lt===Q-1)return Jt(P.substring(B,lt).replace($t,$));if($===R&&P[lt+1]===R)lt++;else if($===R||lt===0||P[lt-1]!==R){gt!==-1&&gt<lt+1&&(gt=P.indexOf(_,lt+1));var Mt=_e((ct=ct!==-1&&ct<lt+1?P.indexOf(T,lt+1):ct)===-1?gt:Math.min(gt,ct));if(P.substr(lt+1+Mt,X)===_){Z.push(P.substring(B,lt).replace($t,$)),P[B=lt+1+Mt+X]!==$&&(lt=P.indexOf($,B)),gt=P.indexOf(_,B),ct=P.indexOf(T,B);break}if(Mt=_e(ct),P.substring(lt+1+Mt,lt+1+Mt+q)===T){if(Z.push(P.substring(B,lt).replace($t,$)),Ye(lt+1+Mt+q),gt=P.indexOf(_,B),lt=P.indexOf($,B),J&&(te(),z))return Ct();if(Y&&nt.length>=Y)return Ct(!0);break}tt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:nt.length,index:B}),lt++}}else if(k&&Z.length===0&&P.substring(B,B+G)===k){if(ct===-1)return Ct();B=ct+q,ct=P.indexOf(T,B),gt=P.indexOf(_,B)}else if(gt!==-1&&(gt<ct||ct===-1))Z.push(P.substring(B,gt)),B=gt+X,gt=P.indexOf(_,B);else{if(ct===-1)break;if(Z.push(P.substring(B,ct)),Ye(ct+q),J&&(te(),z))return Ct();if(Y&&nt.length>=Y)return Ct(!0)}return Jt();function Yt(Nt){nt.push(Nt),pt=B}function _e(Nt){var jt=0;return jt=Nt!==-1&&(Nt=P.substring(lt+1,Nt))&&Nt.trim()===""?Nt.length:jt}function Jt(Nt){return V||(Nt===void 0&&(Nt=P.substring(B)),Z.push(Nt),B=Q,Yt(Z),J&&te()),Ct()}function Ye(Nt){B=Nt,Yt(Z),Z=[],ct=P.indexOf(T,B)}function Ct(Nt){if(x.header&&!N&&nt.length&&!H){var jt=nt[0],ee=Object.create(null),je=new Set(jt);let ei=!1;for(let Le=0;Le<jt.length;Le++){let Ft=jt[Le];if(ee[Ft=O(x.transformHeader)?x.transformHeader(Ft,Le):Ft]){let xe,ni=ee[Ft];for(;xe=Ft+"_"+ni,ni++,je.has(xe););je.add(xe),jt[Le]=xe,ee[Ft]++,ei=!0,(j=j===null?{}:j)[xe]=Ft}else ee[Ft]=1,jt[Le]=Ft;je.add(Ft)}ei&&console.warn("Duplicate headers found and renamed."),H=!0}return{data:nt,errors:tt,meta:{delimiter:_,linebreak:T,aborted:z,truncated:!!Nt,cursor:pt+(N||0),renamedHeaders:j}}}function te(){I(Ct()),nt=[],tt=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return B}}function M(x){var _=x.data,T=a[_.workerId],k=!1;if(_.error)T.userError(_.error,_.file);else if(_.results&&_.results.data){var I={abort:function(){k=!0,E(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:D,resume:D};if(O(T.userStep)){for(var Y=0;Y<_.results.data.length&&(T.userStep({data:_.results.data[Y],errors:_.results.errors,meta:_.results.meta},I),!k);Y++);delete _.results}else O(T.userChunk)&&(T.userChunk(_.results,I,_.file),delete _.results)}_.finished&&!k&&E(_.workerId,_.results)}function E(x,_){var T=a[x];O(T.userComplete)&&T.userComplete(_),T.terminate(),delete a[x]}function D(){throw new Error("Not implemented.")}function C(x){if(typeof x!="object"||x===null)return x;var _,T=Array.isArray(x)?[]:{};for(_ in x)T[_]=C(x[_]);return T}function A(x,_){return function(){x.apply(_,arguments)}}function O(x){return typeof x=="function"}return c.parse=function(x,_){var T=(_=_||{}).dynamicTyping||!1;if(O(T)&&(_.dynamicTypingFunction=T,T={}),_.dynamicTyping=T,_.transform=!!O(_.transform)&&_.transform,!_.worker||!c.WORKERS_SUPPORTED)return T=null,c.NODE_STREAM_INPUT,typeof x=="string"?(x=(k=>k.charCodeAt(0)!==65279?k:k.slice(1))(x),T=new(_.download?h:m)(_)):x.readable===!0&&O(x.read)&&O(x.on)?T=new p(_):(i.File&&x instanceof File||x instanceof Object)&&(T=new f(_)),T.stream(x);(T=(()=>{var k;return!!c.WORKERS_SUPPORTED&&(k=(()=>{var I=i.URL||i.webkitURL||null,Y=n.toString();return c.BLOB_URL||(c.BLOB_URL=I.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; ","(",Y,")();"],{type:"text/javascript"})))})(),(k=new i.Worker(k)).onmessage=M,k.id=l++,a[k.id]=k)})()).userStep=_.step,T.userChunk=_.chunk,T.userComplete=_.complete,T.userError=_.error,_.step=O(_.step),_.chunk=O(_.chunk),_.complete=O(_.complete),_.error=O(_.error),delete _.worker,T.postMessage({input:x,config:_,workerId:T.id})},c.unparse=function(x,_){var T=!1,k=!0,I=",",Y=`\r
14
+ `);var B=0,z=!1;this.parse=function(P,N,V){if(typeof P!="string")throw new Error("Input must be a string");var Q=P.length,X=_.length,q=T.length,G=k.length,J=O(I),nt=[],tt=[],Z=[],pt=B=0;if(!P)return Ct();if(U||U!==!1&&P.indexOf($)===-1){for(var bt=P.split(T),ot=0;ot<bt.length;ot++){if(Z=bt[ot],B+=Z.length,ot!==bt.length-1)B+=T.length;else if(V)return Ct();if(!k||Z.substring(0,G)!==k){if(J){if(nt=[],Yt(Z.split(_)),te(),z)return Ct()}else Yt(Z.split(_));if(Y&&Y<=ot)return nt=nt.slice(0,Y),Ct(!0)}}return Ct()}for(var gt=P.indexOf(_,B),ct=P.indexOf(T,B),$t=new RegExp(b(R)+b($),"g"),lt=P.indexOf($,B);;)if(P[B]===$)for(lt=B,B++;;){if((lt=P.indexOf($,lt+1))===-1)return V||tt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:nt.length,index:B}),Jt();if(lt===Q-1)return Jt(P.substring(B,lt).replace($t,$));if($===R&&P[lt+1]===R)lt++;else if($===R||lt===0||P[lt-1]!==R){gt!==-1&&gt<lt+1&&(gt=P.indexOf(_,lt+1));var Mt=_e((ct=ct!==-1&&ct<lt+1?P.indexOf(T,lt+1):ct)===-1?gt:Math.min(gt,ct));if(P.substr(lt+1+Mt,X)===_){Z.push(P.substring(B,lt).replace($t,$)),P[B=lt+1+Mt+X]!==$&&(lt=P.indexOf($,B)),gt=P.indexOf(_,B),ct=P.indexOf(T,B);break}if(Mt=_e(ct),P.substring(lt+1+Mt,lt+1+Mt+q)===T){if(Z.push(P.substring(B,lt).replace($t,$)),Ye(lt+1+Mt+q),gt=P.indexOf(_,B),lt=P.indexOf($,B),J&&(te(),z))return Ct();if(Y&&nt.length>=Y)return Ct(!0);break}tt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:nt.length,index:B}),lt++}}else if(k&&Z.length===0&&P.substring(B,B+G)===k){if(ct===-1)return Ct();B=ct+q,ct=P.indexOf(T,B),gt=P.indexOf(_,B)}else if(gt!==-1&&(gt<ct||ct===-1))Z.push(P.substring(B,gt)),B=gt+X,gt=P.indexOf(_,B);else{if(ct===-1)break;if(Z.push(P.substring(B,ct)),Ye(ct+q),J&&(te(),z))return Ct();if(Y&&nt.length>=Y)return Ct(!0)}return Jt();function Yt(Nt){nt.push(Nt),pt=B}function _e(Nt){var jt=0;return jt=Nt!==-1&&(Nt=P.substring(lt+1,Nt))&&Nt.trim()===""?Nt.length:jt}function Jt(Nt){return V||(Nt===void 0&&(Nt=P.substring(B)),Z.push(Nt),B=Q,Yt(Z),J&&te()),Ct()}function Ye(Nt){B=Nt,Yt(Z),Z=[],ct=P.indexOf(T,B)}function Ct(Nt){if(x.header&&!N&&nt.length&&!H){var jt=nt[0],ee=Object.create(null),je=new Set(jt);let ni=!1;for(let Le=0;Le<jt.length;Le++){let Ft=jt[Le];if(ee[Ft=O(x.transformHeader)?x.transformHeader(Ft,Le):Ft]){let xe,ii=ee[Ft];for(;xe=Ft+"_"+ii,ii++,je.has(xe););je.add(xe),jt[Le]=xe,ee[Ft]++,ni=!0,(j=j===null?{}:j)[xe]=Ft}else ee[Ft]=1,jt[Le]=Ft;je.add(Ft)}ni&&console.warn("Duplicate headers found and renamed."),H=!0}return{data:nt,errors:tt,meta:{delimiter:_,linebreak:T,aborted:z,truncated:!!Nt,cursor:pt+(N||0),renamedHeaders:j}}}function te(){I(Ct()),nt=[],tt=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return B}}function M(x){var _=x.data,T=a[_.workerId],k=!1;if(_.error)T.userError(_.error,_.file);else if(_.results&&_.results.data){var I={abort:function(){k=!0,E(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:D,resume:D};if(O(T.userStep)){for(var Y=0;Y<_.results.data.length&&(T.userStep({data:_.results.data[Y],errors:_.results.errors,meta:_.results.meta},I),!k);Y++);delete _.results}else O(T.userChunk)&&(T.userChunk(_.results,I,_.file),delete _.results)}_.finished&&!k&&E(_.workerId,_.results)}function E(x,_){var T=a[x];O(T.userComplete)&&T.userComplete(_),T.terminate(),delete a[x]}function D(){throw new Error("Not implemented.")}function C(x){if(typeof x!="object"||x===null)return x;var _,T=Array.isArray(x)?[]:{};for(_ in x)T[_]=C(x[_]);return T}function A(x,_){return function(){x.apply(_,arguments)}}function O(x){return typeof x=="function"}return c.parse=function(x,_){var T=(_=_||{}).dynamicTyping||!1;if(O(T)&&(_.dynamicTypingFunction=T,T={}),_.dynamicTyping=T,_.transform=!!O(_.transform)&&_.transform,!_.worker||!c.WORKERS_SUPPORTED)return T=null,c.NODE_STREAM_INPUT,typeof x=="string"?(x=(k=>k.charCodeAt(0)!==65279?k:k.slice(1))(x),T=new(_.download?h:m)(_)):x.readable===!0&&O(x.read)&&O(x.on)?T=new p(_):(i.File&&x instanceof File||x instanceof Object)&&(T=new f(_)),T.stream(x);(T=(()=>{var k;return!!c.WORKERS_SUPPORTED&&(k=(()=>{var I=i.URL||i.webkitURL||null,Y=n.toString();return c.BLOB_URL||(c.BLOB_URL=I.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; ","(",Y,")();"],{type:"text/javascript"})))})(),(k=new i.Worker(k)).onmessage=M,k.id=l++,a[k.id]=k)})()).userStep=_.step,T.userChunk=_.chunk,T.userComplete=_.complete,T.userError=_.error,_.step=O(_.step),_.chunk=O(_.chunk),_.complete=O(_.complete),_.error=O(_.error),delete _.worker,T.postMessage({input:x,config:_,workerId:T.id})},c.unparse=function(x,_){var T=!1,k=!0,I=",",Y=`\r
15
15
  `,U='"',j=U+U,H=!1,$=null,R=!1,B=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||c.BAD_DELIMITERS.filter(function(N){return _.delimiter.indexOf(N)!==-1}).length||(I=_.delimiter),typeof _.quotes!="boolean"&&typeof _.quotes!="function"&&!Array.isArray(_.quotes)||(T=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(H=_.skipEmptyLines),typeof _.newline=="string"&&(Y=_.newline),typeof _.quoteChar=="string"&&(U=_.quoteChar),typeof _.header=="boolean"&&(k=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");$=_.columns}_.escapeChar!==void 0&&(j=_.escapeChar+U),_.escapeFormulae instanceof RegExp?R=_.escapeFormulae:typeof _.escapeFormulae=="boolean"&&_.escapeFormulae&&(R=/^[=+\-@\t\r].*$/)}})(),new RegExp(b(U),"g"));if(typeof x=="string"&&(x=JSON.parse(x)),Array.isArray(x)){if(!x.length||Array.isArray(x[0]))return z(null,x,H);if(typeof x[0]=="object")return z($||Object.keys(x[0]),x,H)}else if(typeof x=="object")return typeof x.data=="string"&&(x.data=JSON.parse(x.data)),Array.isArray(x.data)&&(x.fields||(x.fields=x.meta&&x.meta.fields||$),x.fields||(x.fields=Array.isArray(x.data[0])?x.fields:typeof x.data[0]=="object"?Object.keys(x.data[0]):[]),Array.isArray(x.data[0])||typeof x.data[0]=="object"||(x.data=[x.data])),z(x.fields||[],x.data||[],H);throw new Error("Unable to serialize unrecognized input");function z(N,V,Q){var X="",q=(typeof N=="string"&&(N=JSON.parse(N)),typeof V=="string"&&(V=JSON.parse(V)),Array.isArray(N)&&0<N.length),G=!Array.isArray(V[0]);if(q&&k){for(var J=0;J<N.length;J++)0<J&&(X+=I),X+=P(N[J],J);0<V.length&&(X+=Y)}for(var nt=0;nt<V.length;nt++){var tt=(q?N:V[nt]).length,Z=!1,pt=q?Object.keys(V[nt]).length===0:V[nt].length===0;if(Q&&!q&&(Z=Q==="greedy"?V[nt].join("").trim()==="":V[nt].length===1&&V[nt][0].length===0),Q==="greedy"&&q){for(var bt=[],ot=0;ot<tt;ot++){var gt=G?N[ot]:ot;bt.push(V[nt][gt])}Z=bt.join("").trim()===""}if(!Z){for(var ct=0;ct<tt;ct++){0<ct&&!pt&&(X+=I);var $t=q&&G?N[ct]:ct;X+=P(V[nt][$t],ct)}nt<V.length-1&&(!Q||0<tt&&!pt)&&(X+=Y)}}return X}function P(N,V){var Q,X;return N==null?"":N.constructor===Date?JSON.stringify(N).slice(1,25):(X=!1,R&&typeof N=="string"&&R.test(N)&&(N="'"+N,X=!0),Q=N.toString().replace(B,j),(X=X||T===!0||typeof T=="function"&&T(N,V)||Array.isArray(T)&&T[V]||((q,G)=>{for(var J=0;J<G.length;J++)if(-1<q.indexOf(G[J]))return!0;return!1})(Q,c.BAD_DELIMITERS)||-1<Q.indexOf(I)||Q.charAt(0)===" "||Q.charAt(Q.length-1)===" ")?U+Q+U:Q)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
16
- `,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!o&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=S,c.ParserHandle=y,c.NetworkStreamer=h,c.FileStreamer=f,c.StringStreamer=m,c.ReadableStreamStreamer=p,i.jQuery&&((s=i.jQuery).fn.parse=function(x){var _=x.config||{},T=[];return this.each(function(Y){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 U=0;U<this.files.length;U++)T.push({file:this.files[U],inputElem:this,instanceConfig:s.extend({},_)})}),k(),this;function k(){if(T.length===0)O(x.complete)&&x.complete();else{var Y,U,j,H,$=T[0];if(O(x.before)){var R=x.before($.file,$.inputElem);if(typeof R=="object"){if(R.action==="abort")return Y="AbortError",U=$.file,j=$.inputElem,H=R.reason,void(O(x.error)&&x.error({name:Y},U,j,H));if(R.action==="skip")return void I();typeof R.config=="object"&&($.instanceConfig=s.extend($.instanceConfig,R.config))}else if(R==="skip")return void I()}var B=$.instanceConfig.complete;$.instanceConfig.complete=function(z){O(B)&&B(z,$.file,$.inputElem),I()},c.parse($.file,$.instanceConfig)}}function I(){T.splice(0,1),k()}}),r&&(i.onmessage=function(x){x=x.data,c.WORKER_ID===void 0&&x&&(c.WORKER_ID=x.workerId),typeof x.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(x.input,x.config),finished:!0}):(i.File&&x.input instanceof File||x.input instanceof Object)&&(x=c.parse(x.input,x.config))&&i.postMessage({workerId:c.WORKER_ID,results:x,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,(p.prototype=Object.create(u.prototype)).constructor=p,c})})(rr)),rr.exports}var IO=RO();const LO=["id"],NO=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,s=d.computed(()=>`export_${new Date().getTime()}`),o=d.computed(()=>{const u=l();return u.length?u:null}),r=()=>{const u=i.labels;if(typeof i.fields!==ti.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ti.Object?h=>MO(h,(f,m)=>u[m]||m):h=>h},a=()=>{const u=i.fields;if(typeof i.fields!==ti.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?h=>CO(h,u):h=>h},l=()=>{if(typeof i.fields===ti.Undefined&&typeof i.labels===ti.Undefined)return i.data;const u=r(),h=a();return i.data.map(f=>u(h(f)))},c=()=>{if(!o?.value){console.warn("No data to export");return}n("export-started",o.value);let u=IO.unparse(o.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
17
- `+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});AO.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(e.filename),1)])],8,LO))}}),FO=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(e){const t=e,n=d.computed(()=>Object.keys(t.headers));return(i,s)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(NO,{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"])]))}}),BO={class:"kong-ui-public-csv-export-modal"},zO={key:0,class:"selected-range"},UO={key:4,class:"text-muted",tag:"span"},Pm=3,HO=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(e,{emit:t}){const{i18n:n}=mt.useI18n(),i=e,s=t,o=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,r=d.ref(1),a=d.computed(()=>f.value.rows.length),l=d.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),c=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(Pm,a.value),rowsTotal:a.value,plural:a.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{if(i.exportState.status!=="success"||!l.value||!i.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const p=i.exportState.chartData,y=p.data.some(C=>C.timestamp!==p.data[0].timestamp),b=p.data.map(C=>{const A=new Date(C.timestamp);return{...Object.keys(C.event).reduce((x,_)=>{if(_ in p.meta.display){const T=C.event[_],k=p.meta.display[_];x[_]=T&&k&&k[T].name||C.event[_]}else x[_]=C.event[_];return x},{}),...y?{timestamp:Ga(A,"yyyy-MM-dd HH:mm:ss"),tzOffset:Ga(A,"XXX")}:{}}});let S=[];y&&(S=[{label:n.t("csvExport.Timestamp"),key:"timestamp"},{label:n.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},E=[...S,...Object.keys(M).map(C=>({label:n.t(`chartLabels.${C}`),key:C})),...i.exportState.chartData.meta.metric_names.map(C=>({label:n.t(`chartLabels.${C}`),key:C}))],D=E.reduce((C,A)=>(C[A.key]=A.label,C),{});return{headers:E,csvHeaders:D,rows:b}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:p}=f.value;return{total:Number(p.length)||0,data:p.slice(0,Pm)}};return d.watch(f,()=>{r.value++}),(p,y)=>{const b=d.resolveComponent("KSkeleton"),S=d.resolveComponent("KEmptyState"),M=d.resolveComponent("KTableData"),E=d.resolveComponent("KTooltip"),D=d.resolveComponent("KButton"),C=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",BO,[d.createVNode(C,{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(()=>[d.createElementVNode("div",null,[e.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",zO,[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(c.value),1)])):d.createCommentVNode("",!0),e.exportState.status==="loading"?(d.openBlock(),d.createBlock(b,{key:1,class:"chart-skeleton",type:"table"})):e.exportState.status==="success"?(d.openBlock(),d.createBlock(M,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(r.value),headers:f.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(S,{"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(S,{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"&&l.value?(d.openBlock(),d.createElementBlock("div",UO,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(E,{class:"preview-tooltip",placement:"right",text:d.unref(n).t("csvExport.maximumRecordAmount",{value:d.unref(Aw)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Wi.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]),"footer-actions":d.withCtx(()=>[d.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(FO,{class:"vitals-report-export-button",filename:o,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:e.exportState.status!=="success"||!l.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"])])}}}),VO={class:"container"},WO={key:0,class:"no-data","data-testid":"sparkline-empty"},$O=["title"],YO=ke(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:s,syncedMaxStamp:o,syncedMinCount:r,syncedMaxCount:a,syncedRenderPoints:l,syncedChartDatasets:c}=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:O,height:x})=>{u.width=O,u.height=x},f=d.computed(()=>e.disableTooltip?[]:[new vm({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),m=d.computed(()=>c.value.reduce((O,{data:x,label:_})=>({...O,[_]:x.reduce((T,{y:k})=>T+k,0)}),{})),p=d.computed(()=>c.value.map(({label:O})=>[m.value[O],`${O}: ${m.value[O]}`]).sort(([O],[x])=>x-O).map(([,O])=>O).join(", ")),y=d.computed(()=>Object.keys(m.value).map(O=>m.value[O]).reduce((O,x)=>O+x,0)),b=d.computed(()=>y.value>0),S=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),M=d.computed(()=>e.datasets.length>1),E=`SparklineTooltipPosition-${t}`,D=d.computed(()=>{const O=e.type==="sparkline_bar",x=O?s.value-1:s.value,_=O?o.value:o.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:O?0:2,right:O?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:E,external:T=>{Uh(u,T,"minutely",{contextFormatter:k=>{const I=k+i.value;let Y="";return i.value>1440*60*1e3?Y=Ao(new Date(I),"MMM dd, yyy hh:mm a"):Y=Ao(new Date(I),"hh:mm a"),`${ET(k)} - ${Y}`}})}}},scales:{x:{min:x,max:_,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:M.value},y:{min:Math.max(r.value-1,0),max:a.value,grid:{display:!1},display:!1,stacked:M.value}}}}),C=d.ref("0"),A=d.ref("0");return d.onMounted(()=>{Me.positioners[E]=function(O,x){if(!O.length||u.interactionMode==="interactive"||x.x===null)return!1;const _=10,T=this.chart.canvas.getBoundingClientRect(),k=u.width||this.width,I=u.height||this.height,Y=T.top-I>0,U=Y?T.top-I-_:T.top+T.height+_,j=T.left>k/2-x.x,H=Math.max(_,window.innerWidth-_-k),$=Math.min(H,j?Math.floor(T.left-k/2)+x.x:0+_);return C.value=`${U}px`,A.value=`${$}px`,{x:$,y:U,xAlign:"center",yAlign:Y?"top":"bottom"}}}),d.onUnmounted(()=>{Me.positioners[E]&&delete Me.positioners[E]}),(O,x)=>(d.openBlock(),d.createElementBlock("div",VO,[b.value?e.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(wm),{key:1,"chart-id":d.unref(t),data:S.value,"data-testid":"sparkline-bar",options:D.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(Tm),{key:2,"chart-id":d.unref(t),data:S.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:D.value,plugins:f.value},null,8,["chart-id","data","data-testid","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",WO,[d.renderSlot(O.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(sr,{key:3,"absolute-left":A.value,"absolute-top":C.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":e.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),b.value&&e.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:O.$slots.label?"":p.value},[d.renderSlot(O.$slots,"label",{total:y.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(p.value),1)],!0)],8,$O)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);kt.AnalyticsChart=KC,kt.ChartLegendPosition=be,kt.CsvExportModal=HO,kt.DECIMAL_DISPLAY=XT,kt.FONT_SIZE_REGULAR=Yh,kt.FONT_SIZE_SMALL=$h,kt.MAX_LABEL_LENGTH=$o,kt.SimpleChart=dO,kt.SparklineChart=YO,kt.TopNTable=SO,kt.ValidType=ti,kt.chartTypes=NC,kt.handleQueryError=bM,kt.isCancellationError=ff,kt.lookupStatusCodeColor=Xh,kt.simpleChartMetricDisplay=LC,kt.simpleChartTypes=FC,kt.statusCodeBadgeBackgroundColor=Dv,Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"})}));
16
+ `,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!o&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=S,c.ParserHandle=y,c.NetworkStreamer=h,c.FileStreamer=f,c.StringStreamer=m,c.ReadableStreamStreamer=p,i.jQuery&&((s=i.jQuery).fn.parse=function(x){var _=x.config||{},T=[];return this.each(function(Y){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 U=0;U<this.files.length;U++)T.push({file:this.files[U],inputElem:this,instanceConfig:s.extend({},_)})}),k(),this;function k(){if(T.length===0)O(x.complete)&&x.complete();else{var Y,U,j,H,$=T[0];if(O(x.before)){var R=x.before($.file,$.inputElem);if(typeof R=="object"){if(R.action==="abort")return Y="AbortError",U=$.file,j=$.inputElem,H=R.reason,void(O(x.error)&&x.error({name:Y},U,j,H));if(R.action==="skip")return void I();typeof R.config=="object"&&($.instanceConfig=s.extend($.instanceConfig,R.config))}else if(R==="skip")return void I()}var B=$.instanceConfig.complete;$.instanceConfig.complete=function(z){O(B)&&B(z,$.file,$.inputElem),I()},c.parse($.file,$.instanceConfig)}}function I(){T.splice(0,1),k()}}),r&&(i.onmessage=function(x){x=x.data,c.WORKER_ID===void 0&&x&&(c.WORKER_ID=x.workerId),typeof x.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(x.input,x.config),finished:!0}):(i.File&&x.input instanceof File||x.input instanceof Object)&&(x=c.parse(x.input,x.config))&&i.postMessage({workerId:c.WORKER_ID,results:x,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,(p.prototype=Object.create(u.prototype)).constructor=p,c})})(rr)),rr.exports}var NO=LO();const FO=["id"],BO=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,s=d.computed(()=>`export_${new Date().getTime()}`),o=d.computed(()=>{const u=l();return u.length?u:null}),r=()=>{const u=i.labels;if(typeof i.fields!==ei.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ei.Object?h=>DO(h,(f,m)=>u[m]||m):h=>h},a=()=>{const u=i.fields;if(typeof i.fields!==ei.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?h=>EO(h,u):h=>h},l=()=>{if(typeof i.fields===ei.Undefined&&typeof i.labels===ei.Undefined)return i.data;const u=r(),h=a();return i.data.map(f=>u(h(f)))},c=()=>{if(!o?.value){console.warn("No data to export");return}n("export-started",o.value);let u=NO.unparse(o.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
17
+ `+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});RO.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(e.filename),1)])],8,FO))}}),zO=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(e){const t=e,n=d.computed(()=>Object.keys(t.headers));return(i,s)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(BO,{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"])]))}}),UO={class:"kong-ui-public-csv-export-modal"},HO={key:0,class:"selected-range"},VO={key:4,class:"text-muted",tag:"span"},Pm=3,WO=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(e,{emit:t}){const{i18n:n}=mt.useI18n(),i=e,s=t,o=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,r=d.ref(1),a=d.computed(()=>f.value.rows.length),l=d.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),c=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(Pm,a.value),rowsTotal:a.value,plural:a.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{if(i.exportState.status!=="success"||!l.value||!i.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const p=i.exportState.chartData,y=p.data.some(C=>C.timestamp!==p.data[0].timestamp),b=p.data.map(C=>{const A=new Date(C.timestamp);return{...Object.keys(C.event).reduce((x,_)=>{if(_ in p.meta.display){const T=C.event[_],k=p.meta.display[_];x[_]=T&&k&&k[T].name||C.event[_]}else x[_]=C.event[_];return x},{}),...y?{timestamp:Ga(A,"yyyy-MM-dd HH:mm:ss"),tzOffset:Ga(A,"XXX")}:{}}});let S=[];y&&(S=[{label:n.t("csvExport.Timestamp"),key:"timestamp"},{label:n.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},E=[...S,...Object.keys(M).map(C=>({label:n.t(`chartLabels.${C}`),key:C})),...i.exportState.chartData.meta.metric_names.map(C=>({label:n.t(`chartLabels.${C}`),key:C}))],D=E.reduce((C,A)=>(C[A.key]=A.label,C),{});return{headers:E,csvHeaders:D,rows:b}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:p}=f.value;return{total:Number(p.length)||0,data:p.slice(0,Pm)}};return d.watch(f,()=>{r.value++}),(p,y)=>{const b=d.resolveComponent("KSkeleton"),S=d.resolveComponent("KEmptyState"),M=d.resolveComponent("KTableData"),E=d.resolveComponent("KTooltip"),D=d.resolveComponent("KButton"),C=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",UO,[d.createVNode(C,{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(()=>[d.createElementVNode("div",null,[e.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",HO,[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(c.value),1)])):d.createCommentVNode("",!0),e.exportState.status==="loading"?(d.openBlock(),d.createBlock(b,{key:1,class:"chart-skeleton",type:"table"})):e.exportState.status==="success"?(d.openBlock(),d.createBlock(M,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(r.value),headers:f.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(S,{"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(S,{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"&&l.value?(d.openBlock(),d.createElementBlock("div",VO,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(E,{class:"preview-tooltip",placement:"right",text:d.unref(n).t("csvExport.maximumRecordAmount",{value:d.unref(Aw)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Wi.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]),"footer-actions":d.withCtx(()=>[d.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(zO,{class:"vitals-report-export-button",filename:o,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:e.exportState.status!=="success"||!l.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"])])}}}),$O={class:"container"},YO={key:0,class:"no-data","data-testid":"sparkline-empty"},jO=["title"],qO=ke(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:s,syncedMaxStamp:o,syncedMinCount:r,syncedMaxCount:a,syncedRenderPoints:l,syncedChartDatasets:c}=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:O,height:x})=>{u.width=O,u.height=x},f=d.computed(()=>e.disableTooltip?[]:[new vm({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),m=d.computed(()=>c.value.reduce((O,{data:x,label:_})=>({...O,[_]:x.reduce((T,{y:k})=>T+k,0)}),{})),p=d.computed(()=>c.value.map(({label:O})=>[m.value[O],`${O}: ${m.value[O]}`]).sort(([O],[x])=>x-O).map(([,O])=>O).join(", ")),y=d.computed(()=>Object.keys(m.value).map(O=>m.value[O]).reduce((O,x)=>O+x,0)),b=d.computed(()=>y.value>0),S=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),M=d.computed(()=>e.datasets.length>1),E=`SparklineTooltipPosition-${t}`,D=d.computed(()=>{const O=e.type==="sparkline_bar",x=O?s.value-1:s.value,_=O?o.value:o.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:O?0:2,right:O?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:E,external:T=>{Uh(u,T,"minutely",{contextFormatter:k=>{const I=k+i.value;let Y="";return i.value>1440*60*1e3?Y=Ao(new Date(I),"MMM dd, yyy hh:mm a"):Y=Ao(new Date(I),"hh:mm a"),`${PT(k)} - ${Y}`}})}}},scales:{x:{min:x,max:_,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:M.value},y:{min:Math.max(r.value-1,0),max:a.value,grid:{display:!1},display:!1,stacked:M.value}}}}),C=d.ref("0"),A=d.ref("0");return d.onMounted(()=>{Me.positioners[E]=function(O,x){if(!O.length||u.interactionMode==="interactive"||x.x===null)return!1;const _=10,T=this.chart.canvas.getBoundingClientRect(),k=u.width||this.width,I=u.height||this.height,Y=T.top-I>0,U=Y?T.top-I-_:T.top+T.height+_,j=T.left>k/2-x.x,H=Math.max(_,window.innerWidth-_-k),$=Math.min(H,j?Math.floor(T.left-k/2)+x.x:0+_);return C.value=`${U}px`,A.value=`${$}px`,{x:$,y:U,xAlign:"center",yAlign:Y?"top":"bottom"}}}),d.onUnmounted(()=>{Me.positioners[E]&&delete Me.positioners[E]}),(O,x)=>(d.openBlock(),d.createElementBlock("div",$O,[b.value?e.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(wm),{key:1,"chart-id":d.unref(t),data:S.value,"data-testid":"sparkline-bar",options:D.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(Tm),{key:2,"chart-id":d.unref(t),data:S.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:D.value,plugins:f.value},null,8,["chart-id","data","data-testid","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",YO,[d.renderSlot(O.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(sr,{key:3,"absolute-left":A.value,"absolute-top":C.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":e.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),b.value&&e.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:O.$slots.label?"":p.value},[d.renderSlot(O.$slots,"label",{total:y.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(p.value),1)],!0)],8,jO)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);kt.AnalyticsChart=ZC,kt.ChartLegendPosition=be,kt.CsvExportModal=WO,kt.DECIMAL_DISPLAY=QT,kt.FONT_SIZE_REGULAR=Yh,kt.FONT_SIZE_SMALL=$h,kt.MAX_LABEL_LENGTH=$o,kt.SimpleChart=fO,kt.SparklineChart=qO,kt.TopNTable=vO,kt.ValidType=ei,kt.chartTypes=BC,kt.handleQueryError=xM,kt.isCancellationError=ff,kt.lookupStatusCodeColor=Xh,kt.simpleChartMetricDisplay=FC,kt.simpleChartTypes=zC,kt.statusCodeBadgeBackgroundColor=Ov,Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"})}));