@kong-ui-public/analytics-chart 10.24.7 → 10.24.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.
- package/dist/vitals-chart.es.js +12 -1
- package/dist/vitals-chart.umd.js +1 -1
- package/package.json +3 -3
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(Jt,p){typeof exports=="object"&&typeof module<"u"?p(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"],p):(Jt=typeof globalThis<"u"?globalThis:Jt||self,p(Jt["kong-ui-publicvitals-chart"]={},Jt.Vue,Jt["kong-ui-public-i18n"],Jt.KongIcons,Jt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Jt,p,$f,Ss,Qi){"use strict";const Tb={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}","%":"%","ops/minute":"ops/minute"},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",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate"},metricAxisTitles:{cache_hit_rate:"Cache hit rate {unit}",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",cache_eviction_rate:"Cache eviction rate in {unit}",cache_expiration_rate:"Cache expiration rate in {unit}",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max) in {unit}"},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 Mb(){const n=$f.createI18n("en-us",Tb);return{i18n:n,i18nT:$f.i18nTComponent(n)}}function Ts(n){return n+.5|0}const xi=(n,t,e)=>Math.max(Math.min(n,e),t);function Ms(n){return xi(Ts(n*2.55),0,255)}function wi(n){return xi(Ts(n*255),0,255)}function Jn(n){return xi(Ts(n/2.55)/100,0,1)}function Yf(n){return xi(Ts(n*100),0,100)}const Sn={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},uc=[..."0123456789ABCDEF"],Db=n=>uc[n&15],kb=n=>uc[(n&240)>>4]+uc[n&15],Zo=n=>(n&240)>>4===(n&15),Cb=n=>Zo(n.r)&&Zo(n.g)&&Zo(n.b)&&Zo(n.a);function Ob(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Sn[n[1]]*17,g:255&Sn[n[2]]*17,b:255&Sn[n[3]]*17,a:t===5?Sn[n[4]]*17:255}:(t===7||t===9)&&(e={r:Sn[n[1]]<<4|Sn[n[2]],g:Sn[n[3]]<<4|Sn[n[4]],b:Sn[n[5]]<<4|Sn[n[6]],a:t===9?Sn[n[7]]<<4|Sn[n[8]]:255})),e}const Ab=(n,t)=>n<255?t(n):"";function Eb(n){var t=Cb(n)?Db:kb;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Ab(n.a,t):void 0}const Rb=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Vf(n,t,e){const i=t*Math.min(e,1-e),r=(s,a=(s+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function Pb(n,t,e){const i=(r,s=(r+n/60)%6)=>e-e*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Ib(n,t,e){const i=Vf(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function Lb(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function dc(n){const e=n.r/255,i=n.g/255,r=n.b/255,s=Math.max(e,i,r),a=Math.min(e,i,r),c=(s+a)/2;let u,d,h;return s!==a&&(h=s-a,d=c>.5?h/(2-s-a):h/(s+a),u=Lb(e,i,r,h,s),u=u*60+.5),[u|0,d||0,c]}function fc(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(wi)}function hc(n,t,e){return fc(Vf,n,t,e)}function Nb(n,t,e){return fc(Ib,n,t,e)}function Fb(n,t,e){return fc(Pb,n,t,e)}function qf(n){return(n%360+360)%360}function Bb(n){const t=Rb.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Ms(+t[5]):wi(+t[5]));const r=qf(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=Nb(r,s,a):t[1]==="hsv"?i=Fb(r,s,a):i=hc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function zb(n,t){var e=dc(n);e[0]=qf(e[0]+t),e=hc(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Ub(n){if(!n)return;const t=dc(n),e=t[0],i=Yf(t[1]),r=Yf(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${Jn(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const jf={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"},Gf={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 Hb(){const n={},t=Object.keys(Gf),e=Object.keys(jf);let i,r,s,a,c;for(i=0;i<t.length;i++){for(a=c=t[i],r=0;r<e.length;r++)s=e[r],c=c.replace(s,jf[s]);s=parseInt(Gf[a],16),n[c]=[s>>16&255,s>>8&255,s&255]}return n}let Qo;function Wb(n){Qo||(Qo=Hb(),Qo.transparent=[0,0,0,0]);const t=Qo[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const $b=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Yb(n){const t=$b.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Ms(a):xi(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Ms(i):xi(i,0,255)),r=255&(t[4]?Ms(r):xi(r,0,255)),s=255&(t[6]?Ms(s):xi(s,0,255)),{r:i,g:r,b:s,a:e}}}function Vb(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Jn(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const pc=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Er=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function qb(n,t,e){const i=Er(Jn(n.r)),r=Er(Jn(n.g)),s=Er(Jn(n.b));return{r:wi(pc(i+e*(Er(Jn(t.r))-i))),g:wi(pc(r+e*(Er(Jn(t.g))-r))),b:wi(pc(s+e*(Er(Jn(t.b))-s))),a:n.a+e*(t.a-n.a)}}function Jo(n,t,e){if(n){let i=dc(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=hc(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Kf(n,t){return n&&Object.assign(t||{},n)}function Xf(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=wi(n[3]))):(t=Kf(n,{r:0,g:0,b:0,a:1}),t.a=wi(t.a)),t}function jb(n){return n.charAt(0)==="r"?Yb(n):Bb(n)}class Ds{constructor(t){if(t instanceof Ds)return t;const e=typeof t;let i;e==="object"?i=Xf(t):e==="string"&&(i=Ob(t)||Wb(t)||jb(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Kf(this._rgb);return t&&(t.a=Jn(t.a)),t}set rgb(t){this._rgb=Xf(t)}rgbString(){return this._valid?Vb(this._rgb):void 0}hexString(){return this._valid?Eb(this._rgb):void 0}hslString(){return this._valid?Ub(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let s;const a=e===s?.5:e,c=2*a-1,u=i.a-r.a,d=((c*u===-1?c:(c+u)/(1+c*u))+1)/2;s=1-d,i.r=255&d*i.r+s*r.r+.5,i.g=255&d*i.g+s*r.g+.5,i.b=255&d*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=qb(this._rgb,t._rgb,e)),this}clone(){return new Ds(this.rgb)}alpha(t){return this._rgb.a=wi(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ts(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Jo(this._rgb,2,t),this}darken(t){return Jo(this._rgb,2,-t),this}saturate(t){return Jo(this._rgb,1,t),this}desaturate(t){return Jo(this._rgb,1,-t),this}rotate(t){return zb(this._rgb,t),this}}function ti(){}const Gb=(()=>{let n=0;return()=>n++})();function Tt(n){return n==null}function Yt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Rt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function ae(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function fn(n,t){return ae(n)?n:t}function Mt(n,t){return typeof n>"u"?t:n}const Kb=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Zf=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Kt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Xt(n,t,e,i){let r,s,a;if(Yt(n))for(s=n.length,r=0;r<s;r++)t.call(e,n[r],r);else if(Rt(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function ta(n,t){let e,i,r,s;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],s=t[e],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function ea(n){if(Yt(n))return n.map(ea);if(Rt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=ea(n[e[r]]);return t}return n}function Qf(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Xb(n,t,e,i){if(!Qf(n))return;const r=t[n],s=e[n];Rt(r)&&Rt(s)?ks(r,s,i):t[n]=ea(s)}function ks(n,t,e){const i=Yt(t)?t:[t],r=i.length;if(!Rt(n))return n;e=e||{};const s=e.merger||Xb;let a;for(let c=0;c<r;++c){if(a=i[c],!Rt(a))continue;const u=Object.keys(a);for(let d=0,h=u.length;d<h;++d)s(u[d],n,a,e)}return n}function Cs(n,t){return ks(n,t,{merger:Zb})}function Zb(n,t,e){if(!Qf(n))return;const i=t[n],r=e[n];Rt(i)&&Rt(r)?Cs(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=ea(r))}const Jf={"":n=>n,x:n=>n.x,y:n=>n.y};function Qb(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Jb(n){const t=Qb(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function vi(n,t){return(Jf[t]||(Jf[t]=Jb(t)))(n)}function gc(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Je=n=>typeof n<"u",tn=n=>typeof n=="function",th=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function tx(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const At=Math.PI,te=2*At,ex=te+At,na=Number.POSITIVE_INFINITY,mc=At/180,re=At/2,Tn=At/4,ia=At*2/3,Si=Math.log10,Wn=Math.sign;function Os(n,t,e){return Math.abs(n-t)<e}function eh(n){const t=Math.round(n);n=Os(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Si(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function nx(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,s)=>r-s).pop(),t}function ix(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Ti(n){return!ix(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function rx(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function nh(n,t,e){let i,r,s;for(i=0,r=n.length;i<r;i++)s=n[i][e],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function xe(n){return n*(At/180)}function ra(n){return n*(180/At)}function ih(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function sa(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let s=Math.atan2(i,e);return s<-.5*At&&(s+=te),{angle:s,distance:r}}function Rr(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function sx(n,t){return(n-t+ex)%te-At}function Be(n){return(n%te+te)%te}function As(n,t,e,i){const r=Be(n),s=Be(t),a=Be(e),c=Be(s-r),u=Be(a-r),d=Be(r-s),h=Be(r-a);return r===s||r===a||i&&s===a||c>u&&d<h}function Ce(n,t,e){return Math.max(t,Math.min(e,n))}function ox(n){return Ce(n,-32768,32767)}function ei(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function yc(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,e(s)?r=s:i=s;return{lo:r,hi:i}}const ni=(n,t,e,i)=>yc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),ax=(n,t,e)=>yc(n,e,i=>n[i][t]>=e);function lx(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const rh=["push","pop","shift","splice","unshift"];function cx(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),rh.forEach(e=>{const i="_onData"+gc(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return n._chartjs.listeners.forEach(c=>{typeof c[i]=="function"&&c[i](...s)}),a}})})}function sh(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(rh.forEach(s=>{delete n[s]}),delete n._chartjs)}function oh(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const ah=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function lh(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,ah.call(window,()=>{i=!1,n.apply(t,e)}))}}function ux(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const _c=n=>n==="start"?"left":n==="end"?"right":"center",ze=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,dx=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function ch(n,t,e){const i=t.length;let r=0,s=i;if(n._sorted){const{iScale:a,vScale:c,_parsed:u}=n,d=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,h=a.axis,{min:g,max:y,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(ni(u,h,g).lo,e?i:ni(t,h,a.getPixelForValue(g)).lo),d){const v=u.slice(0,r+1).reverse().findIndex(S=>!Tt(S[c.axis]));r-=Math.max(0,v)}r=Ce(r,0,i-1)}if(x){let v=Math.max(ni(u,a.axis,y,!0).hi+1,e?0:ni(t,h,a.getPixelForValue(y),!0).hi+1);if(d){const S=u.slice(v-1).findIndex(C=>!Tt(C[c.axis]));v+=Math.max(0,S)}s=Ce(v,r,i)-r}else s=i-r}return{start:r,count:s}}function uh(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),s}const oa=n=>n===0||n===1,dh=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),fh=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,Es={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*re)+1,easeOutSine:n=>Math.sin(n*re),easeInOutSine:n=>-.5*(Math.cos(At*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>oa(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>oa(n)?n:dh(n,.075,.3),easeOutElastic:n=>oa(n)?n:fh(n,.075,.3),easeInOutElastic(n){return oa(n)?n:n<.5?.5*dh(n*2,.1125,.45):.5+.5*fh(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Es.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Es.easeInBounce(n*2)*.5:Es.easeOutBounce(n*2-1)*.5+.5};function bc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xc(n){return bc(n)?n:new Ds(n)}function wc(n){return bc(n)?n:new Ds(n).saturate(.5).darken(.1).hexString()}const fx=["x","y","borderWidth","radius","tension"],hx=["color","borderColor","backgroundColor"];function px(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:hx},numbers:{type:"number",properties:fx}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function gx(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const hh=new Map;function mx(n,t){t=t||{};const e=n+JSON.stringify(t);let i=hh.get(e);return i||(i=new Intl.NumberFormat(n,t),hh.set(e,i)),i}function Rs(n,t,e){return mx(t,e).format(n)}const ph={values(n){return Yt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,s=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=yx(n,e)}const a=Si(Math.abs(s)),c=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:c,maximumFractionDigits:c};return Object.assign(u,this.options.ticks.format),Rs(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Si(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?ph.numeric.call(this,n,t,e):""}};function yx(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var aa={formatters:ph};function _x(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:aa.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ji=Object.create(null),vc=Object.create(null);function Ps(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const s=e[i];n=n[s]||(n[s]=Object.create(null))}return n}function Sc(n,t,e){return typeof t=="string"?ks(Ps(n,t),e):ks(Ps(n,""),t)}class bx{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>wc(r.backgroundColor),this.hoverBorderColor=(i,r)=>wc(r.borderColor),this.hoverColor=(i,r)=>wc(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Sc(this,t,e)}get(t){return Ps(this,t)}describe(t,e){return Sc(vc,t,e)}override(t,e){return Sc(Ji,t,e)}route(t,e,i,r){const s=Ps(this,t),a=Ps(this,i),c="_"+e;Object.defineProperties(s,{[c]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[c],d=a[r];return Rt(u)?Object.assign({},d,u):Mt(u,d)},set(u){this[c]=u}}})}apply(t){t.forEach(e=>e(this))}}var se=new bx({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[px,gx,_x]);function xx(n){return!n||Tt(n.size)||Tt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function la(n,t,e,i,r){let s=t[r];return s||(s=t[r]=n.measureText(r).width,e.push(r)),s>i&&(i=s),i}function wx(n,t,e,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const c=e.length;let u,d,h,g,y;for(u=0;u<c;u++)if(g=e[u],g!=null&&!Yt(g))a=la(n,r,s,a,g);else if(Yt(g))for(d=0,h=g.length;d<h;d++)y=g[d],y!=null&&!Yt(y)&&(a=la(n,r,s,a,y));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function tr(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function gh(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Tc(n,t,e,i){mh(n,t,e,i,null)}function mh(n,t,e,i,r){let s,a,c,u,d,h,g,y;const _=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*mc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(S),n.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),n.restore();return}if(!(isNaN(v)||v<=0)){switch(n.beginPath(),_){default:r?n.ellipse(e,i,r/2,v,0,0,te):n.arc(e,i,v,0,te),n.closePath();break;case"triangle":h=r?r/2:v,n.moveTo(e+Math.sin(S)*h,i-Math.cos(S)*v),S+=ia,n.lineTo(e+Math.sin(S)*h,i-Math.cos(S)*v),S+=ia,n.lineTo(e+Math.sin(S)*h,i-Math.cos(S)*v),n.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(S+Tn)*u,g=Math.cos(S+Tn)*(r?r/2-d:u),c=Math.sin(S+Tn)*u,y=Math.sin(S+Tn)*(r?r/2-d:u),n.arc(e-g,i-c,d,S-At,S-re),n.arc(e+y,i-a,d,S-re,S),n.arc(e+g,i+c,d,S,S+re),n.arc(e-y,i+a,d,S+re,S+At),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*v,h=r?r/2:u,n.rect(e-h,i-u,2*h,2*u);break}S+=Tn;case"rectRot":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,c=Math.sin(S)*v,y=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-c),n.lineTo(e+y,i-a),n.lineTo(e+g,i+c),n.lineTo(e-y,i+a),n.closePath();break;case"crossRot":S+=Tn;case"cross":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,c=Math.sin(S)*v,y=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-c),n.lineTo(e+g,i+c),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a);break;case"star":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,c=Math.sin(S)*v,y=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-c),n.lineTo(e+g,i+c),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a),S+=Tn,g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,c=Math.sin(S)*v,y=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-c),n.lineTo(e+g,i+c),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a);break;case"line":a=r?r/2:Math.cos(S)*v,c=Math.sin(S)*v,n.moveTo(e-a,i-c),n.lineTo(e+a,i+c);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(S)*(r?r/2:v),i+Math.sin(S)*v);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ii(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Is(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ls(n){n.restore()}function vx(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const s=(t.x+e.x)/2;n.lineTo(s,t.y),n.lineTo(s,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Sx(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Tx(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),Tt(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Mx(n,t,e,i,r){if(r.strikethrough||r.underline){const s=n.measureText(i),a=t-s.actualBoundingBoxLeft,c=t+s.actualBoundingBoxRight,u=e-s.actualBoundingBoxAscent,d=e+s.actualBoundingBoxDescent,h=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,h),n.lineTo(c,h),n.stroke()}}function Dx(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function er(n,t,e,i,r,s={}){const a=Yt(t)?t:[t],c=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(n.save(),n.font=r.string,Tx(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&Dx(n,s.backdrop),c&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),Tt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),Mx(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Pr(n,t){const{x:e,y:i,w:r,h:s,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*At,At,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,At,re,!0),n.lineTo(e+r-a.bottomRight,i+s),n.arc(e+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,re,0,!0),n.lineTo(e+r,i+a.topRight),n.arc(e+r-a.topRight,i+a.topRight,a.topRight,0,-re,!0),n.lineTo(e+a.topLeft,i)}const kx=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Cx=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ox(n,t){const e=(""+n).match(kx);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Ax=n=>+n||0;function Mc(n,t){const e={},i=Rt(t),r=i?Object.keys(t):t,s=Rt(n)?i?a=>Mt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=Ax(s(a));return e}function yh(n){return Mc(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Mi(n){return Mc(n,["topLeft","topRight","bottomLeft","bottomRight"])}function we(n){const t=yh(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function le(n,t){n=n||{},t=t||se.font;let e=Mt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Mt(n.style,t.style);i&&!(""+i).match(Cx)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Mt(n.family,t.family),lineHeight:Ox(Mt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Mt(n.weight,t.weight),string:""};return r.string=xx(r),r}function Ns(n,t,e,i){let r,s,a;for(r=0,s=n.length;r<s;++r)if(a=n[r],a!==void 0&&a!==void 0)return a}function Ex(n,t,e){const{min:i,max:r}=n,s=Zf(t,(r-i)/2),a=(c,u)=>e&&c===0?0:c+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Di(n,t){return Object.assign(Object.create(n),t)}function Dc(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=vh("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:c=>Dc([c,...n],t,s,i)};return new Proxy(a,{deleteProperty(c,u){return delete c[u],delete c._keys,delete n[0][u],!0},get(c,u){return bh(c,u,()=>zx(u,t,n,c))},getOwnPropertyDescriptor(c,u){return Reflect.getOwnPropertyDescriptor(c._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(c,u){return Sh(c).includes(u)},ownKeys(c){return Sh(c)},set(c,u,d){const h=c._storage||(c._storage=r());return c[u]=h[u]=d,delete c._keys,!0}})}function Ir(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:_h(n,i),setContext:s=>Ir(n,s,e,i),override:s=>Ir(n.override(s),t,e,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete n[a],!0},get(s,a,c){return bh(s,a,()=>Px(s,a,c))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(s,a,c){return n[a]=c,delete s[a],!0}})}function _h(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:tn(e)?e:()=>e,isIndexable:tn(i)?i:()=>i}}const Rx=(n,t)=>n?n+gc(t):t,kc=(n,t)=>Rt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function bh(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Px(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let c=i[t];return tn(c)&&a.isScriptable(t)&&(c=Ix(t,c,n,e)),Yt(c)&&c.length&&(c=Lx(t,c,n,a.isIndexable)),kc(t,c)&&(c=Ir(c,r,s&&s[t],a)),c}function Ix(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_stack:c}=e;if(c.has(n))throw new Error("Recursion detected: "+Array.from(c).join("->")+"->"+n);c.add(n);let u=t(s,a||i);return c.delete(n),kc(n,u)&&(u=Cc(r._scopes,r,n,u)),u}function Lx(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:c}=e;if(typeof s.index<"u"&&i(n))return t[s.index%t.length];if(Rt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const g=Cc(d,r,n,h);t.push(Ir(g,s,a&&a[n],c))}}return t}function xh(n,t,e){return tn(n)?n(t,e):n}const Nx=(n,t)=>n===!0?t:typeof n=="string"?vi(t,n):void 0;function Fx(n,t,e,i,r){for(const s of t){const a=Nx(e,s);if(a){n.add(a);const c=xh(a._fallback,e,r);if(typeof c<"u"&&c!==e&&c!==i)return c}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function Cc(n,t,e,i){const r=t._rootScopes,s=xh(t._fallback,e,i),a=[...n,...r],c=new Set;c.add(i);let u=wh(c,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=wh(c,a,s,u,i),u===null)?!1:Dc(Array.from(c),[""],r,s,()=>Bx(t,e,i))}function wh(n,t,e,i,r){for(;e;)e=Fx(n,t,e,i,r);return e}function Bx(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return Yt(r)&&Rt(e)?e:r||{}}function zx(n,t,e,i){let r;for(const s of t)if(r=vh(Rx(s,n),e),typeof r<"u")return kc(n,r)?Cc(e,i,n,r):r}function vh(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Sh(n){let t=n._keys;return t||(t=n._keys=Ux(n._scopes)),t}function Ux(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function Th(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let c,u,d,h;for(c=0,u=i;c<u;++c)d=c+e,h=t[d],a[c]={r:r.parse(vi(h,s),d)};return a}const Hx=Number.EPSILON||1e-14,Lr=(n,t)=>t<n.length&&!n[t].skip&&n[t],Mh=n=>n==="x"?"y":"x";function Wx(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,c=Rr(s,r),u=Rr(a,s);let d=c/(c+u),h=u/(c+u);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const g=i*d,y=i*h;return{previous:{x:s.x-g*(a.x-r.x),y:s.y-g*(a.y-r.y)},next:{x:s.x+y*(a.x-r.x),y:s.y+y*(a.y-r.y)}}}function $x(n,t,e){const i=n.length;let r,s,a,c,u,d=Lr(n,0);for(let h=0;h<i-1;++h)if(u=d,d=Lr(n,h+1),!(!u||!d)){if(Os(t[h],0,Hx)){e[h]=e[h+1]=0;continue}r=e[h]/t[h],s=e[h+1]/t[h],c=Math.pow(r,2)+Math.pow(s,2),!(c<=9)&&(a=3/Math.sqrt(c),e[h]=r*a*t[h],e[h+1]=s*a*t[h])}}function Yx(n,t,e="x"){const i=Mh(e),r=n.length;let s,a,c,u=Lr(n,0);for(let d=0;d<r;++d){if(a=c,c=u,u=Lr(n,d+1),!c)continue;const h=c[e],g=c[i];a&&(s=(h-a[e])/3,c[`cp1${e}`]=h-s,c[`cp1${i}`]=g-s*t[d]),u&&(s=(u[e]-h)/3,c[`cp2${e}`]=h+s,c[`cp2${i}`]=g+s*t[d])}}function Vx(n,t="x"){const e=Mh(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,c,u,d=Lr(n,0);for(a=0;a<i;++a)if(c=u,u=d,d=Lr(n,a+1),!!u){if(d){const h=d[t]-u[t];r[a]=h!==0?(d[e]-u[e])/h:0}s[a]=c?d?Wn(r[a-1])!==Wn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}$x(n,r,s),Yx(n,s,t)}function ca(n,t,e){return Math.max(Math.min(n,e),t)}function qx(n,t){let e,i,r,s,a,c=ii(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=c,c=e<i-1&&ii(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=ca(r.cp1x,t.left,t.right),r.cp1y=ca(r.cp1y,t.top,t.bottom)),c&&(r.cp2x=ca(r.cp2x,t.left,t.right),r.cp2y=ca(r.cp2y,t.top,t.bottom)))}function jx(n,t,e,i,r){let s,a,c,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Vx(n,r);else{let d=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)c=n[s],u=Wx(d,c,n[Math.min(s+1,a-(i?0:1))%a],t.tension),c.cp1x=u.previous.x,c.cp1y=u.previous.y,c.cp2x=u.next.x,c.cp2y=u.next.y,d=c}t.capBezierPoints&&qx(n,e)}function Oc(){return typeof window<"u"&&typeof document<"u"}function Ac(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ua(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const da=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Gx(n,t){return da(n).getPropertyValue(t)}const Kx=["top","right","bottom","left"];function nr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=Kx[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Xx=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Zx(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,c,u;if(Xx(r,s,n.target))c=r,u=s;else{const d=t.getBoundingClientRect();c=i.clientX-d.left,u=i.clientY-d.top,a=!0}return{x:c,y:u,box:a}}function ki(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=da(e),s=r.boxSizing==="border-box",a=nr(r,"padding"),c=nr(r,"border","width"),{x:u,y:d,box:h}=Zx(n,e),g=a.left+(h&&c.left),y=a.top+(h&&c.top);let{width:_,height:x}=t;return s&&(_-=a.width+c.width,x-=a.height+c.height),{x:Math.round((u-g)/_*e.width/i),y:Math.round((d-y)/x*e.height/i)}}function Qx(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&Ac(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),c=da(s),u=nr(c,"border","width"),d=nr(c,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=ua(c.maxWidth,s,"clientWidth"),r=ua(c.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||na,maxHeight:r||na}}const Ci=n=>Math.round(n*10)/10;function Jx(n,t,e,i){const r=da(n),s=nr(r,"margin"),a=ua(r.maxWidth,n,"clientWidth")||na,c=ua(r.maxHeight,n,"clientHeight")||na,u=Qx(n,t,e);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const y=nr(r,"border","width"),_=nr(r,"padding");d-=_.width+y.width,h-=_.height+y.height}return d=Math.max(0,d-s.width),h=Math.max(0,i?d/i:h-s.height),d=Ci(Math.min(d,a,u.maxWidth)),h=Ci(Math.min(h,c,u.maxHeight)),d&&!h&&(h=Ci(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&h>u.height&&(h=u.height,d=Ci(Math.floor(h*i))),{width:d,height:h}}function Dh(n,t,e){const i=t||1,r=Ci(n.height*i),s=Ci(n.width*i);n.height=Ci(n.height),n.width=Ci(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(n.currentDevicePixelRatio=i,a.height=r,a.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const tw=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Oc()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function kh(n,t){const e=Gx(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ir(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function ew(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function nw(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=ir(n,r,e),c=ir(r,s,e),u=ir(s,t,e),d=ir(a,c,e),h=ir(c,u,e);return ir(d,h,e)}const iw=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},rw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Nr(n,t,e){return n?iw(t,e):rw()}function Ch(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function Oh(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Ah(n){return n==="angle"?{between:As,compare:sx,normalize:Be}:{between:ei,compare:(t,e)=>t-e,normalize:t=>t}}function Eh({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function sw(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:c}=Ah(i),u=t.length;let{start:d,end:h,loop:g}=n,y,_;if(g){for(d+=u,h+=u,y=0,_=u;y<_&&a(c(t[d%u][i]),r,s);++y)d--,h--;d%=u,h%=u}return h<d&&(h+=u),{start:d,end:h,loop:g,style:n.style}}function Rh(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:c,between:u,normalize:d}=Ah(i),{start:h,end:g,loop:y,style:_}=sw(n,t,e),x=[];let v=!1,S=null,C,E,U;const P=()=>u(r,U,C)&&c(r,U)!==0,I=()=>c(s,C)===0||u(s,U,C),B=()=>v||P(),N=()=>!v||I();for(let T=h,D=h;T<=g;++T)E=t[T%a],!E.skip&&(C=d(E[i]),C!==U&&(v=u(C,r,s),S===null&&B()&&(S=c(C,r)===0?T:D),S!==null&&N()&&(x.push(Eh({start:S,end:T,loop:y,count:a,style:_})),S=null),D=T,U=C));return S!==null&&x.push(Eh({start:S,end:g,loop:y,count:a,style:_})),x}function Ph(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=Rh(i[r],n.points,t);s.length&&e.push(...s)}return e}function ow(n,t,e,i){let r=0,s=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(s+=r);s>r&&n[s%t].skip;)s--;return s%=t,{start:r,end:s}}function aw(n,t,e,i){const r=n.length,s=[];let a=t,c=n[t],u;for(u=t+1;u<=e;++u){const d=n[u%r];d.skip||d.stop?c.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=d.stop?u:null):(a=u,c.skip&&(t=u)),c=d}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function lw(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:c}=ow(e,r,s,i);if(i===!0)return Ih(n,[{start:a,end:c,loop:s}],e,t);const u=c<a?c+r:c,d=!!n._fullLoop&&a===0&&c===r-1;return Ih(n,aw(e,a,u,d),e,t)}function Ih(n,t,e,i){return!i||!i.setContext||!e?t:cw(n,t,e,i)}function cw(n,t,e,i){const r=n._chart.getContext(),s=Lh(n.options),{_datasetIndex:a,options:{spanGaps:c}}=n,u=e.length,d=[];let h=s,g=t[0].start,y=g;function _(x,v,S,C){const E=c?-1:1;if(x!==v){for(x+=u;e[x%u].skip;)x-=E;for(;e[v%u].skip;)v+=E;x%u!==v%u&&(d.push({start:x%u,end:v%u,loop:S,style:C}),h=C,g=v%u)}}for(const x of t){g=c?g:x.start;let v=e[g%u],S;for(y=g+1;y<=x.end;y++){const C=e[y%u];S=Lh(i.setContext(Di(r,{type:"segment",p0:v,p1:C,p0DataIndex:(y-1)%u,p1DataIndex:y%u,datasetIndex:a}))),uw(S,h)&&_(g,y-1,x.loop,h),v=C,h=S}g<y-1&&_(g,y-1,x.loop,h)}return d}function Lh(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function uw(n,t){if(!t)return!1;const e=[],i=function(r,s){return bc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function fa(n,t,e){return n.options.clip?n[e]:t[e]}function dw(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:fa(e,t,"left"),right:fa(e,t,"right"),top:fa(i,t,"top"),bottom:fa(i,t,"bottom")}:t}function Nh(n,t){const e=t._clip;if(e.disabled)return!1;const i=dw(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}class fw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const s=e.listeners[r],a=e.duration;s.forEach(c=>c({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=ah.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,c=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),c=!0):(s[a]=s[s.length-1],s.pop());c&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ri=new fw;const Fh="transparent",hw={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=xc(n||Fh),r=i.valid&&xc(t||Fh);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class pw{constructor(t,e,i,r){const s=e[i];r=Ns([t.to,r,s,t.from]);const a=Ns([t.from,s,r]);this._active=!0,this._fn=t.fn||hw[t.type||typeof a],this._easing=Es[t.easing]||Es.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=Ns([t.to,e,r,t.from]),this._from=Ns([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,c=this._to;let u;if(this._active=s!==c&&(a||e<i),!this._active){this._target[r]=c,this._notify(!0);return}if(e<0){this._target[r]=s;return}u=e/i%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,c,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class Ec{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Rt(t))return;const e=Object.keys(se.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Rt(s))return;const a={};for(const c of e)a[c]=s[c];(Yt(s.properties)&&s.properties||[r]).forEach(c=>{(c===r||!i.has(c))&&i.set(c,a)})})}_animateOptions(t,e){const i=e.options,r=mw(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&gw(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),c=Date.now();let u;for(u=a.length-1;u>=0;--u){const d=a[u];if(d.charAt(0)==="$")continue;if(d==="options"){r.push(...this._animateOptions(t,e));continue}const h=e[d];let g=s[d];const y=i.get(d);if(g)if(y&&g.active()){g.update(y,h,c);continue}else g.cancel();if(!y||!y.duration){t[d]=h;continue}s[d]=g=new pw(y,t,d,h),r.push(g)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return ri.add(this._chart,i),!0}}function gw(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=n[i[r]];s&&s.active()&&e.push(s.wait())}return Promise.all(e)}function mw(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Bh(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,s=e.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function yw(n,t,e){if(e===!1)return!1;const i=Bh(n,e),r=Bh(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function _w(n){let t,e,i,r;return Rt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function zh(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)e.push(i[r].index);return e}function Uh(n,t,e,i={}){const r=n.keys,s=i.mode==="single";let a,c,u,d;if(t===null)return;let h=!1;for(a=0,c=r.length;a<c;++a){if(u=+r[a],u===e){if(h=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||Wn(t)===Wn(d))&&(t+=d)}return!h&&!i.all?0:t}function bw(n,t){const{iScale:e,vScale:i}=t,r=e.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(n),c=new Array(a.length);let u,d,h;for(u=0,d=a.length;u<d;++u)h=a[u],c[u]={[r]:h,[s]:n[h]};return c}function Rc(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function xw(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function ww(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function vw(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Hh(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=n[r.index];if(e&&s>0||!e&&s<0)return r.index}return null}function Wh(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:s,vScale:a,index:c}=i,u=s.axis,d=a.axis,h=xw(s,a,i),g=t.length;let y;for(let _=0;_<g;++_){const x=t[_],{[u]:v,[d]:S}=x,C=x._stacks||(x._stacks={});y=C[d]=vw(r,h,v),y[c]=S,y._top=Hh(y,a,!0,i.type),y._bottom=Hh(y,a,!1,i.type);const E=y._visualValues||(y._visualValues={});E[c]=S}}function Pc(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Sw(n,t){return Di(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Tw(n,t,e){return Di(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Fs(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][e]===void 0)return;delete s[i][e],s[i]._visualValues!==void 0&&s[i]._visualValues[e]!==void 0&&delete s[i]._visualValues[e]}}}const Ic=n=>n==="reset"||n==="none",$h=(n,t)=>t?n:Object.assign({},n),Mw=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:zh(e,!0),values:null};class Oi{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Rc(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&&Fs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(g,y,_,x)=>g==="x"?y:g==="r"?x:_,s=e.xAxisID=Mt(i.xAxisID,Pc(t,"x")),a=e.yAxisID=Mt(i.yAxisID,Pc(t,"y")),c=e.rAxisID=Mt(i.rAxisID,Pc(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,c),h=e.vAxisID=r(u,a,s,c);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(c),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&sh(this._data,this),t._stacked&&Fs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Rt(e)){const r=this._cachedMeta;this._data=bw(e,r)}else if(i!==e){if(i){sh(i,this);const r=this._cachedMeta;Fs(r),r._parsed=[]}e&&Object.isExtensible(e)&&cx(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=e._stacked;e._stacked=Rc(e.vScale,e),e.stack!==i.stack&&(r=!0,Fs(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(Wh(this,e._parsed),e._stacked=Rc(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,c=s.axis;let u=t===0&&e===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],h,g,y;if(this._parsing===!1)i._parsed=r,i._sorted=!0,y=r;else{Yt(r[t])?y=this.parseArrayData(i,r,t,e):Rt(r[t])?y=this.parseObjectData(i,r,t,e):y=this.parsePrimitiveData(i,r,t,e);const _=()=>g[c]===null||d&&g[c]<d[c];for(h=0;h<e;++h)i._parsed[h+t]=g=y[h],u&&(_()&&(u=!1),d=g);i._sorted=u}a&&Wh(this,y)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,c=s.axis,u=a.axis,d=s.getLabels(),h=s===a,g=new Array(r);let y,_,x;for(y=0,_=r;y<_;++y)x=y+i,g[y]={[c]:h||s.parse(d[x],x),[u]:a.parse(e[x],x)};return g}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,c=new Array(r);let u,d,h,g;for(u=0,d=r;u<d;++u)h=u+i,g=e[h],c[u]={x:s.parse(g[0],h),y:a.parse(g[1],h)};return c}parseObjectData(t,e,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:c="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let h,g,y,_;for(h=0,g=r;h<g;++h)y=h+i,_=e[y],d[h]={x:s.parse(vi(_,c),y),y:a.parse(vi(_,u),y)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,s=this._cachedMeta,a=e[t.axis],c={keys:zh(r,!0),values:e._stacks[t.axis]._visualValues};return Uh(c,a,s.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const s=i[e.axis];let a=s===null?NaN:s;const c=r&&i._stacks[e.axis];r&&c&&(r.values=c,a=Uh(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,c=this._getOtherScale(t),u=Mw(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:g}=ww(c);let y,_;function x(){_=r[y];const v=_[c.axis];return!ae(_[t.axis])||h>v||g<v}for(y=0;y<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++y);if(s){for(y=a-1;y>=0;--y)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=e.length;r<s;++r)a=e[r][t.axis],ae(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=_w(Mt(this.options.clip,yw(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],s=e.chartArea,a=[],c=this._drawStart||0,u=this._drawCount||r.length-c,d=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,s,c,u),h=c;h<c+u;++h){const g=r[h];g.hidden||(g.active&&d?a.push(g):g.draw(t,s))}for(h=0;h<a.length;++h)a[h].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=Tw(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=Sw(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",s=this._cachedDataOpts,a=t+"-"+e,c=s[a],u=this.enableOptionSharing&&Je(i);if(c)return $h(c,u);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),g=r?[`${t}Hover`,"hover",t,""]:[t,""],y=d.getOptionScopes(this.getDataset(),h),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),v=d.resolveNamedOptions(y,_,x,g);return v.$shared&&(v.$shared=u,s[a]=Object.freeze($h(v,u))),v}_resolveAnimations(t,e,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${e}`,c=s[a];if(c)return c;let u;if(r.options.animation!==!1){const h=this.chart.config,g=h.datasetAnimationScopeKeys(this._type,e),y=h.getOptionScopes(this.getDataset(),g);u=h.createResolver(y,this.getContext(t,i,e))}const d=new Ec(r,u&&u.animations);return u&&u._cacheable&&(s[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ic(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(e,s)||s!==r;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:a}}updateElement(t,e,i,r){Ic(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!Ic(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const s=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[c,u,d]of this._syncList)this[c](u,d);this._syncList=[];const r=i.length,s=e.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,e,i=!0){const r=this._cachedMeta,s=r.data,a=t+e;let c;const u=d=>{for(d.length+=e,c=d.length-1;c>=a;c--)d[c]=d[c-e]};for(u(s),c=t;c<a;++c)s[c]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Fs(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Dw(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=e.length;r<s;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=oh(i.sort((r,s)=>r-s))}return n._cache.$bar}function kw(n){const t=n.iScale,e=Dw(t,n.type);let i=t._length,r,s,a,c;const u=()=>{a===32767||a===-32768||(Je(c)&&(i=Math.min(i,Math.abs(a-c)||i)),c=a)};for(r=0,s=e.length;r<s;++r)a=t.getPixelForValue(e[r]),u();for(c=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function Cw(n,t,e,i){const r=e.barThickness;let s,a;return Tt(r)?(s=t.min*e.categoryPercentage,a=e.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[n]-s/2}}function Ow(n,t,e,i){const r=t.pixels,s=r[n];let a=n>0?r[n-1]:null,c=n<r.length-1?r[n+1]:null;const u=e.categoryPercentage;a===null&&(a=s-(c===null?t.end-t.start:c-s)),c===null&&(c=s+s-a);const d=s-(s-Math.min(a,c))/2*u;return{chunk:Math.abs(c-a)/2*u/i,ratio:e.barPercentage,start:d}}function Aw(n,t,e,i){const r=e.parse(n[0],i),s=e.parse(n[1],i),a=Math.min(r,s),c=Math.max(r,s);let u=a,d=c;Math.abs(a)>Math.abs(c)&&(u=c,d=a),t[e.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:c}}function Yh(n,t,e,i){return Yt(n)?Aw(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Vh(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),c=r===s,u=[];let d,h,g,y;for(d=e,h=e+i;d<h;++d)y=t[d],g={},g[r.axis]=c||r.parse(a[d],d),u.push(Yh(y,g,s,d));return u}function Lc(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Ew(n,t,e){return n!==0?Wn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Rw(n){let t,e,i,r,s;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:e,end:i,reverse:t,top:r,bottom:s}}function Pw(n,t,e,i){let r=t.borderSkipped;const s={};if(!r){n.borderSkipped=s;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:c,reverse:u,top:d,bottom:h}=Rw(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=h:(s[qh(h,a,c,u)]=!0,r=d)),s[qh(r,a,c,u)]=!0,n.borderSkipped=s}function qh(n,t,e,i){return i?(n=Iw(n,t,e),n=jh(n,e,t)):n=jh(n,t,e),n}function Iw(n,t,e){return n===t?e:n===e?t:n}function jh(n,t,e){return n==="start"?t:n==="end"?e:n}function Lw(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Gh extends Oi{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,e,i,r){return Vh(t,e,i,r)}parseArrayData(t,e,i,r){return Vh(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:c="x",yAxisKey:u="y"}=this._parsing,d=s.axis==="x"?c:u,h=a.axis==="x"?c:u,g=[];let y,_,x,v;for(y=i,_=i+r;y<_;++y)v=e[y],x={},x[s.axis]=s.parse(vi(v,d),y),g.push(Yh(vi(v,h),x,a,y));return g}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,s=this.getParsed(t),a=s._custom,c=Lc(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:c}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:c}}=this,u=c.getBasePixel(),d=c.isHorizontal(),h=this._getRuler(),{sharedOptions:g,includeOptions:y}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),v=s||Tt(x[c.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,h),C=(x._stacks||{})[c.axis],E={horizontal:d,base:v.base,enableBorderRadius:!C||Lc(x._custom)||a===C._top||a===C._bottom,x:d?v.head:S.center,y:d?S.center:v.head,height:d?S.size:Math.abs(v.size),width:d?Math.abs(v.size):S.size};y&&(E.options=g||this.resolveDataElementOptions(_,t[_].active?"active":r));const U=E.options||t[_].options;Pw(E,U,C,a),Lw(E,U,h.ratio),this.updateElement(t[_],_,E,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),s=i.options.stacked,a=[],c=this._cachedMeta.controller.getParsed(e),u=c&&c[i.axis],d=h=>{const g=h._parsed.find(_=>_[i.axis]===u),y=g&&g[h.vScale.axis];if(Tt(y)||isNaN(y))return!0};for(const h of r)if(!(e!==void 0&&d(h))&&((s===!1||a.indexOf(h.stack)===-1||s===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Mt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const r=this._getStacks(t,i),s=e!==void 0?r.indexOf(e):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let s,a;for(s=0,a=e.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const c=t.barThickness;return{min:c||kw(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:c?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,c=s||0,u=this.getParsed(t),d=u._custom,h=Lc(d);let g=u[e.axis],y=0,_=i?this.applyStack(e,u,i):g,x,v;_!==g&&(y=_-g,_=g),h&&(g=d.barStart,_=d.barEnd-d.barStart,g!==0&&Wn(g)!==Wn(d.barEnd)&&(y=0),y+=g);const S=!Tt(s)&&!h?s:y;let C=e.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(y+_):x=C,v=x-C,Math.abs(v)<a){v=Ew(v,e,c)*a,g===c&&(C-=v/2);const E=e.getPixelForDecimal(0),U=e.getPixelForDecimal(1),P=Math.min(E,U),I=Math.max(E,U);C=Math.max(Math.min(C,I),P),x=C+v,i&&!h&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(c)){const E=Wn(v)*e.getLineWidthForValue(c)/2;C+=E,v-=E}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=Mt(r.maxBarThickness,1/0);let c,u;const d=this._getAxisCount();if(e.grouped){const h=s?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?Ow(t,e,r,h*d):Cw(t,e,r,h*d),y=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Mt(y,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;c=g.start+g.chunk*x+g.chunk/2,u=Math.min(a,g.chunk*g.ratio)}else c=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,e.min*e.ratio);return{base:c-u/2,head:c+u/2,center:c,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[e.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class Nw extends Oi{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,e,i,r){const s=super.parsePrimitiveData(t,e,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,e,i,r){const s=super.parseArrayData(t,e,i,r);for(let a=0;a<s.length;a++){const c=e[i+a];s[a]._custom=Mt(c[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,e,i,r){const s=super.parseObjectData(t,e,i,r);for(let a=0;a<s.length;a++){const c=e[i+a];s[a]._custom=Mt(c&&c.r&&+c.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),c=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),d=a._custom;return{label:i[t]||"",value:"("+c+", "+u+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),h=a.axis,g=c.axis;for(let y=e;y<e+i;y++){const _=t[y],x=!s&&this.getParsed(y),v={},S=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[g]=s?c.getBasePixel():c.getPixelForValue(x[g]);v.skip=isNaN(S)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(y,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,y,v,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return e!=="active"&&(r.radius=0),r.radius+=Mt(i&&i._custom,s),r}}function Fw(n,t,e){let i=1,r=1,s=0,a=0;if(t<te){const c=n,u=c+t,d=Math.cos(c),h=Math.sin(c),g=Math.cos(u),y=Math.sin(u),_=(U,P,I)=>As(U,c,u,!0)?1:Math.max(P,P*e,I,I*e),x=(U,P,I)=>As(U,c,u,!0)?-1:Math.min(P,P*e,I,I*e),v=_(0,d,g),S=_(re,h,y),C=x(At,d,g),E=x(At+re,h,y);i=(v-C)/2,r=(S-E)/2,s=-(v+C)/2,a=-(S+E)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Bs extends Oi{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 e=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:c}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((u,d)=>{const g=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:g.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:g.borderDash,lineDashOffset:g.borderDashOffset,lineJoin:g.borderJoinStyle,lineWidth:g.borderWidth,strokeStyle:g.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(c||g.borderRadius),index:d}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Rt(i[t])){const{key:u="value"}=this._parsing;s=d=>+vi(i[d],u)}let a,c;for(a=t,c=t+e;a<c;++a)r._parsed[a]=s(a)}}_getRotation(){return xe(this.options.rotation-90)}_getCircumference(){return xe(this.options.circumference)}_getRotationExtents(){let t=te,e=-te;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,c=Math.max((Math.min(i.width,i.height)-a)/2,0),u=Math.min(Kb(this.options.cutout,c),1),d=this._getRingWeight(this.index),{circumference:h,rotation:g}=this._getRotationExtents(),{ratioX:y,ratioY:_,offsetX:x,offsetY:v}=Fw(g,h,u),S=(i.width-a)/y,C=(i.height-a)/_,E=Math.max(Math.min(S,C)/2,0),U=Zf(this.options.radius,E),P=Math.max(U*u,0),I=(U-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*U,this.offsetY=v*U,r.total=this.calculateTotal(),this.outerRadius=U-I*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-I*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/te)}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,c=a.chartArea,d=a.options.animation,h=(c.left+c.right)/2,g=(c.top+c.bottom)/2,y=s&&d.animateScale,_=y?0:this.innerRadius,x=y?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(e,r);let C=this._getRotation(),E;for(E=0;E<e;++E)C+=this._circumference(E,s);for(E=e;E<e+i;++E){const U=this._circumference(E,s),P=t[E],I={x:h+this.offsetX,y:g+this.offsetY,startAngle:C,endAngle:C+U,circumference:U,outerRadius:x,innerRadius:_};S&&(I.options=v||this.resolveDataElementOptions(E,P.active?"active":r)),C+=U,this.updateElement(P,E,I,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?te*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Rs(e._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,s,a,c,u;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,c=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)u=c.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);e=Math.max(e,s.offset||0,s.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Mt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Kh extends Oi{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 e=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=e,a=this.chart._animationsDisabled;let{start:c,count:u}=ch(e,r,a);this._drawStart=c,this._drawCount=u,uh(e)&&(c=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},t),this.updateElements(r,c,u,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:c,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:g}=this._getSharedOptions(e,r),y=a.axis,_=c.axis,{spanGaps:x,segment:v}=this.options,S=Ti(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",E=e+i,U=t.length;let P=e>0&&this.getParsed(e-1);for(let I=0;I<U;++I){const B=t[I],N=C?B:{};if(I<e||I>=E){N.skip=!0;continue}const T=this.getParsed(I),D=Tt(T[_]),O=N[y]=a.getPixelForValue(T[y],I),L=N[_]=s||D?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,T,u):T[_],I);N.skip=isNaN(O)||isNaN(L)||D,N.stop=I>0&&Math.abs(T[y]-P[y])>S,v&&(N.parsed=T,N.raw=d.data[I]),g&&(N.options=h||this.resolveDataElementOptions(I,B.active?"active":r)),C||this.updateElement(B,I,N,r),P=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Xh extends Oi{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 e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Rs(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return Th.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),c=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-c*this.index,this.innerRadius=this.outerRadius-c}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,g=d.yCenter,y=d.getIndexAngle(0)-.5*At;let _=y,x;const v=360/this.countVisibleElements();for(x=0;x<e;++x)_+=this._computeAngle(x,r,v);for(x=e;x<e+i;x++){const S=t[x];let C=_,E=_+this._computeAngle(x,r,v),U=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=E,s&&(u.animateScale&&(U=0),u.animateRotate&&(C=E=y));const P={x:h,y:g,innerRadius:0,outerRadius:U,startAngle:C,endAngle:E,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,P,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?xe(this.resolveDataElementOptions(t,e).angle||i):0}}class Bw extends Bs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class zw extends Oi{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 e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return Th.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],s=e.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const c={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,c,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let c=e;c<e+i;c++){const u=t[c],d=this.resolveDataElementOptions(c,u.active?"active":r),h=s.getPointPositionForValue(c,this.getParsed(c).r),g=a?s.xCenter:h.x,y=a?s.yCenter:h.y,_={x:g,y,angle:h.angle,skip:isNaN(g)||isNaN(y),options:d};this.updateElement(u,c,_,r)}}}class Uw extends Oi{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 e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),c=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+c+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:s,count:a}=ch(e,i,r);if(this._drawStart=s,this._drawCount=a,uh(e)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:c,_dataset:u}=e;c._chart=this.chart,c._datasetIndex=this.index,c._decimated=!!u._decimated,c.points=i;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(c,void 0,{animated:!r,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:c,_stacked:u,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,r),g=this.getSharedOptions(h),y=this.includeOptions(r,g),_=a.axis,x=c.axis,{spanGaps:v,segment:S}=this.options,C=Ti(v)?v:Number.POSITIVE_INFINITY,E=this.chart._animationsDisabled||s||r==="none";let U=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const I=t[P],B=this.getParsed(P),N=E?I:{},T=Tt(B[x]),D=N[_]=a.getPixelForValue(B[_],P),O=N[x]=s||T?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,B,u):B[x],P);N.skip=isNaN(D)||isNaN(O)||T,N.stop=P>0&&Math.abs(B[_]-U[_])>C,S&&(N.parsed=B,N.raw=d.data[P]),y&&(N.options=g||this.resolveDataElementOptions(P,I.active?"active":r)),E||this.updateElement(I,P,N,r),U=B}this.updateSharedOptions(g,r,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let c=0;for(let u=e.length-1;u>=0;--u)c=Math.max(c,e[u].size(this.resolveDataElementOptions(u))/2);return c>0&&c}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const s=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,s,a)/2}}var Hw=Object.freeze({__proto__:null,BarController:Gh,BubbleController:Nw,DoughnutController:Bs,LineController:Kh,PieController:Bw,PolarAreaController:Xh,RadarController:zw,ScatterController:Uw});function rr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Nc{static override(t){Object.assign(Nc.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return rr()}parse(){return rr()}format(){return rr()}add(){return rr()}diff(){return rr()}startOf(){return rr()}endOf(){return rr()}}var Zh={_date:Nc};function Ww(n,t,e,i){const{controller:r,data:s,_sorted:a}=n,c=r._cachedMeta.iScale,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(c&&t===c.axis&&t!=="r"&&a&&s.length){const d=c._reversePixels?ax:ni;if(i){if(r._sharedOptions){const h=s[0],g=typeof h.getRange=="function"&&h.getRange(t);if(g){const y=d(s,t,e-g),_=d(s,t,e+g);return{lo:y.lo,hi:_.hi}}}}else{const h=d(s,t,e);if(u){const{vScale:g}=r._cachedMeta,{_parsed:y}=n,_=y.slice(0,h.lo+1).reverse().findIndex(v=>!Tt(v[g.axis]));h.lo-=Math.max(0,_);const x=y.slice(h.hi).findIndex(v=>!Tt(v[g.axis]));h.hi+=Math.max(0,x)}return h}}return{lo:0,hi:s.length-1}}function zs(n,t,e,i,r){const s=n.getSortedVisibleDatasetMetas(),a=e[t];for(let c=0,u=s.length;c<u;++c){const{index:d,data:h}=s[c],{lo:g,hi:y}=Ww(s[c],t,a,r);for(let _=g;_<=y;++_){const x=h[_];x.skip||i(x,d,_)}}}function $w(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function Fc(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||zs(n,e,t,function(c,u,d){!r&&!ii(c,n.chartArea,0)||c.inRange(t.x,t.y,i)&&s.push({element:c,datasetIndex:u,index:d})},!0),s}function Yw(n,t,e,i){let r=[];function s(a,c,u){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:g}=sa(a,{x:t.x,y:t.y});As(g,d,h)&&r.push({element:a,datasetIndex:c,index:u})}return zs(n,e,t,s),r}function Vw(n,t,e,i,r,s){let a=[];const c=$w(e);let u=Number.POSITIVE_INFINITY;function d(h,g,y){const _=h.inRange(t.x,t.y,r);if(i&&!_)return;const x=h.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const S=c(t,x);S<u?(a=[{element:h,datasetIndex:g,index:y}],u=S):S===u&&a.push({element:h,datasetIndex:g,index:y})}return zs(n,e,t,d),a}function Bc(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?Yw(n,t,e,r):Vw(n,t,e,i,r,s)}function Qh(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let c=!1;return zs(n,e,t,(u,d,h)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:h}),c=c||u.inRange(t.x,t.y,r))}),i&&!c?[]:s}var zc={evaluateInteractionItems:zs,modes:{index(n,t,e,i){const r=ki(t,n),s=e.axis||"x",a=e.includeInvisible||!1,c=e.intersect?Fc(n,r,s,i,a):Bc(n,r,s,!1,i,a),u=[];return c.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=c[0].index,g=d.data[h];g&&!g.skip&&u.push({element:g,datasetIndex:d.index,index:h})}),u):[]},dataset(n,t,e,i){const r=ki(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let c=e.intersect?Fc(n,r,s,i,a):Bc(n,r,s,!1,i,a);if(c.length>0){const u=c[0].datasetIndex,d=n.getDatasetMeta(u).data;c=[];for(let h=0;h<d.length;++h)c.push({element:d[h],datasetIndex:u,index:h})}return c},point(n,t,e,i){const r=ki(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return Fc(n,r,s,i,a)},nearest(n,t,e,i){const r=ki(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return Bc(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=ki(t,n);return Qh(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=ki(t,n);return Qh(n,r,"y",e.intersect,i)}}};const Jh=["left","top","right","bottom"];function Us(n,t){return n.filter(e=>e.pos===t)}function tp(n,t){return n.filter(e=>Jh.indexOf(e.pos)===-1&&e.box.axis===t)}function Hs(n,t){return n.sort((e,i)=>{const r=t?i:e,s=t?e:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function qw(n){const t=[];let e,i,r,s,a,c;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:s,options:{stack:a,stackWeight:c=1}}=r,t.push({index:e,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:c});return t}function jw(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Jh.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function Gw(n,t){const e=jw(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,c;for(s=0,a=n.length;s<a;++s){c=n[s];const{fullSize:u}=c.box,d=e[c.stack],h=d&&c.stackWeight/d.weight;c.horizontal?(c.width=h?h*i:u&&t.availableWidth,c.height=r):(c.width=i,c.height=h?h*r:u&&t.availableHeight)}return e}function Kw(n){const t=qw(n),e=Hs(t.filter(d=>d.box.fullSize),!0),i=Hs(Us(t,"left"),!0),r=Hs(Us(t,"right")),s=Hs(Us(t,"top"),!0),a=Hs(Us(t,"bottom")),c=tp(t,"x"),u=tp(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(c),chartArea:Us(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(c)}}function ep(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function np(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Xw(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!Rt(r)){e.size&&(n[r]-=e.size);const g=i[e.stack]||{size:0,count:1};g.size=Math.max(g.size,e.horizontal?s.height:s.width),e.size=g.size/g.count,n[r]+=e.size}s.getPadding&&np(a,s.getPadding());const c=Math.max(0,t.outerWidth-ep(a,n,"left","right")),u=Math.max(0,t.outerHeight-ep(a,n,"top","bottom")),d=c!==n.w,h=u!==n.h;return n.w=c,n.h=u,e.horizontal?{same:d,other:h}:{same:h,other:d}}function Zw(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Qw(n,t){const e=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],e[a])}),s}return i(n?["left","right"]:["top","bottom"])}function Ws(n,t,e,i){const r=[];let s,a,c,u,d,h;for(s=0,a=n.length,d=0;s<a;++s){c=n[s],u=c.box,u.update(c.width||t.w,c.height||t.h,Qw(c.horizontal,t));const{same:g,other:y}=Xw(t,e,c,i);d|=g&&r.length,h=h||y,u.fullSize||r.push(c)}return d&&Ws(r,t,e,i)||h}function ha(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function ip(n,t,e,i){const r=e.padding;let{x:s,y:a}=t;for(const c of n){const u=c.box,d=i[c.stack]||{placed:0,weight:1},h=c.stackWeight/d.weight||1;if(c.horizontal){const g=t.w*h,y=d.size||u.height;Je(d.start)&&(a=d.start),u.fullSize?ha(u,r.left,a,e.outerWidth-r.right-r.left,y):ha(u,t.left+d.placed,a,g,y),d.start=a,d.placed+=g,a=u.bottom}else{const g=t.h*h,y=d.size||u.width;Je(d.start)&&(s=d.start),u.fullSize?ha(u,s,r.top,y,e.outerHeight-r.bottom-r.top):ha(u,s,t.top+d.placed,y,g),d.start=s,d.placed+=g,s=u.right}}t.x=s,t.y=a}var Ue={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=we(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),c=Kw(n.boxes),u=c.vertical,d=c.horizontal;Xt(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const h=u.reduce((v,S)=>S.box.options&&S.box.options.display===!1?v:v+1,0)||1,g=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),y=Object.assign({},r);np(y,we(i));const _=Object.assign({maxPadding:y,w:s,h:a,x:r.left,y:r.top},r),x=Gw(u.concat(d),g);Ws(c.fullSize,_,g,x),Ws(u,_,g,x),Ws(d,_,g,x)&&Ws(u,_,g,x),Zw(_),ip(c.leftAndTop,_,g,x),_.x+=_.w,_.y+=_.h,ip(c.rightAndBottom,_,g,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Xt(c.chartArea,v=>{const S=v.box;Object.assign(S,n.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class rp{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class Jw extends rp{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pa="$chartjs",tv={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},sp=n=>n===null||n==="";function ev(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[pa]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",sp(r)){const s=kh(n,"width");s!==void 0&&(n.width=s)}if(sp(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=kh(n,"height");s!==void 0&&(n.height=s)}return n}const op=tw?{passive:!0}:!1;function nv(n,t,e){n&&n.addEventListener(t,e,op)}function iv(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,op)}function rv(n,t){const e=tv[n.type]||n.type,{x:i,y:r}=ki(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function ga(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function sv(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const c of s)a=a||ga(c.addedNodes,i),a=a&&!ga(c.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function ov(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const c of s)a=a||ga(c.removedNodes,i),a=a&&!ga(c.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const $s=new Map;let ap=0;function lp(){const n=window.devicePixelRatio;n!==ap&&(ap=n,$s.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function av(n,t){$s.size||window.addEventListener("resize",lp),$s.set(n,t)}function lv(n){$s.delete(n),$s.size||window.removeEventListener("resize",lp)}function cv(n,t,e){const i=n.canvas,r=i&&Ac(i);if(!r)return;const s=lh((c,u)=>{const d=r.clientWidth;e(c,u),d<r.clientWidth&&e()},window),a=new ResizeObserver(c=>{const u=c[0],d=u.contentRect.width,h=u.contentRect.height;d===0&&h===0||s(d,h)});return a.observe(r),av(n,s),a}function Uc(n,t,e){e&&e.disconnect(),t==="resize"&&lv(n)}function uv(n,t,e){const i=n.canvas,r=lh(s=>{n.ctx!==null&&e(rv(s,n))},n);return nv(i,t,r),r}class dv extends rp{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ev(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[pa])return!1;const i=e[pa].initial;["height","width"].forEach(s=>{const a=i[s];Tt(a)?e.removeAttribute(s):e.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{e.style[s]=r[s]}),e.width=e.width,delete e[pa],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:sv,detach:ov,resize:cv}[e]||uv;r[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:Uc,detach:Uc,resize:Uc}[e]||iv)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Jx(t,e,i,r)}isAttached(t){const e=t&&Ac(t);return!!(e&&e.isConnected)}}function fv(n){return!Oc()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Jw:dv}class He{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ti(this.x)&&Ti(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function hv(n,t){const e=n.options.ticks,i=pv(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?mv(t):[],a=s.length,c=s[0],u=s[a-1],d=[];if(a>r)return yv(t,d,s,a/r),d;const h=gv(s,t,r);if(a>0){let g,y;const _=a>1?Math.round((u-c)/(a-1)):null;for(ma(t,d,h,Tt(_)?0:c-_,c),g=0,y=a-1;g<y;g++)ma(t,d,h,s[g],s[g+1]);return ma(t,d,h,u,Tt(_)?t.length:u+_),d}return ma(t,d,h),d}function pv(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function gv(n,t,e){const i=_v(n),r=t.length/e;if(!i)return Math.max(r,1);const s=nx(i);for(let a=0,c=s.length-1;a<c;a++){const u=s[a];if(u>r)return u}return Math.max(r,1)}function mv(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function yv(n,t,e,i){let r=0,s=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===s&&(t.push(n[a]),r++,s=e[r*i])}function ma(n,t,e,i,r){const s=Mt(i,0),a=Math.min(Mt(r,n.length),n.length);let c=0,u,d,h;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),h=s;h<0;)c++,h=Math.round(s+c*e);for(d=Math.max(s,0);d<a;d++)d===h&&(t.push(n[d]),c++,h=Math.round(s+c*e))}function _v(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const bv=n=>n==="left"?"right":n==="right"?"left":n,cp=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,up=(n,t)=>Math.min(t||n,n);function dp(n,t){const e=[],i=n.length/t,r=n.length;let s=0;for(;s<r;s+=i)e.push(n[Math.floor(s)]);return e}function xv(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),s=n._startPixel,a=n._endPixel,c=1e-6;let u=n.getPixelForTick(r),d;if(!(e&&(i===1?d=Math.max(u-s,a-u):t===0?d=(n.getPixelForTick(1)-u)/2:d=(u-n.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-c||u>a+c)))return u}function wv(n,t){Xt(n,e=>{const i=e.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete e.data[i[s]];i.splice(0,r)}})}function Ys(n){return n.drawTicks?n.tickLength:0}function fp(n,t){if(!n.display)return 0;const e=le(n.font,t),i=we(n.padding);return(Yt(n.text)?n.text.length:1)*e.lineHeight+i.height}function vv(n,t){return Di(n,{scale:t,type:"scale"})}function Sv(n,t,e){return Di(n,{tick:e,index:t,type:"tick"})}function Tv(n,t,e){let i=_c(n);return(e&&t!=="right"||!e&&t==="right")&&(i=bv(i)),i}function Mv(n,t,e,i){const{top:r,left:s,bottom:a,right:c,chart:u}=n,{chartArea:d,scales:h}=u;let g=0,y,_,x;const v=a-r,S=c-s;if(n.isHorizontal()){if(_=ze(i,s,c),Rt(e)){const C=Object.keys(e)[0],E=e[C];x=h[C].getPixelForValue(E)+v-t}else e==="center"?x=(d.bottom+d.top)/2+v-t:x=cp(n,e,t);y=c-s}else{if(Rt(e)){const C=Object.keys(e)[0],E=e[C];_=h[C].getPixelForValue(E)-S+t}else e==="center"?_=(d.left+d.right)/2-S+t:_=cp(n,e,t);x=ze(i,a,r),g=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:y,rotation:g}}class sr extends He{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=fn(t,Number.POSITIVE_INFINITY),e=fn(e,Number.NEGATIVE_INFINITY),i=fn(i,Number.POSITIVE_INFINITY),r=fn(r,Number.NEGATIVE_INFINITY),{min:fn(t,i),max:fn(e,r),minDefined:ae(t),maxDefined:ae(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:e,max:i};const c=this.getMatchingVisibleMetas();for(let u=0,d=c.length;u<d;++u)a=c[u].controller.getMinMax(this,t),r||(e=Math.min(e,a.min)),s||(i=Math.max(i,a.max));return e=s&&e>i?i:e,i=r&&e>i?e:i,{min:fn(e,fn(i,e)),max:fn(i,fn(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Kt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,c=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ex(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=c<this.ticks.length;this._convertTicksToLabels(u?dp(this.ticks,c):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=hv(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Kt(this.options.afterUpdate,[this])}beforeSetDimensions(){Kt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Kt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Kt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Kt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Kt(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Kt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Kt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=up(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,s=e.maxRotation;let a=r,c,u,d;if(!this._isVisible()||!e.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const h=this._getLabelSizes(),g=h.widest.width,y=h.highest.height,_=Ce(this.chart.width-g,0,this.maxWidth);c=t.offset?this.maxWidth/i:_/(i-1),g+6>c&&(c=_/(i-(t.offset?.5:1)),u=this.maxHeight-Ys(t.grid)-e.padding-fp(t.title,this.chart.options.font),d=Math.sqrt(g*g+y*y),a=ra(Math.min(Math.asin(Ce((h.highest.height+6)/c,-1,1)),Math.asin(Ce(u/d,-1,1))-Math.asin(Ce(y/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Kt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Kt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),c=this.isHorizontal();if(a){const u=fp(r,e.options.font);if(c?(t.width=this.maxWidth,t.height=Ys(s)+u):(t.height=this.maxHeight,t.width=Ys(s)+u),i.display&&this.ticks.length){const{first:d,last:h,widest:g,highest:y}=this._getLabelSizes(),_=i.padding*2,x=xe(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(c){const C=i.mirror?0:S*g.width+v*y.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*g.width+S*y.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,h,S,v)}}this._handleMargins(),c?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:s,padding:a},position:c}=this.options,u=this.labelRotation!==0,d=c!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let y=0,_=0;u?d?(y=r*t.width,_=i*e.height):(y=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?y=t.width:s!=="inner"&&(y=t.width/2,_=e.width/2),this.paddingLeft=Math.max((y-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((_-g+a)*this.width/(this.width-g),0)}else{let h=e.height/2,g=t.height/2;s==="start"?(h=0,g=t.height):s==="end"&&(h=e.height,g=0),this.paddingTop=h+a,this.paddingBottom=g+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Kt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)Tt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=dp(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:s}=this,a=[],c=[],u=Math.floor(e/up(e,i));let d=0,h=0,g,y,_,x,v,S,C,E,U,P,I;for(g=0;g<e;g+=u){if(x=t[g].label,v=this._resolveTickFontOptions(g),r.font=S=v.string,C=s[S]=s[S]||{data:{},gc:[]},E=v.lineHeight,U=P=0,!Tt(x)&&!Yt(x))U=la(r,C.data,C.gc,U,x),P=E;else if(Yt(x))for(y=0,_=x.length;y<_;++y)I=x[y],!Tt(I)&&!Yt(I)&&(U=la(r,C.data,C.gc,U,I),P+=E);a.push(U),c.push(P),d=Math.max(U,d),h=Math.max(P,h)}wv(s,e);const B=a.indexOf(d),N=c.indexOf(h),T=D=>({width:a[D]||0,height:c[D]||0});return{first:T(0),last:T(e-1),widest:T(B),highest:T(N),widths:a,heights:c}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ox(this._alignToPixels?tr(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Sv(this.getContext(),t,i))}return this.$context||(this.$context=vv(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=xe(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,c=s?s.widest.width+a:0,u=s?s.highest.height+a:0;return this.isHorizontal()?u*i>c*r?c/i:u/r:u*r<c*i?u/i:c/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:c}=r,u=s.offset,d=this.isHorizontal(),g=this.ticks.length+(u?1:0),y=Ys(s),_=[],x=c.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,C=function(X){return tr(i,X,v)};let E,U,P,I,B,N,T,D,O,L,W,tt;if(a==="top")E=C(this.bottom),N=this.bottom-y,D=E-S,L=C(t.top)+S,tt=t.bottom;else if(a==="bottom")E=C(this.top),L=t.top,tt=C(t.bottom)-S,N=E+S,D=this.top+y;else if(a==="left")E=C(this.right),B=this.right-y,T=E-S,O=C(t.left)+S,W=t.right;else if(a==="right")E=C(this.left),O=t.left,W=C(t.right)-S,B=E+S,T=this.left+y;else if(e==="x"){if(a==="center")E=C((t.top+t.bottom)/2+.5);else if(Rt(a)){const X=Object.keys(a)[0],Q=a[X];E=C(this.chart.scales[X].getPixelForValue(Q))}L=t.top,tt=t.bottom,N=E+S,D=N+y}else if(e==="y"){if(a==="center")E=C((t.left+t.right)/2);else if(Rt(a)){const X=Object.keys(a)[0],Q=a[X];E=C(this.chart.scales[X].getPixelForValue(Q))}B=E-S,T=B-y,O=t.left,W=t.right}const G=Mt(r.ticks.maxTicksLimit,g),nt=Math.max(1,Math.ceil(g/G));for(U=0;U<g;U+=nt){const X=this.getContext(U),Q=s.setContext(X),rt=c.setContext(X),st=Q.lineWidth,ot=Q.color,H=rt.dash||[],V=rt.dashOffset,J=Q.tickWidth,_t=Q.tickColor,pt=Q.tickBorderDash||[],it=Q.tickBorderDashOffset;P=xv(this,U,u),P!==void 0&&(I=tr(i,P,st),d?B=T=O=W=I:N=D=L=tt=I,_.push({tx1:B,ty1:N,tx2:T,ty2:D,x1:O,y1:L,x2:W,y2:tt,width:st,color:ot,borderDash:H,borderDashOffset:V,tickWidth:J,tickColor:_t,tickBorderDash:pt,tickBorderDashOffset:it}))}return this._ticksLength=g,this._borderValue=E,_}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),c=this.ticks,{align:u,crossAlign:d,padding:h,mirror:g}=s,y=Ys(i.grid),_=y+h,x=g?-h:_,v=-xe(this.labelRotation),S=[];let C,E,U,P,I,B,N,T,D,O,L,W,tt="middle";if(r==="top")B=this.bottom-x,N=this._getXAxisLabelAlignment();else if(r==="bottom")B=this.top+x,N=this._getXAxisLabelAlignment();else if(r==="left"){const nt=this._getYAxisLabelAlignment(y);N=nt.textAlign,I=nt.x}else if(r==="right"){const nt=this._getYAxisLabelAlignment(y);N=nt.textAlign,I=nt.x}else if(e==="x"){if(r==="center")B=(t.top+t.bottom)/2+_;else if(Rt(r)){const nt=Object.keys(r)[0],X=r[nt];B=this.chart.scales[nt].getPixelForValue(X)+_}N=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")I=(t.left+t.right)/2-_;else if(Rt(r)){const nt=Object.keys(r)[0],X=r[nt];I=this.chart.scales[nt].getPixelForValue(X)}N=this._getYAxisLabelAlignment(y).textAlign}e==="y"&&(u==="start"?tt="top":u==="end"&&(tt="bottom"));const G=this._getLabelSizes();for(C=0,E=c.length;C<E;++C){U=c[C],P=U.label;const nt=s.setContext(this.getContext(C));T=this.getPixelForTick(C)+s.labelOffset,D=this._resolveTickFontOptions(C),O=D.lineHeight,L=Yt(P)?P.length:1;const X=L/2,Q=nt.color,rt=nt.textStrokeColor,st=nt.textStrokeWidth;let ot=N;a?(I=T,N==="inner"&&(C===E-1?ot=this.options.reverse?"left":"right":C===0?ot=this.options.reverse?"right":"left":ot="center"),r==="top"?d==="near"||v!==0?W=-L*O+O/2:d==="center"?W=-G.highest.height/2-X*O+O:W=-G.highest.height+O/2:d==="near"||v!==0?W=O/2:d==="center"?W=G.highest.height/2-X*O:W=G.highest.height-L*O,g&&(W*=-1),v!==0&&!nt.showLabelBackdrop&&(I+=O/2*Math.sin(v))):(B=T,W=(1-L)*O/2);let H;if(nt.showLabelBackdrop){const V=we(nt.backdropPadding),J=G.heights[C],_t=G.widths[C];let pt=W-V.top,it=0-V.left;switch(tt){case"middle":pt-=J/2;break;case"bottom":pt-=J;break}switch(N){case"center":it-=_t/2;break;case"right":it-=_t;break;case"inner":C===E-1?it-=_t:C>0&&(it-=_t/2);break}H={left:it,top:pt,width:_t+V.width,height:J+V.height,color:nt.backdropColor}}S.push({label:P,font:D,textOffset:W,options:{rotation:v,color:Q,strokeColor:rt,strokeWidth:st,textAlign:ot,textBaseline:tt,translation:[I,B],backdrop:H}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),c=t+s,u=a.widest.width;let d,h;return e==="left"?r?(h=this.right+s,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h+=u)):(h=this.right-c,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h=this.left)):e==="right"?r?(h=this.left+s,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h-=u)):(h=this.left+c,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:s,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const c=(u,d,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(e.display)for(s=0,a=r.length;s<a;++s){const u=r[s];e.drawOnChartArea&&c({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&c({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const c=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let d,h,g,y;this.isHorizontal()?(d=tr(t,this.left,a)-a/2,h=tr(t,this.right,c)+c/2,g=y=u):(g=tr(t,this.top,a)-a/2,y=tr(t,this.bottom,c)+c/2,d=h=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,g),e.lineTo(h,y),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Is(i,r);const s=this.getLabelItems(t);for(const a of s){const c=a.options,u=a.font,d=a.label,h=a.textOffset;er(i,d,0,h,u,c)}r&&Ls(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=we(i.padding),c=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||Rt(e)?(u+=a.bottom,Yt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:g,rotation:y}=Mv(this,u,e,c);er(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:y,textAlign:Tv(c,e,r),textBaseline:"middle",translation:[d,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Mt(t.grid&&t.grid.z,-1),r=Mt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==sr.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=e.length;s<a;++s){const c=e[s];c[i]===this.id&&(!t||c.type===t)&&r.push(c)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return le(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ya{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Cv(e)&&(i=this.register(e));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,Dv(t,a,i),this.override&&se.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in se[r]&&(delete se[r][i],this.override&&delete Ji[i])}}function Dv(n,t,e){const i=ks(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&kv(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function kv(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),s=[n].concat(i).join("."),a=t[e].split("."),c=a.pop(),u=a.join(".");se.route(s,r,u,c)})}function Cv(n){return"id"in n&&"defaults"in n}class Ov{constructor(){this.controllers=new ya(Oi,"datasets",!0),this.elements=new ya(He,"elements"),this.plugins=new ya(Object,"plugins"),this.scales=new ya(sr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Xt(r,a=>{const c=i||this._getRegistryForType(a);this._exec(t,c,a)})})}_exec(t,e,i){const r=gc(t);Kt(i["before"+r],[],i),e[t](i),Kt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var $n=new Ov;class Av{constructor(){this._init=void 0}notify(t,e,i,r){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,e,i);return e==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,r){r=r||{};for(const s of t){const a=s.plugin,c=a[i],u=[e,r,s.options];if(Kt(c,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){Tt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=Mt(i.options&&i.options.plugins,{}),s=Ev(i);return r===!1&&!e?[]:Pv(t,s,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(c=>!a.some(u=>c.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function Ev(n){const t={},e=[],i=Object.keys($n.plugins.items);for(let s=0;s<i.length;s++)e.push($n.getPlugin(i[s]));const r=n.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Rv(n,t){return!t&&n===!1?null:n===!0?{}:n}function Pv(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const c of t){const u=c.id,d=Rv(i[u],r);d!==null&&s.push({plugin:c,options:Iv(n.config,{plugin:c,local:e[u]},d,a)})}return s}function Iv(n,{plugin:t,local:e},i,r){const s=n.pluginScopeKeys(t),a=n.getOptionScopes(i,s);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Hc(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Lv(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Nv(n,t){return n===t?"_index_":"_value_"}function hp(n){if(n==="x"||n==="y"||n==="r")return n}function Fv(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Wc(n,...t){if(hp(n))return n;for(const e of t){const i=e.axis||Fv(e.position)||n.length>1&&hp(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function pp(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Bv(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return pp(n,"x",e[0])||pp(n,"y",e[0])}return{}}function zv(n,t){const e=Ji[n.type]||{scales:{}},i=t.scales||{},r=Hc(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const c=i[a];if(!Rt(c))return console.error(`Invalid scale configuration for scale: ${a}`);if(c._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=Wc(a,c,Bv(a,n),se.scales[c.type]),d=Nv(u,r),h=e.scales||{};s[a]=Cs(Object.create(null),[{axis:u},c,h[u],h[d]])}),n.data.datasets.forEach(a=>{const c=a.type||n.type,u=a.indexAxis||Hc(c,t),h=(Ji[c]||{}).scales||{};Object.keys(h).forEach(g=>{const y=Lv(g,u),_=a[y+"AxisID"]||y;s[_]=s[_]||Object.create(null),Cs(s[_],[{axis:y},i[_],h[g]])})}),Object.keys(s).forEach(a=>{const c=s[a];Cs(c,[se.scales[c.type],se.scale])}),s}function gp(n){const t=n.options||(n.options={});t.plugins=Mt(t.plugins,{}),t.scales=zv(n,t)}function mp(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Uv(n){return n=n||{},n.data=mp(n.data),gp(n),n}const yp=new Map,_p=new Set;function _a(n,t){let e=yp.get(n);return e||(e=t(),yp.set(n,e),_p.add(e)),e}const Vs=(n,t,e)=>{const i=vi(t,e);i!==void 0&&n.add(i)};class Hv{constructor(t){this._config=Uv(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=mp(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(),gp(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _a(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return _a(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return _a(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return _a(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),c=a.get(e);if(c)return c;const u=new Set;e.forEach(h=>{t&&(u.add(t),h.forEach(g=>Vs(u,t,g))),h.forEach(g=>Vs(u,r,g)),h.forEach(g=>Vs(u,Ji[s]||{},g)),h.forEach(g=>Vs(u,se,g)),h.forEach(g=>Vs(u,vc,g))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),_p.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ji[e]||{},se.datasets[e]||{},{type:e},se,vc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:c}=bp(this._resolverCache,t,r);let u=a;if($v(a,e)){s.$shared=!1,i=tn(i)?i():i;const d=this.createResolver(t,i,c);u=Ir(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=bp(this._resolverCache,t,i);return Rt(e)?Ir(s,e,void 0,r):s}}function bp(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let s=i.get(r);return s||(s={resolver:Dc(t,e),subPrefixes:e.filter(c=>!c.toLowerCase().includes("hover"))},i.set(r,s)),s}const Wv=n=>Rt(n)&&Object.getOwnPropertyNames(n).some(t=>tn(n[t]));function $v(n,t){const{isScriptable:e,isIndexable:i}=_h(n);for(const r of t){const s=e(r),a=i(r),c=(a||s)&&n[r];if(s&&(tn(c)||Wv(c))||a&&Yt(c))return!0}return!1}var Yv="4.5.1";const Vv=["top","bottom","left","right","chartArea"];function xp(n,t){return n==="top"||n==="bottom"||Vv.indexOf(n)===-1&&t==="x"}function wp(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function vp(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Kt(e&&e.onComplete,[n],t)}function qv(n){const t=n.chart,e=t.options.animation;Kt(e&&e.onProgress,[n],t)}function Sp(n){return Oc()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ba={},Tp=n=>{const t=Sp(n);return Object.values(ba).filter(e=>e.canvas===t).pop()};function jv(n,t,e){const i=Object.keys(n);for(const r of i){const s=+r;if(s>=t){const a=n[r];delete n[r],(e>0||s>t)&&(n[s+e]=a)}}}function Gv(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let en=class{static defaults=se;static instances=ba;static overrides=Ji;static registry=$n;static version=Yv;static getChart=Tp;static register(...t){$n.add(...t),Mp()}static unregister(...t){$n.remove(...t),Mp()}constructor(t,e){const i=this.config=new Hv(e),r=Sp(t),s=Tp(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||fv(r)),this.platform.updateConfig(i);const c=this.platform.acquireContext(r,a.aspectRatio),u=c&&c.canvas,d=u&&u.height,h=u&&u.width;if(this.id=Gb(),this.ctx=c,this.canvas=u,this.width=h,this.height=d,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Av,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ux(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],ba[this.id]=this,!c||!u){console.error("Failed to create chart: can't acquire context from the given item");return}ri.listen(this,"complete",vp),ri.listen(this,"progress",qv),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return Tt(t)?e&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return $n}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Dh(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return gh(this.canvas,this.ctx),this}stop(){return ri.stop(this),this}resize(t,e){ri.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,e,s),c=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Dh(this,c,!0)&&(this.notifyPlugins("resize",{size:a}),Kt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Xt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((a,c)=>(a[c]=!1,a),{});let s=[];e&&(s=s.concat(Object.keys(e).map(a=>{const c=e[a],u=Wc(a,c),d=u==="r",h=u==="x";return{options:c,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Xt(s,a=>{const c=a.options,u=c.id,d=Wc(u,c),h=Mt(c.type,a.dtype);(c.position===void 0||xp(c.position,d)!==xp(a.dposition))&&(c.position=a.dposition),r[u]=!0;let g=null;if(u in i&&i[u].type===h)g=i[u];else{const y=$n.getScale(h);g=new y({id:u,type:h,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(c,t)}),Xt(r,(a,c)=>{a||delete i[c]}),Xt(i,a=>{Ue.configure(this,a,a.options),Ue.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(wp("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const s=e[i];let a=this.getDatasetMeta(i);const c=s.type||this.config.type;if(a.type&&a.type!==c&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=c,a.indexAxis=s.indexAxis||Hc(c,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const u=$n.getController(c),{datasetElementType:d,dataElementType:h}=se.datasets[c];Object.assign(u,{dataElementType:$n.getElement(h),datasetElementType:d&&$n.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Xt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,h=this.data.datasets.length;d<h;d++){const{controller:g}=this.getDatasetMeta(d),y=!r&&s.indexOf(g)===-1;g.buildOrUpdateElements(y),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Xt(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(wp("z","_idx"));const{_active:c,_lastEvent:u}=this;u?this._eventHandler(u,!0):c.length&&this._updateHoverStyles(c,c,!0),this.render()}_updateScales(){Xt(this.scales,t=>{Ue.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!th(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of e){const a=i==="_removeElements"?-s:s;jv(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,c)=>c+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<e;s++)if(!th(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ue.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Xt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,tn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ri.has(this)?this.attached&&!ri.running(this)&&ri.start(this):(this.draw(),vp({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,s;for(r=0,s=e.length;r<s;++r){const a=e[r];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=Nh(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&Is(e,r),t.controller.draw(),r&&Ls(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ii(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=zc.modes[e];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Di(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);Je(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(c=>c.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ri.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),gh(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(s,a)=>{e.addEventListener(this,s,a),t[s]=a},r=(s,a,c)=>{s.offsetX=a,s.offsetY=c,this._eventHandler(s)};Xt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,d)=>{e.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(e.removeEventListener(this,u,d),delete t[u])},s=(u,d)=>{this.canvas&&this.resize(u,d)};let a;const c=()=>{r("attach",c),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",c)},e.isAttached(this.canvas)?c():a()}unbindEvents(){Xt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Xt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let s,a,c,u;for(e==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),c=0,u=t.length;c<u;++c){a=t[c];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const c=this.getDatasetMeta(s);if(!c)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:c.data[a],index:a}});!ta(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,s=(u,d)=>u.filter(h=>!d.some(g=>h.datasetIndex===g.datasetIndex&&h.index===g.index)),a=s(e,t),c=i?t:s(t,e);a.length&&this.updateHoverStyle(a,r.mode,!1),c.length&&r.mode&&this.updateHoverStyle(c,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:s}=this,a=e,c=this._getActiveElements(t,r,i,a),u=tx(t),d=Gv(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Kt(s.onHover,[t,c,this],this),u&&Kt(s.onClick,[t,c,this],this));const h=!ta(c,r);return(h||e)&&(this._active=c,this._updateHoverStyles(c,r,e)),this._lastEvent=d,h}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function Mp(){return Xt(en.instances,n=>n._plugins.invalidate())}function Kv(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:c,options:u}=t,{borderWidth:d,borderJoinStyle:h}=u,g=Math.min(d/a,Be(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+g/2,e-g/2),c>0){const y=Math.min(d/c,Be(i-e));n.arc(r,s,c+d/2,e-y/2,i+y/2,!0)}else{const y=Math.min(d/2,a*Be(i-e));if(h==="round")n.arc(r,s,y,e-At/2,i+At/2,!0);else if(h==="bevel"){const _=2*y*y,x=-_*Math.cos(e+At/2)+r,v=-_*Math.sin(e+At/2)+s,S=_*Math.cos(i+At/2)+r,C=_*Math.sin(i+At/2)+s;n.lineTo(x,v),n.lineTo(S,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function Xv(n,t,e){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:c,innerRadius:u}=t;let d=r/c;n.beginPath(),n.arc(s,a,c,i-d,e+d),u>r?(d=r/u,n.arc(s,a,u,e+d,i-d,!0)):n.arc(s,a,r,e+re,i-re),n.closePath(),n.clip()}function Zv(n){return Mc(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Qv(n,t,e,i){const r=Zv(n.options.borderRadius),s=(e-t)/2,a=Math.min(s,i*t/2),c=u=>{const d=(e-Math.min(s,u))*i/2;return Ce(u,0,Math.min(s,d))};return{outerStart:c(r.outerStart),outerEnd:c(r.outerEnd),innerStart:Ce(r.innerStart,0,a),innerEnd:Ce(r.innerEnd,0,a)}}function Fr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function xa(n,t,e,i,r,s){const{x:a,y:c,startAngle:u,pixelMargin:d,innerRadius:h}=t,g=Math.max(t.outerRadius+i+e-d,0),y=h>0?h+i+e+d:0;let _=0;const x=r-u;if(i){const nt=h>0?h-i:0,X=g>0?g-i:0,Q=(nt+X)/2,rt=Q!==0?x*Q/(Q+i):x;_=(x-rt)/2}const v=Math.max(.001,x*g-e/At)/g,S=(x-v)/2,C=u+S+_,E=r-S-_,{outerStart:U,outerEnd:P,innerStart:I,innerEnd:B}=Qv(t,y,g,E-C),N=g-U,T=g-P,D=C+U/N,O=E-P/T,L=y+I,W=y+B,tt=C+I/L,G=E-B/W;if(n.beginPath(),s){const nt=(D+O)/2;if(n.arc(a,c,g,D,nt),n.arc(a,c,g,nt,O),P>0){const st=Fr(T,O,a,c);n.arc(st.x,st.y,P,O,E+re)}const X=Fr(W,E,a,c);if(n.lineTo(X.x,X.y),B>0){const st=Fr(W,G,a,c);n.arc(st.x,st.y,B,E+re,G+Math.PI)}const Q=(E-B/y+(C+I/y))/2;if(n.arc(a,c,y,E-B/y,Q,!0),n.arc(a,c,y,Q,C+I/y,!0),I>0){const st=Fr(L,tt,a,c);n.arc(st.x,st.y,I,tt+Math.PI,C-re)}const rt=Fr(N,C,a,c);if(n.lineTo(rt.x,rt.y),U>0){const st=Fr(N,D,a,c);n.arc(st.x,st.y,U,C-re,D)}}else{n.moveTo(a,c);const nt=Math.cos(D)*g+a,X=Math.sin(D)*g+c;n.lineTo(nt,X);const Q=Math.cos(O)*g+a,rt=Math.sin(O)*g+c;n.lineTo(Q,rt)}n.closePath()}function Jv(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:c}=t;let u=t.endAngle;if(s){xa(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(c)||(u=a+(c%te||te))}return xa(n,t,e,i,u,r),n.fill(),u}function t1(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:c,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:g,borderDashOffset:y,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(g||[]),n.lineDashOffset=y,x?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let v=t.endAngle;if(s){xa(n,t,e,i,v,r);for(let S=0;S<s;++S)n.stroke();isNaN(c)||(v=a+(c%te||te))}x&&Xv(n,t,v),u.selfJoin&&v-a>=At&&_===0&&h!=="miter"&&Kv(n,t,v),s||(xa(n,t,e,i,v,r),n.stroke())}class e1 extends He{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,e,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=sa(r,{x:t,y:e}),{startAngle:c,endAngle:u,innerRadius:d,outerRadius:h,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),y=(this.options.spacing+this.options.borderWidth)/2,_=Mt(g,u-c),x=As(s,c,u)&&c!==u,v=_>=te||x,S=ei(a,d+y,h+y);return v&&S}getCenterPoint(t){const{x:e,y:i,startAngle:r,endAngle:s,innerRadius:a,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:u,spacing:d}=this.options,h=(r+s)/2,g=(a+c+d+u)/2;return{x:e+Math.cos(h)*g,y:i+Math.sin(h)*g}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,s=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>te?Math.floor(i/te):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*r,Math.sin(c)*r);const u=1-Math.sin(Math.min(At,i||0)),d=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,Jv(t,this,d,s,a),t1(t,this,d,s,a),t.restore()}}function Dp(n,t,e=t){n.lineCap=Mt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Mt(e.borderDash,t.borderDash)),n.lineDashOffset=Mt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Mt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Mt(e.borderWidth,t.borderWidth),n.strokeStyle=Mt(e.borderColor,t.borderColor)}function n1(n,t,e){n.lineTo(e.x,e.y)}function i1(n){return n.stepped?vx:n.tension||n.cubicInterpolationMode==="monotone"?Sx:n1}function kp(n,t,e={}){const i=n.length,{start:r=0,end:s=i-1}=e,{start:a,end:c}=t,u=Math.max(r,a),d=Math.min(s,c),h=r<a&&s<a||r>c&&s>c;return{count:i,start:u,loop:t.loop,ilen:d<u&&!h?i+d-u:d-u}}function r1(n,t,e,i){const{points:r,options:s}=t,{count:a,start:c,loop:u,ilen:d}=kp(r,e,i),h=i1(s);let{move:g=!0,reverse:y}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(c+(y?d-_:_))%a],!x.skip&&(g?(n.moveTo(x.x,x.y),g=!1):h(n,v,x,y,s.stepped),v=x);return u&&(x=r[(c+(y?d:0))%a],h(n,v,x,y,s.stepped)),!!u}function s1(n,t,e,i){const r=t.points,{count:s,start:a,ilen:c}=kp(r,e,i),{move:u=!0,reverse:d}=i||{};let h=0,g=0,y,_,x,v,S,C;const E=P=>(a+(d?c-P:P))%s,U=()=>{v!==S&&(n.lineTo(h,S),n.lineTo(h,v),n.lineTo(h,C))};for(u&&(_=r[E(0)],n.moveTo(_.x,_.y)),y=0;y<=c;++y){if(_=r[E(y)],_.skip)continue;const P=_.x,I=_.y,B=P|0;B===x?(I<v?v=I:I>S&&(S=I),h=(g*h+P)/++g):(U(),n.lineTo(P,I),x=B,g=0,v=S=I),C=I}U()}function $c(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?s1:r1}function o1(n){return n.stepped?ew:n.tension||n.cubicInterpolationMode==="monotone"?nw:ir}function a1(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),Dp(n,t.options),n.stroke(r)}function l1(n,t,e,i){const{segments:r,options:s}=t,a=$c(t);for(const c of r)Dp(n,s,c.style),n.beginPath(),a(n,t,c,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const c1=typeof Path2D=="function";function u1(n,t,e,i){c1&&!t.options.segment?a1(n,t,e,i):l1(n,t,e,i)}class wa extends He{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,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;jx(this._points,i,t,r,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=lw(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],s=this.points,a=Ph(this,{property:e,start:r,end:r});if(!a.length)return;const c=[],u=o1(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:g,end:y}=a[d],_=s[g],x=s[y];if(_===x){c.push(_);continue}const v=Math.abs((r-_[e])/(x[e]-_[e])),S=u(_,x,v,i.stepped);S[e]=t[e],c.push(S)}return c.length===1?c[0]:c}pathSegment(t,e,i){return $c(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=$c(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const c of r)a&=s(t,this,c,{start:e,end:e+i-1});return!!a}draw(t,e,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),u1(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Cp(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class d1 extends He{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,e,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return Cp(this,t,"x",e)}inYRange(t,e){return Cp(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!ii(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Tc(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Op(n,t){const{x:e,y:i,base:r,width:s,height:a}=n.getProps(["x","y","base","width","height"],t);let c,u,d,h,g;return n.horizontal?(g=a/2,c=Math.min(e,r),u=Math.max(e,r),d=i-g,h=i+g):(g=s/2,c=e-g,u=e+g,d=Math.min(i,r),h=Math.max(i,r)),{left:c,top:d,right:u,bottom:h}}function Ai(n,t,e,i){return n?0:Ce(t,e,i)}function f1(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=yh(i);return{t:Ai(r.top,s.top,0,e),r:Ai(r.right,s.right,0,t),b:Ai(r.bottom,s.bottom,0,e),l:Ai(r.left,s.left,0,t)}}function h1(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Mi(r),a=Math.min(t,e),c=n.borderSkipped,u=i||Rt(r);return{topLeft:Ai(!u||c.top||c.left,s.topLeft,0,a),topRight:Ai(!u||c.top||c.right,s.topRight,0,a),bottomLeft:Ai(!u||c.bottom||c.left,s.bottomLeft,0,a),bottomRight:Ai(!u||c.bottom||c.right,s.bottomRight,0,a)}}function p1(n){const t=Op(n),e=t.right-t.left,i=t.bottom-t.top,r=f1(n,e/2,i/2),s=h1(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function Yc(n,t,e,i){const r=t===null,s=e===null,c=n&&!(r&&s)&&Op(n,i);return c&&(r||ei(t,c.left,c.right))&&(s||ei(e,c.top,c.bottom))}function g1(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function m1(n,t){n.rect(t.x,t.y,t.w,t.h)}function Vc(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,s=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+s,h:n.h+a,radius:n.radius}}class y1 extends He{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:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=p1(this),c=g1(a.radius)?Pr:m1;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),c(t,Vc(a,e,s)),t.clip(),c(t,Vc(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),c(t,Vc(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return Yc(this,t,e,i)}inXRange(t,e){return Yc(this,t,null,e)}inYRange(t,e){return Yc(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+r)/2:e,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var _1=Object.freeze({__proto__:null,ArcElement:e1,BarElement:y1,LineElement:wa,PointElement:d1});const qc=["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)"],Ap=qc.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ep(n){return qc[n%qc.length]}function Rp(n){return Ap[n%Ap.length]}function b1(n,t){return n.borderColor=Ep(t),n.backgroundColor=Rp(t),++t}function x1(n,t){return n.backgroundColor=n.data.map(()=>Ep(t++)),t}function w1(n,t){return n.backgroundColor=n.data.map(()=>Rp(t++)),t}function v1(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Bs?t=x1(e,t):r instanceof Xh?t=w1(e,t):r&&(t=b1(e,t))}}function Pp(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function S1(n){return n&&(n.borderColor||n.backgroundColor)}function T1(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var M1={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:s}=r,a=Pp(i)||S1(r)||s&&Pp(s)||T1();if(!e.forceOverride&&a)return;const c=v1(n);i.forEach(c)}};function D1(n,t,e,i,r){const s=r.samples||i;if(s>=e)return n.slice(t,t+e);const a=[],c=(e-2)/(s-2);let u=0;const d=t+e-1;let h=t,g,y,_,x,v;for(a[u++]=n[h],g=0;g<s-2;g++){let S=0,C=0,E;const U=Math.floor((g+1)*c)+1+t,P=Math.min(Math.floor((g+2)*c)+1,e)+t,I=P-U;for(E=U;E<P;E++)S+=n[E].x,C+=n[E].y;S/=I,C/=I;const B=Math.floor(g*c)+1+t,N=Math.min(Math.floor((g+1)*c)+1,e)+t,{x:T,y:D}=n[h];for(_=x=-1,E=B;E<N;E++)x=.5*Math.abs((T-S)*(n[E].y-D)-(T-n[E].x)*(C-D)),x>_&&(_=x,y=n[E],v=E);a[u++]=y,h=v}return a[u++]=n[d],a}function k1(n,t,e,i){let r=0,s=0,a,c,u,d,h,g,y,_,x,v;const S=[],C=t+e-1,E=n[t].x,P=n[C].x-E;for(a=t;a<t+e;++a){c=n[a],u=(c.x-E)/P*i,d=c.y;const I=u|0;if(I===h)d<x?(x=d,g=a):d>v&&(v=d,y=a),r=(s*r+c.x)/++s;else{const B=a-1;if(!Tt(g)&&!Tt(y)){const N=Math.min(g,y),T=Math.max(g,y);N!==_&&N!==B&&S.push({...n[N],x:r}),T!==_&&T!==B&&S.push({...n[T],x:r})}a>0&&B!==_&&S.push(n[B]),S.push(c),h=I,s=0,x=v=d,g=y=_=a}}return S}function Ip(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Lp(n){n.data.datasets.forEach(t=>{Ip(t)})}function C1(n,t){const e=t.length;let i=0,r;const{iScale:s}=n,{min:a,max:c,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Ce(ni(t,s.axis,a).lo,0,e-1)),d?r=Ce(ni(t,s.axis,c).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var O1={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Lp(n);return}const i=n.width;n.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:c}=r,u=n.getDatasetMeta(s),d=a||r.data;if(Ns([c,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const h=n.scales[u.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:g,count:y}=C1(u,d);const _=e.threshold||4*i;if(y<=_){Ip(r);return}Tt(a)&&(r._data=d,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let x;switch(e.algorithm){case"lttb":x=D1(d,g,y,i,e);break;case"min-max":x=k1(d,g,y,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){Lp(n)}};function A1(n,t,e){const i=n.segments,r=n.points,s=t.points,a=[];for(const c of i){let{start:u,end:d}=c;d=va(u,d,r);const h=jc(e,r[u],r[d],c.loop);if(!t.segments){a.push({source:c,target:h,start:r[u],end:r[d]});continue}const g=Ph(t,h);for(const y of g){const _=jc(e,s[y.start],s[y.end],y.loop),x=Rh(c,r,_);for(const v of x)a.push({source:v,target:y,start:{[e]:Np(h,_,"start",Math.max)},end:{[e]:Np(h,_,"end",Math.min)}})}}return a}function jc(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=Be(r),s=Be(s)),{property:n,start:r,end:s}}function E1(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:c})=>{c=va(a,c,r);const u=r[a],d=r[c];i!==null?(s.push({x:u.x,y:i}),s.push({x:d.x,y:i})):e!==null&&(s.push({x:e,y:u.y}),s.push({x:e,y:d.y}))}),s}function va(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Np(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Fp(n,t){let e=[],i=!1;return Yt(n)?(i=!0,e=n):e=E1(n,t),e.length?new wa({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Bp(n){return n&&n.fill!==!1}function R1(n,t,e){let r=n[t].fill;const s=[t];let a;if(!e)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ae(r))return r;if(a=n[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function P1(n,t,e){const i=F1(n);if(Rt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?I1(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function I1(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function L1(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:Rt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function N1(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:Rt(n)?i=n.value:i=t.getBaseValue(),i}function F1(n){const t=n.options,e=t.fill;let i=Mt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function B1(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,c=z1(t,e);c.push(Fp({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let h=d.start;h<=d.end;h++)U1(r,a[h],c)}return new wa({points:r,options:{}})}function z1(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||e.unshift(s.dataset)}return e}function U1(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:c,point:u}=H1(s,t,"x");if(!(!u||a&&c)){if(a)i.unshift(u);else if(n.push(u),!c)break}}n.push(...i)}function H1(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],s=n.segments,a=n.points;let c=!1,u=!1;for(let d=0;d<s.length;d++){const h=s[d],g=a[h.start][e],y=a[h.end][e];if(ei(r,g,y)){c=r===g,u=r===y;break}}return{first:c,last:u,point:i}}class zp{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:s,radius:a}=this;return e=e||{start:0,end:te},t.arc(r,s,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,s=t.angle;return{x:e+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function W1(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return $1(t,e);if(e==="stack")return B1(n);if(e==="shape")return!0;const r=Y1(n);return r instanceof zp?r:Fp(r,i)}function $1(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Y1(n){return(n.scale||{}).getPointPositionForValue?q1(n):V1(n)}function V1(n){const{scale:t={},fill:e}=n,i=L1(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function q1(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=N1(e,t,s),c=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new zp({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<r;++u)c.push(t.getPointPositionForValue(u,a));return c}function Gc(n,t,e){const i=W1(t),{chart:r,index:s,line:a,scale:c,axis:u}=t,d=a.options,h=d.fill,g=d.backgroundColor,{above:y=g,below:_=g}=h||{},x=r.getDatasetMeta(s),v=Nh(r,x);i&&a.points.length&&(Is(n,e),j1(n,{line:a,target:i,above:y,below:_,area:e,scale:c,axis:u,clip:v}),Ls(n))}function j1(n,t){const{line:e,target:i,above:r,below:s,area:a,scale:c,clip:u}=t,d=e._loop?"angle":t.axis;n.save();let h=s;s!==r&&(d==="x"?(Up(n,i,a.top),Kc(n,{line:e,target:i,color:r,scale:c,property:d,clip:u}),n.restore(),n.save(),Up(n,i,a.bottom)):d==="y"&&(Hp(n,i,a.left),Kc(n,{line:e,target:i,color:s,scale:c,property:d,clip:u}),n.restore(),n.save(),Hp(n,i,a.right),h=r)),Kc(n,{line:e,target:i,color:h,scale:c,property:d,clip:u}),n.restore()}function Up(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const c of i){const{start:u,end:d}=c,h=r[u],g=r[va(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,c,{move:a}),a?n.closePath():n.lineTo(g.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Hp(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const c of i){const{start:u,end:d}=c,h=r[u],g=r[va(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(e,h.y),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,c,{move:a}),a?n.closePath():n.lineTo(e,g.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Kc(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:c}=t,u=A1(e,i,r);for(const{source:d,target:h,start:g,end:y}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,G1(n,a,c,x&&jc(r,g,y)),n.beginPath();const v=!!e.pathSegment(n,d);let S;if(x){v?n.closePath():Wp(n,i,y,r);const C=!!i.pathSegment(n,h,{move:v,reverse:!0});S=v&&C,S||Wp(n,i,g,r)}n.closePath(),n.fill(S?"evenodd":"nonzero"),n.restore()}}function G1(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:c}=i||{};if(s==="x"||s==="y"){let u,d,h,g;s==="x"?(u=a,d=r.top,h=c,g=r.bottom):(u=r.left,d=a,h=r.right,g=c),n.beginPath(),e&&(u=Math.max(u,e.left),h=Math.min(h,e.right),d=Math.max(d,e.top),g=Math.min(g,e.bottom)),n.rect(u,d,h-u,g-d),n.clip()}}function Wp(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var K1={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let s,a,c,u;for(a=0;a<i;++a)s=n.getDatasetMeta(a),c=s.dataset,u=null,c&&c.options&&c instanceof wa&&(u={visible:n.isDatasetVisible(a),index:a,fill:P1(c,a,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:c}),s.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],!(!u||u.fill===!1)&&(u.fill=R1(r,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let a=r.length-1;a>=0;--a){const c=r[a].$filler;c&&(c.line.updateControlPoints(s,c.axis),i&&c.fill&&Gc(n.ctx,c,s))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;Bp(s)&&Gc(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Bp(i)||e.drawTime!=="beforeDatasetDraw"||Gc(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const $p=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},X1=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Yp extends He{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Kt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=le(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:c,itemHeight:u}=$p(i,s);let d,h;e.font=r.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,s,c,u)+10):(h=this.maxHeight,d=this._fitCols(a,r,c,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],h=r+c;let g=t;s.textAlign="left",s.textBaseline="middle";let y=-1,_=-h;return this.legendItems.forEach((x,v)=>{const S=i+e/2+s.measureText(x.text).width;(v===0||d[d.length-1]+S+2*c>a)&&(g+=h,d[d.length-(v>0?0:1)]=0,_+=h,y++),u[v]={left:0,top:_,row:y,width:S,height:r},d[d.length-1]+=S+c}),g}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let g=c,y=0,_=0,x=0,v=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:E,itemHeight:U}=Z1(i,e,s,S,r);C>0&&_+U+2*c>h&&(g+=y+c,d.push({width:y,height:_}),x+=y+c,v++,y=_=0),u[C]={left:x,top:_,col:v,width:E,height:U},y=Math.max(y,E),_+=U+c}),g+=y,d.push({width:y,height:_}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=Nr(s,this.left,this.width);if(this.isHorizontal()){let c=0,u=ze(i,this.left+r,this.right-this.lineWidths[c]);for(const d of e)c!==d.row&&(c=d.row,u=ze(i,this.left+r,this.right-this.lineWidths[c])),d.top+=this.top+t+r,d.left=a.leftForLtr(a.x(u),d.width),u+=d.width+r}else{let c=0,u=ze(i,this.top+t+r,this.bottom-this.columnSizes[c].height);for(const d of e)d.col!==c&&(c=d.col,u=ze(i,this.top+t+r,this.bottom-this.columnSizes[c].height)),d.top=u,d.left+=this.left+r,d.left=a.leftForLtr(a.x(d.left),d.width),u+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Is(t,this),this._draw(),Ls(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,c=se.color,u=Nr(t.rtl,this.left,this.width),d=le(a.font),{padding:h}=a,g=d.size,y=g/2;let _;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:v,itemHeight:S}=$p(a,g),C=function(B,N,T){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const D=Mt(T.lineWidth,1);if(r.fillStyle=Mt(T.fillStyle,c),r.lineCap=Mt(T.lineCap,"butt"),r.lineDashOffset=Mt(T.lineDashOffset,0),r.lineJoin=Mt(T.lineJoin,"miter"),r.lineWidth=D,r.strokeStyle=Mt(T.strokeStyle,c),r.setLineDash(Mt(T.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:D},L=u.xPlus(B,x/2),W=N+y;mh(r,O,L,W,a.pointStyleWidth&&x)}else{const O=N+Math.max((g-v)/2,0),L=u.leftForLtr(B,x),W=Mi(T.borderRadius);r.beginPath(),Object.values(W).some(tt=>tt!==0)?Pr(r,{x:L,y:O,w:x,h:v,radius:W}):r.rect(L,O,x,v),r.fill(),D!==0&&r.stroke()}r.restore()},E=function(B,N,T){er(r,T.text,B,N+S/2,d,{strikethrough:T.hidden,textAlign:u.textAlign(T.textAlign)})},U=this.isHorizontal(),P=this._computeTitleHeight();U?_={x:ze(s,this.left+h,this.right-i[0]),y:this.top+h+P,line:0}:_={x:this.left+h,y:ze(s,this.top+P+h,this.bottom-e[0].height),line:0},Ch(this.ctx,t.textDirection);const I=S+h;this.legendItems.forEach((B,N)=>{r.strokeStyle=B.fontColor,r.fillStyle=B.fontColor;const T=r.measureText(B.text).width,D=u.textAlign(B.textAlign||(B.textAlign=a.textAlign)),O=x+y+T;let L=_.x,W=_.y;u.setWidth(this.width),U?N>0&&L+O+h>this.right&&(W=_.y+=I,_.line++,L=_.x=ze(s,this.left+h,this.right-i[_.line])):N>0&&W+I>this.bottom&&(L=_.x=L+e[_.line].width+h,_.line++,W=_.y=ze(s,this.top+P+h,this.bottom-e[_.line].height));const tt=u.x(L);if(C(tt,W,B),L=dx(D,L+x+y,U?L+O:this.right,t.rtl),E(u.x(L),W,B),U)_.x+=O+h;else if(typeof B.text!="string"){const G=d.lineHeight;_.y+=Vp(B,G)+h}else _.y+=I}),Oh(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=we(e.padding);if(!e.display)return;const s=Nr(t.rtl,this.left,this.width),a=this.ctx,c=e.position,u=i.size/2,d=r.top+u;let h,g=this.left,y=this.width;if(this.isHorizontal())y=Math.max(...this.lineWidths),h=this.top+d,g=ze(t.align,g,this.right-y);else{const x=this.columnSizes.reduce((v,S)=>Math.max(v,S.height),0);h=d+ze(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=ze(c,g,g+y);a.textAlign=s.textAlign(_c(c)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,er(a,e.text,_,h,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=we(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(ei(t,this.left,this.right)&&ei(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],ei(t,r.left,r.left+r.width)&&ei(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!tS(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=X1(r,i);r&&!s&&Kt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Kt(e.onHover,[t,i,this],this)}else i&&Kt(e.onClick,[t,i,this],this)}}function Z1(n,t,e,i,r){const s=Q1(i,n,t,e),a=J1(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function Q1(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+e.size/2+i.measureText(r).width}function J1(n,t,e){let i=n;return typeof t.text!="string"&&(i=Vp(t,e)),i}function Vp(n,t){const e=n.text?n.text.length:0;return t*e}function tS(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var eS={id:"legend",_element:Yp,start(n,t,e){const i=n.legend=new Yp({ctx:n.ctx,options:e,chart:n});Ue.configure(n,i,e),Ue.addBox(n,i)},stop(n){Ue.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Ue.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:c}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(e?0:void 0),h=we(d.borderWidth);return{text:t[u.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:a&&(c||d.borderRadius),datasetIndex:u.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Xc extends He{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=Yt(i.text)?i.text.length:1;this._padding=we(i.padding);const s=r*le(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:s,options:a}=this,c=a.align;let u=0,d,h,g;return this.isHorizontal()?(h=ze(c,i,s),g=e+t,d=s-i):(a.position==="left"?(h=i+t,g=ze(c,r,e),u=At*-.5):(h=s-t,g=ze(c,e,r),u=At*.5),d=r-e),{titleX:h,titleY:g,maxWidth:d,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=le(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:c,maxWidth:u,rotation:d}=this._drawArgs(s);er(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:_c(e.align),textBaseline:"middle",translation:[a,c]})}}function nS(n,t){const e=new Xc({ctx:n.ctx,options:t,chart:n});Ue.configure(n,e,t),Ue.addBox(n,e),n.titleBlock=e}var iS={id:"title",_element:Xc,start(n,t,e){nS(n,e)},stop(n){const t=n.titleBlock;Ue.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Ue.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Sa=new WeakMap;var rS={id:"subtitle",start(n,t,e){const i=new Xc({ctx:n.ctx,options:e,chart:n});Ue.configure(n,i,e),Ue.addBox(n,i),Sa.set(n,i)},stop(n){Ue.removeBox(n,Sa.get(n)),Sa.delete(n)},beforeUpdate(n,t,e){const i=Sa.get(n);Ue.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qs={average(n){if(!n.length)return!1;let t,e,i=new Set,r=0,s=0;for(t=0,e=n.length;t<e;++t){const c=n[t].element;if(c&&c.hasValue()){const u=c.tooltipPosition();i.add(u.x),r+=u.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((c,u)=>c+u)/i.size,y:r/s}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,c;for(s=0,a=n.length;s<a;++s){const u=n[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),h=Rr(t,d);h<r&&(r=h,c=u)}}if(c){const u=c.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function Yn(n,t){return t&&(Yt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function si(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
2
2
|
`)>-1?n.split(`
|
|
3
|
-
`):n}function sS(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:c}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:c,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function qp(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:c}=t,u=le(t.bodyFont),d=le(t.titleFont),h=le(t.footerFont),g=s.length,y=r.length,_=i.length,x=we(t.padding);let v=x.height,S=0,C=i.reduce((P,I)=>P+I.before.length+I.lines.length+I.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,g&&(v+=g*d.lineHeight+(g-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(c,u.lineHeight):u.lineHeight;v+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}y&&(v+=t.footerMarginTop+y*h.lineHeight+(y-1)*t.footerSpacing);let E=0;const U=function(P){S=Math.max(S,e.measureText(P).width+E)};return e.save(),e.font=d.string,Xt(n.title,U),e.font=u.string,Xt(n.beforeBody.concat(n.afterBody),U),E=t.displayColors?a+2+t.boxPadding:0,Xt(i,P=>{Xt(P.before,U),Xt(P.lines,U),Xt(P.after,U)}),E=0,e.font=h.string,Xt(n.footer,U),e.restore(),S+=x.width,{width:S,height:v}}function oS(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function aS(n,t,e,i){const{x:r,width:s}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&r+s+a>t.width||n==="right"&&r-s-a<0)return!0}function lS(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:c,right:u}}=n;let d="center";return i==="center"?d=r<=(c+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),aS(d,n,t,e)&&(d="center"),d}function jp(n,t,e){const i=e.yAlign||t.yAlign||oS(n,e);return{xAlign:e.xAlign||t.xAlign||lS(n,t,e,i),yAlign:i}}function cS(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function uS(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Gp(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:c,yAlign:u}=e,d=r+s,{topLeft:h,topRight:g,bottomLeft:y,bottomRight:_}=Mi(a);let x=cS(t,c);const v=uS(t,u,d);return u==="center"?c==="left"?x+=d:c==="right"&&(x-=d):c==="left"?x-=Math.max(h,y)+r:c==="right"&&(x+=Math.max(g,_)+r),{x:Ce(x,0,i.width-t.width),y:Ce(v,0,i.height-t.height)}}function Ta(n,t,e){const i=we(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Kp(n){return Yn([],si(n))}function dS(n,t,e){return Di(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Xp(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Zp={beforeTitle:ti,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:ti,beforeBody:ti,beforeLabel:ti,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return Tt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ti,afterBody:ti,beforeFooter:ti,footer:ti,afterFooter:ti};function nn(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Zp[t].call(e,i):r}class Qp extends He{static positioners=qs;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,s=new Ec(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=dS(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=nn(i,"beforeTitle",this,t),s=nn(i,"title",this,t),a=nn(i,"afterTitle",this,t);let c=[];return c=Yn(c,si(r)),c=Yn(c,si(s)),c=Yn(c,si(a)),c}getBeforeBody(t,e){return Kp(nn(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Xt(t,s=>{const a={before:[],lines:[],after:[]},c=Xp(i,s);Yn(a.before,si(nn(c,"beforeLabel",this,s))),Yn(a.lines,nn(c,"label",this,s)),Yn(a.after,si(nn(c,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Kp(nn(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=nn(i,"beforeFooter",this,t),s=nn(i,"footer",this,t),a=nn(i,"afterFooter",this,t);let c=[];return c=Yn(c,si(r)),c=Yn(c,si(s)),c=Yn(c,si(a)),c}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let c=[],u,d;for(u=0,d=e.length;u<d;++u)c.push(sS(this.chart,e[u]));return t.filter&&(c=c.filter((h,g,y)=>t.filter(h,g,y,i))),t.itemSort&&(c=c.sort((h,g)=>t.itemSort(h,g,i))),Xt(c,h=>{const g=Xp(t.callbacks,h);r.push(nn(g,"labelColor",this,h)),s.push(nn(g,"labelPointStyle",this,h)),a.push(nn(g,"labelTextColor",this,h))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=c,c}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const c=qs[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const u=this._size=qp(this,i),d=Object.assign({},c,u),h=jp(this.chart,i,d),g=Gp(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,s={opacity:1,x:g.x,y:g.y,width:u.width,height:u.height,caretX:c.x,caretY:c.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const s=this.getCaretPosition(t,i,r);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:c}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=Mi(c),{x:y,y:_}=t,{width:x,height:v}=e;let S,C,E,U,P,I;return s==="center"?(P=_+v/2,r==="left"?(S=y,C=S-a,U=P+a,I=P-a):(S=y+x,C=S+a,U=P-a,I=P+a),E=S):(r==="left"?C=y+Math.max(u,h)+a:r==="right"?C=y+x-Math.max(d,g)-a:C=this.caretX,s==="top"?(U=_,P=U-a,S=C-a,E=C+a):(U=_+v,P=U+a,S=C+a,E=C-a),I=U),{x1:S,x2:C,x3:E,y1:U,y2:P,y3:I}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,c,u;if(s){const d=Nr(i.rtl,this.x,this.width);for(t.x=Ta(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=le(i.titleFont),c=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,u=0;u<s;++u)e.fillText(r[u],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+c,u+1===s&&(t.y+=i.titleMarginBottom-c)}}_drawColorBox(t,e,i,r,s){const a=this.labelColors[i],c=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,h=le(s.bodyFont),g=Ta(this,"left",s),y=r.x(g),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:c.pointStyle,rotation:c.rotation,borderWidth:1},S=r.leftForLtr(y,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Tc(t,v,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Tc(t,v,S,C)}else{t.lineWidth=Rt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const v=r.leftForLtr(y,d),S=r.leftForLtr(r.xPlus(y,1),d-2),C=Mi(a.borderRadius);Object.values(C).some(E=>E!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Pr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Pr(t,{x:S,y:x+1,w:d-2,h:u-2,radius:C}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(v,x,d,u),t.strokeRect(v,x,d,u),t.fillStyle=a.backgroundColor,t.fillRect(S,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:c,boxHeight:u,boxWidth:d,boxPadding:h}=i,g=le(i.bodyFont);let y=g.lineHeight,_=0;const x=Nr(i.rtl,this.x,this.width),v=function(T){e.fillText(T,x.x(t.x+_),t.y+y/2),t.y+=y+s},S=x.textAlign(a);let C,E,U,P,I,B,N;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Ta(this,S,i),e.fillStyle=i.bodyColor,Xt(this.beforeBody,v),_=c&&S!=="right"?a==="center"?d/2+h:d+2+h:0,P=0,B=r.length;P<B;++P){for(C=r[P],E=this.labelTextColors[P],e.fillStyle=E,Xt(C.before,v),U=C.lines,c&&U.length&&(this._drawColorBox(e,t,P,x,i),y=Math.max(g.lineHeight,u)),I=0,N=U.length;I<N;++I)v(U[I]),y=g.lineHeight;Xt(C.after,v)}_=0,y=g.lineHeight,Xt(this.afterBody,v),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,c;if(s){const u=Nr(i.rtl,this.x,this.width);for(t.x=Ta(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",a=le(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,c=0;c<s;++c)e.fillText(r[c],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:s,yAlign:a}=this,{x:c,y:u}=t,{width:d,height:h}=i,{topLeft:g,topRight:y,bottomLeft:_,bottomRight:x}=Mi(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(c+g,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(c+d-y,u),e.quadraticCurveTo(c+d,u,c+d,u+y),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(c+d,u+h-x),e.quadraticCurveTo(c+d,u+h,c+d-x,u+h),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(c+_,u+h),e.quadraticCurveTo(c,u+h,c,u+h-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(c,u+g),e.quadraticCurveTo(c,u,c+g,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=qs[t.position].call(this,this._active,this._eventPosition);if(!a)return;const c=this._size=qp(this,t),u=Object.assign({},a,this._size),d=jp(e,t,u),h=Gp(t,u,d,e);(r._to!==h.x||s._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=c.width,this.height=c.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=we(e.padding),c=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&c&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),Ch(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),Oh(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:c,index:u})=>{const d=this.chart.getDatasetMeta(c);if(!d)throw new Error("Cannot find a dataset at index "+c);return{datasetIndex:c,element:d.data[u],index:u}}),s=!ta(i,r),a=this._positionChanged(r,e);(s||a)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,e,i),c=this._positionChanged(a,t),u=e||!ta(a,s)||c;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(c=>this.chart.data.datasets[c.datasetIndex]&&this.chart.getDatasetMeta(c.datasetIndex).controller.getParsed(c.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:r,options:s}=this,a=qs[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var hn={id:"tooltip",_element:Qp,positioners:qs,afterInit(n,t,e){e&&(n.tooltip=new Qp({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Zp},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},fS=Object.freeze({__proto__:null,Colors:M1,Decimation:O1,Filler:K1,Legend:eS,SubTitle:rS,Title:iS,Tooltip:hn});const hS=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function pS(n,t,e,i){const r=n.indexOf(t);if(r===-1)return hS(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const gS=(n,t)=>n===null?null:Ce(Math.round(n),0,t);function Jp(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class mS extends sr{static id="category";static defaults={ticks:{callback:Jp}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:s}of e)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Tt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:pS(i,t,Mt(e,t),this._addedLabels),gS(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)r.push({value:a});return r}getLabelForValue(t){return Jp.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function yS(n,t){const e=[],{bounds:r,step:s,min:a,max:c,precision:u,count:d,maxTicks:h,maxDigits:g,includeBounds:y}=n,_=s||1,x=h-1,{min:v,max:S}=t,C=!Tt(a),E=!Tt(c),U=!Tt(d),P=(S-v)/(g+1);let I=eh((S-v)/x/_)*_,B,N,T,D;if(I<1e-14&&!C&&!E)return[{value:v},{value:S}];D=Math.ceil(S/I)-Math.floor(v/I),D>x&&(I=eh(D*I/x/_)*_),Tt(u)||(B=Math.pow(10,u),I=Math.ceil(I*B)/B),r==="ticks"?(N=Math.floor(v/I)*I,T=Math.ceil(S/I)*I):(N=v,T=S),C&&E&&s&&rx((c-a)/s,I/1e3)?(D=Math.round(Math.min((c-a)/I,h)),I=(c-a)/D,N=a,T=c):U?(N=C?a:N,T=E?c:T,D=d-1,I=(T-N)/D):(D=(T-N)/I,Os(D,Math.round(D),I/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(ih(I),ih(N));B=Math.pow(10,Tt(u)?O:u),N=Math.round(N*B)/B,T=Math.round(T*B)/B;let L=0;for(C&&(y&&N!==a?(e.push({value:a}),N<a&&L++,Os(Math.round((N+L*I)*B)/B,a,tg(a,P,n))&&L++):N<a&&L++);L<D;++L){const W=Math.round((N+L*I)*B)/B;if(E&&W>c)break;e.push({value:W})}return E&&y&&T!==c?e.length&&Os(e[e.length-1].value,c,tg(c,P,n))?e[e.length-1].value=c:e.push({value:c}):(!E||T===c)&&e.push({value:T}),e}function tg(n,t,{horizontal:e,minRotation:i}){const r=xe(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Ma extends sr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Tt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,c=u=>s=i?s:u;if(t){const u=Wn(r),d=Wn(s);u<0&&d<0?c(0):u>0&&d>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);c(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},s=this._range||this,a=yS(r,s);return t.bounds==="ticks"&&nh(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Rs(t,this.chart.options.locale,this.options.ticks.format)}}class _S extends Ma{static id="linear";static defaults={ticks:{callback:aa.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?t:0,this.max=ae(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const js=n=>Math.floor(Si(n)),or=(n,t)=>Math.pow(10,js(n)+t);function eg(n){return n/Math.pow(10,js(n))===1}function ng(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function bS(n,t){const e=t-n;let i=js(e);for(;ng(n,t,i)>10;)i++;for(;ng(n,t,i)<10;)i--;return Math.min(i,js(n))}function xS(n,{min:t,max:e}){t=fn(n.min,t);const i=[],r=js(t);let s=bS(t,e),a=s<0?Math.pow(10,Math.abs(s)):1;const c=Math.pow(10,s),u=r>s?Math.pow(10,r):0,d=Math.round((t-u)*a)/a,h=Math.floor((t-u)/c/10)*c*10;let g=Math.floor((d-h)/Math.pow(10,s)),y=fn(n.min,Math.round((u+h+g*Math.pow(10,s))*a)/a);for(;y<e;)i.push({value:y,major:eg(y),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(s++,g=2,a=s>=0?1:a),y=Math.round((u+h+g*Math.pow(10,s))*a)/a;const _=fn(n.max,y);return i.push({value:_,major:eg(_),significand:g}),i}class wS extends sr{static id="logarithmic";static defaults={ticks:{callback:aa.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,e){const i=Ma.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return ae(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?Math.max(0,t):null,this.max=ae(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ae(this._userMin)&&(this.min=t===or(this.min,0)?or(this.min,-1):or(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=c=>i=t?i:c,a=c=>r=e?r:c;i===r&&(i<=0?(s(1),a(10)):(s(or(i,-1)),a(or(r,1)))),i<=0&&s(or(r,-1)),r<=0&&a(or(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=xS(e,this);return t.bounds==="ticks"&&nh(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":Rs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Si(t),this._valueRange=Si(this.max)-Si(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Si(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(n){const t=n.ticks;if(t.display&&n.display){const e=we(t.backdropPadding);return Mt(t.font&&t.font.size,se.font.size)+e.height}return 0}function vS(n,t,e){return e=Yt(e)?e:[e],{w:wx(n,t.string,e),h:e.length*t.lineHeight}}function ig(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function SS(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],s=n._pointLabels.length,a=n.options.pointLabels,c=a.centerPointLabels?At/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const h=n.getPointPosition(u,n.drawingArea+r[u],c),g=le(d.font),y=vS(n.ctx,g,n._pointLabels[u]);i[u]=y;const _=Be(n.getIndexAngle(u)+c),x=Math.round(ra(_)),v=ig(x,h.x,y.w,0,180),S=ig(x,h.y,y.h,90,270);TS(e,t,_,v,S)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=kS(n,i,r)}function TS(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let c=0,u=0;i.start<t.l?(c=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-c)):i.end>t.r&&(c=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+c)),r.start<t.t?(u=(t.t-r.start)/a,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,n.b=Math.max(n.b,t.b+u))}function MS(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:c}=e,u=n.getPointPosition(t,i+r+a,s),d=Math.round(ra(Be(u.angle+re))),h=AS(u.y,c.h,d),g=CS(d),y=OS(u.x,c.w,g);return{visible:!0,x:u.x,y:h,textAlign:g,left:y,top:h,right:y+c.w,bottom:h+c.h}}function DS(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ii({x:e,y:i},t)||ii({x:e,y:s},t)||ii({x:r,y:i},t)||ii({x:r,y:s},t))}function kS(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:c}=s.pointLabels,u={extra:Zc(s)/2,additionalAngle:a?At/r:0};let d;for(let h=0;h<r;h++){u.padding=e[h],u.size=t[h];const g=MS(n,h,u);i.push(g),c==="auto"&&(g.visible=DS(g,d),g.visible&&(d=g))}return i}function CS(n){return n===0||n===180?"center":n<180?"left":"right"}function OS(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function AS(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function ES(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:c}=t;if(!Tt(c)){const u=Mi(t.borderRadius),d=we(t.backdropPadding);n.fillStyle=c;const h=i-d.left,g=r-d.top,y=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Pr(n,{x:h,y:g,w:y,h:_,radius:u}),n.fill()):n.fillRect(h,g,y,_)}}function RS(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const s=n._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(n.getPointLabelContext(r));ES(e,a,s);const c=le(a.font),{x:u,y:d,textAlign:h}=s;er(e,n._pointLabels[r],u,d+c.lineHeight/2,c,{color:a.color,textAlign:h,textBaseline:"middle"})}}function rg(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,te);else{let s=n.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=n.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function PS(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:c,lineWidth:u}=t;!a&&!i||!c||!u||e<0||(s.save(),s.strokeStyle=c,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),rg(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function IS(n,t,e){return Di(n,{label:e,index:t,type:"pointLabel"})}class LS extends Ma{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:aa.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=we(Zc(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ae(t)&&!isNaN(t)?t:0,this.max=ae(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zc(this.options))}generateTickLabels(t){Ma.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Kt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?SS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=te/(this._pointLabels.length||1),i=this.options.startAngle||0;return Be(t*e+xe(i))}getDistanceFromCenterForValue(t){if(Tt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Tt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return IS(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-re+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),rg(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:s}=e,a=this._pointLabels.length;let c,u,d;if(e.pointLabels.display&&RS(this,a),r.display&&this.ticks.forEach((h,g)=>{if(g!==0||g===0&&this.min<0){u=this.getDistanceFromCenterForValue(h.value);const y=this.getContext(g),_=r.setContext(y),x=s.setContext(y);PS(this,_,u,a,x)}}),i.display){for(t.save(),c=a-1;c>=0;c--){const h=i.setContext(this.getPointLabelContext(c)),{color:g,lineWidth:y}=h;!y||!g||(t.lineWidth=y,t.strokeStyle=g,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,u=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),d=this.getPointPosition(c,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((c,u)=>{if(u===0&&this.min>=0&&!e.reverse)return;const d=i.setContext(this.getContext(u)),h=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(c.label).width,t.fillStyle=d.backdropColor;const g=we(d.backdropPadding);t.fillRect(-a/2-g.left,-s-h.size/2-g.top,a+g.width,h.size+g.height)}er(t,c.label,0,-s,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Da={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}},rn=Object.keys(Da);function sg(n,t){return n-t}function og(n,t){if(Tt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:s}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ae(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(r&&(a=r==="week"&&(Ti(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function ag(n,t,e,i){const r=rn.length;for(let s=rn.indexOf(n);s<r-1;++s){const a=Da[rn[s]],c=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(c*a.size))<=i)return rn[s]}return rn[r-1]}function NS(n,t,e,i,r){for(let s=rn.length-1;s>=rn.indexOf(e);s--){const a=rn[s];if(Da[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return rn[e?rn.indexOf(e):0]}function FS(n){for(let t=rn.indexOf(n)+1,e=rn.length;t<e;++t)if(Da[rn[t]].common)return rn[t]}function lg(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=yc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function BS(n,t,e,i){const r=n._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let c,u;for(c=s;c<=a;c=+r.add(c,1,i))u=e[c],u>=0&&(t[u].major=!0);return t}function cg(n,t,e){const i=[],r={},s=t.length;let a,c;for(a=0;a<s;++a)c=t[a],r[c]=a,i.push({value:c,major:!1});return s===0||!e?i:BS(n,i,r,e)}class Qc extends sr{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,e={}){const i=t.time||(t.time={}),r=this._adapter=new Zh._date(t.adapters.date);r.init(e),Cs(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:og(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:c}=this.getUserBounds();function u(d){!a&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!c&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!a||!c)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=ae(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),s=ae(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,c=lx(r,s,a);return this._unit=e.unit||(i.autoSkip?ag(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):NS(this,c.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:FS(this._unit),this.initOffsets(r),t.reverse&&c.reverse(),cg(this,c,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Ce(e,0,a),i=Ce(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||ag(s.minUnit,e,i,this._getLabelCapacity(e)),c=Mt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ti(u)||u===!0,h={};let g=e,y,_;if(d&&(g=+t.startOf(g,"isoWeek",u)),g=+t.startOf(g,d?"day":a),t.diff(i,e,a)>1e5*c)throw new Error(e+" and "+i+" are too far apart with stepSize of "+c+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(y=g,_=0;y<i;y=+t.add(y,c,a),_++)lg(h,y,x);return(y===i||r.bounds==="ticks"||_===1)&&lg(h,y,x),Object.keys(h).sort(sg).map(v=>+v)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,s=this._unit,a=e||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,r){const s=this.options,a=s.ticks.callback;if(a)return Kt(a,[t,e,i],this);const c=s.time.displayFormats,u=this._unit,d=this._majorUnit,h=u&&c[u],g=d&&c[d],y=i[e],_=d&&g&&y&&y.major;return this._adapter.format(t,r||(_?g:h))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=xe(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(r),a=Math.sin(r),c=this._resolveTickFontOptions(0).size;return{w:i*s+c*a,h:i*a+c*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,cg(this,[t],this._majorUnit),r),a=this._getLabelSize(s),c=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return c>0?c:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(og(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return oh(t.sort(sg))}}function ka(n,t,e){let i=0,r=n.length-1,s,a,c,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ni(n,"pos",t)),{pos:s,time:c}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ni(n,"time",t)),{time:s,pos:c}=n[i],{time:a,pos:u}=n[r]);const d=a-s;return d?c+(u-c)*(t-s)/d:c}class zS extends Qc{static id="timeseries";static defaults=Qc.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ka(e,this.min),this._tableRange=ka(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,c,u,d,h;for(a=0,c=t.length;a<c;++a)d=t[a],d>=e&&d<=i&&r.push(d);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,c=r.length;a<c;++a)h=r[a+1],u=r[a-1],d=r[a],Math.round((h+u)/2)!==d&&s.push({time:d,pos:a/(c-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ka(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ka(this._table,i*this._tableRange+this._minPos,!0)}}var US=Object.freeze({__proto__:null,CategoryScale:mS,LinearScale:_S,LogarithmicScale:wS,RadialLinearScale:LS,TimeScale:Qc,TimeSeriesScale:zS});const HS=[Hw,_1,fS,US],ug=6048e5,WS=864e5,Gs=6e4,Br=36e5,$S=1e3,dg=Symbol.for("constructDateFrom");function he(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&dg in n?n[dg](t):n instanceof Date?new n.constructor(t):new Date(t)}function Ot(n,t){return he(t||n,n)}function Ca(n,t,e){const i=Ot(n,e?.in);return isNaN(t)?he(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Jc(n,t,e){const i=Ot(n,e?.in);if(isNaN(t))return he(n,NaN);if(!t)return i;const r=i.getDate(),s=he(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function tu(n,t,e){return he(n,+Ot(n)+t)}function YS(n,t,e){return tu(n,t*Br)}let VS={};function ar(){return VS}function Vn(n,t){const e=ar(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Ot(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function zr(n,t){return Vn(n,{...t,weekStartsOn:1})}function fg(n,t){const e=Ot(n,t?.in),i=e.getFullYear(),r=he(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=zr(r),a=he(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=zr(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function Oa(n){const t=Ot(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function lr(n,...t){const e=he.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function eu(n,t){const e=Ot(n,t?.in);return e.setHours(0,0,0,0),e}function hg(n,t,e){const[i,r]=lr(e?.in,n,t),s=eu(i),a=eu(r),c=+s-Oa(s),u=+a-Oa(a);return Math.round((c-u)/WS)}function qS(n,t){const e=fg(n,t),i=he(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),zr(i)}function jS(n,t,e){const i=Ot(n,e?.in);return i.setTime(i.getTime()+t*Gs),i}function GS(n,t,e){return Jc(n,t*3,e)}function KS(n,t,e){return tu(n,t*1e3)}function XS(n,t,e){return Ca(n,t*7,e)}function ZS(n,t,e){return Jc(n,t*12,e)}function Ks(n,t){const e=+Ot(n)-+Ot(t);return e<0?-1:e>0?1:e}function QS(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function nu(n){return!(!QS(n)&&typeof n!="number"||isNaN(+Ot(n)))}function JS(n,t,e){const[i,r]=lr(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function tT(n,t,e){const[i,r]=lr(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function pg(n,t,e){const[i,r]=lr(e?.in,n,t),s=gg(i,r),a=Math.abs(hg(i,r));i.setDate(i.getDate()-s*a);const c=+(gg(i,r)===-s),u=s*(a-c);return u===0?0:u}function gg(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Xs(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function eT(n,t,e){const[i,r]=lr(e?.in,n,t),s=(+i-+r)/Br;return Xs(e?.roundingMethod)(s)}function iu(n,t){return+Ot(n)-+Ot(t)}function nT(n,t,e){const i=iu(n,t)/Gs;return Xs(e?.roundingMethod)(i)}function mg(n,t){const e=Ot(n,t?.in);return e.setHours(23,59,59,999),e}function yg(n,t){const e=Ot(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function iT(n,t){const e=Ot(n,t?.in);return+mg(e,t)==+yg(e,t)}function _g(n,t,e){const[i,r,s]=lr(e?.in,n,n,t),a=Ks(r,s),c=Math.abs(JS(r,s));if(c<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*c);let u=Ks(r,s)===-a;iT(i)&&c===1&&Ks(i,s)===1&&(u=!1);const d=a*(c-+u);return d===0?0:d}function rT(n,t,e){const i=_g(n,t,e)/3;return Xs(e?.roundingMethod)(i)}function sT(n,t,e){const i=iu(n,t)/1e3;return Xs(e?.roundingMethod)(i)}function oT(n,t,e){const i=pg(n,t,e)/7;return Xs(e?.roundingMethod)(i)}function aT(n,t,e){const[i,r]=lr(e?.in,n,t),s=Ks(i,r),a=Math.abs(tT(i,r));i.setFullYear(1584),r.setFullYear(1584);const c=Ks(i,r)===-s,u=s*(a-+c);return u===0?0:u}function lT(n,t){const e=Ot(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function cT(n,t){const e=Ot(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function uT(n,t){const e=Ot(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function bg(n,t){const e=Ot(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function dT(n,t){const e=Ot(n,t?.in);return e.setMinutes(59,59,999),e}function fT(n,t){const e=ar(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Ot(n,t?.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function hT(n,t){const e=Ot(n,t?.in);return e.setSeconds(59,999),e}function pT(n,t){const e=Ot(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function gT(n,t){const e=Ot(n,t?.in);return e.setMilliseconds(999),e}const mT={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"}},yT=(n,t,e)=>{let i;const r=mT[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function ru(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const _T={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bT={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xT={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wT={date:ru({formats:_T,defaultWidth:"full"}),time:ru({formats:bT,defaultWidth:"full"}),dateTime:ru({formats:xT,defaultWidth:"full"})},vT={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ST=(n,t,e,i)=>vT[n];function Zs(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,c=e?.width?String(e.width):a;r=n.formattingValues[c]||n.formattingValues[a]}else{const a=n.defaultWidth,c=e?.width?String(e.width):n.defaultWidth;r=n.values[c]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const TT={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MT={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DT={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"]},kT={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"]},CT={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"}},OT={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"}},AT={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Zs({values:TT,defaultWidth:"wide"}),quarter:Zs({values:MT,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Zs({values:DT,defaultWidth:"wide"}),day:Zs({values:kT,defaultWidth:"wide"}),dayPeriod:Zs({values:CT,defaultWidth:"wide",formattingValues:OT,defaultFormattingWidth:"wide"})};function Qs(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],c=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(c)?RT(c,g=>g.test(a)):ET(c,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function ET(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function RT(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function PT(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const c=t.slice(r.length);return{value:a,rest:c}}}const IT=/^(\d+)(th|st|nd|rd)?/i,LT=/\d+/i,NT={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},FT={any:[/^b/i,/^(a|c)/i]},BT={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zT={any:[/1/i,/2/i,/3/i,/4/i]},UT={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},HT={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]},WT={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},$T={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]},YT={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},VT={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}},qT={ordinalNumber:PT({matchPattern:IT,parsePattern:LT,valueCallback:n=>parseInt(n,10)}),era:Qs({matchPatterns:NT,defaultMatchWidth:"wide",parsePatterns:FT,defaultParseWidth:"any"}),quarter:Qs({matchPatterns:BT,defaultMatchWidth:"wide",parsePatterns:zT,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Qs({matchPatterns:UT,defaultMatchWidth:"wide",parsePatterns:HT,defaultParseWidth:"any"}),day:Qs({matchPatterns:WT,defaultMatchWidth:"wide",parsePatterns:$T,defaultParseWidth:"any"}),dayPeriod:Qs({matchPatterns:YT,defaultMatchWidth:"any",parsePatterns:VT,defaultParseWidth:"any"})},xg={code:"en-US",formatDistance:yT,formatLong:wT,formatRelative:ST,localize:AT,match:qT,options:{weekStartsOn:0,firstWeekContainsDate:1}};function jT(n,t){const e=Ot(n,t?.in);return hg(e,bg(e))+1}function wg(n,t){const e=Ot(n,t?.in),i=+zr(e)-+qS(e);return Math.round(i/ug)+1}function su(n,t){const e=Ot(n,t?.in),i=e.getFullYear(),r=ar(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=he(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const c=Vn(a,t),u=he(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Vn(u,t);return+e>=+c?i+1:+e>=+d?i:i-1}function GT(n,t){const e=ar(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=su(n,t),s=he(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Vn(s,t)}function vg(n,t){const e=Ot(n,t?.in),i=+Vn(e,t)-+GT(e,t);return Math.round(i/ug)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Ei={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Zt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Zt(e+1,2)},d(n,t){return Zt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Zt(n.getHours()%12||12,t.length)},H(n,t){return Zt(n.getHours(),t.length)},m(n,t){return Zt(n.getMinutes(),t.length)},s(n,t){return Zt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Zt(r,t.length)}},Ur={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sg={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return Ei.y(n,t)},Y:function(n,t,e,i){const r=su(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(n,t){const e=fg(n);return Zt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Zt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Ei.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=vg(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=wg(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Ei.d(n,t)},D:function(n,t,e){const i=jT(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Zt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Ur.noon:i===0?r=Ur.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Ur.evening:i>=12?r=Ur.afternoon:i>=4?r=Ur.morning:r=Ur.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Ei.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ei.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ei.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ei.s(n,t)},S:function(n,t){return Ei.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Mg(i);case"XXXX":case"XX":return cr(i);default:return cr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Mg(i);case"xxxx":case"xx":return cr(i);default:return cr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Tg(i,":");default:return"GMT"+cr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Tg(i,":");default:return"GMT"+cr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Zt(i,t.length)},T:function(n,t,e){return Zt(+n,t.length)}};function Tg(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Zt(s,2)}function Mg(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):cr(n,t)}function cr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return e+r+t+s}const Dg=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},kg=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},ou={p:kg,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return Dg(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Dg(i,t)).replace("{{time}}",kg(r,t))}},KT=/^D+$/,XT=/^Y+$/,ZT=["D","DD","YY","YYYY"];function Cg(n){return KT.test(n)}function Og(n){return XT.test(n)}function au(n,t,e){const i=QT(n,t,e);if(console.warn(i),ZT.includes(n))throw new RangeError(i)}function QT(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const JT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eM=/^'([^]*?)'?$/,nM=/''/g,iM=/[a-zA-Z]/;function Aa(n,t,e){const i=ar(),r=e?.locale??i.locale??xg,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=Ot(n,e?.in);if(!nu(c))throw new RangeError("Invalid time value");let u=t.match(tM).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=ou[g];return y(h,r.formatLong)}return h}).join("").match(JT).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:rM(h)};if(Sg[g])return{isToken:!0,value:h};if(g.match(iM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(c,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&Og(g)||!e?.useAdditionalDayOfYearTokens&&Cg(g))&&au(g,t,String(n));const y=Sg[g[0]];return y(c,g,r.localize,d)}).join("")}function rM(n){const t=n.match(eM);return t?t[1].replace(nM,"'"):n}function Ag(){return Object.assign({},ar())}function sM(n,t){const e=Ot(n,t?.in).getDay();return e===0?7:e}function oM(n,t){const e=aM(t)?new t(0):he(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function aM(n){return typeof n=="function"&&n.prototype?.constructor===n}const lM=10;class Eg{subPriority=0;validate(t,e){return!0}}class cM extends Eg{constructor(t,e,i,r,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class uM extends Eg{priority=lM;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,oM(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new cM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class dM extends Wt{priority=140;parse(t,e,i){switch(e){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,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const me={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}/},qn={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 ye(n,t){return n&&{value:t(n.value),rest:n.rest}}function de(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function jn(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(r*Br+s*Gs+a*$S),rest:t.slice(e[0].length)}}function Rg(n){return de(me.anyDigitsSigned,n)}function pe(n,t){switch(n){case 1:return de(me.singleDigit,t);case 2:return de(me.twoDigits,t);case 3:return de(me.threeDigits,t);case 4:return de(me.fourDigits,t);default:return de(new RegExp("^\\d{1,"+n+"}"),t)}}function Ea(n,t){switch(n){case 1:return de(me.singleDigitSigned,t);case 2:return de(me.twoDigitsSigned,t);case 3:return de(me.threeDigitsSigned,t);case 4:return de(me.fourDigitsSigned,t);default:return de(new RegExp("^-?\\d{1,"+n+"}"),t)}}function lu(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Pg(n,t){const e=t>0,i=e?t:1-t;let r;if(i<=50)r=n||100;else{const s=i+50,a=Math.trunc(s/100)*100,c=n>=s%100;r=n+a-(c?100:0)}return e?r:1-r}function Ig(n){return n%400===0||n%4===0&&n%100!==0}class fM extends Wt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="yy"});switch(e){case"y":return ye(pe(4,t),r);case"yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=Pg(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class hM extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return ye(pe(4,t),r);case"Yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=su(t,r);if(i.isTwoDigitYear){const c=Pg(i.year,s);return t.setFullYear(c,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Vn(t,r)}const a=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Vn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class pM extends Wt{priority=130;parse(t,e){return Ea(e==="R"?4:e.length,t)}set(t,e,i){const r=he(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),zr(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class gM extends Wt{priority=130;parse(t,e){return Ea(e==="u"?4:e.length,t)}set(t,e,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 mM extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 yM extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 _M extends Wt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"M":return ye(de(me.month,t),r);case"MM":return ye(pe(2,t),r);case"Mo":return ye(i.ordinalNumber(t,{unit:"month"}),r);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,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class bM extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return ye(de(me.month,t),r);case"LL":return ye(pe(2,t),r);case"Lo":return ye(i.ordinalNumber(t,{unit:"month"}),r);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,e){return e>=0&&e<=11}set(t,e,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 xM(n,t,e){const i=Ot(n,e?.in),r=vg(i,e)-t;return i.setDate(i.getDate()-r*7),Ot(i,e?.in)}class wM extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return de(me.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return Vn(xM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function vM(n,t,e){const i=Ot(n,e?.in),r=wg(i,e)-t;return i.setDate(i.getDate()-r*7),i}class SM extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return de(me.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return zr(vM(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const TM=[31,28,31,30,31,30,31,31,30,31,30,31],MM=[31,29,31,30,31,30,31,31,30,31,30,31];class DM extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return de(me.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=Ig(i),s=t.getMonth();return r?e>=1&&e<=MM[s]:e>=1&&e<=TM[s]}set(t,e,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 kM extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return de(me.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear();return Ig(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,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 cu(n,t,e){const i=ar(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Ot(n,e?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,h=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return Ca(s,h,e)}class CM extends Wt{priority=90;parse(t,e,i){switch(e){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,e){return e>=0&&e<=6}set(t,e,i,r){return t=cu(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class OM extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const c=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+c};switch(e){case"e":case"ee":return ye(pe(e.length,t),s);case"eo":return ye(i.ordinalNumber(t,{unit:"day"}),s);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,e){return e>=0&&e<=6}set(t,e,i,r){return t=cu(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class AM extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const c=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+c};switch(e){case"c":case"cc":return ye(pe(e.length,t),s);case"co":return ye(i.ordinalNumber(t,{unit:"day"}),s);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,e){return e>=0&&e<=6}set(t,e,i,r){return t=cu(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function EM(n,t,e){const i=Ot(n,e?.in),r=sM(i,e),s=t-r;return Ca(i,s,e)}class RM extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return ye(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return ye(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ye(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return ye(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"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=EM(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 PM extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(lu(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class IM extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(lu(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class LM extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(lu(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class NM extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return de(me.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const r=t.getHours()>=12;return r&&i<12?t.setHours(i+12,0,0,0):!r&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class FM extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return de(me.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class BM extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return de(me.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,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 zM extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return de(me.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const r=i<=24?i%24:i;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class UM extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return de(me.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class HM extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return de(me.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class WM extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return ye(pe(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class $M extends Wt{priority=10;parse(t,e){switch(e){case"X":return jn(qn.basicOptionalMinutes,t);case"XX":return jn(qn.basic,t);case"XXXX":return jn(qn.basicOptionalSeconds,t);case"XXXXX":return jn(qn.extendedOptionalSeconds,t);default:return jn(qn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-Oa(t)-i)}incompatibleTokens=["t","T","x"]}class YM extends Wt{priority=10;parse(t,e){switch(e){case"x":return jn(qn.basicOptionalMinutes,t);case"xx":return jn(qn.basic,t);case"xxxx":return jn(qn.basicOptionalSeconds,t);case"xxxxx":return jn(qn.extendedOptionalSeconds,t);default:return jn(qn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-Oa(t)-i)}incompatibleTokens=["t","T","X"]}class VM extends Wt{priority=40;parse(t){return Rg(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class qM extends Wt{priority=20;parse(t){return Rg(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const jM={G:new dM,y:new fM,Y:new hM,R:new pM,u:new gM,Q:new mM,q:new yM,M:new _M,L:new bM,w:new wM,I:new SM,d:new DM,D:new kM,E:new CM,e:new OM,c:new AM,i:new RM,a:new PM,b:new IM,B:new LM,h:new NM,H:new FM,K:new BM,k:new zM,m:new UM,s:new HM,S:new WM,X:new $M,x:new YM,t:new VM,T:new qM},GM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,XM=/^'([^]*?)'?$/,ZM=/''/g,QM=/\S/,JM=/[a-zA-Z]/;function tD(n,t,e,i){const r=()=>he(i?.in||e,NaN),s=Ag(),a=i?.locale??s.locale??xg,c=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(!t)return n?r():Ot(e,i?.in);const d={firstWeekContainsDate:c,weekStartsOn:u,locale:a},h=[new uM(i?.in,e)],g=t.match(KM).map(S=>{const C=S[0];if(C in ou){const E=ou[C];return E(S,a.formatLong)}return S}).join("").match(GM),y=[];for(let S of g){!i?.useAdditionalWeekYearTokens&&Og(S)&&au(S,t,n),!i?.useAdditionalDayOfYearTokens&&Cg(S)&&au(S,t,n);const C=S[0],E=jM[C];if(E){const{incompatibleTokens:U}=E;if(Array.isArray(U)){const I=y.find(B=>U.includes(B.token)||B.token===C);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${S}\` at the same time`)}else if(E.incompatibleTokens==="*"&&y.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);y.push({token:C,fullToken:S});const P=E.run(n,S,a.match,d);if(!P)return r();h.push(P.setter),n=P.rest}else{if(C.match(JM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=eD(S)),n.indexOf(S)===0)n=n.slice(S.length);else return r()}}if(n.length>0&&QM.test(n))return r();const _=h.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,E)=>E.indexOf(S)===C).map(S=>h.filter(C=>C.priority===S).sort((C,E)=>E.subPriority-C.subPriority)).map(S=>S[0]);let x=Ot(e,i?.in);if(isNaN(+x))return r();const v={};for(const S of _){if(!S.validate(x,d))return r();const C=S.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function eD(n){return n.match(XM)[1].replace(ZM,"'")}function nD(n,t){const e=Ot(n,t?.in);return e.setMinutes(0,0,0),e}function iD(n,t){const e=Ot(n,t?.in);return e.setSeconds(0,0),e}function rD(n,t){const e=Ot(n,t?.in);return e.setMilliseconds(0),e}function sD(n){const t=n/Br;return Math.trunc(t)}function Lg(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=cD(n);let s;if(r.date){const d=uD(r.date,i);s=dD(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let c=0,u;if(r.time&&(c=fD(r.time),isNaN(c)))return e();if(r.timezone){if(u=hD(r.timezone),isNaN(u))return e()}else{const d=new Date(a+c),h=Ot(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return Ot(a+c+u,t?.in)}const Ra={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},oD=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,aD=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,lD=/^([+-])(\d{2})(?::?(\d{2}))?$/;function cD(n){const t={},e=n.split(Ra.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Ra.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Ra.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=Ra.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function uD(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:n.slice((i[1]||i[2]).length)}}function dD(n,t){if(t===null)return new Date(NaN);const e=n.match(oD);if(!e)return new Date(NaN);const i=!!e[4],r=Js(e[1]),s=Js(e[2])-1,a=Js(e[3]),c=Js(e[4]),u=Js(e[5])-1;if(i)return _D(t,c,u)?pD(t,c,u):new Date(NaN);{const d=new Date(0);return!mD(t,s,a)||!yD(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Js(n){return n?parseInt(n):1}function fD(n){const t=n.match(aD);if(!t)return NaN;const e=uu(t[1]),i=uu(t[2]),r=uu(t[3]);return bD(e,i,r)?e*Br+i*Gs+r*1e3:NaN}function uu(n){return n&&parseFloat(n.replace(",","."))||0}function hD(n){if(n==="Z")return 0;const t=n.match(lD);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return xD(i,r)?e*(i*Br+r*Gs):NaN}function pD(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const gD=[31,null,31,30,31,30,31,31,30,31,30,31];function Ng(n){return n%400===0||n%4===0&&n%100!==0}function mD(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(gD[t]||(Ng(n)?29:28))}function yD(n,t){return t>=1&&t<=(Ng(n)?366:365)}function _D(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function bD(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function xD(n,t){return t>=0&&t<=59}const wD=1e3;var ht=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(ht||{});const vD=["in","not_in","selector"],SD=["empty","not_empty"],TD=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],ur=n=>n.filter(t=>t!=="time"),Fg=["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"],Bg=ur(Fg),MD=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],zg=[...Fg,"application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],Ug=ur(zg),DD=[...MD,"cache_hit_rate","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"],kD=["control_plane","control_plane_group","gateway_service","consumer","application","oidc_credential","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"],Hg=ur(kD);ur(["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","cache_status","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","oidc_credential","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"]),ur(["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 CD=["platform","platform_usage"],OD=n=>CD.includes(n),AD=[...zg,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],Wg=ur(AD);[...DD];const ED=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],$g=ur(ED);new Set(Bg),new Set(Ug),new Set(Hg),new Set(Wg),new Set($g);const Yg=[{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"}];Yg.map(n=>n.code);const RD=n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:vD},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:SD}},required:["field","operator"],additionalProperties:!1}]}}),PD=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];RD([...new Set([...Ug,...Bg,...Hg,...Wg,...PD,...$g])]);const ID={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"}},LD=(n,t,e)=>{let i;const r=ID[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function du(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const ND={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},FD={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},BD={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zD={date:du({formats:ND,defaultWidth:"full"}),time:du({formats:FD,defaultWidth:"full"}),dateTime:du({formats:BD,defaultWidth:"full"})},UD={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},HD=(n,t,e,i)=>UD[n];function to(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,c=e?.width?String(e.width):a;r=n.formattingValues[c]||n.formattingValues[a]}else{const a=n.defaultWidth,c=e?.width?String(e.width):n.defaultWidth;r=n.values[c]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const WD={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$D={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},YD={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"]},VD={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"]},qD={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"}},jD={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"}},GD=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},KD={ordinalNumber:GD,era:to({values:WD,defaultWidth:"wide"}),quarter:to({values:$D,defaultWidth:"wide",argumentCallback:n=>n-1}),month:to({values:YD,defaultWidth:"wide"}),day:to({values:VD,defaultWidth:"wide"}),dayPeriod:to({values:qD,defaultWidth:"wide",formattingValues:jD,defaultFormattingWidth:"wide"})};function eo(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],c=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(c)?ZD(c,g=>g.test(a)):XD(c,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function XD(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function ZD(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function QD(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const c=t.slice(r.length);return{value:a,rest:c}}}const JD=/^(\d+)(th|st|nd|rd)?/i,tk=/\d+/i,ek={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},nk={any:[/^b/i,/^(a|c)/i]},ik={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rk={any:[/1/i,/2/i,/3/i,/4/i]},sk={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},ok={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]},ak={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},lk={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]},ck={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},uk={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}},dk={ordinalNumber:QD({matchPattern:JD,parsePattern:tk,valueCallback:n=>parseInt(n,10)}),era:eo({matchPatterns:ek,defaultMatchWidth:"wide",parsePatterns:nk,defaultParseWidth:"any"}),quarter:eo({matchPatterns:ik,defaultMatchWidth:"wide",parsePatterns:rk,defaultParseWidth:"any",valueCallback:n=>n+1}),month:eo({matchPatterns:sk,defaultMatchWidth:"wide",parsePatterns:ok,defaultParseWidth:"any"}),day:eo({matchPatterns:ak,defaultMatchWidth:"wide",parsePatterns:lk,defaultParseWidth:"any"}),dayPeriod:eo({matchPatterns:ck,defaultMatchWidth:"any",parsePatterns:uk,defaultParseWidth:"any"})},fk={code:"en-US",formatDistance:LD,formatLong:zD,formatRelative:HD,localize:KD,match:dk,options:{weekStartsOn:0,firstWeekContainsDate:1}};let hk={};function no(){return hk}const Vg=6048e5,pk=864e5,gk=60,mk=3600,qg=Symbol.for("constructDateFrom");function Mn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&qg in n?n[qg](t):n instanceof Date?new n.constructor(t):new Date(t)}function We(n,t){return Mn(t||n,n)}function jg(n){const t=We(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function yk(n,...t){const e=Mn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Hr(n,t){const e=We(n,t?.in);return e.setHours(0,0,0,0),e}function _k(n,t,e){const[i,r]=yk(e?.in,n,t),s=Hr(i),a=Hr(r),c=+s-jg(s),u=+a-jg(a);return Math.round((c-u)/pk)}function bk(n,t){const e=We(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function xk(n,t){const e=We(n,t?.in);return _k(e,bk(e))+1}function oi(n,t){const e=no(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=We(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Pa(n,t){return oi(n,{...t,weekStartsOn:1})}function Gg(n,t){const e=We(n,t?.in),i=e.getFullYear(),r=Mn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Pa(r),a=Mn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=Pa(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function wk(n,t){const e=Gg(n,t),i=Mn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Pa(i)}function vk(n,t){const e=We(n,t?.in),i=+Pa(e)-+wk(e);return Math.round(i/Vg)+1}function Kg(n,t){const e=We(n,t?.in),i=e.getFullYear(),r=no(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Mn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const c=oi(a,t),u=Mn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=oi(u,t);return+e>=+c?i+1:+e>=+d?i:i-1}function Sk(n,t){const e=no(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Kg(n,t),s=Mn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),oi(s,t)}function Tk(n,t){const e=We(n,t?.in),i=+oi(e,t)-+Sk(e,t);return Math.round(i/Vg)+1}function Qt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Ri={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Qt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Qt(e+1,2)},d(n,t){return Qt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Qt(n.getHours()%12||12,t.length)},H(n,t){return Qt(n.getHours(),t.length)},m(n,t){return Qt(n.getMinutes(),t.length)},s(n,t){return Qt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Qt(r,t.length)}},Wr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Xg={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return Ri.y(n,t)},Y:function(n,t,e,i){const r=Kg(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Qt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Qt(s,t.length)},R:function(n,t){const e=Gg(n);return Qt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Qt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Qt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Qt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Ri.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Qt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=Tk(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(n,t,e){const i=vk(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Qt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Ri.d(n,t)},D:function(n,t,e){const i=xk(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Qt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Qt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Qt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Qt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Wr.noon:i===0?r=Wr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Wr.evening:i>=12?r=Wr.afternoon:i>=4?r=Wr.morning:r=Wr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Ri.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ri.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ri.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ri.s(n,t)},S:function(n,t){return Ri.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Qg(i);case"XXXX":case"XX":return dr(i);default:return dr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Qg(i);case"xxxx":case"xx":return dr(i);default:return dr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zg(i,":");default:return"GMT"+dr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zg(i,":");default:return"GMT"+dr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Qt(i,t.length)},T:function(n,t,e){return Qt(+n,t.length)}};function Zg(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Qt(s,2)}function Qg(n,t){return n%60===0?(n>0?"-":"+")+Qt(Math.abs(n)/60,2):dr(n,t)}function dr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Qt(Math.trunc(i/60),2),s=Qt(i%60,2);return e+r+t+s}const Jg=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},tm=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Mk=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return Jg(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Jg(i,t)).replace("{{time}}",tm(r,t))},Dk={p:tm,P:Mk},kk=/^D+$/,Ck=/^Y+$/,Ok=["D","DD","YY","YYYY"];function Ak(n){return kk.test(n)}function Ek(n){return Ck.test(n)}function Rk(n,t,e){const i=Pk(n,t,e);if(console.warn(i),Ok.includes(n))throw new RangeError(i)}function Pk(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Ik(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Lk(n){return!(!Ik(n)&&typeof n!="number"||isNaN(+We(n)))}const Nk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bk=/^'([^]*?)'?$/,zk=/''/g,Uk=/[a-zA-Z]/;function Hk(n,t,e){const i=no(),r=e?.locale??i.locale??fk,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=We(n,e?.in);if(!Lk(c))throw new RangeError("Invalid time value");let u=t.match(Fk).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=Dk[g];return y(h,r.formatLong)}return h}).join("").match(Nk).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:Wk(h)};if(Xg[g])return{isToken:!0,value:h};if(g.match(Uk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(c,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&Ek(g)||!e?.useAdditionalDayOfYearTokens&&Ak(g))&&Rk(g,t,String(n));const y=Xg[g[0]];return y(c,g,r.localize,d)}).join("")}function Wk(n){const t=n.match(Bk);return t?t[1].replace(zk,"'"):n}function Ia(n,t,e){const i=We(n,e?.in);return isNaN(t)?Mn(n,NaN):(i.setDate(i.getDate()+t),i)}function em(n,t,e){const i=We(n,e?.in);if(isNaN(t))return Mn(n,NaN);if(!t)return i;const r=i.getDate(),s=Mn(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function $k(n,t,e){return em(n,t*3,e)}function $r(n,t){const e=We(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Yr(n,t){const e=We(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Yk(n,t){const e=We(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Mn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Vk(){return Object.assign({},no())}function nm(n){return Math.trunc(n*mk)}function qk(n){const t=n/gk;return Math.trunc(t)}function im(n,t,e){return em(n,-1,e)}function rm(n,t,e){return $k(n,-1,e)}function sm(n,t,e){const i=Vk(),r=Kk(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?jk(r,t):Gk(r,t)}function jk(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Gk(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Kk(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Xk(n,t){const e=eC(t);return"formatToParts"in e?Qk(e,n):Jk(e,n)}const Zk={year:0,month:1,day:2,hour:3,minute:4,second:5};function Qk(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=Zk[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Jk(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const fu={},om=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")),tC=om==="06/25/2014, 00:00:00"||om==="06/25/2014 00:00:00";function eC(n){return fu[n]||(fu[n]=tC?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),fu[n]}function hu(n,t,e,i,r,s,a){const c=new Date(0);return c.setUTCFullYear(n,t,e),c.setUTCHours(i,r,s,a),c}const am=36e5,nC=6e4,pu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function io(n,t,e){if(!n)return 0;let i=pu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=pu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),lm(r)?-(r*am):NaN;if(i=pu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return lm(r,a)?(s=Math.abs(r)*am+a*nC,i[1]==="+"?-s:s):NaN}if(sC(n)){t=new Date(t||Date.now());const a=e?t:iC(t),c=gu(a,n);return-(e?c:rC(t,c,n))}return NaN}function iC(n){return hu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function gu(n,t){const e=Xk(n,t),i=hu(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function rC(n,t,e){let i=n.getTime()-t;const r=gu(new Date(i),e);if(t===r)return t;i-=r-t;const s=gu(new Date(i),e);return r===s?r:Math.max(r,s)}function lm(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const cm={};function sC(n){if(cm[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),cm[n]=!0,!0}catch{return!1}}const oC=60*1e3,aC={X:function(n,t,e){const i=mu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return um(i);case"XXXX":case"XX":return Vr(i);default:return Vr(i,":")}},x:function(n,t,e){const i=mu(e.timeZone,n);switch(t){case"x":return um(i);case"xxxx":case"xx":return Vr(i);default:return Vr(i,":")}},O:function(n,t,e){const i=mu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+lC(i,":");default:return"GMT"+Vr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return sm("short",n,e);default:return sm("long",n,e)}}};function mu(n,t){const e=n?io(n,t,!0)/oC:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function La(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Vr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=La(Math.floor(i/60),2),s=La(Math.floor(i%60),2);return e+r+t+s}function um(n,t){return n%60===0?(n>0?"-":"+")+La(Math.abs(n)/60,2):Vr(n,t)}function lC(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+La(s,2)}function dm(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const fm=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,yu=36e5,hm=6e4,cC=2,je={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:fm};function Na(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?cC:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=uC(n),{year:r,restDateString:s}=dC(i.date,e),a=fC(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const c=a.getTime();let u=0,d;if(i.time&&(u=hC(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=io(i.timeZone||t.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=dm(new Date(c+u)),d=dm(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function uC(n){const t={};let e=je.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=je.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=je.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function dC(n,t){if(n){const e=je.YYY[t],i=je.YYYYY[t];let r=je.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=je.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function fC(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=je.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,mm(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=je.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return mC(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=je.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return mm(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=je.Www.exec(n),s)return r=parseInt(s[1],10)-1,ym(r)?pm(t,r):new Date(NaN);if(s=je.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return ym(r,a)?pm(t,r,a):new Date(NaN)}return null}function hC(n){let t,e,i=je.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),_u(t)?t%24*yu:NaN;if(i=je.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),_u(t,e)?t%24*yu+e*hm:NaN;if(i=je.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return _u(t,e,r)?t%24*yu+e*hm+r*1e3:NaN}return null}function pm(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const pC=[31,28,31,30,31,30,31,31,30,31,30,31],gC=[31,29,31,30,31,30,31,31,30,31,30,31];function gm(n){return n%400===0||n%4===0&&n%100!==0}function mm(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gm(n);if(i&&e>gC[t]||!i&&e>pC[t])return!1}return!0}function mC(n,t){if(t<1)return!1;const e=gm(n);return!(e&&t>366||!e&&t>365)}function ym(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function _u(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const yC=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function _C(n,t,e={}){t=String(t);const i=t.match(yC);if(i){const r=Na(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const c=s.indexOf(a),u=s[c-1]==="'",d=s.replace(a,"'"+aC[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return Hk(n,t,e)}function _m(n,t,e){n=Na(n,e);const i=io(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function bm(n,t,e,i){return i={...i,timeZone:t,originalDate:n},_C(_m(n,t,{timeZone:i.timeZone}),e,i)}function bC(n,t,e){if(typeof n=="string"&&!n.match(fm))return Na(n,{...e,timeZone:t});n=Na(n,e);const i=hu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=io(t,new Date(i));return new Date(i+r)}function xC(n,t){return-io(n,t)}function xm(n,t={}){const e=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)"),bm(n,e,i)}function wC(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return bm(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const vC={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 bu(n){return n&&TD.find(t=>n<=vC[t])||null}var Fa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ba={exports:{}};Ba.exports;var wm;function SC(){return wm||(wm=1,(function(n,t){var e=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",c="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",y="[object Map]",_="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",C="[object Set]",E="[object String]",U="[object Symbol]",P="[object WeakMap]",I="[object ArrayBuffer]",B="[object DataView]",N="[object Float32Array]",T="[object Float64Array]",D="[object Int8Array]",O="[object Int16Array]",L="[object Int32Array]",W="[object Uint8Array]",tt="[object Uint8ClampedArray]",G="[object Uint16Array]",nt="[object Uint32Array]",X=/[\\^$.*+?()[\]{}|]/g,Q=/\w*$/,rt=/^\[object .+?Constructor\]$/,st=/^(?:0|[1-9]\d*)$/,ot={};ot[s]=ot[a]=ot[I]=ot[B]=ot[c]=ot[u]=ot[N]=ot[T]=ot[D]=ot[O]=ot[L]=ot[y]=ot[_]=ot[x]=ot[S]=ot[C]=ot[E]=ot[U]=ot[W]=ot[tt]=ot[G]=ot[nt]=!0,ot[d]=ot[h]=ot[P]=!1;var H=typeof Fa=="object"&&Fa&&Fa.Object===Object&&Fa,V=typeof self=="object"&&self&&self.Object===Object&&self,J=H||V||Function("return this")(),_t=t&&!t.nodeType&&t,pt=_t&&!0&&n&&!n.nodeType&&n,it=pt&&pt.exports===_t;function ft(k,$){return k.set($[0],$[1]),k}function ut(k,$){return k.add($),k}function dt(k,$){for(var Z=-1,mt=k?k.length:0;++Z<mt&&$(k[Z],Z,k)!==!1;);return k}function gt(k,$){for(var Z=-1,mt=$.length,Me=k.length;++Z<mt;)k[Me+Z]=$[Z];return k}function lt(k,$,Z,mt){for(var Me=-1,Ye=k?k.length:0;++Me<Ye;)Z=$(Z,k[Me],Me,k);return Z}function It(k,$){for(var Z=-1,mt=Array(k);++Z<k;)mt[Z]=$(Z);return mt}function Bt(k,$){return k?.[$]}function wt(k){var $=!1;if(k!=null&&typeof k.toString!="function")try{$=!!(k+"")}catch{}return $}function kt(k){var $=-1,Z=Array(k.size);return k.forEach(function(mt,Me){Z[++$]=[Me,mt]}),Z}function Dt(k,$){return function(Z){return k($(Z))}}function ve(k){var $=-1,Z=Array(k.size);return k.forEach(function(mt){Z[++$]=mt}),Z}var bt=Array.prototype,Vt=Function.prototype,Se=Object.prototype,Ae=J["__core-js_shared__"],oe=(function(){var k=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return k?"Symbol(src)_1."+k:""})(),on=Vt.toString,qt=Se.hasOwnProperty,Ie=Se.toString,ie=RegExp("^"+on.call(qt).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=it?J.Buffer:void 0,Ee=J.Symbol,gn=J.Uint8Array,zi=Dt(Object.getPrototypeOf,Object),kn=Object.create,$e=Se.propertyIsEnumerable,In=bt.splice,li=Object.getOwnPropertySymbols,wo=Te?Te.isBuffer:void 0,vo=Dt(Object.keys,Object),br=Gn(J,"DataView"),ci=Gn(J,"Map"),So=Gn(J,"Promise"),To=Gn(J,"Set"),Mo=Gn(J,"WeakMap"),Ui=Gn(Object,"create"),ol=di(br),sd=di(ci),od=di(So),ad=di(To),ld=di(Mo),Do=Ee?Ee.prototype:void 0,al=Do?Do.valueOf:void 0;function ui(k){var $=-1,Z=k?k.length:0;for(this.clear();++$<Z;){var mt=k[$];this.set(mt[0],mt[1])}}function cd(){this.__data__=Ui?Ui(null):{}}function ko(k){return this.has(k)&&delete this.__data__[k]}function ud(k){var $=this.__data__;if(Ui){var Z=$[k];return Z===i?void 0:Z}return qt.call($,k)?$[k]:void 0}function Co(k){var $=this.__data__;return Ui?$[k]!==void 0:qt.call($,k)}function dd(k,$){var Z=this.__data__;return Z[k]=Ui&&$===void 0?i:$,this}ui.prototype.clear=cd,ui.prototype.delete=ko,ui.prototype.get=ud,ui.prototype.has=Co,ui.prototype.set=dd;function Ln(k){var $=-1,Z=k?k.length:0;for(this.clear();++$<Z;){var mt=k[$];this.set(mt[0],mt[1])}}function fd(){this.__data__=[]}function hd(k){var $=this.__data__,Z=xr($,k);if(Z<0)return!1;var mt=$.length-1;return Z==mt?$.pop():In.call($,Z,1),!0}function pd(k){var $=this.__data__,Z=xr($,k);return Z<0?void 0:$[Z][1]}function ll(k){return xr(this.__data__,k)>-1}function gd(k,$){var Z=this.__data__,mt=xr(Z,k);return mt<0?Z.push([k,$]):Z[mt][1]=$,this}Ln.prototype.clear=fd,Ln.prototype.delete=hd,Ln.prototype.get=pd,Ln.prototype.has=ll,Ln.prototype.set=gd;function Hi(k){var $=-1,Z=k?k.length:0;for(this.clear();++$<Z;){var mt=k[$];this.set(mt[0],mt[1])}}function cl(){this.__data__={hash:new ui,map:new(ci||Ln),string:new ui}}function md(k){return wr(this,k).delete(k)}function yd(k){return wr(this,k).get(k)}function _d(k){return wr(this,k).has(k)}function bd(k,$){return wr(this,k).set(k,$),this}Hi.prototype.clear=cl,Hi.prototype.delete=md,Hi.prototype.get=yd,Hi.prototype.has=_d,Hi.prototype.set=bd;function Wi(k){this.__data__=new Ln(k)}function xd(){this.__data__=new Ln}function es(k){return this.__data__.delete(k)}function wd(k){return this.__data__.get(k)}function ns(k){return this.__data__.has(k)}function vd(k,$){var Z=this.__data__;if(Z instanceof Ln){var mt=Z.__data__;if(!ci||mt.length<e-1)return mt.push([k,$]),this;Z=this.__data__=new Hi(mt)}return Z.set(k,$),this}Wi.prototype.clear=xd,Wi.prototype.delete=es,Wi.prototype.get=wd,Wi.prototype.has=ns,Wi.prototype.set=vd;function Sd(k,$){var Z=Po(k)||Sl(k)?It(k.length,String):[],mt=Z.length,Me=!!mt;for(var Ye in k)qt.call(k,Ye)&&!(Me&&(Ye=="length"||bl(Ye,mt)))&&Z.push(Ye);return Z}function ul(k,$,Z){var mt=k[$];(!(qt.call(k,$)&&vl(mt,Z))||Z===void 0&&!($ in k))&&(k[$]=Z)}function xr(k,$){for(var Z=k.length;Z--;)if(vl(k[Z][0],$))return Z;return-1}function dl(k,$){return k&&Ao($,Io($),k)}function is(k,$,Z,mt,Me,Ye,Nn){var Le;if(mt&&(Le=Ye?mt(k,Me,Ye,Nn):mt(k)),Le!==void 0)return Le;if(!ls(k))return k;var Ml=Po(k);if(Ml){if(Le=yl(k),!$)return ml(k,Le)}else{var ce=an(k),cs=ce==h||ce==g;if(Id(k))return hl(k,$);if(ce==x||ce==s||cs&&!Ye){if(wt(k))return Ye?k:{};if(Le=_l(cs?{}:k),!$)return Eo(k,dl(Le,k))}else{if(!ot[ce])return Ye?k:{};Le=Ed(k,ce,is,$)}}Nn||(Nn=new Wi);var Kn=Nn.get(k);if(Kn)return Kn;if(Nn.set(k,Le),!Ml)var Lo=Z?Ad(k):Io(k);return dt(Lo||k,function(vr,Ne){Lo&&(Ne=vr,vr=k[Ne]),ul(Le,Ne,is(vr,$,Z,mt,Ne,k,Nn))}),Le}function Td(k){return ls(k)?kn(k):{}}function Md(k,$,Z){var mt=$(k);return Po(k)?mt:gt(mt,Z(k))}function Dd(k){return Ie.call(k)}function kd(k){if(!ls(k)||wl(k))return!1;var $=as(k)||wt(k)?ie:rt;return $.test(di(k))}function fl(k){if(!Ro(k))return vo(k);var $=[];for(var Z in Object(k))qt.call(k,Z)&&Z!="constructor"&&$.push(Z);return $}function hl(k,$){if($)return k.slice();var Z=new k.constructor(k.length);return k.copy(Z),Z}function rs(k){var $=new k.constructor(k.byteLength);return new gn($).set(new gn(k)),$}function Oo(k,$){var Z=$?rs(k.buffer):k.buffer;return new k.constructor(Z,k.byteOffset,k.byteLength)}function Cd(k,$,Z){var mt=$?Z(kt(k),!0):kt(k);return lt(mt,ft,new k.constructor)}function pl(k){var $=new k.constructor(k.source,Q.exec(k));return $.lastIndex=k.lastIndex,$}function ss(k,$,Z){var mt=$?Z(ve(k),!0):ve(k);return lt(mt,ut,new k.constructor)}function gl(k){return al?Object(al.call(k)):{}}function Od(k,$){var Z=$?rs(k.buffer):k.buffer;return new k.constructor(Z,k.byteOffset,k.length)}function ml(k,$){var Z=-1,mt=k.length;for($||($=Array(mt));++Z<mt;)$[Z]=k[Z];return $}function Ao(k,$,Z,mt){Z||(Z={});for(var Me=-1,Ye=$.length;++Me<Ye;){var Nn=$[Me],Le=void 0;ul(Z,Nn,Le===void 0?k[Nn]:Le)}return Z}function Eo(k,$){return Ao(k,os(k),$)}function Ad(k){return Md(k,Io,os)}function wr(k,$){var Z=k.__data__;return xl($)?Z[typeof $=="string"?"string":"hash"]:Z.map}function Gn(k,$){var Z=Bt(k,$);return kd(Z)?Z:void 0}var os=li?Dt(li,Object):Fd,an=Dd;(br&&an(new br(new ArrayBuffer(1)))!=B||ci&&an(new ci)!=y||So&&an(So.resolve())!=v||To&&an(new To)!=C||Mo&&an(new Mo)!=P)&&(an=function(k){var $=Ie.call(k),Z=$==x?k.constructor:void 0,mt=Z?di(Z):void 0;if(mt)switch(mt){case ol:return B;case sd:return y;case od:return v;case ad:return C;case ld:return P}return $});function yl(k){var $=k.length,Z=k.constructor($);return $&&typeof k[0]=="string"&&qt.call(k,"index")&&(Z.index=k.index,Z.input=k.input),Z}function _l(k){return typeof k.constructor=="function"&&!Ro(k)?Td(zi(k)):{}}function Ed(k,$,Z,mt){var Me=k.constructor;switch($){case I:return rs(k);case c:case u:return new Me(+k);case B:return Oo(k,mt);case N:case T:case D:case O:case L:case W:case tt:case G:case nt:return Od(k,mt);case y:return Cd(k,mt,Z);case _:case E:return new Me(k);case S:return pl(k);case C:return ss(k,mt,Z);case U:return gl(k)}}function bl(k,$){return $=$??r,!!$&&(typeof k=="number"||st.test(k))&&k>-1&&k%1==0&&k<$}function xl(k){var $=typeof k;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?k!=="__proto__":k===null}function wl(k){return!!oe&&oe in k}function Ro(k){var $=k&&k.constructor,Z=typeof $=="function"&&$.prototype||Se;return k===Z}function di(k){if(k!=null){try{return on.call(k)}catch{}try{return k+""}catch{}}return""}function Rd(k){return is(k,!0,!0)}function vl(k,$){return k===$||k!==k&&$!==$}function Sl(k){return Pd(k)&&qt.call(k,"callee")&&(!$e.call(k,"callee")||Ie.call(k)==s)}var Po=Array.isArray;function Tl(k){return k!=null&&Ld(k.length)&&!as(k)}function Pd(k){return Nd(k)&&Tl(k)}var Id=wo||ee;function as(k){var $=ls(k)?Ie.call(k):"";return $==h||$==g}function Ld(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=r}function ls(k){var $=typeof k;return!!k&&($=="object"||$=="function")}function Nd(k){return!!k&&typeof k=="object"}function Io(k){return Tl(k)?Sd(k):fl(k)}function Fd(){return[]}function ee(){return!1}n.exports=Rd})(Ba,Ba.exports)),Ba.exports}SC();const Dn=(n,t)=>new Date(n.getTime()-xC(t,n));class Oe{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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=168&&e.add("hourly"),i>=48&&e.add("daily"),i>=672&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=bC(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return _m(e,t)}}class TC extends Oe{rawStart(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class MC extends Oe{rawStart(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class DC extends Oe{rawStart(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class kC extends Oe{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class CC extends Oe{rawEnd(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Dn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=oi(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Dn(i,t)),i}}class OC extends Oe{rawEnd(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}rawStart(t){let e=$r(rm(this.tzAdjustedDate(t)));return t&&(e=Dn(e,t)),e}}class AC extends Oe{rawEnd(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}rawStart(t){let e=Yr(im(this.tzAdjustedDate(t)));return t&&(e=Dn(e,t)),e}}class EC extends Oe{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Dn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Dn(e,t)),e}}ht.FIFTEEN_MIN,new Oe({key:ht.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"]}),ht.ONE_HOUR,new Oe({key:ht.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"]}),ht.SIX_HOUR,new Oe({key:ht.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"]}),ht.TWELVE_HOUR,new Oe({key:ht.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"]}),ht.ONE_DAY,new Oe({key:ht.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"]}),ht.SEVEN_DAY,new Oe({key:ht.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"]}),ht.THIRTY_DAY,new Oe({key:ht.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"]}),ht.NINETY_DAY,new Oe({key:ht.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"]}),ht.ONE_HUNDRED_EIGHTY_DAY,new Oe({key:ht.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"]}),ht.ONE_YEAR,new Oe({key:ht.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"]}),ht.CURRENT_WEEK,new TC({key:ht.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=oi(new Date,{weekStartsOn:1});return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ht.CURRENT_MONTH,new MC({key:ht.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Yr(new Date);return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.CURRENT_QUARTER,new DC({key:ht.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=$r(new Date);return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.CURRENT_YEAR,new kC({key:ht.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.PREVIOUS_WEEK,new CC({key:ht.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"]}),ht.PREVIOUS_MONTH,new AC({key:ht.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Yr(new Date),e=Yr(im(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=vm(t,e)),3600*24*Yk(new Date().setMonth(new Date().getMonth()-1))+nm(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.PREVIOUS_QUARTER,new OC({key:ht.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=$r(new Date),t=$r(rm(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.PREVIOUS_YEAR,new EC({key:ht.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=vm(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+nm(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function vm(n,t){return qk(n.getTimezoneOffset()-t.getTimezoneOffset())}ht.FIFTEEN_MIN,ht.ONE_HOUR,ht.SIX_HOUR,ht.TWELVE_HOUR,ht.ONE_DAY,ht.SEVEN_DAY,ht.FIFTEEN_MIN,ht.ONE_HOUR,ht.SIX_HOUR,ht.TWELVE_HOUR,ht.ONE_DAY,ht.SEVEN_DAY,ht.THIRTY_DAY,ht.NINETY_DAY,ht.ONE_HUNDRED_EIGHTY_DAY,ht.ONE_YEAR,ht.CURRENT_WEEK,ht.CURRENT_MONTH,ht.CURRENT_QUARTER,ht.CURRENT_YEAR,ht.PREVIOUS_WEEK,ht.PREVIOUS_MONTH,ht.PREVIOUS_QUARTER,ht.PREVIOUS_YEAR;const RC=new Map(Yg.map(n=>[n.code,{code:n.code,name:n.name}])),xu=n=>RC.get(n)?.name||n,Sm=1e3,PC=1e4,Tm=1e6,Mm=1e9,Dm=1e12,za=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},ro=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function Ua(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?PC:Sm;return n<r||t.precision&&t.precision>Math.log10(n)?e=za(ro(n,1,t),t):n<Tm?e=`${ro(n,Sm,t)}k`:n<Mm?e=`${ro(n,Tm,t)}m`:n<Dm?e=`${za(ro(n,Mm,t),t)}b`:e=`${za(ro(n,Dm,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}Ua.addCommas=za;const IC=typeof document<"u"&&document.documentElement?.lang||"en-US",Ha=new Intl.NumberFormat(IC);function fr({i18n:n}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,c=r?Math.pow(2,30):1e9,u=r?Math.pow(2,20):1e6,d=r?Math.pow(2,10):1e3;let h;return i>=s?h=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=c?h=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},e=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?n.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:c=!1,translateUnit:u=d=>d}={})=>{const d=u(r,i);switch(r){case"bytes":return t(i,s);case"usd":return e(i,a);default:return isNaN(i)?`${i}`:c?`${Ua(i,{capital:!0})} ${d}`:i>=.01?`${Ha.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:e,formatRange:(i,r,s,{isBytes1024:a=!1,currency:c="USD",approximate:u=!1,translateUnit:d=h=>h}={})=>{const h=d(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${e(i,c)} - ${e(r,c)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${Ua(i,{capital:!0})} - ${Ua(r,{capital:!0})} ${h}`}const g=i>=.01?`${Ha.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,y=r>=.01?`${Ha.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${g} - ${y} ${h}`}}}const Wa=n=>["interactive","zoom-interactive"].includes(n),km=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Wa(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=Pt.useI18n(),{formatUnit:a}=fr({i18n:s}),c=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Wa(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",h=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(h,e):ao({tickValue:new Date(h),granularity:e}),n.tooltipSeries=r.dataPoints.map((g,y)=>{const _=g.parsed[d],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=g.dataset.label;return{backgroundColor:u[y].backgroundColor,borderColor:u[y].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(c),n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},Cm=(n,t)=>{const{tooltip:e}=t,{i18n:i}=Pt.useI18n(),{formatUnit:r}=fr({i18n:i});if(e.opacity===0&&!Wa(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,c)=>c.rawValue-a.rawValue);if(e.body&&!Wa(n.interactionMode)){const a=e.labelColors,c=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((d,h)=>{const g=u?d.parsed:d.parsed[c],y=r(g??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:y,rawValue:g,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},LC=n=>n&&n.datasets&&n.datasets.length,NC=n=>LC(n)&&n.datasets.some(t=>t.data.length),FC=n=>n.datasets.some(t=>t.data[0]&&nu(t.data[0].x)),BC=n=>!!NC(n)&&n.datasets.some(t=>t.data.length==1),zC=n=>FC(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),wu=(n,t,e)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,c=n.x??0;return c<e?c+t*s*(1-r):c-t*a*(1-r)},UC=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function Om(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Am=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(e)},HC=2,Em=10,Rm=12,$a=10,WC="#f1f0ff",$C="#e0e4ea",Pm="#6c7489",YC="#afb7c5",VC="#d60027",qC="#ad000e",vu="#6c7489",Im="#52596e",jC="#007d60",GC="#995c00",KC="#ffc400",XC="'Inter', Roboto, Helvetica, sans-serif",so="16px",ZC="20px",QC="#bee2ff",JC="#8fc1ff",tO="#5f9aff",eO="#306fff",nO="#b5ffee",iO="#00fabe",rO="#00d6a4",sO="#00a17b",oO="#007d60",aO="#005944",lO="#b5ffee",cO="#00fabe",uO="#b5ffee",dO="#00a17b",fO="#fff296",hO="#ffe04b",pO="#ffc400",gO="#b37600",mO="#995c00",yO="#804400",_O="#fff296",bO="#ffe04b",xO="#ffc2b3",wO="#ff9877",vO="#ff723c",SO="#f75008",TO="#d13500",MO="#a31f00",DO="#ffc2b3",kO="#ff9877",CO="#ff723c",OO="#f75008",AO="#d13500",EO="#a31f00",RO="#ffc2b3",PO="#ff9877",IO="#ff723c",LO="#f75008",NO="#d13500",FO="#a31f00",BO="#ffc2b3",zO="#ff9877",UO="#ff723c",HO="#f75008",WO="#d13500",$O="#a31f00",YO="#ffc2b3",VO="#ff9877",qO="#ff723c",jO="#f75008",GO="#d13500",KO="#ffabab",XO="#ff7272",ZO="#ff3954",QO="#f50045",JO="#d60027",tA="#ad000e",eA="#ffabab",nA="#ff7272",iA="#ff3954",rA="#f50045",sA="#d60027",oA="#eefaff",aA="#ecfffb",lA="#fffce0",cA="#fff1ef",uA="#ffe5e5",dA="#5f9aff",fA="#00d6a4",hA="#ffc400",pA="#ff723c",gA="#ff3954",Pi=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Su=(n,t)=>(t||Pi)[n%Pi.length],mA="#6f7787",yA={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"}},_A=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return yA[t]?.background||"#fafafa"},bA=YC,Lm=(n,t,e,i)=>{let r;return e?r=bA:Array.isArray(i)?r=Su(n,i):r=i[t],r||Su(n)},Tu=n=>{switch(n){case"error":return VC;case"warning":return KC;case"neutral":return Pm;default:return Pm}},xA={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},wA=2,vA=0,Mu=new Map,Nm=(n,t)=>{const{i18n:e}=Pt.useI18n(),{formatBytes:i}=fr({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):Ha.format(n)},SA=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},TA=()=>{const n="label_height";if(!Mu.has(n)){const t=le({});Mu.set(n,t.lineHeight)}return Mu.get(n)},MA=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):e,0),DA=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,kA=$C,CA={100:QC,101:JC,102:tO,103:eO,200:nO,201:iO,202:rO,203:sO,204:oO,205:aO,206:lO,207:cO,208:uO,226:dO,300:fO,301:hO,302:pO,303:gO,304:mO,305:yO,307:_O,308:bO,400:xO,401:wO,402:vO,403:SO,404:TO,405:MO,406:DO,407:kO,408:CO,409:OO,410:AO,411:EO,412:RO,413:PO,414:IO,415:LO,416:NO,417:FO,418:BO,421:zO,422:UO,423:HO,424:WO,425:$O,426:YO,428:VO,429:qO,431:jO,451:GO,500:KO,501:XO,502:ZO,503:QO,504:JO,505:tA,506:eA,507:nA,508:iA,510:rA,511:sA},OA={100:oA,200:aA,300:lA,400:cA,500:uA},AA={"1XX":dA,"2XX":fA,"3XX":hA,"4XX":pA,"5XX":gA},Fm=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return CA[t]??OA[e]??kA},Du={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Fm(`${t}`),n),{}),____OTHER____:WC,...AA};function Bm(n,t,e){const i=Ag(),r=PA(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?EA(r,t):RA(r,t)}function EA(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function RA(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function PA(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function IA(n,t){const e=zA(t);return"formatToParts"in e?NA(e,n):FA(e,n)}const LA={year:0,month:1,day:2,hour:3,minute:4,second:5};function NA(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=LA[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function FA(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ku={},zm=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")),BA=zm==="06/25/2014, 00:00:00"||zm==="06/25/2014 00:00:00";function zA(n){return ku[n]||(ku[n]=BA?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ku[n]}function Um(n,t,e,i,r,s,a){const c=new Date(0);return c.setUTCFullYear(n,t,e),c.setUTCHours(i,r,s,a),c}const Hm=36e5,UA=6e4,Cu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ou(n,t,e){if(!n)return 0;let i=Cu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Cu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),Wm(r)?-(r*Hm):NaN;if(i=Cu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Wm(r,a)?(s=Math.abs(r)*Hm+a*UA,i[1]==="+"?-s:s):NaN}if($A(n)){t=new Date(t||Date.now());const a=e?t:HA(t),c=Au(a,n);return-(e?c:WA(t,c,n))}return NaN}function HA(n){return Um(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Au(n,t){const e=IA(n,t),i=Um(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function WA(n,t,e){let r=n.getTime()-t;const s=Au(new Date(r),e);if(t===s)return t;r-=s-t;const a=Au(new Date(r),e);return s===a?s:Math.max(s,a)}function Wm(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const $m={};function $A(n){if($m[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),$m[n]=!0,!0}catch{return!1}}const YA=60*1e3,VA={X:function(n,t,e){const i=Eu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ym(i);case"XXXX":case"XX":return qr(i);default:return qr(i,":")}},x:function(n,t,e){const i=Eu(e.timeZone,n);switch(t){case"x":return Ym(i);case"xxxx":case"xx":return qr(i);default:return qr(i,":")}},O:function(n,t,e){const i=Eu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+qA(i,":");default:return"GMT"+qr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Bm("short",n,e);default:return Bm("long",n,e)}}};function Eu(n,t){const e=n?Ou(n,t,!0)/YA:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ya(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function qr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Ya(Math.floor(i/60),2),s=Ya(Math.floor(i%60),2);return e+r+t+s}function Ym(n,t){return n%60===0?(n>0?"-":"+")+Ya(Math.abs(n)/60,2):qr(n,t)}function qA(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Ya(s,2)}function Vm(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const jA=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ru=36e5,qm=6e4,GA=2,Ge={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:jA};function jm(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?GA:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=KA(n),{year:r,restDateString:s}=XA(i.date,e),a=ZA(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const c=a.getTime();let u=0,d;if(i.time&&(u=QA(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Ou(i.timeZone||t.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Vm(new Date(c+u)),d=Vm(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function KA(n){const t={};let e=Ge.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ge.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ge.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function XA(n,t){if(n){const e=Ge.YYY[t],i=Ge.YYYYY[t];let r=Ge.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ge.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function ZA(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Ge.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Xm(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ge.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return eE(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ge.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Xm(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ge.Www.exec(n),s)return r=parseInt(s[1],10)-1,Zm(r)?Gm(t,r):new Date(NaN);if(s=Ge.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Zm(r,a)?Gm(t,r,a):new Date(NaN)}return null}function QA(n){let t,e,i=Ge.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Pu(t)?t%24*Ru:NaN;if(i=Ge.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Pu(t,e)?t%24*Ru+e*qm:NaN;if(i=Ge.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Pu(t,e,r)?t%24*Ru+e*qm+r*1e3:NaN}return null}function Gm(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const JA=[31,28,31,30,31,30,31,31,30,31,30,31],tE=[31,29,31,30,31,30,31,31,30,31,30,31];function Km(n){return n%400===0||n%4===0&&n%100!==0}function Xm(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Km(n);if(i&&e>tE[t]||!i&&e>JA[t])return!1}return!0}function eE(n,t){if(t<1)return!1;const e=Km(n);return!(e&&t>366||!e&&t>365)}function Zm(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Pu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const nE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Iu(n,t,e={}){t=String(t);const i=t.match(nE);if(i){const r=jm(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const c=s.indexOf(a),u=s[c-1]==="'",d=s.replace(a,"'"+VA[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return Aa(n,t,e)}function iE(n,t,e){n=jm(n,e);const i=Ou(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function oo(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Iu(iE(n,t,{timeZone:i.timeZone}),e,i)}const rE=(n,t)=>`${oo(n,t,"yyyy")} W${oo(n,t,"II")}`,Lu="yyyy-MM-dd h:mm:ss a",Nu="h:mm:ss a",hr="yyyy-MM-dd h:mm a",jr="h:mm a",sE="yyyy-MM-dd",Fu="MMM dd, yyyy h:mm:ss a",Ii="MMM dd, yyyy h:mm a",oE={secondly:n=>n?Lu:Nu,tenSecondly:n=>n?Lu:Nu,thirtySecondly:n=>n?Lu:Nu,minutely:n=>n?hr:jr,fiveMinutely:n=>n?hr:jr,tenMinutely:n=>n?hr:jr,thirtyMinutely:n=>n?hr:jr,hourly:n=>n?hr:jr,twoHourly:n=>n?hr:jr,twelveHourly:()=>hr,daily:()=>sE},aE={secondly:()=>Fu,tenSecondly:()=>Fu,thirtySecondly:()=>Fu,minutely:()=>Ii,fiveMinutely:()=>Ii,tenMinutely:()=>Ii,thirtyMinutely:()=>Ii,hourly:()=>Ii,twoHourly:()=>Ii,twelveHourly:()=>Ii,daily:()=>Ii};function Qm({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const c=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return rE(n,c);if(r&&r[t]){const u=r[t](i);return oo(n,c,u)}if(s&&s[t]){const u=s[t]();return oo(n,c,u)}return oo(n,c,a)}const lE=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>Qm({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:oE,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ao=({tickValue:n,granularity:t,timezone:e})=>Qm({tickValue:n,granularity:t,timezone:e,tooltipMap:aE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Jm=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",cE=n=>{const{i18n:t}=Pt.useI18n();return Jm(n)?{type:"canceled",message:t.t("query_errors.canceled.message")}:n?.status===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:n?.status===408||n?.message?.includes("timeout")?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:n?.response?.data?.message==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:n.response?.data?.invalid_parameters?.map(e=>e.reason).join(", ")||n?.message}},lo=n=>n.toLocaleLowerCase().endsWith("count"),uE=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))};function dE(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};hn.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=h.width/2,_=wu(d,g,y),x=d.y,v=d.x<y?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:v}},zc.modes.customInteractionMode=function(u,d){const h=ki(d,u),g=[];return zc.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(y,_,x)=>{u.options.indexAxis==="y"&&y.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&y.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x})}),g};const r=n.numLabels.value>25?Em:Rm,s=({chart:u,index:d})=>{const h=u.data;return{size:r,style:h?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,h)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(h),d&&d.length>$a?d.slice(0,$a)+"...":d):u.getLabelForValue(Number(d)),c=p.computed(()=>({indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="y"?!Tt(n.metricAxesTitle?.value):!Tt(n.dimensionAxesTitle?.value),text:n.indexAxis==="y"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="x"?!Tt(n.metricAxesTitle?.value):!Tt(n.dimensionAxesTitle?.value),text:n.indexAxis==="x"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:u=>{Cm(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.getCurrentInstance()&&p.onUnmounted(()=>{hn.positioners[e]&&delete hn.positioners[e]}),c}en.register(...HS);const fE=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,s)=>r===i[s])};function hE(n,t,e,i,r){const s=p.shallowRef(null),a=(c,u)=>{if(t.value)return new en(t.value,{type:n,data:c,plugins:i,options:u})};return p.onMounted(()=>{s.value=a(e.value,r.value)}),p.onBeforeUnmount(()=>{Tt(s.value)||s.value.destroy()}),p.watch(e,(c,u)=>{if(fE(u,c)&&!Tt(s.value)){for(const[d,h]of c.datasets.entries())Object.assign(s.value.data.datasets[d],h);s.value.data.labels=c.labels,s.value.update()}else Tt(s.value)||s.value.destroy(),s.value=a(c,r.value)}),p.watch(t,()=>{Tt(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),p.watch(r,(c,u)=>{(c.indexAxis!==u.indexAxis||JSON.stringify(c.scales.x.title)!==JSON.stringify(u.scales.x.title)||JSON.stringify(c.scales.y.title)!==JSON.stringify(u.scales.y.title))&&(Tt(s.value)||s.value.destroy(),s.value=a(e.value,c))}),s}const ty=1e3,pE=1e4,ey=1e6,ny=1e9,iy=1e12,co=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},Gr=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function uo(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?pE:ty;return n<r||t.precision&&t.precision>Math.log10(n)?e=co(Gr(n,1,t),t):n<ey?e=`${Gr(n,ty,t)}k`:n<ny?e=`${Gr(n,ey,t)}m`:n<iy?e=`${co(Gr(n,ny,t),t)}b`:e=`${co(Gr(n,iy,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}uo.addCommas=co;function gE(n,t,e){const{i18n:i}=Pt.useI18n(),{formatBytes:r}=fr({i18n:i}),{translateUnit:s}=Pt.useTranslatedUnits();return{legendValues:p.computed(()=>n.value.datasets.reduce((c,u)=>{const d=u.total?u.total:u.data.reduce((g,y)=>g+(typeof y=="number"?Number(y)||0:Number(y&&y.y)||0),0);let h;if(e.value==="bytes")h=r(d);else{const g=s(e.value,d);h=i&&i.t("legend.datapointValueDisplay",{value:uo(d,{capital:!0}),unit:g})||`${uo(d,{capital:!0})} ${e.value}`}return{...c,[u.label]:{raw:d,formatted:h,isThreshold:u.isThreshold}}},{}))}}function mE(n){return p.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${xm(new Date(e))} - ${xm(new Date(i),{includeTZ:!0})}`:""})}function yE(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};hn.positioners[e]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const c=this.chart.canvas.getBoundingClientRect(),u=n.tooltipState.width||this.width,d=c.width/2,h=wu(a,u,d),g=a.y,y=a.x<d?"left":"center";return{x:h-n.tooltipState.offsetX,y:g,xAlign:y}};const r=p.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{Cm(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return p.onUnmounted(()=>{hn.positioners[e]&&delete hn.positioners[e]}),{options:r}}function _E(n){const t=p.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return lE({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!Tt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=p.computed(()=>({title:{display:!Tt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value})),r=`lineChartTooltipPosition-${n.tooltipState.chartID}`,s={enabled:!1,position:r};hn.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=n.tooltipState.height||this.height,_=h.width/2,x=h.height/2,v=wu(d,g,_);let S=UC(d,y,x);const C=d.y<x?"top":"bottom",E=d.x<_?"left":"center";return y>h.height&&(S=0),{x:v,y:S,xAlign:E,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,h=new Date(d.getTime()-u);return sD(u)>24||h.getDate()!==d.getDate()}),c=p.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:n.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{km(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:n.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{hn.positioners[r]&&delete hn.positioners[r]}),{options:c}}function bE(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:c}=n,{i18n:u}=Pt.useI18n();return t?i.map(h=>({label:u&&u.te(`chartLabels.${h}`)&&u.t(`chartLabels.${h}`)||h,backgroundColor:Su(i.indexOf(h),Pi),data:a.map((g,y)=>e?s[`${g.id},${h}`]||0:s[`${y},${h}`]||null)})):Array.from(r).flatMap((h,g)=>{if(!h)return[];const y=Lm(g,h.name,h.id==="empty",c);return{label:u&&u.te(`chartLabels.${h.name}`)&&u.t(`chartLabels.${h.name}`)||h.name,backgroundColor:y,data:a.map(_=>s[`${_.id},${h.id}`]||null),isSegmentEmpty:h.id==="empty"}})}function xE(n,t){const{i18n:e}=Pt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,c=s&&Object.keys(s),u=a&&a.length>1,d=s&&c&&c.length>0,h=d&&c.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const g=d&&c||a,y=g[0],_=g.length>1?g[1]:g[0],x=Object.fromEntries(u?r.flatMap(D=>a.map((O,L)=>{const W=D.event[y],tt=d?`${W},${O}`:`${L},${O}`,G=D.event[O];return[tt,G]})):r.map(D=>{const O=d?`${D.event[y]},${D.event[_]}`:`${y},${_}`,L=D.event[a[0]];return[O,L]})),v=Object.keys(x).reduce((D,O)=>{const[L]=O.split(","),W=x[O];return D[L]?D[L]+=W:D[L]=W,D},{}),S=Object.entries(v).sort(([,D],[,O])=>Number(O)-Number(D)).map(([D])=>D),C=s[y],E=s[_];let U=d&&C&&Object.entries(C).map(([D,O])=>({id:D,name:O.name}))||a.map(D=>({id:D,name:D})),P=d&&E&&Object.entries(E).map(([D,O])=>({id:D,name:O.name}))||a.map(D=>({id:D,name:D}));if(d&&y==="country_code"&&(U=U.map(D=>({...D,name:xu(D.id)||D.name}))),d&&_==="country_code"&&(P=P.map(D=>({...D,name:xu(D.id)||D.name}))),y!=="status_code"&&y!=="status_code_grouped"&&(U.sort((D,O)=>S.indexOf(D.id)-S.indexOf(O.id)),P.sort((D,O)=>S.indexOf(D.id)-S.indexOf(O.id))),!U||!P)return{labels:[],datasets:[]};const I=bE({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:P,pivotRecords:x,rowLabels:U,colorPalette:n.colorPalette||Pi}),B=d?U.map(D=>e&&e.te(`chartLabels.${D.name}`)&&e.t(`chartLabels.${D.name}`)||D.name):a.map(D=>e&&e.te(`chartLabels.${D}`)&&e.t(`chartLabels.${D}`)||D),N=U.map(D=>D.id==="empty");return{labels:B,datasets:I,isLabelEmpty:N,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const wE=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),vE=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Lg(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},SE=(n,t,e,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),c=Math.floor((n-i)/e)*e+i,u=Math.floor((a-i)/e)*e+i+e;return wE(c,u,e)};function TE(n,t){const{i18n:e}=Pt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start:c,end:u}=t.value.meta,d=new Date(c).getTime(),h=new Date(u).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const g=s&&Object.keys(s)||a,y=g&&g[0],_=s[y];let x=s&&_&&Object.keys(_).map(B=>({id:B,name:_[B].name}))||a.map(B=>({id:B,name:B}));y==="country_code"&&(x=x.map(B=>({...B,name:xu(B.id)||B.name})));const v=t.value.meta.granularity_ms;if(typeof v!="number"||isNaN(v)||!isFinite(v)||v===0)return console.error("Invalid step value:",v),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const S=vE(d),C=SE(d,h,v,S,r),E=new Set,U=r?.length?r.reduce((B,N)=>{const T=new Date(N.timestamp).valueOf(),D=N.event;for(const O of a)E.add(O),T in B||(B[T]={}),O in B[T]||(B[T][O]={});for(const O of a)x.forEach(L=>{D[y]===L.id||O===L.id?(B[T][O]||(B[T][O]={}),B[T][O][L.id]=Math.round(Number(D[O])*1e3)/1e3):g.length||(B[T][O]||(B[T][O]={}),B[T][O][L.id]=Math.round(Number(D[L.id])*1e3)/1e3)});return B},{}):{},I=[...a.length===1?a.flatMap(B=>x.map(N=>[B,N.id,N.name,N.id==="empty"])):x.map(B=>[B.name,B.id,B.name,B.id==="empty"])].map(([B,N,T,D],O)=>{const L=C.map(nt=>nt in U&&B in U[nt]?{x:nt,y:U[nt][B][N]||0}:{x:nt,y:0});let{colorPalette:W,fill:tt}=n;Tt(W)&&(W=Pi);const G=Lm(O,T,D,W);return{rawDimension:T,rawMetric:B,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:G,backgroundColor:G,data:L,total:L.reduce((nt,{y:X})=>nt+Number(X),0),...xA,fill:tt,borderWidth:tt?vA:wA,isSegmentEmpty:D}});return y==="status_code"||y==="status_code_grouped"?I.sort((B,N)=>(B.label??"")<(N.label??"")?-1:1):I.sort((B,N)=>Number(B.total)<Number(N.total)?-1:1),{datasets:I}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const ME=(n,t)=>{p.watch([n,t],(e,i,r)=>{const[s,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function DE(){const{i18n:n}=Pt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return lo(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const kE="analytics-query-provider",ry=2;function CE(){const n=p.inject(kE);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function sy(n,t){return p.getCurrentScope()?(p.onScopeDispose(n,t),!0):!1}const oy=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const OE=n=>n!=null,AE=Object.prototype.toString,EE=n=>AE.call(n)==="[object Object]";function Va(n){return Array.isArray(n)?n:[n]}function RE(n){return p.getCurrentInstance()}function PE(n,t={}){if(!p.isRef(n))return p.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=p.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=p.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return e}function IE(n,t=!0,e){RE()?p.onMounted(n,e):t?n():p.nextTick(n)}function LE(n,t,e){return p.watch(n,t,{...e,immediate:!0})}const qa=oy?window:void 0;function Kr(n){var t;const e=p.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function fo(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=p.computed(()=>{const i=Va(p.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return LE(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>Kr(s)))!==null&&i!==void 0?i:[qa].filter(s=>s!=null),Va(p.toValue(e.value?n[1]:n[0])),Va(p.unref(e.value?n[2]:n[1])),p.toValue(e.value?n[3]:n[2])]},([i,r,s,a],c,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=EE(a)?{...a}:a,h=i.flatMap(g=>r.flatMap(y=>s.map(_=>t(g,y,_,d))));u(()=>{h.forEach(g=>g())})},{flush:"post"})}function NE(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function ay(n){const t=NE();return p.computed(()=>(t.value,!!n()))}function FE(n,t,e={}){const{window:i=qa,...r}=e;let s;const a=ay(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const g=Va(p.toValue(n)).map(Kr).filter(OE);return new Set(g)}),g=>{c(),a.value&&g.size&&(s=new MutationObserver(t),g.forEach(y=>s.observe(y,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),h=()=>{u(),c()};return sy(h),{isSupported:a,stop:h,takeRecords:d}}const ja={speed:2,margin:30,direction:"both"};function BE(n){n.scrollLeft>n.scrollWidth-n.clientWidth&&(n.scrollLeft=Math.max(0,n.scrollWidth-n.clientWidth)),n.scrollTop>n.scrollHeight-n.clientHeight&&(n.scrollTop=Math.max(0,n.scrollHeight-n.clientHeight))}function zE(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:c,stopPropagation:u,exact:d,onMove:h,onEnd:g,onStart:y,initialValue:_,axis:x="both",draggingElement:v=qa,containerElement:S,handle:C=n,buttons:E=[0],restrictInView:U,autoScroll:P=!1}=t,I=p.ref((e=p.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),B=p.ref(),N=H=>a?a.includes(H.pointerType):!0,T=H=>{p.toValue(c)&&H.preventDefault(),p.toValue(u)&&H.stopPropagation()},D=p.toValue(P),O=typeof D=="object"?{speed:(i=p.toValue(D.speed))!==null&&i!==void 0?i:ja.speed,margin:(r=p.toValue(D.margin))!==null&&r!==void 0?r:ja.margin,direction:(s=D.direction)!==null&&s!==void 0?s:ja.direction}:ja,L=H=>typeof H=="number"?[H,H]:[H.x,H.y],W=(H,V,J)=>{const{clientWidth:_t,clientHeight:pt,scrollLeft:it,scrollTop:ft,scrollWidth:ut,scrollHeight:dt}=H,[gt,lt]=L(O.margin),[It,Bt]=L(O.speed);let wt=0,kt=0;(O.direction==="x"||O.direction==="both")&&(J.x<gt&&it>0?wt=-It:J.x+V.width>_t-gt&&it<ut-_t&&(wt=It)),(O.direction==="y"||O.direction==="both")&&(J.y<lt&&ft>0?kt=-Bt:J.y+V.height>pt-lt&&ft<dt-pt&&(kt=Bt)),(wt||kt)&&H.scrollBy({left:wt,top:kt,behavior:"auto"})};let tt=null;const G=()=>{const H=p.toValue(S);H&&!tt&&(tt=setInterval(()=>{const V=p.toValue(n).getBoundingClientRect(),{x:J,y:_t}=I.value,pt={x:J-H.scrollLeft,y:_t-H.scrollTop};pt.x>=0&&pt.y>=0&&(W(H,V,pt),pt.x+=H.scrollLeft,pt.y+=H.scrollTop,I.value=pt)},1e3/60))},nt=()=>{tt&&(clearInterval(tt),tt=null)},X=(H,V,J,_t)=>{const[pt,it]=typeof J=="number"?[J,J]:[J.x,J.y],{clientWidth:ft,clientHeight:ut}=V;return H.x<pt||H.x+_t.width>ft-pt||H.y<it||H.y+_t.height>ut-it},Q=()=>{if(p.toValue(t.disabled)||!B.value)return;const H=p.toValue(S);if(!H)return;const V=p.toValue(n).getBoundingClientRect(),{x:J,y:_t}=I.value;X({x:J-H.scrollLeft,y:_t-H.scrollTop},H,O.margin,V)?G():nt()};p.toValue(P)&&p.watch(I,Q);const rt=H=>{var V;if(!p.toValue(E).includes(H.button)||p.toValue(t.disabled)||!N(H)||p.toValue(d)&&H.target!==p.toValue(n))return;const J=p.toValue(S),_t=J==null||(V=J.getBoundingClientRect)===null||V===void 0?void 0:V.call(J),pt=p.toValue(n).getBoundingClientRect(),it={x:H.clientX-(J?pt.left-_t.left+(P?0:J.scrollLeft):pt.left),y:H.clientY-(J?pt.top-_t.top+(P?0:J.scrollTop):pt.top)};y?.(it,H)!==!1&&(B.value=it,T(H))},st=H=>{if(p.toValue(t.disabled)||!N(H)||!B.value)return;const V=p.toValue(S);V instanceof HTMLElement&&BE(V);const J=p.toValue(n).getBoundingClientRect();let{x:_t,y:pt}=I.value;if((x==="x"||x==="both")&&(_t=H.clientX-B.value.x,V&&(_t=Math.min(Math.max(0,_t),V.scrollWidth-J.width))),(x==="y"||x==="both")&&(pt=H.clientY-B.value.y,V&&(pt=Math.min(Math.max(0,pt),V.scrollHeight-J.height))),p.toValue(P)&&V&&(tt===null&&W(V,J,{x:_t,y:pt}),_t+=V.scrollLeft,pt+=V.scrollTop),V&&(U||P)){if(x!=="y"){const it=_t-V.scrollLeft;it<0?_t=V.scrollLeft:it>V.clientWidth-J.width&&(_t=V.clientWidth-J.width+V.scrollLeft)}if(x!=="x"){const it=pt-V.scrollTop;it<0?pt=V.scrollTop:it>V.clientHeight-J.height&&(pt=V.clientHeight-J.height+V.scrollTop)}}I.value={x:_t,y:pt},h?.(I.value,H),T(H)},ot=H=>{p.toValue(t.disabled)||!N(H)||B.value&&(B.value=void 0,P&&nt(),g?.(I.value,H),T(H))};if(oy){const H=()=>{var V;return{capture:(V=t.capture)!==null&&V!==void 0?V:!0,passive:!p.toValue(c)}};fo(C,"pointerdown",rt,H),fo(v,"pointermove",st,H),fo(v,"pointerup",ot,H)}return{...PE(I),position:I,isDragging:p.computed(()=>!!B.value),style:p.computed(()=>`
|
|
3
|
+
`):n}function sS(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:c}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:c,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function qp(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:c}=t,u=le(t.bodyFont),d=le(t.titleFont),h=le(t.footerFont),g=s.length,y=r.length,_=i.length,x=we(t.padding);let v=x.height,S=0,C=i.reduce((P,I)=>P+I.before.length+I.lines.length+I.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,g&&(v+=g*d.lineHeight+(g-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(c,u.lineHeight):u.lineHeight;v+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}y&&(v+=t.footerMarginTop+y*h.lineHeight+(y-1)*t.footerSpacing);let E=0;const U=function(P){S=Math.max(S,e.measureText(P).width+E)};return e.save(),e.font=d.string,Xt(n.title,U),e.font=u.string,Xt(n.beforeBody.concat(n.afterBody),U),E=t.displayColors?a+2+t.boxPadding:0,Xt(i,P=>{Xt(P.before,U),Xt(P.lines,U),Xt(P.after,U)}),E=0,e.font=h.string,Xt(n.footer,U),e.restore(),S+=x.width,{width:S,height:v}}function oS(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function aS(n,t,e,i){const{x:r,width:s}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&r+s+a>t.width||n==="right"&&r-s-a<0)return!0}function lS(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:c,right:u}}=n;let d="center";return i==="center"?d=r<=(c+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),aS(d,n,t,e)&&(d="center"),d}function jp(n,t,e){const i=e.yAlign||t.yAlign||oS(n,e);return{xAlign:e.xAlign||t.xAlign||lS(n,t,e,i),yAlign:i}}function cS(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function uS(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Gp(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:c,yAlign:u}=e,d=r+s,{topLeft:h,topRight:g,bottomLeft:y,bottomRight:_}=Mi(a);let x=cS(t,c);const v=uS(t,u,d);return u==="center"?c==="left"?x+=d:c==="right"&&(x-=d):c==="left"?x-=Math.max(h,y)+r:c==="right"&&(x+=Math.max(g,_)+r),{x:Ce(x,0,i.width-t.width),y:Ce(v,0,i.height-t.height)}}function Ta(n,t,e){const i=we(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Kp(n){return Yn([],si(n))}function dS(n,t,e){return Di(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Xp(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Zp={beforeTitle:ti,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:ti,beforeBody:ti,beforeLabel:ti,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return Tt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ti,afterBody:ti,beforeFooter:ti,footer:ti,afterFooter:ti};function nn(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Zp[t].call(e,i):r}class Qp extends He{static positioners=qs;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,s=new Ec(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=dS(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=nn(i,"beforeTitle",this,t),s=nn(i,"title",this,t),a=nn(i,"afterTitle",this,t);let c=[];return c=Yn(c,si(r)),c=Yn(c,si(s)),c=Yn(c,si(a)),c}getBeforeBody(t,e){return Kp(nn(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Xt(t,s=>{const a={before:[],lines:[],after:[]},c=Xp(i,s);Yn(a.before,si(nn(c,"beforeLabel",this,s))),Yn(a.lines,nn(c,"label",this,s)),Yn(a.after,si(nn(c,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Kp(nn(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=nn(i,"beforeFooter",this,t),s=nn(i,"footer",this,t),a=nn(i,"afterFooter",this,t);let c=[];return c=Yn(c,si(r)),c=Yn(c,si(s)),c=Yn(c,si(a)),c}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let c=[],u,d;for(u=0,d=e.length;u<d;++u)c.push(sS(this.chart,e[u]));return t.filter&&(c=c.filter((h,g,y)=>t.filter(h,g,y,i))),t.itemSort&&(c=c.sort((h,g)=>t.itemSort(h,g,i))),Xt(c,h=>{const g=Xp(t.callbacks,h);r.push(nn(g,"labelColor",this,h)),s.push(nn(g,"labelPointStyle",this,h)),a.push(nn(g,"labelTextColor",this,h))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=c,c}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const c=qs[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const u=this._size=qp(this,i),d=Object.assign({},c,u),h=jp(this.chart,i,d),g=Gp(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,s={opacity:1,x:g.x,y:g.y,width:u.width,height:u.height,caretX:c.x,caretY:c.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const s=this.getCaretPosition(t,i,r);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:c}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=Mi(c),{x:y,y:_}=t,{width:x,height:v}=e;let S,C,E,U,P,I;return s==="center"?(P=_+v/2,r==="left"?(S=y,C=S-a,U=P+a,I=P-a):(S=y+x,C=S+a,U=P-a,I=P+a),E=S):(r==="left"?C=y+Math.max(u,h)+a:r==="right"?C=y+x-Math.max(d,g)-a:C=this.caretX,s==="top"?(U=_,P=U-a,S=C-a,E=C+a):(U=_+v,P=U+a,S=C+a,E=C-a),I=U),{x1:S,x2:C,x3:E,y1:U,y2:P,y3:I}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,c,u;if(s){const d=Nr(i.rtl,this.x,this.width);for(t.x=Ta(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=le(i.titleFont),c=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,u=0;u<s;++u)e.fillText(r[u],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+c,u+1===s&&(t.y+=i.titleMarginBottom-c)}}_drawColorBox(t,e,i,r,s){const a=this.labelColors[i],c=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,h=le(s.bodyFont),g=Ta(this,"left",s),y=r.x(g),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:c.pointStyle,rotation:c.rotation,borderWidth:1},S=r.leftForLtr(y,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Tc(t,v,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Tc(t,v,S,C)}else{t.lineWidth=Rt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const v=r.leftForLtr(y,d),S=r.leftForLtr(r.xPlus(y,1),d-2),C=Mi(a.borderRadius);Object.values(C).some(E=>E!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Pr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Pr(t,{x:S,y:x+1,w:d-2,h:u-2,radius:C}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(v,x,d,u),t.strokeRect(v,x,d,u),t.fillStyle=a.backgroundColor,t.fillRect(S,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:c,boxHeight:u,boxWidth:d,boxPadding:h}=i,g=le(i.bodyFont);let y=g.lineHeight,_=0;const x=Nr(i.rtl,this.x,this.width),v=function(T){e.fillText(T,x.x(t.x+_),t.y+y/2),t.y+=y+s},S=x.textAlign(a);let C,E,U,P,I,B,N;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Ta(this,S,i),e.fillStyle=i.bodyColor,Xt(this.beforeBody,v),_=c&&S!=="right"?a==="center"?d/2+h:d+2+h:0,P=0,B=r.length;P<B;++P){for(C=r[P],E=this.labelTextColors[P],e.fillStyle=E,Xt(C.before,v),U=C.lines,c&&U.length&&(this._drawColorBox(e,t,P,x,i),y=Math.max(g.lineHeight,u)),I=0,N=U.length;I<N;++I)v(U[I]),y=g.lineHeight;Xt(C.after,v)}_=0,y=g.lineHeight,Xt(this.afterBody,v),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,c;if(s){const u=Nr(i.rtl,this.x,this.width);for(t.x=Ta(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",a=le(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,c=0;c<s;++c)e.fillText(r[c],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:s,yAlign:a}=this,{x:c,y:u}=t,{width:d,height:h}=i,{topLeft:g,topRight:y,bottomLeft:_,bottomRight:x}=Mi(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(c+g,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(c+d-y,u),e.quadraticCurveTo(c+d,u,c+d,u+y),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(c+d,u+h-x),e.quadraticCurveTo(c+d,u+h,c+d-x,u+h),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(c+_,u+h),e.quadraticCurveTo(c,u+h,c,u+h-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(c,u+g),e.quadraticCurveTo(c,u,c+g,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=qs[t.position].call(this,this._active,this._eventPosition);if(!a)return;const c=this._size=qp(this,t),u=Object.assign({},a,this._size),d=jp(e,t,u),h=Gp(t,u,d,e);(r._to!==h.x||s._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=c.width,this.height=c.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=we(e.padding),c=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&c&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),Ch(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),Oh(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:c,index:u})=>{const d=this.chart.getDatasetMeta(c);if(!d)throw new Error("Cannot find a dataset at index "+c);return{datasetIndex:c,element:d.data[u],index:u}}),s=!ta(i,r),a=this._positionChanged(r,e);(s||a)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,e,i),c=this._positionChanged(a,t),u=e||!ta(a,s)||c;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(c=>this.chart.data.datasets[c.datasetIndex]&&this.chart.getDatasetMeta(c.datasetIndex).controller.getParsed(c.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:r,options:s}=this,a=qs[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var hn={id:"tooltip",_element:Qp,positioners:qs,afterInit(n,t,e){e&&(n.tooltip=new Qp({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Zp},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},fS=Object.freeze({__proto__:null,Colors:M1,Decimation:O1,Filler:K1,Legend:eS,SubTitle:rS,Title:iS,Tooltip:hn});const hS=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function pS(n,t,e,i){const r=n.indexOf(t);if(r===-1)return hS(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const gS=(n,t)=>n===null?null:Ce(Math.round(n),0,t);function Jp(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class mS extends sr{static id="category";static defaults={ticks:{callback:Jp}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:s}of e)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Tt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:pS(i,t,Mt(e,t),this._addedLabels),gS(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)r.push({value:a});return r}getLabelForValue(t){return Jp.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function yS(n,t){const e=[],{bounds:r,step:s,min:a,max:c,precision:u,count:d,maxTicks:h,maxDigits:g,includeBounds:y}=n,_=s||1,x=h-1,{min:v,max:S}=t,C=!Tt(a),E=!Tt(c),U=!Tt(d),P=(S-v)/(g+1);let I=eh((S-v)/x/_)*_,B,N,T,D;if(I<1e-14&&!C&&!E)return[{value:v},{value:S}];D=Math.ceil(S/I)-Math.floor(v/I),D>x&&(I=eh(D*I/x/_)*_),Tt(u)||(B=Math.pow(10,u),I=Math.ceil(I*B)/B),r==="ticks"?(N=Math.floor(v/I)*I,T=Math.ceil(S/I)*I):(N=v,T=S),C&&E&&s&&rx((c-a)/s,I/1e3)?(D=Math.round(Math.min((c-a)/I,h)),I=(c-a)/D,N=a,T=c):U?(N=C?a:N,T=E?c:T,D=d-1,I=(T-N)/D):(D=(T-N)/I,Os(D,Math.round(D),I/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(ih(I),ih(N));B=Math.pow(10,Tt(u)?O:u),N=Math.round(N*B)/B,T=Math.round(T*B)/B;let L=0;for(C&&(y&&N!==a?(e.push({value:a}),N<a&&L++,Os(Math.round((N+L*I)*B)/B,a,tg(a,P,n))&&L++):N<a&&L++);L<D;++L){const W=Math.round((N+L*I)*B)/B;if(E&&W>c)break;e.push({value:W})}return E&&y&&T!==c?e.length&&Os(e[e.length-1].value,c,tg(c,P,n))?e[e.length-1].value=c:e.push({value:c}):(!E||T===c)&&e.push({value:T}),e}function tg(n,t,{horizontal:e,minRotation:i}){const r=xe(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Ma extends sr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Tt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,c=u=>s=i?s:u;if(t){const u=Wn(r),d=Wn(s);u<0&&d<0?c(0):u>0&&d>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);c(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},s=this._range||this,a=yS(r,s);return t.bounds==="ticks"&&nh(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Rs(t,this.chart.options.locale,this.options.ticks.format)}}class _S extends Ma{static id="linear";static defaults={ticks:{callback:aa.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?t:0,this.max=ae(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const js=n=>Math.floor(Si(n)),or=(n,t)=>Math.pow(10,js(n)+t);function eg(n){return n/Math.pow(10,js(n))===1}function ng(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function bS(n,t){const e=t-n;let i=js(e);for(;ng(n,t,i)>10;)i++;for(;ng(n,t,i)<10;)i--;return Math.min(i,js(n))}function xS(n,{min:t,max:e}){t=fn(n.min,t);const i=[],r=js(t);let s=bS(t,e),a=s<0?Math.pow(10,Math.abs(s)):1;const c=Math.pow(10,s),u=r>s?Math.pow(10,r):0,d=Math.round((t-u)*a)/a,h=Math.floor((t-u)/c/10)*c*10;let g=Math.floor((d-h)/Math.pow(10,s)),y=fn(n.min,Math.round((u+h+g*Math.pow(10,s))*a)/a);for(;y<e;)i.push({value:y,major:eg(y),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(s++,g=2,a=s>=0?1:a),y=Math.round((u+h+g*Math.pow(10,s))*a)/a;const _=fn(n.max,y);return i.push({value:_,major:eg(_),significand:g}),i}class wS extends sr{static id="logarithmic";static defaults={ticks:{callback:aa.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,e){const i=Ma.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return ae(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?Math.max(0,t):null,this.max=ae(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ae(this._userMin)&&(this.min=t===or(this.min,0)?or(this.min,-1):or(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=c=>i=t?i:c,a=c=>r=e?r:c;i===r&&(i<=0?(s(1),a(10)):(s(or(i,-1)),a(or(r,1)))),i<=0&&s(or(r,-1)),r<=0&&a(or(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=xS(e,this);return t.bounds==="ticks"&&nh(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":Rs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Si(t),this._valueRange=Si(this.max)-Si(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Si(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(n){const t=n.ticks;if(t.display&&n.display){const e=we(t.backdropPadding);return Mt(t.font&&t.font.size,se.font.size)+e.height}return 0}function vS(n,t,e){return e=Yt(e)?e:[e],{w:wx(n,t.string,e),h:e.length*t.lineHeight}}function ig(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function SS(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],s=n._pointLabels.length,a=n.options.pointLabels,c=a.centerPointLabels?At/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const h=n.getPointPosition(u,n.drawingArea+r[u],c),g=le(d.font),y=vS(n.ctx,g,n._pointLabels[u]);i[u]=y;const _=Be(n.getIndexAngle(u)+c),x=Math.round(ra(_)),v=ig(x,h.x,y.w,0,180),S=ig(x,h.y,y.h,90,270);TS(e,t,_,v,S)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=kS(n,i,r)}function TS(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let c=0,u=0;i.start<t.l?(c=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-c)):i.end>t.r&&(c=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+c)),r.start<t.t?(u=(t.t-r.start)/a,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,n.b=Math.max(n.b,t.b+u))}function MS(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:c}=e,u=n.getPointPosition(t,i+r+a,s),d=Math.round(ra(Be(u.angle+re))),h=AS(u.y,c.h,d),g=CS(d),y=OS(u.x,c.w,g);return{visible:!0,x:u.x,y:h,textAlign:g,left:y,top:h,right:y+c.w,bottom:h+c.h}}function DS(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ii({x:e,y:i},t)||ii({x:e,y:s},t)||ii({x:r,y:i},t)||ii({x:r,y:s},t))}function kS(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:c}=s.pointLabels,u={extra:Zc(s)/2,additionalAngle:a?At/r:0};let d;for(let h=0;h<r;h++){u.padding=e[h],u.size=t[h];const g=MS(n,h,u);i.push(g),c==="auto"&&(g.visible=DS(g,d),g.visible&&(d=g))}return i}function CS(n){return n===0||n===180?"center":n<180?"left":"right"}function OS(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function AS(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function ES(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:c}=t;if(!Tt(c)){const u=Mi(t.borderRadius),d=we(t.backdropPadding);n.fillStyle=c;const h=i-d.left,g=r-d.top,y=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Pr(n,{x:h,y:g,w:y,h:_,radius:u}),n.fill()):n.fillRect(h,g,y,_)}}function RS(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const s=n._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(n.getPointLabelContext(r));ES(e,a,s);const c=le(a.font),{x:u,y:d,textAlign:h}=s;er(e,n._pointLabels[r],u,d+c.lineHeight/2,c,{color:a.color,textAlign:h,textBaseline:"middle"})}}function rg(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,te);else{let s=n.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=n.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function PS(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:c,lineWidth:u}=t;!a&&!i||!c||!u||e<0||(s.save(),s.strokeStyle=c,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),rg(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function IS(n,t,e){return Di(n,{label:e,index:t,type:"pointLabel"})}class LS extends Ma{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:aa.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=we(Zc(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ae(t)&&!isNaN(t)?t:0,this.max=ae(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zc(this.options))}generateTickLabels(t){Ma.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Kt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?SS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=te/(this._pointLabels.length||1),i=this.options.startAngle||0;return Be(t*e+xe(i))}getDistanceFromCenterForValue(t){if(Tt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Tt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return IS(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-re+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),rg(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:s}=e,a=this._pointLabels.length;let c,u,d;if(e.pointLabels.display&&RS(this,a),r.display&&this.ticks.forEach((h,g)=>{if(g!==0||g===0&&this.min<0){u=this.getDistanceFromCenterForValue(h.value);const y=this.getContext(g),_=r.setContext(y),x=s.setContext(y);PS(this,_,u,a,x)}}),i.display){for(t.save(),c=a-1;c>=0;c--){const h=i.setContext(this.getPointLabelContext(c)),{color:g,lineWidth:y}=h;!y||!g||(t.lineWidth=y,t.strokeStyle=g,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,u=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),d=this.getPointPosition(c,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((c,u)=>{if(u===0&&this.min>=0&&!e.reverse)return;const d=i.setContext(this.getContext(u)),h=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(c.label).width,t.fillStyle=d.backdropColor;const g=we(d.backdropPadding);t.fillRect(-a/2-g.left,-s-h.size/2-g.top,a+g.width,h.size+g.height)}er(t,c.label,0,-s,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Da={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}},rn=Object.keys(Da);function sg(n,t){return n-t}function og(n,t){if(Tt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:s}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ae(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(r&&(a=r==="week"&&(Ti(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function ag(n,t,e,i){const r=rn.length;for(let s=rn.indexOf(n);s<r-1;++s){const a=Da[rn[s]],c=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(c*a.size))<=i)return rn[s]}return rn[r-1]}function NS(n,t,e,i,r){for(let s=rn.length-1;s>=rn.indexOf(e);s--){const a=rn[s];if(Da[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return rn[e?rn.indexOf(e):0]}function FS(n){for(let t=rn.indexOf(n)+1,e=rn.length;t<e;++t)if(Da[rn[t]].common)return rn[t]}function lg(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=yc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function BS(n,t,e,i){const r=n._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let c,u;for(c=s;c<=a;c=+r.add(c,1,i))u=e[c],u>=0&&(t[u].major=!0);return t}function cg(n,t,e){const i=[],r={},s=t.length;let a,c;for(a=0;a<s;++a)c=t[a],r[c]=a,i.push({value:c,major:!1});return s===0||!e?i:BS(n,i,r,e)}class Qc extends sr{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,e={}){const i=t.time||(t.time={}),r=this._adapter=new Zh._date(t.adapters.date);r.init(e),Cs(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:og(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:c}=this.getUserBounds();function u(d){!a&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!c&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!a||!c)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=ae(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),s=ae(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,c=lx(r,s,a);return this._unit=e.unit||(i.autoSkip?ag(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):NS(this,c.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:FS(this._unit),this.initOffsets(r),t.reverse&&c.reverse(),cg(this,c,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Ce(e,0,a),i=Ce(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||ag(s.minUnit,e,i,this._getLabelCapacity(e)),c=Mt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ti(u)||u===!0,h={};let g=e,y,_;if(d&&(g=+t.startOf(g,"isoWeek",u)),g=+t.startOf(g,d?"day":a),t.diff(i,e,a)>1e5*c)throw new Error(e+" and "+i+" are too far apart with stepSize of "+c+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(y=g,_=0;y<i;y=+t.add(y,c,a),_++)lg(h,y,x);return(y===i||r.bounds==="ticks"||_===1)&&lg(h,y,x),Object.keys(h).sort(sg).map(v=>+v)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,s=this._unit,a=e||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,r){const s=this.options,a=s.ticks.callback;if(a)return Kt(a,[t,e,i],this);const c=s.time.displayFormats,u=this._unit,d=this._majorUnit,h=u&&c[u],g=d&&c[d],y=i[e],_=d&&g&&y&&y.major;return this._adapter.format(t,r||(_?g:h))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=xe(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(r),a=Math.sin(r),c=this._resolveTickFontOptions(0).size;return{w:i*s+c*a,h:i*a+c*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,cg(this,[t],this._majorUnit),r),a=this._getLabelSize(s),c=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return c>0?c:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(og(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return oh(t.sort(sg))}}function ka(n,t,e){let i=0,r=n.length-1,s,a,c,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ni(n,"pos",t)),{pos:s,time:c}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ni(n,"time",t)),{time:s,pos:c}=n[i],{time:a,pos:u}=n[r]);const d=a-s;return d?c+(u-c)*(t-s)/d:c}class zS extends Qc{static id="timeseries";static defaults=Qc.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ka(e,this.min),this._tableRange=ka(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,c,u,d,h;for(a=0,c=t.length;a<c;++a)d=t[a],d>=e&&d<=i&&r.push(d);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,c=r.length;a<c;++a)h=r[a+1],u=r[a-1],d=r[a],Math.round((h+u)/2)!==d&&s.push({time:d,pos:a/(c-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ka(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ka(this._table,i*this._tableRange+this._minPos,!0)}}var US=Object.freeze({__proto__:null,CategoryScale:mS,LinearScale:_S,LogarithmicScale:wS,RadialLinearScale:LS,TimeScale:Qc,TimeSeriesScale:zS});const HS=[Hw,_1,fS,US],ug=6048e5,WS=864e5,Gs=6e4,Br=36e5,$S=1e3,dg=Symbol.for("constructDateFrom");function he(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&dg in n?n[dg](t):n instanceof Date?new n.constructor(t):new Date(t)}function Ot(n,t){return he(t||n,n)}function Ca(n,t,e){const i=Ot(n,e?.in);return isNaN(t)?he(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Jc(n,t,e){const i=Ot(n,e?.in);if(isNaN(t))return he(n,NaN);if(!t)return i;const r=i.getDate(),s=he(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function tu(n,t,e){return he(n,+Ot(n)+t)}function YS(n,t,e){return tu(n,t*Br)}let VS={};function ar(){return VS}function Vn(n,t){const e=ar(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Ot(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function zr(n,t){return Vn(n,{...t,weekStartsOn:1})}function fg(n,t){const e=Ot(n,t?.in),i=e.getFullYear(),r=he(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=zr(r),a=he(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=zr(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function Oa(n){const t=Ot(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function lr(n,...t){const e=he.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function eu(n,t){const e=Ot(n,t?.in);return e.setHours(0,0,0,0),e}function hg(n,t,e){const[i,r]=lr(e?.in,n,t),s=eu(i),a=eu(r),c=+s-Oa(s),u=+a-Oa(a);return Math.round((c-u)/WS)}function qS(n,t){const e=fg(n,t),i=he(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),zr(i)}function jS(n,t,e){const i=Ot(n,e?.in);return i.setTime(i.getTime()+t*Gs),i}function GS(n,t,e){return Jc(n,t*3,e)}function KS(n,t,e){return tu(n,t*1e3)}function XS(n,t,e){return Ca(n,t*7,e)}function ZS(n,t,e){return Jc(n,t*12,e)}function Ks(n,t){const e=+Ot(n)-+Ot(t);return e<0?-1:e>0?1:e}function QS(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function nu(n){return!(!QS(n)&&typeof n!="number"||isNaN(+Ot(n)))}function JS(n,t,e){const[i,r]=lr(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function tT(n,t,e){const[i,r]=lr(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function pg(n,t,e){const[i,r]=lr(e?.in,n,t),s=gg(i,r),a=Math.abs(hg(i,r));i.setDate(i.getDate()-s*a);const c=+(gg(i,r)===-s),u=s*(a-c);return u===0?0:u}function gg(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Xs(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function eT(n,t,e){const[i,r]=lr(e?.in,n,t),s=(+i-+r)/Br;return Xs(e?.roundingMethod)(s)}function iu(n,t){return+Ot(n)-+Ot(t)}function nT(n,t,e){const i=iu(n,t)/Gs;return Xs(e?.roundingMethod)(i)}function mg(n,t){const e=Ot(n,t?.in);return e.setHours(23,59,59,999),e}function yg(n,t){const e=Ot(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function iT(n,t){const e=Ot(n,t?.in);return+mg(e,t)==+yg(e,t)}function _g(n,t,e){const[i,r,s]=lr(e?.in,n,n,t),a=Ks(r,s),c=Math.abs(JS(r,s));if(c<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*c);let u=Ks(r,s)===-a;iT(i)&&c===1&&Ks(i,s)===1&&(u=!1);const d=a*(c-+u);return d===0?0:d}function rT(n,t,e){const i=_g(n,t,e)/3;return Xs(e?.roundingMethod)(i)}function sT(n,t,e){const i=iu(n,t)/1e3;return Xs(e?.roundingMethod)(i)}function oT(n,t,e){const i=pg(n,t,e)/7;return Xs(e?.roundingMethod)(i)}function aT(n,t,e){const[i,r]=lr(e?.in,n,t),s=Ks(i,r),a=Math.abs(tT(i,r));i.setFullYear(1584),r.setFullYear(1584);const c=Ks(i,r)===-s,u=s*(a-+c);return u===0?0:u}function lT(n,t){const e=Ot(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function cT(n,t){const e=Ot(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function uT(n,t){const e=Ot(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function bg(n,t){const e=Ot(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function dT(n,t){const e=Ot(n,t?.in);return e.setMinutes(59,59,999),e}function fT(n,t){const e=ar(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Ot(n,t?.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function hT(n,t){const e=Ot(n,t?.in);return e.setSeconds(59,999),e}function pT(n,t){const e=Ot(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function gT(n,t){const e=Ot(n,t?.in);return e.setMilliseconds(999),e}const mT={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"}},yT=(n,t,e)=>{let i;const r=mT[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function ru(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const _T={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bT={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xT={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wT={date:ru({formats:_T,defaultWidth:"full"}),time:ru({formats:bT,defaultWidth:"full"}),dateTime:ru({formats:xT,defaultWidth:"full"})},vT={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ST=(n,t,e,i)=>vT[n];function Zs(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,c=e?.width?String(e.width):a;r=n.formattingValues[c]||n.formattingValues[a]}else{const a=n.defaultWidth,c=e?.width?String(e.width):n.defaultWidth;r=n.values[c]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const TT={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MT={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DT={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"]},kT={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"]},CT={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"}},OT={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"}},AT={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Zs({values:TT,defaultWidth:"wide"}),quarter:Zs({values:MT,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Zs({values:DT,defaultWidth:"wide"}),day:Zs({values:kT,defaultWidth:"wide"}),dayPeriod:Zs({values:CT,defaultWidth:"wide",formattingValues:OT,defaultFormattingWidth:"wide"})};function Qs(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],c=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(c)?RT(c,g=>g.test(a)):ET(c,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function ET(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function RT(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function PT(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const c=t.slice(r.length);return{value:a,rest:c}}}const IT=/^(\d+)(th|st|nd|rd)?/i,LT=/\d+/i,NT={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},FT={any:[/^b/i,/^(a|c)/i]},BT={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zT={any:[/1/i,/2/i,/3/i,/4/i]},UT={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},HT={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]},WT={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},$T={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]},YT={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},VT={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}},qT={ordinalNumber:PT({matchPattern:IT,parsePattern:LT,valueCallback:n=>parseInt(n,10)}),era:Qs({matchPatterns:NT,defaultMatchWidth:"wide",parsePatterns:FT,defaultParseWidth:"any"}),quarter:Qs({matchPatterns:BT,defaultMatchWidth:"wide",parsePatterns:zT,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Qs({matchPatterns:UT,defaultMatchWidth:"wide",parsePatterns:HT,defaultParseWidth:"any"}),day:Qs({matchPatterns:WT,defaultMatchWidth:"wide",parsePatterns:$T,defaultParseWidth:"any"}),dayPeriod:Qs({matchPatterns:YT,defaultMatchWidth:"any",parsePatterns:VT,defaultParseWidth:"any"})},xg={code:"en-US",formatDistance:yT,formatLong:wT,formatRelative:ST,localize:AT,match:qT,options:{weekStartsOn:0,firstWeekContainsDate:1}};function jT(n,t){const e=Ot(n,t?.in);return hg(e,bg(e))+1}function wg(n,t){const e=Ot(n,t?.in),i=+zr(e)-+qS(e);return Math.round(i/ug)+1}function su(n,t){const e=Ot(n,t?.in),i=e.getFullYear(),r=ar(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=he(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const c=Vn(a,t),u=he(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Vn(u,t);return+e>=+c?i+1:+e>=+d?i:i-1}function GT(n,t){const e=ar(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=su(n,t),s=he(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Vn(s,t)}function vg(n,t){const e=Ot(n,t?.in),i=+Vn(e,t)-+GT(e,t);return Math.round(i/ug)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Ei={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Zt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Zt(e+1,2)},d(n,t){return Zt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Zt(n.getHours()%12||12,t.length)},H(n,t){return Zt(n.getHours(),t.length)},m(n,t){return Zt(n.getMinutes(),t.length)},s(n,t){return Zt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Zt(r,t.length)}},Ur={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sg={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return Ei.y(n,t)},Y:function(n,t,e,i){const r=su(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(n,t){const e=fg(n);return Zt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Zt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Ei.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=vg(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=wg(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Ei.d(n,t)},D:function(n,t,e){const i=jT(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Zt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Ur.noon:i===0?r=Ur.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Ur.evening:i>=12?r=Ur.afternoon:i>=4?r=Ur.morning:r=Ur.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Ei.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ei.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ei.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ei.s(n,t)},S:function(n,t){return Ei.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Mg(i);case"XXXX":case"XX":return cr(i);default:return cr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Mg(i);case"xxxx":case"xx":return cr(i);default:return cr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Tg(i,":");default:return"GMT"+cr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Tg(i,":");default:return"GMT"+cr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Zt(i,t.length)},T:function(n,t,e){return Zt(+n,t.length)}};function Tg(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Zt(s,2)}function Mg(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):cr(n,t)}function cr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return e+r+t+s}const Dg=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},kg=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},ou={p:kg,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return Dg(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Dg(i,t)).replace("{{time}}",kg(r,t))}},KT=/^D+$/,XT=/^Y+$/,ZT=["D","DD","YY","YYYY"];function Cg(n){return KT.test(n)}function Og(n){return XT.test(n)}function au(n,t,e){const i=QT(n,t,e);if(console.warn(i),ZT.includes(n))throw new RangeError(i)}function QT(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const JT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eM=/^'([^]*?)'?$/,nM=/''/g,iM=/[a-zA-Z]/;function Aa(n,t,e){const i=ar(),r=e?.locale??i.locale??xg,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=Ot(n,e?.in);if(!nu(c))throw new RangeError("Invalid time value");let u=t.match(tM).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=ou[g];return y(h,r.formatLong)}return h}).join("").match(JT).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:rM(h)};if(Sg[g])return{isToken:!0,value:h};if(g.match(iM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(c,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&Og(g)||!e?.useAdditionalDayOfYearTokens&&Cg(g))&&au(g,t,String(n));const y=Sg[g[0]];return y(c,g,r.localize,d)}).join("")}function rM(n){const t=n.match(eM);return t?t[1].replace(nM,"'"):n}function Ag(){return Object.assign({},ar())}function sM(n,t){const e=Ot(n,t?.in).getDay();return e===0?7:e}function oM(n,t){const e=aM(t)?new t(0):he(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function aM(n){return typeof n=="function"&&n.prototype?.constructor===n}const lM=10;class Eg{subPriority=0;validate(t,e){return!0}}class cM extends Eg{constructor(t,e,i,r,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class uM extends Eg{priority=lM;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,oM(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new cM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class dM extends Wt{priority=140;parse(t,e,i){switch(e){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,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const me={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}/},qn={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 ye(n,t){return n&&{value:t(n.value),rest:n.rest}}function de(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function jn(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(r*Br+s*Gs+a*$S),rest:t.slice(e[0].length)}}function Rg(n){return de(me.anyDigitsSigned,n)}function pe(n,t){switch(n){case 1:return de(me.singleDigit,t);case 2:return de(me.twoDigits,t);case 3:return de(me.threeDigits,t);case 4:return de(me.fourDigits,t);default:return de(new RegExp("^\\d{1,"+n+"}"),t)}}function Ea(n,t){switch(n){case 1:return de(me.singleDigitSigned,t);case 2:return de(me.twoDigitsSigned,t);case 3:return de(me.threeDigitsSigned,t);case 4:return de(me.fourDigitsSigned,t);default:return de(new RegExp("^-?\\d{1,"+n+"}"),t)}}function lu(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Pg(n,t){const e=t>0,i=e?t:1-t;let r;if(i<=50)r=n||100;else{const s=i+50,a=Math.trunc(s/100)*100,c=n>=s%100;r=n+a-(c?100:0)}return e?r:1-r}function Ig(n){return n%400===0||n%4===0&&n%100!==0}class fM extends Wt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="yy"});switch(e){case"y":return ye(pe(4,t),r);case"yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=Pg(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class hM extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return ye(pe(4,t),r);case"Yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=su(t,r);if(i.isTwoDigitYear){const c=Pg(i.year,s);return t.setFullYear(c,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Vn(t,r)}const a=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Vn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class pM extends Wt{priority=130;parse(t,e){return Ea(e==="R"?4:e.length,t)}set(t,e,i){const r=he(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),zr(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class gM extends Wt{priority=130;parse(t,e){return Ea(e==="u"?4:e.length,t)}set(t,e,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 mM extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 yM extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 _M extends Wt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"M":return ye(de(me.month,t),r);case"MM":return ye(pe(2,t),r);case"Mo":return ye(i.ordinalNumber(t,{unit:"month"}),r);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,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class bM extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return ye(de(me.month,t),r);case"LL":return ye(pe(2,t),r);case"Lo":return ye(i.ordinalNumber(t,{unit:"month"}),r);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,e){return e>=0&&e<=11}set(t,e,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 xM(n,t,e){const i=Ot(n,e?.in),r=vg(i,e)-t;return i.setDate(i.getDate()-r*7),Ot(i,e?.in)}class wM extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return de(me.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return Vn(xM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function vM(n,t,e){const i=Ot(n,e?.in),r=wg(i,e)-t;return i.setDate(i.getDate()-r*7),i}class SM extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return de(me.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return zr(vM(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const TM=[31,28,31,30,31,30,31,31,30,31,30,31],MM=[31,29,31,30,31,30,31,31,30,31,30,31];class DM extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return de(me.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=Ig(i),s=t.getMonth();return r?e>=1&&e<=MM[s]:e>=1&&e<=TM[s]}set(t,e,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 kM extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return de(me.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear();return Ig(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,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 cu(n,t,e){const i=ar(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Ot(n,e?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,h=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return Ca(s,h,e)}class CM extends Wt{priority=90;parse(t,e,i){switch(e){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,e){return e>=0&&e<=6}set(t,e,i,r){return t=cu(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class OM extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const c=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+c};switch(e){case"e":case"ee":return ye(pe(e.length,t),s);case"eo":return ye(i.ordinalNumber(t,{unit:"day"}),s);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,e){return e>=0&&e<=6}set(t,e,i,r){return t=cu(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class AM extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const c=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+c};switch(e){case"c":case"cc":return ye(pe(e.length,t),s);case"co":return ye(i.ordinalNumber(t,{unit:"day"}),s);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,e){return e>=0&&e<=6}set(t,e,i,r){return t=cu(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function EM(n,t,e){const i=Ot(n,e?.in),r=sM(i,e),s=t-r;return Ca(i,s,e)}class RM extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return ye(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return ye(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ye(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return ye(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"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=EM(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 PM extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(lu(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class IM extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(lu(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class LM extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(lu(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class NM extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return de(me.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const r=t.getHours()>=12;return r&&i<12?t.setHours(i+12,0,0,0):!r&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class FM extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return de(me.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class BM extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return de(me.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,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 zM extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return de(me.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const r=i<=24?i%24:i;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class UM extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return de(me.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class HM extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return de(me.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class WM extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return ye(pe(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class $M extends Wt{priority=10;parse(t,e){switch(e){case"X":return jn(qn.basicOptionalMinutes,t);case"XX":return jn(qn.basic,t);case"XXXX":return jn(qn.basicOptionalSeconds,t);case"XXXXX":return jn(qn.extendedOptionalSeconds,t);default:return jn(qn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-Oa(t)-i)}incompatibleTokens=["t","T","x"]}class YM extends Wt{priority=10;parse(t,e){switch(e){case"x":return jn(qn.basicOptionalMinutes,t);case"xx":return jn(qn.basic,t);case"xxxx":return jn(qn.basicOptionalSeconds,t);case"xxxxx":return jn(qn.extendedOptionalSeconds,t);default:return jn(qn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-Oa(t)-i)}incompatibleTokens=["t","T","X"]}class VM extends Wt{priority=40;parse(t){return Rg(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class qM extends Wt{priority=20;parse(t){return Rg(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const jM={G:new dM,y:new fM,Y:new hM,R:new pM,u:new gM,Q:new mM,q:new yM,M:new _M,L:new bM,w:new wM,I:new SM,d:new DM,D:new kM,E:new CM,e:new OM,c:new AM,i:new RM,a:new PM,b:new IM,B:new LM,h:new NM,H:new FM,K:new BM,k:new zM,m:new UM,s:new HM,S:new WM,X:new $M,x:new YM,t:new VM,T:new qM},GM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,XM=/^'([^]*?)'?$/,ZM=/''/g,QM=/\S/,JM=/[a-zA-Z]/;function tD(n,t,e,i){const r=()=>he(i?.in||e,NaN),s=Ag(),a=i?.locale??s.locale??xg,c=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(!t)return n?r():Ot(e,i?.in);const d={firstWeekContainsDate:c,weekStartsOn:u,locale:a},h=[new uM(i?.in,e)],g=t.match(KM).map(S=>{const C=S[0];if(C in ou){const E=ou[C];return E(S,a.formatLong)}return S}).join("").match(GM),y=[];for(let S of g){!i?.useAdditionalWeekYearTokens&&Og(S)&&au(S,t,n),!i?.useAdditionalDayOfYearTokens&&Cg(S)&&au(S,t,n);const C=S[0],E=jM[C];if(E){const{incompatibleTokens:U}=E;if(Array.isArray(U)){const I=y.find(B=>U.includes(B.token)||B.token===C);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${S}\` at the same time`)}else if(E.incompatibleTokens==="*"&&y.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);y.push({token:C,fullToken:S});const P=E.run(n,S,a.match,d);if(!P)return r();h.push(P.setter),n=P.rest}else{if(C.match(JM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=eD(S)),n.indexOf(S)===0)n=n.slice(S.length);else return r()}}if(n.length>0&&QM.test(n))return r();const _=h.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,E)=>E.indexOf(S)===C).map(S=>h.filter(C=>C.priority===S).sort((C,E)=>E.subPriority-C.subPriority)).map(S=>S[0]);let x=Ot(e,i?.in);if(isNaN(+x))return r();const v={};for(const S of _){if(!S.validate(x,d))return r();const C=S.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function eD(n){return n.match(XM)[1].replace(ZM,"'")}function nD(n,t){const e=Ot(n,t?.in);return e.setMinutes(0,0,0),e}function iD(n,t){const e=Ot(n,t?.in);return e.setSeconds(0,0),e}function rD(n,t){const e=Ot(n,t?.in);return e.setMilliseconds(0),e}function sD(n){const t=n/Br;return Math.trunc(t)}function Lg(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=cD(n);let s;if(r.date){const d=uD(r.date,i);s=dD(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let c=0,u;if(r.time&&(c=fD(r.time),isNaN(c)))return e();if(r.timezone){if(u=hD(r.timezone),isNaN(u))return e()}else{const d=new Date(a+c),h=Ot(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return Ot(a+c+u,t?.in)}const Ra={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},oD=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,aD=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,lD=/^([+-])(\d{2})(?::?(\d{2}))?$/;function cD(n){const t={},e=n.split(Ra.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Ra.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Ra.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=Ra.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function uD(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:n.slice((i[1]||i[2]).length)}}function dD(n,t){if(t===null)return new Date(NaN);const e=n.match(oD);if(!e)return new Date(NaN);const i=!!e[4],r=Js(e[1]),s=Js(e[2])-1,a=Js(e[3]),c=Js(e[4]),u=Js(e[5])-1;if(i)return _D(t,c,u)?pD(t,c,u):new Date(NaN);{const d=new Date(0);return!mD(t,s,a)||!yD(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Js(n){return n?parseInt(n):1}function fD(n){const t=n.match(aD);if(!t)return NaN;const e=uu(t[1]),i=uu(t[2]),r=uu(t[3]);return bD(e,i,r)?e*Br+i*Gs+r*1e3:NaN}function uu(n){return n&&parseFloat(n.replace(",","."))||0}function hD(n){if(n==="Z")return 0;const t=n.match(lD);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return xD(i,r)?e*(i*Br+r*Gs):NaN}function pD(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const gD=[31,null,31,30,31,30,31,31,30,31,30,31];function Ng(n){return n%400===0||n%4===0&&n%100!==0}function mD(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(gD[t]||(Ng(n)?29:28))}function yD(n,t){return t>=1&&t<=(Ng(n)?366:365)}function _D(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function bD(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function xD(n,t){return t>=0&&t<=59}const wD=1e3;var ht=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(ht||{});const vD=["in","not_in","selector"],SD=["empty","not_empty"],TD=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],ur=n=>n.filter(t=>t!=="time"),Fg=["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"],Bg=ur(Fg),MD=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],zg=[...Fg,"application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],Ug=ur(zg),DD=[...MD,"cache_hit_rate","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"],kD=["control_plane","control_plane_group","ai_control_plane","gateway_service","consumer","ai_consumer","ai_consumer_group","application","oidc_credential","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","mcp_server","model","agent","ai_data_plane_node"],Hg=ur(kD);ur(["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","cache_status","client_ip","consumer","ai_consumer","consumer_group","ai_consumer_group","control_plane","control_plane_group","ai_control_plane","country_code","data_plane_node","data_plane_node_version","ai_data_plane_node","gateway_service","header_host","header_user_agent","http_method","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","oidc_credential","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"]),ur(["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 CD=["platform","platform_usage"],OD=n=>CD.includes(n),AD=[...zg,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],Wg=ur(AD);[...DD];const ED=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],$g=ur(ED);new Set(Bg),new Set(Ug),new Set(Hg),new Set(Wg),new Set($g);const Yg=[{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"}];Yg.map(n=>n.code);const RD=n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:vD},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:SD}},required:["field","operator"],additionalProperties:!1}]}}),PD=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];RD([...new Set([...Ug,...Bg,...Hg,...Wg,...PD,...$g])]);const ID={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"}},LD=(n,t,e)=>{let i;const r=ID[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function du(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const ND={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},FD={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},BD={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zD={date:du({formats:ND,defaultWidth:"full"}),time:du({formats:FD,defaultWidth:"full"}),dateTime:du({formats:BD,defaultWidth:"full"})},UD={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},HD=(n,t,e,i)=>UD[n];function to(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,c=e?.width?String(e.width):a;r=n.formattingValues[c]||n.formattingValues[a]}else{const a=n.defaultWidth,c=e?.width?String(e.width):n.defaultWidth;r=n.values[c]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const WD={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$D={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},YD={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"]},VD={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"]},qD={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"}},jD={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"}},GD=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},KD={ordinalNumber:GD,era:to({values:WD,defaultWidth:"wide"}),quarter:to({values:$D,defaultWidth:"wide",argumentCallback:n=>n-1}),month:to({values:YD,defaultWidth:"wide"}),day:to({values:VD,defaultWidth:"wide"}),dayPeriod:to({values:qD,defaultWidth:"wide",formattingValues:jD,defaultFormattingWidth:"wide"})};function eo(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],c=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(c)?ZD(c,g=>g.test(a)):XD(c,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function XD(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function ZD(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function QD(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const c=t.slice(r.length);return{value:a,rest:c}}}const JD=/^(\d+)(th|st|nd|rd)?/i,tk=/\d+/i,ek={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},nk={any:[/^b/i,/^(a|c)/i]},ik={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rk={any:[/1/i,/2/i,/3/i,/4/i]},sk={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},ok={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]},ak={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},lk={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]},ck={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},uk={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}},dk={ordinalNumber:QD({matchPattern:JD,parsePattern:tk,valueCallback:n=>parseInt(n,10)}),era:eo({matchPatterns:ek,defaultMatchWidth:"wide",parsePatterns:nk,defaultParseWidth:"any"}),quarter:eo({matchPatterns:ik,defaultMatchWidth:"wide",parsePatterns:rk,defaultParseWidth:"any",valueCallback:n=>n+1}),month:eo({matchPatterns:sk,defaultMatchWidth:"wide",parsePatterns:ok,defaultParseWidth:"any"}),day:eo({matchPatterns:ak,defaultMatchWidth:"wide",parsePatterns:lk,defaultParseWidth:"any"}),dayPeriod:eo({matchPatterns:ck,defaultMatchWidth:"any",parsePatterns:uk,defaultParseWidth:"any"})},fk={code:"en-US",formatDistance:LD,formatLong:zD,formatRelative:HD,localize:KD,match:dk,options:{weekStartsOn:0,firstWeekContainsDate:1}};let hk={};function no(){return hk}const Vg=6048e5,pk=864e5,gk=60,mk=3600,qg=Symbol.for("constructDateFrom");function Mn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&qg in n?n[qg](t):n instanceof Date?new n.constructor(t):new Date(t)}function We(n,t){return Mn(t||n,n)}function jg(n){const t=We(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function yk(n,...t){const e=Mn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Hr(n,t){const e=We(n,t?.in);return e.setHours(0,0,0,0),e}function _k(n,t,e){const[i,r]=yk(e?.in,n,t),s=Hr(i),a=Hr(r),c=+s-jg(s),u=+a-jg(a);return Math.round((c-u)/pk)}function bk(n,t){const e=We(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function xk(n,t){const e=We(n,t?.in);return _k(e,bk(e))+1}function oi(n,t){const e=no(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=We(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Pa(n,t){return oi(n,{...t,weekStartsOn:1})}function Gg(n,t){const e=We(n,t?.in),i=e.getFullYear(),r=Mn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Pa(r),a=Mn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=Pa(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function wk(n,t){const e=Gg(n,t),i=Mn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Pa(i)}function vk(n,t){const e=We(n,t?.in),i=+Pa(e)-+wk(e);return Math.round(i/Vg)+1}function Kg(n,t){const e=We(n,t?.in),i=e.getFullYear(),r=no(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Mn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const c=oi(a,t),u=Mn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=oi(u,t);return+e>=+c?i+1:+e>=+d?i:i-1}function Sk(n,t){const e=no(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Kg(n,t),s=Mn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),oi(s,t)}function Tk(n,t){const e=We(n,t?.in),i=+oi(e,t)-+Sk(e,t);return Math.round(i/Vg)+1}function Qt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Ri={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Qt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Qt(e+1,2)},d(n,t){return Qt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Qt(n.getHours()%12||12,t.length)},H(n,t){return Qt(n.getHours(),t.length)},m(n,t){return Qt(n.getMinutes(),t.length)},s(n,t){return Qt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Qt(r,t.length)}},Wr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Xg={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return Ri.y(n,t)},Y:function(n,t,e,i){const r=Kg(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Qt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Qt(s,t.length)},R:function(n,t){const e=Gg(n);return Qt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Qt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Qt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Qt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Ri.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Qt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=Tk(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(n,t,e){const i=vk(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Qt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Ri.d(n,t)},D:function(n,t,e){const i=xk(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Qt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Qt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Qt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Qt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Wr.noon:i===0?r=Wr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Wr.evening:i>=12?r=Wr.afternoon:i>=4?r=Wr.morning:r=Wr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Ri.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ri.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ri.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ri.s(n,t)},S:function(n,t){return Ri.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Qg(i);case"XXXX":case"XX":return dr(i);default:return dr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Qg(i);case"xxxx":case"xx":return dr(i);default:return dr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zg(i,":");default:return"GMT"+dr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zg(i,":");default:return"GMT"+dr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Qt(i,t.length)},T:function(n,t,e){return Qt(+n,t.length)}};function Zg(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Qt(s,2)}function Qg(n,t){return n%60===0?(n>0?"-":"+")+Qt(Math.abs(n)/60,2):dr(n,t)}function dr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Qt(Math.trunc(i/60),2),s=Qt(i%60,2);return e+r+t+s}const Jg=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},tm=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Mk=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return Jg(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Jg(i,t)).replace("{{time}}",tm(r,t))},Dk={p:tm,P:Mk},kk=/^D+$/,Ck=/^Y+$/,Ok=["D","DD","YY","YYYY"];function Ak(n){return kk.test(n)}function Ek(n){return Ck.test(n)}function Rk(n,t,e){const i=Pk(n,t,e);if(console.warn(i),Ok.includes(n))throw new RangeError(i)}function Pk(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Ik(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Lk(n){return!(!Ik(n)&&typeof n!="number"||isNaN(+We(n)))}const Nk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bk=/^'([^]*?)'?$/,zk=/''/g,Uk=/[a-zA-Z]/;function Hk(n,t,e){const i=no(),r=e?.locale??i.locale??fk,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=We(n,e?.in);if(!Lk(c))throw new RangeError("Invalid time value");let u=t.match(Fk).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=Dk[g];return y(h,r.formatLong)}return h}).join("").match(Nk).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:Wk(h)};if(Xg[g])return{isToken:!0,value:h};if(g.match(Uk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(c,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&Ek(g)||!e?.useAdditionalDayOfYearTokens&&Ak(g))&&Rk(g,t,String(n));const y=Xg[g[0]];return y(c,g,r.localize,d)}).join("")}function Wk(n){const t=n.match(Bk);return t?t[1].replace(zk,"'"):n}function Ia(n,t,e){const i=We(n,e?.in);return isNaN(t)?Mn(n,NaN):(i.setDate(i.getDate()+t),i)}function em(n,t,e){const i=We(n,e?.in);if(isNaN(t))return Mn(n,NaN);if(!t)return i;const r=i.getDate(),s=Mn(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function $k(n,t,e){return em(n,t*3,e)}function $r(n,t){const e=We(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Yr(n,t){const e=We(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Yk(n,t){const e=We(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Mn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Vk(){return Object.assign({},no())}function nm(n){return Math.trunc(n*mk)}function qk(n){const t=n/gk;return Math.trunc(t)}function im(n,t,e){return em(n,-1,e)}function rm(n,t,e){return $k(n,-1,e)}function sm(n,t,e){const i=Vk(),r=Kk(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?jk(r,t):Gk(r,t)}function jk(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Gk(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Kk(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Xk(n,t){const e=eC(t);return"formatToParts"in e?Qk(e,n):Jk(e,n)}const Zk={year:0,month:1,day:2,hour:3,minute:4,second:5};function Qk(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=Zk[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Jk(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const fu={},om=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")),tC=om==="06/25/2014, 00:00:00"||om==="06/25/2014 00:00:00";function eC(n){return fu[n]||(fu[n]=tC?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),fu[n]}function hu(n,t,e,i,r,s,a){const c=new Date(0);return c.setUTCFullYear(n,t,e),c.setUTCHours(i,r,s,a),c}const am=36e5,nC=6e4,pu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function io(n,t,e){if(!n)return 0;let i=pu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=pu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),lm(r)?-(r*am):NaN;if(i=pu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return lm(r,a)?(s=Math.abs(r)*am+a*nC,i[1]==="+"?-s:s):NaN}if(sC(n)){t=new Date(t||Date.now());const a=e?t:iC(t),c=gu(a,n);return-(e?c:rC(t,c,n))}return NaN}function iC(n){return hu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function gu(n,t){const e=Xk(n,t),i=hu(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function rC(n,t,e){let i=n.getTime()-t;const r=gu(new Date(i),e);if(t===r)return t;i-=r-t;const s=gu(new Date(i),e);return r===s?r:Math.max(r,s)}function lm(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const cm={};function sC(n){if(cm[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),cm[n]=!0,!0}catch{return!1}}const oC=60*1e3,aC={X:function(n,t,e){const i=mu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return um(i);case"XXXX":case"XX":return Vr(i);default:return Vr(i,":")}},x:function(n,t,e){const i=mu(e.timeZone,n);switch(t){case"x":return um(i);case"xxxx":case"xx":return Vr(i);default:return Vr(i,":")}},O:function(n,t,e){const i=mu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+lC(i,":");default:return"GMT"+Vr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return sm("short",n,e);default:return sm("long",n,e)}}};function mu(n,t){const e=n?io(n,t,!0)/oC:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function La(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Vr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=La(Math.floor(i/60),2),s=La(Math.floor(i%60),2);return e+r+t+s}function um(n,t){return n%60===0?(n>0?"-":"+")+La(Math.abs(n)/60,2):Vr(n,t)}function lC(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+La(s,2)}function dm(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const fm=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,yu=36e5,hm=6e4,cC=2,je={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:fm};function Na(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?cC:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=uC(n),{year:r,restDateString:s}=dC(i.date,e),a=fC(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const c=a.getTime();let u=0,d;if(i.time&&(u=hC(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=io(i.timeZone||t.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=dm(new Date(c+u)),d=dm(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function uC(n){const t={};let e=je.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=je.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=je.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function dC(n,t){if(n){const e=je.YYY[t],i=je.YYYYY[t];let r=je.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=je.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function fC(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=je.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,mm(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=je.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return mC(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=je.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return mm(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=je.Www.exec(n),s)return r=parseInt(s[1],10)-1,ym(r)?pm(t,r):new Date(NaN);if(s=je.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return ym(r,a)?pm(t,r,a):new Date(NaN)}return null}function hC(n){let t,e,i=je.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),_u(t)?t%24*yu:NaN;if(i=je.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),_u(t,e)?t%24*yu+e*hm:NaN;if(i=je.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return _u(t,e,r)?t%24*yu+e*hm+r*1e3:NaN}return null}function pm(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const pC=[31,28,31,30,31,30,31,31,30,31,30,31],gC=[31,29,31,30,31,30,31,31,30,31,30,31];function gm(n){return n%400===0||n%4===0&&n%100!==0}function mm(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gm(n);if(i&&e>gC[t]||!i&&e>pC[t])return!1}return!0}function mC(n,t){if(t<1)return!1;const e=gm(n);return!(e&&t>366||!e&&t>365)}function ym(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function _u(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const yC=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function _C(n,t,e={}){t=String(t);const i=t.match(yC);if(i){const r=Na(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const c=s.indexOf(a),u=s[c-1]==="'",d=s.replace(a,"'"+aC[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return Hk(n,t,e)}function _m(n,t,e){n=Na(n,e);const i=io(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function bm(n,t,e,i){return i={...i,timeZone:t,originalDate:n},_C(_m(n,t,{timeZone:i.timeZone}),e,i)}function bC(n,t,e){if(typeof n=="string"&&!n.match(fm))return Na(n,{...e,timeZone:t});n=Na(n,e);const i=hu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=io(t,new Date(i));return new Date(i+r)}function xC(n,t){return-io(n,t)}function xm(n,t={}){const e=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)"),bm(n,e,i)}function wC(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return bm(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const vC={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 bu(n){return n&&TD.find(t=>n<=vC[t])||null}var Fa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ba={exports:{}};Ba.exports;var wm;function SC(){return wm||(wm=1,(function(n,t){var e=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",c="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",y="[object Map]",_="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",C="[object Set]",E="[object String]",U="[object Symbol]",P="[object WeakMap]",I="[object ArrayBuffer]",B="[object DataView]",N="[object Float32Array]",T="[object Float64Array]",D="[object Int8Array]",O="[object Int16Array]",L="[object Int32Array]",W="[object Uint8Array]",tt="[object Uint8ClampedArray]",G="[object Uint16Array]",nt="[object Uint32Array]",X=/[\\^$.*+?()[\]{}|]/g,Q=/\w*$/,rt=/^\[object .+?Constructor\]$/,st=/^(?:0|[1-9]\d*)$/,ot={};ot[s]=ot[a]=ot[I]=ot[B]=ot[c]=ot[u]=ot[N]=ot[T]=ot[D]=ot[O]=ot[L]=ot[y]=ot[_]=ot[x]=ot[S]=ot[C]=ot[E]=ot[U]=ot[W]=ot[tt]=ot[G]=ot[nt]=!0,ot[d]=ot[h]=ot[P]=!1;var H=typeof Fa=="object"&&Fa&&Fa.Object===Object&&Fa,V=typeof self=="object"&&self&&self.Object===Object&&self,J=H||V||Function("return this")(),_t=t&&!t.nodeType&&t,pt=_t&&!0&&n&&!n.nodeType&&n,it=pt&&pt.exports===_t;function ft(k,$){return k.set($[0],$[1]),k}function ut(k,$){return k.add($),k}function dt(k,$){for(var Z=-1,mt=k?k.length:0;++Z<mt&&$(k[Z],Z,k)!==!1;);return k}function gt(k,$){for(var Z=-1,mt=$.length,Me=k.length;++Z<mt;)k[Me+Z]=$[Z];return k}function lt(k,$,Z,mt){for(var Me=-1,Ye=k?k.length:0;++Me<Ye;)Z=$(Z,k[Me],Me,k);return Z}function It(k,$){for(var Z=-1,mt=Array(k);++Z<k;)mt[Z]=$(Z);return mt}function Bt(k,$){return k?.[$]}function wt(k){var $=!1;if(k!=null&&typeof k.toString!="function")try{$=!!(k+"")}catch{}return $}function kt(k){var $=-1,Z=Array(k.size);return k.forEach(function(mt,Me){Z[++$]=[Me,mt]}),Z}function Dt(k,$){return function(Z){return k($(Z))}}function ve(k){var $=-1,Z=Array(k.size);return k.forEach(function(mt){Z[++$]=mt}),Z}var bt=Array.prototype,Vt=Function.prototype,Se=Object.prototype,Ae=J["__core-js_shared__"],oe=(function(){var k=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return k?"Symbol(src)_1."+k:""})(),on=Vt.toString,qt=Se.hasOwnProperty,Ie=Se.toString,ie=RegExp("^"+on.call(qt).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=it?J.Buffer:void 0,Ee=J.Symbol,gn=J.Uint8Array,zi=Dt(Object.getPrototypeOf,Object),kn=Object.create,$e=Se.propertyIsEnumerable,In=bt.splice,li=Object.getOwnPropertySymbols,wo=Te?Te.isBuffer:void 0,vo=Dt(Object.keys,Object),br=Gn(J,"DataView"),ci=Gn(J,"Map"),So=Gn(J,"Promise"),To=Gn(J,"Set"),Mo=Gn(J,"WeakMap"),Ui=Gn(Object,"create"),ol=di(br),sd=di(ci),od=di(So),ad=di(To),ld=di(Mo),Do=Ee?Ee.prototype:void 0,al=Do?Do.valueOf:void 0;function ui(k){var $=-1,Z=k?k.length:0;for(this.clear();++$<Z;){var mt=k[$];this.set(mt[0],mt[1])}}function cd(){this.__data__=Ui?Ui(null):{}}function ko(k){return this.has(k)&&delete this.__data__[k]}function ud(k){var $=this.__data__;if(Ui){var Z=$[k];return Z===i?void 0:Z}return qt.call($,k)?$[k]:void 0}function Co(k){var $=this.__data__;return Ui?$[k]!==void 0:qt.call($,k)}function dd(k,$){var Z=this.__data__;return Z[k]=Ui&&$===void 0?i:$,this}ui.prototype.clear=cd,ui.prototype.delete=ko,ui.prototype.get=ud,ui.prototype.has=Co,ui.prototype.set=dd;function Ln(k){var $=-1,Z=k?k.length:0;for(this.clear();++$<Z;){var mt=k[$];this.set(mt[0],mt[1])}}function fd(){this.__data__=[]}function hd(k){var $=this.__data__,Z=xr($,k);if(Z<0)return!1;var mt=$.length-1;return Z==mt?$.pop():In.call($,Z,1),!0}function pd(k){var $=this.__data__,Z=xr($,k);return Z<0?void 0:$[Z][1]}function ll(k){return xr(this.__data__,k)>-1}function gd(k,$){var Z=this.__data__,mt=xr(Z,k);return mt<0?Z.push([k,$]):Z[mt][1]=$,this}Ln.prototype.clear=fd,Ln.prototype.delete=hd,Ln.prototype.get=pd,Ln.prototype.has=ll,Ln.prototype.set=gd;function Hi(k){var $=-1,Z=k?k.length:0;for(this.clear();++$<Z;){var mt=k[$];this.set(mt[0],mt[1])}}function cl(){this.__data__={hash:new ui,map:new(ci||Ln),string:new ui}}function md(k){return wr(this,k).delete(k)}function yd(k){return wr(this,k).get(k)}function _d(k){return wr(this,k).has(k)}function bd(k,$){return wr(this,k).set(k,$),this}Hi.prototype.clear=cl,Hi.prototype.delete=md,Hi.prototype.get=yd,Hi.prototype.has=_d,Hi.prototype.set=bd;function Wi(k){this.__data__=new Ln(k)}function xd(){this.__data__=new Ln}function es(k){return this.__data__.delete(k)}function wd(k){return this.__data__.get(k)}function ns(k){return this.__data__.has(k)}function vd(k,$){var Z=this.__data__;if(Z instanceof Ln){var mt=Z.__data__;if(!ci||mt.length<e-1)return mt.push([k,$]),this;Z=this.__data__=new Hi(mt)}return Z.set(k,$),this}Wi.prototype.clear=xd,Wi.prototype.delete=es,Wi.prototype.get=wd,Wi.prototype.has=ns,Wi.prototype.set=vd;function Sd(k,$){var Z=Po(k)||Sl(k)?It(k.length,String):[],mt=Z.length,Me=!!mt;for(var Ye in k)qt.call(k,Ye)&&!(Me&&(Ye=="length"||bl(Ye,mt)))&&Z.push(Ye);return Z}function ul(k,$,Z){var mt=k[$];(!(qt.call(k,$)&&vl(mt,Z))||Z===void 0&&!($ in k))&&(k[$]=Z)}function xr(k,$){for(var Z=k.length;Z--;)if(vl(k[Z][0],$))return Z;return-1}function dl(k,$){return k&&Ao($,Io($),k)}function is(k,$,Z,mt,Me,Ye,Nn){var Le;if(mt&&(Le=Ye?mt(k,Me,Ye,Nn):mt(k)),Le!==void 0)return Le;if(!ls(k))return k;var Ml=Po(k);if(Ml){if(Le=yl(k),!$)return ml(k,Le)}else{var ce=an(k),cs=ce==h||ce==g;if(Id(k))return hl(k,$);if(ce==x||ce==s||cs&&!Ye){if(wt(k))return Ye?k:{};if(Le=_l(cs?{}:k),!$)return Eo(k,dl(Le,k))}else{if(!ot[ce])return Ye?k:{};Le=Ed(k,ce,is,$)}}Nn||(Nn=new Wi);var Kn=Nn.get(k);if(Kn)return Kn;if(Nn.set(k,Le),!Ml)var Lo=Z?Ad(k):Io(k);return dt(Lo||k,function(vr,Ne){Lo&&(Ne=vr,vr=k[Ne]),ul(Le,Ne,is(vr,$,Z,mt,Ne,k,Nn))}),Le}function Td(k){return ls(k)?kn(k):{}}function Md(k,$,Z){var mt=$(k);return Po(k)?mt:gt(mt,Z(k))}function Dd(k){return Ie.call(k)}function kd(k){if(!ls(k)||wl(k))return!1;var $=as(k)||wt(k)?ie:rt;return $.test(di(k))}function fl(k){if(!Ro(k))return vo(k);var $=[];for(var Z in Object(k))qt.call(k,Z)&&Z!="constructor"&&$.push(Z);return $}function hl(k,$){if($)return k.slice();var Z=new k.constructor(k.length);return k.copy(Z),Z}function rs(k){var $=new k.constructor(k.byteLength);return new gn($).set(new gn(k)),$}function Oo(k,$){var Z=$?rs(k.buffer):k.buffer;return new k.constructor(Z,k.byteOffset,k.byteLength)}function Cd(k,$,Z){var mt=$?Z(kt(k),!0):kt(k);return lt(mt,ft,new k.constructor)}function pl(k){var $=new k.constructor(k.source,Q.exec(k));return $.lastIndex=k.lastIndex,$}function ss(k,$,Z){var mt=$?Z(ve(k),!0):ve(k);return lt(mt,ut,new k.constructor)}function gl(k){return al?Object(al.call(k)):{}}function Od(k,$){var Z=$?rs(k.buffer):k.buffer;return new k.constructor(Z,k.byteOffset,k.length)}function ml(k,$){var Z=-1,mt=k.length;for($||($=Array(mt));++Z<mt;)$[Z]=k[Z];return $}function Ao(k,$,Z,mt){Z||(Z={});for(var Me=-1,Ye=$.length;++Me<Ye;){var Nn=$[Me],Le=void 0;ul(Z,Nn,Le===void 0?k[Nn]:Le)}return Z}function Eo(k,$){return Ao(k,os(k),$)}function Ad(k){return Md(k,Io,os)}function wr(k,$){var Z=k.__data__;return xl($)?Z[typeof $=="string"?"string":"hash"]:Z.map}function Gn(k,$){var Z=Bt(k,$);return kd(Z)?Z:void 0}var os=li?Dt(li,Object):Fd,an=Dd;(br&&an(new br(new ArrayBuffer(1)))!=B||ci&&an(new ci)!=y||So&&an(So.resolve())!=v||To&&an(new To)!=C||Mo&&an(new Mo)!=P)&&(an=function(k){var $=Ie.call(k),Z=$==x?k.constructor:void 0,mt=Z?di(Z):void 0;if(mt)switch(mt){case ol:return B;case sd:return y;case od:return v;case ad:return C;case ld:return P}return $});function yl(k){var $=k.length,Z=k.constructor($);return $&&typeof k[0]=="string"&&qt.call(k,"index")&&(Z.index=k.index,Z.input=k.input),Z}function _l(k){return typeof k.constructor=="function"&&!Ro(k)?Td(zi(k)):{}}function Ed(k,$,Z,mt){var Me=k.constructor;switch($){case I:return rs(k);case c:case u:return new Me(+k);case B:return Oo(k,mt);case N:case T:case D:case O:case L:case W:case tt:case G:case nt:return Od(k,mt);case y:return Cd(k,mt,Z);case _:case E:return new Me(k);case S:return pl(k);case C:return ss(k,mt,Z);case U:return gl(k)}}function bl(k,$){return $=$??r,!!$&&(typeof k=="number"||st.test(k))&&k>-1&&k%1==0&&k<$}function xl(k){var $=typeof k;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?k!=="__proto__":k===null}function wl(k){return!!oe&&oe in k}function Ro(k){var $=k&&k.constructor,Z=typeof $=="function"&&$.prototype||Se;return k===Z}function di(k){if(k!=null){try{return on.call(k)}catch{}try{return k+""}catch{}}return""}function Rd(k){return is(k,!0,!0)}function vl(k,$){return k===$||k!==k&&$!==$}function Sl(k){return Pd(k)&&qt.call(k,"callee")&&(!$e.call(k,"callee")||Ie.call(k)==s)}var Po=Array.isArray;function Tl(k){return k!=null&&Ld(k.length)&&!as(k)}function Pd(k){return Nd(k)&&Tl(k)}var Id=wo||ee;function as(k){var $=ls(k)?Ie.call(k):"";return $==h||$==g}function Ld(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=r}function ls(k){var $=typeof k;return!!k&&($=="object"||$=="function")}function Nd(k){return!!k&&typeof k=="object"}function Io(k){return Tl(k)?Sd(k):fl(k)}function Fd(){return[]}function ee(){return!1}n.exports=Rd})(Ba,Ba.exports)),Ba.exports}SC();const Dn=(n,t)=>new Date(n.getTime()-xC(t,n));class Oe{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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=168&&e.add("hourly"),i>=48&&e.add("daily"),i>=672&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=bC(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return _m(e,t)}}class TC extends Oe{rawStart(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class MC extends Oe{rawStart(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class DC extends Oe{rawStart(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class kC extends Oe{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class CC extends Oe{rawEnd(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Dn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=oi(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Dn(i,t)),i}}class OC extends Oe{rawEnd(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}rawStart(t){let e=$r(rm(this.tzAdjustedDate(t)));return t&&(e=Dn(e,t)),e}}class AC extends Oe{rawEnd(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}rawStart(t){let e=Yr(im(this.tzAdjustedDate(t)));return t&&(e=Dn(e,t)),e}}class EC extends Oe{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Dn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Dn(e,t)),e}}ht.FIFTEEN_MIN,new Oe({key:ht.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"]}),ht.ONE_HOUR,new Oe({key:ht.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"]}),ht.SIX_HOUR,new Oe({key:ht.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"]}),ht.TWELVE_HOUR,new Oe({key:ht.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"]}),ht.ONE_DAY,new Oe({key:ht.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"]}),ht.SEVEN_DAY,new Oe({key:ht.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"]}),ht.THIRTY_DAY,new Oe({key:ht.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"]}),ht.NINETY_DAY,new Oe({key:ht.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"]}),ht.ONE_HUNDRED_EIGHTY_DAY,new Oe({key:ht.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"]}),ht.ONE_YEAR,new Oe({key:ht.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"]}),ht.CURRENT_WEEK,new TC({key:ht.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=oi(new Date,{weekStartsOn:1});return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ht.CURRENT_MONTH,new MC({key:ht.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Yr(new Date);return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.CURRENT_QUARTER,new DC({key:ht.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=$r(new Date);return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.CURRENT_YEAR,new kC({key:ht.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.PREVIOUS_WEEK,new CC({key:ht.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"]}),ht.PREVIOUS_MONTH,new AC({key:ht.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Yr(new Date),e=Yr(im(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=vm(t,e)),3600*24*Yk(new Date().setMonth(new Date().getMonth()-1))+nm(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.PREVIOUS_QUARTER,new OC({key:ht.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=$r(new Date),t=$r(rm(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.PREVIOUS_YEAR,new EC({key:ht.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=vm(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+nm(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function vm(n,t){return qk(n.getTimezoneOffset()-t.getTimezoneOffset())}ht.FIFTEEN_MIN,ht.ONE_HOUR,ht.SIX_HOUR,ht.TWELVE_HOUR,ht.ONE_DAY,ht.SEVEN_DAY,ht.FIFTEEN_MIN,ht.ONE_HOUR,ht.SIX_HOUR,ht.TWELVE_HOUR,ht.ONE_DAY,ht.SEVEN_DAY,ht.THIRTY_DAY,ht.NINETY_DAY,ht.ONE_HUNDRED_EIGHTY_DAY,ht.ONE_YEAR,ht.CURRENT_WEEK,ht.CURRENT_MONTH,ht.CURRENT_QUARTER,ht.CURRENT_YEAR,ht.PREVIOUS_WEEK,ht.PREVIOUS_MONTH,ht.PREVIOUS_QUARTER,ht.PREVIOUS_YEAR;const RC=new Map(Yg.map(n=>[n.code,{code:n.code,name:n.name}])),xu=n=>RC.get(n)?.name||n,Sm=1e3,PC=1e4,Tm=1e6,Mm=1e9,Dm=1e12,za=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},ro=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function Ua(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?PC:Sm;return n<r||t.precision&&t.precision>Math.log10(n)?e=za(ro(n,1,t),t):n<Tm?e=`${ro(n,Sm,t)}k`:n<Mm?e=`${ro(n,Tm,t)}m`:n<Dm?e=`${za(ro(n,Mm,t),t)}b`:e=`${za(ro(n,Dm,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}Ua.addCommas=za;const IC=typeof document<"u"&&document.documentElement?.lang||"en-US",Ha=new Intl.NumberFormat(IC);function fr({i18n:n}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,c=r?Math.pow(2,30):1e9,u=r?Math.pow(2,20):1e6,d=r?Math.pow(2,10):1e3;let h;return i>=s?h=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=c?h=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},e=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?n.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:c=!1,translateUnit:u=d=>d}={})=>{const d=u(r,i);switch(r){case"bytes":return t(i,s);case"usd":return e(i,a);default:return isNaN(i)?`${i}`:c?`${Ua(i,{capital:!0})} ${d}`:i>=.01?`${Ha.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:e,formatRange:(i,r,s,{isBytes1024:a=!1,currency:c="USD",approximate:u=!1,translateUnit:d=h=>h}={})=>{const h=d(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${e(i,c)} - ${e(r,c)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${Ua(i,{capital:!0})} - ${Ua(r,{capital:!0})} ${h}`}const g=i>=.01?`${Ha.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,y=r>=.01?`${Ha.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${g} - ${y} ${h}`}}}const Wa=n=>["interactive","zoom-interactive"].includes(n),km=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Wa(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=Pt.useI18n(),{formatUnit:a}=fr({i18n:s}),c=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Wa(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",h=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(h,e):ao({tickValue:new Date(h),granularity:e}),n.tooltipSeries=r.dataPoints.map((g,y)=>{const _=g.parsed[d],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=g.dataset.label;return{backgroundColor:u[y].backgroundColor,borderColor:u[y].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(c),n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},Cm=(n,t)=>{const{tooltip:e}=t,{i18n:i}=Pt.useI18n(),{formatUnit:r}=fr({i18n:i});if(e.opacity===0&&!Wa(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,c)=>c.rawValue-a.rawValue);if(e.body&&!Wa(n.interactionMode)){const a=e.labelColors,c=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((d,h)=>{const g=u?d.parsed:d.parsed[c],y=r(g??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:y,rawValue:g,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},LC=n=>n&&n.datasets&&n.datasets.length,NC=n=>LC(n)&&n.datasets.some(t=>t.data.length),FC=n=>n.datasets.some(t=>t.data[0]&&nu(t.data[0].x)),BC=n=>!!NC(n)&&n.datasets.some(t=>t.data.length==1),zC=n=>FC(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),wu=(n,t,e)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,c=n.x??0;return c<e?c+t*s*(1-r):c-t*a*(1-r)},UC=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function Om(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Am=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(e)},HC=2,Em=10,Rm=12,$a=10,WC="#f1f0ff",$C="#e0e4ea",Pm="#6c7489",YC="#afb7c5",VC="#d60027",qC="#ad000e",vu="#6c7489",Im="#52596e",jC="#007d60",GC="#995c00",KC="#ffc400",XC="'Inter', Roboto, Helvetica, sans-serif",so="16px",ZC="20px",QC="#bee2ff",JC="#8fc1ff",tO="#5f9aff",eO="#306fff",nO="#b5ffee",iO="#00fabe",rO="#00d6a4",sO="#00a17b",oO="#007d60",aO="#005944",lO="#b5ffee",cO="#00fabe",uO="#b5ffee",dO="#00a17b",fO="#fff296",hO="#ffe04b",pO="#ffc400",gO="#b37600",mO="#995c00",yO="#804400",_O="#fff296",bO="#ffe04b",xO="#ffc2b3",wO="#ff9877",vO="#ff723c",SO="#f75008",TO="#d13500",MO="#a31f00",DO="#ffc2b3",kO="#ff9877",CO="#ff723c",OO="#f75008",AO="#d13500",EO="#a31f00",RO="#ffc2b3",PO="#ff9877",IO="#ff723c",LO="#f75008",NO="#d13500",FO="#a31f00",BO="#ffc2b3",zO="#ff9877",UO="#ff723c",HO="#f75008",WO="#d13500",$O="#a31f00",YO="#ffc2b3",VO="#ff9877",qO="#ff723c",jO="#f75008",GO="#d13500",KO="#ffabab",XO="#ff7272",ZO="#ff3954",QO="#f50045",JO="#d60027",tA="#ad000e",eA="#ffabab",nA="#ff7272",iA="#ff3954",rA="#f50045",sA="#d60027",oA="#eefaff",aA="#ecfffb",lA="#fffce0",cA="#fff1ef",uA="#ffe5e5",dA="#5f9aff",fA="#00d6a4",hA="#ffc400",pA="#ff723c",gA="#ff3954",Pi=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Su=(n,t)=>(t||Pi)[n%Pi.length],mA="#6f7787",yA={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"}},_A=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return yA[t]?.background||"#fafafa"},bA=YC,Lm=(n,t,e,i)=>{let r;return e?r=bA:Array.isArray(i)?r=Su(n,i):r=i[t],r||Su(n)},Tu=n=>{switch(n){case"error":return VC;case"warning":return KC;case"neutral":return Pm;default:return Pm}},xA={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},wA=2,vA=0,Mu=new Map,Nm=(n,t)=>{const{i18n:e}=Pt.useI18n(),{formatBytes:i}=fr({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):Ha.format(n)},SA=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},TA=()=>{const n="label_height";if(!Mu.has(n)){const t=le({});Mu.set(n,t.lineHeight)}return Mu.get(n)},MA=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):e,0),DA=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,kA=$C,CA={100:QC,101:JC,102:tO,103:eO,200:nO,201:iO,202:rO,203:sO,204:oO,205:aO,206:lO,207:cO,208:uO,226:dO,300:fO,301:hO,302:pO,303:gO,304:mO,305:yO,307:_O,308:bO,400:xO,401:wO,402:vO,403:SO,404:TO,405:MO,406:DO,407:kO,408:CO,409:OO,410:AO,411:EO,412:RO,413:PO,414:IO,415:LO,416:NO,417:FO,418:BO,421:zO,422:UO,423:HO,424:WO,425:$O,426:YO,428:VO,429:qO,431:jO,451:GO,500:KO,501:XO,502:ZO,503:QO,504:JO,505:tA,506:eA,507:nA,508:iA,510:rA,511:sA},OA={100:oA,200:aA,300:lA,400:cA,500:uA},AA={"1XX":dA,"2XX":fA,"3XX":hA,"4XX":pA,"5XX":gA},Fm=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return CA[t]??OA[e]??kA},Du={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Fm(`${t}`),n),{}),____OTHER____:WC,...AA};function Bm(n,t,e){const i=Ag(),r=PA(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?EA(r,t):RA(r,t)}function EA(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function RA(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function PA(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function IA(n,t){const e=zA(t);return"formatToParts"in e?NA(e,n):FA(e,n)}const LA={year:0,month:1,day:2,hour:3,minute:4,second:5};function NA(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=LA[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function FA(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ku={},zm=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")),BA=zm==="06/25/2014, 00:00:00"||zm==="06/25/2014 00:00:00";function zA(n){return ku[n]||(ku[n]=BA?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ku[n]}function Um(n,t,e,i,r,s,a){const c=new Date(0);return c.setUTCFullYear(n,t,e),c.setUTCHours(i,r,s,a),c}const Hm=36e5,UA=6e4,Cu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ou(n,t,e){if(!n)return 0;let i=Cu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Cu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),Wm(r)?-(r*Hm):NaN;if(i=Cu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Wm(r,a)?(s=Math.abs(r)*Hm+a*UA,i[1]==="+"?-s:s):NaN}if($A(n)){t=new Date(t||Date.now());const a=e?t:HA(t),c=Au(a,n);return-(e?c:WA(t,c,n))}return NaN}function HA(n){return Um(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Au(n,t){const e=IA(n,t),i=Um(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function WA(n,t,e){let r=n.getTime()-t;const s=Au(new Date(r),e);if(t===s)return t;r-=s-t;const a=Au(new Date(r),e);return s===a?s:Math.max(s,a)}function Wm(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const $m={};function $A(n){if($m[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),$m[n]=!0,!0}catch{return!1}}const YA=60*1e3,VA={X:function(n,t,e){const i=Eu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ym(i);case"XXXX":case"XX":return qr(i);default:return qr(i,":")}},x:function(n,t,e){const i=Eu(e.timeZone,n);switch(t){case"x":return Ym(i);case"xxxx":case"xx":return qr(i);default:return qr(i,":")}},O:function(n,t,e){const i=Eu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+qA(i,":");default:return"GMT"+qr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Bm("short",n,e);default:return Bm("long",n,e)}}};function Eu(n,t){const e=n?Ou(n,t,!0)/YA:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ya(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function qr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Ya(Math.floor(i/60),2),s=Ya(Math.floor(i%60),2);return e+r+t+s}function Ym(n,t){return n%60===0?(n>0?"-":"+")+Ya(Math.abs(n)/60,2):qr(n,t)}function qA(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Ya(s,2)}function Vm(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const jA=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ru=36e5,qm=6e4,GA=2,Ge={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:jA};function jm(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?GA:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=KA(n),{year:r,restDateString:s}=XA(i.date,e),a=ZA(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const c=a.getTime();let u=0,d;if(i.time&&(u=QA(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Ou(i.timeZone||t.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Vm(new Date(c+u)),d=Vm(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function KA(n){const t={};let e=Ge.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ge.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ge.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function XA(n,t){if(n){const e=Ge.YYY[t],i=Ge.YYYYY[t];let r=Ge.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ge.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function ZA(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Ge.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Xm(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ge.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return eE(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ge.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Xm(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ge.Www.exec(n),s)return r=parseInt(s[1],10)-1,Zm(r)?Gm(t,r):new Date(NaN);if(s=Ge.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Zm(r,a)?Gm(t,r,a):new Date(NaN)}return null}function QA(n){let t,e,i=Ge.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Pu(t)?t%24*Ru:NaN;if(i=Ge.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Pu(t,e)?t%24*Ru+e*qm:NaN;if(i=Ge.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Pu(t,e,r)?t%24*Ru+e*qm+r*1e3:NaN}return null}function Gm(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const JA=[31,28,31,30,31,30,31,31,30,31,30,31],tE=[31,29,31,30,31,30,31,31,30,31,30,31];function Km(n){return n%400===0||n%4===0&&n%100!==0}function Xm(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Km(n);if(i&&e>tE[t]||!i&&e>JA[t])return!1}return!0}function eE(n,t){if(t<1)return!1;const e=Km(n);return!(e&&t>366||!e&&t>365)}function Zm(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Pu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const nE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Iu(n,t,e={}){t=String(t);const i=t.match(nE);if(i){const r=jm(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const c=s.indexOf(a),u=s[c-1]==="'",d=s.replace(a,"'"+VA[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return Aa(n,t,e)}function iE(n,t,e){n=jm(n,e);const i=Ou(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function oo(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Iu(iE(n,t,{timeZone:i.timeZone}),e,i)}const rE=(n,t)=>`${oo(n,t,"yyyy")} W${oo(n,t,"II")}`,Lu="yyyy-MM-dd h:mm:ss a",Nu="h:mm:ss a",hr="yyyy-MM-dd h:mm a",jr="h:mm a",sE="yyyy-MM-dd",Fu="MMM dd, yyyy h:mm:ss a",Ii="MMM dd, yyyy h:mm a",oE={secondly:n=>n?Lu:Nu,tenSecondly:n=>n?Lu:Nu,thirtySecondly:n=>n?Lu:Nu,minutely:n=>n?hr:jr,fiveMinutely:n=>n?hr:jr,tenMinutely:n=>n?hr:jr,thirtyMinutely:n=>n?hr:jr,hourly:n=>n?hr:jr,twoHourly:n=>n?hr:jr,twelveHourly:()=>hr,daily:()=>sE},aE={secondly:()=>Fu,tenSecondly:()=>Fu,thirtySecondly:()=>Fu,minutely:()=>Ii,fiveMinutely:()=>Ii,tenMinutely:()=>Ii,thirtyMinutely:()=>Ii,hourly:()=>Ii,twoHourly:()=>Ii,twelveHourly:()=>Ii,daily:()=>Ii};function Qm({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const c=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return rE(n,c);if(r&&r[t]){const u=r[t](i);return oo(n,c,u)}if(s&&s[t]){const u=s[t]();return oo(n,c,u)}return oo(n,c,a)}const lE=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>Qm({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:oE,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ao=({tickValue:n,granularity:t,timezone:e})=>Qm({tickValue:n,granularity:t,timezone:e,tooltipMap:aE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Jm=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",cE=n=>{const{i18n:t}=Pt.useI18n();return Jm(n)?{type:"canceled",message:t.t("query_errors.canceled.message")}:n?.status===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:n?.status===408||n?.message?.includes("timeout")?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:n?.response?.data?.message==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:n.response?.data?.invalid_parameters?.map(e=>e.reason).join(", ")||n?.message}},lo=n=>n.toLocaleLowerCase().endsWith("count"),uE=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))};function dE(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};hn.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=h.width/2,_=wu(d,g,y),x=d.y,v=d.x<y?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:v}},zc.modes.customInteractionMode=function(u,d){const h=ki(d,u),g=[];return zc.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(y,_,x)=>{u.options.indexAxis==="y"&&y.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&y.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x})}),g};const r=n.numLabels.value>25?Em:Rm,s=({chart:u,index:d})=>{const h=u.data;return{size:r,style:h?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,h)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(h),d&&d.length>$a?d.slice(0,$a)+"...":d):u.getLabelForValue(Number(d)),c=p.computed(()=>({indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="y"?!Tt(n.metricAxesTitle?.value):!Tt(n.dimensionAxesTitle?.value),text:n.indexAxis==="y"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="x"?!Tt(n.metricAxesTitle?.value):!Tt(n.dimensionAxesTitle?.value),text:n.indexAxis==="x"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:u=>{Cm(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.getCurrentInstance()&&p.onUnmounted(()=>{hn.positioners[e]&&delete hn.positioners[e]}),c}en.register(...HS);const fE=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,s)=>r===i[s])};function hE(n,t,e,i,r){const s=p.shallowRef(null),a=(c,u)=>{if(t.value)return new en(t.value,{type:n,data:c,plugins:i,options:u})};return p.onMounted(()=>{s.value=a(e.value,r.value)}),p.onBeforeUnmount(()=>{Tt(s.value)||s.value.destroy()}),p.watch(e,(c,u)=>{if(fE(u,c)&&!Tt(s.value)){for(const[d,h]of c.datasets.entries())Object.assign(s.value.data.datasets[d],h);s.value.data.labels=c.labels,s.value.update()}else Tt(s.value)||s.value.destroy(),s.value=a(c,r.value)}),p.watch(t,()=>{Tt(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),p.watch(r,(c,u)=>{(c.indexAxis!==u.indexAxis||JSON.stringify(c.scales.x.title)!==JSON.stringify(u.scales.x.title)||JSON.stringify(c.scales.y.title)!==JSON.stringify(u.scales.y.title))&&(Tt(s.value)||s.value.destroy(),s.value=a(e.value,c))}),s}const ty=1e3,pE=1e4,ey=1e6,ny=1e9,iy=1e12,co=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},Gr=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function uo(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?pE:ty;return n<r||t.precision&&t.precision>Math.log10(n)?e=co(Gr(n,1,t),t):n<ey?e=`${Gr(n,ty,t)}k`:n<ny?e=`${Gr(n,ey,t)}m`:n<iy?e=`${co(Gr(n,ny,t),t)}b`:e=`${co(Gr(n,iy,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}uo.addCommas=co;function gE(n,t,e){const{i18n:i}=Pt.useI18n(),{formatBytes:r}=fr({i18n:i}),{translateUnit:s}=Pt.useTranslatedUnits();return{legendValues:p.computed(()=>n.value.datasets.reduce((c,u)=>{const d=u.total?u.total:u.data.reduce((g,y)=>g+(typeof y=="number"?Number(y)||0:Number(y&&y.y)||0),0);let h;if(e.value==="bytes")h=r(d);else{const g=s(e.value,d);h=i&&i.t("legend.datapointValueDisplay",{value:uo(d,{capital:!0}),unit:g})||`${uo(d,{capital:!0})} ${e.value}`}return{...c,[u.label]:{raw:d,formatted:h,isThreshold:u.isThreshold}}},{}))}}function mE(n){return p.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${xm(new Date(e))} - ${xm(new Date(i),{includeTZ:!0})}`:""})}function yE(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};hn.positioners[e]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const c=this.chart.canvas.getBoundingClientRect(),u=n.tooltipState.width||this.width,d=c.width/2,h=wu(a,u,d),g=a.y,y=a.x<d?"left":"center";return{x:h-n.tooltipState.offsetX,y:g,xAlign:y}};const r=p.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{Cm(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return p.onUnmounted(()=>{hn.positioners[e]&&delete hn.positioners[e]}),{options:r}}function _E(n){const t=p.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return lE({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!Tt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=p.computed(()=>({title:{display:!Tt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value})),r=`lineChartTooltipPosition-${n.tooltipState.chartID}`,s={enabled:!1,position:r};hn.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=n.tooltipState.height||this.height,_=h.width/2,x=h.height/2,v=wu(d,g,_);let S=UC(d,y,x);const C=d.y<x?"top":"bottom",E=d.x<_?"left":"center";return y>h.height&&(S=0),{x:v,y:S,xAlign:E,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,h=new Date(d.getTime()-u);return sD(u)>24||h.getDate()!==d.getDate()}),c=p.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:n.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{km(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:n.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{hn.positioners[r]&&delete hn.positioners[r]}),{options:c}}function bE(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:c}=n,{i18n:u}=Pt.useI18n();return t?i.map(h=>({label:u&&u.te(`chartLabels.${h}`)&&u.t(`chartLabels.${h}`)||h,backgroundColor:Su(i.indexOf(h),Pi),data:a.map((g,y)=>e?s[`${g.id},${h}`]||0:s[`${y},${h}`]||null)})):Array.from(r).flatMap((h,g)=>{if(!h)return[];const y=Lm(g,h.name,h.id==="empty",c);return{label:u&&u.te(`chartLabels.${h.name}`)&&u.t(`chartLabels.${h.name}`)||h.name,backgroundColor:y,data:a.map(_=>s[`${_.id},${h.id}`]||null),isSegmentEmpty:h.id==="empty"}})}function xE(n,t){const{i18n:e}=Pt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,c=s&&Object.keys(s),u=a&&a.length>1,d=s&&c&&c.length>0,h=d&&c.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const g=d&&c||a,y=g[0],_=g.length>1?g[1]:g[0],x=Object.fromEntries(u?r.flatMap(D=>a.map((O,L)=>{const W=D.event[y],tt=d?`${W},${O}`:`${L},${O}`,G=D.event[O];return[tt,G]})):r.map(D=>{const O=d?`${D.event[y]},${D.event[_]}`:`${y},${_}`,L=D.event[a[0]];return[O,L]})),v=Object.keys(x).reduce((D,O)=>{const[L]=O.split(","),W=x[O];return D[L]?D[L]+=W:D[L]=W,D},{}),S=Object.entries(v).sort(([,D],[,O])=>Number(O)-Number(D)).map(([D])=>D),C=s[y],E=s[_];let U=d&&C&&Object.entries(C).map(([D,O])=>({id:D,name:O.name}))||a.map(D=>({id:D,name:D})),P=d&&E&&Object.entries(E).map(([D,O])=>({id:D,name:O.name}))||a.map(D=>({id:D,name:D}));if(d&&y==="country_code"&&(U=U.map(D=>({...D,name:xu(D.id)||D.name}))),d&&_==="country_code"&&(P=P.map(D=>({...D,name:xu(D.id)||D.name}))),y!=="status_code"&&y!=="status_code_grouped"&&(U.sort((D,O)=>S.indexOf(D.id)-S.indexOf(O.id)),P.sort((D,O)=>S.indexOf(D.id)-S.indexOf(O.id))),!U||!P)return{labels:[],datasets:[]};const I=bE({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:P,pivotRecords:x,rowLabels:U,colorPalette:n.colorPalette||Pi}),B=d?U.map(D=>e&&e.te(`chartLabels.${D.name}`)&&e.t(`chartLabels.${D.name}`)||D.name):a.map(D=>e&&e.te(`chartLabels.${D}`)&&e.t(`chartLabels.${D}`)||D),N=U.map(D=>D.id==="empty");return{labels:B,datasets:I,isLabelEmpty:N,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const wE=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),vE=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Lg(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},SE=(n,t,e,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),c=Math.floor((n-i)/e)*e+i,u=Math.floor((a-i)/e)*e+i+e;return wE(c,u,e)};function TE(n,t){const{i18n:e}=Pt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start:c,end:u}=t.value.meta,d=new Date(c).getTime(),h=new Date(u).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const g=s&&Object.keys(s)||a,y=g&&g[0],_=s[y];let x=s&&_&&Object.keys(_).map(B=>({id:B,name:_[B].name}))||a.map(B=>({id:B,name:B}));y==="country_code"&&(x=x.map(B=>({...B,name:xu(B.id)||B.name})));const v=t.value.meta.granularity_ms;if(typeof v!="number"||isNaN(v)||!isFinite(v)||v===0)return console.error("Invalid step value:",v),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const S=vE(d),C=SE(d,h,v,S,r),E=new Set,U=r?.length?r.reduce((B,N)=>{const T=new Date(N.timestamp).valueOf(),D=N.event;for(const O of a)E.add(O),T in B||(B[T]={}),O in B[T]||(B[T][O]={});for(const O of a)x.forEach(L=>{D[y]===L.id||O===L.id?(B[T][O]||(B[T][O]={}),B[T][O][L.id]=Math.round(Number(D[O])*1e3)/1e3):g.length||(B[T][O]||(B[T][O]={}),B[T][O][L.id]=Math.round(Number(D[L.id])*1e3)/1e3)});return B},{}):{},I=[...a.length===1?a.flatMap(B=>x.map(N=>[B,N.id,N.name,N.id==="empty"])):x.map(B=>[B.name,B.id,B.name,B.id==="empty"])].map(([B,N,T,D],O)=>{const L=C.map(nt=>nt in U&&B in U[nt]?{x:nt,y:U[nt][B][N]||0}:{x:nt,y:0});let{colorPalette:W,fill:tt}=n;Tt(W)&&(W=Pi);const G=Lm(O,T,D,W);return{rawDimension:T,rawMetric:B,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:G,backgroundColor:G,data:L,total:L.reduce((nt,{y:X})=>nt+Number(X),0),...xA,fill:tt,borderWidth:tt?vA:wA,isSegmentEmpty:D}});return y==="status_code"||y==="status_code_grouped"?I.sort((B,N)=>(B.label??"")<(N.label??"")?-1:1):I.sort((B,N)=>Number(B.total)<Number(N.total)?-1:1),{datasets:I}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const ME=(n,t)=>{p.watch([n,t],(e,i,r)=>{const[s,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function DE(){const{i18n:n}=Pt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return lo(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const kE="analytics-query-provider",ry=2;function CE(){const n=p.inject(kE);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function sy(n,t){return p.getCurrentScope()?(p.onScopeDispose(n,t),!0):!1}const oy=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const OE=n=>n!=null,AE=Object.prototype.toString,EE=n=>AE.call(n)==="[object Object]";function Va(n){return Array.isArray(n)?n:[n]}function RE(n){return p.getCurrentInstance()}function PE(n,t={}){if(!p.isRef(n))return p.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=p.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=p.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return e}function IE(n,t=!0,e){RE()?p.onMounted(n,e):t?n():p.nextTick(n)}function LE(n,t,e){return p.watch(n,t,{...e,immediate:!0})}const qa=oy?window:void 0;function Kr(n){var t;const e=p.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function fo(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=p.computed(()=>{const i=Va(p.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return LE(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>Kr(s)))!==null&&i!==void 0?i:[qa].filter(s=>s!=null),Va(p.toValue(e.value?n[1]:n[0])),Va(p.unref(e.value?n[2]:n[1])),p.toValue(e.value?n[3]:n[2])]},([i,r,s,a],c,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=EE(a)?{...a}:a,h=i.flatMap(g=>r.flatMap(y=>s.map(_=>t(g,y,_,d))));u(()=>{h.forEach(g=>g())})},{flush:"post"})}function NE(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function ay(n){const t=NE();return p.computed(()=>(t.value,!!n()))}function FE(n,t,e={}){const{window:i=qa,...r}=e;let s;const a=ay(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const g=Va(p.toValue(n)).map(Kr).filter(OE);return new Set(g)}),g=>{c(),a.value&&g.size&&(s=new MutationObserver(t),g.forEach(y=>s.observe(y,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),h=()=>{u(),c()};return sy(h),{isSupported:a,stop:h,takeRecords:d}}const ja={speed:2,margin:30,direction:"both"};function BE(n){n.scrollLeft>n.scrollWidth-n.clientWidth&&(n.scrollLeft=Math.max(0,n.scrollWidth-n.clientWidth)),n.scrollTop>n.scrollHeight-n.clientHeight&&(n.scrollTop=Math.max(0,n.scrollHeight-n.clientHeight))}function zE(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:c,stopPropagation:u,exact:d,onMove:h,onEnd:g,onStart:y,initialValue:_,axis:x="both",draggingElement:v=qa,containerElement:S,handle:C=n,buttons:E=[0],restrictInView:U,autoScroll:P=!1}=t,I=p.ref((e=p.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),B=p.ref(),N=H=>a?a.includes(H.pointerType):!0,T=H=>{p.toValue(c)&&H.preventDefault(),p.toValue(u)&&H.stopPropagation()},D=p.toValue(P),O=typeof D=="object"?{speed:(i=p.toValue(D.speed))!==null&&i!==void 0?i:ja.speed,margin:(r=p.toValue(D.margin))!==null&&r!==void 0?r:ja.margin,direction:(s=D.direction)!==null&&s!==void 0?s:ja.direction}:ja,L=H=>typeof H=="number"?[H,H]:[H.x,H.y],W=(H,V,J)=>{const{clientWidth:_t,clientHeight:pt,scrollLeft:it,scrollTop:ft,scrollWidth:ut,scrollHeight:dt}=H,[gt,lt]=L(O.margin),[It,Bt]=L(O.speed);let wt=0,kt=0;(O.direction==="x"||O.direction==="both")&&(J.x<gt&&it>0?wt=-It:J.x+V.width>_t-gt&&it<ut-_t&&(wt=It)),(O.direction==="y"||O.direction==="both")&&(J.y<lt&&ft>0?kt=-Bt:J.y+V.height>pt-lt&&ft<dt-pt&&(kt=Bt)),(wt||kt)&&H.scrollBy({left:wt,top:kt,behavior:"auto"})};let tt=null;const G=()=>{const H=p.toValue(S);H&&!tt&&(tt=setInterval(()=>{const V=p.toValue(n).getBoundingClientRect(),{x:J,y:_t}=I.value,pt={x:J-H.scrollLeft,y:_t-H.scrollTop};pt.x>=0&&pt.y>=0&&(W(H,V,pt),pt.x+=H.scrollLeft,pt.y+=H.scrollTop,I.value=pt)},1e3/60))},nt=()=>{tt&&(clearInterval(tt),tt=null)},X=(H,V,J,_t)=>{const[pt,it]=typeof J=="number"?[J,J]:[J.x,J.y],{clientWidth:ft,clientHeight:ut}=V;return H.x<pt||H.x+_t.width>ft-pt||H.y<it||H.y+_t.height>ut-it},Q=()=>{if(p.toValue(t.disabled)||!B.value)return;const H=p.toValue(S);if(!H)return;const V=p.toValue(n).getBoundingClientRect(),{x:J,y:_t}=I.value;X({x:J-H.scrollLeft,y:_t-H.scrollTop},H,O.margin,V)?G():nt()};p.toValue(P)&&p.watch(I,Q);const rt=H=>{var V;if(!p.toValue(E).includes(H.button)||p.toValue(t.disabled)||!N(H)||p.toValue(d)&&H.target!==p.toValue(n))return;const J=p.toValue(S),_t=J==null||(V=J.getBoundingClientRect)===null||V===void 0?void 0:V.call(J),pt=p.toValue(n).getBoundingClientRect(),it={x:H.clientX-(J?pt.left-_t.left+(P?0:J.scrollLeft):pt.left),y:H.clientY-(J?pt.top-_t.top+(P?0:J.scrollTop):pt.top)};y?.(it,H)!==!1&&(B.value=it,T(H))},st=H=>{if(p.toValue(t.disabled)||!N(H)||!B.value)return;const V=p.toValue(S);V instanceof HTMLElement&&BE(V);const J=p.toValue(n).getBoundingClientRect();let{x:_t,y:pt}=I.value;if((x==="x"||x==="both")&&(_t=H.clientX-B.value.x,V&&(_t=Math.min(Math.max(0,_t),V.scrollWidth-J.width))),(x==="y"||x==="both")&&(pt=H.clientY-B.value.y,V&&(pt=Math.min(Math.max(0,pt),V.scrollHeight-J.height))),p.toValue(P)&&V&&(tt===null&&W(V,J,{x:_t,y:pt}),_t+=V.scrollLeft,pt+=V.scrollTop),V&&(U||P)){if(x!=="y"){const it=_t-V.scrollLeft;it<0?_t=V.scrollLeft:it>V.clientWidth-J.width&&(_t=V.clientWidth-J.width+V.scrollLeft)}if(x!=="x"){const it=pt-V.scrollTop;it<0?pt=V.scrollTop:it>V.clientHeight-J.height&&(pt=V.clientHeight-J.height+V.scrollTop)}}I.value={x:_t,y:pt},h?.(I.value,H),T(H)},ot=H=>{p.toValue(t.disabled)||!N(H)||B.value&&(B.value=void 0,P&&nt(),g?.(I.value,H),T(H))};if(oy){const H=()=>{var V;return{capture:(V=t.capture)!==null&&V!==void 0?V:!0,passive:!p.toValue(c)}};fo(C,"pointerdown",rt,H),fo(v,"pointermove",st,H),fo(v,"pointerup",ot,H)}return{...PE(I),position:I,isDragging:p.computed(()=>!!B.value),style:p.computed(()=>`
|
|
4
4
|
left: ${I.value.x}px;
|
|
5
5
|
top: ${I.value.y}px;
|
|
6
6
|
${P?"text-wrap: nowrap;":""}
|