@kong-ui-public/analytics-chart 9.3.1 → 9.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/types/components/AnalyticsChart.vue.d.ts.map +1 -1
- package/dist/vitals-chart.es.js +2205 -2197
- package/dist/vitals-chart.umd.js +15 -15
- package/package.json +3 -3
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
(function(nt,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","@kong/kongponents"],h):(nt=typeof globalThis<"u"?globalThis:nt||self,h(nt["kong-ui-publicvitals-chart"]={},nt.Vue,nt["kong-ui-public-i18n"],nt.KongIcons,nt.Kongponents))})(this,function(nt,h,Bn,
|
|
1
|
+
(function(nt,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","@kong/kongponents"],h):(nt=typeof globalThis<"u"?globalThis:nt||self,h(nt["kong-ui-publicvitals-chart"]={},nt.Vue,nt["kong-ui-public-i18n"],nt.KongIcons,nt.Kongponents))})(this,function(nt,h,Bn,nc,ic){"use strict";var cT=Object.defineProperty;var uT=(nt,h,Bn)=>h in nt?cT(nt,h,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):nt[h]=Bn;var P=(nt,h,Bn)=>uT(nt,typeof h!="symbol"?h+"":h,Bn);var An,dg;const fg={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Not all data is shown in the below report. Reports are currently limited to a maximum of {maxReturned} entities.",entityNoName:"no-name",debug:"debug",total:"Total",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}"},csvExport:{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.",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_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)",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",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",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:"Alert threshold",api:"API"},metricAxisTitles:{request_count:"Request count",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_p99:"Response latency (p99) in {unit}",response_latency_p95:"Response latency (p95) in {unit}",response_latency_p50:"Response latency (p50) in {unit}",upstream_latency_p99:"Upstream latency (p99) in {unit}",upstream_latency_p95:"Upstream latency (p95) in {unit}",upstream_latency_p50:"Upstream latency (p50) in {unit}",kong_latency_p99:"Kong latency (p99) in {unit}",kong_latency_p95:"Kong latency (p95) in {unit}",kong_latency_p50:"Kong latency (p50) in {unit}",response_size_p99:"Response size (p99) in {unit}",response_size_p95:"Response size (p95) in {unit}",response_size_p50:"Response size (p50) in {unit}",request_size_p99:"Request size (p99) in {unit}",request_size_p95:"Request size (p95) in {unit}",request_size_p50:"Request size (p50) in {unit}",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency (p99) in {unit}",RESPONSE_LATENCY_P95:"Response latency (p95) in {unit}",RESPONSE_LATENCY_P50:"Response latency (p50) in {unit}",RESPONSE_SIZE_P99:"Response size (p99) in {unit}",RESPONSE_SIZE_P95:"Response size (p95) in {unit}",RESPONSE_SIZE_P50:"Response size (p50) in {unit}",REQUEST_SIZE_P99:"Request size (p99) in {unit}",REQUEST_SIZE_P95:"Request size (p95) in {unit}",REQUEST_SIZE_P50:"Request size (p50) in {unit}",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99) in {unit}",LatencyP95:"Response latency (p95) in {unit}",LatencyP50:"Response latency (p50) in {unit}",LatencyAverage:"Response latency (avg) in {unit}",UpstreamLatencyP99:"Upstream latency (p99) in {unit}",UpstreamLatencyP95:"Upstream latency (p95) in {unit}",UpstreamLatencyP50:"Upstream latency (p50) in {unit}",UpstreamLatencyAverage:"Upstream latency (avg) in {unit}",KongLatencyP99:"Kong latency (p99) in {unit}",KongLatencyP95:"Kong latency (p95) in {unit}",KongLatencyP50:"Kong latency (p50) in {unit}",KongLatencyAverage:"Kong latency (avg) in {unit}",ResponseSizeP99:"Response size (p99) in {unit}",ResponseSizeP95:"Response size (p95) in {unit}",ResponseSizeP50:"Response size (p50) in {unit}",RequestSizeP99:"Request size (p99) in {unit}",RequestSizeP95:"Request size (p95) in {unit}",RequestSizeP50:"Request size (p50) in {unit}",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)",api:"API"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",daily:"@timestamp per day",weekly:"@timestamp per week"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}},singleValue:{valueError:"Invalid configuration"},new_timerange_label:"New time range",zoom_action_items:{zoom:"Zoom",view_requests:"View requests",cancel:"Cancel"}};function gg(){const n=Bn.createI18n("en-us",fg);return{i18n:n,i18nT:Bn.i18nTComponent(n)}}/*!
|
|
2
2
|
* @kurkle/color v0.3.2
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2023 Jukka Kurkela
|
|
5
5
|
* Released under the MIT License
|
|
6
|
-
*/function Wi(n){return n+.5|0}const yn=(n,t,e)=>Math.max(Math.min(n,e),t);function Yi(n){return yn(Wi(n*2.55),0,255)}function bn(n){return yn(Wi(n*255),0,255)}function Ze(n){return yn(Wi(n/2.55)/100,0,1)}function
|
|
6
|
+
*/function Wi(n){return n+.5|0}const yn=(n,t,e)=>Math.max(Math.min(n,e),t);function Yi(n){return yn(Wi(n*2.55),0,255)}function bn(n){return yn(Wi(n*255),0,255)}function Ze(n){return yn(Wi(n/2.55)/100,0,1)}function sc(n){return yn(Wi(n*100),0,100)}const Ce={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},yo=[..."0123456789ABCDEF"],pg=n=>yo[n&15],mg=n=>yo[(n&240)>>4]+yo[n&15],Us=n=>(n&240)>>4===(n&15),yg=n=>Us(n.r)&&Us(n.g)&&Us(n.b)&&Us(n.a);function bg(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Ce[n[1]]*17,g:255&Ce[n[2]]*17,b:255&Ce[n[3]]*17,a:t===5?Ce[n[4]]*17:255}:(t===7||t===9)&&(e={r:Ce[n[1]]<<4|Ce[n[2]],g:Ce[n[3]]<<4|Ce[n[4]],b:Ce[n[5]]<<4|Ce[n[6]],a:t===9?Ce[n[7]]<<4|Ce[n[8]]:255})),e}const _g=(n,t)=>n<255?t(n):"";function xg(n){var t=yg(n)?pg:mg;return n?"#"+t(n.r)+t(n.g)+t(n.b)+_g(n.a,t):void 0}const wg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rc(n,t,e){const i=t*Math.min(e,1-e),s=(r,o=(r+n/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function vg(n,t,e){const i=(s,r=(s+n/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Mg(n,t,e){const i=rc(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function kg(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function bo(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),o=Math.min(e,i,s),a=(r+o)/2;let l,c,u;return r!==o&&(u=r-o,c=a>.5?u/(2-r-o):u/(r+o),l=kg(e,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function _o(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(bn)}function xo(n,t,e){return _o(rc,n,t,e)}function Dg(n,t,e){return _o(Mg,n,t,e)}function Sg(n,t,e){return _o(vg,n,t,e)}function oc(n){return(n%360+360)%360}function Tg(n){const t=wg.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Yi(+t[5]):bn(+t[5]));const s=oc(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Dg(s,r,o):t[1]==="hsv"?i=Sg(s,r,o):i=xo(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Cg(n,t){var e=bo(n);e[0]=oc(e[0]+t),e=xo(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Pg(n){if(!n)return;const t=bo(n),e=t[0],i=sc(t[1]),s=sc(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ze(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const ac={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},lc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Og(){const n={},t=Object.keys(lc),e=Object.keys(ac);let i,s,r,o,a;for(i=0;i<t.length;i++){for(o=a=t[i],s=0;s<e.length;s++)r=e[s],a=a.replace(r,ac[r]);r=parseInt(lc[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}let Xs;function Eg(n){Xs||(Xs=Og(),Xs.transparent=[0,0,0,0]);const t=Xs[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Ag=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Rg(n){const t=Ag.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];e=t[8]?Yi(o):yn(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Yi(i):yn(i,0,255)),s=255&(t[4]?Yi(s):yn(s,0,255)),r=255&(t[6]?Yi(r):yn(r,0,255)),{r:i,g:s,b:r,a:e}}}function Ig(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ze(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const wo=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,di=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Lg(n,t,e){const i=di(Ze(n.r)),s=di(Ze(n.g)),r=di(Ze(n.b));return{r:bn(wo(i+e*(di(Ze(t.r))-i))),g:bn(wo(s+e*(di(Ze(t.g))-s))),b:bn(wo(r+e*(di(Ze(t.b))-r))),a:n.a+e*(t.a-n.a)}}function qs(n,t,e){if(n){let i=bo(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=xo(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function cc(n,t){return n&&Object.assign(t||{},n)}function uc(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=bn(n[3]))):(t=cc(n,{r:0,g:0,b:0,a:1}),t.a=bn(t.a)),t}function Ng(n){return n.charAt(0)==="r"?Rg(n):Tg(n)}class ji{constructor(t){if(t instanceof ji)return t;const e=typeof t;let i;e==="object"?i=uc(t):e==="string"&&(i=bg(t)||Eg(t)||Ng(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=cc(this._rgb);return t&&(t.a=Ze(t.a)),t}set rgb(t){this._rgb=uc(t)}rgbString(){return this._valid?Ig(this._rgb):void 0}hexString(){return this._valid?xg(this._rgb):void 0}hslString(){return this._valid?Pg(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Lg(this._rgb,t._rgb,e)),this}clone(){return new ji(this.rgb)}alpha(t){return this._rgb.a=bn(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Wi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return qs(this._rgb,2,t),this}darken(t){return qs(this._rgb,2,-t),this}saturate(t){return qs(this._rgb,1,t),this}desaturate(t){return qs(this._rgb,1,-t),this}rotate(t){return Cg(this._rgb,t),this}}/*!
|
|
7
7
|
* Chart.js v4.4.5
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2024 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function Qe(){}const Fg=(()=>{let n=0;return()=>n++})();function rt(n){return n===null||typeof n>"u"}function Mt(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 ct(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Me(n,t){return Rt(n)?n:t}function it(n,t){return typeof n>"u"?t:n}const zg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,uc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function kt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Dt(n,t,e,i){let s,r,o;if(Mt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ct(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function Gs(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function Ks(n){if(Mt(n))return n.map(Ks);if(ct(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Ks(n[e[s]]);return t}return n}function dc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Bg(n,t,e,i){if(!dc(n))return;const s=t[n],r=e[n];ct(s)&&ct(r)?Vi(s,r,i):t[n]=Ks(r)}function Vi(n,t,e){const i=Mt(t)?t:[t],s=i.length;if(!ct(n))return n;e=e||{};const r=e.merger||Bg;let o;for(let a=0;a<s;++a){if(o=i[a],!ct(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],n,o,e)}return n}function $i(n,t){return Vi(n,t,{merger:Hg})}function Hg(n,t,e){if(!dc(n))return;const i=t[n],s=e[n];ct(i)&&ct(s)?$i(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Ks(s))}const hc={"":n=>n,x:n=>n.x,y:n=>n.y};function Wg(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Yg(n){const t=Wg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function _n(n,t){return(hc[t]||(hc[t]=Yg(t)))(n)}function vo(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ge=n=>typeof n<"u",pe=n=>typeof n=="function",fc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function jg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const pt=Math.PI,Ct=2*pt,Vg=Ct+pt,Zs=Number.POSITIVE_INFINITY,Mo=pt/180,Ot=pt/2,Pe=pt/4,Qs=pt*2/3,xn=Math.log10,Ye=Math.sign;function Ui(n,t,e){return Math.abs(n-t)<e}function gc(n){const t=Math.round(n);n=Ui(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function $g(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function wn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Ug(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function pc(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Ut(n){return n*(pt/180)}function Js(n){return n*(180/pt)}function mc(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function tr(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*pt&&(r+=Ct),{angle:r,distance:s}}function hi(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Xg(n,t){return(n-t+Vg)%Ct-pt}function ke(n){return(n%Ct+Ct)%Ct}function Xi(n,t,e,i){const s=ke(n),r=ke(t),o=ke(e),a=ke(r-s),l=ke(o-s),c=ke(s-r),u=ke(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Zt(n,t,e){return Math.max(t,Math.min(e,n))}function qg(n){return Zt(n,-32768,32767)}function Je(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function ko(n,t,e){e=e||(o=>n[o]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const tn=(n,t,e,i)=>ko(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),Gg=(n,t,e)=>ko(n,e,i=>n[i][t]>=e);function Kg(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const yc=["push","pop","shift","splice","unshift"];function Zg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),yc.forEach(e=>{const i="_onData"+vo(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function bc(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(yc.forEach(r=>{delete n[r]}),delete n._chartjs)}function _c(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const xc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function wc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,xc.call(window,()=>{i=!1,n.apply(t,e)}))}}function Qg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Do=n=>n==="start"?"left":n==="end"?"right":"center",ie=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Jg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function vc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,_parsed:a}=n,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:f}=o.getUserBounds();d&&(s=Zt(Math.min(tn(a,l,c).lo,e?i:tn(t,l,o.getPixelForValue(c)).lo),0,i-1)),f?r=Zt(Math.max(tn(a,o.axis,u,!0).hi+1,e?0:tn(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function Mc(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const er=n=>n===0||n===1,kc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ct/e)),Dc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ct/e)+1,qi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Ot)+1,easeOutSine:n=>Math.sin(n*Ot),easeInOutSine:n=>-.5*(Math.cos(pt*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=>er(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=>er(n)?n:kc(n,.075,.3),easeOutElastic:n=>er(n)?n:Dc(n,.075,.3),easeInOutElastic(n){return er(n)?n:n<.5?.5*kc(n*2,.1125,.45):.5+.5*Dc(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-qi.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?qi.easeInBounce(n*2)*.5:qi.easeOutBounce(n*2-1)*.5+.5};function So(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Sc(n){return So(n)?n:new ji(n)}function To(n){return So(n)?n:new ji(n).saturate(.5).darken(.1).hexString()}const tp=["x","y","borderWidth","radius","tension"],ep=["color","borderColor","backgroundColor"];function np(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:ep},numbers:{type:"number",properties:tp}}),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 ip(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Tc=new Map;function sp(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Tc.get(e);return i||(i=new Intl.NumberFormat(n,t),Tc.set(e,i)),i}function Gi(n,t,e){return sp(t,e).format(n)}const Cc={values(n){return Mt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=rp(n,e)}const o=xn(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Gi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Cc.numeric.call(this,n,t,e):""}};function rp(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 nr={formatters:Cc};function op(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:nr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Hn=Object.create(null),Co=Object.create(null);function Ki(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Po(n,t,e){return typeof t=="string"?Vi(Ki(n,t),e):Vi(Ki(n,""),t)}class ap{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>To(s.backgroundColor),this.hoverBorderColor=(i,s)=>To(s.borderColor),this.hoverColor=(i,s)=>To(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Po(this,t,e)}get(t){return Ki(this,t)}describe(t,e){return Po(Co,t,e)}override(t,e){return Po(Hn,t,e)}route(t,e,i,s){const r=Ki(this,t),o=Ki(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return ct(l)?Object.assign({},c,l):it(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var Et=new ap({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[np,ip,op]);function lp(n){return!n||rt(n.size)||rt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ir(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function cp(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0;const a=e.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!Mt(d))o=ir(n,s,r,o,d);else if(Mt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!Mt(f)&&(o=ir(n,s,r,o,f));n.restore();const g=r.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[r[l]];r.splice(0,g)}return o}function Wn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Pc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Oo(n,t,e,i){Oc(n,t,e,i,null)}function Oc(n,t,e,i,s){let r,o,a,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,y=t.radius;let x=(p||0)*Mo;if(g&&typeof g=="object"&&(r=g.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(y)||y<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,y,0,0,Ct):n.arc(e,i,y,0,Ct),n.closePath();break;case"triangle":u=s?s/2:y,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=Qs,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=Qs,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,o=Math.cos(x+Pe)*l,d=Math.cos(x+Pe)*(s?s/2-c:l),a=Math.sin(x+Pe)*l,f=Math.sin(x+Pe)*(s?s/2-c:l),n.arc(e-d,i-a,c,x-pt,x-Ot),n.arc(e+f,i-o,c,x-Ot,x),n.arc(e+d,i+a,c,x,x+Ot),n.arc(e-f,i+o,c,x+Ot,x+pt),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=Pe;case"rectRot":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+f,i-o),n.lineTo(e+d,i+a),n.lineTo(e-f,i+o),n.closePath();break;case"crossRot":x+=Pe;case"cross":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"star":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o),x+=Pe,d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"line":o=s?s/2:Math.cos(x)*y,a=Math.sin(x)*y,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:y),i+Math.sin(x)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function en(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Zi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Qi(n){n.restore()}function up(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function dp(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 hp(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),rt(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 fp(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function gp(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Yn(n,t,e,i,s,r={}){const o=Mt(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,hp(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&gp(n,r.backdrop),a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),rt(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),fp(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function fi(n,t){const{x:e,y:i,w:s,h:r,radius:o}=t;n.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*pt,pt,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,pt,Ot,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Ot,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Ot,!0),n.lineTo(e+o.topLeft,i)}const pp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yp(n,t){const e=(""+n).match(pp);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 bp=n=>+n||0;function Eo(n,t){const e={},i=ct(t),s=i?Object.keys(t):t,r=ct(n)?i?o=>it(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=bp(r(o));return e}function Ec(n){return Eo(n,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(n){return Eo(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Xt(n){const t=Ec(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(n,t){n=n||{},t=t||Et.font;let e=it(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=it(n.style,t.style);i&&!(""+i).match(mp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:it(n.family,t.family),lineHeight:yp(it(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:it(n.weight,t.weight),string:""};return s.string=lp(s),s}function Ji(n,t,e,i){let s,r,o;for(s=0,r=n.length;s<r;++s)if(o=n[s],o!==void 0&&o!==void 0)return o}function _p(n,t,e){const{min:i,max:s}=n,r=uc(t,(s-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Mn(n,t){return Object.assign(Object.create(n),t)}function Ao(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Nc("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Ao([a,...n],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return Rc(a,l,()=>Tp(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return Fc(a).includes(l)},ownKeys(a){return Fc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function gi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ac(n,i),setContext:r=>gi(n,r,e,i),override:r=>gi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return Rc(r,o,()=>wp(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function Ac(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:pe(e)?e:()=>e,isIndexable:pe(i)?i:()=>i}}const xp=(n,t)=>n?n+vo(t):t,Ro=(n,t)=>ct(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Rc(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function wp(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return pe(a)&&o.isScriptable(t)&&(a=vp(t,a,n,e)),Mt(a)&&a.length&&(a=Mp(t,a,n,o.isIndexable)),Ro(t,a)&&(a=gi(a,s,r&&r[t],o)),a}function vp(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(r,o||i);return a.delete(n),Ro(n,l)&&(l=Io(s._scopes,s,n,l)),l}function Mp(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(ct(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Io(c,s,n,u);t.push(gi(d,r,o&&o[n],a))}}return t}function Ic(n,t,e){return pe(n)?n(t,e):n}const kp=(n,t)=>n===!0?t:typeof n=="string"?_n(t,n):void 0;function Dp(n,t,e,i,s){for(const r of t){const o=kp(e,r);if(o){n.add(o);const a=Ic(o._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function Io(n,t,e,i){const s=t._rootScopes,r=Ic(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Lc(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Lc(a,o,r,l,i),l===null)?!1:Ao(Array.from(a),[""],s,r,()=>Sp(t,e,i))}function Lc(n,t,e,i,s){for(;e;)e=Dp(n,t,e,i,s);return e}function Sp(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return Mt(s)&&ct(e)?e:s||{}}function Tp(n,t,e,i){let s;for(const r of t)if(s=Nc(xp(r,n),e),typeof s<"u")return Ro(n,s)?Io(e,i,n,s):s}function Nc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Fc(n){let t=n._keys;return t||(t=n._keys=Cp(n._scopes)),t}function Cp(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function zc(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],o[a]={r:s.parse(_n(u,r),c)};return o}const Pp=Number.EPSILON||1e-14,pi=(n,t)=>t<n.length&&!n[t].skip&&n[t],Bc=n=>n==="x"?"y":"x";function Op(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=hi(r,s),l=hi(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,f=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+f*(o.x-s.x),y:r.y+f*(o.y-s.y)}}}function Ep(n,t,e){const i=n.length;let s,r,o,a,l,c=pi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=pi(n,u+1),!(!l||!c)){if(Ui(t[u],0,Pp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[u]=s*o*t[u],e[u+1]=r*o*t[u])}}function Ap(n,t,e="x"){const i=Bc(e),s=n.length;let r,o,a,l=pi(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=pi(n,c+1),!a)continue;const u=a[e],d=a[i];o&&(r=(u-o[e])/3,a[`cp1${e}`]=u-r,a[`cp1${i}`]=d-r*t[c]),l&&(r=(l[e]-u)/3,a[`cp2${e}`]=u+r,a[`cp2${i}`]=d+r*t[c])}}function Rp(n,t="x"){const e=Bc(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=pi(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=pi(n,o+1),!!l){if(c){const u=c[t]-l[t];s[o]=u!==0?(c[e]-l[e])/u:0}r[o]=a?c?Ye(s[o-1])!==Ye(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Ep(n,s,r),Ap(n,r,t)}function sr(n,t,e){return Math.max(Math.min(n,e),t)}function Ip(n,t){let e,i,s,r,o,a=en(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&en(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=sr(s.cp1x,t.left,t.right),s.cp1y=sr(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=sr(s.cp2x,t.left,t.right),s.cp2y=sr(s.cp2y,t.top,t.bottom)))}function Lp(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Rp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],l=Op(c,a,n[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Ip(n,e)}function Lo(){return typeof window<"u"&&typeof document<"u"}function No(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function rr(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 or=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Np(n,t){return or(n).getPropertyValue(t)}const Fp=["top","right","bottom","left"];function jn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=Fp[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Bp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(zp(s,r,n.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function kn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=or(e),r=s.boxSizing==="border-box",o=jn(s,"padding"),a=jn(s,"border","width"),{x:l,y:c,box:u}=Bp(n,e),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:g,height:p}=t;return r&&(g-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Hp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&No(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=or(r),l=jn(a,"border","width"),c=jn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=rr(a.maxWidth,r,"clientWidth"),s=rr(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Zs,maxHeight:s||Zs}}const ar=n=>Math.round(n*10)/10;function Wp(n,t,e,i){const s=or(n),r=jn(s,"margin"),o=rr(s.maxWidth,n,"clientWidth")||Zs,a=rr(s.maxHeight,n,"clientHeight")||Zs,l=Hp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=jn(s,"border","width"),g=jn(s,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=ar(Math.min(c,o,l.maxWidth)),u=ar(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ar(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ar(Math.floor(u*i))),{width:c,height:u}}function Hc(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Yp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Lo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function Wc(n,t){const e=Np(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Vn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function jp(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 Vp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=Vn(n,s,e),a=Vn(s,r,e),l=Vn(r,t,e),c=Vn(o,a,e),u=Vn(a,l,e);return Vn(c,u,e)}const $p=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}}},Up=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function mi(n,t,e){return n?$p(t,e):Up()}function Yc(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 jc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Vc(n){return n==="angle"?{between:Xi,compare:Xg,normalize:ke}:{between:Je,compare:(t,e)=>t-e,normalize:t=>t}}function $c({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Xp(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=Vc(i),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&o(a(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Uc(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=Vc(i),{start:u,end:d,loop:f,style:g}=Xp(n,t,e),p=[];let y=!1,x=null,M,v,D;const S=()=>l(s,D,M)&&a(s,D)!==0,T=()=>a(r,M)===0||l(r,D,M),R=()=>y||S(),E=()=>!y||T();for(let _=u,b=u;_<=d;++_)v=t[_%o],!v.skip&&(M=c(v[i]),M!==D&&(y=l(M,s,r),x===null&&R()&&(x=a(M,s)===0?_:b),x!==null&&E()&&(p.push($c({start:x,end:_,loop:f,count:o,style:g})),x=null),b=_,D=M));return x!==null&&p.push($c({start:x,end:d,loop:f,count:o,style:g})),p}function Xc(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=Uc(i[s],n.points,t);r.length&&e.push(...r)}return e}function qp(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Gp(n,t,e,i){const s=n.length,r=[];let o=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function Kp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=qp(e,s,r,i);if(i===!0)return qc(n,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!n._fullLoop&&o===0&&a===s-1;return qc(n,Gp(e,o,l,c),e,t)}function qc(n,t,e,i){return!i||!i.setContext||!e?t:Zp(n,t,e,i)}function Zp(n,t,e,i){const s=n._chart.getContext(),r=Gc(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,f=d;function g(p,y,x,M){const v=a?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=v;for(;e[y%l].skip;)y+=v;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:x,style:M}),u=M,d=y%l)}}for(const p of t){d=a?d:p.start;let y=e[d%l],x;for(f=d+1;f<=p.end;f++){const M=e[f%l];x=Gc(i.setContext(Mn(s,{type:"segment",p0:y,p1:M,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),Qp(x,u)&&g(d,f-1,p.loop,u),y=M,u=x}d<f-1&&g(d,f-1,p.loop,u)}return c}function Gc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Qp(n,t){if(!t)return!1;const e=[],i=function(s,r){return So(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
|
|
11
|
+
*/function Qe(){}const Fg=(()=>{let n=0;return()=>n++})();function ot(n){return n===null||typeof n>"u"}function Mt(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 ut(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Me(n,t){return Rt(n)?n:t}function it(n,t){return typeof n>"u"?t:n}const zg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,dc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function kt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Dt(n,t,e,i){let s,r,o;if(Mt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ut(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function Gs(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function Ks(n){if(Mt(n))return n.map(Ks);if(ut(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Ks(n[e[s]]);return t}return n}function hc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Bg(n,t,e,i){if(!hc(n))return;const s=t[n],r=e[n];ut(s)&&ut(r)?Vi(s,r,i):t[n]=Ks(r)}function Vi(n,t,e){const i=Mt(t)?t:[t],s=i.length;if(!ut(n))return n;e=e||{};const r=e.merger||Bg;let o;for(let a=0;a<s;++a){if(o=i[a],!ut(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],n,o,e)}return n}function $i(n,t){return Vi(n,t,{merger:Hg})}function Hg(n,t,e){if(!hc(n))return;const i=t[n],s=e[n];ut(i)&&ut(s)?$i(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Ks(s))}const fc={"":n=>n,x:n=>n.x,y:n=>n.y};function Wg(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Yg(n){const t=Wg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function _n(n,t){return(fc[t]||(fc[t]=Yg(t)))(n)}function vo(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ge=n=>typeof n<"u",pe=n=>typeof n=="function",gc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function jg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const pt=Math.PI,Ct=2*pt,Vg=Ct+pt,Zs=Number.POSITIVE_INFINITY,Mo=pt/180,Ot=pt/2,Pe=pt/4,Qs=pt*2/3,xn=Math.log10,Ye=Math.sign;function Ui(n,t,e){return Math.abs(n-t)<e}function pc(n){const t=Math.round(n);n=Ui(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function $g(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function wn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Ug(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function mc(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Ut(n){return n*(pt/180)}function Js(n){return n*(180/pt)}function yc(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function tr(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*pt&&(r+=Ct),{angle:r,distance:s}}function hi(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Xg(n,t){return(n-t+Vg)%Ct-pt}function ke(n){return(n%Ct+Ct)%Ct}function Xi(n,t,e,i){const s=ke(n),r=ke(t),o=ke(e),a=ke(r-s),l=ke(o-s),c=ke(s-r),u=ke(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Zt(n,t,e){return Math.max(t,Math.min(e,n))}function qg(n){return Zt(n,-32768,32767)}function Je(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function ko(n,t,e){e=e||(o=>n[o]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const tn=(n,t,e,i)=>ko(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),Gg=(n,t,e)=>ko(n,e,i=>n[i][t]>=e);function Kg(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const bc=["push","pop","shift","splice","unshift"];function Zg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),bc.forEach(e=>{const i="_onData"+vo(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function _c(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(bc.forEach(r=>{delete n[r]}),delete n._chartjs)}function xc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const wc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function vc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,wc.call(window,()=>{i=!1,n.apply(t,e)}))}}function Qg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Do=n=>n==="start"?"left":n==="end"?"right":"center",ie=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Jg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Mc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,_parsed:a}=n,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:f}=o.getUserBounds();d&&(s=Zt(Math.min(tn(a,l,c).lo,e?i:tn(t,l,o.getPixelForValue(c)).lo),0,i-1)),f?r=Zt(Math.max(tn(a,o.axis,u,!0).hi+1,e?0:tn(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function kc(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const er=n=>n===0||n===1,Dc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ct/e)),Sc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ct/e)+1,qi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Ot)+1,easeOutSine:n=>Math.sin(n*Ot),easeInOutSine:n=>-.5*(Math.cos(pt*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=>er(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=>er(n)?n:Dc(n,.075,.3),easeOutElastic:n=>er(n)?n:Sc(n,.075,.3),easeInOutElastic(n){return er(n)?n:n<.5?.5*Dc(n*2,.1125,.45):.5+.5*Sc(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-qi.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?qi.easeInBounce(n*2)*.5:qi.easeOutBounce(n*2-1)*.5+.5};function So(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Tc(n){return So(n)?n:new ji(n)}function To(n){return So(n)?n:new ji(n).saturate(.5).darken(.1).hexString()}const tp=["x","y","borderWidth","radius","tension"],ep=["color","borderColor","backgroundColor"];function np(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:ep},numbers:{type:"number",properties:tp}}),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 ip(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Cc=new Map;function sp(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Cc.get(e);return i||(i=new Intl.NumberFormat(n,t),Cc.set(e,i)),i}function Gi(n,t,e){return sp(t,e).format(n)}const Pc={values(n){return Mt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=rp(n,e)}const o=xn(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Gi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Pc.numeric.call(this,n,t,e):""}};function rp(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 nr={formatters:Pc};function op(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:nr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Hn=Object.create(null),Co=Object.create(null);function Ki(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Po(n,t,e){return typeof t=="string"?Vi(Ki(n,t),e):Vi(Ki(n,""),t)}class ap{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>To(s.backgroundColor),this.hoverBorderColor=(i,s)=>To(s.borderColor),this.hoverColor=(i,s)=>To(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Po(this,t,e)}get(t){return Ki(this,t)}describe(t,e){return Po(Co,t,e)}override(t,e){return Po(Hn,t,e)}route(t,e,i,s){const r=Ki(this,t),o=Ki(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return ut(l)?Object.assign({},c,l):it(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var Et=new ap({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[np,ip,op]);function lp(n){return!n||ot(n.size)||ot(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ir(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function cp(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0;const a=e.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!Mt(d))o=ir(n,s,r,o,d);else if(Mt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!Mt(f)&&(o=ir(n,s,r,o,f));n.restore();const g=r.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[r[l]];r.splice(0,g)}return o}function Wn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Oc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Oo(n,t,e,i){Ec(n,t,e,i,null)}function Ec(n,t,e,i,s){let r,o,a,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,y=t.radius;let x=(p||0)*Mo;if(g&&typeof g=="object"&&(r=g.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(y)||y<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,y,0,0,Ct):n.arc(e,i,y,0,Ct),n.closePath();break;case"triangle":u=s?s/2:y,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=Qs,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=Qs,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,o=Math.cos(x+Pe)*l,d=Math.cos(x+Pe)*(s?s/2-c:l),a=Math.sin(x+Pe)*l,f=Math.sin(x+Pe)*(s?s/2-c:l),n.arc(e-d,i-a,c,x-pt,x-Ot),n.arc(e+f,i-o,c,x-Ot,x),n.arc(e+d,i+a,c,x,x+Ot),n.arc(e-f,i+o,c,x+Ot,x+pt),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=Pe;case"rectRot":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+f,i-o),n.lineTo(e+d,i+a),n.lineTo(e-f,i+o),n.closePath();break;case"crossRot":x+=Pe;case"cross":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"star":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o),x+=Pe,d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"line":o=s?s/2:Math.cos(x)*y,a=Math.sin(x)*y,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:y),i+Math.sin(x)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function en(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Zi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Qi(n){n.restore()}function up(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function dp(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 hp(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),ot(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 fp(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function gp(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Yn(n,t,e,i,s,r={}){const o=Mt(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,hp(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&gp(n,r.backdrop),a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),ot(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),fp(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function fi(n,t){const{x:e,y:i,w:s,h:r,radius:o}=t;n.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*pt,pt,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,pt,Ot,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Ot,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Ot,!0),n.lineTo(e+o.topLeft,i)}const pp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yp(n,t){const e=(""+n).match(pp);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 bp=n=>+n||0;function Eo(n,t){const e={},i=ut(t),s=i?Object.keys(t):t,r=ut(n)?i?o=>it(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=bp(r(o));return e}function Ac(n){return Eo(n,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(n){return Eo(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Xt(n){const t=Ac(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(n,t){n=n||{},t=t||Et.font;let e=it(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=it(n.style,t.style);i&&!(""+i).match(mp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:it(n.family,t.family),lineHeight:yp(it(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:it(n.weight,t.weight),string:""};return s.string=lp(s),s}function Ji(n,t,e,i){let s,r,o;for(s=0,r=n.length;s<r;++s)if(o=n[s],o!==void 0&&o!==void 0)return o}function _p(n,t,e){const{min:i,max:s}=n,r=dc(t,(s-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Mn(n,t){return Object.assign(Object.create(n),t)}function Ao(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Fc("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Ao([a,...n],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return Ic(a,l,()=>Tp(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return zc(a).includes(l)},ownKeys(a){return zc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function gi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Rc(n,i),setContext:r=>gi(n,r,e,i),override:r=>gi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return Ic(r,o,()=>wp(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function Rc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:pe(e)?e:()=>e,isIndexable:pe(i)?i:()=>i}}const xp=(n,t)=>n?n+vo(t):t,Ro=(n,t)=>ut(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ic(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function wp(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return pe(a)&&o.isScriptable(t)&&(a=vp(t,a,n,e)),Mt(a)&&a.length&&(a=Mp(t,a,n,o.isIndexable)),Ro(t,a)&&(a=gi(a,s,r&&r[t],o)),a}function vp(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(r,o||i);return a.delete(n),Ro(n,l)&&(l=Io(s._scopes,s,n,l)),l}function Mp(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(ut(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Io(c,s,n,u);t.push(gi(d,r,o&&o[n],a))}}return t}function Lc(n,t,e){return pe(n)?n(t,e):n}const kp=(n,t)=>n===!0?t:typeof n=="string"?_n(t,n):void 0;function Dp(n,t,e,i,s){for(const r of t){const o=kp(e,r);if(o){n.add(o);const a=Lc(o._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function Io(n,t,e,i){const s=t._rootScopes,r=Lc(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Nc(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Nc(a,o,r,l,i),l===null)?!1:Ao(Array.from(a),[""],s,r,()=>Sp(t,e,i))}function Nc(n,t,e,i,s){for(;e;)e=Dp(n,t,e,i,s);return e}function Sp(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return Mt(s)&&ut(e)?e:s||{}}function Tp(n,t,e,i){let s;for(const r of t)if(s=Fc(xp(r,n),e),typeof s<"u")return Ro(n,s)?Io(e,i,n,s):s}function Fc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function zc(n){let t=n._keys;return t||(t=n._keys=Cp(n._scopes)),t}function Cp(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Bc(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],o[a]={r:s.parse(_n(u,r),c)};return o}const Pp=Number.EPSILON||1e-14,pi=(n,t)=>t<n.length&&!n[t].skip&&n[t],Hc=n=>n==="x"?"y":"x";function Op(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=hi(r,s),l=hi(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,f=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+f*(o.x-s.x),y:r.y+f*(o.y-s.y)}}}function Ep(n,t,e){const i=n.length;let s,r,o,a,l,c=pi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=pi(n,u+1),!(!l||!c)){if(Ui(t[u],0,Pp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[u]=s*o*t[u],e[u+1]=r*o*t[u])}}function Ap(n,t,e="x"){const i=Hc(e),s=n.length;let r,o,a,l=pi(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=pi(n,c+1),!a)continue;const u=a[e],d=a[i];o&&(r=(u-o[e])/3,a[`cp1${e}`]=u-r,a[`cp1${i}`]=d-r*t[c]),l&&(r=(l[e]-u)/3,a[`cp2${e}`]=u+r,a[`cp2${i}`]=d+r*t[c])}}function Rp(n,t="x"){const e=Hc(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=pi(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=pi(n,o+1),!!l){if(c){const u=c[t]-l[t];s[o]=u!==0?(c[e]-l[e])/u:0}r[o]=a?c?Ye(s[o-1])!==Ye(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Ep(n,s,r),Ap(n,r,t)}function sr(n,t,e){return Math.max(Math.min(n,e),t)}function Ip(n,t){let e,i,s,r,o,a=en(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&en(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=sr(s.cp1x,t.left,t.right),s.cp1y=sr(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=sr(s.cp2x,t.left,t.right),s.cp2y=sr(s.cp2y,t.top,t.bottom)))}function Lp(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Rp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],l=Op(c,a,n[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Ip(n,e)}function Lo(){return typeof window<"u"&&typeof document<"u"}function No(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function rr(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 or=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Np(n,t){return or(n).getPropertyValue(t)}const Fp=["top","right","bottom","left"];function jn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=Fp[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Bp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(zp(s,r,n.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function kn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=or(e),r=s.boxSizing==="border-box",o=jn(s,"padding"),a=jn(s,"border","width"),{x:l,y:c,box:u}=Bp(n,e),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:g,height:p}=t;return r&&(g-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Hp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&No(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=or(r),l=jn(a,"border","width"),c=jn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=rr(a.maxWidth,r,"clientWidth"),s=rr(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Zs,maxHeight:s||Zs}}const ar=n=>Math.round(n*10)/10;function Wp(n,t,e,i){const s=or(n),r=jn(s,"margin"),o=rr(s.maxWidth,n,"clientWidth")||Zs,a=rr(s.maxHeight,n,"clientHeight")||Zs,l=Hp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=jn(s,"border","width"),g=jn(s,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=ar(Math.min(c,o,l.maxWidth)),u=ar(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ar(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ar(Math.floor(u*i))),{width:c,height:u}}function Wc(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Yp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Lo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function Yc(n,t){const e=Np(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Vn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function jp(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 Vp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=Vn(n,s,e),a=Vn(s,r,e),l=Vn(r,t,e),c=Vn(o,a,e),u=Vn(a,l,e);return Vn(c,u,e)}const $p=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}}},Up=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function mi(n,t,e){return n?$p(t,e):Up()}function jc(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 Vc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function $c(n){return n==="angle"?{between:Xi,compare:Xg,normalize:ke}:{between:Je,compare:(t,e)=>t-e,normalize:t=>t}}function Uc({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Xp(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=$c(i),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&o(a(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Xc(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=$c(i),{start:u,end:d,loop:f,style:g}=Xp(n,t,e),p=[];let y=!1,x=null,M,v,D;const S=()=>l(s,D,M)&&a(s,D)!==0,T=()=>a(r,M)===0||l(r,D,M),A=()=>y||S(),O=()=>!y||T();for(let _=u,b=u;_<=d;++_)v=t[_%o],!v.skip&&(M=c(v[i]),M!==D&&(y=l(M,s,r),x===null&&A()&&(x=a(M,s)===0?_:b),x!==null&&O()&&(p.push(Uc({start:x,end:_,loop:f,count:o,style:g})),x=null),b=_,D=M));return x!==null&&p.push(Uc({start:x,end:d,loop:f,count:o,style:g})),p}function qc(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=Xc(i[s],n.points,t);r.length&&e.push(...r)}return e}function qp(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Gp(n,t,e,i){const s=n.length,r=[];let o=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function Kp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=qp(e,s,r,i);if(i===!0)return Gc(n,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!n._fullLoop&&o===0&&a===s-1;return Gc(n,Gp(e,o,l,c),e,t)}function Gc(n,t,e,i){return!i||!i.setContext||!e?t:Zp(n,t,e,i)}function Zp(n,t,e,i){const s=n._chart.getContext(),r=Kc(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,f=d;function g(p,y,x,M){const v=a?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=v;for(;e[y%l].skip;)y+=v;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:x,style:M}),u=M,d=y%l)}}for(const p of t){d=a?d:p.start;let y=e[d%l],x;for(f=d+1;f<=p.end;f++){const M=e[f%l];x=Kc(i.setContext(Mn(s,{type:"segment",p0:y,p1:M,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),Qp(x,u)&&g(d,f-1,p.loop,u),y=M,u=x}d<f-1&&g(d,f-1,p.loop,u)}return c}function Kc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Qp(n,t){if(!t)return!1;const e=[],i=function(s,r){return So(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
|
|
12
12
|
* Chart.js v4.4.5
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2024 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class Jp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=xc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var nn=new Jp;const Kc="transparent",tm={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Sc(n||Kc),s=i.valid&&Sc(t||Kc);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class em{constructor(t,e,i,s){const r=e[i];s=Ji([t.to,s,r,t.from]);const o=Ji([t.from,r,s]);this._active=!0,this._fn=t.fn||tm[t.type||typeof o],this._easing=qi[t.easing]||qi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ji([t.to,e,s,t.from]),this._from=Ji([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Fo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ct(t))return;const e=Object.keys(Et.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ct(r))return;const o={};for(const a of e)o[a]=r[a];(Mt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=im(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&nm(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=d=new em(f,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return nn.add(this._chart,i),!0}}function nm(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function im(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 Zc(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function sm(n,t,e){if(e===!1)return!1;const i=Zc(n,e),s=Zc(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function rm(n){let t,e,i,s;return ct(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function Qc(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function Jc(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||Ye(t)===Ye(c))&&(t+=c)}return t}}function om(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function zo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function am(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function lm(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function cm(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function tu(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function eu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=am(r,o,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:y,[c]:x}=p,M=p._stacks||(p._stacks={});f=M[c]=cm(s,u,y),f[a]=x,f._top=tu(f,o,!0,i.type),f._bottom=tu(f,o,!1,i.type);const v=f._visualValues||(f._visualValues={});v[a]=x}}function Bo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function um(n,t){return Mn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function dm(n,t,e){return Mn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ts(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const Ho=n=>n==="reset"||n==="none",nu=(n,t)=>t?n:Object.assign({},n),hm=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Qc(e,!0),values:null};class Fe{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=zo(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ts(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,r=e.xAxisID=it(i.xAxisID,Bo(t,"x")),o=e.yAxisID=it(i.yAxisID,Bo(t,"y")),a=e.rAxisID=it(i.rAxisID,Bo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&bc(this._data,this),t._stacked&&ts(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ct(e)){const s=this._cachedMeta;this._data=om(e,s)}else if(i!==e){if(i){bc(i,this);const s=this._cachedMeta;ts(s),s._parsed=[]}e&&Object.isExtensible(e)&&Zg(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=zo(e.vScale,e),e.stack!==i.stack&&(s=!0,ts(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(eu(this,e._parsed),e._stacked=zo(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{Mt(s[t])?f=this.parseArrayData(i,s,t,e):ct(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&eu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,d=new Array(s);let f,g,p;for(f=0,g=s;f<g;++f)p=f+i,d[f]={[a]:u||r.parse(c[p],p),[l]:o.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,f,g;for(u=0,d=s;u<d;++u)f=u+i,g=e[f],c[u]={x:r.parse(_n(g,a),f),y:o.parse(_n(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:Qc(s,!0),values:e._stacks[t.axis]._visualValues};return Jc(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=Jc(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=hm(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=lm(a);let f,g;function p(){g=s[f];const y=g[a.axis];return!Rt(g[t.axis])||u>y||d<y}for(f=0;f<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++f);if(r){for(f=o-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Rt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=rm(it(this.options.clip,sm(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const d=s[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=dm(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=um(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&ge(i);if(a)return nu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Et.elements[t]),p=()=>this.getContext(i,s,e),y=c.resolveNamedOptions(f,g,p,d);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(nu(y,l))),y}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Fo(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ho(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){Ho(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ho(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&ts(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}O(Fe,"defaults",{}),O(Fe,"datasetElementType",null),O(Fe,"dataElementType",null);function fm(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=_c(i.sort((s,r)=>s-r))}return n._cache.$bar}function gm(n){const t=n.iScale,e=fm(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(ge(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function pm(n,t,e,i){const s=e.barThickness;let r,o;return rt(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function mm(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function ym(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function iu(n,t,e,i){return Mt(n)?ym(n,t,e,i):t[e.axis]=e.parse(n,i),t}function su(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(iu(f,d,r,c));return l}function Wo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function bm(n,t,e){return n!==0?Ye(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function _m(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function xm(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=_m(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[ru(u,o,a,l)]=!0,s=c)),r[ru(s,o,a,l)]=!0,n.borderSkipped=r}function ru(n,t,e,i){return i?(n=wm(n,t,e),n=ou(n,e,t)):n=ou(n,t,e),n}function wm(n,t,e){return n===t?e:n===e?t:n}function ou(n,t,e){return n==="start"?t:n==="end"?e:n}function vm(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class es extends Fe{parsePrimitiveData(t,e,i,s){return su(t,e,i,s)}parseArrayData(t,e,i,s){return su(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let f,g,p,y;for(f=i,g=i+s;f<g;++f)y=e[f],p={},p[r.axis]=r.parse(_n(y,c),f),d.push(iu(_n(y,u),p,o,f));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Wo(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),y=r||rt(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,u),M=(p._stacks||{})[a.axis],v={horizontal:c,base:y.base,enableBorderRadius:!M||Wo(p._custom)||o===M._top||o===M._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};f&&(v.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const D=v.options||t[g].options;xm(v,D,M,o),vm(v,D,u.ratio),this.updateElement(t[g],g,v,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),f=d&&d[u.vScale.axis];if(rt(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||gm(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Wo(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,y;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Ye(d)!==Ye(c.barEnd)&&(f=0),f+=d);const x=!rt(r)&&!u?r:f;let M=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=M,y=p-M,Math.abs(y)<o){y=bm(y,e,a)*o,d===a&&(M-=y/2);const v=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),S=Math.min(v,D),T=Math.max(v,D);M=Math.max(Math.min(M,T),S),p=M+y,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(M))}if(M===e.getPixelForValue(a)){const v=Ye(y)*e.getLineWidthForValue(a)/2;M+=v,y-=v}return{size:y,base:M,head:p,center:p+y/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=it(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?mm(t,e,s,c):pm(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}O(es,"id","bar"),O(es,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),O(es,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class lr extends Fe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=it(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=it(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,d=a.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!r&&this.getParsed(f),y={},x=y[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),M=y[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);y.skip=isNaN(x)||isNaN(M),c&&(y.options=l||this.resolveDataElementOptions(f,g.active?"active":s),r&&(y.options.radius=0)),this.updateElement(g,f,y,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=it(i&&i._custom,r),s}}O(lr,"id","bubble"),O(lr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),O(lr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Mm(n,t,e){let i=1,s=1,r=0,o=0;if(t<Ct){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(D,S,T)=>Xi(D,a,l,!0)?1:Math.max(S,S*e,T,T*e),p=(D,S,T)=>Xi(D,a,l,!0)?-1:Math.min(S,S*e,T,T*e),y=g(0,c,d),x=g(Ot,u,f),M=p(pt,c,d),v=p(pt+Ot,u,f);i=(y-M)/2,s=(x-v)/2,r=-(y+M)/2,o=-(x+v)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class sn extends Fe{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ct(i[t])){const{key:l="value"}=this._parsing;r=c=>+_n(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Ut(this.options.rotation-90)}_getCircumference(){return Ut(this.options.circumference)}_getRotationExtents(){let t=Ct,e=-Ct;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(zg(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:y}=Mm(d,u,l),x=(i.width-o)/f,M=(i.height-o)/g,v=Math.max(Math.min(x,M)/2,0),D=uc(this.options.radius,v),S=Math.max(D*l,0),T=(D-S)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=y*D,s.total=this.calculateTotal(),this.outerRadius=D-T*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-T*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Ct)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=r&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(e,s);let M=this._getRotation(),v;for(v=0;v<e;++v)M+=this._circumference(v,r);for(v=e;v<e+i;++v){const D=this._circumference(v,r),S=t[v],T={x:u+this.offsetX,y:d+this.offsetY,startAngle:M,endAngle:M+D,circumference:D,outerRadius:p,innerRadius:g};x&&(T.options=y||this.resolveDataElementOptions(v,S.active?"active":s)),M+=D,this.updateElement(S,v,T,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ct*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(it(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}O(sn,"id","doughnut"),O(sn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),O(sn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),O(sn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ns extends Fe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=vc(e,s,o);this._drawStart=a,this._drawCount=l,Mc(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),f=o.axis,g=a.axis,{spanGaps:p,segment:y}=this.options,x=wn(p)?p:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none",v=e+i,D=t.length;let S=e>0&&this.getParsed(e-1);for(let T=0;T<D;++T){const R=t[T],E=M?R:{};if(T<e||T>=v){E.skip=!0;continue}const _=this.getParsed(T),b=rt(_[g]),P=E[f]=o.getPixelForValue(_[f],T),I=E[g]=r||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[g],T);E.skip=isNaN(P)||isNaN(I)||b,E.stop=T>0&&Math.abs(_[f]-S[f])>x,y&&(E.parsed=_,E.raw=c.data[T]),d&&(E.options=u||this.resolveDataElementOptions(T,R.active?"active":s)),M||this.updateElement(R,T,E,s),S=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}O(ns,"id","line"),O(ns,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(ns,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class is extends Fe{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return zc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*pt;let g=f,p;const y=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,y);for(p=e;p<e+i;p++){const x=t[p];let M=g,v=g+this._computeAngle(p,s,y),D=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=v,r&&(l.animateScale&&(D=0),l.animateRotate&&(M=v=f));const S={x:u,y:d,innerRadius:0,outerRadius:D,startAngle:M,endAngle:v,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,S,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Ut(this.resolveDataElementOptions(t,e).angle||i):0}}O(is,"id","polarArea"),O(is,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),O(is,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Yo extends sn{}O(Yo,"id","pie"),O(Yo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class cr extends Fe{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return zc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),d=o?r.xCenter:u.x,f=o?r.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,g,s)}}}O(cr,"id","radar"),O(cr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),O(cr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ur extends Fe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=vc(e,i,s);if(this._drawStart=r,this._drawCount=o,Mc(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),f=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:y,segment:x}=this.options,M=wn(y)?y:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let S=e;S<e+i;++S){const T=t[S],R=this.getParsed(S),E=v?T:{},_=rt(R[p]),b=E[g]=o.getPixelForValue(R[g],S),P=E[p]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[p],S);E.skip=isNaN(b)||isNaN(P)||_,E.stop=S>0&&Math.abs(R[g]-D[g])>M,x&&(E.parsed=R,E.raw=c.data[S]),f&&(E.options=d||this.resolveDataElementOptions(S,T.active?"active":s)),v||this.updateElement(T,S,E,s),D=R}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}O(ur,"id","scatter"),O(ur,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),O(ur,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var km=Object.freeze({__proto__:null,BarController:es,BubbleController:lr,DoughnutController:sn,LineController:ns,PieController:Yo,PolarAreaController:is,RadarController:cr,ScatterController:ur});function $n(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class jo{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign(jo.prototype,t)}init(){}formats(){return $n()}parse(){return $n()}format(){return $n()}add(){return $n()}diff(){return $n()}startOf(){return $n()}endOf(){return $n()}}var au={_date:jo};function Dm(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?Gg:tn;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,e-u),f=l(r,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function ss(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:d,hi:f}=Dm(r[a],t,o,s);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Sm(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Vo(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||ss(n,e,t,function(a,l,c){!s&&!en(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Tm(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=tr(o,{x:t.x,y:t.y});Xi(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return ss(n,e,t,r),s}function Cm(n,t,e,i,s,r){let o=[];const a=Sm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;const x=a(t,p);x<l?(o=[{element:u,datasetIndex:d,index:f}],l=x):x===l&&o.push({element:u,datasetIndex:d,index:f})}return ss(n,e,t,c),o}function $o(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?Tm(n,t,e,s):Cm(n,t,e,i,s,r)}function lu(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return ss(n,e,t,(l,c,u)=>{l[o]&&l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Uo={evaluateInteractionItems:ss,modes:{index(n,t,e,i){const s=kn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Vo(n,s,r,i,o):$o(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=kn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Vo(n,s,r,i,o):$o(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=kn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Vo(n,s,r,i,o)},nearest(n,t,e,i){const s=kn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return $o(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=kn(t,n);return lu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=kn(t,n);return lu(n,s,"y",e.intersect,i)}}};const cu=["left","top","right","bottom"];function rs(n,t){return n.filter(e=>e.pos===t)}function uu(n,t){return n.filter(e=>cu.indexOf(e.pos)===-1&&e.box.axis===t)}function os(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function Pm(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function Om(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!cu.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function Em(n,t){const e=Om(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function Am(n){const t=Pm(n),e=os(t.filter(c=>c.box.fullSize),!0),i=os(rs(t,"left"),!0),s=os(rs(t,"right")),r=os(rs(t,"top"),!0),o=os(rs(t,"bottom")),a=uu(t,"x"),l=uu(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:rs(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function du(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function hu(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 Rm(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!ct(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&hu(o,r.getPadding());const a=Math.max(0,t.outerWidth-du(o,n,"left","right")),l=Math.max(0,t.outerHeight-du(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Im(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Lm(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function as(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Lm(a.horizontal,t));const{same:d,other:f}=Rm(t,e,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&as(s,t,e,i)||u}function dr(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function fu(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;ge(c.start)&&(o=c.start),l.fullSize?dr(l,s.left,o,e.outerWidth-s.right-s.left,f):dr(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;ge(c.start)&&(r=c.start),l.fullSize?dr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):dr(l,r,t.top+c.placed,f,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var se={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=Xt(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Am(n.boxes),l=a.vertical,c=a.horizontal;Dt(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);hu(f,Xt(i));const g=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),p=Em(l.concat(c),d);as(a.fullSize,g,d,p),as(l,g,d,p),as(c,g,d,p)&&as(l,g,d,p),Im(g),fu(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,fu(a.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Dt(a.chartArea,y=>{const x=y.box;Object.assign(x,n.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class gu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Nm extends gu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const hr="$chartjs",Fm={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},pu=n=>n===null||n==="";function zm(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[hr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",pu(s)){const r=Wc(n,"width");r!==void 0&&(n.width=r)}if(pu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=Wc(n,"height");r!==void 0&&(n.height=r)}return n}const mu=Yp?{passive:!0}:!1;function Bm(n,t,e){n&&n.addEventListener(t,e,mu)}function Hm(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,mu)}function Wm(n,t){const e=Fm[n.type]||n.type,{x:i,y:s}=kn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function fr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Ym(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||fr(a.addedNodes,i),o=o&&!fr(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function jm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||fr(a.removedNodes,i),o=o&&!fr(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ls=new Map;let yu=0;function bu(){const n=window.devicePixelRatio;n!==yu&&(yu=n,ls.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Vm(n,t){ls.size||window.addEventListener("resize",bu),ls.set(n,t)}function $m(n){ls.delete(n),ls.size||window.removeEventListener("resize",bu)}function Um(n,t,e){const i=n.canvas,s=i&&No(i);if(!s)return;const r=wc((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),Vm(n,r),o}function Xo(n,t,e){e&&e.disconnect(),t==="resize"&&$m(n)}function Xm(n,t,e){const i=n.canvas,s=wc(r=>{n.ctx!==null&&e(Wm(r,n))},n);return Bm(i,t,s),s}class qm extends gu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(zm(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[hr])return!1;const i=e[hr].initial;["height","width"].forEach(r=>{const o=i[r];rt(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[hr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Ym,detach:jm,resize:Um}[e]||Xm;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Xo,detach:Xo,resize:Xo}[e]||Hm)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Wp(t,e,i,s)}isAttached(t){const e=t&&No(t);return!!(e&&e.isConnected)}}function Gm(n){return!Lo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Nm:qm}class Qt{constructor(){O(this,"x");O(this,"y");O(this,"active",!1);O(this,"options");O(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return wn(this.x)&&wn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}O(Qt,"defaults",{}),O(Qt,"defaultRoutes");function Km(n,t){const e=n.options.ticks,i=Zm(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Jm(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return ty(t,c,r,o/s),c;const u=Qm(r,t,s);if(o>0){let d,f;const g=o>1?Math.round((l-a)/(o-1)):null;for(gr(t,c,u,rt(g)?0:a-g,a),d=0,f=o-1;d<f;d++)gr(t,c,u,r[d],r[d+1]);return gr(t,c,u,l,rt(g)?t.length:l+g),c}return gr(t,c,u),c}function Zm(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Qm(n,t,e){const i=ey(n),s=t.length/e;if(!i)return Math.max(s,1);const r=$g(i);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function Jm(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function ty(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function gr(n,t,e,i,s){const r=it(i,0),o=Math.min(it(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function ey(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 ny=n=>n==="left"?"right":n==="right"?"left":n,_u=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,xu=(n,t)=>Math.min(t||n,n);function wu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function iy(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function sy(n,t){Dt(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function cs(n){return n.drawTicks?n.tickLength:0}function vu(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Xt(n.padding);return(Mt(n.text)?n.text.length:1)*e.lineHeight+i.height}function ry(n,t){return Mn(n,{scale:t,type:"scale"})}function oy(n,t,e){return Mn(n,{tick:e,index:t,type:"tick"})}function ay(n,t,e){let i=Do(n);return(e&&t!=="right"||!e&&t==="right")&&(i=ny(i)),i}function ly(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const y=o-s,x=a-r;if(n.isHorizontal()){if(g=ie(i,r,a),ct(e)){const M=Object.keys(e)[0],v=e[M];p=u[M].getPixelForValue(v)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=_u(n,e,t);f=a-r}else{if(ct(e)){const M=Object.keys(e)[0],v=e[M];g=u[M].getPixelForValue(v)-x+t}else e==="center"?g=(c.left+c.right)/2-x+t:g=_u(n,e,t);p=ie(i,o,s),d=e==="left"?-Ot:Ot}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class Un extends Qt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=Me(t,Number.POSITIVE_INFINITY),e=Me(e,Number.NEGATIVE_INFINITY),i=Me(i,Number.POSITIVE_INFINITY),s=Me(s,Number.NEGATIVE_INFINITY),{min:Me(t,i),max:Me(e,s),minDefined:Rt(t),maxDefined:Rt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Me(e,Me(i,e)),max:Me(i,Me(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){kt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_p(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?wu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Km(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){kt(this.options.afterUpdate,[this])}beforeSetDimensions(){kt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){kt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),kt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){kt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=kt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){kt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){kt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=xu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Zt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),d+6>a&&(a=g/(i-(t.offset?.5:1)),l=this.maxHeight-cs(t.grid)-e.padding-vu(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Js(Math.min(Math.asin(Zt((u.highest.height+6)/a,-1,1)),Math.asin(Zt(l/c,-1,1))-Math.asin(Zt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){kt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){kt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=vu(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=cs(r)+l):(t.height=this.maxHeight,t.width=cs(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=i.padding*2,p=Ut(this.labelRotation),y=Math.cos(p),x=Math.sin(p);if(a){const M=i.mirror?0:x*d.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+M+g)}else{const M=i.mirror?0:y*d.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+M+g)}this._calculatePadding(c,u,x,y)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*t.width,g=i*e.height):(f=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+o)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){kt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)rt(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=wu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/xu(e,i));let c=0,u=0,d,f,g,p,y,x,M,v,D,S,T;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),s.font=x=y.string,M=r[x]=r[x]||{data:{},gc:[]},v=y.lineHeight,D=S=0,!rt(p)&&!Mt(p))D=ir(s,M.data,M.gc,D,p),S=v;else if(Mt(p))for(f=0,g=p.length;f<g;++f)T=p[f],!rt(T)&&!Mt(T)&&(D=ir(s,M.data,M.gc,D,T),S+=v);o.push(D),a.push(S),c=Math.max(D,c),u=Math.max(S,u)}sy(r,e);const R=o.indexOf(c),E=a.indexOf(u),_=b=>({width:o[b]||0,height:a[b]||0});return{first:_(0),last:_(e-1),widest:_(R),highest:_(E),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return qg(this._alignToPixels?Wn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=oy(this.getContext(),t,i))}return this.$context||(this.$context=ry(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ut(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=cs(r),g=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,x=y/2,M=function(X){return Wn(i,X,y)};let v,D,S,T,R,E,_,b,P,I,C,N;if(o==="top")v=M(this.bottom),E=this.bottom-f,b=v-x,I=M(t.top)+x,N=t.bottom;else if(o==="bottom")v=M(this.top),I=t.top,N=M(t.bottom)-x,E=v+x,b=this.top+f;else if(o==="left")v=M(this.right),R=this.right-f,_=v-x,P=M(t.left)+x,C=t.right;else if(o==="right")v=M(this.left),P=t.left,C=M(t.right)-x,R=v+x,_=this.left+f;else if(e==="x"){if(o==="center")v=M((t.top+t.bottom)/2+.5);else if(ct(o)){const X=Object.keys(o)[0],H=o[X];v=M(this.chart.scales[X].getPixelForValue(H))}I=t.top,N=t.bottom,E=v+x,b=E+f}else if(e==="y"){if(o==="center")v=M((t.left+t.right)/2);else if(ct(o)){const X=Object.keys(o)[0],H=o[X];v=M(this.chart.scales[X].getPixelForValue(H))}R=v-x,_=R-f,P=t.left,C=t.right}const j=it(s.ticks.maxTicksLimit,d),$=Math.max(1,Math.ceil(d/j));for(D=0;D<d;D+=$){const X=this.getContext(D),H=r.setContext(X),ut=a.setContext(X),V=H.lineWidth,tt=H.color,U=ut.dash||[],B=ut.dashOffset,Q=H.tickWidth,wt=H.tickColor,dt=H.tickBorderDash||[],vt=H.tickBorderDashOffset;S=iy(this,D,l),S!==void 0&&(T=Wn(i,S,V),c?R=_=P=C=T:E=b=I=N=T,g.push({tx1:R,ty1:E,tx2:_,ty2:b,x1:P,y1:I,x2:C,y2:N,width:V,color:tt,borderDash:U,borderDashOffset:B,tickWidth:Q,tickColor:wt,tickBorderDash:dt,tickBorderDashOffset:vt}))}return this._ticksLength=d,this._borderValue=v,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,f=cs(i.grid),g=f+u,p=d?-u:g,y=-Ut(this.labelRotation),x=[];let M,v,D,S,T,R,E,_,b,P,I,C,N="middle";if(s==="top")R=this.bottom-p,E=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+p,E=this._getXAxisLabelAlignment();else if(s==="left"){const $=this._getYAxisLabelAlignment(f);E=$.textAlign,T=$.x}else if(s==="right"){const $=this._getYAxisLabelAlignment(f);E=$.textAlign,T=$.x}else if(e==="x"){if(s==="center")R=(t.top+t.bottom)/2+g;else if(ct(s)){const $=Object.keys(s)[0],X=s[$];R=this.chart.scales[$].getPixelForValue(X)+g}E=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")T=(t.left+t.right)/2-g;else if(ct(s)){const $=Object.keys(s)[0],X=s[$];T=this.chart.scales[$].getPixelForValue(X)}E=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?N="top":l==="end"&&(N="bottom"));const j=this._getLabelSizes();for(M=0,v=a.length;M<v;++M){D=a[M],S=D.label;const $=r.setContext(this.getContext(M));_=this.getPixelForTick(M)+r.labelOffset,b=this._resolveTickFontOptions(M),P=b.lineHeight,I=Mt(S)?S.length:1;const X=I/2,H=$.color,ut=$.textStrokeColor,V=$.textStrokeWidth;let tt=E;o?(T=_,E==="inner"&&(M===v-1?tt=this.options.reverse?"left":"right":M===0?tt=this.options.reverse?"right":"left":tt="center"),s==="top"?c==="near"||y!==0?C=-I*P+P/2:c==="center"?C=-j.highest.height/2-X*P+P:C=-j.highest.height+P/2:c==="near"||y!==0?C=P/2:c==="center"?C=j.highest.height/2-X*P:C=j.highest.height-I*P,d&&(C*=-1),y!==0&&!$.showLabelBackdrop&&(T+=P/2*Math.sin(y))):(R=_,C=(1-I)*P/2);let U;if($.showLabelBackdrop){const B=Xt($.backdropPadding),Q=j.heights[M],wt=j.widths[M];let dt=C-B.top,vt=0-B.left;switch(N){case"middle":dt-=Q/2;break;case"bottom":dt-=Q;break}switch(E){case"center":vt-=wt/2;break;case"right":vt-=wt;break;case"inner":M===v-1?vt-=wt:M>0&&(vt-=wt/2);break}U={left:vt,top:dt,width:wt+B.width,height:Q+B.height,color:$.backdropColor}}x.push({label:S,font:b,textOffset:C,options:{rotation:y,color:H,strokeColor:ut,strokeWidth:V,textAlign:tt,textBaseline:N,translation:[T,R],backdrop:U}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ut(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=Wn(t,this.left,o)-o/2,u=Wn(t,this.right,a)+a/2,d=f=l):(d=Wn(t,this.top,o)-o/2,f=Wn(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Zi(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Yn(i,c,0,u,l,a)}s&&Qi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=It(i.font),o=Xt(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ct(e)?(l+=o.bottom,Mt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=ly(this,l,e,a);Yn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:f,textAlign:ay(a,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=it(t.grid&&t.grid.z,-1),s=it(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Un.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return It(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class pr{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;dy(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,cy(t,o,i),this.override&&Et.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Et[s]&&(delete Et[s][i],this.override&&delete Hn[i])}}function cy(n,t,e){const i=Vi(Object.create(null),[e?Et.get(e):{},Et.get(t),n.defaults]);Et.set(t,i),n.defaultRoutes&&uy(t,n.defaultRoutes),n.descriptors&&Et.describe(t,n.descriptors)}function uy(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");Et.route(r,s,l,a)})}function dy(n){return"id"in n&&"defaults"in n}class hy{constructor(){this.controllers=new pr(Fe,"datasets",!0),this.elements=new pr(Qt,"elements"),this.plugins=new pr(Object,"plugins"),this.scales=new pr(Un,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Dt(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=vo(t);kt(i["before"+s],[],i),e[t](i),kt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var je=new hy;class fy{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(kt(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){rt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=it(i.options&&i.options.plugins,{}),r=gy(i);return s===!1&&!e?[]:my(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function gy(n){const t={},e=[],i=Object.keys(je.plugins.items);for(let r=0;r<i.length;r++)e.push(je.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function py(n,t){return!t&&n===!1?null:n===!0?{}:n}function my(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=py(i[l],s);c!==null&&r.push({plugin:a,options:yy(n.config,{plugin:a,local:e[l]},c,o)})}return r}function yy(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function qo(n,t){const e=Et.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function by(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function _y(n,t){return n===t?"_index_":"_value_"}function Mu(n){if(n==="x"||n==="y"||n==="r")return n}function xy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Go(n,...t){if(Mu(n))return n;for(const e of t){const i=e.axis||xy(e.position)||n.length>1&&Mu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function ku(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function wy(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 ku(n,"x",e[0])||ku(n,"y",e[0])}return{}}function vy(n,t){const e=Hn[n.type]||{scales:{}},i=t.scales||{},s=qo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!ct(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Go(o,a,wy(o,n),Et.scales[a.type]),c=_y(l,s),u=e.scales||{};r[o]=$i(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||qo(a,t),u=(Hn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=by(d,l),g=o[f+"AxisID"]||f;r[g]=r[g]||Object.create(null),$i(r[g],[{axis:f},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];$i(a,[Et.scales[a.type],Et.scale])}),r}function Du(n){const t=n.options||(n.options={});t.plugins=it(t.plugins,{}),t.scales=vy(n,t)}function Su(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function My(n){return n=n||{},n.data=Su(n.data),Du(n),n}const Tu=new Map,Cu=new Set;function mr(n,t){let e=Tu.get(n);return e||(e=t(),Tu.set(n,e),Cu.add(e)),e}const us=(n,t,e)=>{const i=_n(t,e);i!==void 0&&n.add(i)};class ky{constructor(t){this._config=My(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=Su(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(),Du(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return mr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return mr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return mr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return mr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>us(l,t,d))),u.forEach(d=>us(l,s,d)),u.forEach(d=>us(l,Hn[r]||{},d)),u.forEach(d=>us(l,Et,d)),u.forEach(d=>us(l,Co,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Cu.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Hn[e]||{},Et.datasets[e]||{},{type:e},Et,Co]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Pu(this._resolverCache,t,s);let l=o;if(Sy(o,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,a);l=gi(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Pu(this._resolverCache,t,i);return ct(e)?gi(r,e,void 0,s):r}}function Pu(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:Ao(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Dy=n=>ct(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function Sy(n,t){const{isScriptable:e,isIndexable:i}=Ac(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(pe(a)||Dy(a))||o&&Mt(a))return!0}return!1}var Ty="4.4.5";const Cy=["top","bottom","left","right","chartArea"];function Ou(n,t){return n==="top"||n==="bottom"||Cy.indexOf(n)===-1&&t==="x"}function Eu(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Au(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),kt(e&&e.onComplete,[n],t)}function Py(n){const t=n.chart,e=t.options.animation;kt(e&&e.onProgress,[n],t)}function Ru(n){return Lo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const yr={},Iu=n=>{const t=Ru(n);return Object.values(yr).filter(e=>e.canvas===t).pop()};function Oy(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function Ey(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function br(n,t,e){return n.options.clip?n[e]:t[e]}function Ay(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:br(e,t,"left"),right:br(e,t,"right"),top:br(i,t,"top"),bottom:br(i,t,"bottom")}:t}let Oe=(An=class{static register(...t){je.add(...t),Lu()}static unregister(...t){je.remove(...t),Lu()}constructor(t,e){const i=this.config=new ky(e),s=Ru(t),r=Iu(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Gm(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Fg(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new fy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Qg(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],yr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}nn.listen(this,"complete",Au),nn.listen(this,"progress",Py),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return rt(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return je}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Hc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Pc(this.canvas,this.ctx),this}stop(){return nn.stop(this),this}resize(t,e){nn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Hc(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),kt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Dt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=Go(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Dt(r,o=>{const a=o.options,l=a.id,c=Go(l,a),u=it(a.type,o.dtype);(a.position===void 0||Ou(a.position,c)!==Ou(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const f=je.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Dt(s,(o,a)=>{o||delete i[a]}),Dt(i,o=>{se.configure(this,o,o.options),se.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Eu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||qo(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=je.getController(a),{datasetElementType:c,dataElementType:u}=Et.datasets[a];Object.assign(l,{dataElementType:je.getElement(u),datasetElementType:c&&je.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Dt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||Dt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Eu("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Dt(this.scales,t=>{se.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!fc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;Oy(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!fc(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;se.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Dt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,pe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(nn.has(this)?this.attached&&!nn.running(this)&&nn.start(this):(this.draw(),Au({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,r=Ay(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Zi(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Qi(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Uo.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Mn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);ge(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),nn.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(),Pc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete yr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Dt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){Dt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Dt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Gs(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=jg(t),c=Ey(t,this._lastEvent,i,l);i&&(this._lastEvent=null,kt(r.onHover,[t,a,this],this),l&&kt(r.onClick,[t,a,this],this));const u=!Gs(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},O(An,"defaults",Et),O(An,"instances",yr),O(An,"overrides",Hn),O(An,"registry",je),O(An,"version",Ty),O(An,"getChart",Iu),An);function Lu(){return Dt(Oe.instances,n=>n._plugins.invalidate())}function Ry(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Ot,i-Ot),n.closePath(),n.clip()}function Iy(n){return Eo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Ly(n,t,e,i){const s=Iy(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return Zt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Zt(s.innerStart,0,o),innerEnd:Zt(s.innerEnd,0,o)}}function yi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function _r(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const $=u>0?u-i:0,X=d>0?d-i:0,H=($+X)/2,ut=H!==0?p*H/(H+i):p;g=(p-ut)/2}const y=Math.max(.001,p*d-e/pt)/d,x=(p-y)/2,M=l+x+g,v=s-x-g,{outerStart:D,outerEnd:S,innerStart:T,innerEnd:R}=Ly(t,f,d,v-M),E=d-D,_=d-S,b=M+D/E,P=v-S/_,I=f+T,C=f+R,N=M+T/I,j=v-R/C;if(n.beginPath(),r){const $=(b+P)/2;if(n.arc(o,a,d,b,$),n.arc(o,a,d,$,P),S>0){const V=yi(_,P,o,a);n.arc(V.x,V.y,S,P,v+Ot)}const X=yi(C,v,o,a);if(n.lineTo(X.x,X.y),R>0){const V=yi(C,j,o,a);n.arc(V.x,V.y,R,v+Ot,j+Math.PI)}const H=(v-R/f+(M+T/f))/2;if(n.arc(o,a,f,v-R/f,H,!0),n.arc(o,a,f,H,M+T/f,!0),T>0){const V=yi(I,N,o,a);n.arc(V.x,V.y,T,N+Math.PI,M-Ot)}const ut=yi(E,M,o,a);if(n.lineTo(ut.x,ut.y),D>0){const V=yi(E,b,o,a);n.arc(V.x,V.y,D,M-Ot,b)}}else{n.moveTo(o,a);const $=Math.cos(b)*d+o,X=Math.sin(b)*d+a;n.lineTo($,X);const H=Math.cos(P)*d+o,ut=Math.sin(P)*d+a;n.lineTo(H,ut)}n.closePath()}function Ny(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){_r(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%Ct||Ct))}return _r(n,t,e,i,l,s),n.fill(),l}function Fy(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){_r(n,t,e,i,p,s);for(let y=0;y<r;++y)n.stroke();isNaN(a)||(p=o+(a%Ct||Ct))}g&&Ry(n,t,p),r||(_r(n,t,e,i,p,s),n.stroke())}class ds extends Qt{constructor(e){super();O(this,"circumference");O(this,"endAngle");O(this,"fullCircles");O(this,"innerRadius");O(this,"outerRadius");O(this,"pixelMargin");O(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=tr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=it(f,c-l),y=Xi(o,l,c)&&l!==c,x=p>=Ct||y,M=Je(a,u+g,d+g);return x&&M}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+o)/2,f=(a+l+u+c)/2;return{x:i+Math.cos(d)*f,y:s+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ct?Math.floor(s/Ct):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(pt,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Ny(e,this,u,o,a),Fy(e,this,u,o,a),e.restore()}}O(ds,"id","arc"),O(ds,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),O(ds,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(ds,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Nu(n,t,e=t){n.lineCap=it(e.borderCapStyle,t.borderCapStyle),n.setLineDash(it(e.borderDash,t.borderDash)),n.lineDashOffset=it(e.borderDashOffset,t.borderDashOffset),n.lineJoin=it(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=it(e.borderWidth,t.borderWidth),n.strokeStyle=it(e.borderColor,t.borderColor)}function zy(n,t,e){n.lineTo(e.x,e.y)}function By(n){return n.stepped?up:n.tension||n.cubicInterpolationMode==="monotone"?dp:zy}function Fu(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Hy(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Fu(s,e,i),u=By(r);let{move:d=!0,reverse:f}=i||{},g,p,y;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,f,r.stepped),y=p);return l&&(p=s[(a+(f?c:0))%o],u(n,y,p,f,r.stepped)),!!l}function Wy(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Fu(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,y,x,M;const v=S=>(o+(c?a-S:S))%r,D=()=>{y!==x&&(n.lineTo(u,x),n.lineTo(u,y),n.lineTo(u,M))};for(l&&(g=s[v(0)],n.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[v(f)],g.skip)continue;const S=g.x,T=g.y,R=S|0;R===p?(T<y?y=T:T>x&&(x=T),u=(d*u+S)/++d):(D(),n.lineTo(S,T),p=R,d=0,y=x=T),M=T}D()}function Ko(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Wy:Hy}function Yy(n){return n.stepped?jp:n.tension||n.cubicInterpolationMode==="monotone"?Vp:Vn}function jy(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Nu(n,t.options),n.stroke(s)}function Vy(n,t,e,i){const{segments:s,options:r}=t,o=Ko(t);for(const a of s)Nu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const $y=typeof Path2D=="function";function Uy(n,t,e,i){$y&&!t.options.segment?jy(n,t,e,i):Vy(n,t,e,i)}class Dn extends Qt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Lp(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Kp(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=Xc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Yy(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],g=r[d],p=r[f];if(g===p){a.push(g);continue}const y=Math.abs((s-g[e])/(p[e]-g[e])),x=l(g,p,y,i.stepped);x[e]=t[e],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Ko(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=Ko(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Uy(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}O(Dn,"id","line"),O(Dn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),O(Dn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),O(Dn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function zu(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class xr extends Qt{constructor(e){super();O(this,"parsed");O(this,"skip");O(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return zu(this,e,"x",i)}inYRange(e,i){return zu(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!en(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Oo(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}O(xr,"id","point"),O(xr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),O(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Bu(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return n.horizontal?(d=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,a=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function Sn(n,t,e,i){return n?0:Zt(t,e,i)}function Xy(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Ec(i);return{t:Sn(s.top,r.top,0,e),r:Sn(s.right,r.right,0,t),b:Sn(s.bottom,r.bottom,0,e),l:Sn(s.left,r.left,0,t)}}function qy(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=vn(s),o=Math.min(t,e),a=n.borderSkipped,l=i||ct(s);return{topLeft:Sn(!l||a.top||a.left,r.topLeft,0,o),topRight:Sn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Sn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Sn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Gy(n){const t=Bu(n),e=t.right-t.left,i=t.bottom-t.top,s=Xy(n,e/2,i/2),r=qy(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function Zo(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Bu(n,i);return a&&(s||Je(t,a.left,a.right))&&(r||Je(e,a.top,a.bottom))}function Ky(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Zy(n,t){n.rect(t.x,t.y,t.w,t.h)}function Qo(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class wr extends Qt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=Gy(this),a=Ky(o.radius)?fi:Zy;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,Qo(o,e,r)),t.clip(),a(t,Qo(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Qo(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Zo(this,t,e,i)}inXRange(t,e){return Zo(this,t,null,e)}inYRange(t,e){return Zo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}O(wr,"id","bar"),O(wr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),O(wr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Qy=Object.freeze({__proto__:null,ArcElement:ds,BarElement:wr,LineElement:Dn,PointElement:xr});const Jo=["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)"],Hu=Jo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Wu(n){return Jo[n%Jo.length]}function Yu(n){return Hu[n%Hu.length]}function Jy(n,t){return n.borderColor=Wu(t),n.backgroundColor=Yu(t),++t}function tb(n,t){return n.backgroundColor=n.data.map(()=>Wu(t++)),t}function eb(n,t){return n.backgroundColor=n.data.map(()=>Yu(t++)),t}function nb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof sn?t=tb(e,t):s instanceof is?t=eb(e,t):s&&(t=Jy(e,t))}}function ju(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function ib(n){return n&&(n.borderColor||n.backgroundColor)}function sb(){return Et.borderColor!=="rgba(0,0,0,0.1)"||Et.backgroundColor!=="rgba(0,0,0,0.1)"}var rb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,o=ju(i)||ib(s)||r&&ju(r)||sb();if(!e.forceOverride&&o)return;const a=nb(n);i.forEach(a)}};function ob(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,f,g,p,y;for(o[l++]=n[u],d=0;d<r-2;d++){let x=0,M=0,v;const D=Math.floor((d+1)*a)+1+t,S=Math.min(Math.floor((d+2)*a)+1,e)+t,T=S-D;for(v=D;v<S;v++)x+=n[v].x,M+=n[v].y;x/=T,M/=T;const R=Math.floor(d*a)+1+t,E=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:_,y:b}=n[u];for(g=p=-1,v=R;v<E;v++)p=.5*Math.abs((_-x)*(n[v].y-b)-(_-n[v].x)*(M-b)),p>g&&(g=p,f=n[v],y=v);o[l++]=f,u=y}return o[l++]=n[c],o}function ab(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,f,g,p,y;const x=[],M=t+e-1,v=n[t].x,S=n[M].x-v;for(o=t;o<t+e;++o){a=n[o],l=(a.x-v)/S*i,c=a.y;const T=l|0;if(T===u)c<p?(p=c,d=o):c>y&&(y=c,f=o),s=(r*s+a.x)/++r;else{const R=o-1;if(!rt(d)&&!rt(f)){const E=Math.min(d,f),_=Math.max(d,f);E!==g&&E!==R&&x.push({...n[E],x:s}),_!==g&&_!==R&&x.push({...n[_],x:s})}o>0&&R!==g&&x.push(n[R]),x.push(a),u=T,r=0,p=y=c,d=f=g=o}}return x}function Vu(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 $u(n){n.data.datasets.forEach(t=>{Vu(t)})}function lb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Zt(tn(t,r.axis,o).lo,0,e-1)),c?s=Zt(tn(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var cb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){$u(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Ji([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:f}=lb(l,c);const g=e.threshold||4*i;if(f<=g){Vu(s);return}rt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(e.algorithm){case"lttb":p=ob(c,d,f,i,e);break;case"min-max":p=ab(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){$u(n)}};function ub(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=ea(l,c,s);const u=ta(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=Xc(t,u);for(const f of d){const g=ta(e,r[f.start],r[f.end],f.loop),p=Uc(a,s,g);for(const y of p)o.push({source:y,target:f,start:{[e]:Uu(u,g,"start",Math.max)},end:{[e]:Uu(u,g,"end",Math.min)}})}}return o}function ta(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=ke(s),r=ke(r)),{property:n,start:s,end:r}}function db(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=ea(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function ea(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Uu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Xu(n,t){let e=[],i=!1;return Mt(n)?(i=!0,e=n):e=db(n,t),e.length?new Dn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function qu(n){return n&&n.fill!==!1}function hb(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Rt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function fb(n,t,e){const i=yb(n);if(ct(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?gb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function gb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function pb(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ct(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function mb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ct(n)?i=n.value:i=t.getBaseValue(),i}function yb(n){const t=n.options,e=t.fill;let i=it(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function bb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=_b(t,e);a.push(Xu({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)xb(s,o[u],a)}return new Dn({points:s,options:{}})}function _b(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function xb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=wb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function wb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=o[u.start][e],f=o[u.end][e];if(Je(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:i}}class Gu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:Ct},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function vb(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return Mb(t,e);if(e==="stack")return bb(n);if(e==="shape")return!0;const s=kb(n);return s instanceof Gu?s:Xu(s,i)}function Mb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function kb(n){return(n.scale||{}).getPointPositionForValue?Sb(n):Db(n)}function Db(n){const{scale:t={},fill:e}=n,i=pb(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Sb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=mb(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new Gu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function na(n,t,e){const i=vb(t),{line:s,scale:r,axis:o}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};i&&s.points.length&&(Zi(n,e),Tb(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:o}),Qi(n))}function Tb(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&r!==s&&(Ku(n,i,o.top),Zu(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),Ku(n,i,o.bottom)),Zu(n,{line:e,target:i,color:r,scale:a,property:l}),n.restore()}function Ku(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[ea(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Zu(n,t){const{line:e,target:i,property:s,color:r,scale:o}=t,a=ub(e,i,s);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:f=r}={}}=l,g=i!==!0;n.save(),n.fillStyle=f,Cb(n,o,g&&ta(s,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let y;if(g){p?n.closePath():Qu(n,i,d,s);const x=!!i.pathSegment(n,c,{move:p,reverse:!0});y=p&&x,y||Qu(n,i,u,s)}n.closePath(),n.fill(y?"evenodd":"nonzero"),n.restore()}}function Cb(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(n.beginPath(),n.rect(o,i,a-o,s-i),n.clip())}function Qu(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Pb={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof Dn&&(l={visible:n.isDatasetVisible(o),index:o,fill:fb(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=hb(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&na(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;qu(r)&&na(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!qu(i)||e.drawTime!=="beforeDatasetDraw"||na(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ju=(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)}},Ob=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class td extends Qt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=kt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=It(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Ju(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((p,y)=>{const x=i+e/2+r.measureText(p.text).width;(y===0||c[c.length-1]+x+2*a>o)&&(d+=u,c[c.length-(y>0?0:1)]=0,g+=u,f++),l[y]={left:0,top:g,row:f,width:x,height:s},c[c.length-1]+=x+a}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,g=0,p=0,y=0;return this.legendItems.forEach((x,M)=>{const{itemWidth:v,itemHeight:D}=Eb(i,e,r,x,s);M>0&&g+D+2*a>u&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,y++,f=g=0),l[M]={left:p,top:g,col:y,width:v,height:D},f=Math.max(f,v),g+=D+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=mi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=ie(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ie(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Zi(t,this),this._draw(),Qi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=Et.color,l=mi(t.rtl,this.left,this.width),c=It(o.font),{padding:u}=o,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:x}=Ju(o,d),M=function(R,E,_){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const b=it(_.lineWidth,1);if(s.fillStyle=it(_.fillStyle,a),s.lineCap=it(_.lineCap,"butt"),s.lineDashOffset=it(_.lineDashOffset,0),s.lineJoin=it(_.lineJoin,"miter"),s.lineWidth=b,s.strokeStyle=it(_.strokeStyle,a),s.setLineDash(it(_.lineDash,[])),o.usePointStyle){const P={radius:y*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:b},I=l.xPlus(R,p/2),C=E+f;Oc(s,P,I,C,o.pointStyleWidth&&p)}else{const P=E+Math.max((d-y)/2,0),I=l.leftForLtr(R,p),C=vn(_.borderRadius);s.beginPath(),Object.values(C).some(N=>N!==0)?fi(s,{x:I,y:P,w:p,h:y,radius:C}):s.rect(I,P,p,y),s.fill(),b!==0&&s.stroke()}s.restore()},v=function(R,E,_){Yn(s,_.text,R,E+x/2,c,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},D=this.isHorizontal(),S=this._computeTitleHeight();D?g={x:ie(r,this.left+u,this.right-i[0]),y:this.top+u+S,line:0}:g={x:this.left+u,y:ie(r,this.top+S+u,this.bottom-e[0].height),line:0},Yc(this.ctx,t.textDirection);const T=x+u;this.legendItems.forEach((R,E)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const _=s.measureText(R.text).width,b=l.textAlign(R.textAlign||(R.textAlign=o.textAlign)),P=p+f+_;let I=g.x,C=g.y;l.setWidth(this.width),D?E>0&&I+P+u>this.right&&(C=g.y+=T,g.line++,I=g.x=ie(r,this.left+u,this.right-i[g.line])):E>0&&C+T>this.bottom&&(I=g.x=I+e[g.line].width+u,g.line++,C=g.y=ie(r,this.top+S+u,this.bottom-e[g.line].height));const N=l.x(I);if(M(N,C,R),I=Jg(b,I+p+f,D?I+P:this.right,t.rtl),v(l.x(I),C,R),D)g.x+=P+u;else if(typeof R.text!="string"){const j=c.lineHeight;g.y+=ed(R,j)+u}else g.y+=T}),jc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=It(e.font),s=Xt(e.padding);if(!e.display)return;const r=mi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=ie(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);u=c+ie(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=ie(a,d,d+f);o.textAlign=r.textAlign(Do(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Yn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=It(t.font),i=Xt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Je(t,this.left,this.right)&&Je(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Je(t,s.left,s.left+s.width)&&Je(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Ib(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=Ob(s,i);s&&!r&&kt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&kt(e.onHover,[t,i,this],this)}else i&&kt(e.onClick,[t,i,this],this)}}function Eb(n,t,e,i,s){const r=Ab(i,n,t,e),o=Rb(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Ab(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function Rb(n,t,e){let i=n;return typeof t.text!="string"&&(i=ed(t,e)),i}function ed(n,t){const e=n.text?n.text.length:0;return t*e}function Ib(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Lb={id:"legend",_element:td,start(n,t,e){const i=n.legend=new td({ctx:n.ctx,options:e,chart:n});se.configure(n,i,e),se.addBox(n,i)},stop(n){se.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;se.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Xt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ia extends Qt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=Mt(i.text)?i.text.length:1;this._padding=Xt(i.padding);const r=s*It(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=ie(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=ie(a,s,e),l=pt*-.5):(u=r-t,d=ie(a,e,s),l=pt*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Yn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Do(e.align),textBaseline:"middle",translation:[o,a]})}}function Nb(n,t){const e=new ia({ctx:n.ctx,options:t,chart:n});se.configure(n,e,t),se.addBox(n,e),n.titleBlock=e}var Fb={id:"title",_element:ia,start(n,t,e){Nb(n,e)},stop(n){const t=n.titleBlock;se.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;se.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 vr=new WeakMap;var zb={id:"subtitle",start(n,t,e){const i=new ia({ctx:n.ctx,options:e,chart:n});se.configure(n,i,e),se.addBox(n,i),vr.set(n,i)},stop(n){se.removeBox(n,vr.get(n)),vr.delete(n)},beforeUpdate(n,t,e){const i=vr.get(n);se.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const hs={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=hi(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ve(n,t){return t&&(Mt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function rn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
16
|
+
*/class Jp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=wc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var nn=new Jp;const Zc="transparent",tm={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Tc(n||Zc),s=i.valid&&Tc(t||Zc);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class em{constructor(t,e,i,s){const r=e[i];s=Ji([t.to,s,r,t.from]);const o=Ji([t.from,r,s]);this._active=!0,this._fn=t.fn||tm[t.type||typeof o],this._easing=qi[t.easing]||qi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ji([t.to,e,s,t.from]),this._from=Ji([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Fo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ut(t))return;const e=Object.keys(Et.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ut(r))return;const o={};for(const a of e)o[a]=r[a];(Mt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=im(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&nm(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=d=new em(f,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return nn.add(this._chart,i),!0}}function nm(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function im(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 Qc(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function sm(n,t,e){if(e===!1)return!1;const i=Qc(n,e),s=Qc(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function rm(n){let t,e,i,s;return ut(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function Jc(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function tu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||Ye(t)===Ye(c))&&(t+=c)}return t}}function om(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function zo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function am(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function lm(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function cm(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function eu(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function nu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=am(r,o,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:y,[c]:x}=p,M=p._stacks||(p._stacks={});f=M[c]=cm(s,u,y),f[a]=x,f._top=eu(f,o,!0,i.type),f._bottom=eu(f,o,!1,i.type);const v=f._visualValues||(f._visualValues={});v[a]=x}}function Bo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function um(n,t){return Mn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function dm(n,t,e){return Mn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ts(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const Ho=n=>n==="reset"||n==="none",iu=(n,t)=>t?n:Object.assign({},n),hm=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Jc(e,!0),values:null};class Fe{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=zo(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ts(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,r=e.xAxisID=it(i.xAxisID,Bo(t,"x")),o=e.yAxisID=it(i.yAxisID,Bo(t,"y")),a=e.rAxisID=it(i.rAxisID,Bo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_c(this._data,this),t._stacked&&ts(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ut(e)){const s=this._cachedMeta;this._data=om(e,s)}else if(i!==e){if(i){_c(i,this);const s=this._cachedMeta;ts(s),s._parsed=[]}e&&Object.isExtensible(e)&&Zg(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=zo(e.vScale,e),e.stack!==i.stack&&(s=!0,ts(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(nu(this,e._parsed),e._stacked=zo(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{Mt(s[t])?f=this.parseArrayData(i,s,t,e):ut(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&nu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,d=new Array(s);let f,g,p;for(f=0,g=s;f<g;++f)p=f+i,d[f]={[a]:u||r.parse(c[p],p),[l]:o.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,f,g;for(u=0,d=s;u<d;++u)f=u+i,g=e[f],c[u]={x:r.parse(_n(g,a),f),y:o.parse(_n(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:Jc(s,!0),values:e._stacks[t.axis]._visualValues};return tu(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=tu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=hm(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=lm(a);let f,g;function p(){g=s[f];const y=g[a.axis];return!Rt(g[t.axis])||u>y||d<y}for(f=0;f<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++f);if(r){for(f=o-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Rt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=rm(it(this.options.clip,sm(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const d=s[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=dm(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=um(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&ge(i);if(a)return iu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Et.elements[t]),p=()=>this.getContext(i,s,e),y=c.resolveNamedOptions(f,g,p,d);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(iu(y,l))),y}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Fo(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ho(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){Ho(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ho(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&ts(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(Fe,"defaults",{}),P(Fe,"datasetElementType",null),P(Fe,"dataElementType",null);function fm(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=xc(i.sort((s,r)=>s-r))}return n._cache.$bar}function gm(n){const t=n.iScale,e=fm(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(ge(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function pm(n,t,e,i){const s=e.barThickness;let r,o;return ot(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function mm(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function ym(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function su(n,t,e,i){return Mt(n)?ym(n,t,e,i):t[e.axis]=e.parse(n,i),t}function ru(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(su(f,d,r,c));return l}function Wo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function bm(n,t,e){return n!==0?Ye(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function _m(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function xm(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=_m(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[ou(u,o,a,l)]=!0,s=c)),r[ou(s,o,a,l)]=!0,n.borderSkipped=r}function ou(n,t,e,i){return i?(n=wm(n,t,e),n=au(n,e,t)):n=au(n,t,e),n}function wm(n,t,e){return n===t?e:n===e?t:n}function au(n,t,e){return n==="start"?t:n==="end"?e:n}function vm(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class es extends Fe{parsePrimitiveData(t,e,i,s){return ru(t,e,i,s)}parseArrayData(t,e,i,s){return ru(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let f,g,p,y;for(f=i,g=i+s;f<g;++f)y=e[f],p={},p[r.axis]=r.parse(_n(y,c),f),d.push(su(_n(y,u),p,o,f));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Wo(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),y=r||ot(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,u),M=(p._stacks||{})[a.axis],v={horizontal:c,base:y.base,enableBorderRadius:!M||Wo(p._custom)||o===M._top||o===M._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};f&&(v.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const D=v.options||t[g].options;xm(v,D,M,o),vm(v,D,u.ratio),this.updateElement(t[g],g,v,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),f=d&&d[u.vScale.axis];if(ot(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||gm(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Wo(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,y;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Ye(d)!==Ye(c.barEnd)&&(f=0),f+=d);const x=!ot(r)&&!u?r:f;let M=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=M,y=p-M,Math.abs(y)<o){y=bm(y,e,a)*o,d===a&&(M-=y/2);const v=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),S=Math.min(v,D),T=Math.max(v,D);M=Math.max(Math.min(M,T),S),p=M+y,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(M))}if(M===e.getPixelForValue(a)){const v=Ye(y)*e.getLineWidthForValue(a)/2;M+=v,y-=v}return{size:y,base:M,head:p,center:p+y/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=it(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?mm(t,e,s,c):pm(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}P(es,"id","bar"),P(es,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(es,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class lr extends Fe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=it(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=it(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,d=a.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!r&&this.getParsed(f),y={},x=y[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),M=y[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);y.skip=isNaN(x)||isNaN(M),c&&(y.options=l||this.resolveDataElementOptions(f,g.active?"active":s),r&&(y.options.radius=0)),this.updateElement(g,f,y,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=it(i&&i._custom,r),s}}P(lr,"id","bubble"),P(lr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(lr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Mm(n,t,e){let i=1,s=1,r=0,o=0;if(t<Ct){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(D,S,T)=>Xi(D,a,l,!0)?1:Math.max(S,S*e,T,T*e),p=(D,S,T)=>Xi(D,a,l,!0)?-1:Math.min(S,S*e,T,T*e),y=g(0,c,d),x=g(Ot,u,f),M=p(pt,c,d),v=p(pt+Ot,u,f);i=(y-M)/2,s=(x-v)/2,r=-(y+M)/2,o=-(x+v)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class sn extends Fe{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ut(i[t])){const{key:l="value"}=this._parsing;r=c=>+_n(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Ut(this.options.rotation-90)}_getCircumference(){return Ut(this.options.circumference)}_getRotationExtents(){let t=Ct,e=-Ct;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(zg(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:y}=Mm(d,u,l),x=(i.width-o)/f,M=(i.height-o)/g,v=Math.max(Math.min(x,M)/2,0),D=dc(this.options.radius,v),S=Math.max(D*l,0),T=(D-S)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=y*D,s.total=this.calculateTotal(),this.outerRadius=D-T*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-T*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Ct)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=r&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(e,s);let M=this._getRotation(),v;for(v=0;v<e;++v)M+=this._circumference(v,r);for(v=e;v<e+i;++v){const D=this._circumference(v,r),S=t[v],T={x:u+this.offsetX,y:d+this.offsetY,startAngle:M,endAngle:M+D,circumference:D,outerRadius:p,innerRadius:g};x&&(T.options=y||this.resolveDataElementOptions(v,S.active?"active":s)),M+=D,this.updateElement(S,v,T,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ct*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(it(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(sn,"id","doughnut"),P(sn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),P(sn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(sn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ns extends Fe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=Mc(e,s,o);this._drawStart=a,this._drawCount=l,kc(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),f=o.axis,g=a.axis,{spanGaps:p,segment:y}=this.options,x=wn(p)?p:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none",v=e+i,D=t.length;let S=e>0&&this.getParsed(e-1);for(let T=0;T<D;++T){const A=t[T],O=M?A:{};if(T<e||T>=v){O.skip=!0;continue}const _=this.getParsed(T),b=ot(_[g]),C=O[f]=o.getPixelForValue(_[f],T),R=O[g]=r||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[g],T);O.skip=isNaN(C)||isNaN(R)||b,O.stop=T>0&&Math.abs(_[f]-S[f])>x,y&&(O.parsed=_,O.raw=c.data[T]),d&&(O.options=u||this.resolveDataElementOptions(T,A.active?"active":s)),M||this.updateElement(A,T,O,s),S=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(ns,"id","line"),P(ns,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(ns,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class is extends Fe{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return Bc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*pt;let g=f,p;const y=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,y);for(p=e;p<e+i;p++){const x=t[p];let M=g,v=g+this._computeAngle(p,s,y),D=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=v,r&&(l.animateScale&&(D=0),l.animateRotate&&(M=v=f));const S={x:u,y:d,innerRadius:0,outerRadius:D,startAngle:M,endAngle:v,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,S,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Ut(this.resolveDataElementOptions(t,e).angle||i):0}}P(is,"id","polarArea"),P(is,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(is,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Yo extends sn{}P(Yo,"id","pie"),P(Yo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class cr extends Fe{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Bc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),d=o?r.xCenter:u.x,f=o?r.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,g,s)}}}P(cr,"id","radar"),P(cr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(cr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ur extends Fe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=Mc(e,i,s);if(this._drawStart=r,this._drawCount=o,kc(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),f=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:y,segment:x}=this.options,M=wn(y)?y:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let S=e;S<e+i;++S){const T=t[S],A=this.getParsed(S),O=v?T:{},_=ot(A[p]),b=O[g]=o.getPixelForValue(A[g],S),C=O[p]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[p],S);O.skip=isNaN(b)||isNaN(C)||_,O.stop=S>0&&Math.abs(A[g]-D[g])>M,x&&(O.parsed=A,O.raw=c.data[S]),f&&(O.options=d||this.resolveDataElementOptions(S,T.active?"active":s)),v||this.updateElement(T,S,O,s),D=A}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}P(ur,"id","scatter"),P(ur,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(ur,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var km=Object.freeze({__proto__:null,BarController:es,BubbleController:lr,DoughnutController:sn,LineController:ns,PieController:Yo,PolarAreaController:is,RadarController:cr,ScatterController:ur});function $n(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class jo{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(jo.prototype,t)}init(){}formats(){return $n()}parse(){return $n()}format(){return $n()}add(){return $n()}diff(){return $n()}startOf(){return $n()}endOf(){return $n()}}var lu={_date:jo};function Dm(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?Gg:tn;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,e-u),f=l(r,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function ss(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:d,hi:f}=Dm(r[a],t,o,s);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Sm(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Vo(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||ss(n,e,t,function(a,l,c){!s&&!en(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Tm(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=tr(o,{x:t.x,y:t.y});Xi(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return ss(n,e,t,r),s}function Cm(n,t,e,i,s,r){let o=[];const a=Sm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;const x=a(t,p);x<l?(o=[{element:u,datasetIndex:d,index:f}],l=x):x===l&&o.push({element:u,datasetIndex:d,index:f})}return ss(n,e,t,c),o}function $o(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?Tm(n,t,e,s):Cm(n,t,e,i,s,r)}function cu(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return ss(n,e,t,(l,c,u)=>{l[o]&&l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Uo={evaluateInteractionItems:ss,modes:{index(n,t,e,i){const s=kn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Vo(n,s,r,i,o):$o(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=kn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Vo(n,s,r,i,o):$o(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=kn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Vo(n,s,r,i,o)},nearest(n,t,e,i){const s=kn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return $o(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=kn(t,n);return cu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=kn(t,n);return cu(n,s,"y",e.intersect,i)}}};const uu=["left","top","right","bottom"];function rs(n,t){return n.filter(e=>e.pos===t)}function du(n,t){return n.filter(e=>uu.indexOf(e.pos)===-1&&e.box.axis===t)}function os(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function Pm(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function Om(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!uu.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function Em(n,t){const e=Om(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function Am(n){const t=Pm(n),e=os(t.filter(c=>c.box.fullSize),!0),i=os(rs(t,"left"),!0),s=os(rs(t,"right")),r=os(rs(t,"top"),!0),o=os(rs(t,"bottom")),a=du(t,"x"),l=du(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:rs(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function hu(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function fu(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 Rm(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!ut(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&fu(o,r.getPadding());const a=Math.max(0,t.outerWidth-hu(o,n,"left","right")),l=Math.max(0,t.outerHeight-hu(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Im(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Lm(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function as(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Lm(a.horizontal,t));const{same:d,other:f}=Rm(t,e,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&as(s,t,e,i)||u}function dr(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function gu(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;ge(c.start)&&(o=c.start),l.fullSize?dr(l,s.left,o,e.outerWidth-s.right-s.left,f):dr(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;ge(c.start)&&(r=c.start),l.fullSize?dr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):dr(l,r,t.top+c.placed,f,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var se={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=Xt(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Am(n.boxes),l=a.vertical,c=a.horizontal;Dt(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);fu(f,Xt(i));const g=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),p=Em(l.concat(c),d);as(a.fullSize,g,d,p),as(l,g,d,p),as(c,g,d,p)&&as(l,g,d,p),Im(g),gu(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,gu(a.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Dt(a.chartArea,y=>{const x=y.box;Object.assign(x,n.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class pu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Nm extends pu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const hr="$chartjs",Fm={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mu=n=>n===null||n==="";function zm(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[hr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",mu(s)){const r=Yc(n,"width");r!==void 0&&(n.width=r)}if(mu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=Yc(n,"height");r!==void 0&&(n.height=r)}return n}const yu=Yp?{passive:!0}:!1;function Bm(n,t,e){n&&n.addEventListener(t,e,yu)}function Hm(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,yu)}function Wm(n,t){const e=Fm[n.type]||n.type,{x:i,y:s}=kn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function fr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Ym(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||fr(a.addedNodes,i),o=o&&!fr(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function jm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||fr(a.removedNodes,i),o=o&&!fr(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ls=new Map;let bu=0;function _u(){const n=window.devicePixelRatio;n!==bu&&(bu=n,ls.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Vm(n,t){ls.size||window.addEventListener("resize",_u),ls.set(n,t)}function $m(n){ls.delete(n),ls.size||window.removeEventListener("resize",_u)}function Um(n,t,e){const i=n.canvas,s=i&&No(i);if(!s)return;const r=vc((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),Vm(n,r),o}function Xo(n,t,e){e&&e.disconnect(),t==="resize"&&$m(n)}function Xm(n,t,e){const i=n.canvas,s=vc(r=>{n.ctx!==null&&e(Wm(r,n))},n);return Bm(i,t,s),s}class qm extends pu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(zm(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[hr])return!1;const i=e[hr].initial;["height","width"].forEach(r=>{const o=i[r];ot(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[hr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Ym,detach:jm,resize:Um}[e]||Xm;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Xo,detach:Xo,resize:Xo}[e]||Hm)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Wp(t,e,i,s)}isAttached(t){const e=t&&No(t);return!!(e&&e.isConnected)}}function Gm(n){return!Lo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Nm:qm}class Qt{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return wn(this.x)&&wn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}P(Qt,"defaults",{}),P(Qt,"defaultRoutes");function Km(n,t){const e=n.options.ticks,i=Zm(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Jm(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return ty(t,c,r,o/s),c;const u=Qm(r,t,s);if(o>0){let d,f;const g=o>1?Math.round((l-a)/(o-1)):null;for(gr(t,c,u,ot(g)?0:a-g,a),d=0,f=o-1;d<f;d++)gr(t,c,u,r[d],r[d+1]);return gr(t,c,u,l,ot(g)?t.length:l+g),c}return gr(t,c,u),c}function Zm(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Qm(n,t,e){const i=ey(n),s=t.length/e;if(!i)return Math.max(s,1);const r=$g(i);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function Jm(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function ty(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function gr(n,t,e,i,s){const r=it(i,0),o=Math.min(it(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function ey(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 ny=n=>n==="left"?"right":n==="right"?"left":n,xu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,wu=(n,t)=>Math.min(t||n,n);function vu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function iy(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function sy(n,t){Dt(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function cs(n){return n.drawTicks?n.tickLength:0}function Mu(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Xt(n.padding);return(Mt(n.text)?n.text.length:1)*e.lineHeight+i.height}function ry(n,t){return Mn(n,{scale:t,type:"scale"})}function oy(n,t,e){return Mn(n,{tick:e,index:t,type:"tick"})}function ay(n,t,e){let i=Do(n);return(e&&t!=="right"||!e&&t==="right")&&(i=ny(i)),i}function ly(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const y=o-s,x=a-r;if(n.isHorizontal()){if(g=ie(i,r,a),ut(e)){const M=Object.keys(e)[0],v=e[M];p=u[M].getPixelForValue(v)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=xu(n,e,t);f=a-r}else{if(ut(e)){const M=Object.keys(e)[0],v=e[M];g=u[M].getPixelForValue(v)-x+t}else e==="center"?g=(c.left+c.right)/2-x+t:g=xu(n,e,t);p=ie(i,o,s),d=e==="left"?-Ot:Ot}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class Un extends Qt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=Me(t,Number.POSITIVE_INFINITY),e=Me(e,Number.NEGATIVE_INFINITY),i=Me(i,Number.POSITIVE_INFINITY),s=Me(s,Number.NEGATIVE_INFINITY),{min:Me(t,i),max:Me(e,s),minDefined:Rt(t),maxDefined:Rt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Me(e,Me(i,e)),max:Me(i,Me(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){kt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_p(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?vu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Km(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){kt(this.options.afterUpdate,[this])}beforeSetDimensions(){kt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){kt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),kt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){kt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=kt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){kt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){kt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=wu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Zt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),d+6>a&&(a=g/(i-(t.offset?.5:1)),l=this.maxHeight-cs(t.grid)-e.padding-Mu(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Js(Math.min(Math.asin(Zt((u.highest.height+6)/a,-1,1)),Math.asin(Zt(l/c,-1,1))-Math.asin(Zt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){kt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){kt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Mu(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=cs(r)+l):(t.height=this.maxHeight,t.width=cs(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=i.padding*2,p=Ut(this.labelRotation),y=Math.cos(p),x=Math.sin(p);if(a){const M=i.mirror?0:x*d.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+M+g)}else{const M=i.mirror?0:y*d.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+M+g)}this._calculatePadding(c,u,x,y)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*t.width,g=i*e.height):(f=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+o)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){kt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)ot(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=vu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/wu(e,i));let c=0,u=0,d,f,g,p,y,x,M,v,D,S,T;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),s.font=x=y.string,M=r[x]=r[x]||{data:{},gc:[]},v=y.lineHeight,D=S=0,!ot(p)&&!Mt(p))D=ir(s,M.data,M.gc,D,p),S=v;else if(Mt(p))for(f=0,g=p.length;f<g;++f)T=p[f],!ot(T)&&!Mt(T)&&(D=ir(s,M.data,M.gc,D,T),S+=v);o.push(D),a.push(S),c=Math.max(D,c),u=Math.max(S,u)}sy(r,e);const A=o.indexOf(c),O=a.indexOf(u),_=b=>({width:o[b]||0,height:a[b]||0});return{first:_(0),last:_(e-1),widest:_(A),highest:_(O),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return qg(this._alignToPixels?Wn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=oy(this.getContext(),t,i))}return this.$context||(this.$context=ry(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ut(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=cs(r),g=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,x=y/2,M=function(U){return Wn(i,U,y)};let v,D,S,T,A,O,_,b,C,R,I,Y;if(o==="top")v=M(this.bottom),O=this.bottom-f,b=v-x,R=M(t.top)+x,Y=t.bottom;else if(o==="bottom")v=M(this.top),R=t.top,Y=M(t.bottom)-x,O=v+x,b=this.top+f;else if(o==="left")v=M(this.right),A=this.right-f,_=v-x,C=M(t.left)+x,I=t.right;else if(o==="right")v=M(this.left),C=t.left,I=M(t.right)-x,A=v+x,_=this.left+f;else if(e==="x"){if(o==="center")v=M((t.top+t.bottom)/2+.5);else if(ut(o)){const U=Object.keys(o)[0],H=o[U];v=M(this.chart.scales[U].getPixelForValue(H))}R=t.top,Y=t.bottom,O=v+x,b=O+f}else if(e==="y"){if(o==="center")v=M((t.left+t.right)/2);else if(ut(o)){const U=Object.keys(o)[0],H=o[U];v=M(this.chart.scales[U].getPixelForValue(H))}A=v-x,_=A-f,C=t.left,I=t.right}const L=it(s.ticks.maxTicksLimit,d),W=Math.max(1,Math.ceil(d/L));for(D=0;D<d;D+=W){const U=this.getContext(D),H=r.setContext(U),st=a.setContext(U),$=H.lineWidth,tt=H.color,X=st.dash||[],B=st.dashOffset,Q=H.tickWidth,wt=H.tickColor,dt=H.tickBorderDash||[],vt=H.tickBorderDashOffset;S=iy(this,D,l),S!==void 0&&(T=Wn(i,S,$),c?A=_=C=I=T:O=b=R=Y=T,g.push({tx1:A,ty1:O,tx2:_,ty2:b,x1:C,y1:R,x2:I,y2:Y,width:$,color:tt,borderDash:X,borderDashOffset:B,tickWidth:Q,tickColor:wt,tickBorderDash:dt,tickBorderDashOffset:vt}))}return this._ticksLength=d,this._borderValue=v,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,f=cs(i.grid),g=f+u,p=d?-u:g,y=-Ut(this.labelRotation),x=[];let M,v,D,S,T,A,O,_,b,C,R,I,Y="middle";if(s==="top")A=this.bottom-p,O=this._getXAxisLabelAlignment();else if(s==="bottom")A=this.top+p,O=this._getXAxisLabelAlignment();else if(s==="left"){const W=this._getYAxisLabelAlignment(f);O=W.textAlign,T=W.x}else if(s==="right"){const W=this._getYAxisLabelAlignment(f);O=W.textAlign,T=W.x}else if(e==="x"){if(s==="center")A=(t.top+t.bottom)/2+g;else if(ut(s)){const W=Object.keys(s)[0],U=s[W];A=this.chart.scales[W].getPixelForValue(U)+g}O=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")T=(t.left+t.right)/2-g;else if(ut(s)){const W=Object.keys(s)[0],U=s[W];T=this.chart.scales[W].getPixelForValue(U)}O=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?Y="top":l==="end"&&(Y="bottom"));const L=this._getLabelSizes();for(M=0,v=a.length;M<v;++M){D=a[M],S=D.label;const W=r.setContext(this.getContext(M));_=this.getPixelForTick(M)+r.labelOffset,b=this._resolveTickFontOptions(M),C=b.lineHeight,R=Mt(S)?S.length:1;const U=R/2,H=W.color,st=W.textStrokeColor,$=W.textStrokeWidth;let tt=O;o?(T=_,O==="inner"&&(M===v-1?tt=this.options.reverse?"left":"right":M===0?tt=this.options.reverse?"right":"left":tt="center"),s==="top"?c==="near"||y!==0?I=-R*C+C/2:c==="center"?I=-L.highest.height/2-U*C+C:I=-L.highest.height+C/2:c==="near"||y!==0?I=C/2:c==="center"?I=L.highest.height/2-U*C:I=L.highest.height-R*C,d&&(I*=-1),y!==0&&!W.showLabelBackdrop&&(T+=C/2*Math.sin(y))):(A=_,I=(1-R)*C/2);let X;if(W.showLabelBackdrop){const B=Xt(W.backdropPadding),Q=L.heights[M],wt=L.widths[M];let dt=I-B.top,vt=0-B.left;switch(Y){case"middle":dt-=Q/2;break;case"bottom":dt-=Q;break}switch(O){case"center":vt-=wt/2;break;case"right":vt-=wt;break;case"inner":M===v-1?vt-=wt:M>0&&(vt-=wt/2);break}X={left:vt,top:dt,width:wt+B.width,height:Q+B.height,color:W.backdropColor}}x.push({label:S,font:b,textOffset:I,options:{rotation:y,color:H,strokeColor:st,strokeWidth:$,textAlign:tt,textBaseline:Y,translation:[T,A],backdrop:X}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ut(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=Wn(t,this.left,o)-o/2,u=Wn(t,this.right,a)+a/2,d=f=l):(d=Wn(t,this.top,o)-o/2,f=Wn(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Zi(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Yn(i,c,0,u,l,a)}s&&Qi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=It(i.font),o=Xt(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ut(e)?(l+=o.bottom,Mt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=ly(this,l,e,a);Yn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:f,textAlign:ay(a,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=it(t.grid&&t.grid.z,-1),s=it(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Un.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return It(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class pr{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;dy(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,cy(t,o,i),this.override&&Et.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Et[s]&&(delete Et[s][i],this.override&&delete Hn[i])}}function cy(n,t,e){const i=Vi(Object.create(null),[e?Et.get(e):{},Et.get(t),n.defaults]);Et.set(t,i),n.defaultRoutes&&uy(t,n.defaultRoutes),n.descriptors&&Et.describe(t,n.descriptors)}function uy(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");Et.route(r,s,l,a)})}function dy(n){return"id"in n&&"defaults"in n}class hy{constructor(){this.controllers=new pr(Fe,"datasets",!0),this.elements=new pr(Qt,"elements"),this.plugins=new pr(Object,"plugins"),this.scales=new pr(Un,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Dt(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=vo(t);kt(i["before"+s],[],i),e[t](i),kt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var je=new hy;class fy{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(kt(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){ot(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=it(i.options&&i.options.plugins,{}),r=gy(i);return s===!1&&!e?[]:my(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function gy(n){const t={},e=[],i=Object.keys(je.plugins.items);for(let r=0;r<i.length;r++)e.push(je.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function py(n,t){return!t&&n===!1?null:n===!0?{}:n}function my(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=py(i[l],s);c!==null&&r.push({plugin:a,options:yy(n.config,{plugin:a,local:e[l]},c,o)})}return r}function yy(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function qo(n,t){const e=Et.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function by(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function _y(n,t){return n===t?"_index_":"_value_"}function ku(n){if(n==="x"||n==="y"||n==="r")return n}function xy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Go(n,...t){if(ku(n))return n;for(const e of t){const i=e.axis||xy(e.position)||n.length>1&&ku(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Du(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function wy(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 Du(n,"x",e[0])||Du(n,"y",e[0])}return{}}function vy(n,t){const e=Hn[n.type]||{scales:{}},i=t.scales||{},s=qo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!ut(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Go(o,a,wy(o,n),Et.scales[a.type]),c=_y(l,s),u=e.scales||{};r[o]=$i(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||qo(a,t),u=(Hn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=by(d,l),g=o[f+"AxisID"]||f;r[g]=r[g]||Object.create(null),$i(r[g],[{axis:f},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];$i(a,[Et.scales[a.type],Et.scale])}),r}function Su(n){const t=n.options||(n.options={});t.plugins=it(t.plugins,{}),t.scales=vy(n,t)}function Tu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function My(n){return n=n||{},n.data=Tu(n.data),Su(n),n}const Cu=new Map,Pu=new Set;function mr(n,t){let e=Cu.get(n);return e||(e=t(),Cu.set(n,e),Pu.add(e)),e}const us=(n,t,e)=>{const i=_n(t,e);i!==void 0&&n.add(i)};class ky{constructor(t){this._config=My(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=Tu(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(),Su(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return mr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return mr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return mr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return mr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>us(l,t,d))),u.forEach(d=>us(l,s,d)),u.forEach(d=>us(l,Hn[r]||{},d)),u.forEach(d=>us(l,Et,d)),u.forEach(d=>us(l,Co,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Pu.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Hn[e]||{},Et.datasets[e]||{},{type:e},Et,Co]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Ou(this._resolverCache,t,s);let l=o;if(Sy(o,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,a);l=gi(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Ou(this._resolverCache,t,i);return ut(e)?gi(r,e,void 0,s):r}}function Ou(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:Ao(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Dy=n=>ut(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function Sy(n,t){const{isScriptable:e,isIndexable:i}=Rc(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(pe(a)||Dy(a))||o&&Mt(a))return!0}return!1}var Ty="4.4.5";const Cy=["top","bottom","left","right","chartArea"];function Eu(n,t){return n==="top"||n==="bottom"||Cy.indexOf(n)===-1&&t==="x"}function Au(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Ru(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),kt(e&&e.onComplete,[n],t)}function Py(n){const t=n.chart,e=t.options.animation;kt(e&&e.onProgress,[n],t)}function Iu(n){return Lo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const yr={},Lu=n=>{const t=Iu(n);return Object.values(yr).filter(e=>e.canvas===t).pop()};function Oy(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function Ey(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function br(n,t,e){return n.options.clip?n[e]:t[e]}function Ay(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:br(e,t,"left"),right:br(e,t,"right"),top:br(i,t,"top"),bottom:br(i,t,"bottom")}:t}let Oe=(An=class{static register(...t){je.add(...t),Nu()}static unregister(...t){je.remove(...t),Nu()}constructor(t,e){const i=this.config=new ky(e),s=Iu(t),r=Lu(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Gm(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Fg(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new fy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Qg(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],yr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}nn.listen(this,"complete",Ru),nn.listen(this,"progress",Py),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return ot(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return je}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Wc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return nn.stop(this),this}resize(t,e){nn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Wc(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),kt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Dt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=Go(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Dt(r,o=>{const a=o.options,l=a.id,c=Go(l,a),u=it(a.type,o.dtype);(a.position===void 0||Eu(a.position,c)!==Eu(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const f=je.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Dt(s,(o,a)=>{o||delete i[a]}),Dt(i,o=>{se.configure(this,o,o.options),se.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Au("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||qo(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=je.getController(a),{datasetElementType:c,dataElementType:u}=Et.datasets[a];Object.assign(l,{dataElementType:je.getElement(u),datasetElementType:c&&je.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Dt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||Dt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Au("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Dt(this.scales,t=>{se.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!gc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;Oy(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!gc(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;se.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Dt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,pe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(nn.has(this)?this.attached&&!nn.running(this)&&nn.start(this):(this.draw(),Ru({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,r=Ay(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Zi(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Qi(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Uo.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Mn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);ge(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),nn.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(),Oc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete yr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Dt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){Dt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Dt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Gs(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=jg(t),c=Ey(t,this._lastEvent,i,l);i&&(this._lastEvent=null,kt(r.onHover,[t,a,this],this),l&&kt(r.onClick,[t,a,this],this));const u=!Gs(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},P(An,"defaults",Et),P(An,"instances",yr),P(An,"overrides",Hn),P(An,"registry",je),P(An,"version",Ty),P(An,"getChart",Lu),An);function Nu(){return Dt(Oe.instances,n=>n._plugins.invalidate())}function Ry(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Ot,i-Ot),n.closePath(),n.clip()}function Iy(n){return Eo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Ly(n,t,e,i){const s=Iy(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return Zt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Zt(s.innerStart,0,o),innerEnd:Zt(s.innerEnd,0,o)}}function yi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function _r(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const W=u>0?u-i:0,U=d>0?d-i:0,H=(W+U)/2,st=H!==0?p*H/(H+i):p;g=(p-st)/2}const y=Math.max(.001,p*d-e/pt)/d,x=(p-y)/2,M=l+x+g,v=s-x-g,{outerStart:D,outerEnd:S,innerStart:T,innerEnd:A}=Ly(t,f,d,v-M),O=d-D,_=d-S,b=M+D/O,C=v-S/_,R=f+T,I=f+A,Y=M+T/R,L=v-A/I;if(n.beginPath(),r){const W=(b+C)/2;if(n.arc(o,a,d,b,W),n.arc(o,a,d,W,C),S>0){const $=yi(_,C,o,a);n.arc($.x,$.y,S,C,v+Ot)}const U=yi(I,v,o,a);if(n.lineTo(U.x,U.y),A>0){const $=yi(I,L,o,a);n.arc($.x,$.y,A,v+Ot,L+Math.PI)}const H=(v-A/f+(M+T/f))/2;if(n.arc(o,a,f,v-A/f,H,!0),n.arc(o,a,f,H,M+T/f,!0),T>0){const $=yi(R,Y,o,a);n.arc($.x,$.y,T,Y+Math.PI,M-Ot)}const st=yi(O,M,o,a);if(n.lineTo(st.x,st.y),D>0){const $=yi(O,b,o,a);n.arc($.x,$.y,D,M-Ot,b)}}else{n.moveTo(o,a);const W=Math.cos(b)*d+o,U=Math.sin(b)*d+a;n.lineTo(W,U);const H=Math.cos(C)*d+o,st=Math.sin(C)*d+a;n.lineTo(H,st)}n.closePath()}function Ny(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){_r(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%Ct||Ct))}return _r(n,t,e,i,l,s),n.fill(),l}function Fy(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){_r(n,t,e,i,p,s);for(let y=0;y<r;++y)n.stroke();isNaN(a)||(p=o+(a%Ct||Ct))}g&&Ry(n,t,p),r||(_r(n,t,e,i,p,s),n.stroke())}class ds extends Qt{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=tr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=it(f,c-l),y=Xi(o,l,c)&&l!==c,x=p>=Ct||y,M=Je(a,u+g,d+g);return x&&M}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+o)/2,f=(a+l+u+c)/2;return{x:i+Math.cos(d)*f,y:s+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ct?Math.floor(s/Ct):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(pt,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Ny(e,this,u,o,a),Fy(e,this,u,o,a),e.restore()}}P(ds,"id","arc"),P(ds,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),P(ds,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(ds,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Fu(n,t,e=t){n.lineCap=it(e.borderCapStyle,t.borderCapStyle),n.setLineDash(it(e.borderDash,t.borderDash)),n.lineDashOffset=it(e.borderDashOffset,t.borderDashOffset),n.lineJoin=it(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=it(e.borderWidth,t.borderWidth),n.strokeStyle=it(e.borderColor,t.borderColor)}function zy(n,t,e){n.lineTo(e.x,e.y)}function By(n){return n.stepped?up:n.tension||n.cubicInterpolationMode==="monotone"?dp:zy}function zu(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Hy(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=zu(s,e,i),u=By(r);let{move:d=!0,reverse:f}=i||{},g,p,y;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,f,r.stepped),y=p);return l&&(p=s[(a+(f?c:0))%o],u(n,y,p,f,r.stepped)),!!l}function Wy(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=zu(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,y,x,M;const v=S=>(o+(c?a-S:S))%r,D=()=>{y!==x&&(n.lineTo(u,x),n.lineTo(u,y),n.lineTo(u,M))};for(l&&(g=s[v(0)],n.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[v(f)],g.skip)continue;const S=g.x,T=g.y,A=S|0;A===p?(T<y?y=T:T>x&&(x=T),u=(d*u+S)/++d):(D(),n.lineTo(S,T),p=A,d=0,y=x=T),M=T}D()}function Ko(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Wy:Hy}function Yy(n){return n.stepped?jp:n.tension||n.cubicInterpolationMode==="monotone"?Vp:Vn}function jy(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Fu(n,t.options),n.stroke(s)}function Vy(n,t,e,i){const{segments:s,options:r}=t,o=Ko(t);for(const a of s)Fu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const $y=typeof Path2D=="function";function Uy(n,t,e,i){$y&&!t.options.segment?jy(n,t,e,i):Vy(n,t,e,i)}class Dn extends Qt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Lp(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Kp(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=qc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Yy(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],g=r[d],p=r[f];if(g===p){a.push(g);continue}const y=Math.abs((s-g[e])/(p[e]-g[e])),x=l(g,p,y,i.stepped);x[e]=t[e],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Ko(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=Ko(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Uy(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(Dn,"id","line"),P(Dn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(Dn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(Dn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Bu(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class xr extends Qt{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return Bu(this,e,"x",i)}inYRange(e,i){return Bu(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!en(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Oo(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(xr,"id","point"),P(xr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hu(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return n.horizontal?(d=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,a=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function Sn(n,t,e,i){return n?0:Zt(t,e,i)}function Xy(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Ac(i);return{t:Sn(s.top,r.top,0,e),r:Sn(s.right,r.right,0,t),b:Sn(s.bottom,r.bottom,0,e),l:Sn(s.left,r.left,0,t)}}function qy(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=vn(s),o=Math.min(t,e),a=n.borderSkipped,l=i||ut(s);return{topLeft:Sn(!l||a.top||a.left,r.topLeft,0,o),topRight:Sn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Sn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Sn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Gy(n){const t=Hu(n),e=t.right-t.left,i=t.bottom-t.top,s=Xy(n,e/2,i/2),r=qy(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function Zo(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Hu(n,i);return a&&(s||Je(t,a.left,a.right))&&(r||Je(e,a.top,a.bottom))}function Ky(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Zy(n,t){n.rect(t.x,t.y,t.w,t.h)}function Qo(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class wr extends Qt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=Gy(this),a=Ky(o.radius)?fi:Zy;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,Qo(o,e,r)),t.clip(),a(t,Qo(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Qo(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Zo(this,t,e,i)}inXRange(t,e){return Zo(this,t,null,e)}inYRange(t,e){return Zo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(wr,"id","bar"),P(wr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(wr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Qy=Object.freeze({__proto__:null,ArcElement:ds,BarElement:wr,LineElement:Dn,PointElement:xr});const Jo=["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)"],Wu=Jo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Yu(n){return Jo[n%Jo.length]}function ju(n){return Wu[n%Wu.length]}function Jy(n,t){return n.borderColor=Yu(t),n.backgroundColor=ju(t),++t}function tb(n,t){return n.backgroundColor=n.data.map(()=>Yu(t++)),t}function eb(n,t){return n.backgroundColor=n.data.map(()=>ju(t++)),t}function nb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof sn?t=tb(e,t):s instanceof is?t=eb(e,t):s&&(t=Jy(e,t))}}function Vu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function ib(n){return n&&(n.borderColor||n.backgroundColor)}function sb(){return Et.borderColor!=="rgba(0,0,0,0.1)"||Et.backgroundColor!=="rgba(0,0,0,0.1)"}var rb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,o=Vu(i)||ib(s)||r&&Vu(r)||sb();if(!e.forceOverride&&o)return;const a=nb(n);i.forEach(a)}};function ob(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,f,g,p,y;for(o[l++]=n[u],d=0;d<r-2;d++){let x=0,M=0,v;const D=Math.floor((d+1)*a)+1+t,S=Math.min(Math.floor((d+2)*a)+1,e)+t,T=S-D;for(v=D;v<S;v++)x+=n[v].x,M+=n[v].y;x/=T,M/=T;const A=Math.floor(d*a)+1+t,O=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:_,y:b}=n[u];for(g=p=-1,v=A;v<O;v++)p=.5*Math.abs((_-x)*(n[v].y-b)-(_-n[v].x)*(M-b)),p>g&&(g=p,f=n[v],y=v);o[l++]=f,u=y}return o[l++]=n[c],o}function ab(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,f,g,p,y;const x=[],M=t+e-1,v=n[t].x,S=n[M].x-v;for(o=t;o<t+e;++o){a=n[o],l=(a.x-v)/S*i,c=a.y;const T=l|0;if(T===u)c<p?(p=c,d=o):c>y&&(y=c,f=o),s=(r*s+a.x)/++r;else{const A=o-1;if(!ot(d)&&!ot(f)){const O=Math.min(d,f),_=Math.max(d,f);O!==g&&O!==A&&x.push({...n[O],x:s}),_!==g&&_!==A&&x.push({...n[_],x:s})}o>0&&A!==g&&x.push(n[A]),x.push(a),u=T,r=0,p=y=c,d=f=g=o}}return x}function $u(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 Uu(n){n.data.datasets.forEach(t=>{$u(t)})}function lb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Zt(tn(t,r.axis,o).lo,0,e-1)),c?s=Zt(tn(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var cb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Uu(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Ji([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:f}=lb(l,c);const g=e.threshold||4*i;if(f<=g){$u(s);return}ot(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(e.algorithm){case"lttb":p=ob(c,d,f,i,e);break;case"min-max":p=ab(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Uu(n)}};function ub(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=ea(l,c,s);const u=ta(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=qc(t,u);for(const f of d){const g=ta(e,r[f.start],r[f.end],f.loop),p=Xc(a,s,g);for(const y of p)o.push({source:y,target:f,start:{[e]:Xu(u,g,"start",Math.max)},end:{[e]:Xu(u,g,"end",Math.min)}})}}return o}function ta(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=ke(s),r=ke(r)),{property:n,start:s,end:r}}function db(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=ea(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function ea(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Xu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function qu(n,t){let e=[],i=!1;return Mt(n)?(i=!0,e=n):e=db(n,t),e.length?new Dn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Gu(n){return n&&n.fill!==!1}function hb(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Rt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function fb(n,t,e){const i=yb(n);if(ut(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?gb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function gb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function pb(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ut(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function mb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ut(n)?i=n.value:i=t.getBaseValue(),i}function yb(n){const t=n.options,e=t.fill;let i=it(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function bb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=_b(t,e);a.push(qu({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)xb(s,o[u],a)}return new Dn({points:s,options:{}})}function _b(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function xb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=wb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function wb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=o[u.start][e],f=o[u.end][e];if(Je(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:i}}class Ku{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:Ct},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function vb(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return Mb(t,e);if(e==="stack")return bb(n);if(e==="shape")return!0;const s=kb(n);return s instanceof Ku?s:qu(s,i)}function Mb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function kb(n){return(n.scale||{}).getPointPositionForValue?Sb(n):Db(n)}function Db(n){const{scale:t={},fill:e}=n,i=pb(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Sb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=mb(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new Ku({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function na(n,t,e){const i=vb(t),{line:s,scale:r,axis:o}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};i&&s.points.length&&(Zi(n,e),Tb(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:o}),Qi(n))}function Tb(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&r!==s&&(Zu(n,i,o.top),Qu(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),Zu(n,i,o.bottom)),Qu(n,{line:e,target:i,color:r,scale:a,property:l}),n.restore()}function Zu(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[ea(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Qu(n,t){const{line:e,target:i,property:s,color:r,scale:o}=t,a=ub(e,i,s);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:f=r}={}}=l,g=i!==!0;n.save(),n.fillStyle=f,Cb(n,o,g&&ta(s,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let y;if(g){p?n.closePath():Ju(n,i,d,s);const x=!!i.pathSegment(n,c,{move:p,reverse:!0});y=p&&x,y||Ju(n,i,u,s)}n.closePath(),n.fill(y?"evenodd":"nonzero"),n.restore()}}function Cb(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(n.beginPath(),n.rect(o,i,a-o,s-i),n.clip())}function Ju(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Pb={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof Dn&&(l={visible:n.isDatasetVisible(o),index:o,fill:fb(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=hb(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&na(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Gu(r)&&na(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Gu(i)||e.drawTime!=="beforeDatasetDraw"||na(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const td=(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)}},Ob=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class ed extends Qt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=kt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=It(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=td(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((p,y)=>{const x=i+e/2+r.measureText(p.text).width;(y===0||c[c.length-1]+x+2*a>o)&&(d+=u,c[c.length-(y>0?0:1)]=0,g+=u,f++),l[y]={left:0,top:g,row:f,width:x,height:s},c[c.length-1]+=x+a}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,g=0,p=0,y=0;return this.legendItems.forEach((x,M)=>{const{itemWidth:v,itemHeight:D}=Eb(i,e,r,x,s);M>0&&g+D+2*a>u&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,y++,f=g=0),l[M]={left:p,top:g,col:y,width:v,height:D},f=Math.max(f,v),g+=D+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=mi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=ie(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ie(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Zi(t,this),this._draw(),Qi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=Et.color,l=mi(t.rtl,this.left,this.width),c=It(o.font),{padding:u}=o,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:x}=td(o,d),M=function(A,O,_){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const b=it(_.lineWidth,1);if(s.fillStyle=it(_.fillStyle,a),s.lineCap=it(_.lineCap,"butt"),s.lineDashOffset=it(_.lineDashOffset,0),s.lineJoin=it(_.lineJoin,"miter"),s.lineWidth=b,s.strokeStyle=it(_.strokeStyle,a),s.setLineDash(it(_.lineDash,[])),o.usePointStyle){const C={radius:y*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:b},R=l.xPlus(A,p/2),I=O+f;Ec(s,C,R,I,o.pointStyleWidth&&p)}else{const C=O+Math.max((d-y)/2,0),R=l.leftForLtr(A,p),I=vn(_.borderRadius);s.beginPath(),Object.values(I).some(Y=>Y!==0)?fi(s,{x:R,y:C,w:p,h:y,radius:I}):s.rect(R,C,p,y),s.fill(),b!==0&&s.stroke()}s.restore()},v=function(A,O,_){Yn(s,_.text,A,O+x/2,c,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},D=this.isHorizontal(),S=this._computeTitleHeight();D?g={x:ie(r,this.left+u,this.right-i[0]),y:this.top+u+S,line:0}:g={x:this.left+u,y:ie(r,this.top+S+u,this.bottom-e[0].height),line:0},jc(this.ctx,t.textDirection);const T=x+u;this.legendItems.forEach((A,O)=>{s.strokeStyle=A.fontColor,s.fillStyle=A.fontColor;const _=s.measureText(A.text).width,b=l.textAlign(A.textAlign||(A.textAlign=o.textAlign)),C=p+f+_;let R=g.x,I=g.y;l.setWidth(this.width),D?O>0&&R+C+u>this.right&&(I=g.y+=T,g.line++,R=g.x=ie(r,this.left+u,this.right-i[g.line])):O>0&&I+T>this.bottom&&(R=g.x=R+e[g.line].width+u,g.line++,I=g.y=ie(r,this.top+S+u,this.bottom-e[g.line].height));const Y=l.x(R);if(M(Y,I,A),R=Jg(b,R+p+f,D?R+C:this.right,t.rtl),v(l.x(R),I,A),D)g.x+=C+u;else if(typeof A.text!="string"){const L=c.lineHeight;g.y+=nd(A,L)+u}else g.y+=T}),Vc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=It(e.font),s=Xt(e.padding);if(!e.display)return;const r=mi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=ie(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);u=c+ie(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=ie(a,d,d+f);o.textAlign=r.textAlign(Do(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Yn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=It(t.font),i=Xt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Je(t,this.left,this.right)&&Je(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Je(t,s.left,s.left+s.width)&&Je(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Ib(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=Ob(s,i);s&&!r&&kt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&kt(e.onHover,[t,i,this],this)}else i&&kt(e.onClick,[t,i,this],this)}}function Eb(n,t,e,i,s){const r=Ab(i,n,t,e),o=Rb(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Ab(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function Rb(n,t,e){let i=n;return typeof t.text!="string"&&(i=nd(t,e)),i}function nd(n,t){const e=n.text?n.text.length:0;return t*e}function Ib(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Lb={id:"legend",_element:ed,start(n,t,e){const i=n.legend=new ed({ctx:n.ctx,options:e,chart:n});se.configure(n,i,e),se.addBox(n,i)},stop(n){se.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;se.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Xt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ia extends Qt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=Mt(i.text)?i.text.length:1;this._padding=Xt(i.padding);const r=s*It(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=ie(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=ie(a,s,e),l=pt*-.5):(u=r-t,d=ie(a,e,s),l=pt*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Yn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Do(e.align),textBaseline:"middle",translation:[o,a]})}}function Nb(n,t){const e=new ia({ctx:n.ctx,options:t,chart:n});se.configure(n,e,t),se.addBox(n,e),n.titleBlock=e}var Fb={id:"title",_element:ia,start(n,t,e){Nb(n,e)},stop(n){const t=n.titleBlock;se.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;se.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 vr=new WeakMap;var zb={id:"subtitle",start(n,t,e){const i=new ia({ctx:n.ctx,options:e,chart:n});se.configure(n,i,e),se.addBox(n,i),vr.set(n,i)},stop(n){se.removeBox(n,vr.get(n)),vr.delete(n)},beforeUpdate(n,t,e){const i=vr.get(n);se.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const hs={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=hi(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ve(n,t){return t&&(Mt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function rn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
17
17
|
`)>-1?n.split(`
|
|
18
|
-
`):n}function Bb(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function nd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),d=r.length,f=s.length,g=i.length,p=Xt(t.padding);let y=p.height,x=0,M=i.reduce((S,T)=>S+T.before.length+T.lines.length+T.after.length,0);if(M+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),M){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*S+(M-g)*l.lineHeight+(M-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const D=function(S){x=Math.max(x,e.measureText(S).width+v)};return e.save(),e.font=c.string,Dt(n.title,D),e.font=l.string,Dt(n.beforeBody.concat(n.afterBody),D),v=t.displayColors?o+2+t.boxPadding:0,Dt(i,S=>{Dt(S.before,D),Dt(S.lines,D),Dt(S.after,D)}),v=0,e.font=u.string,Dt(n.footer,D),e.restore(),x+=p.width,{width:x,height:y}}function Hb(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Wb(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function Yb(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Wb(c,n,t,e)&&(c="center"),c}function id(n,t,e){const i=e.yAlign||t.yAlign||Hb(n,e);return{xAlign:e.xAlign||t.xAlign||Yb(n,t,e,i),yAlign:i}}function jb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Vb(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function sd(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=vn(o);let p=jb(t,a);const y=Vb(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Zt(p,0,i.width-t.width),y:Zt(y,0,i.height-t.height)}}function Mr(n,t,e){const i=Xt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function rd(n){return Ve([],rn(n))}function $b(n,t,e){return Mn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function od(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const ad={beforeTitle:Qe,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:Qe,beforeBody:Qe,beforeLabel:Qe,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 rt(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:Qe,afterBody:Qe,beforeFooter:Qe,footer:Qe,afterFooter:Qe};function me(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?ad[t].call(e,i):s}class sa extends Qt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Fo(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=$b(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=me(i,"beforeTitle",this,t),r=me(i,"title",this,t),o=me(i,"afterTitle",this,t);let a=[];return a=Ve(a,rn(s)),a=Ve(a,rn(r)),a=Ve(a,rn(o)),a}getBeforeBody(t,e){return rd(me(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return Dt(t,r=>{const o={before:[],lines:[],after:[]},a=od(i,r);Ve(o.before,rn(me(a,"beforeLabel",this,r))),Ve(o.lines,me(a,"label",this,r)),Ve(o.after,rn(me(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return rd(me(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=me(i,"beforeFooter",this,t),r=me(i,"footer",this,t),o=me(i,"afterFooter",this,t);let a=[];return a=Ve(a,rn(s)),a=Ve(a,rn(r)),a=Ve(a,rn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Bb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Dt(a,u=>{const d=od(t.callbacks,u);s.push(me(d,"labelColor",this,u)),r.push(me(d,"labelPointStyle",this,u)),o.push(me(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=hs[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=nd(this,i),c=Object.assign({},a,l),u=id(this.chart,i,c),d=sd(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=vn(a),{x:f,y:g}=t,{width:p,height:y}=e;let x,M,v,D,S,T;return r==="center"?(S=g+y/2,s==="left"?(x=f,M=x-o,D=S+o,T=S-o):(x=f+p,M=x+o,D=S-o,T=S+o),v=x):(s==="left"?M=f+Math.max(l,u)+o:s==="right"?M=f+p-Math.max(c,d)-o:M=this.caretX,r==="top"?(D=g,S=D-o,x=M-o,v=M+o):(D=g+y,S=D+o,x=M+o,v=M-o),T=D),{x1:x,x2:M,x3:v,y1:D,y2:S,y3:T}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=mi(i.rtl,this.x,this.width);for(t.x=Mr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=It(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=It(r.bodyFont),d=Mr(this,"left",r),f=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,M=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Oo(t,y,x,M),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Oo(t,y,x,M)}else{t.lineWidth=ct(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const y=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),M=vn(o.borderRadius);Object.values(M).some(v=>v!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,fi(t,{x:y,y:p,w:c,h:l,radius:M}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),fi(t,{x,y:p+1,w:c-2,h:l-2,radius:M}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(x,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=It(i.bodyFont);let f=d.lineHeight,g=0;const p=mi(i.rtl,this.x,this.width),y=function(_){e.fillText(_,p.x(t.x+g),t.y+f/2),t.y+=f+r},x=p.textAlign(o);let M,v,D,S,T,R,E;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=Mr(this,x,i),e.fillStyle=i.bodyColor,Dt(this.beforeBody,y),g=a&&x!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,R=s.length;S<R;++S){for(M=s[S],v=this.labelTextColors[S],e.fillStyle=v,Dt(M.before,y),D=M.lines,a&&D.length&&(this._drawColorBox(e,t,S,p,i),f=Math.max(d.lineHeight,l)),T=0,E=D.length;T<E;++T)y(D[T]),f=d.lineHeight;Dt(M.after,y)}g=0,f=d.lineHeight,Dt(this.afterBody,y),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=mi(i.rtl,this.x,this.width);for(t.x=Mr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=It(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=vn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=hs[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=nd(this,t),l=Object.assign({},o,this._size),c=id(e,t,l),u=sd(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Xt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),Yc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),jc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Gs(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Gs(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=hs[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}O(sa,"positioners",hs);var $e={id:"tooltip",_element:sa,positioners:hs,afterInit(n,t,e){e&&(n.tooltip=new sa({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:ad},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"]},Ub=Object.freeze({__proto__:null,Colors:rb,Decimation:cb,Filler:Pb,Legend:Lb,SubTitle:zb,Title:Fb,Tooltip:$e});const Xb=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function qb(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Xb(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Gb=(n,t)=>n===null?null:Zt(Math.round(n),0,t);function ld(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ra extends Un{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(rt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:qb(i,t,it(e,t),this._addedLabels),Gb(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return ld.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}O(ra,"id","category"),O(ra,"defaults",{ticks:{callback:ld}});function Kb(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=r||1,p=u-1,{min:y,max:x}=t,M=!rt(o),v=!rt(a),D=!rt(c),S=(x-y)/(d+1);let T=gc((x-y)/p/g)*g,R,E,_,b;if(T<1e-14&&!M&&!v)return[{value:y},{value:x}];b=Math.ceil(x/T)-Math.floor(y/T),b>p&&(T=gc(b*T/p/g)*g),rt(l)||(R=Math.pow(10,l),T=Math.ceil(T*R)/R),s==="ticks"?(E=Math.floor(y/T)*T,_=Math.ceil(x/T)*T):(E=y,_=x),M&&v&&r&&Ug((a-o)/r,T/1e3)?(b=Math.round(Math.min((a-o)/T,u)),T=(a-o)/b,E=o,_=a):D?(E=M?o:E,_=v?a:_,b=c-1,T=(_-E)/b):(b=(_-E)/T,Ui(b,Math.round(b),T/1e3)?b=Math.round(b):b=Math.ceil(b));const P=Math.max(mc(T),mc(E));R=Math.pow(10,rt(l)?P:l),E=Math.round(E*R)/R,_=Math.round(_*R)/R;let I=0;for(M&&(f&&E!==o?(e.push({value:o}),E<o&&I++,Ui(Math.round((E+I*T)*R)/R,o,cd(o,S,n))&&I++):E<o&&I++);I<b;++I){const C=Math.round((E+I*T)*R)/R;if(v&&C>a)break;e.push({value:C})}return v&&f&&_!==a?e.length&&Ui(e[e.length-1].value,a,cd(a,S,n))?e[e.length-1].value=a:e.push({value:a}):(!v||_===a)&&e.push({value:_}),e}function cd(n,t,{horizontal:e,minRotation:i}){const s=Ut(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class kr extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return rt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=Ye(s),c=Ye(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=Kb(s,r);return t.bounds==="ticks"&&pc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Gi(t,this.chart.options.locale,this.options.ticks.format)}}class oa extends kr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?t:0,this.max=Rt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ut(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}O(oa,"id","linear"),O(oa,"defaults",{ticks:{callback:nr.formatters.numeric}});const fs=n=>Math.floor(xn(n)),Xn=(n,t)=>Math.pow(10,fs(n)+t);function ud(n){return n/Math.pow(10,fs(n))===1}function dd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Zb(n,t){const e=t-n;let i=fs(e);for(;dd(n,t,i)>10;)i++;for(;dd(n,t,i)<10;)i--;return Math.min(i,fs(n))}function Qb(n,{min:t,max:e}){t=Me(n.min,t);const i=[],s=fs(t);let r=Zb(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),f=Me(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;f<e;)i.push({value:f,major:ud(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),f=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=Me(n.max,f);return i.push({value:g,major:ud(g),significand:d}),i}class aa extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=kr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?Math.max(0,t):null,this.max=Rt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rt(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r(Xn(i,-1)),o(Xn(s,1)))),i<=0&&r(Xn(s,-1)),s<=0&&o(Xn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Qb(e,this);return t.bounds==="ticks"&&pc(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Gi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xn(t),this._valueRange=xn(this.max)-xn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}O(aa,"id","logarithmic"),O(aa,"defaults",{ticks:{callback:nr.formatters.logarithmic,major:{enabled:!0}}});function la(n){const t=n.ticks;if(t.display&&n.display){const e=Xt(t.backdropPadding);return it(t.font&&t.font.size,Et.font.size)+e.height}return 0}function Jb(n,t,e){return e=Mt(e)?e:[e],{w:cp(n,t.string,e),h:e.length*t.lineHeight}}function hd(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function t0(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?pt/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),d=It(c.font),f=Jb(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=ke(n.getIndexAngle(l)+a),p=Math.round(Js(g)),y=hd(p,u.x,f.w,0,180),x=hd(p,u.y,f.h,90,270);e0(e,t,g,y,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=s0(n,i,s)}function e0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function n0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(Js(ke(l.angle+Ot))),u=a0(l.y,a.h,c),d=r0(c),f=o0(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function i0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(en({x:e,y:i},t)||en({x:e,y:r},t)||en({x:s,y:i},t)||en({x:s,y:r},t))}function s0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:la(r)/2,additionalAngle:o?pt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=n0(n,u,l);i.push(d),a==="auto"&&(d.visible=i0(d,c),d.visible&&(c=d))}return i}function r0(n){return n===0||n===180?"center":n<180?"left":"right"}function o0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function a0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function l0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!rt(a)){const l=vn(t.borderRadius),c=Xt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,f=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),fi(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function c0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));l0(e,o,r);const a=It(o.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function fd(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ct);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function u0(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),fd(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function d0(n,t,e){return Mn(n,{label:e,index:t,type:"pointLabel"})}class gs extends kr{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=Xt(la(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Rt(t)&&!isNaN(t)?t:0,this.max=Rt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/la(this.options))}generateTickLabels(t){kr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=kt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?t0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=Ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return ke(t*e+Ut(i))}getDistanceFromCenterForValue(t){if(rt(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(rt(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 d0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),fd(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&c0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=s.setContext(f),p=r.setContext(f);u0(this,g,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=It(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Xt(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Yn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}O(gs,"id","radialLinear"),O(gs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:nr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),O(gs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),O(gs,"descriptors",{angleLines:{_fallback:"grid"}});const Dr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ye=Object.keys(Dr);function gd(n,t){return n-t}function pd(n,t){if(rt(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Rt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(wn(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function md(n,t,e,i){const s=ye.length;for(let r=ye.indexOf(n);r<s-1;++r){const o=Dr[ye[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ye[r]}return ye[s-1]}function h0(n,t,e,i,s){for(let r=ye.length-1;r>=ye.indexOf(e);r--){const o=ye[r];if(Dr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ye[e?ye.indexOf(e):0]}function f0(n){for(let t=ye.indexOf(n)+1,e=ye.length;t<e;++t)if(Dr[ye[t]].common)return ye[t]}function yd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=ko(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function g0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function bd(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:g0(n,i,s,e)}class ps extends Un{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new au._date(t.adapters.date);s.init(e),$i(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:pd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Rt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Rt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=Kg(s,r,o);return this._unit=e.unit||(i.autoSkip?md(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):h0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:f0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),bd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Zt(e,0,o),i=Zt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||md(r.minUnit,e,i,this._getLabelCapacity(e)),a=it(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=wn(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,a,o),g++)yd(u,f,p);return(f===i||s.bounds==="ticks"||g===1)&&yd(u,f,p),Object.keys(u).sort(gd).map(y=>+y)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return kt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[e],g=c&&d&&f&&f.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Ut(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,bd(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(pd(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return _c(t.sort(gd))}}O(ps,"id","time"),O(ps,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Sr(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=tn(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=tn(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class ca extends ps{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=Sr(e,this.min),this._tableRange=Sr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Sr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Sr(this._table,i*this._tableRange+this._minPos,!0)}}O(ca,"id","timeseries"),O(ca,"defaults",ps.defaults);var p0=Object.freeze({__proto__:null,CategoryScale:ra,LinearScale:oa,LogarithmicScale:aa,RadialLinearScale:gs,TimeScale:ps,TimeSeriesScale:ca});const m0=[km,Qy,Ub,p0],_d=6048e5,y0=864e5,ms=6e4,bi=36e5,b0=1e3,xd=Symbol.for("constructDateFrom");function zt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&xd in n?n[xd](t):n instanceof Date?new n.constructor(t):new Date(t)}function ot(n,t){return zt(t||n,n)}function Tr(n,t,e){const i=ot(n,e==null?void 0:e.in);return isNaN(t)?zt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ua(n,t,e){const i=ot(n,e==null?void 0:e.in);if(isNaN(t))return zt(n,NaN);if(!t)return i;const s=i.getDate(),r=zt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function da(n,t,e){return zt(n,+ot(n)+t)}function _0(n,t,e){return da(n,t*bi)}let x0={};function qn(){return x0}function Ue(n,t){var a,l,c,u;const e=qn(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=ot(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function _i(n,t){return Ue(n,{...t,weekStartsOn:1})}function wd(n,t){const e=ot(n,t==null?void 0:t.in),i=e.getFullYear(),s=zt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=_i(s),o=zt(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=_i(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Cr(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 Gn(n,...t){const e=zt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ha(n,t){const e=ot(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function vd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ha(i),o=ha(s),a=+r-Cr(r),l=+o-Cr(o);return Math.round((a-l)/y0)}function w0(n,t){const e=wd(n,t),i=zt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),_i(i)}function v0(n,t,e){const i=ot(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ms),i}function M0(n,t,e){return ua(n,t*3,e)}function k0(n,t,e){return da(n,t*1e3)}function D0(n,t,e){return Tr(n,t*7,e)}function S0(n,t,e){return ua(n,t*12,e)}function ys(n,t){const e=+ot(n)-+ot(t);return e<0?-1:e>0?1:e}function T0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function fa(n){return!(!T0(n)&&typeof n!="number"||isNaN(+ot(n)))}function C0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function P0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Md(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=kd(i,s),o=Math.abs(vd(i,s));i.setDate(i.getDate()-r*o);const a=+(kd(i,s)===-r),l=r*(o-a);return l===0?0:l}function kd(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function bs(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function O0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/bi;return bs(e==null?void 0:e.roundingMethod)(r)}function ga(n,t){return+ot(n)-+ot(t)}function E0(n,t,e){const i=ga(n,t)/ms;return bs(e==null?void 0:e.roundingMethod)(i)}function Dd(n,t){const e=ot(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Sd(n,t){const e=ot(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function A0(n,t){const e=ot(n,t==null?void 0:t.in);return+Dd(e,t)==+Sd(e,t)}function Td(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),o=ys(s,r),a=Math.abs(C0(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ys(s,r)===-o;A0(i)&&a===1&&ys(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function R0(n,t,e){const i=Td(n,t,e)/3;return bs(e==null?void 0:e.roundingMethod)(i)}function I0(n,t,e){const i=ga(n,t)/1e3;return bs(e==null?void 0:e.roundingMethod)(i)}function L0(n,t,e){const i=Md(n,t,e)/7;return bs(e==null?void 0:e.roundingMethod)(i)}function N0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ys(i,s),o=Math.abs(P0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ys(i,s)===-r,l=r*(o-+a);return l===0?0:l}function F0(n,t){const e=ot(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function z0(n,t){const e=ot(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function B0(n,t){const e=ot(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Cd(n,t){const e=ot(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function H0(n,t){const e=ot(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function W0(n,t){var a,l;const e=qn(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=ot(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function Y0(n,t){const e=ot(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function j0(n,t){const e=ot(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function V0(n,t){const e=ot(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const $0={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"}},U0=(n,t,e)=>{let i;const s=$0[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function pa(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const X0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},q0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},G0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},K0={date:pa({formats:X0,defaultWidth:"full"}),time:pa({formats:q0,defaultWidth:"full"}),dateTime:pa({formats:G0,defaultWidth:"full"})},Z0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Q0=(n,t,e,i)=>Z0[n];function _s(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const J0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},t_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},e_={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"]},n_={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"]},i_={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"}},s_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},r_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:_s({values:J0,defaultWidth:"wide"}),quarter:_s({values:t_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:_s({values:e_,defaultWidth:"wide"}),day:_s({values:n_,defaultWidth:"wide"}),dayPeriod:_s({values:i_,defaultWidth:"wide",formattingValues:s_,defaultFormattingWidth:"wide"})};function xs(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?a_(a,d=>d.test(o)):o_(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function o_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function a_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function l_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const c_=/^(\d+)(th|st|nd|rd)?/i,u_=/\d+/i,d_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},h_={any:[/^b/i,/^(a|c)/i]},f_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},g_={any:[/1/i,/2/i,/3/i,/4/i]},p_={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},m_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},y_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},b_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},__={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},x_={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},w_={ordinalNumber:l_({matchPattern:c_,parsePattern:u_,valueCallback:n=>parseInt(n,10)}),era:xs({matchPatterns:d_,defaultMatchWidth:"wide",parsePatterns:h_,defaultParseWidth:"any"}),quarter:xs({matchPatterns:f_,defaultMatchWidth:"wide",parsePatterns:g_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:xs({matchPatterns:p_,defaultMatchWidth:"wide",parsePatterns:m_,defaultParseWidth:"any"}),day:xs({matchPatterns:y_,defaultMatchWidth:"wide",parsePatterns:b_,defaultParseWidth:"any"}),dayPeriod:xs({matchPatterns:__,defaultMatchWidth:"any",parsePatterns:x_,defaultParseWidth:"any"})},Pd={code:"en-US",formatDistance:U0,formatLong:K0,formatRelative:Q0,localize:r_,match:w_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function v_(n,t){const e=ot(n,t==null?void 0:t.in);return vd(e,Cd(e))+1}function Od(n,t){const e=ot(n,t==null?void 0:t.in),i=+_i(e)-+w0(e);return Math.round(i/_d)+1}function ma(n,t){var u,d,f,g;const e=ot(n,t==null?void 0:t.in),i=e.getFullYear(),s=qn(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=zt((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Ue(o,t),l=zt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Ue(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function M_(n,t){var a,l,c,u;const e=qn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=ma(n,t),r=zt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Ue(r,t)}function Ed(n,t){const e=ot(n,t==null?void 0:t.in),i=+Ue(e,t)-+M_(e,t);return Math.round(i/_d)+1}function St(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Tn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return St(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):St(e+1,2)},d(n,t){return St(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return St(n.getHours()%12||12,t.length)},H(n,t){return St(n.getHours(),t.length)},m(n,t){return St(n.getMinutes(),t.length)},s(n,t){return St(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return St(s,t.length)}},xi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ad={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Tn.y(n,t)},Y:function(n,t,e,i){const s=ma(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return St(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):St(r,t.length)},R:function(n,t){const e=wd(n);return St(e,t.length)},u:function(n,t){const e=n.getFullYear();return St(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 St(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return St(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Tn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return St(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Ed(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):St(s,t.length)},I:function(n,t,e){const i=Od(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):St(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Tn.d(n,t)},D:function(n,t,e){const i=v_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):St(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return St(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return St(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return St(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=xi.noon:i===0?s=xi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=xi.evening:i>=12?s=xi.afternoon:i>=4?s=xi.morning:s=xi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Tn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Tn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):St(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):St(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Tn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Tn.s(n,t)},S:function(n,t){return Tn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Id(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Id(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Rd(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Rd(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return St(i,t.length)},T:function(n,t,e){return St(+n,t.length)}};function Rd(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+St(r,2)}function Id(n,t){return n%60===0?(n>0?"-":"+")+St(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=St(Math.trunc(i/60),2),r=St(i%60,2);return e+s+t+r}const Ld=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Nd=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ya={p:Nd,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ld(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Ld(i,t)).replace("{{time}}",Nd(s,t))}},k_=/^D+$/,D_=/^Y+$/,S_=["D","DD","YY","YYYY"];function Fd(n){return k_.test(n)}function zd(n){return D_.test(n)}function ba(n,t,e){const i=T_(n,t,e);if(console.warn(i),S_.includes(n))throw new RangeError(i)}function T_(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 C_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,P_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,O_=/^'([^]*?)'?$/,E_=/''/g,A_=/[a-zA-Z]/;function Bd(n,t,e){var u,d,f,g,p,y,x,M;const i=qn(),s=(e==null?void 0:e.locale)??i.locale??Pd,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(f=i.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((y=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??i.weekStartsOn??((M=(x=i.locale)==null?void 0:x.options)==null?void 0:M.weekStartsOn)??0,a=ot(n,e==null?void 0:e.in);if(!fa(a))throw new RangeError("Invalid time value");let l=t.match(P_).map(v=>{const D=v[0];if(D==="p"||D==="P"){const S=ya[D];return S(v,s.formatLong)}return v}).join("").match(C_).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const D=v[0];if(D==="'")return{isToken:!1,value:R_(v)};if(Ad[D])return{isToken:!0,value:v};if(D.match(A_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(v=>{if(!v.isToken)return v.value;const D=v.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&zd(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Fd(D))&&ba(D,t,String(n));const S=Ad[D[0]];return S(a,D,s.localize,c)}).join("")}function R_(n){const t=n.match(O_);return t?t[1].replace(E_,"'"):n}function Hd(){return Object.assign({},qn())}function I_(n,t){const e=ot(n,t==null?void 0:t.in).getDay();return e===0?7:e}function L_(n,t){const e=N_(t)?new t(0):zt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function N_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const F_=10;class Wd{constructor(){O(this,"subPriority",0)}validate(t,e){return!0}}class z_ extends Wd{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class B_ extends Wd{constructor(e,i){super();O(this,"priority",F_);O(this,"subPriority",-1);this.context=e||(s=>zt(i,s))}set(e,i){return i.timestampIsSet?e:zt(e,L_(e,this.context))}}class xt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new z_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class H_ extends xt{constructor(){super(...arguments);O(this,"priority",140);O(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const jt={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}/},Xe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Vt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Nt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function qe(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*bi+r*ms+o*b0),rest:t.slice(e[0].length)}}function Yd(n){return Nt(jt.anyDigitsSigned,n)}function Bt(n,t){switch(n){case 1:return Nt(jt.singleDigit,t);case 2:return Nt(jt.twoDigits,t);case 3:return Nt(jt.threeDigits,t);case 4:return Nt(jt.fourDigits,t);default:return Nt(new RegExp("^\\d{1,"+n+"}"),t)}}function Pr(n,t){switch(n){case 1:return Nt(jt.singleDigitSigned,t);case 2:return Nt(jt.twoDigitsSigned,t);case 3:return Nt(jt.threeDigitsSigned,t);case 4:return Nt(jt.fourDigitsSigned,t);default:return Nt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function _a(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function jd(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function Vd(n){return n%400===0||n%4===0&&n%100!==0}class W_ extends xt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return Vt(Bt(4,e),r);case"yo":return Vt(s.ordinalNumber(e,{unit:"year"}),r);default:return Vt(Bt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=jd(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class Y_ extends xt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Vt(Bt(4,e),r);case"Yo":return Vt(s.ordinalNumber(e,{unit:"year"}),r);default:return Vt(Bt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=ma(e,r);if(s.isTwoDigitYear){const l=jd(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}}class j_ extends xt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Pr(i==="R"?4:i.length,e)}set(e,i,s){const r=zt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),_i(r)}}class V_ extends xt{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Pr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class $_ extends xt{constructor(){super(...arguments);O(this,"priority",120);O(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Bt(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class U_ extends xt{constructor(){super(...arguments);O(this,"priority",120);O(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Bt(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class X_ extends xt{constructor(){super(...arguments);O(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);O(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return Vt(Nt(jt.month,e),r);case"MM":return Vt(Bt(2,e),r);case"Mo":return Vt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class q_ extends xt{constructor(){super(...arguments);O(this,"priority",110);O(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return Vt(Nt(jt.month,e),r);case"LL":return Vt(Bt(2,e),r);case"Lo":return Vt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function G_(n,t,e){const i=ot(n,e==null?void 0:e.in),s=Ed(i,e)-t;return i.setDate(i.getDate()-s*7),ot(i,e==null?void 0:e.in)}class K_ extends xt{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Nt(jt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Ue(G_(e,s,r),r)}}function Z_(n,t,e){const i=ot(n,e==null?void 0:e.in),s=Od(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Q_ extends xt{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Nt(jt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return _i(Z_(e,s))}}const J_=[31,28,31,30,31,30,31,31,30,31,30,31],tx=[31,29,31,30,31,30,31,31,30,31,30,31];class ex extends xt{constructor(){super(...arguments);O(this,"priority",90);O(this,"subPriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Nt(jt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Bt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=Vd(s),o=e.getMonth();return r?i>=1&&i<=tx[o]:i>=1&&i<=J_[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class nx extends xt{constructor(){super(...arguments);O(this,"priority",90);O(this,"subpriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Nt(jt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Bt(i.length,e)}}validate(e,i){const s=e.getFullYear();return Vd(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function xa(n,t,e){var d,f,g,p;const i=qn(),s=(e==null?void 0:e.weekStartsOn)??((f=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=ot(n,e==null?void 0:e.in),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Tr(r,u,e)}class ix extends xt{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=xa(e,s,r),e.setHours(0,0,0,0),e}}class sx extends xt{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Vt(Bt(i.length,e),o);case"eo":return Vt(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=xa(e,s,r),e.setHours(0,0,0,0),e}}class rx extends xt{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Vt(Bt(i.length,e),o);case"co":return Vt(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=xa(e,s,r),e.setHours(0,0,0,0),e}}function ox(n,t,e){const i=ot(n,e==null?void 0:e.in),s=I_(i,e),r=t-s;return Tr(i,r,e)}class ax extends xt{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return Bt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Vt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Vt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Vt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Vt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=ox(e,s),e.setHours(0,0,0,0),e}}class lx extends xt{constructor(){super(...arguments);O(this,"priority",80);O(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(_a(s),0,0,0),e}}class cx extends xt{constructor(){super(...arguments);O(this,"priority",80);O(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(_a(s),0,0,0),e}}class ux extends xt{constructor(){super(...arguments);O(this,"priority",80);O(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(_a(s),0,0,0),e}}class dx extends xt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Nt(jt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class hx extends xt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Nt(jt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class fx extends xt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Nt(jt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class gx extends xt{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Nt(jt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class px extends xt{constructor(){super(...arguments);O(this,"priority",60);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Nt(jt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class mx extends xt{constructor(){super(...arguments);O(this,"priority",50);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Nt(jt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class yx extends xt{constructor(){super(...arguments);O(this,"priority",30);O(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Vt(Bt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class bx extends xt{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return qe(Xe.basicOptionalMinutes,e);case"XX":return qe(Xe.basic,e);case"XXXX":return qe(Xe.basicOptionalSeconds,e);case"XXXXX":return qe(Xe.extendedOptionalSeconds,e);case"XXX":default:return qe(Xe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:zt(e,e.getTime()-Cr(e)-s)}}class _x extends xt{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return qe(Xe.basicOptionalMinutes,e);case"xx":return qe(Xe.basic,e);case"xxxx":return qe(Xe.basicOptionalSeconds,e);case"xxxxx":return qe(Xe.extendedOptionalSeconds,e);case"xxx":default:return qe(Xe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:zt(e,e.getTime()-Cr(e)-s)}}class xx extends xt{constructor(){super(...arguments);O(this,"priority",40);O(this,"incompatibleTokens","*")}parse(e){return Yd(e)}set(e,i,s){return[zt(e,s*1e3),{timestampIsSet:!0}]}}class wx extends xt{constructor(){super(...arguments);O(this,"priority",20);O(this,"incompatibleTokens","*")}parse(e){return Yd(e)}set(e,i,s){return[zt(e,s),{timestampIsSet:!0}]}}const vx={G:new H_,y:new W_,Y:new Y_,R:new j_,u:new V_,Q:new $_,q:new U_,M:new X_,L:new q_,w:new K_,I:new Q_,d:new ex,D:new nx,E:new ix,e:new sx,c:new rx,i:new ax,a:new lx,b:new cx,B:new ux,h:new dx,H:new hx,K:new fx,k:new gx,m:new px,s:new mx,S:new yx,X:new bx,x:new _x,t:new xx,T:new wx},Mx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dx=/^'([^]*?)'?$/,Sx=/''/g,Tx=/\S/,Cx=/[a-zA-Z]/;function Px(n,t,e,i){var x,M,v,D,S,T,R,E;const s=()=>zt((i==null?void 0:i.in)||e,NaN),r=Hd(),o=(i==null?void 0:i.locale)??r.locale??Pd,a=(i==null?void 0:i.firstWeekContainsDate)??((M=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:M.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(v=r.locale)==null?void 0:v.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((T=(S=i==null?void 0:i.locale)==null?void 0:S.options)==null?void 0:T.weekStartsOn)??r.weekStartsOn??((E=(R=r.locale)==null?void 0:R.options)==null?void 0:E.weekStartsOn)??0;if(!t)return n?s():ot(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new B_(i==null?void 0:i.in,e)],d=t.match(kx).map(_=>{const b=_[0];if(b in ya){const P=ya[b];return P(_,o.formatLong)}return _}).join("").match(Mx),f=[];for(let _ of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&zd(_)&&ba(_,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Fd(_)&&ba(_,t,n);const b=_[0],P=vx[b];if(P){const{incompatibleTokens:I}=P;if(Array.isArray(I)){const N=f.find(j=>I.includes(j.token)||j.token===b);if(N)throw new RangeError(`The format string mustn't contain \`${N.fullToken}\` and \`${_}\` at the same time`)}else if(P.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);f.push({token:b,fullToken:_});const C=P.run(n,_,o.match,c);if(!C)return s();u.push(C.setter),n=C.rest}else{if(b.match(Cx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(_==="''"?_="'":b==="'"&&(_=Ox(_)),n.indexOf(_)===0)n=n.slice(_.length);else return s()}}if(n.length>0&&Tx.test(n))return s();const g=u.map(_=>_.priority).sort((_,b)=>b-_).filter((_,b,P)=>P.indexOf(_)===b).map(_=>u.filter(b=>b.priority===_).sort((b,P)=>P.subPriority-b.subPriority)).map(_=>_[0]);let p=ot(e,i==null?void 0:i.in);if(isNaN(+p))return s();const y={};for(const _ of g){if(!_.validate(p,c))return s();const b=_.set(p,y,c);Array.isArray(b)?(p=b[0],Object.assign(y,b[1])):p=b}return p}function Ox(n){return n.match(Dx)[1].replace(Sx,"'")}function Ex(n,t){const e=ot(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Ax(n,t){const e=ot(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Rx(n,t){const e=ot(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Ix(n){const t=n/bi;return Math.trunc(t)}function $d(n,t){const e=()=>zt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=zx(n);let r;if(s.date){const c=Bx(s.date,i);r=Hx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=Wx(s.time),isNaN(a)))return e();if(s.timezone){if(l=Yx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=ot(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return ot(o+a+l,t==null?void 0:t.in)}const Or={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Lx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Nx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Fx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function zx(n){const t={},e=n.split(Or.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Or.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Or.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Or.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Bx(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Hx(n,t){if(t===null)return new Date(NaN);const e=n.match(Lx);if(!e)return new Date(NaN);const i=!!e[4],s=ws(e[1]),r=ws(e[2])-1,o=ws(e[3]),a=ws(e[4]),l=ws(e[5])-1;if(i)return Xx(t,a,l)?jx(t,a,l):new Date(NaN);{const c=new Date(0);return!$x(t,r,o)||!Ux(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function ws(n){return n?parseInt(n):1}function Wx(n){const t=n.match(Nx);if(!t)return NaN;const e=wa(t[1]),i=wa(t[2]),s=wa(t[3]);return qx(e,i,s)?e*bi+i*ms+s*1e3:NaN}function wa(n){return n&&parseFloat(n.replace(",","."))||0}function Yx(n){if(n==="Z")return 0;const t=n.match(Fx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Gx(i,s)?e*(i*bi+s*ms):NaN}function jx(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Vx=[31,null,31,30,31,30,31,31,30,31,30,31];function Ud(n){return n%400===0||n%4===0&&n%100!==0}function $x(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Vx[t]||(Ud(n)?29:28))}function Ux(n,t){return t>=1&&t<=(Ud(n)?366:365)}function Xx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function qx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Gx(n,t){return t>=0&&t<=59}const Er=n=>["interactive","zoom-interactive"].includes(n),Kx=(n,t,e)=>{var r,o;const{tooltip:i}=t;if(i.opacity===0&&!Er(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(i.body&&!Er(n.interactionMode)){const a=i.labelColors,l=((o=(r=t.chart.config)==null?void 0:r.options)==null?void 0:o.indexAxis)==="y"?"x":"y";n.tooltipContext=xh(new Date(i.dataPoints[0].parsed.x),e,!0),n.tooltipSeries=i.dataPoints.map((c,u)=>{const d=c.parsed[l],f=wh(d,n.units,{translateUnit:n.translateUnit}),g=c.dataset.label;return{backgroundColor:a[u].backgroundColor,borderColor:a[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(s),n.left=`${i.x}px`,n.top=`${i.y}px`,n.showTooltip=!0}},Xd=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!Er(n.interactionMode)){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!Er(n.interactionMode)){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["gauge","donut"].includes(n.chartType);l?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((c,u)=>{const d=l?c.parsed:c.parsed[a],f=wh(d,n.units,{translateUnit:n.translateUnit});let g;return l?g=c.dataset.labels[c.dataIndex]:g=c.dataset.label,{backgroundColor:o[u].backgroundColor,borderColor:o[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Zx=n=>n&&n.datasets&&n.datasets.length,Qx=n=>Zx(n)&&n.datasets.some(t=>t.data.length),Jx=n=>n.datasets.some(t=>t.data[0]&&fa(t.data[0].x)),tw=n=>!!Qx(n)&&n.datasets.some(t=>t.data.length==1),ew=n=>Jx(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),va=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},nw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Ma(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const qd=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},iw=2,Gd=10,Kd=12,ka=new Intl.NumberFormat(((dg=document==null?void 0:document.documentElement)==null?void 0:dg.lang)||"en-US"),Ar=10,Zd={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Rr=(n,t)=>(t||on)[n%on.length],Qd=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},Jd="#6f7787",th={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"}},sw=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=th[t])==null?void 0:e.background)||"#fafafa"},rw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},ow={"4XX":"#FFBA81","5XX":"#FF8484"},aw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},lw="#dad4c7",eh="#afb7c5",cw=n=>{const t=Object.entries(Zd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Zd.standard},Da=(n,t,e,i)=>{let s;return e?s=eh:Array.isArray(i)?s=Rr(n,i):s=i[t],s||Rr(n)},uw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},dw=2,hw=0,Sa=new Map,Ta=(n,t)=>t==="bytes"?Nr(n):t==="count/minute"?n.toFixed(2):ka.format(n),nh=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},fw=()=>{const n="label_height";if(!Sa.has(n)){const t=It({});Sa.set(n,t.lineHeight)}return Sa.get(n)},gw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),ih=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),sh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ca="#e0e4ea",pw={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},vs=(n,t)=>{let e=1;const i=pw[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},rh=new Map([[100,vs("100",[100,101,102,103])],[200,vs("200",[200,201,202,203,204,205,206,207,208,226])],[300,vs("300",[300,301,302,303,304,305,307,308])],[400,vs("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,vs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Pa=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=rh.get(e);return i===void 0?Ca:i.get(t)??i.get(-1)??Ca},mw=n=>{const t=Pa(n);return{solid:t,light:t}},Ir={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Pa(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function oh(n,t,e){const i=Hd(),s=_w(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?yw(s,t):bw(s,t)}function yw(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 bw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function _w(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function xw(n,t){const e=Dw(t);return"formatToParts"in e?vw(e,n):Mw(e,n)}const ww={year:0,month:1,day:2,hour:3,minute:4,second:5};function vw(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=ww[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Mw(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 Oa={},ah=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")),kw=ah==="06/25/2014, 00:00:00"||ah==="06/25/2014 00:00:00";function Dw(n){return Oa[n]||(Oa[n]=kw?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"})),Oa[n]}function lh(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const ch=36e5,Sw=6e4,Ea={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Aa(n,t,e){if(!n)return 0;let i=Ea.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Ea.timezoneHH.exec(n),i)return s=parseInt(i[1],10),uh(s)?-(s*ch):NaN;if(i=Ea.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return uh(s,o)?(r=Math.abs(s)*ch+o*Sw,i[1]==="+"?-r:r):NaN}if(Pw(n)){t=new Date(t||Date.now());const o=e?t:Tw(t),a=Ra(o,n);return-(e?a:Cw(t,a,n))}return NaN}function Tw(n){return lh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ra(n,t){const e=xw(n,t),i=lh(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function Cw(n,t,e){let s=n.getTime()-t;const r=Ra(new Date(s),e);if(t===r)return t;s-=r-t;const o=Ra(new Date(s),e);return r===o?r:Math.max(r,o)}function uh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const dh={};function Pw(n){if(dh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),dh[n]=!0,!0}catch{return!1}}const Ow=60*1e3,Ew={X:function(n,t,e){const i=Ia(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return hh(i);case"XXXX":case"XX":return wi(i);case"XXXXX":case"XXX":default:return wi(i,":")}},x:function(n,t,e){const i=Ia(e.timeZone,n);switch(t){case"x":return hh(i);case"xxxx":case"xx":return wi(i);case"xxxxx":case"xxx":default:return wi(i,":")}},O:function(n,t,e){const i=Ia(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Aw(i,":");case"OOOO":default:return"GMT"+wi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return oh("short",n,e);case"zzzz":default:return oh("long",n,e)}}};function Ia(n,t){const e=n?Aa(n,t,!0)/Ow:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Lr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function wi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Lr(Math.floor(i/60),2),r=Lr(Math.floor(i%60),2);return e+s+t+r}function hh(n,t){return n%60===0?(n>0?"-":"+")+Lr(Math.abs(n)/60,2):wi(n,t)}function Aw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Lr(r,2)}function fh(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 Rw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,La=36e5,gh=6e4,Iw=2,ae={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:Rw};function ph(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?Iw: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=Lw(n),{year:s,restDateString:r}=Nw(i.date,e),o=Fw(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=zw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Aa(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=fh(new Date(a+l)),c=fh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Lw(n){const t={};let e=ae.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ae.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ae.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Nw(n,t){if(n){const e=ae.YYY[t],i=ae.YYYYY[t];let s=ae.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ae.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Fw(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ae.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,bh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ae.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Ww(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ae.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return bh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ae.Www.exec(n),r)return s=parseInt(r[1],10)-1,_h(s)?mh(t,s):new Date(NaN);if(r=ae.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return _h(s,o)?mh(t,s,o):new Date(NaN)}return null}function zw(n){let t,e,i=ae.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Na(t)?t%24*La:NaN;if(i=ae.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Na(t,e)?t%24*La+e*gh:NaN;if(i=ae.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Na(t,e,s)?t%24*La+e*gh+s*1e3:NaN}return null}function mh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Bw=[31,28,31,30,31,30,31,31,30,31,30,31],Hw=[31,29,31,30,31,30,31,31,30,31,30,31];function yh(n){return n%400===0||n%4===0&&n%100!==0}function bh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=yh(n);if(i&&e>Hw[t]||!i&&e>Bw[t])return!1}return!0}function Ww(n,t){if(t<1)return!1;const e=yh(n);return!(e&&t>366||!e&&t>365)}function _h(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Na(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Yw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Fa(n,t,e={}){t=String(t);const i=t.match(Yw);if(i){const s=ph(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Ew[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Bd(n,t,e)}function jw(n,t,e){n=ph(n,e);const i=Aa(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Zn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Fa(jw(n,t,{timeZone:i.timeZone}),e,i)}const xh=(n,t,e,i)=>{const s=Intl.DateTimeFormat().resolvedOptions().timeZone;switch(t){case"secondly":case"tenSecondly":case"thirtySecondly":return Zn(n,s,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a");case"minutely":case"fiveMinutely":case"tenMinutely":case"thirtyMinutely":case"hourly":case"twoHourly":return Zn(n,s,e?"yyyy-MM-dd h:mm a":"h:mm a");case"twelveHourly":return Zn(n,s,"yyyy-MM-dd h:mm a");case"daily":return Zn(n,s,"yyyy-MM-dd");case"weekly":return`${Zn(n,s,"yyyy")} W${Zn(n,s,"II")}`;default:return Zn(n,s,"yyyy-MM-dd h:mm:ss a")}},Nr=(n,t)=>{if(isNaN(n))return"0 B";const{i18n:e}=gt.useI18n(),i=t?0x4000000000000:1e15,s=t?1099511627776:1e12,r=t?1073741824:1e9,o=t?1048576:1e6,a=t?1024:1e3;let l;return n>=i?l=e.formatNumber(Number.parseFloat((n/i).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):n>=s?l=e.formatNumber(Number.parseFloat((n/s).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):n>=r?l=e.formatNumber(Number.parseFloat((n/r).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):n>=o?l=e.formatNumber(Number.parseFloat((n/o).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):n>=a?l=e.formatNumber(Number.parseFloat((n/a).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):l=e.formatNumber(Number.parseFloat(n.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),l.replace(/([a-zA-Z]*)$/," $1")},Vw=(n,t="USD")=>{if(isNaN(n))return t==="USD"?"$0.00":`${n}`;const{i18n:e}=gt.useI18n();return n>=.01||t!=="USD"?e.formatNumber(n,{style:"currency",currency:t}):n<1e-4?"< $0.0001":`$${Number.parseFloat(n.toPrecision(4))}`},wh=(n,t,{isBytes1024:e=!1,currency:i="USD",translateUnit:s=r=>r}={})=>{const r=s(t,n);switch(t){case"bytes":return Nr(n,e);case"usd":return Vw(n,i);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(n)?`${n}`:n>=.01?`${ka.format(Number.parseFloat(n.toFixed(2)))} ${r}`:`${Number.parseFloat(n.toPrecision(4))} ${r}`}};function $w(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};$e.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=u.width/2,g=va(c,d,f),p=c.y,y=c.x<f?"left":"center";return{x:g-n.tooltipState.offsetX,y:p-n.tooltipState.offsetY,xAlign:y}},Uo.modes.customInteractionMode=function(l,c){const u=kn(c,l),d=[];return Uo.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,g,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p})}),d};const s=n.numLabels.value>25?Gd:Kd,r=({chart:l,index:c})=>{var d;const u=l.data;return{size:s,style:(d=u==null?void 0:u.isLabelEmpty)!=null&&d[c]?"italic":"normal"}},o=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Ar?c.slice(0,Ar)+"...":c):l.getLabelForValue(Number(c)),a=h.computed(()=>{var l,c,u,d,f,g,p,y;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:r,callback:function(x,M){return o(this,x,M)}},title:{display:n.indexAxis==="y"?!rt((l=n.metricAxesTitle)==null?void 0:l.value):!rt((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(x,M){return o(this,x,M)}},title:{display:n.indexAxis==="x"?!rt((f=n.metricAxesTitle)==null?void 0:f.value):!rt((g=n.dimensionAxesTitle)==null?void 0:g.value),text:n.indexAxis==="x"?(p=n.metricAxesTitle)==null?void 0:p.value:(y=n.dimensionAxesTitle)==null?void 0:y.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{Xd(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return h.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),a}Oe.register(...m0);const Uw=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function Xw(n,t,e,i,s){const r=h.shallowRef(null),o=(a,l)=>{if(t.value)return new Oe(t.value,{type:n,data:a,plugins:i,options:l})};return h.onMounted(()=>{r.value=o(e.value,s.value)}),h.onBeforeUnmount(()=>{rt(r.value)||r.value.destroy()}),h.watch(e,(a,l)=>{if(Uw(l,a)&&!rt(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else rt(r.value)||r.value.destroy(),r.value=o(a,s.value)}),h.watch(t,()=>{rt(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),h.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(rt(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function za(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,y){y&&y%3===0&&f.push(d),f.push(p)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<o?d=e(c,r,u)+"m":c<a?d=t(e(c,o,u),u)+"b":d=t(e(c,a,u),u)+"t",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(vh);var qw=vh.exports;const Ms=za(qw);function Gw(n,t,e){const{i18n:i}=gt.useI18n(),{translateUnit:s}=gt.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=Nr(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:Ms(l,{capital:!0}),unit:u})||`${Ms(l,{capital:!0})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var Kw=Object.defineProperty,Zw=(n,t,e)=>t in n?Kw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ee=(n,t,e)=>Zw(n,typeof t!="symbol"?t+"":t,e),ft=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(ft||{});const Mh=["in","not_in","selector"],kh=["empty","not_empty"],Qw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],ks=n=>n.filter(t=>t!=="time"),Dh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Ba=ks(Dh),Jw=["active_services","request_count","request_per_minute","response_latency_average"],t1=[...Dh,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Ha=ks(t1);[...Jw];const e1=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],Wa=ks(e1);ks(["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),ks(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Ba),new Set(Ha),new Set(Wa),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Mh},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:kh}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Ha,...Ba,...Wa])]),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Mh},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:kh}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Ha,...Ba,...Wa])]);const Sh=6048e5,n1=864e5,i1=60,s1=3600,Th=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Th in n?n[Th](t):n instanceof Date?new n.constructor(t):new Date(t)}function le(n,t){return Ae(t||n,n)}function Ch(n,t,e){const i=le(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function r1(n,t,e){const i=le(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let o1={};function Ds(){return o1}function an(n,t){var e,i,s,r;const o=Ds(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=le(n,t==null?void 0:t.in),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Fr(n,t){return an(n,{...t,weekStartsOn:1})}function Ph(n,t){const e=le(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Fr(s),o=Ae(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=Fr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Oh(n){const t=le(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 a1(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function zr(n,t){const e=le(n,void 0);return e.setHours(0,0,0,0),e}function l1(n,t,e){const[i,s]=a1(void 0,n,t),r=zr(i),o=zr(s),a=+r-Oh(r),l=+o-Oh(o);return Math.round((a-l)/n1)}function c1(n,t){const e=Ph(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Fr(i)}function u1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function d1(n){return!(!u1(n)&&typeof n!="number"||isNaN(+le(n)))}function vi(n,t){const e=le(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function h1(n,t){const e=le(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const f1={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"}},g1=(n,t,e)=>{let i;const s=f1[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ya(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const p1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},m1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},y1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},b1={date:Ya({formats:p1,defaultWidth:"full"}),time:Ya({formats:m1,defaultWidth:"full"}),dateTime:Ya({formats:y1,defaultWidth:"full"})},_1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},x1=(n,t,e,i)=>_1[n];function Ss(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const w1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},v1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},M1={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"]},k1={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"]},D1={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"}},S1={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"}},T1=(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"},C1={ordinalNumber:T1,era:Ss({values:w1,defaultWidth:"wide"}),quarter:Ss({values:v1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ss({values:M1,defaultWidth:"wide"}),day:Ss({values:k1,defaultWidth:"wide"}),dayPeriod:Ss({values:D1,defaultWidth:"wide",formattingValues:S1,defaultFormattingWidth:"wide"})};function Ts(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?O1(a,d=>d.test(o)):P1(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function P1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function O1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function E1(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const A1=/^(\d+)(th|st|nd|rd)?/i,R1=/\d+/i,I1={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},L1={any:[/^b/i,/^(a|c)/i]},N1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},F1={any:[/1/i,/2/i,/3/i,/4/i]},z1={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},B1={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]},H1={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},W1={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]},Y1={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},j1={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}},V1={ordinalNumber:E1({matchPattern:A1,parsePattern:R1,valueCallback:n=>parseInt(n,10)}),era:Ts({matchPatterns:I1,defaultMatchWidth:"wide",parsePatterns:L1,defaultParseWidth:"any"}),quarter:Ts({matchPatterns:N1,defaultMatchWidth:"wide",parsePatterns:F1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ts({matchPatterns:z1,defaultMatchWidth:"wide",parsePatterns:B1,defaultParseWidth:"any"}),day:Ts({matchPatterns:H1,defaultMatchWidth:"wide",parsePatterns:W1,defaultParseWidth:"any"}),dayPeriod:Ts({matchPatterns:Y1,defaultMatchWidth:"any",parsePatterns:j1,defaultParseWidth:"any"})},$1={code:"en-US",formatDistance:g1,formatLong:b1,formatRelative:x1,localize:C1,match:V1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function U1(n,t){const e=le(n,void 0);return l1(e,h1(e))+1}function X1(n,t){const e=le(n,void 0),i=+Fr(e)-+c1(e);return Math.round(i/Sh)+1}function Eh(n,t){var e,i,s,r;const o=le(n,t==null?void 0:t.in),a=o.getFullYear(),l=Ds(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=an(u,t),f=Ae((t==null?void 0:t.in)||n,0);f.setFullYear(a,0,c),f.setHours(0,0,0,0);const g=an(f,t);return+o>=+d?a+1:+o>=+g?a:a-1}function q1(n,t){var e,i,s,r;const o=Ds(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Eh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),an(c,t)}function G1(n,t){const e=le(n,t==null?void 0:t.in),i=+an(e,t)-+q1(e,t);return Math.round(i/Sh)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Cn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},Mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ah={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Cn.y(n,t)},Y:function(n,t,e,i){const s=Eh(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Tt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=Ph(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Cn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=G1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=X1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Cn.d(n,t)},D:function(n,t,e){const i=U1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Mi.noon:i===0?s=Mi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Mi.evening:i>=12?s=Mi.afternoon:i>=4?s=Mi.morning:s=Mi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Cn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Cn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Cn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Cn.s(n,t)},S:function(n,t){return Cn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ih(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Ih(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Rh(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Rh(i,":");case"zzzz":default:return"GMT"+Qn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function Rh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function Ih(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Qn(n,t)}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Lh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Nh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},K1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Lh(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Lh(i,t)).replace("{{time}}",Nh(s,t))},Z1={p:Nh,P:K1},Q1=/^D+$/,J1=/^Y+$/,tv=["D","DD","YY","YYYY"];function ev(n){return Q1.test(n)}function nv(n){return J1.test(n)}function iv(n,t,e){const i=sv(n,t,e);if(console.warn(i),tv.includes(n))throw new RangeError(i)}function sv(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 rv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ov=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,av=/^'([^]*?)'?$/,lv=/''/g,cv=/[a-zA-Z]/;function uv(n,t,e){var i,s,r,o,a,l,c,u;const d=Ds(),f=(e==null?void 0:e.locale)??d.locale??$1,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,y=le(n,e==null?void 0:e.in);if(!d1(y))throw new RangeError("Invalid time value");let x=t.match(ov).map(v=>{const D=v[0];if(D==="p"||D==="P"){const S=Z1[D];return S(v,f.formatLong)}return v}).join("").match(rv).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const D=v[0];if(D==="'")return{isToken:!1,value:dv(v)};if(Ah[D])return{isToken:!0,value:v};if(D.match(cv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:v}});f.localize.preprocessor&&(x=f.localize.preprocessor(y,x));const M={firstWeekContainsDate:g,weekStartsOn:p,locale:f};return x.map(v=>{if(!v.isToken)return v.value;const D=v.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&nv(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&ev(D))&&iv(D,t,String(n));const S=Ah[D[0]];return S(y,D,f.localize,M)}).join("")}function dv(n){const t=n.match(av);return t?t[1].replace(lv,"'"):n}function hv(n,t){const e=le(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function fv(){return Object.assign({},Ds())}function gv(n){return Math.trunc(n*s1)}function pv(n){const t=n/i1;return Math.trunc(t)}function Fh(n,t,e){return r1(n,-1)}function zh(n,t,e){const i=fv(),s=bv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?mv(s,t):yv(s,t)}function mv(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 yv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function bv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function _v(n,t){const e=kv(t);return"formatToParts"in e?wv(e,n):vv(e,n)}const xv={year:0,month:1,day:2,hour:3,minute:4,second:5};function wv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=xv[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function vv(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ja={},Bh=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")),Mv=Bh==="06/25/2014, 00:00:00"||Bh==="06/25/2014 00:00:00";function kv(n){return ja[n]||(ja[n]=Mv?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ja[n]}function Va(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const Hh=36e5,Dv=6e4,$a={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Cs(n,t,e){if(!n)return 0;let i=$a.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=$a.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Wh(s)?-(s*Hh):NaN;if(i=$a.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Wh(s,o)?(r=Math.abs(s)*Hh+o*Dv,i[1]==="+"?-r:r):NaN}if(Cv(n)){t=new Date(t||Date.now());const o=e?t:Sv(t),a=Ua(o,n);return-(e?a:Tv(t,a,n))}return NaN}function Sv(n){return Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ua(n,t){const e=_v(n,t),i=Va(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function Tv(n,t,e){let i=n.getTime()-t;const s=Ua(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ua(new Date(i),e);return s===r?s:Math.max(s,r)}function Wh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Yh={};function Cv(n){if(Yh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Yh[n]=!0,!0}catch{return!1}}const Pv=60*1e3,Ov={X:function(n,t,e){const i=Xa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return jh(i);case"XXXX":case"XX":return ki(i);case"XXXXX":case"XXX":default:return ki(i,":")}},x:function(n,t,e){const i=Xa(e.timeZone,n);switch(t){case"x":return jh(i);case"xxxx":case"xx":return ki(i);case"xxxxx":case"xxx":default:return ki(i,":")}},O:function(n,t,e){const i=Xa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ev(i,":");case"OOOO":default:return"GMT"+ki(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return zh("short",n,e);case"zzzz":default:return zh("long",n,e)}}};function Xa(n,t){const e=n?Cs(n,t,!0)/Pv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Br(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function ki(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Br(Math.floor(i/60),2),r=Br(Math.floor(i%60),2);return e+s+t+r}function jh(n,t){return n%60===0?(n>0?"-":"+")+Br(Math.abs(n)/60,2):ki(n,t)}function Ev(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Br(r,2)}function Vh(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 $h=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,qa=36e5,Uh=6e4,Av=2,ce={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:$h};function Hr(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?Av: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=Rv(n),{year:s,restDateString:r}=Iv(i.date,e),o=Lv(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Nv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Cs(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=Vh(new Date(a+l)),c=Vh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Rv(n){const t={};let e=ce.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ce.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ce.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Iv(n,t){if(n){const e=ce.YYY[t],i=ce.YYYYY[t];let s=ce.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ce.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Lv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ce.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Gh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ce.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Bv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ce.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Gh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ce.Www.exec(n),r)return s=parseInt(r[1],10)-1,Kh(s)?Xh(t,s):new Date(NaN);if(r=ce.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Kh(s,o)?Xh(t,s,o):new Date(NaN)}return null}function Nv(n){let t,e,i=ce.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*qa:NaN;if(i=ce.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ga(t,e)?t%24*qa+e*Uh:NaN;if(i=ce.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ga(t,e,s)?t%24*qa+e*Uh+s*1e3:NaN}return null}function Xh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Fv=[31,28,31,30,31,30,31,31,30,31,30,31],zv=[31,29,31,30,31,30,31,31,30,31,30,31];function qh(n){return n%400===0||n%4===0&&n%100!==0}function Gh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=qh(n);if(i&&e>zv[t]||!i&&e>Fv[t])return!1}return!0}function Bv(n,t){if(t<1)return!1;const e=qh(n);return!(e&&t>366||!e&&t>365)}function Kh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ga(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Hv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Wv(n,t,e={}){t=String(t);const i=t.match(Hv);if(i){const s=Hr(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Ov[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return uv(n,t,e)}function Zh(n,t,e){n=Hr(n,e);const i=Cs(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Yv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Wv(Zh(n,t,{timeZone:i.timeZone}),e,i)}function jv(n,t,e){if(typeof n=="string"&&!n.match($h))return Hr(n,{...e,timeZone:t});n=Hr(n,e);const i=Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Cs(t,new Date(i));return new Date(i+s)}function Vv(n,t){return-Cs(n,t)}function Di(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return Yv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const $v={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Ka(n){return n&&Qw.find(t=>n<=$v[t])||null}var Wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Yr={exports:{}};Yr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object GeneratorFunction]",f="[object Map]",g="[object Number]",p="[object Object]",y="[object Promise]",x="[object RegExp]",M="[object Set]",v="[object String]",D="[object Symbol]",S="[object WeakMap]",T="[object ArrayBuffer]",R="[object DataView]",E="[object Float32Array]",_="[object Float64Array]",b="[object Int8Array]",P="[object Int16Array]",I="[object Int32Array]",C="[object Uint8Array]",N="[object Uint8ClampedArray]",j="[object Uint16Array]",$="[object Uint32Array]",X=/[\\^$.*+?()[\]{}|]/g,H=/\w*$/,ut=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,tt={};tt[r]=tt[o]=tt[T]=tt[R]=tt[a]=tt[l]=tt[E]=tt[_]=tt[b]=tt[P]=tt[I]=tt[f]=tt[g]=tt[p]=tt[x]=tt[M]=tt[v]=tt[D]=tt[C]=tt[N]=tt[j]=tt[$]=!0,tt[c]=tt[u]=tt[S]=!1;var U=typeof Wr=="object"&&Wr&&Wr.Object===Object&&Wr,B=typeof self=="object"&&self&&self.Object===Object&&self,Q=U||B||Function("return this")(),wt=t&&!t.nodeType&&t,dt=wt&&!0&&n&&!n.nodeType&&n,vt=dt&&dt.exports===wt;function et(w,A){return w.set(A[0],A[1]),w}function At(w,A){return w.add(A),w}function F(w,A){for(var z=-1,G=w?w.length:0;++z<G&&A(w[z],z,w)!==!1;);return w}function W(w,A){for(var z=-1,G=A.length,$t=w.length;++z<G;)w[$t+z]=A[z];return w}function K(w,A,z,G){for(var $t=-1,Gt=w?w.length:0;++$t<Gt;)z=A(z,w[$t],$t,w);return z}function J(w,A){for(var z=-1,G=Array(w);++z<w;)G[z]=A(z);return G}function q(w,A){return w==null?void 0:w[A]}function at(w){var A=!1;if(w!=null&&typeof w.toString!="function")try{A=!!(w+"")}catch{}return A}function st(w){var A=-1,z=Array(w.size);return w.forEach(function(G,$t){z[++A]=[$t,G]}),z}function ht(w,A){return function(z){return w(A(z))}}function bt(w){var A=-1,z=Array(w.size);return w.forEach(function(G){z[++A]=G}),z}var Jt=Array.prototype,ue=Function.prototype,qt=Object.prototype,Ht=Q["__core-js_shared__"],_t=function(){var w=/[^.]+$/.exec(Ht&&Ht.keys&&Ht.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Pt=ue.toString,Wt=qt.hasOwnProperty,mt=qt.toString,Ge=RegExp("^"+Pt.call(Wt).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_e=vt?Q.Buffer:void 0,de=Q.Symbol,he=Q.Uint8Array,De=ht(Object.getPrototypeOf,Object),Se=Object.create,Lt=qt.propertyIsEnumerable,Te=Jt.splice,ne=Object.getOwnPropertySymbols,si=_e?_e.isBuffer:void 0,Rn=ht(Object.keys,Object),Ls=Nn(Q,"DataView"),ri=Nn(Q,"Map"),Ns=Nn(Q,"Promise"),oi=Nn(Q,"Set"),cn=Nn(Q,"WeakMap"),un=Nn(Object,"create"),Fs=re(Ls),zs=re(ri),ai=re(Ns),bl=re(oi),_l=re(cn),eo=de?de.prototype:void 0,no=eo?eo.valueOf:void 0;function dn(w){var A=-1,z=w?w.length:0;for(this.clear();++A<z;){var G=w[A];this.set(G[0],G[1])}}function Ai(){this.__data__=un?un(null):{}}function Bs(w){return this.has(w)&&delete this.__data__[w]}function io(w){var A=this.__data__;if(un){var z=A[w];return z===i?void 0:z}return Wt.call(A,w)?A[w]:void 0}function hn(w){var A=this.__data__;return un?A[w]!==void 0:Wt.call(A,w)}function xl(w,A){var z=this.__data__;return z[w]=un&&A===void 0?i:A,this}dn.prototype.clear=Ai,dn.prototype.delete=Bs,dn.prototype.get=io,dn.prototype.has=hn,dn.prototype.set=xl;function Be(w){var A=-1,z=w?w.length:0;for(this.clear();++A<z;){var G=w[A];this.set(G[0],G[1])}}function wl(){this.__data__=[]}function vl(w){var A=this.__data__,z=Ii(A,w);if(z<0)return!1;var G=A.length-1;return z==G?A.pop():Te.call(A,z,1),!0}function Ml(w){var A=this.__data__,z=Ii(A,w);return z<0?void 0:A[z][1]}function He(w){return Ii(this.__data__,w)>-1}function kl(w,A){var z=this.__data__,G=Ii(z,w);return G<0?z.push([w,A]):z[G][1]=A,this}Be.prototype.clear=wl,Be.prototype.delete=vl,Be.prototype.get=Ml,Be.prototype.has=He,Be.prototype.set=kl;function In(w){var A=-1,z=w?w.length:0;for(this.clear();++A<z;){var G=w[A];this.set(G[0],G[1])}}function Dl(){this.__data__={hash:new dn,map:new(ri||Be),string:new dn}}function Sl(w){return Fi(this,w).delete(w)}function Tl(w){return Fi(this,w).get(w)}function We(w){return Fi(this,w).has(w)}function Cl(w,A){return Fi(this,w).set(w,A),this}In.prototype.clear=Dl,In.prototype.delete=Sl,In.prototype.get=Tl,In.prototype.has=We,In.prototype.set=Cl;function Ln(w){this.__data__=new Be(w)}function Pl(){this.__data__=new Be}function Ol(w){return this.__data__.delete(w)}function El(w){return this.__data__.get(w)}function Ri(w){return this.__data__.has(w)}function Al(w,A){var z=this.__data__;if(z instanceof Be){var G=z.__data__;if(!ri||G.length<e-1)return G.push([w,A]),this;z=this.__data__=new In(G)}return z.set(w,A),this}Ln.prototype.clear=Pl,Ln.prototype.delete=Ol,Ln.prototype.get=El,Ln.prototype.has=Ri,Ln.prototype.set=Al;function Rl(w,A){var z=js(w)||Bi(w)?J(w.length,String):[],G=z.length,$t=!!G;for(var Gt in w)Wt.call(w,Gt)&&!($t&&(Gt=="length"||Kl(Gt,G)))&&z.push(Gt);return z}function Ie(w,A,z){var G=w[A];(!(Wt.call(w,A)&&Ys(G,z))||z===void 0&&!(A in w))&&(w[A]=z)}function Ii(w,A){for(var z=w.length;z--;)if(Ys(w[z][0],A))return z;return-1}function Il(w,A){return w&&so(A,li(A),w)}function Hs(w,A,z,G,$t,Gt,xe){var te;if(G&&(te=Gt?G(w,$t,Gt,xe):G(w)),te!==void 0)return te;if(!gn(w))return w;var ho=js(w);if(ho){if(te=ql(w),!A)return $l(w,te)}else{var Fn=Ke(w),fo=Fn==u||Fn==d;if(lo(w))return Bl(w,A);if(Fn==p||Fn==r||fo&&!Gt){if(at(w))return Gt?w:{};if(te=oo(fo?{}:w),!A)return Ul(w,Il(te,w))}else{if(!tt[Fn])return Gt?w:{};te=Gl(w,Fn,Hs,A)}}xe||(xe=new Ln);var go=xe.get(w);if(go)return go;if(xe.set(w,te),!ho)var ci=z?Xl(w):li(w);return F(ci||w,function($s,Hi){ci&&(Hi=$s,$s=w[Hi]),Ie(te,Hi,Hs($s,A,z,G,Hi,w,xe))}),te}function Ll(w){return gn(w)?Se(w):{}}function Nl(w,A,z){var G=A(w);return js(w)?G:W(G,z(w))}function Fl(w){return mt.call(w)}function Li(w){if(!gn(w)||Zl(w))return!1;var A=Vs(w)||at(w)?Ge:ut;return A.test(re(w))}function zl(w){if(!fn(w))return Rn(w);var A=[];for(var z in Object(w))Wt.call(w,z)&&z!="constructor"&&A.push(z);return A}function Bl(w,A){if(A)return w.slice();var z=new w.constructor(w.length);return w.copy(z),z}function Ni(w){var A=new w.constructor(w.byteLength);return new he(A).set(new he(w)),A}function Hl(w,A){var z=A?Ni(w.buffer):w.buffer;return new w.constructor(z,w.byteOffset,w.byteLength)}function Wl(w,A,z){var G=A?z(st(w),!0):st(w);return K(G,et,new w.constructor)}function Ws(w){var A=new w.constructor(w.source,H.exec(w));return A.lastIndex=w.lastIndex,A}function Yl(w,A,z){var G=A?z(bt(w),!0):bt(w);return K(G,At,new w.constructor)}function jl(w){return no?Object(no.call(w)):{}}function Vl(w,A){var z=A?Ni(w.buffer):w.buffer;return new w.constructor(z,w.byteOffset,w.length)}function $l(w,A){var z=-1,G=w.length;for(A||(A=Array(G));++z<G;)A[z]=w[z];return A}function so(w,A,z,G){z||(z={});for(var $t=-1,Gt=A.length;++$t<Gt;){var xe=A[$t],te=void 0;Ie(z,xe,te===void 0?w[xe]:te)}return z}function Ul(w,A){return so(w,ro(w),A)}function Xl(w){return Nl(w,li,ro)}function Fi(w,A){var z=w.__data__;return zi(A)?z[typeof A=="string"?"string":"hash"]:z.map}function Nn(w,A){var z=q(w,A);return Li(z)?z:void 0}var ro=ne?ht(ne,Object):co,Ke=Fl;(Ls&&Ke(new Ls(new ArrayBuffer(1)))!=R||ri&&Ke(new ri)!=f||Ns&&Ke(Ns.resolve())!=y||oi&&Ke(new oi)!=M||cn&&Ke(new cn)!=S)&&(Ke=function(w){var A=mt.call(w),z=A==p?w.constructor:void 0,G=z?re(z):void 0;if(G)switch(G){case Fs:return R;case zs:return f;case ai:return y;case bl:return M;case _l:return S}return A});function ql(w){var A=w.length,z=w.constructor(A);return A&&typeof w[0]=="string"&&Wt.call(w,"index")&&(z.index=w.index,z.input=w.input),z}function oo(w){return typeof w.constructor=="function"&&!fn(w)?Ll(De(w)):{}}function Gl(w,A,z,G){var $t=w.constructor;switch(A){case T:return Ni(w);case a:case l:return new $t(+w);case R:return Hl(w,G);case E:case _:case b:case P:case I:case C:case N:case j:case $:return Vl(w,G);case f:return Wl(w,G,z);case g:case v:return new $t(w);case x:return Ws(w);case M:return Yl(w,G,z);case D:return jl(w)}}function Kl(w,A){return A=A??s,!!A&&(typeof w=="number"||V.test(w))&&w>-1&&w%1==0&&w<A}function zi(w){var A=typeof w;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?w!=="__proto__":w===null}function Zl(w){return!!_t&&_t in w}function fn(w){var A=w&&w.constructor,z=typeof A=="function"&&A.prototype||qt;return w===z}function re(w){if(w!=null){try{return Pt.call(w)}catch{}try{return w+""}catch{}}return""}function Ql(w){return Hs(w,!0,!0)}function Ys(w,A){return w===A||w!==w&&A!==A}function Bi(w){return Jl(w)&&Wt.call(w,"callee")&&(!Lt.call(w,"callee")||mt.call(w)==r)}var js=Array.isArray;function ao(w){return w!=null&&tc(w.length)&&!Vs(w)}function Jl(w){return pn(w)&&ao(w)}var lo=si||uo;function Vs(w){var A=gn(w)?mt.call(w):"";return A==u||A==d}function tc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function gn(w){var A=typeof w;return!!w&&(A=="object"||A=="function")}function pn(w){return!!w&&typeof w=="object"}function li(w){return ao(w)?Rl(w):zl(w)}function co(){return[]}function uo(){return!1}n.exports=Ql}(Yr,Yr.exports),Yr.exports;const Si=(n,t)=>new Date(n.getTime()-Vv(t,n));class ze{constructor(t){Ee(this,"timeframeText"),Ee(this,"key"),Ee(this,"display"),Ee(this,"timeframeLength"),Ee(this,"allowedTiers"),Ee(this,"defaultResponseGranularity"),Ee(this,"dataGranularity"),Ee(this,"isRelative"),Ee(this,"fineGrainedDefaultGranularity"),Ee(this,"_startCustom"),Ee(this,"_endCustom"),Ee(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=jv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Zh(e,t)}}class Uv extends ze{rawStart(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Si(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Xv extends ze{rawStart(t){let e=vi(this.tzAdjustedDate(t));return t&&(e=Si(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class qv extends ze{rawEnd(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Si(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=an(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Si(i,t)),i}}class Gv extends ze{rawEnd(t){let e=vi(this.tzAdjustedDate(t));return t&&(e=Si(e,t)),e}rawStart(t){let e=vi(Fh(this.tzAdjustedDate(t)));return t&&(e=Si(e,t)),e}}ft.FIFTEEN_MIN,new ze({key:ft.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),ft.ONE_HOUR,new ze({key:ft.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),ft.SIX_HOUR,new ze({key:ft.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ft.TWELVE_HOUR,new ze({key:ft.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ft.ONE_DAY,new ze({key:ft.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ft.SEVEN_DAY,new ze({key:ft.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ft.THIRTY_DAY,new ze({key:ft.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),ft.CURRENT_WEEK,new Uv({key:ft.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=an(new Date,{weekStartsOn:1});return(zr(Ch(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ft.CURRENT_MONTH,new Xv({key:ft.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=vi(new Date);return(zr(Ch(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ft.PREVIOUS_WEEK,new qv({key:ft.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ft.PREVIOUS_MONTH,new Gv({key:ft.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=vi(new Date),e=vi(Fh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Kv(t,e)),60*60*24*hv(new Date().setMonth(new Date().getMonth()-1))+gv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Kv(n,t){return pv(n.getTimezoneOffset()-t.getTimezoneOffset())}ft.FIFTEEN_MIN,ft.ONE_HOUR,ft.SIX_HOUR,ft.TWELVE_HOUR,ft.ONE_DAY,ft.SEVEN_DAY,ft.FIFTEEN_MIN,ft.ONE_HOUR,ft.SIX_HOUR,ft.TWELVE_HOUR,ft.ONE_DAY,ft.SEVEN_DAY,ft.THIRTY_DAY,ft.CURRENT_WEEK,ft.CURRENT_MONTH,ft.PREVIOUS_WEEK,ft.PREVIOUS_MONTH;function Zv(n){return h.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${Di(e)} - ${Di(i,{includeTZ:!0})}`:""})}function Qv(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};$e.positioners[e]=function(r,o){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=a.width/2,u=va(o,l,c),d=o.y,f=o.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:d,xAlign:f}};const s=h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{Xd(n.tooltipState,r)}}}}));return h.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),{options:s}}function Jv(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return xh(d,n.granularity.value,o.value)}},title:{display:!rt((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=h.computed(()=>{var l,c;return{title:{display:!rt((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};$e.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,y=va(c,d,g);let x=nw(c,f,p);const M=c.y<p?"top":"bottom",v=c.x<g?"left":"center";return f>u.height&&(x=0),{x:y,y:x,xAlign:v,yAlign:M}};const o=h.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return Ix(l)>24||u.getDate()!==c.getDate()}),a=h.computed(()=>{var l;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:c=>{Kx(n.tooltipState,c,n.granularity.value)}}},interaction:{mode:"index",intersect:!1}}});return h.onUnmounted(()=>{$e.positioners[s]&&delete $e.positioners[s]}),{options:a}}function tM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=gt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Rr(i.indexOf(u),on),data:o.map((d,f)=>e?r[`${d.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const f=Da(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function eM(n,t){const{i18n:e}=gt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0,u=c&&a.length>1;if(!s.length||!o)return{datasets:[],labels:[]};const d=c&&a||o,f=d[0],g=d.length>1?d[1]:d[0],p=Object.fromEntries(l?s.flatMap(b=>o.map((P,I)=>{const C=b.event[f],N=c?`${C},${P}`:`${I},${P}`,j=b.event[P];return[N,j]})):s.map(b=>{const P=c?`${b.event[f]},${b.event[g]}`:`${f},${g}`,I=b.event[o[0]];return[P,I]})),y=Object.keys(p).reduce((b,P)=>{const[I]=P.split(","),C=p[P];return b[I]?b[I]+=C:b[I]=C,b},{}),x=Object.entries(y).sort(([,b],[,P])=>Number(P)-Number(b)).map(([b])=>b),M=r[f],v=r[g],D=c&&M&&Object.entries(M).map(([b,P])=>({id:b,name:P.name}))||o.map(b=>({id:b,name:b})),S=c&&v&&Object.entries(v).map(([b,P])=>({id:b,name:P.name}))||o.map(b=>({id:b,name:b}));if(f!=="status_code"&&f!=="status_code_grouped"&&(D.sort((b,P)=>x.indexOf(b.id)-x.indexOf(P.id)),S.sort((b,P)=>x.indexOf(b.id)-x.indexOf(P.id))),!D||!S)return{labels:[],datasets:[]};const T=tM({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:d,barSegmentLabels:S,pivotRecords:p,rowLabels:D,colorPalette:n.colorPalette||on}),R=c?D.map(b=>e&&e.te(`chartLabels.${b.name}`)&&e.t(`chartLabels.${b.name}`)||b.name):o.map(b=>e&&e.te(`chartLabels.${b}`)&&e.t(`chartLabels.${b}`)||b),E=D.map(b=>b.id==="empty");return{labels:R,datasets:T,isLabelEmpty:E,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const nM="#6c7489",iM="#6c7489",sM="#995c00",rM="16px",oM="20px",Qh="24px",aM="40px",lM="48px",cM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),uM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return $d(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},dM=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return cM(a,l,e)};function hM(n,t){const{i18n:e}=gt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],d=r[u],f=r&&d&&Object.keys(d).map(S=>({id:S,name:d[S].name}))||o.map(S=>({id:S,name:S})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const p=uM(a),y=dM(a,l,g,p,s),x=new Set,M=s!=null&&s.length?s.reduce((S,T)=>{const R=new Date(T.timestamp).valueOf(),E=T.event;for(const _ of o)x.add(_),R in S||(S[R]={}),_ in S[R]||(S[R][_]={});for(const _ of o)f.forEach(b=>{E[u]===b.id||_===b.id?(S[R][_]||(S[R][_]={}),S[R][_][b.name]=Math.round(Number(E[_])*1e3)/1e3):c.length||(S[R][_]||(S[R][_]={}),S[R][_][b.name]=Math.round(Number(E[b.id])*1e3)/1e3)});return S},{}):{},D=[...o.length===1?o.flatMap(S=>f.map(T=>[S,T.name,T.id==="empty"])):f.map(S=>[S.name,S.name,S.id==="empty"])].map(([S,T,R],E)=>{const _=y.map(C=>C in M&&S in M[C]?{x:C,y:M[C][S][T]||0}:{x:C,y:0});let{colorPalette:b,fill:P}=n;rt(b)&&(b=on);const I=Da(E,T,R,b);return{rawDimension:T,rawMetric:S,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:I,backgroundColor:I,data:_,total:_.reduce((C,{y:N})=>C+Number(N),0),...uw,fill:P,borderWidth:P?hw:dw,isSegmentEmpty:R}});if(u==="status_code"||u==="status_code_grouped"?D.sort((S,T)=>(S.label??"")<(T.label??"")?-1:1):D.sort((S,T)=>Number(S.total)<Number(T.total)?-1:1),n.threshold)for(const S of Object.keys(n.threshold)){const T=n.threshold[S];T&&D.push({type:"line",rawMetric:S,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:nM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:y.map(R=>({x:R,y:T}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const fM=(n,t)=>{h.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function gM(){const{i18n:n}=gt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const Jh="analytics-query-provider",tf=2;function pM(){const n=h.inject(Jh);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function mM(n,t){const e=h.computed(()=>{if(!n.value)return t.left;const s=n.value.getBoundingClientRect();return`${parseFloat(t.left)+s.left+window.scrollX}px`}),i=h.computed(()=>{if(!n.value)return t.top;const s=n.value.getBoundingClientRect();return`${parseFloat(t.top)+s.top+window.scrollY}px`});return{tooltipAbsoluteLeft:e,tooltipAbsoluteTop:i}}const gt={useBarChartOptions:$w,useChartJSCommon:Xw,useChartLegendValues:Gw,useChartSelectedRange:Zv,useExploreResultToDatasets:eM,useExploreResultToTimeDataset:hM,useDonutChartOptions:Qv,useLineChartOptions:Jv,useI18n:gg,useReportChartDataForSynthetics:fM,useTranslatedUnits:gM,useEvaluateFeatureFlag:pM,useTooltipAbsolutePosition:mM};var Ft=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Ft||{});/*!
|
|
18
|
+
`):n}function Bb(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function id(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),d=r.length,f=s.length,g=i.length,p=Xt(t.padding);let y=p.height,x=0,M=i.reduce((S,T)=>S+T.before.length+T.lines.length+T.after.length,0);if(M+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),M){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*S+(M-g)*l.lineHeight+(M-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const D=function(S){x=Math.max(x,e.measureText(S).width+v)};return e.save(),e.font=c.string,Dt(n.title,D),e.font=l.string,Dt(n.beforeBody.concat(n.afterBody),D),v=t.displayColors?o+2+t.boxPadding:0,Dt(i,S=>{Dt(S.before,D),Dt(S.lines,D),Dt(S.after,D)}),v=0,e.font=u.string,Dt(n.footer,D),e.restore(),x+=p.width,{width:x,height:y}}function Hb(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Wb(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function Yb(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Wb(c,n,t,e)&&(c="center"),c}function sd(n,t,e){const i=e.yAlign||t.yAlign||Hb(n,e);return{xAlign:e.xAlign||t.xAlign||Yb(n,t,e,i),yAlign:i}}function jb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Vb(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function rd(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=vn(o);let p=jb(t,a);const y=Vb(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Zt(p,0,i.width-t.width),y:Zt(y,0,i.height-t.height)}}function Mr(n,t,e){const i=Xt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function od(n){return Ve([],rn(n))}function $b(n,t,e){return Mn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ad(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const ld={beforeTitle:Qe,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:Qe,beforeBody:Qe,beforeLabel:Qe,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 ot(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:Qe,afterBody:Qe,beforeFooter:Qe,footer:Qe,afterFooter:Qe};function me(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?ld[t].call(e,i):s}class sa extends Qt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Fo(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=$b(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=me(i,"beforeTitle",this,t),r=me(i,"title",this,t),o=me(i,"afterTitle",this,t);let a=[];return a=Ve(a,rn(s)),a=Ve(a,rn(r)),a=Ve(a,rn(o)),a}getBeforeBody(t,e){return od(me(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return Dt(t,r=>{const o={before:[],lines:[],after:[]},a=ad(i,r);Ve(o.before,rn(me(a,"beforeLabel",this,r))),Ve(o.lines,me(a,"label",this,r)),Ve(o.after,rn(me(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return od(me(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=me(i,"beforeFooter",this,t),r=me(i,"footer",this,t),o=me(i,"afterFooter",this,t);let a=[];return a=Ve(a,rn(s)),a=Ve(a,rn(r)),a=Ve(a,rn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Bb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Dt(a,u=>{const d=ad(t.callbacks,u);s.push(me(d,"labelColor",this,u)),r.push(me(d,"labelPointStyle",this,u)),o.push(me(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=hs[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=id(this,i),c=Object.assign({},a,l),u=sd(this.chart,i,c),d=rd(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=vn(a),{x:f,y:g}=t,{width:p,height:y}=e;let x,M,v,D,S,T;return r==="center"?(S=g+y/2,s==="left"?(x=f,M=x-o,D=S+o,T=S-o):(x=f+p,M=x+o,D=S-o,T=S+o),v=x):(s==="left"?M=f+Math.max(l,u)+o:s==="right"?M=f+p-Math.max(c,d)-o:M=this.caretX,r==="top"?(D=g,S=D-o,x=M-o,v=M+o):(D=g+y,S=D+o,x=M+o,v=M-o),T=D),{x1:x,x2:M,x3:v,y1:D,y2:S,y3:T}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=mi(i.rtl,this.x,this.width);for(t.x=Mr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=It(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=It(r.bodyFont),d=Mr(this,"left",r),f=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,M=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Oo(t,y,x,M),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Oo(t,y,x,M)}else{t.lineWidth=ut(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const y=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),M=vn(o.borderRadius);Object.values(M).some(v=>v!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,fi(t,{x:y,y:p,w:c,h:l,radius:M}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),fi(t,{x,y:p+1,w:c-2,h:l-2,radius:M}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(x,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=It(i.bodyFont);let f=d.lineHeight,g=0;const p=mi(i.rtl,this.x,this.width),y=function(_){e.fillText(_,p.x(t.x+g),t.y+f/2),t.y+=f+r},x=p.textAlign(o);let M,v,D,S,T,A,O;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=Mr(this,x,i),e.fillStyle=i.bodyColor,Dt(this.beforeBody,y),g=a&&x!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,A=s.length;S<A;++S){for(M=s[S],v=this.labelTextColors[S],e.fillStyle=v,Dt(M.before,y),D=M.lines,a&&D.length&&(this._drawColorBox(e,t,S,p,i),f=Math.max(d.lineHeight,l)),T=0,O=D.length;T<O;++T)y(D[T]),f=d.lineHeight;Dt(M.after,y)}g=0,f=d.lineHeight,Dt(this.afterBody,y),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=mi(i.rtl,this.x,this.width);for(t.x=Mr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=It(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=vn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=hs[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=id(this,t),l=Object.assign({},o,this._size),c=sd(e,t,l),u=rd(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Xt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),jc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Vc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Gs(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Gs(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=hs[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}P(sa,"positioners",hs);var $e={id:"tooltip",_element:sa,positioners:hs,afterInit(n,t,e){e&&(n.tooltip=new sa({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:ld},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"]},Ub=Object.freeze({__proto__:null,Colors:rb,Decimation:cb,Filler:Pb,Legend:Lb,SubTitle:zb,Title:Fb,Tooltip:$e});const Xb=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function qb(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Xb(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Gb=(n,t)=>n===null?null:Zt(Math.round(n),0,t);function cd(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ra extends Un{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(ot(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:qb(i,t,it(e,t),this._addedLabels),Gb(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return cd.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(ra,"id","category"),P(ra,"defaults",{ticks:{callback:cd}});function Kb(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=r||1,p=u-1,{min:y,max:x}=t,M=!ot(o),v=!ot(a),D=!ot(c),S=(x-y)/(d+1);let T=pc((x-y)/p/g)*g,A,O,_,b;if(T<1e-14&&!M&&!v)return[{value:y},{value:x}];b=Math.ceil(x/T)-Math.floor(y/T),b>p&&(T=pc(b*T/p/g)*g),ot(l)||(A=Math.pow(10,l),T=Math.ceil(T*A)/A),s==="ticks"?(O=Math.floor(y/T)*T,_=Math.ceil(x/T)*T):(O=y,_=x),M&&v&&r&&Ug((a-o)/r,T/1e3)?(b=Math.round(Math.min((a-o)/T,u)),T=(a-o)/b,O=o,_=a):D?(O=M?o:O,_=v?a:_,b=c-1,T=(_-O)/b):(b=(_-O)/T,Ui(b,Math.round(b),T/1e3)?b=Math.round(b):b=Math.ceil(b));const C=Math.max(yc(T),yc(O));A=Math.pow(10,ot(l)?C:l),O=Math.round(O*A)/A,_=Math.round(_*A)/A;let R=0;for(M&&(f&&O!==o?(e.push({value:o}),O<o&&R++,Ui(Math.round((O+R*T)*A)/A,o,ud(o,S,n))&&R++):O<o&&R++);R<b;++R){const I=Math.round((O+R*T)*A)/A;if(v&&I>a)break;e.push({value:I})}return v&&f&&_!==a?e.length&&Ui(e[e.length-1].value,a,ud(a,S,n))?e[e.length-1].value=a:e.push({value:a}):(!v||_===a)&&e.push({value:_}),e}function ud(n,t,{horizontal:e,minRotation:i}){const s=Ut(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class kr extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return ot(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=Ye(s),c=Ye(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=Kb(s,r);return t.bounds==="ticks"&&mc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Gi(t,this.chart.options.locale,this.options.ticks.format)}}class oa extends kr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?t:0,this.max=Rt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ut(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(oa,"id","linear"),P(oa,"defaults",{ticks:{callback:nr.formatters.numeric}});const fs=n=>Math.floor(xn(n)),Xn=(n,t)=>Math.pow(10,fs(n)+t);function dd(n){return n/Math.pow(10,fs(n))===1}function hd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Zb(n,t){const e=t-n;let i=fs(e);for(;hd(n,t,i)>10;)i++;for(;hd(n,t,i)<10;)i--;return Math.min(i,fs(n))}function Qb(n,{min:t,max:e}){t=Me(n.min,t);const i=[],s=fs(t);let r=Zb(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),f=Me(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;f<e;)i.push({value:f,major:dd(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),f=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=Me(n.max,f);return i.push({value:g,major:dd(g),significand:d}),i}class aa extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=kr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?Math.max(0,t):null,this.max=Rt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rt(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r(Xn(i,-1)),o(Xn(s,1)))),i<=0&&r(Xn(s,-1)),s<=0&&o(Xn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Qb(e,this);return t.bounds==="ticks"&&mc(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Gi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xn(t),this._valueRange=xn(this.max)-xn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(aa,"id","logarithmic"),P(aa,"defaults",{ticks:{callback:nr.formatters.logarithmic,major:{enabled:!0}}});function la(n){const t=n.ticks;if(t.display&&n.display){const e=Xt(t.backdropPadding);return it(t.font&&t.font.size,Et.font.size)+e.height}return 0}function Jb(n,t,e){return e=Mt(e)?e:[e],{w:cp(n,t.string,e),h:e.length*t.lineHeight}}function fd(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function t0(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?pt/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),d=It(c.font),f=Jb(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=ke(n.getIndexAngle(l)+a),p=Math.round(Js(g)),y=fd(p,u.x,f.w,0,180),x=fd(p,u.y,f.h,90,270);e0(e,t,g,y,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=s0(n,i,s)}function e0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function n0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(Js(ke(l.angle+Ot))),u=a0(l.y,a.h,c),d=r0(c),f=o0(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function i0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(en({x:e,y:i},t)||en({x:e,y:r},t)||en({x:s,y:i},t)||en({x:s,y:r},t))}function s0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:la(r)/2,additionalAngle:o?pt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=n0(n,u,l);i.push(d),a==="auto"&&(d.visible=i0(d,c),d.visible&&(c=d))}return i}function r0(n){return n===0||n===180?"center":n<180?"left":"right"}function o0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function a0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function l0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!ot(a)){const l=vn(t.borderRadius),c=Xt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,f=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),fi(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function c0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));l0(e,o,r);const a=It(o.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function gd(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ct);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function u0(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),gd(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function d0(n,t,e){return Mn(n,{label:e,index:t,type:"pointLabel"})}class gs extends kr{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=Xt(la(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Rt(t)&&!isNaN(t)?t:0,this.max=Rt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/la(this.options))}generateTickLabels(t){kr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=kt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?t0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=Ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return ke(t*e+Ut(i))}getDistanceFromCenterForValue(t){if(ot(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(ot(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 d0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),gd(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&c0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=s.setContext(f),p=r.setContext(f);u0(this,g,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=It(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Xt(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Yn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(gs,"id","radialLinear"),P(gs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:nr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(gs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(gs,"descriptors",{angleLines:{_fallback:"grid"}});const Dr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ye=Object.keys(Dr);function pd(n,t){return n-t}function md(n,t){if(ot(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Rt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(wn(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function yd(n,t,e,i){const s=ye.length;for(let r=ye.indexOf(n);r<s-1;++r){const o=Dr[ye[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ye[r]}return ye[s-1]}function h0(n,t,e,i,s){for(let r=ye.length-1;r>=ye.indexOf(e);r--){const o=ye[r];if(Dr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ye[e?ye.indexOf(e):0]}function f0(n){for(let t=ye.indexOf(n)+1,e=ye.length;t<e;++t)if(Dr[ye[t]].common)return ye[t]}function bd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=ko(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function g0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function _d(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:g0(n,i,s,e)}class ps extends Un{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new lu._date(t.adapters.date);s.init(e),$i(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:md(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Rt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Rt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=Kg(s,r,o);return this._unit=e.unit||(i.autoSkip?yd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):h0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:f0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),_d(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Zt(e,0,o),i=Zt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||yd(r.minUnit,e,i,this._getLabelCapacity(e)),a=it(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=wn(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,a,o),g++)bd(u,f,p);return(f===i||s.bounds==="ticks"||g===1)&&bd(u,f,p),Object.keys(u).sort(pd).map(y=>+y)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return kt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[e],g=c&&d&&f&&f.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Ut(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,_d(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(md(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return xc(t.sort(pd))}}P(ps,"id","time"),P(ps,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Sr(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=tn(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=tn(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class ca extends ps{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=Sr(e,this.min),this._tableRange=Sr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Sr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Sr(this._table,i*this._tableRange+this._minPos,!0)}}P(ca,"id","timeseries"),P(ca,"defaults",ps.defaults);var p0=Object.freeze({__proto__:null,CategoryScale:ra,LinearScale:oa,LogarithmicScale:aa,RadialLinearScale:gs,TimeScale:ps,TimeSeriesScale:ca});const m0=[km,Qy,Ub,p0],xd=6048e5,y0=864e5,ms=6e4,bi=36e5,b0=1e3,wd=Symbol.for("constructDateFrom");function zt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&wd in n?n[wd](t):n instanceof Date?new n.constructor(t):new Date(t)}function at(n,t){return zt(t||n,n)}function Tr(n,t,e){const i=at(n,e==null?void 0:e.in);return isNaN(t)?zt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ua(n,t,e){const i=at(n,e==null?void 0:e.in);if(isNaN(t))return zt(n,NaN);if(!t)return i;const s=i.getDate(),r=zt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function da(n,t,e){return zt(n,+at(n)+t)}function _0(n,t,e){return da(n,t*bi)}let x0={};function qn(){return x0}function Ue(n,t){var a,l,c,u;const e=qn(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=at(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function _i(n,t){return Ue(n,{...t,weekStartsOn:1})}function vd(n,t){const e=at(n,t==null?void 0:t.in),i=e.getFullYear(),s=zt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=_i(s),o=zt(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=_i(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Cr(n){const t=at(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Gn(n,...t){const e=zt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ha(n,t){const e=at(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Md(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ha(i),o=ha(s),a=+r-Cr(r),l=+o-Cr(o);return Math.round((a-l)/y0)}function w0(n,t){const e=vd(n,t),i=zt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),_i(i)}function v0(n,t,e){const i=at(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ms),i}function M0(n,t,e){return ua(n,t*3,e)}function k0(n,t,e){return da(n,t*1e3)}function D0(n,t,e){return Tr(n,t*7,e)}function S0(n,t,e){return ua(n,t*12,e)}function ys(n,t){const e=+at(n)-+at(t);return e<0?-1:e>0?1:e}function T0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function fa(n){return!(!T0(n)&&typeof n!="number"||isNaN(+at(n)))}function C0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function P0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function kd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=Dd(i,s),o=Math.abs(Md(i,s));i.setDate(i.getDate()-r*o);const a=+(Dd(i,s)===-r),l=r*(o-a);return l===0?0:l}function Dd(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function bs(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function O0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/bi;return bs(e==null?void 0:e.roundingMethod)(r)}function ga(n,t){return+at(n)-+at(t)}function E0(n,t,e){const i=ga(n,t)/ms;return bs(e==null?void 0:e.roundingMethod)(i)}function Sd(n,t){const e=at(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Td(n,t){const e=at(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function A0(n,t){const e=at(n,t==null?void 0:t.in);return+Sd(e,t)==+Td(e,t)}function Cd(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),o=ys(s,r),a=Math.abs(C0(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ys(s,r)===-o;A0(i)&&a===1&&ys(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function R0(n,t,e){const i=Cd(n,t,e)/3;return bs(e==null?void 0:e.roundingMethod)(i)}function I0(n,t,e){const i=ga(n,t)/1e3;return bs(e==null?void 0:e.roundingMethod)(i)}function L0(n,t,e){const i=kd(n,t,e)/7;return bs(e==null?void 0:e.roundingMethod)(i)}function N0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ys(i,s),o=Math.abs(P0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ys(i,s)===-r,l=r*(o-+a);return l===0?0:l}function F0(n,t){const e=at(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function z0(n,t){const e=at(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function B0(n,t){const e=at(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Pd(n,t){const e=at(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function H0(n,t){const e=at(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function W0(n,t){var a,l;const e=qn(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=at(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function Y0(n,t){const e=at(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function j0(n,t){const e=at(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function V0(n,t){const e=at(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const $0={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"}},U0=(n,t,e)=>{let i;const s=$0[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function pa(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const X0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},q0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},G0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},K0={date:pa({formats:X0,defaultWidth:"full"}),time:pa({formats:q0,defaultWidth:"full"}),dateTime:pa({formats:G0,defaultWidth:"full"})},Z0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Q0=(n,t,e,i)=>Z0[n];function _s(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const J0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},t_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},e_={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"]},n_={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"]},i_={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"}},s_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},r_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:_s({values:J0,defaultWidth:"wide"}),quarter:_s({values:t_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:_s({values:e_,defaultWidth:"wide"}),day:_s({values:n_,defaultWidth:"wide"}),dayPeriod:_s({values:i_,defaultWidth:"wide",formattingValues:s_,defaultFormattingWidth:"wide"})};function xs(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?a_(a,d=>d.test(o)):o_(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function o_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function a_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function l_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const c_=/^(\d+)(th|st|nd|rd)?/i,u_=/\d+/i,d_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},h_={any:[/^b/i,/^(a|c)/i]},f_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},g_={any:[/1/i,/2/i,/3/i,/4/i]},p_={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},m_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},y_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},b_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},__={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},x_={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},w_={ordinalNumber:l_({matchPattern:c_,parsePattern:u_,valueCallback:n=>parseInt(n,10)}),era:xs({matchPatterns:d_,defaultMatchWidth:"wide",parsePatterns:h_,defaultParseWidth:"any"}),quarter:xs({matchPatterns:f_,defaultMatchWidth:"wide",parsePatterns:g_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:xs({matchPatterns:p_,defaultMatchWidth:"wide",parsePatterns:m_,defaultParseWidth:"any"}),day:xs({matchPatterns:y_,defaultMatchWidth:"wide",parsePatterns:b_,defaultParseWidth:"any"}),dayPeriod:xs({matchPatterns:__,defaultMatchWidth:"any",parsePatterns:x_,defaultParseWidth:"any"})},Od={code:"en-US",formatDistance:U0,formatLong:K0,formatRelative:Q0,localize:r_,match:w_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function v_(n,t){const e=at(n,t==null?void 0:t.in);return Md(e,Pd(e))+1}function Ed(n,t){const e=at(n,t==null?void 0:t.in),i=+_i(e)-+w0(e);return Math.round(i/xd)+1}function ma(n,t){var u,d,f,g;const e=at(n,t==null?void 0:t.in),i=e.getFullYear(),s=qn(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=zt((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Ue(o,t),l=zt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Ue(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function M_(n,t){var a,l,c,u;const e=qn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=ma(n,t),r=zt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Ue(r,t)}function Ad(n,t){const e=at(n,t==null?void 0:t.in),i=+Ue(e,t)-+M_(e,t);return Math.round(i/xd)+1}function St(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Tn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return St(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):St(e+1,2)},d(n,t){return St(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return St(n.getHours()%12||12,t.length)},H(n,t){return St(n.getHours(),t.length)},m(n,t){return St(n.getMinutes(),t.length)},s(n,t){return St(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return St(s,t.length)}},xi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Rd={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Tn.y(n,t)},Y:function(n,t,e,i){const s=ma(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return St(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):St(r,t.length)},R:function(n,t){const e=vd(n);return St(e,t.length)},u:function(n,t){const e=n.getFullYear();return St(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 St(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return St(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Tn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return St(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Ad(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):St(s,t.length)},I:function(n,t,e){const i=Ed(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):St(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Tn.d(n,t)},D:function(n,t,e){const i=v_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):St(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return St(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return St(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return St(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=xi.noon:i===0?s=xi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=xi.evening:i>=12?s=xi.afternoon:i>=4?s=xi.morning:s=xi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Tn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Tn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):St(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):St(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Tn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Tn.s(n,t)},S:function(n,t){return Tn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ld(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Ld(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Id(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Id(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return St(i,t.length)},T:function(n,t,e){return St(+n,t.length)}};function Id(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+St(r,2)}function Ld(n,t){return n%60===0?(n>0?"-":"+")+St(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=St(Math.trunc(i/60),2),r=St(i%60,2);return e+s+t+r}const Nd=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Fd=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ya={p:Fd,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Nd(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Nd(i,t)).replace("{{time}}",Fd(s,t))}},k_=/^D+$/,D_=/^Y+$/,S_=["D","DD","YY","YYYY"];function zd(n){return k_.test(n)}function Bd(n){return D_.test(n)}function ba(n,t,e){const i=T_(n,t,e);if(console.warn(i),S_.includes(n))throw new RangeError(i)}function T_(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 C_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,P_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,O_=/^'([^]*?)'?$/,E_=/''/g,A_=/[a-zA-Z]/;function Hd(n,t,e){var u,d,f,g,p,y,x,M;const i=qn(),s=(e==null?void 0:e.locale)??i.locale??Od,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(f=i.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((y=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??i.weekStartsOn??((M=(x=i.locale)==null?void 0:x.options)==null?void 0:M.weekStartsOn)??0,a=at(n,e==null?void 0:e.in);if(!fa(a))throw new RangeError("Invalid time value");let l=t.match(P_).map(v=>{const D=v[0];if(D==="p"||D==="P"){const S=ya[D];return S(v,s.formatLong)}return v}).join("").match(C_).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const D=v[0];if(D==="'")return{isToken:!1,value:R_(v)};if(Rd[D])return{isToken:!0,value:v};if(D.match(A_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(v=>{if(!v.isToken)return v.value;const D=v.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Bd(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&zd(D))&&ba(D,t,String(n));const S=Rd[D[0]];return S(a,D,s.localize,c)}).join("")}function R_(n){const t=n.match(O_);return t?t[1].replace(E_,"'"):n}function Wd(){return Object.assign({},qn())}function I_(n,t){const e=at(n,t==null?void 0:t.in).getDay();return e===0?7:e}function L_(n,t){const e=N_(t)?new t(0):zt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function N_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const F_=10;class Yd{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class z_ extends Yd{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class B_ extends Yd{constructor(e,i){super();P(this,"priority",F_);P(this,"subPriority",-1);this.context=e||(s=>zt(i,s))}set(e,i){return i.timestampIsSet?e:zt(e,L_(e,this.context))}}class xt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new z_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class H_ extends xt{constructor(){super(...arguments);P(this,"priority",140);P(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const jt={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}/},Xe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Vt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Nt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function qe(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*bi+r*ms+o*b0),rest:t.slice(e[0].length)}}function jd(n){return Nt(jt.anyDigitsSigned,n)}function Bt(n,t){switch(n){case 1:return Nt(jt.singleDigit,t);case 2:return Nt(jt.twoDigits,t);case 3:return Nt(jt.threeDigits,t);case 4:return Nt(jt.fourDigits,t);default:return Nt(new RegExp("^\\d{1,"+n+"}"),t)}}function Pr(n,t){switch(n){case 1:return Nt(jt.singleDigitSigned,t);case 2:return Nt(jt.twoDigitsSigned,t);case 3:return Nt(jt.threeDigitsSigned,t);case 4:return Nt(jt.fourDigitsSigned,t);default:return Nt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function _a(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Vd(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function $d(n){return n%400===0||n%4===0&&n%100!==0}class W_ extends xt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return Vt(Bt(4,e),r);case"yo":return Vt(s.ordinalNumber(e,{unit:"year"}),r);default:return Vt(Bt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=Vd(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class Y_ extends xt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Vt(Bt(4,e),r);case"Yo":return Vt(s.ordinalNumber(e,{unit:"year"}),r);default:return Vt(Bt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=ma(e,r);if(s.isTwoDigitYear){const l=Vd(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}}class j_ extends xt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Pr(i==="R"?4:i.length,e)}set(e,i,s){const r=zt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),_i(r)}}class V_ extends xt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Pr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class $_ extends xt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Bt(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class U_ extends xt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Bt(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class X_ extends xt{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return Vt(Nt(jt.month,e),r);case"MM":return Vt(Bt(2,e),r);case"Mo":return Vt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class q_ extends xt{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return Vt(Nt(jt.month,e),r);case"LL":return Vt(Bt(2,e),r);case"Lo":return Vt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function G_(n,t,e){const i=at(n,e==null?void 0:e.in),s=Ad(i,e)-t;return i.setDate(i.getDate()-s*7),at(i,e==null?void 0:e.in)}class K_ extends xt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Nt(jt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Ue(G_(e,s,r),r)}}function Z_(n,t,e){const i=at(n,e==null?void 0:e.in),s=Ed(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Q_ extends xt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Nt(jt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return _i(Z_(e,s))}}const J_=[31,28,31,30,31,30,31,31,30,31,30,31],tx=[31,29,31,30,31,30,31,31,30,31,30,31];class ex extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Nt(jt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Bt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=$d(s),o=e.getMonth();return r?i>=1&&i<=tx[o]:i>=1&&i<=J_[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class nx extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Nt(jt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Bt(i.length,e)}}validate(e,i){const s=e.getFullYear();return $d(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function xa(n,t,e){var d,f,g,p;const i=qn(),s=(e==null?void 0:e.weekStartsOn)??((f=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=at(n,e==null?void 0:e.in),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Tr(r,u,e)}class ix extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=xa(e,s,r),e.setHours(0,0,0,0),e}}class sx extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Vt(Bt(i.length,e),o);case"eo":return Vt(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=xa(e,s,r),e.setHours(0,0,0,0),e}}class rx extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Vt(Bt(i.length,e),o);case"co":return Vt(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=xa(e,s,r),e.setHours(0,0,0,0),e}}function ox(n,t,e){const i=at(n,e==null?void 0:e.in),s=I_(i,e),r=t-s;return Tr(i,r,e)}class ax extends xt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return Bt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Vt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Vt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Vt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Vt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=ox(e,s),e.setHours(0,0,0,0),e}}class lx extends xt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(_a(s),0,0,0),e}}class cx extends xt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(_a(s),0,0,0),e}}class ux extends xt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(_a(s),0,0,0),e}}class dx extends xt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Nt(jt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class hx extends xt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Nt(jt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class fx extends xt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Nt(jt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class gx extends xt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Nt(jt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Bt(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class px extends xt{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Nt(jt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class mx extends xt{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Nt(jt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Bt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class yx extends xt{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Vt(Bt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class bx extends xt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return qe(Xe.basicOptionalMinutes,e);case"XX":return qe(Xe.basic,e);case"XXXX":return qe(Xe.basicOptionalSeconds,e);case"XXXXX":return qe(Xe.extendedOptionalSeconds,e);case"XXX":default:return qe(Xe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:zt(e,e.getTime()-Cr(e)-s)}}class _x extends xt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return qe(Xe.basicOptionalMinutes,e);case"xx":return qe(Xe.basic,e);case"xxxx":return qe(Xe.basicOptionalSeconds,e);case"xxxxx":return qe(Xe.extendedOptionalSeconds,e);case"xxx":default:return qe(Xe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:zt(e,e.getTime()-Cr(e)-s)}}class xx extends xt{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return jd(e)}set(e,i,s){return[zt(e,s*1e3),{timestampIsSet:!0}]}}class wx extends xt{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return jd(e)}set(e,i,s){return[zt(e,s),{timestampIsSet:!0}]}}const vx={G:new H_,y:new W_,Y:new Y_,R:new j_,u:new V_,Q:new $_,q:new U_,M:new X_,L:new q_,w:new K_,I:new Q_,d:new ex,D:new nx,E:new ix,e:new sx,c:new rx,i:new ax,a:new lx,b:new cx,B:new ux,h:new dx,H:new hx,K:new fx,k:new gx,m:new px,s:new mx,S:new yx,X:new bx,x:new _x,t:new xx,T:new wx},Mx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dx=/^'([^]*?)'?$/,Sx=/''/g,Tx=/\S/,Cx=/[a-zA-Z]/;function Px(n,t,e,i){var x,M,v,D,S,T,A,O;const s=()=>zt((i==null?void 0:i.in)||e,NaN),r=Wd(),o=(i==null?void 0:i.locale)??r.locale??Od,a=(i==null?void 0:i.firstWeekContainsDate)??((M=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:M.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(v=r.locale)==null?void 0:v.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((T=(S=i==null?void 0:i.locale)==null?void 0:S.options)==null?void 0:T.weekStartsOn)??r.weekStartsOn??((O=(A=r.locale)==null?void 0:A.options)==null?void 0:O.weekStartsOn)??0;if(!t)return n?s():at(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new B_(i==null?void 0:i.in,e)],d=t.match(kx).map(_=>{const b=_[0];if(b in ya){const C=ya[b];return C(_,o.formatLong)}return _}).join("").match(Mx),f=[];for(let _ of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&Bd(_)&&ba(_,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&zd(_)&&ba(_,t,n);const b=_[0],C=vx[b];if(C){const{incompatibleTokens:R}=C;if(Array.isArray(R)){const Y=f.find(L=>R.includes(L.token)||L.token===b);if(Y)throw new RangeError(`The format string mustn't contain \`${Y.fullToken}\` and \`${_}\` at the same time`)}else if(C.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);f.push({token:b,fullToken:_});const I=C.run(n,_,o.match,c);if(!I)return s();u.push(I.setter),n=I.rest}else{if(b.match(Cx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(_==="''"?_="'":b==="'"&&(_=Ox(_)),n.indexOf(_)===0)n=n.slice(_.length);else return s()}}if(n.length>0&&Tx.test(n))return s();const g=u.map(_=>_.priority).sort((_,b)=>b-_).filter((_,b,C)=>C.indexOf(_)===b).map(_=>u.filter(b=>b.priority===_).sort((b,C)=>C.subPriority-b.subPriority)).map(_=>_[0]);let p=at(e,i==null?void 0:i.in);if(isNaN(+p))return s();const y={};for(const _ of g){if(!_.validate(p,c))return s();const b=_.set(p,y,c);Array.isArray(b)?(p=b[0],Object.assign(y,b[1])):p=b}return p}function Ox(n){return n.match(Dx)[1].replace(Sx,"'")}function Ex(n,t){const e=at(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Ax(n,t){const e=at(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Rx(n,t){const e=at(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Ix(n){const t=n/bi;return Math.trunc(t)}function Ud(n,t){const e=()=>zt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=zx(n);let r;if(s.date){const c=Bx(s.date,i);r=Hx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=Wx(s.time),isNaN(a)))return e();if(s.timezone){if(l=Yx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=at(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return at(o+a+l,t==null?void 0:t.in)}const Or={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Lx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Nx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Fx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function zx(n){const t={},e=n.split(Or.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Or.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Or.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Or.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Bx(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Hx(n,t){if(t===null)return new Date(NaN);const e=n.match(Lx);if(!e)return new Date(NaN);const i=!!e[4],s=ws(e[1]),r=ws(e[2])-1,o=ws(e[3]),a=ws(e[4]),l=ws(e[5])-1;if(i)return Xx(t,a,l)?jx(t,a,l):new Date(NaN);{const c=new Date(0);return!$x(t,r,o)||!Ux(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function ws(n){return n?parseInt(n):1}function Wx(n){const t=n.match(Nx);if(!t)return NaN;const e=wa(t[1]),i=wa(t[2]),s=wa(t[3]);return qx(e,i,s)?e*bi+i*ms+s*1e3:NaN}function wa(n){return n&&parseFloat(n.replace(",","."))||0}function Yx(n){if(n==="Z")return 0;const t=n.match(Fx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Gx(i,s)?e*(i*bi+s*ms):NaN}function jx(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Vx=[31,null,31,30,31,30,31,31,30,31,30,31];function Xd(n){return n%400===0||n%4===0&&n%100!==0}function $x(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Vx[t]||(Xd(n)?29:28))}function Ux(n,t){return t>=1&&t<=(Xd(n)?366:365)}function Xx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function qx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Gx(n,t){return t>=0&&t<=59}const Er=n=>["interactive","zoom-interactive"].includes(n),Kx=(n,t,e)=>{var r,o;const{tooltip:i}=t;if(i.opacity===0&&!Er(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(i.body&&!Er(n.interactionMode)){const a=i.labelColors,l=((o=(r=t.chart.config)==null?void 0:r.options)==null?void 0:o.indexAxis)==="y"?"x":"y";n.tooltipContext=wh(new Date(i.dataPoints[0].parsed.x),e,!0),n.tooltipSeries=i.dataPoints.map((c,u)=>{const d=c.parsed[l],f=vh(d,n.units,{translateUnit:n.translateUnit}),g=c.dataset.label;return{backgroundColor:a[u].backgroundColor,borderColor:a[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(s),n.left=`${i.x}px`,n.top=`${i.y}px`,n.showTooltip=!0}},qd=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!Er(n.interactionMode)){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!Er(n.interactionMode)){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["gauge","donut"].includes(n.chartType);l?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((c,u)=>{const d=l?c.parsed:c.parsed[a],f=vh(d,n.units,{translateUnit:n.translateUnit});let g;return l?g=c.dataset.labels[c.dataIndex]:g=c.dataset.label,{backgroundColor:o[u].backgroundColor,borderColor:o[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Zx=n=>n&&n.datasets&&n.datasets.length,Qx=n=>Zx(n)&&n.datasets.some(t=>t.data.length),Jx=n=>n.datasets.some(t=>t.data[0]&&fa(t.data[0].x)),tw=n=>!!Qx(n)&&n.datasets.some(t=>t.data.length==1),ew=n=>Jx(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),va=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},nw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Ma(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Gd=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},iw=2,Kd=10,Zd=12,ka=new Intl.NumberFormat(((dg=document==null?void 0:document.documentElement)==null?void 0:dg.lang)||"en-US"),Ar=10,Qd={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Rr=(n,t)=>(t||on)[n%on.length],Jd=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},th="#6f7787",eh={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"}},sw=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=eh[t])==null?void 0:e.background)||"#fafafa"},rw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},ow={"4XX":"#FFBA81","5XX":"#FF8484"},aw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},lw="#dad4c7",nh="#afb7c5",cw=n=>{const t=Object.entries(Qd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Qd.standard},Da=(n,t,e,i)=>{let s;return e?s=nh:Array.isArray(i)?s=Rr(n,i):s=i[t],s||Rr(n)},uw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},dw=2,hw=0,Sa=new Map,Ta=(n,t)=>t==="bytes"?Nr(n):t==="count/minute"?n.toFixed(2):ka.format(n),ih=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},fw=()=>{const n="label_height";if(!Sa.has(n)){const t=It({});Sa.set(n,t.lineHeight)}return Sa.get(n)},gw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),sh=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),rh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ca="#e0e4ea",pw={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},vs=(n,t)=>{let e=1;const i=pw[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},oh=new Map([[100,vs("100",[100,101,102,103])],[200,vs("200",[200,201,202,203,204,205,206,207,208,226])],[300,vs("300",[300,301,302,303,304,305,307,308])],[400,vs("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,vs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Pa=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=oh.get(e);return i===void 0?Ca:i.get(t)??i.get(-1)??Ca},mw=n=>{const t=Pa(n);return{solid:t,light:t}},Ir={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Pa(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function ah(n,t,e){const i=Wd(),s=_w(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?yw(s,t):bw(s,t)}function yw(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 bw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function _w(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function xw(n,t){const e=Dw(t);return"formatToParts"in e?vw(e,n):Mw(e,n)}const ww={year:0,month:1,day:2,hour:3,minute:4,second:5};function vw(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=ww[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Mw(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 Oa={},lh=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")),kw=lh==="06/25/2014, 00:00:00"||lh==="06/25/2014 00:00:00";function Dw(n){return Oa[n]||(Oa[n]=kw?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"})),Oa[n]}function ch(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const uh=36e5,Sw=6e4,Ea={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Aa(n,t,e){if(!n)return 0;let i=Ea.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Ea.timezoneHH.exec(n),i)return s=parseInt(i[1],10),dh(s)?-(s*uh):NaN;if(i=Ea.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return dh(s,o)?(r=Math.abs(s)*uh+o*Sw,i[1]==="+"?-r:r):NaN}if(Pw(n)){t=new Date(t||Date.now());const o=e?t:Tw(t),a=Ra(o,n);return-(e?a:Cw(t,a,n))}return NaN}function Tw(n){return ch(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ra(n,t){const e=xw(n,t),i=ch(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function Cw(n,t,e){let s=n.getTime()-t;const r=Ra(new Date(s),e);if(t===r)return t;s-=r-t;const o=Ra(new Date(s),e);return r===o?r:Math.max(r,o)}function dh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const hh={};function Pw(n){if(hh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),hh[n]=!0,!0}catch{return!1}}const Ow=60*1e3,Ew={X:function(n,t,e){const i=Ia(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return fh(i);case"XXXX":case"XX":return wi(i);case"XXXXX":case"XXX":default:return wi(i,":")}},x:function(n,t,e){const i=Ia(e.timeZone,n);switch(t){case"x":return fh(i);case"xxxx":case"xx":return wi(i);case"xxxxx":case"xxx":default:return wi(i,":")}},O:function(n,t,e){const i=Ia(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Aw(i,":");case"OOOO":default:return"GMT"+wi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return ah("short",n,e);case"zzzz":default:return ah("long",n,e)}}};function Ia(n,t){const e=n?Aa(n,t,!0)/Ow:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Lr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function wi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Lr(Math.floor(i/60),2),r=Lr(Math.floor(i%60),2);return e+s+t+r}function fh(n,t){return n%60===0?(n>0?"-":"+")+Lr(Math.abs(n)/60,2):wi(n,t)}function Aw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Lr(r,2)}function gh(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 Rw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,La=36e5,ph=6e4,Iw=2,ae={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:Rw};function mh(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?Iw: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=Lw(n),{year:s,restDateString:r}=Nw(i.date,e),o=Fw(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=zw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Aa(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=gh(new Date(a+l)),c=gh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Lw(n){const t={};let e=ae.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ae.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ae.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Nw(n,t){if(n){const e=ae.YYY[t],i=ae.YYYYY[t];let s=ae.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ae.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Fw(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ae.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,_h(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ae.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Ww(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ae.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return _h(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ae.Www.exec(n),r)return s=parseInt(r[1],10)-1,xh(s)?yh(t,s):new Date(NaN);if(r=ae.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return xh(s,o)?yh(t,s,o):new Date(NaN)}return null}function zw(n){let t,e,i=ae.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Na(t)?t%24*La:NaN;if(i=ae.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Na(t,e)?t%24*La+e*ph:NaN;if(i=ae.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Na(t,e,s)?t%24*La+e*ph+s*1e3:NaN}return null}function yh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Bw=[31,28,31,30,31,30,31,31,30,31,30,31],Hw=[31,29,31,30,31,30,31,31,30,31,30,31];function bh(n){return n%400===0||n%4===0&&n%100!==0}function _h(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=bh(n);if(i&&e>Hw[t]||!i&&e>Bw[t])return!1}return!0}function Ww(n,t){if(t<1)return!1;const e=bh(n);return!(e&&t>366||!e&&t>365)}function xh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Na(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Yw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Fa(n,t,e={}){t=String(t);const i=t.match(Yw);if(i){const s=mh(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Ew[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Hd(n,t,e)}function jw(n,t,e){n=mh(n,e);const i=Aa(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Zn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Fa(jw(n,t,{timeZone:i.timeZone}),e,i)}const wh=(n,t,e,i)=>{const s=Intl.DateTimeFormat().resolvedOptions().timeZone;switch(t){case"secondly":case"tenSecondly":case"thirtySecondly":return Zn(n,s,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a");case"minutely":case"fiveMinutely":case"tenMinutely":case"thirtyMinutely":case"hourly":case"twoHourly":return Zn(n,s,e?"yyyy-MM-dd h:mm a":"h:mm a");case"twelveHourly":return Zn(n,s,"yyyy-MM-dd h:mm a");case"daily":return Zn(n,s,"yyyy-MM-dd");case"weekly":return`${Zn(n,s,"yyyy")} W${Zn(n,s,"II")}`;default:return Zn(n,s,"yyyy-MM-dd h:mm:ss a")}},Nr=(n,t)=>{if(isNaN(n))return"0 B";const{i18n:e}=gt.useI18n(),i=t?0x4000000000000:1e15,s=t?1099511627776:1e12,r=t?1073741824:1e9,o=t?1048576:1e6,a=t?1024:1e3;let l;return n>=i?l=e.formatNumber(Number.parseFloat((n/i).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):n>=s?l=e.formatNumber(Number.parseFloat((n/s).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):n>=r?l=e.formatNumber(Number.parseFloat((n/r).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):n>=o?l=e.formatNumber(Number.parseFloat((n/o).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):n>=a?l=e.formatNumber(Number.parseFloat((n/a).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):l=e.formatNumber(Number.parseFloat(n.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),l.replace(/([a-zA-Z]*)$/," $1")},Vw=(n,t="USD")=>{if(isNaN(n))return t==="USD"?"$0.00":`${n}`;const{i18n:e}=gt.useI18n();return n>=.01||t!=="USD"?e.formatNumber(n,{style:"currency",currency:t}):n<1e-4?"< $0.0001":`$${Number.parseFloat(n.toPrecision(4))}`},vh=(n,t,{isBytes1024:e=!1,currency:i="USD",translateUnit:s=r=>r}={})=>{const r=s(t,n);switch(t){case"bytes":return Nr(n,e);case"usd":return Vw(n,i);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(n)?`${n}`:n>=.01?`${ka.format(Number.parseFloat(n.toFixed(2)))} ${r}`:`${Number.parseFloat(n.toPrecision(4))} ${r}`}};function $w(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};$e.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=u.width/2,g=va(c,d,f),p=c.y,y=c.x<f?"left":"center";return{x:g-n.tooltipState.offsetX,y:p-n.tooltipState.offsetY,xAlign:y}},Uo.modes.customInteractionMode=function(l,c){const u=kn(c,l),d=[];return Uo.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,g,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p})}),d};const s=n.numLabels.value>25?Kd:Zd,r=({chart:l,index:c})=>{var d;const u=l.data;return{size:s,style:(d=u==null?void 0:u.isLabelEmpty)!=null&&d[c]?"italic":"normal"}},o=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Ar?c.slice(0,Ar)+"...":c):l.getLabelForValue(Number(c)),a=h.computed(()=>{var l,c,u,d,f,g,p,y;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:r,callback:function(x,M){return o(this,x,M)}},title:{display:n.indexAxis==="y"?!ot((l=n.metricAxesTitle)==null?void 0:l.value):!ot((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(x,M){return o(this,x,M)}},title:{display:n.indexAxis==="x"?!ot((f=n.metricAxesTitle)==null?void 0:f.value):!ot((g=n.dimensionAxesTitle)==null?void 0:g.value),text:n.indexAxis==="x"?(p=n.metricAxesTitle)==null?void 0:p.value:(y=n.dimensionAxesTitle)==null?void 0:y.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{qd(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return h.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),a}Oe.register(...m0);const Uw=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function Xw(n,t,e,i,s){const r=h.shallowRef(null),o=(a,l)=>{if(t.value)return new Oe(t.value,{type:n,data:a,plugins:i,options:l})};return h.onMounted(()=>{r.value=o(e.value,s.value)}),h.onBeforeUnmount(()=>{ot(r.value)||r.value.destroy()}),h.watch(e,(a,l)=>{if(Uw(l,a)&&!ot(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else ot(r.value)||r.value.destroy(),r.value=o(a,s.value)}),h.watch(t,()=>{ot(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),h.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(ot(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function za(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,y){y&&y%3===0&&f.push(d),f.push(p)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<o?d=e(c,r,u)+"m":c<a?d=t(e(c,o,u),u)+"b":d=t(e(c,a,u),u)+"t",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Mh);var qw=Mh.exports;const Ms=za(qw);function Gw(n,t,e){const{i18n:i}=gt.useI18n(),{translateUnit:s}=gt.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=Nr(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:Ms(l,{capital:!0}),unit:u})||`${Ms(l,{capital:!0})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var Kw=Object.defineProperty,Zw=(n,t,e)=>t in n?Kw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ee=(n,t,e)=>Zw(n,typeof t!="symbol"?t+"":t,e),ft=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(ft||{});const kh=["in","not_in","selector"],Dh=["empty","not_empty"],Qw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],ks=n=>n.filter(t=>t!=="time"),Sh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Ba=ks(Sh),Jw=["active_services","request_count","request_per_minute","response_latency_average"],t1=[...Sh,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Ha=ks(t1);[...Jw];const e1=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],Wa=ks(e1);ks(["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),ks(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Ba),new Set(Ha),new Set(Wa),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:kh},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Dh}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Ha,...Ba,...Wa])]),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:kh},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Dh}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Ha,...Ba,...Wa])]);const Th=6048e5,n1=864e5,i1=60,s1=3600,Ch=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Ch in n?n[Ch](t):n instanceof Date?new n.constructor(t):new Date(t)}function le(n,t){return Ae(t||n,n)}function Ph(n,t,e){const i=le(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function r1(n,t,e){const i=le(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let o1={};function Ds(){return o1}function an(n,t){var e,i,s,r;const o=Ds(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=le(n,t==null?void 0:t.in),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Fr(n,t){return an(n,{...t,weekStartsOn:1})}function Oh(n,t){const e=le(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Fr(s),o=Ae(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=Fr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Eh(n){const t=le(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 a1(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function zr(n,t){const e=le(n,void 0);return e.setHours(0,0,0,0),e}function l1(n,t,e){const[i,s]=a1(void 0,n,t),r=zr(i),o=zr(s),a=+r-Eh(r),l=+o-Eh(o);return Math.round((a-l)/n1)}function c1(n,t){const e=Oh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Fr(i)}function u1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function d1(n){return!(!u1(n)&&typeof n!="number"||isNaN(+le(n)))}function vi(n,t){const e=le(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function h1(n,t){const e=le(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const f1={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"}},g1=(n,t,e)=>{let i;const s=f1[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ya(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const p1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},m1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},y1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},b1={date:Ya({formats:p1,defaultWidth:"full"}),time:Ya({formats:m1,defaultWidth:"full"}),dateTime:Ya({formats:y1,defaultWidth:"full"})},_1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},x1=(n,t,e,i)=>_1[n];function Ss(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const w1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},v1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},M1={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"]},k1={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"]},D1={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"}},S1={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"}},T1=(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"},C1={ordinalNumber:T1,era:Ss({values:w1,defaultWidth:"wide"}),quarter:Ss({values:v1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ss({values:M1,defaultWidth:"wide"}),day:Ss({values:k1,defaultWidth:"wide"}),dayPeriod:Ss({values:D1,defaultWidth:"wide",formattingValues:S1,defaultFormattingWidth:"wide"})};function Ts(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?O1(a,d=>d.test(o)):P1(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function P1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function O1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function E1(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const A1=/^(\d+)(th|st|nd|rd)?/i,R1=/\d+/i,I1={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},L1={any:[/^b/i,/^(a|c)/i]},N1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},F1={any:[/1/i,/2/i,/3/i,/4/i]},z1={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},B1={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]},H1={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},W1={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]},Y1={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},j1={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}},V1={ordinalNumber:E1({matchPattern:A1,parsePattern:R1,valueCallback:n=>parseInt(n,10)}),era:Ts({matchPatterns:I1,defaultMatchWidth:"wide",parsePatterns:L1,defaultParseWidth:"any"}),quarter:Ts({matchPatterns:N1,defaultMatchWidth:"wide",parsePatterns:F1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ts({matchPatterns:z1,defaultMatchWidth:"wide",parsePatterns:B1,defaultParseWidth:"any"}),day:Ts({matchPatterns:H1,defaultMatchWidth:"wide",parsePatterns:W1,defaultParseWidth:"any"}),dayPeriod:Ts({matchPatterns:Y1,defaultMatchWidth:"any",parsePatterns:j1,defaultParseWidth:"any"})},$1={code:"en-US",formatDistance:g1,formatLong:b1,formatRelative:x1,localize:C1,match:V1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function U1(n,t){const e=le(n,void 0);return l1(e,h1(e))+1}function X1(n,t){const e=le(n,void 0),i=+Fr(e)-+c1(e);return Math.round(i/Th)+1}function Ah(n,t){var e,i,s,r;const o=le(n,t==null?void 0:t.in),a=o.getFullYear(),l=Ds(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=an(u,t),f=Ae((t==null?void 0:t.in)||n,0);f.setFullYear(a,0,c),f.setHours(0,0,0,0);const g=an(f,t);return+o>=+d?a+1:+o>=+g?a:a-1}function q1(n,t){var e,i,s,r;const o=Ds(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Ah(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),an(c,t)}function G1(n,t){const e=le(n,t==null?void 0:t.in),i=+an(e,t)-+q1(e,t);return Math.round(i/Th)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Cn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},Mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Rh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Cn.y(n,t)},Y:function(n,t,e,i){const s=Ah(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Tt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=Oh(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Cn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=G1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=X1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Cn.d(n,t)},D:function(n,t,e){const i=U1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Mi.noon:i===0?s=Mi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Mi.evening:i>=12?s=Mi.afternoon:i>=4?s=Mi.morning:s=Mi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Cn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Cn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Cn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Cn.s(n,t)},S:function(n,t){return Cn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Lh(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Lh(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ih(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ih(i,":");case"zzzz":default:return"GMT"+Qn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function Ih(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function Lh(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Qn(n,t)}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Nh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Fh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},K1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Nh(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Nh(i,t)).replace("{{time}}",Fh(s,t))},Z1={p:Fh,P:K1},Q1=/^D+$/,J1=/^Y+$/,tv=["D","DD","YY","YYYY"];function ev(n){return Q1.test(n)}function nv(n){return J1.test(n)}function iv(n,t,e){const i=sv(n,t,e);if(console.warn(i),tv.includes(n))throw new RangeError(i)}function sv(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 rv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ov=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,av=/^'([^]*?)'?$/,lv=/''/g,cv=/[a-zA-Z]/;function uv(n,t,e){var i,s,r,o,a,l,c,u;const d=Ds(),f=(e==null?void 0:e.locale)??d.locale??$1,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,y=le(n,e==null?void 0:e.in);if(!d1(y))throw new RangeError("Invalid time value");let x=t.match(ov).map(v=>{const D=v[0];if(D==="p"||D==="P"){const S=Z1[D];return S(v,f.formatLong)}return v}).join("").match(rv).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const D=v[0];if(D==="'")return{isToken:!1,value:dv(v)};if(Rh[D])return{isToken:!0,value:v};if(D.match(cv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:v}});f.localize.preprocessor&&(x=f.localize.preprocessor(y,x));const M={firstWeekContainsDate:g,weekStartsOn:p,locale:f};return x.map(v=>{if(!v.isToken)return v.value;const D=v.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&nv(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&ev(D))&&iv(D,t,String(n));const S=Rh[D[0]];return S(y,D,f.localize,M)}).join("")}function dv(n){const t=n.match(av);return t?t[1].replace(lv,"'"):n}function hv(n,t){const e=le(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function fv(){return Object.assign({},Ds())}function gv(n){return Math.trunc(n*s1)}function pv(n){const t=n/i1;return Math.trunc(t)}function zh(n,t,e){return r1(n,-1)}function Bh(n,t,e){const i=fv(),s=bv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?mv(s,t):yv(s,t)}function mv(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 yv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function bv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function _v(n,t){const e=kv(t);return"formatToParts"in e?wv(e,n):vv(e,n)}const xv={year:0,month:1,day:2,hour:3,minute:4,second:5};function wv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=xv[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function vv(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ja={},Hh=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")),Mv=Hh==="06/25/2014, 00:00:00"||Hh==="06/25/2014 00:00:00";function kv(n){return ja[n]||(ja[n]=Mv?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ja[n]}function Va(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const Wh=36e5,Dv=6e4,$a={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Cs(n,t,e){if(!n)return 0;let i=$a.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=$a.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Yh(s)?-(s*Wh):NaN;if(i=$a.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Yh(s,o)?(r=Math.abs(s)*Wh+o*Dv,i[1]==="+"?-r:r):NaN}if(Cv(n)){t=new Date(t||Date.now());const o=e?t:Sv(t),a=Ua(o,n);return-(e?a:Tv(t,a,n))}return NaN}function Sv(n){return Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ua(n,t){const e=_v(n,t),i=Va(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function Tv(n,t,e){let i=n.getTime()-t;const s=Ua(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ua(new Date(i),e);return s===r?s:Math.max(s,r)}function Yh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const jh={};function Cv(n){if(jh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),jh[n]=!0,!0}catch{return!1}}const Pv=60*1e3,Ov={X:function(n,t,e){const i=Xa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Vh(i);case"XXXX":case"XX":return ki(i);case"XXXXX":case"XXX":default:return ki(i,":")}},x:function(n,t,e){const i=Xa(e.timeZone,n);switch(t){case"x":return Vh(i);case"xxxx":case"xx":return ki(i);case"xxxxx":case"xxx":default:return ki(i,":")}},O:function(n,t,e){const i=Xa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ev(i,":");case"OOOO":default:return"GMT"+ki(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Bh("short",n,e);case"zzzz":default:return Bh("long",n,e)}}};function Xa(n,t){const e=n?Cs(n,t,!0)/Pv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Br(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function ki(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Br(Math.floor(i/60),2),r=Br(Math.floor(i%60),2);return e+s+t+r}function Vh(n,t){return n%60===0?(n>0?"-":"+")+Br(Math.abs(n)/60,2):ki(n,t)}function Ev(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Br(r,2)}function $h(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 Uh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,qa=36e5,Xh=6e4,Av=2,ce={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Uh};function Hr(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?Av: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=Rv(n),{year:s,restDateString:r}=Iv(i.date,e),o=Lv(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Nv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Cs(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=$h(new Date(a+l)),c=$h(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Rv(n){const t={};let e=ce.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ce.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ce.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Iv(n,t){if(n){const e=ce.YYY[t],i=ce.YYYYY[t];let s=ce.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ce.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Lv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ce.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Kh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ce.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Bv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ce.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Kh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ce.Www.exec(n),r)return s=parseInt(r[1],10)-1,Zh(s)?qh(t,s):new Date(NaN);if(r=ce.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Zh(s,o)?qh(t,s,o):new Date(NaN)}return null}function Nv(n){let t,e,i=ce.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*qa:NaN;if(i=ce.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ga(t,e)?t%24*qa+e*Xh:NaN;if(i=ce.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ga(t,e,s)?t%24*qa+e*Xh+s*1e3:NaN}return null}function qh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Fv=[31,28,31,30,31,30,31,31,30,31,30,31],zv=[31,29,31,30,31,30,31,31,30,31,30,31];function Gh(n){return n%400===0||n%4===0&&n%100!==0}function Kh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Gh(n);if(i&&e>zv[t]||!i&&e>Fv[t])return!1}return!0}function Bv(n,t){if(t<1)return!1;const e=Gh(n);return!(e&&t>366||!e&&t>365)}function Zh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ga(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Hv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Wv(n,t,e={}){t=String(t);const i=t.match(Hv);if(i){const s=Hr(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Ov[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return uv(n,t,e)}function Qh(n,t,e){n=Hr(n,e);const i=Cs(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Yv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Wv(Qh(n,t,{timeZone:i.timeZone}),e,i)}function jv(n,t,e){if(typeof n=="string"&&!n.match(Uh))return Hr(n,{...e,timeZone:t});n=Hr(n,e);const i=Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Cs(t,new Date(i));return new Date(i+s)}function Vv(n,t){return-Cs(n,t)}function Di(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return Yv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const $v={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Ka(n){return n&&Qw.find(t=>n<=$v[t])||null}var Wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Yr={exports:{}};Yr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object GeneratorFunction]",f="[object Map]",g="[object Number]",p="[object Object]",y="[object Promise]",x="[object RegExp]",M="[object Set]",v="[object String]",D="[object Symbol]",S="[object WeakMap]",T="[object ArrayBuffer]",A="[object DataView]",O="[object Float32Array]",_="[object Float64Array]",b="[object Int8Array]",C="[object Int16Array]",R="[object Int32Array]",I="[object Uint8Array]",Y="[object Uint8ClampedArray]",L="[object Uint16Array]",W="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,H=/\w*$/,st=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,tt={};tt[r]=tt[o]=tt[T]=tt[A]=tt[a]=tt[l]=tt[O]=tt[_]=tt[b]=tt[C]=tt[R]=tt[f]=tt[g]=tt[p]=tt[x]=tt[M]=tt[v]=tt[D]=tt[I]=tt[Y]=tt[L]=tt[W]=!0,tt[c]=tt[u]=tt[S]=!1;var X=typeof Wr=="object"&&Wr&&Wr.Object===Object&&Wr,B=typeof self=="object"&&self&&self.Object===Object&&self,Q=X||B||Function("return this")(),wt=t&&!t.nodeType&&t,dt=wt&&!0&&n&&!n.nodeType&&n,vt=dt&&dt.exports===wt;function et(w,E){return w.set(E[0],E[1]),w}function At(w,E){return w.add(E),w}function F(w,E){for(var z=-1,G=w?w.length:0;++z<G&&E(w[z],z,w)!==!1;);return w}function j(w,E){for(var z=-1,G=E.length,$t=w.length;++z<G;)w[$t+z]=E[z];return w}function K(w,E,z,G){for(var $t=-1,Gt=w?w.length:0;++$t<Gt;)z=E(z,w[$t],$t,w);return z}function J(w,E){for(var z=-1,G=Array(w);++z<w;)G[z]=E(z);return G}function q(w,E){return w==null?void 0:w[E]}function lt(w){var E=!1;if(w!=null&&typeof w.toString!="function")try{E=!!(w+"")}catch{}return E}function rt(w){var E=-1,z=Array(w.size);return w.forEach(function(G,$t){z[++E]=[$t,G]}),z}function ht(w,E){return function(z){return w(E(z))}}function bt(w){var E=-1,z=Array(w.size);return w.forEach(function(G){z[++E]=G}),z}var Jt=Array.prototype,ue=Function.prototype,qt=Object.prototype,Ht=Q["__core-js_shared__"],_t=function(){var w=/[^.]+$/.exec(Ht&&Ht.keys&&Ht.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Pt=ue.toString,Wt=qt.hasOwnProperty,mt=qt.toString,Ge=RegExp("^"+Pt.call(Wt).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_e=vt?Q.Buffer:void 0,de=Q.Symbol,he=Q.Uint8Array,De=ht(Object.getPrototypeOf,Object),Se=Object.create,Lt=qt.propertyIsEnumerable,Te=Jt.splice,ne=Object.getOwnPropertySymbols,si=_e?_e.isBuffer:void 0,Rn=ht(Object.keys,Object),Ls=Nn(Q,"DataView"),ri=Nn(Q,"Map"),Ns=Nn(Q,"Promise"),oi=Nn(Q,"Set"),cn=Nn(Q,"WeakMap"),un=Nn(Object,"create"),Fs=re(Ls),zs=re(ri),ai=re(Ns),_l=re(oi),xl=re(cn),eo=de?de.prototype:void 0,no=eo?eo.valueOf:void 0;function dn(w){var E=-1,z=w?w.length:0;for(this.clear();++E<z;){var G=w[E];this.set(G[0],G[1])}}function Ai(){this.__data__=un?un(null):{}}function Bs(w){return this.has(w)&&delete this.__data__[w]}function io(w){var E=this.__data__;if(un){var z=E[w];return z===i?void 0:z}return Wt.call(E,w)?E[w]:void 0}function hn(w){var E=this.__data__;return un?E[w]!==void 0:Wt.call(E,w)}function wl(w,E){var z=this.__data__;return z[w]=un&&E===void 0?i:E,this}dn.prototype.clear=Ai,dn.prototype.delete=Bs,dn.prototype.get=io,dn.prototype.has=hn,dn.prototype.set=wl;function Be(w){var E=-1,z=w?w.length:0;for(this.clear();++E<z;){var G=w[E];this.set(G[0],G[1])}}function vl(){this.__data__=[]}function Ml(w){var E=this.__data__,z=Ii(E,w);if(z<0)return!1;var G=E.length-1;return z==G?E.pop():Te.call(E,z,1),!0}function kl(w){var E=this.__data__,z=Ii(E,w);return z<0?void 0:E[z][1]}function He(w){return Ii(this.__data__,w)>-1}function Dl(w,E){var z=this.__data__,G=Ii(z,w);return G<0?z.push([w,E]):z[G][1]=E,this}Be.prototype.clear=vl,Be.prototype.delete=Ml,Be.prototype.get=kl,Be.prototype.has=He,Be.prototype.set=Dl;function In(w){var E=-1,z=w?w.length:0;for(this.clear();++E<z;){var G=w[E];this.set(G[0],G[1])}}function Sl(){this.__data__={hash:new dn,map:new(ri||Be),string:new dn}}function Tl(w){return Fi(this,w).delete(w)}function Cl(w){return Fi(this,w).get(w)}function We(w){return Fi(this,w).has(w)}function Pl(w,E){return Fi(this,w).set(w,E),this}In.prototype.clear=Sl,In.prototype.delete=Tl,In.prototype.get=Cl,In.prototype.has=We,In.prototype.set=Pl;function Ln(w){this.__data__=new Be(w)}function Ol(){this.__data__=new Be}function El(w){return this.__data__.delete(w)}function Al(w){return this.__data__.get(w)}function Ri(w){return this.__data__.has(w)}function Rl(w,E){var z=this.__data__;if(z instanceof Be){var G=z.__data__;if(!ri||G.length<e-1)return G.push([w,E]),this;z=this.__data__=new In(G)}return z.set(w,E),this}Ln.prototype.clear=Ol,Ln.prototype.delete=El,Ln.prototype.get=Al,Ln.prototype.has=Ri,Ln.prototype.set=Rl;function Il(w,E){var z=js(w)||Bi(w)?J(w.length,String):[],G=z.length,$t=!!G;for(var Gt in w)Wt.call(w,Gt)&&!($t&&(Gt=="length"||Zl(Gt,G)))&&z.push(Gt);return z}function Ie(w,E,z){var G=w[E];(!(Wt.call(w,E)&&Ys(G,z))||z===void 0&&!(E in w))&&(w[E]=z)}function Ii(w,E){for(var z=w.length;z--;)if(Ys(w[z][0],E))return z;return-1}function Ll(w,E){return w&&so(E,li(E),w)}function Hs(w,E,z,G,$t,Gt,xe){var te;if(G&&(te=Gt?G(w,$t,Gt,xe):G(w)),te!==void 0)return te;if(!gn(w))return w;var ho=js(w);if(ho){if(te=Gl(w),!E)return Ul(w,te)}else{var Fn=Ke(w),fo=Fn==u||Fn==d;if(lo(w))return Hl(w,E);if(Fn==p||Fn==r||fo&&!Gt){if(lt(w))return Gt?w:{};if(te=oo(fo?{}:w),!E)return Xl(w,Ll(te,w))}else{if(!tt[Fn])return Gt?w:{};te=Kl(w,Fn,Hs,E)}}xe||(xe=new Ln);var go=xe.get(w);if(go)return go;if(xe.set(w,te),!ho)var ci=z?ql(w):li(w);return F(ci||w,function($s,Hi){ci&&(Hi=$s,$s=w[Hi]),Ie(te,Hi,Hs($s,E,z,G,Hi,w,xe))}),te}function Nl(w){return gn(w)?Se(w):{}}function Fl(w,E,z){var G=E(w);return js(w)?G:j(G,z(w))}function zl(w){return mt.call(w)}function Li(w){if(!gn(w)||Ql(w))return!1;var E=Vs(w)||lt(w)?Ge:st;return E.test(re(w))}function Bl(w){if(!fn(w))return Rn(w);var E=[];for(var z in Object(w))Wt.call(w,z)&&z!="constructor"&&E.push(z);return E}function Hl(w,E){if(E)return w.slice();var z=new w.constructor(w.length);return w.copy(z),z}function Ni(w){var E=new w.constructor(w.byteLength);return new he(E).set(new he(w)),E}function Wl(w,E){var z=E?Ni(w.buffer):w.buffer;return new w.constructor(z,w.byteOffset,w.byteLength)}function Yl(w,E,z){var G=E?z(rt(w),!0):rt(w);return K(G,et,new w.constructor)}function Ws(w){var E=new w.constructor(w.source,H.exec(w));return E.lastIndex=w.lastIndex,E}function jl(w,E,z){var G=E?z(bt(w),!0):bt(w);return K(G,At,new w.constructor)}function Vl(w){return no?Object(no.call(w)):{}}function $l(w,E){var z=E?Ni(w.buffer):w.buffer;return new w.constructor(z,w.byteOffset,w.length)}function Ul(w,E){var z=-1,G=w.length;for(E||(E=Array(G));++z<G;)E[z]=w[z];return E}function so(w,E,z,G){z||(z={});for(var $t=-1,Gt=E.length;++$t<Gt;){var xe=E[$t],te=void 0;Ie(z,xe,te===void 0?w[xe]:te)}return z}function Xl(w,E){return so(w,ro(w),E)}function ql(w){return Fl(w,li,ro)}function Fi(w,E){var z=w.__data__;return zi(E)?z[typeof E=="string"?"string":"hash"]:z.map}function Nn(w,E){var z=q(w,E);return Li(z)?z:void 0}var ro=ne?ht(ne,Object):co,Ke=zl;(Ls&&Ke(new Ls(new ArrayBuffer(1)))!=A||ri&&Ke(new ri)!=f||Ns&&Ke(Ns.resolve())!=y||oi&&Ke(new oi)!=M||cn&&Ke(new cn)!=S)&&(Ke=function(w){var E=mt.call(w),z=E==p?w.constructor:void 0,G=z?re(z):void 0;if(G)switch(G){case Fs:return A;case zs:return f;case ai:return y;case _l:return M;case xl:return S}return E});function Gl(w){var E=w.length,z=w.constructor(E);return E&&typeof w[0]=="string"&&Wt.call(w,"index")&&(z.index=w.index,z.input=w.input),z}function oo(w){return typeof w.constructor=="function"&&!fn(w)?Nl(De(w)):{}}function Kl(w,E,z,G){var $t=w.constructor;switch(E){case T:return Ni(w);case a:case l:return new $t(+w);case A:return Wl(w,G);case O:case _:case b:case C:case R:case I:case Y:case L:case W:return $l(w,G);case f:return Yl(w,G,z);case g:case v:return new $t(w);case x:return Ws(w);case M:return jl(w,G,z);case D:return Vl(w)}}function Zl(w,E){return E=E??s,!!E&&(typeof w=="number"||$.test(w))&&w>-1&&w%1==0&&w<E}function zi(w){var E=typeof w;return E=="string"||E=="number"||E=="symbol"||E=="boolean"?w!=="__proto__":w===null}function Ql(w){return!!_t&&_t in w}function fn(w){var E=w&&w.constructor,z=typeof E=="function"&&E.prototype||qt;return w===z}function re(w){if(w!=null){try{return Pt.call(w)}catch{}try{return w+""}catch{}}return""}function Jl(w){return Hs(w,!0,!0)}function Ys(w,E){return w===E||w!==w&&E!==E}function Bi(w){return tc(w)&&Wt.call(w,"callee")&&(!Lt.call(w,"callee")||mt.call(w)==r)}var js=Array.isArray;function ao(w){return w!=null&&ec(w.length)&&!Vs(w)}function tc(w){return pn(w)&&ao(w)}var lo=si||uo;function Vs(w){var E=gn(w)?mt.call(w):"";return E==u||E==d}function ec(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function gn(w){var E=typeof w;return!!w&&(E=="object"||E=="function")}function pn(w){return!!w&&typeof w=="object"}function li(w){return ao(w)?Il(w):Bl(w)}function co(){return[]}function uo(){return!1}n.exports=Jl}(Yr,Yr.exports),Yr.exports;const Si=(n,t)=>new Date(n.getTime()-Vv(t,n));class ze{constructor(t){Ee(this,"timeframeText"),Ee(this,"key"),Ee(this,"display"),Ee(this,"timeframeLength"),Ee(this,"allowedTiers"),Ee(this,"defaultResponseGranularity"),Ee(this,"dataGranularity"),Ee(this,"isRelative"),Ee(this,"fineGrainedDefaultGranularity"),Ee(this,"_startCustom"),Ee(this,"_endCustom"),Ee(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=jv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Qh(e,t)}}class Uv extends ze{rawStart(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Si(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Xv extends ze{rawStart(t){let e=vi(this.tzAdjustedDate(t));return t&&(e=Si(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class qv extends ze{rawEnd(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Si(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=an(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Si(i,t)),i}}class Gv extends ze{rawEnd(t){let e=vi(this.tzAdjustedDate(t));return t&&(e=Si(e,t)),e}rawStart(t){let e=vi(zh(this.tzAdjustedDate(t)));return t&&(e=Si(e,t)),e}}ft.FIFTEEN_MIN,new ze({key:ft.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),ft.ONE_HOUR,new ze({key:ft.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),ft.SIX_HOUR,new ze({key:ft.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ft.TWELVE_HOUR,new ze({key:ft.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ft.ONE_DAY,new ze({key:ft.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ft.SEVEN_DAY,new ze({key:ft.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ft.THIRTY_DAY,new ze({key:ft.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),ft.CURRENT_WEEK,new Uv({key:ft.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=an(new Date,{weekStartsOn:1});return(zr(Ph(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ft.CURRENT_MONTH,new Xv({key:ft.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=vi(new Date);return(zr(Ph(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ft.PREVIOUS_WEEK,new qv({key:ft.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ft.PREVIOUS_MONTH,new Gv({key:ft.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=vi(new Date),e=vi(zh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Kv(t,e)),60*60*24*hv(new Date().setMonth(new Date().getMonth()-1))+gv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Kv(n,t){return pv(n.getTimezoneOffset()-t.getTimezoneOffset())}ft.FIFTEEN_MIN,ft.ONE_HOUR,ft.SIX_HOUR,ft.TWELVE_HOUR,ft.ONE_DAY,ft.SEVEN_DAY,ft.FIFTEEN_MIN,ft.ONE_HOUR,ft.SIX_HOUR,ft.TWELVE_HOUR,ft.ONE_DAY,ft.SEVEN_DAY,ft.THIRTY_DAY,ft.CURRENT_WEEK,ft.CURRENT_MONTH,ft.PREVIOUS_WEEK,ft.PREVIOUS_MONTH;function Zv(n){return h.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${Di(e)} - ${Di(i,{includeTZ:!0})}`:""})}function Qv(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};$e.positioners[e]=function(r,o){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=a.width/2,u=va(o,l,c),d=o.y,f=o.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:d,xAlign:f}};const s=h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{qd(n.tooltipState,r)}}}}));return h.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),{options:s}}function Jv(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return wh(d,n.granularity.value,o.value)}},title:{display:!ot((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=h.computed(()=>{var l,c;return{title:{display:!ot((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};$e.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,y=va(c,d,g);let x=nw(c,f,p);const M=c.y<p?"top":"bottom",v=c.x<g?"left":"center";return f>u.height&&(x=0),{x:y,y:x,xAlign:v,yAlign:M}};const o=h.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return Ix(l)>24||u.getDate()!==c.getDate()}),a=h.computed(()=>{var l;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:c=>{Kx(n.tooltipState,c,n.granularity.value)}}},interaction:{mode:"index",intersect:!1}}});return h.onUnmounted(()=>{$e.positioners[s]&&delete $e.positioners[s]}),{options:a}}function tM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=gt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Rr(i.indexOf(u),on),data:o.map((d,f)=>e?r[`${d.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const f=Da(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function eM(n,t){const{i18n:e}=gt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0,u=c&&a.length>1;if(!s.length||!o)return{datasets:[],labels:[]};const d=c&&a||o,f=d[0],g=d.length>1?d[1]:d[0],p=Object.fromEntries(l?s.flatMap(b=>o.map((C,R)=>{const I=b.event[f],Y=c?`${I},${C}`:`${R},${C}`,L=b.event[C];return[Y,L]})):s.map(b=>{const C=c?`${b.event[f]},${b.event[g]}`:`${f},${g}`,R=b.event[o[0]];return[C,R]})),y=Object.keys(p).reduce((b,C)=>{const[R]=C.split(","),I=p[C];return b[R]?b[R]+=I:b[R]=I,b},{}),x=Object.entries(y).sort(([,b],[,C])=>Number(C)-Number(b)).map(([b])=>b),M=r[f],v=r[g],D=c&&M&&Object.entries(M).map(([b,C])=>({id:b,name:C.name}))||o.map(b=>({id:b,name:b})),S=c&&v&&Object.entries(v).map(([b,C])=>({id:b,name:C.name}))||o.map(b=>({id:b,name:b}));if(f!=="status_code"&&f!=="status_code_grouped"&&(D.sort((b,C)=>x.indexOf(b.id)-x.indexOf(C.id)),S.sort((b,C)=>x.indexOf(b.id)-x.indexOf(C.id))),!D||!S)return{labels:[],datasets:[]};const T=tM({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:d,barSegmentLabels:S,pivotRecords:p,rowLabels:D,colorPalette:n.colorPalette||on}),A=c?D.map(b=>e&&e.te(`chartLabels.${b.name}`)&&e.t(`chartLabels.${b.name}`)||b.name):o.map(b=>e&&e.te(`chartLabels.${b}`)&&e.t(`chartLabels.${b}`)||b),O=D.map(b=>b.id==="empty");return{labels:A,datasets:T,isLabelEmpty:O,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const nM="#6c7489",iM="#6c7489",sM="#995c00",rM="16px",oM="20px",Jh="24px",aM="40px",lM="48px",cM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),uM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Ud(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},dM=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return cM(a,l,e)};function hM(n,t){const{i18n:e}=gt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],d=r[u],f=r&&d&&Object.keys(d).map(S=>({id:S,name:d[S].name}))||o.map(S=>({id:S,name:S})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const p=uM(a),y=dM(a,l,g,p,s),x=new Set,M=s!=null&&s.length?s.reduce((S,T)=>{const A=new Date(T.timestamp).valueOf(),O=T.event;for(const _ of o)x.add(_),A in S||(S[A]={}),_ in S[A]||(S[A][_]={});for(const _ of o)f.forEach(b=>{O[u]===b.id||_===b.id?(S[A][_]||(S[A][_]={}),S[A][_][b.name]=Math.round(Number(O[_])*1e3)/1e3):c.length||(S[A][_]||(S[A][_]={}),S[A][_][b.name]=Math.round(Number(O[b.id])*1e3)/1e3)});return S},{}):{},D=[...o.length===1?o.flatMap(S=>f.map(T=>[S,T.name,T.id==="empty"])):f.map(S=>[S.name,S.name,S.id==="empty"])].map(([S,T,A],O)=>{const _=y.map(I=>I in M&&S in M[I]?{x:I,y:M[I][S][T]||0}:{x:I,y:0});let{colorPalette:b,fill:C}=n;ot(b)&&(b=on);const R=Da(O,T,A,b);return{rawDimension:T,rawMetric:S,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:R,backgroundColor:R,data:_,total:_.reduce((I,{y:Y})=>I+Number(Y),0),...uw,fill:C,borderWidth:C?hw:dw,isSegmentEmpty:A}});if(u==="status_code"||u==="status_code_grouped"?D.sort((S,T)=>(S.label??"")<(T.label??"")?-1:1):D.sort((S,T)=>Number(S.total)<Number(T.total)?-1:1),n.threshold)for(const S of Object.keys(n.threshold)){const T=n.threshold[S];T&&D.push({type:"line",rawMetric:S,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:nM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:y.map(A=>({x:A,y:T}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const fM=(n,t)=>{h.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function gM(){const{i18n:n}=gt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const Za="analytics-query-provider",tf=2;function pM(){const n=h.inject(Za);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function mM(n,t){const e=h.computed(()=>{if(!n.value)return t.left;const s=n.value.getBoundingClientRect();return`${parseFloat(t.left)+s.left+window.scrollX}px`}),i=h.computed(()=>{if(!n.value)return t.top;const s=n.value.getBoundingClientRect();return`${parseFloat(t.top)+s.top+window.scrollY}px`});return{tooltipAbsoluteLeft:e,tooltipAbsoluteTop:i}}const gt={useBarChartOptions:$w,useChartJSCommon:Xw,useChartLegendValues:Gw,useChartSelectedRange:Zv,useExploreResultToDatasets:eM,useExploreResultToTimeDataset:hM,useDonutChartOptions:Qv,useLineChartOptions:Jv,useI18n:gg,useReportChartDataForSynthetics:fM,useTranslatedUnits:gM,useEvaluateFeatureFlag:pM,useTooltipAbsolutePosition:mM};var Ft=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Ft||{});/*!
|
|
19
19
|
* chartjs-plugin-annotation v3.1.0
|
|
20
20
|
* https://www.chartjs.org/chartjs-plugin-annotation/index
|
|
21
21
|
* (c) 2024 chartjs-plugin-annotation Contributors
|
|
22
22
|
* Released under the MIT License
|
|
23
|
-
*/const ef={modes:{point(n,t){return jr(n,t,{intersect:!0})},nearest(n,t,e){return _M(n,t,e)},x(n,t,e){return jr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return jr(n,t,{intersect:e.intersect,axis:"y"})}}};function Za(n,t,e){return(ef.modes[e.mode]||ef.modes.nearest)(n,t,e)}function yM(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function bM(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function jr(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):yM(i,t,e.axis))}function _M(n,t,e){let i=Number.POSITIVE_INFINITY;return jr(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=bM(t,o,e.axis),l=hi(t,a);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Jn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,o=t.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}const xM=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ti=.001,Vr=(n,t,e)=>Math.min(e,Math.max(t,n)),nf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function wM(n,t,e){for(const i of Object.keys(n))n[i]=Vr(n[i],t,e);return n}function vM(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function sf(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-ti&&n.x<=i+l+ti,u=n.y>=e-l-ti&&n.y<=s+l+ti;return r==="x"?c:(r==="y"||c)&&u}function rf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Jn(n,e,Ut(-s));return sf(a,t,i,{borderWidth:r,hitTolerance:o})}function ei(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function MM(n,t,e,i=!0){const s=e.split(".");let r=0;for(const o of t.split(".")){const a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(xM(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const of=n=>typeof n=="string"&&n.endsWith("%"),af=n=>parseFloat(n)/100,lf=n=>Vr(af(n),0,1),Ps=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),kM={box:n=>Ps(n.centerX,n.centerY),doughnutLabel:n=>Ps(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ps(n.centerX,n.centerY),line:n=>Ps(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ps(n.centerX,n.centerY)};function Qa(n,t){return t==="start"?0:t==="end"?n:of(t)?lf(t)*n:n/2}function Pn(n,t,e=!0){return typeof t=="number"?t:of(t)?(e?lf(t):af(t))*n:n}function DM(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function cf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=ct(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=Ja(i),d=ff(n.x,l,s,u.x),f=ff(n.y,c,r,u.y);return{x:d,y:f,x2:d+l,y2:f+c,width:l,height:c,centerX:d+l/2,centerY:f+c/2}}function Ja(n,t="center"){return ct(n)?{x:it(n.x,t),y:it(n.y,t)}:(n=it(n,t),{x:n,y:n})}const uf=(n,t)=>n&&n.autoFit&&t<1;function df(n,t){const e=n.font,i=Mt(e)?e:[e];return uf(n,t)?i.map(function(s){const r=It(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,It(r)}):i.map(s=>It(s))}function hf(n){return n&&(ge(n.xValue)||ge(n.yValue))}function ff(n,t,e=0,i){return n-Qa(t,i)+e}function Ti(n,t,e){const i=e.init;if(i){if(i===!0)return pf(t,e)}else return;return SM(n,t,e)}function gf(n,t,e){let i=!1;return t.forEach(s=>{pe(n[s])?(i=!0,e[s]=n[s]):ge(e[s])&&delete e[s]}),i}function pf(n,t){const e=t.type||"line";return kM[e](n)}function SM(n,t,e){const i=kt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return pf(t,e);if(ct(i))return i}const tl=new Map,TM=n=>isNaN(n)||n<=0,CM=n=>n.reduce(function(t,e){return t+=e.string,t},"");function $r(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Ur(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Ut(i)),n.translate(-t,-e))}function ln(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Ci(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Xr(n,t){const e=t.content;if($r(e))return{width:Pn(e.width,t.width),height:Pn(e.height,t.height)};const i=df(t),s=t.textStrokeWidth,r=Mt(e)?e:[e],o=r.join()+CM(i)+s+(n._measureText?"-spriting":"");return tl.has(o)||tl.set(o,AM(n,r,i,s)),tl.get(o)}function mf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Ci(n,e);const a=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),fi(n,{x:i,y:s,w:r,h:o,radius:wM(vn(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function yf(n,t,e,i){const s=e.content;if($r(s)){n.save(),n.globalAlpha=LM(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=Mt(s)?s:[s],o=df(e,i),a=e.color,l=Mt(a)?a:[a],c=DM(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,PM(n,e)&&RM(n,{x:c,y:u},r,o),IM(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function PM(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function OM(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Mo;if($r(o)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),n.restore();return}TM(s)||EM(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function EM(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:o}){let a,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ct),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(o+Pe)*c,l=Math.sin(o+Pe)*c,n.arc(t-a,e-l,u,o-pt,o-Ot),n.arc(t+l,e-a,u,o-Ot,o),n.arc(t+a,e+l,u,o,o+Ot),n.arc(t-l,e+a,u,o+Ot,o+pt),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=Pe;case"rectRot":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":o+=Pe;case"cross":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),o+=Pe,a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(o)*i,e+Math.sin(o)*i);break}n.fill()}function AM(n,t,e,i){n.save();const s=t.length;let r=0,o=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];r=Math.max(r,n.measureText(c).width+i),o+=l.lineHeight}return n.restore(),{width:r,height:o}}function RM(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(o,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(o,t,e+c/2+r),r+=c}),n.stroke()}function IM(n,{x:t,y:e},i,{fonts:s,colors:r}){let o=0;i.forEach(function(a,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(a,t,e+d/2+o),o+=d,n.fill()})}function LM(n,t){const e=wn(n)?n:t;return wn(e)?Vr(e,0,1):1}const bf=["left","bottom","top","right"];function NM(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&WM(t,r);if(!o||jM(t,r,o))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=FM(t,o),{sideStart:u,sideEnd:d}=BM(t,o,l);(r.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const f=Jn({x:e,y:i},t.getCenterPoint(),Ut(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function FM(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=zM(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+o,y:i},l={x:a.x,y:r}):(a={x:e,y:i+o},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function zM(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function BM(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=HM(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Pn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Pn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function HM(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function WM(n,t){const e=t.position;return bf.includes(e)?e:YM(n,t)}function YM(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,y=Pn(o,p),x=Pn(a,p),M=[e,e+y,e+y,s],v=[i+x,r,i,r],D=[];for(let S=0;S<4;S++){const T=Jn({x:M[S],y:v[S]},g,Ut(f));D.push({position:bf[S],distance:hi(T,{x:l,y:c})})}return D.sort((S,T)=>S.distance-T.distance)[0].position}function jM(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let o=i,a=s;return e==="left"?o+=r:e==="right"?o-=r:e==="top"?a+=r:e==="bottom"&&(a-=r),n.inRange(o,a)}const _f={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Pi(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function ni(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function xf(n,t){if(n){const e=n.options.reverse,i=Pi(n,t.min,e?t.end:t.start),s=Pi(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function wf(n,t){const{chartArea:e,scales:i}=n,s=i[ni(i,t,"xScaleID")],r=i[ni(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=Pi(s,t.xValue,s.left+s.width/2)),r&&(a=Pi(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function el(n,t){const e=n.scales,i=e[ni(e,t,"xScaleID")],s=e[ni(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=kf(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=kf(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:r,y:a,x2:o,y2:l,width:o-r,height:l-a,centerX:r+(o-r)/2,centerY:a+(l-a)/2}}function vf(n,t){if(!hf(t)){const e=el(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,o=e.centerY+t.yAdjust;return{x:r-i,y:o-i,x2:r+i,y2:o+i,centerX:r,centerY:o,width:s,height:s,radius:i}}return $M(n,t)}function VM(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?UM(s,r,t):XM(e,r,t),r}function Mf(n,t){const e=el(n,t);return e.initProperties=Ti(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:KM(n,e,t),initProperties:e.initProperties}],e}function $M(n,t){const e=wf(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function kf(n,t){const e=xf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function UM(n,t,e){const i=Pi(n,e.value,NaN),s=Pi(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function XM(n,t,e){for(const i of Object.keys(_f)){const s=n[ni(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=_f[i],d=xf(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function qM({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return Df({start:r,end:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function GM({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return Df({start:r,end:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Df(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:l}=t,c=i-s-e-o-a-t.size;return e+s/2+l+Qa(c,r)}function KM(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=Ja(i.position),r=Xt(i.padding),o=Xr(n.ctx,i),a=qM({properties:t,options:e},o,s,r),l=GM({properties:t,options:e},o,s,r),c=o.width+r.width,u=o.height+r.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const nl=["enter","leave"],il=nl.concat("click");function ZM(n,t,e){t.listened=gf(e,il,t.listeners),t.moveListened=!1,nl.forEach(i=>{pe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&pe(i.click)&&(t.listened=!0),t.moveListened||nl.forEach(s=>{pe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function QM(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return JM(n,t,e);case"click":return tk(n,t,e)}}function JM(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Za(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=Sf(r,"leave",s,i);return Sf(r,"enter",i,s)||o}function Sf({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=Tf(o.options[e]||n.listeners[e],o,t)||r);return r}function tk(n,t,e){const i=n.listeners,s=Za(n.visibleElements,t,e.interaction);let r;for(const o of s)r=Tf(o.options.click||i.click,o,t)||r;return r}function Tf(n,t,e){return kt(n,[t.$context,e])===!0}const qr=["afterDraw","beforeDraw"];function ek(n,t,e){const i=t.visibleElements;t.hooked=gf(e,qr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||qr.forEach(r=>{pe(s.options[r])&&(t.hooked=!0)})})}function Cf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return kt(i,[t.$context])}}function nk(n,t,e){const i=ak(n.scales,t,e);let s=Pf(t,i,"min","suggestedMin");s=Pf(t,i,"max","suggestedMax")||s,s&&pe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function ik(n,t){for(const e of n)rk(e,t)}function Pf(n,t,e,i){if(Rt(t[e])&&!sk(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function sk(n,t,e){return ge(n[t])||ge(n[e])}function rk(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ni(t,n,e);i&&!t[i]&&ok(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function ok(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ge(n[e+i]))return!0;return!1}function ak(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:it(t.min,Number.NEGATIVE_INFINITY),max:it(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Of(a,t,["value","endValue"],o):ni(n,a,r)===s&&Of(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Of(n,t,e,i){for(const s of e){const r=n[s];if(ge(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Oi extends Qt{inRange(t,e,i,s){const{x:r,y:o}=Jn({x:t,y:e},this.getCenterPoint(s),Ut(-this.options.rotation));return sf({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return ei(this,t)}draw(t){t.save(),Ur(t,this.getCenterPoint(),this.options.rotation),mf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Mf(t,e)}}Oi.id="boxAnnotation",Oi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Oi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Oi.descriptors={label:{_fallback:!0}};class Gr extends Qt{inRange(t,e,i,s){return rf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options;!e.display||!e.content||(fk(t,this),t.save(),Ur(t,this.getCenterPoint(),this.rotation),yf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=lk(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=uk(t,e,i);let a=Xr(t.ctx,e);const l=dk(a,o);uf(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,f=cf(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:Ti(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}Gr.id="doughnutLabelAnnotation",Gr.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},Gr.defaultRoutes={};function lk(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof sn&&ck(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function ck(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function uk({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:o}=n,{innerRadius:a,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,d=(s+o)/2+c,f={left:Math.max(u-a,i),right:Math.min(u+a,r),top:Math.max(d-a,s),bottom:Math.min(d+a,o)},g={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,y=a-p,x=g.y>d,M=x?s+p:o-p,v=hk(M,u,d,y);return{controllerMeta:{_centerX:u,_centerY:d,_radius:y,_counterclockwise:x,...v},point:g,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function dk({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function hk(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),o=t*-2,a=Math.pow(t,2)+s-r,l=Math.pow(o,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Ct};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:tr({x:t,y:e},{x:c,y:n}).angle,_endAngle:tr({x:t,y:e},{x:u,y:n}).angle}}function fk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=ln(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,o,a),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Os extends Qt{inRange(t,e,i,s){return rf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=!ge(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Ur(t,this.getCenterPoint(),this.rotation),NM(t,this),mf(t,this,e),yf(t,gk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(hf(e))i=wf(t,e);else{const{centerX:a,centerY:l}=el(t,e);i={x:a,y:l}}const s=Xt(e.padding),r=Xr(t.ctx,e),o=cf(i,r,e,s);return{initProperties:Ti(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Os.id="labelAnnotation",Os.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Os.defaultRoutes={borderColor:"color"};function gk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Xt(s.padding);return{x:n+o.left+r,y:t+o.top+r,width:e-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}const sl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),rl=(n,t,e)=>sl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Ef=(n,t,e)=>sl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Es=n=>n*n,pk=(n,t,{x:e,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},Af=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,ol=(n,t,e,i)=>({x:Af(n.x,t.x,e.x,i),y:Af(n.y,t.y,e.y,i)}),Rf=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),If=(n,t,e,i)=>-Math.atan2(Rf(n.x,t.x,e.x,i),Rf(n.y,t.y,e.y,i))+.5*pt;class As extends Qt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const o={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,f)||al(this,o,s);return l.restore(),g}const c=Es(r);return _k(this,o,c,s)||al(this,o,s)}return mk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return ei(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!ln(t,a))return t.restore();Ci(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return Tk(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Bf(this),g=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),ll(t,0,d,c),ll(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=VM(t,e),{x:s,y:r,x2:o,y2:a}=i,l=yk(i,t.chartArea),c=l?bk({x:s,y:r},{x:o,y:a},t.chartArea):{x:s,y:r,x2:o,y2:a,width:Math.abs(o-s),height:Math.abs(a-r)};if(c.centerX=(o+s)/2,c.centerY=(a+r)/2,c.initProperties=Ti(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Sk(c,e,hi(d,f))}const u=xk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}As.id="lineAnnotation";const Lf={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};As.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Lf),fill:!1,length:12,start:Object.assign({},Lf),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Os.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},As.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},As.defaultRoutes={borderColor:"color"};function mk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=pk(t,e,n.getProps(["x","y","x2","y2"],r),i);return nf(o,s)||al(n,{mouseX:t,mouseY:e},r,i)}function yk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&e<a||n>r&&e>r||t<s&&i<s||t>o&&i>o)}function Nf({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Ef(o,{x:n,y:t},e),n=o),n>s&&(t=Ef(s,{x:n,y:t},e),n=s),t<i&&(n=rl(i,{x:n,y:t},e),t=i),t>r&&(n=rl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function bk(n,t,e){const{x:i,y:s}=Nf(n,t,e),{x:r,y:o}=Nf(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function _k(n,{mouseX:t,mouseY:e},i=ti,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Es(c)+Es(u),f=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return f<0?(g=r,p=o):f>1?(g=a,p=l):(g=r+f*c,p=o+f*u),Es(t-g)+Es(e-p)<=i}function al(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function xk(n,t,e){const i=e.borderWidth,s=Xt(e.padding),r=Xr(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return vk(t,e,{width:o,height:a,padding:s},n.chartArea)}function wk(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>pt/2?r-pt:r<pt/-2?r+pt:r}function vk(n,t,e,i){const{width:s,height:r,padding:o}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?wk(n):Ut(t.rotation),f=Mk(s,r,d),g=kk(n,t,{labelSize:f,padding:o},i),p=n.cp?ol(c,n.cp,u,g):sl(c,u,g),y={size:f.w,min:i.left,max:i.right,padding:o.left},x={size:f.h,min:i.top,max:i.bottom,padding:o.top},M=zf(p.x,y)+a,v=zf(p.y,x)+l;return{x:M-s/2,y:v-r/2,x2:M+s/2,y2:v+r/2,centerX:M,centerY:v,pointX:p.x,pointY:p.y,width:s,height:r,rotation:Js(d)}}function Mk(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function kk(n,t,e,i){let s;const r=Dk(n,i);return t.position==="start"?s=Ff({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Ff({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=Qa(1,t.position),s}function Ff(n,t,e,i){const{labelSize:s,padding:r}=t,o=n.w*i.dx,a=n.h*i.dy,l=o>0&&(s.w/2+r.left-i.x)/o,c=a>0&&(s.h/2+r.top-i.y)/a;return Vr(Math.max(l,c),0,.25)}function Dk(n,t){const{x:e,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(o,l),dx:a<=c?1:-1,dy:o<=l?1:-1}}function zf(n,t){const{size:e,min:i,max:s,padding:r}=t,o=e/2;return e>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function Bf(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Hf(n,e),endAdjust:Hf(n,i)}}function Hf(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(rl(0,r,{x:0,y:s}))}function ll(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:o,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ci(n,i),ln(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),o===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Sk(n,t,e){const{x:i,y:s,x2:r,y2:o,centerX:a,centerY:l}=n,c=Math.atan2(o-s,r-i),u=Ja(t.controlPoint,0),d={x:a+Pn(e,u.x,!1),y:l+Pn(e,u.y,!1)};return Jn(d,{x:a,y:l},c)}function Wf(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),ll(n,0,-s,r),n.restore())}function Tk(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Bf(t),g={x:s,y:r},p={x:o,y:a},y=If(g,e,p,0),x=If(g,e,p,1)-pt,M=ol(g,e,p,d/i),v=ol(g,e,p,1-f/i),D=new Path2D;n.beginPath(),D.moveTo(M.x,M.y),D.quadraticCurveTo(e.x,e.y,v.x,v.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,Wf(n,M,{angle:y,adjust:d},c),Wf(n,v,{angle:x,adjust:f},u)}class Rs extends Qt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Ck({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,o);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),d=i==="y"?{start:l,end:u}:{start:a,end:c},f=Jn({x:t,y:e},this.getCenterPoint(s),Ut(-r));return f[i]>=d.start-o-ti&&f[i]<=d.end+o+ti}getCenterPoint(t){return ei(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),Ur(t,this.getCenterPoint(),o.rotation),Ci(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=ln(t,o);t.ellipse(s,r,i/2,e/2,pt/2,0,2*pt),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Mf(t,e)}}Rs.id="ellipseAnnotation",Rs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Oi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Rs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Rs.descriptors={label:{_fallback:!0}};function Ck(n,t,e,i){const{width:s,height:r,centerX:o,centerY:a}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=Ut(e||0),d=Math.cos(u),f=Math.sin(u),g=Math.pow(d*(n.x-o)+f*(n.y-a),2),p=Math.pow(f*(n.x-o)-d*(n.y-a),2);return g/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class Kr extends Qt{inRange(t,e,i,s){const{x:r,y:o,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?vM({x:t,y:e},this.getCenterPoint(s),c/2,u):nf(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ci(t,e);const s=ln(t,e);OM(t,this,this.centerX,this.centerY),s&&!$r(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=vf(t,e);return i.initProperties=Ti(t,i,e),i}}Kr.id="pointAnnotation",Kr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Kr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class Zr extends Qt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Ok(this.elements,t,e,s);const r=Jn({x:t,y:e},this.getCenterPoint(s),Ut(-this.options.rotation)),o=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...o),l=Math.max(...o);return r[i]>=a&&r[i]<=l}getCenterPoint(t){return ei(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ci(t,i);const s=ln(t,i);let r=!0;for(const o of e)r?(t.moveTo(o.x,o.y),r=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=vf(t,e),{sides:s,rotation:r}=e,o=[],a=2*pt/s;let l=r*Mo;for(let c=0;c<s;c++,l+=a){const u=Pk(i,e,l);u.initProperties=Ti(t,i,e),o.push(u)}return i.elements=o,i}}Zr.id="polygonAnnotation",Zr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Zr.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Pk({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const o=(i+s)/2,a=Math.sin(r),l=Math.cos(r),c={x:n+a*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+a*(e+o),bY:t-l*(e+o)}}}function Ok(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const o of n){const a=o.getProps(["bX","bY"],i);a.bY>e!=r.bY>e&&t<(r.bX-a.bX)*(e-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}const On={box:Oi,doughnutLabel:Gr,ellipse:Rs,label:Os,line:As,point:Kr,polygon:Zr};Object.keys(On).forEach(n=>{Et.describe(`elements.${On[n].id}`,{_fallback:"plugins.annotation.common"})});const Ek={update:Object.assign},Ak=il.concat(qr),Yf=(n,t)=>ct(t)?dl(n,t):n,cl=n=>n==="color"||n==="font";function ul(n="line"){return On[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function Rk(n,t,e,i){const s=Lk(n,e.animations,i),r=t.annotations,o=zk(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=jf(o,a,l.type),u=l.setContext(Fk(n,c,o,l)),d=c.resolveElementProperties(n,u);d.skip=Ik(d),"elements"in d&&(Nk(c,d.elements,u,s),delete d.elements),ge(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Vf(u),s.update(c,d)}}function Ik(n){return isNaN(n.x)||isNaN(n.y)}function Lk(n,t,e){return e==="reset"||e==="none"||e==="resize"?Ek:new Fo(n,t)}function Nk(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const o=t[r],a=o.properties,l=jf(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=Vf(c),i.update(l,a)}}function jf(n,t,e,i){const s=On[ul(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Vf(n){const t=On[ul(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,dl(n,t.defaults),dl(n,t.defaultRoutes));for(const i of Ak)e[i]=n[i];return e}function dl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];cl(i)&&Mt(r)?e[i]=r.map(o=>Yf(o,s)):e[i]=Yf(r,s)}return e}function Fk(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function zk(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var Bk="3.1.0";const En=new Map,$f=n=>n.type!=="doughnutLabel",Hk=il.concat(qr);var Uf={id:"annotation",version:Bk,beforeRegister(){MM("chart.js","4.0",Oe.version)},afterRegister(){Oe.register(On)},afterUnregister(){Oe.unregister(On)},beforeInit(n){En.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=En.get(n),s=i.annotations=[];let r=e.annotations;ct(r)?Object.keys(r).forEach(o=>{const a=r[o];ct(a)&&(a.id=o,s.push(a))}):Mt(r)&&s.push(...r),ik(s.filter($f),n.scales)},afterDataLimits(n,t){const e=En.get(n);nk(n,t.scale,e.annotations.filter($f).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=En.get(n);ZM(n,i,e),Rk(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),ek(n,i,e)},beforeDatasetsDraw(n,t,e){Is(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Is(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Is(n,t.index,e.clip)},beforeDraw(n,t,e){Is(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Is(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=En.get(n);QM(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){En.delete(n)},getAnnotations(n){const t=En.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return Za(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!Hk.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${On[ul(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:cl,_fallback:!0},_indexable:cl}},additionalOptionScopes:[""]};function Is(n,t,e){const{ctx:i,chartArea:s}=n,r=En.get(n);e&&Zi(i,s);const o=Wk(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)Yk(i,s,r,a);e&&Qi(i)}function Wk(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function Yk(n,t,e,i){const s=i.element;i.main?(Cf(e,s,"beforeDraw"),s.draw(n,t),Cf(e,s,"afterDraw")):s.draw(n,t)}const jk={class:"zoom-actions-container"},Vk=["onClick"],$k=h.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=gt.useI18n(),r=o=>{o.action(e.newTimeRange),i("onAction")};return(o,a)=>(h.openBlock(),h.createElementBlock("div",jk,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(o.zoomActionItems,l=>(h.openBlock(),h.createElementBlock("div",{key:l.label,class:"zoom-action-item",onClick:c=>r(l)},h.toDisplayString(l.label),9,Vk))),128)),h.createElementVNode("div",{class:"zoom-action-item",onClick:a[0]||(a[0]=l=>o.$emit("onAction"))},h.toDisplayString(h.unref(s).t("zoom_action_items.cancel")),1)]))}}),Re=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},Uk=Re($k,[["__scopeId","data-v-96d04a22"]]),Xk={class:"zoom-timerange-container"},qk={class:"zoom-timerange-heading"},Gk={class:"title"},Kk={class:"zoom-timerange-details"},Zk=Re(h.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{}},setup(n){const t=n,{i18n:e}=gt.useI18n(),i=h.ref(Di(t.start.getTime())),s=h.ref(Di(t.end.getTime())),r=(o,a)=>{Ma(()=>{i.value=Di(o.getTime()),s.value=Di(a.getTime())},100)()};return h.watch(()=>[t.start,t.end],([o,a])=>{r(o,a)},{immediate:!0}),(o,a)=>(h.openBlock(),h.createElementBlock("div",Xk,[h.createElementVNode("div",qk,[h.createElementVNode("span",Gk,h.toDisplayString(h.unref(e).t("new_timerange_label")),1)]),h.createElementVNode("div",Kk,[h.createVNode(h.unref(nc.KBadge),null,{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(i.value),1)]),_:1}),a[0]||(a[0]=h.createTextVNode(" - ")),h.createVNode(h.unref(nc.KBadge),null,{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(s.value),1)]),_:1})])]))}}),[["__scopeId","data-v-1d43bf39"]]),Qk={key:2},Jk={class:"tooltip-title"},tD={class:"title"},eD={key:0,class:"subtitle"},nD={class:"context"},iD={class:"metric"},sD={class:"tooltip"},rD={key:0},oD={class:"display-value"},hl=Re(h.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0}},emits:["dimensions","top","left","onAction"],setup(n,{emit:t}){const e=t,i=n,s=h.ref(null),r=h.ref(!1),o=h.ref({x:0,y:0}),a=h.ref({x:0,y:0}),l=h.ref({left:i.absoluteLeft,top:i.absoluteTop}),c=h.computed(()=>i.state.tooltipContext),u=h.computed(()=>i.state.metricDisplay),d=h.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));h.watch(s,x=>{if(x){const{width:M,height:v}=x.getBoundingClientRect();e("dimensions",{width:M,height:v})}}),h.watch(()=>i.state.interactionMode,x=>{["interactive","zoom-interactive"].includes(x)&&(l.value.left=i.absoluteLeft,l.value.top=i.absoluteTop)});function f(x){if(s.value){r.value=!0,document.body.classList.add("no-select");const M=window.getComputedStyle(s.value),v=M.transform||M.webkitTransform||M.mozTransform,D=new DOMMatrix(v),S=D.m41,T=D.m42;o.value={x:S,y:T},a.value={x:x.clientX,y:x.clientY},window.addEventListener("mousemove",p),window.addEventListener("mouseup",y)}}let g=null;function p(x){x.preventDefault(),x.stopPropagation(),r.value&&(g!==null&&window.cancelAnimationFrame(g),g=window.requestAnimationFrame(()=>{const M=x.clientX-a.value.x,v=x.clientY-a.value.y;l.value.left=`${o.value.x+M}px`,l.value.top=`${o.value.y+v}px`}))}function y(){r.value=!1,document.body.classList.remove("no-select"),g!==null&&window.cancelAnimationFrame(g),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",y)}return(x,M)=>{var v,D;return x.state.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:h.normalizeClass(["tooltip-container",{locked:x.state.interactionMode==="interactive"}]),style:h.normalizeStyle({transform:d.value?`translate(${l.value.left}, ${l.value.top})`:`translate(${x.absoluteLeft}, ${x.absoluteTop})`,left:"0",top:"0",pointerEvents:d.value?"all":"none"}),onMousedown:f},[x.state.interactionMode==="selecting-chart-area"?(h.openBlock(),h.createBlock(Zk,{key:0,end:(v=x.zoomTimeRange)==null?void 0:v.end,start:(D=x.zoomTimeRange)==null?void 0:D.start},null,8,["end","start"])):x.state.interactionMode==="zoom-interactive"&&x.zoomTimeRange&&x.zoomActionItems?(h.openBlock(),h.createBlock(Uk,{key:1,"new-time-range":x.zoomTimeRange,"zoom-action-items":x.zoomActionItems,onOnAction:M[0]||(M[0]=S=>e("onAction"))},null,8,["new-time-range","zoom-action-items"])):(h.openBlock(),h.createElementBlock("div",Qk,[h.createElementVNode("div",Jk,[h.createElementVNode("div",tD,[h.createElementVNode("div",null,h.toDisplayString(x.tooltipTitle),1),d.value?(h.openBlock(),h.createBlock(h.unref(ec.DragIcon),{key:0,class:"drag-icon",color:h.unref(iM),size:h.unref(rM)},null,8,["color","size"])):h.createCommentVNode("",!0)]),c.value||u.value?(h.openBlock(),h.createElementBlock("div",eD,[h.createElementVNode("div",nD,h.toDisplayString(c.value),1),h.createElementVNode("div",iD,h.toDisplayString(u.value),1)])):h.createCommentVNode("",!0)]),h.createElementVNode("ul",sD,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(x.state.tooltipSeries,({backgroundColor:S,borderColor:T,label:R,value:E,isSegmentEmpty:_})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:R},[x.state.tooltipSeries.length?(h.openBlock(),h.createElementBlock("li",rD,[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:S,"border-color":T})},null,4),h.createElementVNode("span",{class:h.normalizeClass(["display-label",{empty:_}])},h.toDisplayString(R),3),h.createElementVNode("span",oD,h.toDisplayString(E),1)])):h.createCommentVNode("",!0)],64))),128))])]))],38)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-734753ff"]]),aD=["onClick"],lD={key:0,class:"sub-label"},cD={class:"tooltip-content"},fl=Re(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){h.useCssVars(S=>({c25a8106:l.value}));const t=n,{i18n:e}=gt.useI18n(),i=h.ref(),s=h.ref([]),r=h.inject("showLegendValues",!0),o=h.inject("legendPosition",h.ref(Ft.Right)),a=h.ref([]),l=h.ref(Qh),c=()=>{const S=i.value;if(!S||!s.value||S.children.length===0)return 0;const T=S.children[0].getBoundingClientRect().top;for(const R of s.value)if(R.getBoundingClientRect().top>T)return!0;return!1},u=h.computed(()=>t.items.length>2||o.value===Ft.Right),d=()=>{i.value&&o.value===Ft.Bottom&&(c()?l.value=lM:l.value=Qh)},f=()=>{if(i.value&&o.value===Ft.Bottom){let S=0;s.value.forEach(R=>{const E=Array.from(R.children).reduce((_,b)=>_+b.offsetWidth,0);E>S&&(S=E)});const T=parseInt(aM,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${S+T}px)`}d()},g=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let S=0;S<t.items.length;S++)if(t.items[S].text!==a.value[S].text)return a.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{g()&&f()},{immediate:!0,flush:"post"});const p=h.ref(0),y=h.ref(0),x=new ResizeObserver(Ma(S=>{const T=S[0],R=T.contentRect.width,E=T.contentRect.height;R!==p.value&&E===y.value&&f(),p.value=R,y.value=E},100));h.watch(()=>o.value,()=>{f()}),h.onMounted(()=>{a.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),h.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const M=(S=0,T)=>{if(t.chartInstance===null)return;const R=t.chartInstance instanceof Oe?t.chartInstance:t.chartInstance.chart;v(S,T)?R.hide(S,T):R.show(S,T),R.update()},v=(S=0,T)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const R=t.chartInstance instanceof Oe?t.chartInstance:t.chartInstance.chart,E=R.getDatasetMeta(S);return E.dataset||T===void 0?R.isDatasetVisible(S):!(E.data.length&&E.data[T].hidden)},D=S=>({[Ft.Right]:"vertical",[Ft.Bottom]:"horizontal",[Ft.Hidden]:"hidden"})[S];return(S,T)=>{const R=h.resolveComponent("KTooltip");return h.unref(o)!==h.unref(Ft).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:h.normalizeClass(["legend-container",D(h.unref(o))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:E,strokeStyle:_,text:b,datasetIndex:P,index:I,value:C,isSegmentEmpty:N})=>(h.openBlock(),h.createElementBlock("li",{key:b,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:j=>M(P,I)},[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:E,"border-color":_})},null,4),h.createVNode(R,null,h.createSlots({default:h.withCtx(()=>[h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!v(P,I)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":u.value,empty:N}])},h.toDisplayString(b),3),C&&h.unref(r)?(h.openBlock(),h.createElementBlock("div",lD,h.toDisplayString(C.formatted),1)):h.createCommentVNode("",!0)],2)]),_:2},[N?{name:"content",fn:h.withCtx(()=>[h.createElementVNode("div",cD,h.toDisplayString(h.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,aD))),128))],2)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-afbe6cec"]]);for(var ee=[],gl=0;gl<256;++gl)ee.push((gl+256).toString(16).slice(1));function uD(n,t=0){return(ee[n[t+0]]+ee[n[t+1]]+ee[n[t+2]]+ee[n[t+3]]+"-"+ee[n[t+4]]+ee[n[t+5]]+"-"+ee[n[t+6]]+ee[n[t+7]]+"-"+ee[n[t+8]]+ee[n[t+9]]+"-"+ee[n[t+10]]+ee[n[t+11]]+ee[n[t+12]]+ee[n[t+13]]+ee[n[t+14]]+ee[n[t+15]]).toLowerCase()}var Qr,dD=new Uint8Array(16);function hD(){if(!Qr&&(Qr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qr(dD)}var fD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Xf={randomUUID:fD};function Jr(n,t,e){if(Xf.randomUUID&&!n)return Xf.randomUUID();n=n||{};var i=n.random||(n.rng||hD)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,uD(i)}const qf=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()};class Gf{constructor(){O(this,"id","highlightPlugin");O(this,"_clickedElements");O(this,"_previousHoverOption");O(this,"_clicked",!1);O(this,"_pause",!1);O(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&qf(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,qf(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const gD=["id"],pD=["id"],mD={class:"axis-tooltip-content"},Kf=6,yD="100%",bD="100%",_D=20,xD=20,Zf=6,wD=0,vD=10,MD=10,kD=1,DD=Re(h.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=gt.useI18n(),{translateUnit:i}=gt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),o=new Gf,a=h.ref(null),l=h.useTemplateRef("chartParentRef"),c=({chart:F},W)=>{var q;const K=F.data,J=(q=K.labels)==null?void 0:q.indexOf(W);return K.datasets.reduce((at,st,ht)=>{if(F.isDatasetVisible(ht)){const bt=st.data[J];return isNaN(bt)?at:at+bt}else return at},0)},u=(F,W,K,J)=>{const q=J==="horizontal";W===null&&(W=e.t("entityNoName"));const at={type:"label",yValue:bt=>q?W:c(bt,W),xValue:bt=>q?c(bt,W):W},st={...at,position:q?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>q?0:-Math.abs(fw()),content:bt=>Ta(c(bt,W),K)},ht={...at,content:bt=>sh(c(bt,W),ih(bt.chart,F)),position:q?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:bt=>q?nh(Ta(c(bt,W),K)):0,color:Jd};return{[`${W}-value`]:st,[`${W}-percent`]:ht}},d=h.ref(null),f=h.ref(),g=h.ref(Jr()),p=Jr(),y=Jr(),x=h.ref([]),M=h.ref(h.inject("legendPosition",Ft.Right)),v=h.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),D=h.toRef(t,"metricUnit"),S=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),T=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:S.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:R,tooltipAbsoluteTop:E}=gt.useTooltipAbsolutePosition(l,T),_=h.ref(0),b=()=>{var F;return t.annotations&&((F=t.chartData.labels)==null?void 0:F.reduce((W,K)=>Object.assign(W,u(t.chartData,K,D.value,t.orientation)),{}))},P={id:g.value,afterUpdate(F){_.value+=1,x.value=qd(F,t.legendValues,t.chartLegendSortFn)}},I={id:p,afterUpdate(F){F.options.plugins.annotation.annotations=t.annotations?b():{}}},j=[P,{id:"axisHover",afterEvent(F,W){var K;if(v.show=!1,W.event.type==="mousemove"){const J=W.event,q=F.options.indexAxis,at=F.scales,st=F.scales[q].getLabelForValue(Number(F.scales[q].getValueForPixel(J[q]))),bt=F.scales[q].getLabels().indexOf(st),Jt=(K=t.chartData.isLabelEmpty)==null?void 0:K[bt];if((qt=>qt==="x"?J.y>at.x.top:J.x<at.y.right)(q)){T.interactionMode!=="interactive"&&(T.showTooltip=!1);const Ht=F.canvas.getContext("2d").measureText(st).width,_t=Math.abs(Math.round(J.x-Ht*.5)),Pt=Math.round(J.x+Ht*.5),Wt=F.canvas.getBoundingClientRect(),mt=40;v.left=q==="x"?`${(_t>0?_t:Pt)-v.offset+Wt.left}px`:`${J.x-Ht*.5-v.offset+Wt.left}px`,v.top=`${J.y-mt+Wt.top}px`,st.length>Ar?(v.show=!0,v.text=st):Jt?(v.text=e.t("emptyEntityInfo"),v.show=!0):v.show=!1}else v.show=!1}}},{id:y,afterUpdate(F){F.options.layout.padding.right=S.value?Q.value:0}},o,...t.annotations?[I]:[]],$=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),X=h.ref(0),H=h.ref(0),ut=new ResizeObserver(Ma(F=>{X.value=F[0].contentRect.width,H.value=F[0].contentRect.height},100)),V=h.computed(()=>{var W,K;const F=(K=(W=t.chartData)==null?void 0:W.labels)==null?void 0:K.length;return d.value&&F&&!S.value?`${Math.max(F*(_D+Zf),X.value)}px`:yD}),tt=h.computed(()=>{var W,K;const F=(K=(W=t.chartData)==null?void 0:W.labels)==null?void 0:K.length;return d.value&&F&&S.value?`${Math.max(F*(xD+Zf),H.value)}px`:bD});gt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&Oe.register(Uf),a.value&&(X.value=a.value.offsetWidth,H.value=a.value.offsetHeight,ut.observe(a.value))}),h.onUnmounted(()=>{a.value&&ut.unobserve(a.value)});const U=h.computed(()=>{const F=gt.useBarChartOptions({tooltipState:T,legendID:g.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:S.value?"y":"x",numLabels:$});return{...F.value,plugins:{...F.value.plugins,annotation:{annotations:b(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Kf}}}}),B=gt.useChartJSCommon("bar",d,h.toRef(t,"chartData"),j,U),Q=h.computed(()=>{_.value;const F=t.chartData.labels,W=t.chartData.datasets,K=F.map((at,st)=>W.reduce((ht,bt)=>isNaN(Number(bt.data[st]))?ht:ht+Number(bt.data[st]),0)),J=B.value?ih(B.value,t.chartData):gw(t.chartData);return K.map(at=>nh(Ta(at,D.value)+sh(at,J))).reduce((at,st)=>Math.max(at,st),0)+Kf});h.onBeforeUnmount(()=>{Oe.unregister(Uf)});const wt={[Ft.Right]:"legend-row",[Ft.Bottom]:"column"},dt=h.computed(()=>{if(f.value&&B.value){const F=window.devicePixelRatio,W=B.value,K=W.scales.y.width*F+kD,J=(W.scales.y.height+W.scales.y.top+W.scales.x.height)*F,q=f.value.getContext("2d");return q.scale(F,F),q.canvas.width=K,q.canvas.height=J,q.canvas.style.width=`${K/F}px`,q.canvas.style.height=`${J/F}px`,{scale:F,width:K*F,height:J*F,targetCtx:q}}return null}),vt=F=>{const W=F.target;if(dt.value&&B.value&&!S.value){const K=dt.value.scale,J=dt.value.targetCtx,q=dt.value.width,at=dt.value.height,st=B.value,ht=st.canvas;J.fillStyle="white",W.scrollLeft>=wD&&W.scrollLeft<=vD?(J.globalCompositeOperation="source-over",J.clearRect(0,0,q,at),J.drawImage(ht,0,0,q,at,0,0,q,at),J.globalCompositeOperation="destination-over",J.fillRect(0,0,q,at)):(J.globalCompositeOperation="source-over",J.fillRect(0,(st.scales.y.height+st.scales.y.top+MD)*K,q,st.scales.x.height*K))}T.offsetY=W.scrollTop,T.offsetX=W.scrollLeft,v.offset=W.scrollLeft},et=({width:F,height:W})=>{T.width=F,T.height=W};h.watch(()=>t.orientation,()=>{var F;if(f.value&&dt.value){const W=dt.value.width,K=dt.value.height;((F=f.value)==null?void 0:F.getContext("2d")).clearRect(0,0,W,K)}T.showTooltip=!1,T.interactionMode="idle"}),h.watch(()=>t.annotations,F=>{B.value&&(F?B.value.options.plugins.annotation.annotations=b(t.chartData):delete B.value.options.plugins.annotation.annotations)});const At=()=>{T.showTooltip&&(T.interactionMode!=="idle"?T.interactionMode="idle":T.interactionMode="interactive")};return(F,W)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:l,class:h.normalizeClass(["chart-parent",wt[M.value]])},[h.createElementVNode("canvas",{id:h.unref(s),ref_key:"axis",ref:f,class:"axis"},null,8,gD),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:a,class:"chart-container","on:scroll":vt,onClick:W[0]||(W[0]=K=>At())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:V.value,height:tt.value})},[h.createElementVNode("canvas",{id:h.unref(r),ref_key:"canvas",ref:d,class:"chart-canvas"},null,8,pD)],4)],544),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[v.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:v.top,left:v.left}),width:"auto"},[h.createElementVNode("div",mD,h.toDisplayString(v.text),1)],4)):h.createCommentVNode("",!0),h.createVNode(hl,{"absolute-left":h.unref(R),"absolute-top":h.unref(E),state:T,"tooltip-title":F.tooltipTitle,onDimensions:et},null,8,["absolute-left","absolute-top","state","tooltip-title"])])),h.createVNode(fl,{id:g.value,"chart-instance":h.unref(B),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-13a1a6c4"]]);/*!
|
|
23
|
+
*/const ef={modes:{point(n,t){return jr(n,t,{intersect:!0})},nearest(n,t,e){return _M(n,t,e)},x(n,t,e){return jr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return jr(n,t,{intersect:e.intersect,axis:"y"})}}};function Qa(n,t,e){return(ef.modes[e.mode]||ef.modes.nearest)(n,t,e)}function yM(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function bM(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function jr(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):yM(i,t,e.axis))}function _M(n,t,e){let i=Number.POSITIVE_INFINITY;return jr(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=bM(t,o,e.axis),l=hi(t,a);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Jn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,o=t.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}const xM=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ti=.001,Vr=(n,t,e)=>Math.min(e,Math.max(t,n)),nf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function wM(n,t,e){for(const i of Object.keys(n))n[i]=Vr(n[i],t,e);return n}function vM(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function sf(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-ti&&n.x<=i+l+ti,u=n.y>=e-l-ti&&n.y<=s+l+ti;return r==="x"?c:(r==="y"||c)&&u}function rf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Jn(n,e,Ut(-s));return sf(a,t,i,{borderWidth:r,hitTolerance:o})}function ei(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function MM(n,t,e,i=!0){const s=e.split(".");let r=0;for(const o of t.split(".")){const a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(xM(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const of=n=>typeof n=="string"&&n.endsWith("%"),af=n=>parseFloat(n)/100,lf=n=>Vr(af(n),0,1),Ps=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),kM={box:n=>Ps(n.centerX,n.centerY),doughnutLabel:n=>Ps(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ps(n.centerX,n.centerY),line:n=>Ps(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ps(n.centerX,n.centerY)};function Ja(n,t){return t==="start"?0:t==="end"?n:of(t)?lf(t)*n:n/2}function Pn(n,t,e=!0){return typeof t=="number"?t:of(t)?(e?lf(t):af(t))*n:n}function DM(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function cf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=ut(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=tl(i),d=ff(n.x,l,s,u.x),f=ff(n.y,c,r,u.y);return{x:d,y:f,x2:d+l,y2:f+c,width:l,height:c,centerX:d+l/2,centerY:f+c/2}}function tl(n,t="center"){return ut(n)?{x:it(n.x,t),y:it(n.y,t)}:(n=it(n,t),{x:n,y:n})}const uf=(n,t)=>n&&n.autoFit&&t<1;function df(n,t){const e=n.font,i=Mt(e)?e:[e];return uf(n,t)?i.map(function(s){const r=It(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,It(r)}):i.map(s=>It(s))}function hf(n){return n&&(ge(n.xValue)||ge(n.yValue))}function ff(n,t,e=0,i){return n-Ja(t,i)+e}function Ti(n,t,e){const i=e.init;if(i){if(i===!0)return pf(t,e)}else return;return SM(n,t,e)}function gf(n,t,e){let i=!1;return t.forEach(s=>{pe(n[s])?(i=!0,e[s]=n[s]):ge(e[s])&&delete e[s]}),i}function pf(n,t){const e=t.type||"line";return kM[e](n)}function SM(n,t,e){const i=kt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return pf(t,e);if(ut(i))return i}const el=new Map,TM=n=>isNaN(n)||n<=0,CM=n=>n.reduce(function(t,e){return t+=e.string,t},"");function $r(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Ur(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Ut(i)),n.translate(-t,-e))}function ln(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Ci(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Xr(n,t){const e=t.content;if($r(e))return{width:Pn(e.width,t.width),height:Pn(e.height,t.height)};const i=df(t),s=t.textStrokeWidth,r=Mt(e)?e:[e],o=r.join()+CM(i)+s+(n._measureText?"-spriting":"");return el.has(o)||el.set(o,AM(n,r,i,s)),el.get(o)}function mf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Ci(n,e);const a=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),fi(n,{x:i,y:s,w:r,h:o,radius:wM(vn(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function yf(n,t,e,i){const s=e.content;if($r(s)){n.save(),n.globalAlpha=LM(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=Mt(s)?s:[s],o=df(e,i),a=e.color,l=Mt(a)?a:[a],c=DM(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,PM(n,e)&&RM(n,{x:c,y:u},r,o),IM(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function PM(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function OM(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Mo;if($r(o)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),n.restore();return}TM(s)||EM(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function EM(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:o}){let a,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ct),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(o+Pe)*c,l=Math.sin(o+Pe)*c,n.arc(t-a,e-l,u,o-pt,o-Ot),n.arc(t+l,e-a,u,o-Ot,o),n.arc(t+a,e+l,u,o,o+Ot),n.arc(t-l,e+a,u,o+Ot,o+pt),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=Pe;case"rectRot":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":o+=Pe;case"cross":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),o+=Pe,a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(o)*i,e+Math.sin(o)*i);break}n.fill()}function AM(n,t,e,i){n.save();const s=t.length;let r=0,o=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];r=Math.max(r,n.measureText(c).width+i),o+=l.lineHeight}return n.restore(),{width:r,height:o}}function RM(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(o,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(o,t,e+c/2+r),r+=c}),n.stroke()}function IM(n,{x:t,y:e},i,{fonts:s,colors:r}){let o=0;i.forEach(function(a,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(a,t,e+d/2+o),o+=d,n.fill()})}function LM(n,t){const e=wn(n)?n:t;return wn(e)?Vr(e,0,1):1}const bf=["left","bottom","top","right"];function NM(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&WM(t,r);if(!o||jM(t,r,o))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=FM(t,o),{sideStart:u,sideEnd:d}=BM(t,o,l);(r.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const f=Jn({x:e,y:i},t.getCenterPoint(),Ut(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function FM(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=zM(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+o,y:i},l={x:a.x,y:r}):(a={x:e,y:i+o},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function zM(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function BM(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=HM(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Pn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Pn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function HM(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function WM(n,t){const e=t.position;return bf.includes(e)?e:YM(n,t)}function YM(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,y=Pn(o,p),x=Pn(a,p),M=[e,e+y,e+y,s],v=[i+x,r,i,r],D=[];for(let S=0;S<4;S++){const T=Jn({x:M[S],y:v[S]},g,Ut(f));D.push({position:bf[S],distance:hi(T,{x:l,y:c})})}return D.sort((S,T)=>S.distance-T.distance)[0].position}function jM(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let o=i,a=s;return e==="left"?o+=r:e==="right"?o-=r:e==="top"?a+=r:e==="bottom"&&(a-=r),n.inRange(o,a)}const _f={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Pi(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function ni(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function xf(n,t){if(n){const e=n.options.reverse,i=Pi(n,t.min,e?t.end:t.start),s=Pi(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function wf(n,t){const{chartArea:e,scales:i}=n,s=i[ni(i,t,"xScaleID")],r=i[ni(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=Pi(s,t.xValue,s.left+s.width/2)),r&&(a=Pi(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function nl(n,t){const e=n.scales,i=e[ni(e,t,"xScaleID")],s=e[ni(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=kf(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=kf(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:r,y:a,x2:o,y2:l,width:o-r,height:l-a,centerX:r+(o-r)/2,centerY:a+(l-a)/2}}function vf(n,t){if(!hf(t)){const e=nl(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,o=e.centerY+t.yAdjust;return{x:r-i,y:o-i,x2:r+i,y2:o+i,centerX:r,centerY:o,width:s,height:s,radius:i}}return $M(n,t)}function VM(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?UM(s,r,t):XM(e,r,t),r}function Mf(n,t){const e=nl(n,t);return e.initProperties=Ti(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:KM(n,e,t),initProperties:e.initProperties}],e}function $M(n,t){const e=wf(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function kf(n,t){const e=xf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function UM(n,t,e){const i=Pi(n,e.value,NaN),s=Pi(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function XM(n,t,e){for(const i of Object.keys(_f)){const s=n[ni(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=_f[i],d=xf(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function qM({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return Df({start:r,end:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function GM({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return Df({start:r,end:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Df(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:l}=t,c=i-s-e-o-a-t.size;return e+s/2+l+Ja(c,r)}function KM(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=tl(i.position),r=Xt(i.padding),o=Xr(n.ctx,i),a=qM({properties:t,options:e},o,s,r),l=GM({properties:t,options:e},o,s,r),c=o.width+r.width,u=o.height+r.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const il=["enter","leave"],sl=il.concat("click");function ZM(n,t,e){t.listened=gf(e,sl,t.listeners),t.moveListened=!1,il.forEach(i=>{pe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&pe(i.click)&&(t.listened=!0),t.moveListened||il.forEach(s=>{pe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function QM(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return JM(n,t,e);case"click":return tk(n,t,e)}}function JM(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Qa(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=Sf(r,"leave",s,i);return Sf(r,"enter",i,s)||o}function Sf({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=Tf(o.options[e]||n.listeners[e],o,t)||r);return r}function tk(n,t,e){const i=n.listeners,s=Qa(n.visibleElements,t,e.interaction);let r;for(const o of s)r=Tf(o.options.click||i.click,o,t)||r;return r}function Tf(n,t,e){return kt(n,[t.$context,e])===!0}const qr=["afterDraw","beforeDraw"];function ek(n,t,e){const i=t.visibleElements;t.hooked=gf(e,qr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||qr.forEach(r=>{pe(s.options[r])&&(t.hooked=!0)})})}function Cf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return kt(i,[t.$context])}}function nk(n,t,e){const i=ak(n.scales,t,e);let s=Pf(t,i,"min","suggestedMin");s=Pf(t,i,"max","suggestedMax")||s,s&&pe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function ik(n,t){for(const e of n)rk(e,t)}function Pf(n,t,e,i){if(Rt(t[e])&&!sk(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function sk(n,t,e){return ge(n[t])||ge(n[e])}function rk(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ni(t,n,e);i&&!t[i]&&ok(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function ok(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ge(n[e+i]))return!0;return!1}function ak(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:it(t.min,Number.NEGATIVE_INFINITY),max:it(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Of(a,t,["value","endValue"],o):ni(n,a,r)===s&&Of(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Of(n,t,e,i){for(const s of e){const r=n[s];if(ge(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Oi extends Qt{inRange(t,e,i,s){const{x:r,y:o}=Jn({x:t,y:e},this.getCenterPoint(s),Ut(-this.options.rotation));return sf({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return ei(this,t)}draw(t){t.save(),Ur(t,this.getCenterPoint(),this.options.rotation),mf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Mf(t,e)}}Oi.id="boxAnnotation",Oi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Oi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Oi.descriptors={label:{_fallback:!0}};class Gr extends Qt{inRange(t,e,i,s){return rf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options;!e.display||!e.content||(fk(t,this),t.save(),Ur(t,this.getCenterPoint(),this.rotation),yf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=lk(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=uk(t,e,i);let a=Xr(t.ctx,e);const l=dk(a,o);uf(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,f=cf(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:Ti(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}Gr.id="doughnutLabelAnnotation",Gr.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},Gr.defaultRoutes={};function lk(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof sn&&ck(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function ck(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function uk({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:o}=n,{innerRadius:a,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,d=(s+o)/2+c,f={left:Math.max(u-a,i),right:Math.min(u+a,r),top:Math.max(d-a,s),bottom:Math.min(d+a,o)},g={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,y=a-p,x=g.y>d,M=x?s+p:o-p,v=hk(M,u,d,y);return{controllerMeta:{_centerX:u,_centerY:d,_radius:y,_counterclockwise:x,...v},point:g,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function dk({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function hk(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),o=t*-2,a=Math.pow(t,2)+s-r,l=Math.pow(o,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Ct};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:tr({x:t,y:e},{x:c,y:n}).angle,_endAngle:tr({x:t,y:e},{x:u,y:n}).angle}}function fk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=ln(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,o,a),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Os extends Qt{inRange(t,e,i,s){return rf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=!ge(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Ur(t,this.getCenterPoint(),this.rotation),NM(t,this),mf(t,this,e),yf(t,gk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(hf(e))i=wf(t,e);else{const{centerX:a,centerY:l}=nl(t,e);i={x:a,y:l}}const s=Xt(e.padding),r=Xr(t.ctx,e),o=cf(i,r,e,s);return{initProperties:Ti(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Os.id="labelAnnotation",Os.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Os.defaultRoutes={borderColor:"color"};function gk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Xt(s.padding);return{x:n+o.left+r,y:t+o.top+r,width:e-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}const rl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),ol=(n,t,e)=>rl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Ef=(n,t,e)=>rl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Es=n=>n*n,pk=(n,t,{x:e,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},Af=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,al=(n,t,e,i)=>({x:Af(n.x,t.x,e.x,i),y:Af(n.y,t.y,e.y,i)}),Rf=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),If=(n,t,e,i)=>-Math.atan2(Rf(n.x,t.x,e.x,i),Rf(n.y,t.y,e.y,i))+.5*pt;class As extends Qt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const o={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,f)||ll(this,o,s);return l.restore(),g}const c=Es(r);return _k(this,o,c,s)||ll(this,o,s)}return mk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return ei(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!ln(t,a))return t.restore();Ci(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return Tk(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Bf(this),g=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),cl(t,0,d,c),cl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=VM(t,e),{x:s,y:r,x2:o,y2:a}=i,l=yk(i,t.chartArea),c=l?bk({x:s,y:r},{x:o,y:a},t.chartArea):{x:s,y:r,x2:o,y2:a,width:Math.abs(o-s),height:Math.abs(a-r)};if(c.centerX=(o+s)/2,c.centerY=(a+r)/2,c.initProperties=Ti(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Sk(c,e,hi(d,f))}const u=xk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}As.id="lineAnnotation";const Lf={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};As.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Lf),fill:!1,length:12,start:Object.assign({},Lf),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Os.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},As.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},As.defaultRoutes={borderColor:"color"};function mk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=pk(t,e,n.getProps(["x","y","x2","y2"],r),i);return nf(o,s)||ll(n,{mouseX:t,mouseY:e},r,i)}function yk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&e<a||n>r&&e>r||t<s&&i<s||t>o&&i>o)}function Nf({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Ef(o,{x:n,y:t},e),n=o),n>s&&(t=Ef(s,{x:n,y:t},e),n=s),t<i&&(n=ol(i,{x:n,y:t},e),t=i),t>r&&(n=ol(r,{x:n,y:t},e),t=r),{x:n,y:t}}function bk(n,t,e){const{x:i,y:s}=Nf(n,t,e),{x:r,y:o}=Nf(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function _k(n,{mouseX:t,mouseY:e},i=ti,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Es(c)+Es(u),f=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return f<0?(g=r,p=o):f>1?(g=a,p=l):(g=r+f*c,p=o+f*u),Es(t-g)+Es(e-p)<=i}function ll(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function xk(n,t,e){const i=e.borderWidth,s=Xt(e.padding),r=Xr(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return vk(t,e,{width:o,height:a,padding:s},n.chartArea)}function wk(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>pt/2?r-pt:r<pt/-2?r+pt:r}function vk(n,t,e,i){const{width:s,height:r,padding:o}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?wk(n):Ut(t.rotation),f=Mk(s,r,d),g=kk(n,t,{labelSize:f,padding:o},i),p=n.cp?al(c,n.cp,u,g):rl(c,u,g),y={size:f.w,min:i.left,max:i.right,padding:o.left},x={size:f.h,min:i.top,max:i.bottom,padding:o.top},M=zf(p.x,y)+a,v=zf(p.y,x)+l;return{x:M-s/2,y:v-r/2,x2:M+s/2,y2:v+r/2,centerX:M,centerY:v,pointX:p.x,pointY:p.y,width:s,height:r,rotation:Js(d)}}function Mk(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function kk(n,t,e,i){let s;const r=Dk(n,i);return t.position==="start"?s=Ff({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Ff({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=Ja(1,t.position),s}function Ff(n,t,e,i){const{labelSize:s,padding:r}=t,o=n.w*i.dx,a=n.h*i.dy,l=o>0&&(s.w/2+r.left-i.x)/o,c=a>0&&(s.h/2+r.top-i.y)/a;return Vr(Math.max(l,c),0,.25)}function Dk(n,t){const{x:e,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(o,l),dx:a<=c?1:-1,dy:o<=l?1:-1}}function zf(n,t){const{size:e,min:i,max:s,padding:r}=t,o=e/2;return e>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function Bf(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Hf(n,e),endAdjust:Hf(n,i)}}function Hf(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(ol(0,r,{x:0,y:s}))}function cl(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:o,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ci(n,i),ln(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),o===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Sk(n,t,e){const{x:i,y:s,x2:r,y2:o,centerX:a,centerY:l}=n,c=Math.atan2(o-s,r-i),u=tl(t.controlPoint,0),d={x:a+Pn(e,u.x,!1),y:l+Pn(e,u.y,!1)};return Jn(d,{x:a,y:l},c)}function Wf(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),cl(n,0,-s,r),n.restore())}function Tk(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Bf(t),g={x:s,y:r},p={x:o,y:a},y=If(g,e,p,0),x=If(g,e,p,1)-pt,M=al(g,e,p,d/i),v=al(g,e,p,1-f/i),D=new Path2D;n.beginPath(),D.moveTo(M.x,M.y),D.quadraticCurveTo(e.x,e.y,v.x,v.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,Wf(n,M,{angle:y,adjust:d},c),Wf(n,v,{angle:x,adjust:f},u)}class Rs extends Qt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Ck({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,o);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),d=i==="y"?{start:l,end:u}:{start:a,end:c},f=Jn({x:t,y:e},this.getCenterPoint(s),Ut(-r));return f[i]>=d.start-o-ti&&f[i]<=d.end+o+ti}getCenterPoint(t){return ei(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),Ur(t,this.getCenterPoint(),o.rotation),Ci(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=ln(t,o);t.ellipse(s,r,i/2,e/2,pt/2,0,2*pt),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Mf(t,e)}}Rs.id="ellipseAnnotation",Rs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Oi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Rs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Rs.descriptors={label:{_fallback:!0}};function Ck(n,t,e,i){const{width:s,height:r,centerX:o,centerY:a}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=Ut(e||0),d=Math.cos(u),f=Math.sin(u),g=Math.pow(d*(n.x-o)+f*(n.y-a),2),p=Math.pow(f*(n.x-o)-d*(n.y-a),2);return g/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class Kr extends Qt{inRange(t,e,i,s){const{x:r,y:o,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?vM({x:t,y:e},this.getCenterPoint(s),c/2,u):nf(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ci(t,e);const s=ln(t,e);OM(t,this,this.centerX,this.centerY),s&&!$r(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=vf(t,e);return i.initProperties=Ti(t,i,e),i}}Kr.id="pointAnnotation",Kr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Kr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class Zr extends Qt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Ok(this.elements,t,e,s);const r=Jn({x:t,y:e},this.getCenterPoint(s),Ut(-this.options.rotation)),o=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...o),l=Math.max(...o);return r[i]>=a&&r[i]<=l}getCenterPoint(t){return ei(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ci(t,i);const s=ln(t,i);let r=!0;for(const o of e)r?(t.moveTo(o.x,o.y),r=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=vf(t,e),{sides:s,rotation:r}=e,o=[],a=2*pt/s;let l=r*Mo;for(let c=0;c<s;c++,l+=a){const u=Pk(i,e,l);u.initProperties=Ti(t,i,e),o.push(u)}return i.elements=o,i}}Zr.id="polygonAnnotation",Zr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Zr.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Pk({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const o=(i+s)/2,a=Math.sin(r),l=Math.cos(r),c={x:n+a*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+a*(e+o),bY:t-l*(e+o)}}}function Ok(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const o of n){const a=o.getProps(["bX","bY"],i);a.bY>e!=r.bY>e&&t<(r.bX-a.bX)*(e-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}const On={box:Oi,doughnutLabel:Gr,ellipse:Rs,label:Os,line:As,point:Kr,polygon:Zr};Object.keys(On).forEach(n=>{Et.describe(`elements.${On[n].id}`,{_fallback:"plugins.annotation.common"})});const Ek={update:Object.assign},Ak=sl.concat(qr),Yf=(n,t)=>ut(t)?hl(n,t):n,ul=n=>n==="color"||n==="font";function dl(n="line"){return On[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function Rk(n,t,e,i){const s=Lk(n,e.animations,i),r=t.annotations,o=zk(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=jf(o,a,l.type),u=l.setContext(Fk(n,c,o,l)),d=c.resolveElementProperties(n,u);d.skip=Ik(d),"elements"in d&&(Nk(c,d.elements,u,s),delete d.elements),ge(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Vf(u),s.update(c,d)}}function Ik(n){return isNaN(n.x)||isNaN(n.y)}function Lk(n,t,e){return e==="reset"||e==="none"||e==="resize"?Ek:new Fo(n,t)}function Nk(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const o=t[r],a=o.properties,l=jf(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=Vf(c),i.update(l,a)}}function jf(n,t,e,i){const s=On[dl(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Vf(n){const t=On[dl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,hl(n,t.defaults),hl(n,t.defaultRoutes));for(const i of Ak)e[i]=n[i];return e}function hl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];ul(i)&&Mt(r)?e[i]=r.map(o=>Yf(o,s)):e[i]=Yf(r,s)}return e}function Fk(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function zk(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var Bk="3.1.0";const En=new Map,$f=n=>n.type!=="doughnutLabel",Hk=sl.concat(qr);var Uf={id:"annotation",version:Bk,beforeRegister(){MM("chart.js","4.0",Oe.version)},afterRegister(){Oe.register(On)},afterUnregister(){Oe.unregister(On)},beforeInit(n){En.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=En.get(n),s=i.annotations=[];let r=e.annotations;ut(r)?Object.keys(r).forEach(o=>{const a=r[o];ut(a)&&(a.id=o,s.push(a))}):Mt(r)&&s.push(...r),ik(s.filter($f),n.scales)},afterDataLimits(n,t){const e=En.get(n);nk(n,t.scale,e.annotations.filter($f).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=En.get(n);ZM(n,i,e),Rk(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),ek(n,i,e)},beforeDatasetsDraw(n,t,e){Is(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Is(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Is(n,t.index,e.clip)},beforeDraw(n,t,e){Is(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Is(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=En.get(n);QM(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){En.delete(n)},getAnnotations(n){const t=En.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return Qa(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!Hk.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${On[dl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:ul,_fallback:!0},_indexable:ul}},additionalOptionScopes:[""]};function Is(n,t,e){const{ctx:i,chartArea:s}=n,r=En.get(n);e&&Zi(i,s);const o=Wk(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)Yk(i,s,r,a);e&&Qi(i)}function Wk(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function Yk(n,t,e,i){const s=i.element;i.main?(Cf(e,s,"beforeDraw"),s.draw(n,t),Cf(e,s,"afterDraw")):s.draw(n,t)}const jk={class:"zoom-actions-container"},Vk=["onClick"],$k=h.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=gt.useI18n(),r=o=>{o.action(e.newTimeRange),i("onAction")};return(o,a)=>(h.openBlock(),h.createElementBlock("div",jk,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(o.zoomActionItems,l=>(h.openBlock(),h.createElementBlock("div",{key:l.label,class:"zoom-action-item",onClick:c=>r(l)},h.toDisplayString(l.label),9,Vk))),128)),h.createElementVNode("div",{class:"zoom-action-item",onClick:a[0]||(a[0]=l=>o.$emit("onAction"))},h.toDisplayString(h.unref(s).t("zoom_action_items.cancel")),1)]))}}),Re=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},Uk=Re($k,[["__scopeId","data-v-96d04a22"]]),Xk={class:"zoom-timerange-container"},qk={class:"zoom-timerange-heading"},Gk={class:"title"},Kk={class:"zoom-timerange-details"},Zk=Re(h.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{}},setup(n){const t=n,{i18n:e}=gt.useI18n(),i=h.ref(Di(t.start.getTime())),s=h.ref(Di(t.end.getTime())),r=(o,a)=>{Ma(()=>{i.value=Di(o.getTime()),s.value=Di(a.getTime())},100)()};return h.watch(()=>[t.start,t.end],([o,a])=>{r(o,a)},{immediate:!0}),(o,a)=>(h.openBlock(),h.createElementBlock("div",Xk,[h.createElementVNode("div",qk,[h.createElementVNode("span",Gk,h.toDisplayString(h.unref(e).t("new_timerange_label")),1)]),h.createElementVNode("div",Kk,[h.createVNode(h.unref(ic.KBadge),null,{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(i.value),1)]),_:1}),a[0]||(a[0]=h.createTextVNode(" - ")),h.createVNode(h.unref(ic.KBadge),null,{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(s.value),1)]),_:1})])]))}}),[["__scopeId","data-v-1d43bf39"]]),Qk={key:2},Jk={class:"tooltip-title"},tD={class:"title"},eD={key:0,class:"subtitle"},nD={class:"context"},iD={class:"metric"},sD={class:"tooltip"},rD={key:0},oD={class:"display-value"},fl=Re(h.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0}},emits:["dimensions","top","left","onAction"],setup(n,{emit:t}){const e=t,i=n,s=h.ref(null),r=h.ref(!1),o=h.ref({x:0,y:0}),a=h.ref({x:0,y:0}),l=h.ref({left:i.absoluteLeft,top:i.absoluteTop}),c=h.computed(()=>i.state.tooltipContext),u=h.computed(()=>i.state.metricDisplay),d=h.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));h.watch(s,x=>{if(x){const{width:M,height:v}=x.getBoundingClientRect();e("dimensions",{width:M,height:v})}}),h.watch(()=>i.state.interactionMode,x=>{["interactive","zoom-interactive"].includes(x)&&(l.value.left=i.absoluteLeft,l.value.top=i.absoluteTop)});function f(x){if(s.value){r.value=!0,document.body.classList.add("no-select");const M=window.getComputedStyle(s.value),v=M.transform||M.webkitTransform||M.mozTransform,D=new DOMMatrix(v),S=D.m41,T=D.m42;o.value={x:S,y:T},a.value={x:x.clientX,y:x.clientY},window.addEventListener("mousemove",p),window.addEventListener("mouseup",y)}}let g=null;function p(x){x.preventDefault(),x.stopPropagation(),r.value&&(g!==null&&window.cancelAnimationFrame(g),g=window.requestAnimationFrame(()=>{const M=x.clientX-a.value.x,v=x.clientY-a.value.y;l.value.left=`${o.value.x+M}px`,l.value.top=`${o.value.y+v}px`}))}function y(){r.value=!1,document.body.classList.remove("no-select"),g!==null&&window.cancelAnimationFrame(g),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",y)}return(x,M)=>{var v,D;return x.state.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:h.normalizeClass(["tooltip-container",{locked:x.state.interactionMode==="interactive"}]),style:h.normalizeStyle({transform:d.value?`translate(${l.value.left}, ${l.value.top})`:`translate(${x.absoluteLeft}, ${x.absoluteTop})`,left:"0",top:"0",pointerEvents:d.value?"all":"none"}),onMousedown:f},[x.state.interactionMode==="selecting-chart-area"?(h.openBlock(),h.createBlock(Zk,{key:0,end:(v=x.zoomTimeRange)==null?void 0:v.end,start:(D=x.zoomTimeRange)==null?void 0:D.start},null,8,["end","start"])):x.state.interactionMode==="zoom-interactive"&&x.zoomTimeRange&&x.zoomActionItems?(h.openBlock(),h.createBlock(Uk,{key:1,"new-time-range":x.zoomTimeRange,"zoom-action-items":x.zoomActionItems,onOnAction:M[0]||(M[0]=S=>e("onAction"))},null,8,["new-time-range","zoom-action-items"])):(h.openBlock(),h.createElementBlock("div",Qk,[h.createElementVNode("div",Jk,[h.createElementVNode("div",tD,[h.createElementVNode("div",null,h.toDisplayString(x.tooltipTitle),1),d.value?(h.openBlock(),h.createBlock(h.unref(nc.DragIcon),{key:0,class:"drag-icon",color:h.unref(iM),size:h.unref(rM)},null,8,["color","size"])):h.createCommentVNode("",!0)]),c.value||u.value?(h.openBlock(),h.createElementBlock("div",eD,[h.createElementVNode("div",nD,h.toDisplayString(c.value),1),h.createElementVNode("div",iD,h.toDisplayString(u.value),1)])):h.createCommentVNode("",!0)]),h.createElementVNode("ul",sD,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(x.state.tooltipSeries,({backgroundColor:S,borderColor:T,label:A,value:O,isSegmentEmpty:_})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:A},[x.state.tooltipSeries.length?(h.openBlock(),h.createElementBlock("li",rD,[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:S,"border-color":T})},null,4),h.createElementVNode("span",{class:h.normalizeClass(["display-label",{empty:_}])},h.toDisplayString(A),3),h.createElementVNode("span",oD,h.toDisplayString(O),1)])):h.createCommentVNode("",!0)],64))),128))])]))],38)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-734753ff"]]),aD=["onClick"],lD={key:0,class:"sub-label"},cD={class:"tooltip-content"},gl=Re(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){h.useCssVars(S=>({c25a8106:l.value}));const t=n,{i18n:e}=gt.useI18n(),i=h.ref(),s=h.ref([]),r=h.inject("showLegendValues",!0),o=h.inject("legendPosition",h.ref(Ft.Right)),a=h.ref([]),l=h.ref(Jh),c=()=>{const S=i.value;if(!S||!s.value||S.children.length===0)return 0;const T=S.children[0].getBoundingClientRect().top;for(const A of s.value)if(A.getBoundingClientRect().top>T)return!0;return!1},u=h.computed(()=>t.items.length>2||o.value===Ft.Right),d=()=>{i.value&&o.value===Ft.Bottom&&(c()?l.value=lM:l.value=Jh)},f=()=>{if(i.value&&o.value===Ft.Bottom){let S=0;s.value.forEach(A=>{const O=Array.from(A.children).reduce((_,b)=>_+b.offsetWidth,0);O>S&&(S=O)});const T=parseInt(aM,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${S+T}px)`}d()},g=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let S=0;S<t.items.length;S++)if(t.items[S].text!==a.value[S].text)return a.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{g()&&f()},{immediate:!0,flush:"post"});const p=h.ref(0),y=h.ref(0),x=new ResizeObserver(Ma(S=>{const T=S[0],A=T.contentRect.width,O=T.contentRect.height;A!==p.value&&O===y.value&&f(),p.value=A,y.value=O},100));h.watch(()=>o.value,()=>{f()}),h.onMounted(()=>{a.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),h.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const M=(S=0,T)=>{if(t.chartInstance===null)return;const A=t.chartInstance instanceof Oe?t.chartInstance:t.chartInstance.chart;v(S,T)?A.hide(S,T):A.show(S,T),A.update()},v=(S=0,T)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const A=t.chartInstance instanceof Oe?t.chartInstance:t.chartInstance.chart,O=A.getDatasetMeta(S);return O.dataset||T===void 0?A.isDatasetVisible(S):!(O.data.length&&O.data[T].hidden)},D=S=>({[Ft.Right]:"vertical",[Ft.Bottom]:"horizontal",[Ft.Hidden]:"hidden"})[S];return(S,T)=>{const A=h.resolveComponent("KTooltip");return h.unref(o)!==h.unref(Ft).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:h.normalizeClass(["legend-container",D(h.unref(o))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:O,strokeStyle:_,text:b,datasetIndex:C,index:R,value:I,isSegmentEmpty:Y})=>(h.openBlock(),h.createElementBlock("li",{key:b,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:L=>M(C,R)},[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:O,"border-color":_})},null,4),h.createVNode(A,null,h.createSlots({default:h.withCtx(()=>[h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!v(C,R)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":u.value,empty:Y}])},h.toDisplayString(b),3),I&&h.unref(r)?(h.openBlock(),h.createElementBlock("div",lD,h.toDisplayString(I.formatted),1)):h.createCommentVNode("",!0)],2)]),_:2},[Y?{name:"content",fn:h.withCtx(()=>[h.createElementVNode("div",cD,h.toDisplayString(h.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,aD))),128))],2)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-afbe6cec"]]);for(var ee=[],pl=0;pl<256;++pl)ee.push((pl+256).toString(16).slice(1));function uD(n,t=0){return(ee[n[t+0]]+ee[n[t+1]]+ee[n[t+2]]+ee[n[t+3]]+"-"+ee[n[t+4]]+ee[n[t+5]]+"-"+ee[n[t+6]]+ee[n[t+7]]+"-"+ee[n[t+8]]+ee[n[t+9]]+"-"+ee[n[t+10]]+ee[n[t+11]]+ee[n[t+12]]+ee[n[t+13]]+ee[n[t+14]]+ee[n[t+15]]).toLowerCase()}var Qr,dD=new Uint8Array(16);function hD(){if(!Qr&&(Qr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qr(dD)}var fD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Xf={randomUUID:fD};function Jr(n,t,e){if(Xf.randomUUID&&!n)return Xf.randomUUID();n=n||{};var i=n.random||(n.rng||hD)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,uD(i)}const qf=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()};class Gf{constructor(){P(this,"id","highlightPlugin");P(this,"_clickedElements");P(this,"_previousHoverOption");P(this,"_clicked",!1);P(this,"_pause",!1);P(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&qf(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,qf(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const gD=["id"],pD=["id"],mD={class:"axis-tooltip-content"},Kf=6,yD="100%",bD="100%",_D=20,xD=20,Zf=6,wD=0,vD=10,MD=10,kD=1,DD=Re(h.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=gt.useI18n(),{translateUnit:i}=gt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),o=new Gf,a=h.ref(null),l=h.useTemplateRef("chartParentRef"),c=({chart:F},j)=>{var q;const K=F.data,J=(q=K.labels)==null?void 0:q.indexOf(j);return K.datasets.reduce((lt,rt,ht)=>{if(F.isDatasetVisible(ht)){const bt=rt.data[J];return isNaN(bt)?lt:lt+bt}else return lt},0)},u=(F,j,K,J)=>{const q=J==="horizontal";j===null&&(j=e.t("entityNoName"));const lt={type:"label",yValue:bt=>q?j:c(bt,j),xValue:bt=>q?c(bt,j):j},rt={...lt,position:q?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>q?0:-Math.abs(fw()),content:bt=>Ta(c(bt,j),K)},ht={...lt,content:bt=>rh(c(bt,j),sh(bt.chart,F)),position:q?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:bt=>q?ih(Ta(c(bt,j),K)):0,color:th};return{[`${j}-value`]:rt,[`${j}-percent`]:ht}},d=h.ref(null),f=h.ref(),g=h.ref(Jr()),p=Jr(),y=Jr(),x=h.ref([]),M=h.ref(h.inject("legendPosition",Ft.Right)),v=h.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),D=h.toRef(t,"metricUnit"),S=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),T=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:S.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:A,tooltipAbsoluteTop:O}=gt.useTooltipAbsolutePosition(l,T),_=h.ref(0),b=()=>{var F;return t.annotations&&((F=t.chartData.labels)==null?void 0:F.reduce((j,K)=>Object.assign(j,u(t.chartData,K,D.value,t.orientation)),{}))},C={id:g.value,afterUpdate(F){_.value+=1,x.value=Gd(F,t.legendValues,t.chartLegendSortFn)}},R={id:p,afterUpdate(F){F.options.plugins.annotation.annotations=t.annotations?b():{}}},L=[C,{id:"axisHover",afterEvent(F,j){var K;if(v.show=!1,j.event.type==="mousemove"){const J=j.event,q=F.options.indexAxis,lt=F.scales,rt=F.scales[q].getLabelForValue(Number(F.scales[q].getValueForPixel(J[q]))),bt=F.scales[q].getLabels().indexOf(rt),Jt=(K=t.chartData.isLabelEmpty)==null?void 0:K[bt];if((qt=>qt==="x"?J.y>lt.x.top:J.x<lt.y.right)(q)){T.interactionMode!=="interactive"&&(T.showTooltip=!1);const Ht=F.canvas.getContext("2d").measureText(rt).width,_t=Math.abs(Math.round(J.x-Ht*.5)),Pt=Math.round(J.x+Ht*.5),Wt=F.canvas.getBoundingClientRect(),mt=40;v.left=q==="x"?`${(_t>0?_t:Pt)-v.offset+Wt.left}px`:`${J.x-Ht*.5-v.offset+Wt.left}px`,v.top=`${J.y-mt+Wt.top}px`,rt.length>Ar?(v.show=!0,v.text=rt):Jt?(v.text=e.t("emptyEntityInfo"),v.show=!0):v.show=!1}else v.show=!1}}},{id:y,afterUpdate(F){F.options.layout.padding.right=S.value?Q.value:0}},o,...t.annotations?[R]:[]],W=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),U=h.ref(0),H=h.ref(0),st=new ResizeObserver(Ma(F=>{U.value=F[0].contentRect.width,H.value=F[0].contentRect.height},100)),$=h.computed(()=>{var j,K;const F=(K=(j=t.chartData)==null?void 0:j.labels)==null?void 0:K.length;return d.value&&F&&!S.value?`${Math.max(F*(_D+Zf),U.value)}px`:yD}),tt=h.computed(()=>{var j,K;const F=(K=(j=t.chartData)==null?void 0:j.labels)==null?void 0:K.length;return d.value&&F&&S.value?`${Math.max(F*(xD+Zf),H.value)}px`:bD});gt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&Oe.register(Uf),a.value&&(U.value=a.value.offsetWidth,H.value=a.value.offsetHeight,st.observe(a.value))}),h.onUnmounted(()=>{a.value&&st.unobserve(a.value)});const X=h.computed(()=>{const F=gt.useBarChartOptions({tooltipState:T,legendID:g.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:S.value?"y":"x",numLabels:W});return{...F.value,plugins:{...F.value.plugins,annotation:{annotations:b(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Kf}}}}),B=gt.useChartJSCommon("bar",d,h.toRef(t,"chartData"),L,X),Q=h.computed(()=>{_.value;const F=t.chartData.labels,j=t.chartData.datasets,K=F.map((lt,rt)=>j.reduce((ht,bt)=>isNaN(Number(bt.data[rt]))?ht:ht+Number(bt.data[rt]),0)),J=B.value?sh(B.value,t.chartData):gw(t.chartData);return K.map(lt=>ih(Ta(lt,D.value)+rh(lt,J))).reduce((lt,rt)=>Math.max(lt,rt),0)+Kf});h.onBeforeUnmount(()=>{Oe.unregister(Uf)});const wt={[Ft.Right]:"legend-row",[Ft.Bottom]:"column"},dt=h.computed(()=>{if(f.value&&B.value){const F=window.devicePixelRatio,j=B.value,K=j.scales.y.width*F+kD,J=(j.scales.y.height+j.scales.y.top+j.scales.x.height)*F,q=f.value.getContext("2d");return q.scale(F,F),q.canvas.width=K,q.canvas.height=J,q.canvas.style.width=`${K/F}px`,q.canvas.style.height=`${J/F}px`,{scale:F,width:K*F,height:J*F,targetCtx:q}}return null}),vt=F=>{const j=F.target;if(dt.value&&B.value&&!S.value){const K=dt.value.scale,J=dt.value.targetCtx,q=dt.value.width,lt=dt.value.height,rt=B.value,ht=rt.canvas;J.fillStyle="white",j.scrollLeft>=wD&&j.scrollLeft<=vD?(J.globalCompositeOperation="source-over",J.clearRect(0,0,q,lt),J.drawImage(ht,0,0,q,lt,0,0,q,lt),J.globalCompositeOperation="destination-over",J.fillRect(0,0,q,lt)):(J.globalCompositeOperation="source-over",J.fillRect(0,(rt.scales.y.height+rt.scales.y.top+MD)*K,q,rt.scales.x.height*K))}T.offsetY=j.scrollTop,T.offsetX=j.scrollLeft,v.offset=j.scrollLeft},et=({width:F,height:j})=>{T.width=F,T.height=j};h.watch(()=>t.orientation,()=>{var F;if(f.value&&dt.value){const j=dt.value.width,K=dt.value.height;((F=f.value)==null?void 0:F.getContext("2d")).clearRect(0,0,j,K)}T.showTooltip=!1,T.interactionMode="idle"}),h.watch(()=>t.annotations,F=>{B.value&&(F?B.value.options.plugins.annotation.annotations=b(t.chartData):delete B.value.options.plugins.annotation.annotations)});const At=()=>{T.showTooltip&&(T.interactionMode!=="idle"?T.interactionMode="idle":T.interactionMode="interactive")};return(F,j)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:l,class:h.normalizeClass(["chart-parent",wt[M.value]])},[h.createElementVNode("canvas",{id:h.unref(s),ref_key:"axis",ref:f,class:"axis"},null,8,gD),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:a,class:"chart-container","on:scroll":vt,onClick:j[0]||(j[0]=K=>At())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:$.value,height:tt.value})},[h.createElementVNode("canvas",{id:h.unref(r),ref_key:"canvas",ref:d,class:"chart-canvas"},null,8,pD)],4)],544),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[v.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:v.top,left:v.left}),width:"auto"},[h.createElementVNode("div",mD,h.toDisplayString(v.text),1)],4)):h.createCommentVNode("",!0),h.createVNode(fl,{"absolute-left":h.unref(A),"absolute-top":h.unref(O),state:T,"tooltip-title":F.tooltipTitle,onDimensions:et},null,8,["absolute-left","absolute-top","state","tooltip-title"])])),h.createVNode(gl,{id:g.value,"chart-instance":h.unref(B),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-13a1a6c4"]]);/*!
|
|
24
24
|
* chartjs-adapter-date-fns v3.0.0
|
|
25
25
|
* https://www.chartjs.org
|
|
26
26
|
* (c) 2022 chartjs-adapter-date-fns Contributors
|
|
27
27
|
* Released under the MIT license
|
|
28
|
-
*/const SD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};au._date.override({_id:"date-fns",formats:function(){return SD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=ot(n):e==="string"&&(typeof t=="string"?n=Px(n,t,new Date,this.options):n=$d(n,this.options)),fa(n)?n.getTime():null},format:function(n,t){return Bd(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return da(n,t);case"second":return k0(n,t);case"minute":return v0(n,t);case"hour":return _0(n,t);case"day":return Tr(n,t);case"week":return D0(n,t);case"month":return ua(n,t);case"quarter":return M0(n,t);case"year":return S0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return ga(n,t);case"second":return I0(n,t);case"minute":return E0(n,t);case"hour":return O0(n,t);case"day":return Md(n,t);case"week":return L0(n,t);case"month":return Td(n,t);case"quarter":return R0(n,t);case"year":return N0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Rx(n);case"minute":return Ax(n);case"hour":return Ex(n);case"day":return ha(n);case"week":return Ue(n);case"isoWeek":return Ue(n,{weekStartsOn:+e});case"month":return z0(n);case"quarter":return F0(n);case"year":return Cd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return V0(n);case"minute":return Y0(n);case"hour":return H0(n);case"day":return Dd(n);case"week":return W0(n);case"month":return Sd(n);case"quarter":return j0(n);case"year":return B0(n);default:return n}}});const Qf={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},TD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Qf,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},CD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ei(n){return h.isProxy(n)?h.toRaw(n):n}function PD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function OD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Jf(n,t){n.labels=t}function tg(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function ED(n,t){const e={labels:[],datasets:[]};return Jf(e,n.labels),tg(e,n.datasets,t),e}const AD=h.defineComponent({props:TD,setup(n,t){let{expose:e,slots:i}=t;const s=h.ref(null),r=h.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=ED(u,g),y=PD(p,u);r.value=new Oe(s.value,{type:c,data:y,options:{...d},plugins:f})},a=()=>{const c=h.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return h.onMounted(o),h.onUnmounted(a),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const y=h.toRaw(r.value);if(!y)return;let x=!1;if(d){const M=Ei(d),v=Ei(g);M&&M!==v&&(OD(y,M),x=!0)}if(f){const M=Ei(f.labels),v=Ei(p.labels),D=Ei(f.datasets),S=Ei(p.datasets);M!==v&&(Jf(y.config.data,M),x=!0),D&&D!==S&&(tg(y.config.data,D,n.datasetIdKey),x=!0)}x&&h.nextTick(()=>{l(y)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[h.h("p",{},[i.default?i.default():""])])}});function pl(n,t){return Oe.register(t),h.defineComponent({props:Qf,setup(e,i){let{expose:s}=i;const r=h.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>h.h(AD,CD({ref:o},{type:n,...e}))}})}const RD=pl("bar",es),eg=pl("doughnut",sn),ID=pl("line",ns),LD={class:"chart-container"},ND=h.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Ft.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>on},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=gt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=h.ref([]),o=h.useTemplateRef("chartParentRef"),a=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=gt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(v){r.value=v.options.plugins.legend.labels.generateLabels(v).map(D=>({...D,value:t.legendValues&&t.legendValues[D.text],hidden:!1}))}},d=h.computed(()=>[u]),f=h.computed(()=>[t.chartData.datasets.reduce((D,S)=>(D.labels.push(S.label),D.backgroundColor.push(S.backgroundColor),D.borderColor.push(Qd(S.backgroundColor,50)),D.data.push(S.data.reduce((T,R)=>T+R,0)),D),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),g=h.computed(()=>({...t.chartData,datasets:f.value}));gt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:p}=gt.useDonutChartOptions({tooltipState:a,legendID:i}),y=h.ref(),x=v=>({[Ft.Right]:"legend-row",[Ft.Bottom]:"column",[Ft.Hidden]:"hidden"})[v],M=({width:v,height:D})=>{a.width=v,a.height=D};return(v,D)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:o,class:h.normalizeClass(["chart-parent",x(v.legendPosition)]),"data-testid":"donut-chart-parent"},[h.createElementVNode("div",LD,[h.createVNode(h.unref(eg),{ref_key:"chartInstance",ref:y,"chart-id":h.unref(s),data:g.value,options:h.unref(p),plugins:d.value},null,8,["chart-id","data","options","plugins"]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(hl,{"absolute-left":h.unref(l),"absolute-top":h.unref(c),state:a,"tooltip-title":v.tooltipTitle,unit:v.metricUnit,onDimensions:M},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),h.createVNode(fl,{id:h.unref(i),"chart-instance":y.value,items:r.value,position:v.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),FD=Re(ND,[["__scopeId","data-v-b61e8182"]]),ng=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()};class zD{constructor(){O(this,"id","verticalLinePlugin");O(this,"_clickedSegment");O(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;ng(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;ng(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const BD=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(200, 200, 200, 0.5)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},ig=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class HD{constructor(){O(this,"id","dragSelectPlugin");O(this,"_isDragging",!1);O(this,"_startX",0);O(this,"_endX",0);O(this,"_dragTimeout");O(this,"_clearSelectionArea",!1);O(this,"_chart",null);O(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas,i=e.getBoundingClientRect();let s=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{this._isDragging=!0,this._clearSelectionArea=!1,s=!0,this._startX=l.clientX-i.left},150)},o=l=>{s&&this._isDragging&&(this._endX=l.clientX-i.left,ig("dragSelectMove",t,this),t.update())},a=l=>{clearTimeout(this._dragTimeout),s&&this._isDragging&&(this._endX=l.clientX-i.left,ig("dragSelect",t,this),t.update(),s=!1,this._isDragging=!1)};e.addEventListener("mousedown",r),e.addEventListener("mousemove",o),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:o,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&BD(t,this._startX,this._endX)}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const WD=["hidden","single","full"];var ii=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ii||{});const YD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],jD=["gauge","top_n","single_value"],VD=Re(h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},zoom:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,s=new zD,r=new Gf,o=new HD,{translateUnit:a}=gt.useTranslatedUnits(),l=h.ref(),c=crypto.randomUUID(),u=crypto.randomUUID(),d=h.ref([]),f=h.ref(),g=h.ref(h.inject("legendPosition",Ft.Right)),p=h.ref(null),y=h.ref(void 0),x=h.ref(!1),M=h.inject(Jh),v=M==null?void 0:M.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),D=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:a,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:u,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:S,tooltipAbsoluteTop:T}=gt.useTooltipAbsolutePosition(p,D),R={id:c,afterUpdate(U){d.value=qd(U,e.legendValues,e.chartLegendSortFn)}},E=h.computed(()=>[R,r,...e.zoom?[o]:[],...e.type==="timeseries_line"?[s]:[]]),_=h.computed(()=>`line-${E.value.map(U=>U.id).join("-")}`),b=h.computed(()=>`bar-${E.value.map(U=>U.id).join("-")}`),P=h.computed(()=>e.chartData&&tw(e.chartData)),I=h.computed(()=>v?!1:x.value),{options:C}=gt.useLineChartOptions({tooltipState:D,timeRangeMs:h.toRef(e,"timeRangeMs"),granularity:h.toRef(e,"granularity"),legendID:c,stacked:h.toRef(e,"stacked"),metricAxesTitle:h.toRef(e,"metricAxesTitle"),dimensionAxesTitle:h.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:P});gt.useReportChartDataForSynthetics(h.toRef(e,"chartData"),h.toRef(e,"syntheticsDataKey"));const N=U=>({[Ft.Right]:"legend-row",[Ft.Bottom]:"column",[Ft.Hidden]:"hidden"})[U],j=({width:U,height:B})=>{D.width=U,D.height=B},$=(U=!0)=>{D.interactionMode="idle",o.clearSelectionArea(),r.isPaused&&r.resume(U),s.isPaused&&s.resume()},X=()=>{D.interactionMode="interactive"},H=()=>{var U,B;!l.value||!((B=(U=l.value.chart.tooltip)==null?void 0:U.dataPoints)!=null&&B.length)||(D.interactionMode==="interactive"?s.clickedSegment=l.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},ut=()=>{if(x.value){x.value=!1;return}D.interactionMode!=="idle"?$():X(),H()};h.watch(()=>e.type,()=>{D.interactionMode="idle",D.showTooltip=!1,s.destroyClickedSegment()});const V=U=>{U.preventDefault(),U.stopPropagation();const{xStart:B,xEnd:Q}=U.detail;B&&Q&&(y.value={start:new Date(B),end:new Date(Q),type:"absolute"},v?D.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(B),end:new Date(Q),type:"absolute"}),$()))},tt=U=>{v&&(D.interactionMode="selecting-chart-area"),x.value=!0,s.pause(),r.pause();const{xStart:B,xEnd:Q}=U.detail;B&&Q&&(y.value={start:new Date(B),end:new Date(Q),type:"absolute"})};return h.watch(()=>{var U;return(U=l.value)==null?void 0:U.chart},()=>{var U;(U=l.value)!=null&&U.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",V),l.value.chart.canvas.removeEventListener("dragSelectMove",tt),l.value.chart.canvas.addEventListener("dragSelect",V),l.value.chart.canvas.addEventListener("dragSelectMove",tt))}),h.onUnmounted(()=>{var U;(U=l.value)!=null&&U.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",V),l.value.chart.canvas.removeEventListener("dragSelectMove",tt))}),(U,B)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:p,class:h.normalizeClass(["chart-parent",N(g.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:B[0]||(B[0]=Q=>ut())},[U.type==="timeseries_line"?(h.openBlock(),h.createBlock(h.unref(ID),{key:_.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:U.chartData,"data-testid":"time-series-line-chart",options:h.unref(C),plugins:E.value},null,8,["chart-id","data","options","plugins"])):U.type==="timeseries_bar"?(h.openBlock(),h.createBlock(h.unref(RD),{key:b.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:U.chartData,"data-testid":"time-series-bar-chart",options:h.unref(C),plugins:E.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[I.value?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(hl,{key:0,ref_key:"tooltipElement",ref:f,"absolute-left":h.unref(S),"absolute-top":h.unref(T),"data-testid":"tooltip",state:D,"tooltip-title":U.tooltipTitle,"zoom-action-items":U.zoomActionItems,"zoom-time-range":y.value,onDimensions:j,onLeft:B[1]||(B[1]=Q=>D.left=Q),onOnAction:B[2]||(B[2]=()=>$(!1)),onTop:B[3]||(B[3]=Q=>D.top=Q)},null,8,["absolute-left","absolute-top","state","tooltip-title","zoom-action-items","zoom-time-range"]))])),h.createVNode(fl,{id:h.unref(c),"chart-instance":l.value,"data-testid":"legend",items:d.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-20ceb50a"]]),$D={class:"analytics-chart-shell"},UD={key:0,class:"chart-header"},XD={class:"tooltip-content"},qD={key:2,class:"analytics-chart-parent"},GD=h.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Ft.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1}},emits:["zoom-time-range","view-requests"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=gt.useI18n(),r=h.computed(()=>p.value?gt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ir,threshold:i.chartOptions.threshold||void 0},h.toRef(i,"chartData")).value:gt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ir},h.toRef(i,"chartData")).value),o=h.computed(()=>{var C;return(C=i.chartData)!=null&&C.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),a=h.computed(()=>{var C;return(C=i.chartData.meta)!=null&&C.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),l=h.computed(()=>i.showLegendValues&&i.legendPosition!==Ft.Bottom),{legendValues:c}=gt.useChartLegendValues(r,i.chartOptions.type,a),u=h.computed(()=>{var C,N,j;return((j=(N=(C=i.chartData)==null?void 0:C.meta)==null?void 0:N.limit)==null?void 0:j.toString())||null}),d=h.computed(()=>{var C,N;return((N=(C=i.chartData)==null?void 0:C.meta)==null?void 0:N.truncated)||!1}),f=s.t("limitedResultsShown",{maxReturned:u.value}),g=h.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),p=h.computed(()=>["timeseries_bar","timeseries_line"].some(C=>C===i.chartOptions.type)),y=h.computed(()=>i.chartOptions.type==="donut"),x=h.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),M=h.computed(()=>{var j,$;if(!((j=i.chartData)!=null&&j.meta.metric_names)||!(($=i.chartData)!=null&&$.meta.metric_units))return;const C=i.chartData.meta.metric_names[0],N=i.chartData.meta.metric_units[C];if(i.chartData.meta.metric_names.length>1){if(C.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${N}`,{plural:"s"})});if(C.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${N}`,{plural:"s"})})}return s.t(`chartLabels.${C}`)}),v=h.computed(()=>{var j,$,X;if(!((j=i.chartData)!=null&&j.meta.metric_names)||!(($=i.chartData)!=null&&$.meta.metric_units))return;const C=i.chartData.meta.metric_names[0],N=i.chartData.meta.metric_units[C];if(i.chartData.meta.metric_names.length>1){if(C.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${N}`,{plural:"s"})});if(C.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${N}`,{plural:"s"})})}return((X=i.chartOptions)==null?void 0:X.metricAxesTitle)||s.te(`metricAxisTitles.${C}`)&&s.te(`chartUnits.${N}`)&&s.t(`metricAxisTitles.${C}`,{unit:s.t(`chartUnits.${N}`,{plural:"s"})})||void 0}),D=h.computed(()=>{const C=p.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];return i.chartOptions.dimensionAxesTitle||s.te(`chartLabels.${C}`)&&s.t(`chartLabels.${C}`)||void 0}),S=h.computed(()=>{const C=Ka(Number(i.chartData.meta.granularity_ms));return s.t(`granularityAxisTitles.${C}`)}),T=h.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),R=h.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),E=h.computed(()=>p.value?ew(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=h.computed(()=>i.chartData.meta.granularity_ms?Ka(i.chartData.meta.granularity_ms)||"hourly":Ka(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),b=h.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(C,N)=>C.text===s.t("chartLabels.____OTHER____")?1:N.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(C.text,10))&&!isNaN(parseInt(N.text,10))?C.text<N.text?-1:1:C.value&&N.value?N.value.raw-C.value.raw:0),P=h.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(C,N)=>C.label===s.t("chartLabels.____OTHER____")?1:N.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(C.label,10))&&!isNaN(parseInt(N.label,10))?C.label<N.label?-1:1:C.value&&N.value?N.rawValue-C.rawValue:0),I=h.computed(()=>[{label:s.t("zoom_action_items.zoom"),action:C=>e("zoom-time-range",C)},{label:s.t("zoom_action_items.view_requests"),action:C=>e("view-requests",C)}]);return h.provide("showLegendValues",l),h.provide("legendPosition",h.toRef(i,"legendPosition")),(C,N)=>{const j=h.resolveComponent("KTooltip"),$=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",$D,[E.value&&d.value&&u.value?(h.openBlock(),h.createElementBlock("div",UD,[h.createVNode(j,{class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createElementVNode("div",XD,h.toDisplayString(h.unref(f)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(ec.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(sM)})`,size:h.unref(oM)},null,8,["color","size"])]),_:1})])):h.createCommentVNode("",!0),E.value?(h.openBlock(),h.createElementBlock("div",qD,[p.value?(h.openBlock(),h.createBlock(VD,{key:0,"chart-data":r.value,"chart-legend-sort-fn":b.value,"chart-tooltip-sort-fn":P.value,"dimension-axes-title":S.value,fill:C.chartOptions.stacked,granularity:_.value,"legend-values":h.unref(c),"metric-axes-title":v.value,"metric-unit":a.value,stacked:C.chartOptions.stacked,"synthetics-data-key":C.syntheticsDataKey,"time-range-ms":o.value,"tooltip-metric-display":M.value,"tooltip-title":C.tooltipTitle,type:C.chartOptions.type,zoom:C.timeseriesZoom,"zoom-action-items":I.value,onZoomTimeRange:N[0]||(N[0]=X=>e("zoom-time-range",X))},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom","zoom-action-items"])):g.value?(h.openBlock(),h.createBlock(DD,{key:1,annotations:C.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":b.value,"chart-tooltip-sort-fn":P.value,"data-testid":"bar-chart-container","dimension-axes-title":D.value,"legend-values":h.unref(c),"metric-axes-title":v.value,"metric-unit":a.value,orientation:x.value,stacked:C.chartOptions.stacked,"synthetics-data-key":C.syntheticsDataKey,"tooltip-metric-display":M.value,"tooltip-title":C.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):y.value?(h.openBlock(),h.createBlock(FD,{key:2,"chart-data":r.value,"dataset-colors":C.chartOptions.chartDatasetColors||h.unref(Ir),"legend-position":C.legendPosition,"legend-values":h.unref(c),"metric-unit":a.value,"synthetics-data-key":C.syntheticsDataKey,"tooltip-dimension-display":D.value,"tooltip-metric-display":M.value,"tooltip-title":C.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock($,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(T.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.value),1)]),_:1}))])}}}),KD=Re(GD,[["__scopeId","data-v-c2262f02"]]),ZD={class:"chart-parent","data-testid":"gauge-chart-parent"},QD={class:"chart-totals-flex"},JD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},tS=Re(h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:on},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=gt.useI18n(),i=h.ref(Jr()),s=h.computed(()=>[t.chartData.datasets.reduce((p,y)=>(p.labels.push(y.label),p.borderColor.push(y.backgroundColor),p.backgroundColor.push(y.backgroundColor),p.data.push(y.data.reduce((x,M)=>x+M,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=h.computed(()=>({...t.chartData,datasets:s.value}));gt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=h.ref(),l=h.computed(()=>{var g;return Ms((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return Ms(((g=s==null?void 0:s.value[0])==null?void 0:g.data[0])+((p=s==null?void 0:s.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>["full","single"].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay==="full");return(g,p)=>(h.openBlock(),h.createElementBlock("div",ZD,[h.createElementVNode("div",QD,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",JD,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(eg),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-4f4e5b76"]]),eS={class:"chart-parent","data-testid":"single-value-parent"},nS={key:1,class:"single-value-wrapper"},iS={class:"single-value","data-testid":"single-value-chart"},sS={key:0,class:"single-value-unit"},rS=Re(h.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:tf}},setup(n){const{i18n:{t}}=gt.useI18n(),e=n,i=h.computed(()=>e.data.data[0]),s=h.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=h.computed(()=>{var u,d;const c=s.value?(d=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:d[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=h.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=h.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=h.computed(()=>{var d;const c=a.value;if(c===null)return"";if((d=s.value)!=null&&d.includes("_size_"))return Nr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:tf;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return h.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",eS,[a.value===null?(h.openBlock(),h.createBlock(d,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:h.unref(t)("singleValue.valueError")},null,8,["title"])):(h.openBlock(),h.createElementBlock("div",nS,[h.createElementVNode("span",iS,h.toDisplayString(l.value),1),o.value?(h.openBlock(),h.createElementBlock("span",sS," "+h.toDisplayString(r.value),1)):h.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),oS={class:"simple-chart-shell"},aS={key:1,class:"analytics-chart-parent"},lS=Re(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=gt.useI18n(),i=h.computed(()=>{var u;const c=gt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},h.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=h.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=h.computed(()=>t.chartOptions.type==="gauge"),o=h.computed(()=>t.chartOptions.type==="single_value"),a=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=h.computed(()=>{var u,d;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(d=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:d[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",oS,[l.value?(h.openBlock(),h.createElementBlock("div",aS,[r.value?(h.openBlock(),h.createBlock(tS,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0),o.value?(h.openBlock(),h.createBlock(rS,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(d,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),cS={class:"top-n-card-title","data-testid":"top-n-card-title"},uS={class:"top-n-card-description","data-testid":"top-n-card-description"},dS={key:3,class:"top-n-table","data-testid":"top-n-table"},hS={class:"table-headings"},fS={class:"table-row"},gS={class:"column-1"},pS={class:"column-2"},mS={class:"table-body","data-testid":"top-n-data"},yS=["data-testid"],bS={class:"column-1"},_S={class:"column-2"},xS=Re(h.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=gt.useI18n(),i=h.computed(()=>t.data.data),s=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=h.computed(()=>{var p,y;return(p=t.data.meta)!=null&&p.display&&((y=Object.keys(t.data.meta.display))==null?void 0:y[0])||""}),o=h.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=h.computed(()=>{var p,y;return(y=(p=t.data.meta)==null?void 0:p.metric_names)!=null&&y.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=h.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=p=>{const y=p.event;return String(y[r.value])},d=p=>{const y=u(p),x=o.value&&o.value[y];return x?x.name:"-"},f=p=>{const y=u(p),x=o.value&&o.value[y];return x?!!x.deleted:!1},g=p=>{if(!a.value)return"–";const x=p.event[a.value];return x?Ms(x,{capital:!0,round:!0}):"–"};return(p,y)=>{const x=h.resolveComponent("KEmptyState"),M=h.resolveComponent("KSkeleton"),v=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(v,{class:"kong-ui-public-top-n-table","title-tag":p.titleTag},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):p.isLoading?(h.openBlock(),h.createBlock(M,{key:1,"table-columns":2,type:"table"})):s.value?(h.openBlock(),h.createElementBlock("div",dS,[h.createElementVNode("div",hS,[h.createElementVNode("div",fS,[h.createElementVNode("div",gS,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",pS,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",mS,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(D,S)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${S}`,class:"table-row","data-testid":`row-${u(D)}`},[h.createElementVNode("div",bS,[h.renderSlot(p.$slots,"name",{record:{id:u(D),name:d(D),deleted:f(D),dimension:r.value}},()=>[h.createTextVNode(h.toDisplayString(d(D)),1)],!0)]),h.createElementVNode("div",_S," "+h.toDisplayString(g(D)),1)],8,yS))),128))])])):(h.openBlock(),h.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[p.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",cS,h.toDisplayString(p.title),1)]),key:"0"}:void 0,p.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",uS,h.toDisplayString(p.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var to={exports:{}};to.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",d="[object Date]",f="[object Error]",g="[object Function]",p="[object GeneratorFunction]",y="[object Map]",x="[object Number]",M="[object Object]",v="[object Promise]",D="[object RegExp]",S="[object Set]",T="[object String]",R="[object Symbol]",E="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",P="[object Float32Array]",I="[object Float64Array]",C="[object Int8Array]",N="[object Int16Array]",j="[object Int32Array]",$="[object Uint8Array]",X="[object Uint8ClampedArray]",H="[object Uint16Array]",ut="[object Uint32Array]",V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,U=/^\./,B=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,wt=/\\(\\)?/g,dt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,et={};et[P]=et[I]=et[C]=et[N]=et[j]=et[$]=et[X]=et[H]=et[ut]=!0,et[l]=et[c]=et[_]=et[u]=et[b]=et[d]=et[f]=et[g]=et[y]=et[x]=et[M]=et[D]=et[S]=et[T]=et[E]=!1;var At=typeof be=="object"&&be&&be.Object===Object&&be,F=typeof self=="object"&&self&&self.Object===Object&&self,W=At||F||Function("return this")(),K=t&&!t.nodeType&&t,J=K&&!0&&n&&!n.nodeType&&n,q=J&&J.exports===K,at=q&&At.process,st=function(){try{return at&&at.binding("util")}catch{}}(),ht=st&&st.isTypedArray;function bt(m,k){for(var L=-1,Y=m?m.length:0;++L<Y;)if(k(m[L],L,m))return!0;return!1}function Jt(m){return function(k){return k==null?void 0:k[m]}}function ue(m,k){for(var L=-1,Y=Array(m);++L<m;)Y[L]=k(L);return Y}function qt(m){return function(k){return m(k)}}function Ht(m,k){return m==null?void 0:m[k]}function _t(m){var k=!1;if(m!=null&&typeof m.toString!="function")try{k=!!(m+"")}catch{}return k}function Pt(m){var k=-1,L=Array(m.size);return m.forEach(function(Y,lt){L[++k]=[lt,Y]}),L}function Wt(m,k){return function(L){return m(k(L))}}function mt(m){var k=-1,L=Array(m.size);return m.forEach(function(Y){L[++k]=Y}),L}var Ge=Array.prototype,_e=Function.prototype,de=Object.prototype,he=W["__core-js_shared__"],De=function(){var m=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""}(),Se=_e.toString,Lt=de.hasOwnProperty,Te=de.toString,ne=RegExp("^"+Se.call(Lt).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),si=W.Symbol,Rn=W.Uint8Array,Ls=de.propertyIsEnumerable,ri=Ge.splice,Ns=Wt(Object.keys,Object),oi=fn(W,"DataView"),cn=fn(W,"Map"),un=fn(W,"Promise"),Fs=fn(W,"Set"),zs=fn(W,"WeakMap"),ai=fn(Object,"create"),bl=pn(oi),_l=pn(cn),eo=pn(un),no=pn(Fs),dn=pn(zs),Ai=si?si.prototype:void 0,Bs=Ai?Ai.valueOf:void 0,io=Ai?Ai.toString:void 0;function hn(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var Y=m[k];this.set(Y[0],Y[1])}}function xl(){this.__data__=ai?ai(null):{}}function Be(m){return this.has(m)&&delete this.__data__[m]}function wl(m){var k=this.__data__;if(ai){var L=k[m];return L===s?void 0:L}return Lt.call(k,m)?k[m]:void 0}function vl(m){var k=this.__data__;return ai?k[m]!==void 0:Lt.call(k,m)}function Ml(m,k){var L=this.__data__;return L[m]=ai&&k===void 0?s:k,this}hn.prototype.clear=xl,hn.prototype.delete=Be,hn.prototype.get=wl,hn.prototype.has=vl,hn.prototype.set=Ml;function He(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var Y=m[k];this.set(Y[0],Y[1])}}function kl(){this.__data__=[]}function In(m){var k=this.__data__,L=Li(k,m);if(L<0)return!1;var Y=k.length-1;return L==Y?k.pop():ri.call(k,L,1),!0}function Dl(m){var k=this.__data__,L=Li(k,m);return L<0?void 0:k[L][1]}function Sl(m){return Li(this.__data__,m)>-1}function Tl(m,k){var L=this.__data__,Y=Li(L,m);return Y<0?L.push([m,k]):L[Y][1]=k,this}He.prototype.clear=kl,He.prototype.delete=In,He.prototype.get=Dl,He.prototype.has=Sl,He.prototype.set=Tl;function We(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var Y=m[k];this.set(Y[0],Y[1])}}function Cl(){this.__data__={hash:new hn,map:new(cn||He),string:new hn}}function Ln(m){return zi(this,m).delete(m)}function Pl(m){return zi(this,m).get(m)}function Ol(m){return zi(this,m).has(m)}function El(m,k){return zi(this,m).set(m,k),this}We.prototype.clear=Cl,We.prototype.delete=Ln,We.prototype.get=Pl,We.prototype.has=Ol,We.prototype.set=El;function Ri(m){var k=-1,L=m?m.length:0;for(this.__data__=new We;++k<L;)this.add(m[k])}function Al(m){return this.__data__.set(m,s),this}function Rl(m){return this.__data__.has(m)}Ri.prototype.add=Ri.prototype.push=Al,Ri.prototype.has=Rl;function Ie(m){this.__data__=new He(m)}function Ii(){this.__data__=new He}function Il(m){return this.__data__.delete(m)}function Hs(m){return this.__data__.get(m)}function Ll(m){return this.__data__.has(m)}function Nl(m,k){var L=this.__data__;if(L instanceof He){var Y=L.__data__;if(!cn||Y.length<e-1)return Y.push([m,k]),this;L=this.__data__=new We(Y)}return L.set(m,k),this}Ie.prototype.clear=Ii,Ie.prototype.delete=Il,Ie.prototype.get=Hs,Ie.prototype.has=Ll,Ie.prototype.set=Nl;function Fl(m,k){var L=w(m)||uo(m)?ue(m.length,String):[],Y=L.length,lt=!!Y;for(var Z in m)Lt.call(m,Z)&&!(lt&&(Z=="length"||Ys(Z,Y)))&&L.push(Z);return L}function Li(m,k){for(var L=m.length;L--;)if(co(m[L][0],k))return L;return-1}var zl=ql();function Bl(m,k){return m&&zl(m,k,ci)}function Ni(m,k){k=Bi(k,m)?[k]:Ke(k);for(var L=0,Y=k.length;m!=null&&L<Y;)m=m[gn(k[L++])];return L&&L==Y?m:void 0}function Hl(m){return Te.call(m)}function Wl(m,k){return m!=null&&k in Object(m)}function Ws(m,k,L,Y,lt){return m===k?!0:m==null||k==null||!Gt(m)&&!xe(k)?m!==m&&k!==k:Yl(m,k,Ws,L,Y,lt)}function Yl(m,k,L,Y,lt,Z){var yt=w(m),Kt=w(k),Yt=c,oe=c;yt||(Yt=re(m),Yt=Yt==l?M:Yt),Kt||(oe=re(k),oe=oe==l?M:oe);var we=Yt==M&&!_t(m),ve=oe==M&&!_t(k),fe=Yt==oe;if(fe&&!we)return Z||(Z=new Ie),yt||ho(m)?oo(m,k,L,Y,lt,Z):Gl(m,k,Yt,L,Y,lt,Z);if(!(lt&o)){var Le=we&&Lt.call(m,"__wrapped__"),Ne=ve&&Lt.call(k,"__wrapped__");if(Le||Ne){var zn=Le?m.value():m,mn=Ne?k.value():k;return Z||(Z=new Ie),L(zn,mn,Y,lt,Z)}}return fe?(Z||(Z=new Ie),Kl(m,k,L,Y,lt,Z)):!1}function jl(m,k,L,Y){var lt=L.length,Z=lt;if(m==null)return!Z;for(m=Object(m);lt--;){var yt=L[lt];if(yt[2]?yt[1]!==m[yt[0]]:!(yt[0]in m))return!1}for(;++lt<Z;){yt=L[lt];var Kt=yt[0],Yt=m[Kt],oe=yt[1];if(yt[2]){if(Yt===void 0&&!(Kt in m))return!1}else{var we=new Ie,ve;if(!(ve===void 0?Ws(oe,Yt,Y,r|o,we):ve))return!1}}return!0}function Vl(m){if(!Gt(m)||ao(m))return!1;var k=G(m)||_t(m)?ne:dt;return k.test(pn(m))}function $l(m){return xe(m)&&$t(m.length)&&!!et[Te.call(m)]}function so(m){return typeof m=="function"?m:m==null?Hi:typeof m=="object"?w(m)?Fi(m[0],m[1]):Xl(m):lT(m)}function Ul(m){if(!Jl(m))return Ns(m);var k=[];for(var L in Object(m))Lt.call(m,L)&&L!="constructor"&&k.push(L);return k}function Xl(m){var k=Zl(m);return k.length==1&&k[0][2]?Vs(k[0][0],k[0][1]):function(L){return L===m||jl(L,m,k)}}function Fi(m,k){return Bi(m)&&lo(k)?Vs(gn(m),k):function(L){var Y=fo(L,m);return Y===void 0&&Y===k?go(L,m):Ws(k,Y,void 0,r|o)}}function Nn(m){return function(k){return Ni(k,m)}}function ro(m){if(typeof m=="string")return m;if(te(m))return io?io.call(m):"";var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function Ke(m){return w(m)?m:tc(m)}function ql(m){return function(k,L,Y){for(var lt=-1,Z=Object(k),yt=Y(k),Kt=yt.length;Kt--;){var Yt=yt[++lt];if(L(Z[Yt],Yt,Z)===!1)break}return k}}function oo(m,k,L,Y,lt,Z){var yt=lt&o,Kt=m.length,Yt=k.length;if(Kt!=Yt&&!(yt&&Yt>Kt))return!1;var oe=Z.get(m);if(oe&&Z.get(k))return oe==k;var we=-1,ve=!0,fe=lt&r?new Ri:void 0;for(Z.set(m,k),Z.set(k,m);++we<Kt;){var Le=m[we],Ne=k[we];if(Y)var zn=yt?Y(Ne,Le,we,k,m,Z):Y(Le,Ne,we,m,k,Z);if(zn!==void 0){if(zn)continue;ve=!1;break}if(fe){if(!bt(k,function(mn,ui){if(!fe.has(ui)&&(Le===mn||L(Le,mn,Y,lt,Z)))return fe.add(ui)})){ve=!1;break}}else if(!(Le===Ne||L(Le,Ne,Y,lt,Z))){ve=!1;break}}return Z.delete(m),Z.delete(k),ve}function Gl(m,k,L,Y,lt,Z,yt){switch(L){case b:if(m.byteLength!=k.byteLength||m.byteOffset!=k.byteOffset)return!1;m=m.buffer,k=k.buffer;case _:return!(m.byteLength!=k.byteLength||!Y(new Rn(m),new Rn(k)));case u:case d:case x:return co(+m,+k);case f:return m.name==k.name&&m.message==k.message;case D:case T:return m==k+"";case y:var Kt=Pt;case S:var Yt=Z&o;if(Kt||(Kt=mt),m.size!=k.size&&!Yt)return!1;var oe=yt.get(m);if(oe)return oe==k;Z|=r,yt.set(m,k);var we=oo(Kt(m),Kt(k),Y,lt,Z,yt);return yt.delete(m),we;case R:if(Bs)return Bs.call(m)==Bs.call(k)}return!1}function Kl(m,k,L,Y,lt,Z){var yt=lt&o,Kt=ci(m),Yt=Kt.length,oe=ci(k),we=oe.length;if(Yt!=we&&!yt)return!1;for(var ve=Yt;ve--;){var fe=Kt[ve];if(!(yt?fe in k:Lt.call(k,fe)))return!1}var Le=Z.get(m);if(Le&&Z.get(k))return Le==k;var Ne=!0;Z.set(m,k),Z.set(k,m);for(var zn=yt;++ve<Yt;){fe=Kt[ve];var mn=m[fe],ui=k[fe];if(Y)var hg=yt?Y(ui,mn,fe,k,m,Z):Y(mn,ui,fe,m,k,Z);if(!(hg===void 0?mn===ui||L(mn,ui,Y,lt,Z):hg)){Ne=!1;break}zn||(zn=fe=="constructor")}if(Ne&&!zn){var po=m.constructor,mo=k.constructor;po!=mo&&"constructor"in m&&"constructor"in k&&!(typeof po=="function"&&po instanceof po&&typeof mo=="function"&&mo instanceof mo)&&(Ne=!1)}return Z.delete(m),Z.delete(k),Ne}function zi(m,k){var L=m.__data__;return js(k)?L[typeof k=="string"?"string":"hash"]:L.map}function Zl(m){for(var k=ci(m),L=k.length;L--;){var Y=k[L],lt=m[Y];k[L]=[Y,lt,lo(lt)]}return k}function fn(m,k){var L=Ht(m,k);return Vl(L)?L:void 0}var re=Hl;(oi&&re(new oi(new ArrayBuffer(1)))!=b||cn&&re(new cn)!=y||un&&re(un.resolve())!=v||Fs&&re(new Fs)!=S||zs&&re(new zs)!=E)&&(re=function(m){var k=Te.call(m),L=k==M?m.constructor:void 0,Y=L?pn(L):void 0;if(Y)switch(Y){case bl:return b;case _l:return y;case eo:return v;case no:return S;case dn:return E}return k});function Ql(m,k,L){k=Bi(k,m)?[k]:Ke(k);for(var Y,lt=-1,yt=k.length;++lt<yt;){var Z=gn(k[lt]);if(!(Y=m!=null&&L(m,Z)))break;m=m[Z]}if(Y)return Y;var yt=m?m.length:0;return!!yt&&$t(yt)&&Ys(Z,yt)&&(w(m)||uo(m))}function Ys(m,k){return k=k??a,!!k&&(typeof m=="number"||vt.test(m))&&m>-1&&m%1==0&&m<k}function Bi(m,k){if(w(m))return!1;var L=typeof m;return L=="number"||L=="symbol"||L=="boolean"||m==null||te(m)?!0:tt.test(m)||!V.test(m)||k!=null&&m in Object(k)}function js(m){var k=typeof m;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?m!=="__proto__":m===null}function ao(m){return!!De&&De in m}function Jl(m){var k=m&&m.constructor,L=typeof k=="function"&&k.prototype||de;return m===L}function lo(m){return m===m&&!Gt(m)}function Vs(m,k){return function(L){return L==null?!1:L[m]===k&&(k!==void 0||m in Object(L))}}var tc=li(function(m){m=Fn(m);var k=[];return U.test(m)&&k.push(""),m.replace(B,function(L,Y,lt,Z){k.push(lt?Z.replace(wt,"$1"):Y||L)}),k});function gn(m){if(typeof m=="string"||te(m))return m;var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function pn(m){if(m!=null){try{return Se.call(m)}catch{}try{return m+""}catch{}}return""}function li(m,k){if(typeof m!="function"||k&&typeof k!="function")throw new TypeError(i);var L=function(){var Y=arguments,lt=k?k.apply(this,Y):Y[0],Z=L.cache;if(Z.has(lt))return Z.get(lt);var yt=m.apply(this,Y);return L.cache=Z.set(lt,yt),yt};return L.cache=new(li.Cache||We),L}li.Cache=We;function co(m,k){return m===k||m!==m&&k!==k}function uo(m){return z(m)&&Lt.call(m,"callee")&&(!Ls.call(m,"callee")||Te.call(m)==l)}var w=Array.isArray;function A(m){return m!=null&&$t(m.length)&&!G(m)}function z(m){return xe(m)&&A(m)}function G(m){var k=Gt(m)?Te.call(m):"";return k==g||k==p}function $t(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=a}function Gt(m){var k=typeof m;return!!m&&(k=="object"||k=="function")}function xe(m){return!!m&&typeof m=="object"}function te(m){return typeof m=="symbol"||xe(m)&&Te.call(m)==R}var ho=ht?qt(ht):$l;function Fn(m){return m==null?"":ro(m)}function fo(m,k,L){var Y=m==null?void 0:Ni(m,k);return Y===void 0?L:Y}function go(m,k){return m!=null&&Ql(m,k,Wl)}function ci(m){return A(m)?Fl(m):Ul(m)}function $s(m,k){var L={};return k=so(k),Bl(m,function(Y,lt,Z){L[k(Y,lt,Z)]=Y}),L}function Hi(m){return m}function lT(m){return Bi(m)?Jt(gn(m)):Nn(m)}n.exports=$s}(to,to.exports);var wS=to.exports;const vS=za(wS);var MS=9007199254740991,kS="[object Arguments]",DS="[object Function]",SS="[object GeneratorFunction]",TS="[object Symbol]",CS=typeof be=="object"&&be&&be.Object===Object&&be,PS=typeof self=="object"&&self&&self.Object===Object&&self,OS=CS||PS||Function("return this")();function ES(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function AS(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function RS(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var ml=Object.prototype,IS=ml.hasOwnProperty,yl=ml.toString,sg=OS.Symbol,LS=ml.propertyIsEnumerable,rg=sg?sg.isConcatSpreadable:void 0,og=Math.max;function NS(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=HS),s||(s=[]);++r<o;){var a=n[r];e(a)?RS(s,a):s[s.length]=a}return s}function FS(n,t){return n=Object(n),zS(n,t,function(e,i){return i in n})}function zS(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function BS(n,t){return t=og(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=og(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,ES(n,this,o)}}function HS(n){return jS(n)||YS(n)||!!(rg&&n&&n[rg])}function WS(n){if(typeof n=="string"||GS(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function YS(n){return $S(n)&&IS.call(n,"callee")&&(!LS.call(n,"callee")||yl.call(n)==kS)}var jS=Array.isArray;function VS(n){return n!=null&&XS(n.length)&&!US(n)}function $S(n){return ag(n)&&VS(n)}function US(n){var t=qS(n)?yl.call(n):"";return t==DS||t==SS}function XS(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=MS}function qS(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function ag(n){return!!n&&typeof n=="object"}function GS(n){return typeof n=="symbol"||ag(n)&&yl.call(n)==TS}var KS=BS(function(n,t){return n==null?{}:FS(n,AS(NS(t),WS))}),ZS=KS;const QS=za(ZS);var lg={exports:{}};(function(n,t){(function(e,i){i()})(be,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof be=="object"&&be.global===be?be:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,d){var f=o.URL||o.webkitURL,g=document.createElement("a");u=u||c.name||"download",g.download=u,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?r(g):s(g.href)?i(c,u,d):r(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){r(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(s(c))i(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||g&&p||a)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var D=x.result;D=y?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=D:location=D,f=null},x.readAsDataURL(c)}else{var M=o.URL||o.webkitURL,v=M.createObjectURL(c);f?f.location=v:location.href=v,f=null,setTimeout(function(){M.revokeObjectURL(v)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(lg);var JS=lg.exports,cg={exports:{}};/* @license
|
|
28
|
+
*/const SD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};lu._date.override({_id:"date-fns",formats:function(){return SD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=at(n):e==="string"&&(typeof t=="string"?n=Px(n,t,new Date,this.options):n=Ud(n,this.options)),fa(n)?n.getTime():null},format:function(n,t){return Hd(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return da(n,t);case"second":return k0(n,t);case"minute":return v0(n,t);case"hour":return _0(n,t);case"day":return Tr(n,t);case"week":return D0(n,t);case"month":return ua(n,t);case"quarter":return M0(n,t);case"year":return S0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return ga(n,t);case"second":return I0(n,t);case"minute":return E0(n,t);case"hour":return O0(n,t);case"day":return kd(n,t);case"week":return L0(n,t);case"month":return Cd(n,t);case"quarter":return R0(n,t);case"year":return N0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Rx(n);case"minute":return Ax(n);case"hour":return Ex(n);case"day":return ha(n);case"week":return Ue(n);case"isoWeek":return Ue(n,{weekStartsOn:+e});case"month":return z0(n);case"quarter":return F0(n);case"year":return Pd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return V0(n);case"minute":return Y0(n);case"hour":return H0(n);case"day":return Sd(n);case"week":return W0(n);case"month":return Td(n);case"quarter":return j0(n);case"year":return B0(n);default:return n}}});const Qf={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},TD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Qf,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},CD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ei(n){return h.isProxy(n)?h.toRaw(n):n}function PD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function OD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Jf(n,t){n.labels=t}function tg(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function ED(n,t){const e={labels:[],datasets:[]};return Jf(e,n.labels),tg(e,n.datasets,t),e}const AD=h.defineComponent({props:TD,setup(n,t){let{expose:e,slots:i}=t;const s=h.ref(null),r=h.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=ED(u,g),y=PD(p,u);r.value=new Oe(s.value,{type:c,data:y,options:{...d},plugins:f})},a=()=>{const c=h.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return h.onMounted(o),h.onUnmounted(a),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const y=h.toRaw(r.value);if(!y)return;let x=!1;if(d){const M=Ei(d),v=Ei(g);M&&M!==v&&(OD(y,M),x=!0)}if(f){const M=Ei(f.labels),v=Ei(p.labels),D=Ei(f.datasets),S=Ei(p.datasets);M!==v&&(Jf(y.config.data,M),x=!0),D&&D!==S&&(tg(y.config.data,D,n.datasetIdKey),x=!0)}x&&h.nextTick(()=>{l(y)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[h.h("p",{},[i.default?i.default():""])])}});function ml(n,t){return Oe.register(t),h.defineComponent({props:Qf,setup(e,i){let{expose:s}=i;const r=h.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>h.h(AD,CD({ref:o},{type:n,...e}))}})}const RD=ml("bar",es),eg=ml("doughnut",sn),ID=ml("line",ns),LD={class:"chart-container"},ND=h.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Ft.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>on},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=gt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=h.ref([]),o=h.useTemplateRef("chartParentRef"),a=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=gt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(v){r.value=v.options.plugins.legend.labels.generateLabels(v).map(D=>({...D,value:t.legendValues&&t.legendValues[D.text],hidden:!1}))}},d=h.computed(()=>[u]),f=h.computed(()=>[t.chartData.datasets.reduce((D,S)=>(D.labels.push(S.label),D.backgroundColor.push(S.backgroundColor),D.borderColor.push(Jd(S.backgroundColor,50)),D.data.push(S.data.reduce((T,A)=>T+A,0)),D),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),g=h.computed(()=>({...t.chartData,datasets:f.value}));gt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:p}=gt.useDonutChartOptions({tooltipState:a,legendID:i}),y=h.ref(),x=v=>({[Ft.Right]:"legend-row",[Ft.Bottom]:"column",[Ft.Hidden]:"hidden"})[v],M=({width:v,height:D})=>{a.width=v,a.height=D};return(v,D)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:o,class:h.normalizeClass(["chart-parent",x(v.legendPosition)]),"data-testid":"donut-chart-parent"},[h.createElementVNode("div",LD,[h.createVNode(h.unref(eg),{ref_key:"chartInstance",ref:y,"chart-id":h.unref(s),data:g.value,options:h.unref(p),plugins:d.value},null,8,["chart-id","data","options","plugins"]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(fl,{"absolute-left":h.unref(l),"absolute-top":h.unref(c),state:a,"tooltip-title":v.tooltipTitle,unit:v.metricUnit,onDimensions:M},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),h.createVNode(gl,{id:h.unref(i),"chart-instance":y.value,items:r.value,position:v.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),FD=Re(ND,[["__scopeId","data-v-b61e8182"]]),ng=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()};class zD{constructor(){P(this,"id","verticalLinePlugin");P(this,"_clickedSegment");P(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;ng(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;ng(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const BD=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(200, 200, 200, 0.5)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},ig=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class HD{constructor(){P(this,"id","dragSelectPlugin");P(this,"_isDragging",!1);P(this,"_startX",0);P(this,"_endX",0);P(this,"_dragTimeout");P(this,"_clearSelectionArea",!1);P(this,"_chart",null);P(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas,i=e.getBoundingClientRect();let s=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{this._isDragging=!0,this._clearSelectionArea=!1,s=!0,this._startX=l.clientX-i.left},150)},o=l=>{s&&this._isDragging&&(this._endX=l.clientX-i.left,ig("dragSelectMove",t,this),t.update())},a=l=>{clearTimeout(this._dragTimeout),s&&this._isDragging&&(this._endX=l.clientX-i.left,ig("dragSelect",t,this),t.update(),s=!1,this._isDragging=!1)};e.addEventListener("mousedown",r),e.addEventListener("mousemove",o),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:o,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&BD(t,this._startX,this._endX)}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const WD=["hidden","single","full"];var ii=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ii||{});const YD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],jD=["gauge","top_n","single_value"],VD=Re(h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},zoom:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,s=new zD,r=new Gf,o=new HD,{translateUnit:a}=gt.useTranslatedUnits(),l=h.ref(),c=crypto.randomUUID(),u=crypto.randomUUID(),d=h.ref([]),f=h.ref(),g=h.ref(h.inject("legendPosition",Ft.Right)),p=h.ref(null),y=h.ref(void 0),x=h.ref(!1),M=h.inject(Za),v=M==null?void 0:M.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),D=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:a,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:u,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:S,tooltipAbsoluteTop:T}=gt.useTooltipAbsolutePosition(p,D),A={id:c,afterUpdate(X){d.value=Gd(X,e.legendValues,e.chartLegendSortFn)}},O=h.computed(()=>[A,r,...e.zoom?[o]:[],...e.type==="timeseries_line"?[s]:[]]),_=h.computed(()=>`line-${O.value.map(X=>X.id).join("-")}`),b=h.computed(()=>`bar-${O.value.map(X=>X.id).join("-")}`),C=h.computed(()=>e.chartData&&tw(e.chartData)),R=h.computed(()=>v?!1:x.value),{options:I}=gt.useLineChartOptions({tooltipState:D,timeRangeMs:h.toRef(e,"timeRangeMs"),granularity:h.toRef(e,"granularity"),legendID:c,stacked:h.toRef(e,"stacked"),metricAxesTitle:h.toRef(e,"metricAxesTitle"),dimensionAxesTitle:h.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:C});gt.useReportChartDataForSynthetics(h.toRef(e,"chartData"),h.toRef(e,"syntheticsDataKey"));const Y=X=>({[Ft.Right]:"legend-row",[Ft.Bottom]:"column",[Ft.Hidden]:"hidden"})[X],L=({width:X,height:B})=>{D.width=X,D.height=B},W=(X=!0)=>{D.interactionMode="idle",o.clearSelectionArea(),r.isPaused&&r.resume(X),s.isPaused&&s.resume()},U=()=>{D.interactionMode="interactive"},H=()=>{var X,B;!l.value||!((B=(X=l.value.chart.tooltip)==null?void 0:X.dataPoints)!=null&&B.length)||(D.interactionMode==="interactive"?s.clickedSegment=l.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},st=()=>{if(x.value){x.value=!1;return}D.interactionMode!=="idle"?W():U(),H()};h.watch(()=>e.type,()=>{D.interactionMode="idle",D.showTooltip=!1,s.destroyClickedSegment()});const $=X=>{X.preventDefault(),X.stopPropagation();const{xStart:B,xEnd:Q}=X.detail;B&&Q&&(y.value={start:new Date(B),end:new Date(Q),type:"absolute"},v?D.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(B),end:new Date(Q),type:"absolute"}),W()))},tt=X=>{v&&(D.interactionMode="selecting-chart-area"),x.value=!0,s.pause(),r.pause();const{xStart:B,xEnd:Q}=X.detail;B&&Q&&(y.value={start:new Date(B),end:new Date(Q),type:"absolute"})};return h.watch(()=>{var X;return(X=l.value)==null?void 0:X.chart},()=>{var X;(X=l.value)!=null&&X.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",$),l.value.chart.canvas.removeEventListener("dragSelectMove",tt),l.value.chart.canvas.addEventListener("dragSelect",$),l.value.chart.canvas.addEventListener("dragSelectMove",tt))}),h.onUnmounted(()=>{var X;(X=l.value)!=null&&X.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",$),l.value.chart.canvas.removeEventListener("dragSelectMove",tt))}),(X,B)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chartParentRef",ref:p,class:h.normalizeClass(["chart-parent",Y(g.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:B[0]||(B[0]=Q=>st())},[X.type==="timeseries_line"?(h.openBlock(),h.createBlock(h.unref(ID),{key:_.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:X.chartData,"data-testid":"time-series-line-chart",options:h.unref(I),plugins:O.value},null,8,["chart-id","data","options","plugins"])):X.type==="timeseries_bar"?(h.openBlock(),h.createBlock(h.unref(RD),{key:b.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:X.chartData,"data-testid":"time-series-bar-chart",options:h.unref(I),plugins:O.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[R.value?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(fl,{key:0,ref_key:"tooltipElement",ref:f,"absolute-left":h.unref(S),"absolute-top":h.unref(T),"data-testid":"tooltip",state:D,"tooltip-title":X.tooltipTitle,"zoom-action-items":X.zoomActionItems,"zoom-time-range":y.value,onDimensions:L,onLeft:B[1]||(B[1]=Q=>D.left=Q),onOnAction:B[2]||(B[2]=()=>W(!1)),onTop:B[3]||(B[3]=Q=>D.top=Q)},null,8,["absolute-left","absolute-top","state","tooltip-title","zoom-action-items","zoom-time-range"]))])),h.createVNode(gl,{id:h.unref(c),"chart-instance":l.value,"data-testid":"legend",items:d.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-20ceb50a"]]),$D={class:"analytics-chart-shell"},UD={key:0,class:"chart-header"},XD={class:"tooltip-content"},qD={key:2,class:"analytics-chart-parent"},GD=h.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Ft.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1}},emits:["zoom-time-range","view-requests"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=gt.useI18n(),r=h.inject(Za),o=h.ref("");h.onMounted(async()=>{var L;o.value=await((L=r==null?void 0:r.requestsBaseUrl)==null?void 0:L.call(r))??""});const a=h.computed(()=>x.value?gt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ir,threshold:i.chartOptions.threshold||void 0},h.toRef(i,"chartData")).value:gt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ir},h.toRef(i,"chartData")).value),l=h.computed(()=>{var L;return(L=i.chartData)!=null&&L.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),c=h.computed(()=>{var L;return(L=i.chartData.meta)!=null&&L.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),u=h.computed(()=>i.showLegendValues&&i.legendPosition!==Ft.Bottom),{legendValues:d}=gt.useChartLegendValues(a,i.chartOptions.type,c),f=h.computed(()=>{var L,W,U;return((U=(W=(L=i.chartData)==null?void 0:L.meta)==null?void 0:W.limit)==null?void 0:U.toString())||null}),g=h.computed(()=>{var L,W;return((W=(L=i.chartData)==null?void 0:L.meta)==null?void 0:W.truncated)||!1}),p=s.t("limitedResultsShown",{maxReturned:f.value}),y=h.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),x=h.computed(()=>["timeseries_bar","timeseries_line"].some(L=>L===i.chartOptions.type)),M=h.computed(()=>i.chartOptions.type==="donut"),v=h.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),D=h.computed(()=>{var U,H;if(!((U=i.chartData)!=null&&U.meta.metric_names)||!((H=i.chartData)!=null&&H.meta.metric_units))return;const L=i.chartData.meta.metric_names[0],W=i.chartData.meta.metric_units[L];if(i.chartData.meta.metric_names.length>1){if(L.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${W}`,{plural:"s"})});if(L.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${W}`,{plural:"s"})})}return s.t(`chartLabels.${L}`)}),S=h.computed(()=>{var U,H,st;if(!((U=i.chartData)!=null&&U.meta.metric_names)||!((H=i.chartData)!=null&&H.meta.metric_units))return;const L=i.chartData.meta.metric_names[0],W=i.chartData.meta.metric_units[L];if(i.chartData.meta.metric_names.length>1){if(L.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${W}`,{plural:"s"})});if(L.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${W}`,{plural:"s"})})}return((st=i.chartOptions)==null?void 0:st.metricAxesTitle)||s.te(`metricAxisTitles.${L}`)&&s.te(`chartUnits.${W}`)&&s.t(`metricAxisTitles.${L}`,{unit:s.t(`chartUnits.${W}`,{plural:"s"})})||void 0}),T=h.computed(()=>{const L=x.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];return i.chartOptions.dimensionAxesTitle||s.te(`chartLabels.${L}`)&&s.t(`chartLabels.${L}`)||void 0}),A=h.computed(()=>{const L=Ka(Number(i.chartData.meta.granularity_ms));return s.t(`granularityAxisTitles.${L}`)}),O=h.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),_=h.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),b=h.computed(()=>x.value?ew(a.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),C=h.computed(()=>i.chartData.meta.granularity_ms?Ka(i.chartData.meta.granularity_ms)||"hourly":Ka(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),R=h.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(L,W)=>L.text===s.t("chartLabels.____OTHER____")?1:W.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(L.text,10))&&!isNaN(parseInt(W.text,10))?L.text<W.text?-1:1:L.value&&W.value?W.value.raw-L.value.raw:0),I=h.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(L,W)=>L.label===s.t("chartLabels.____OTHER____")?1:W.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(L.label,10))&&!isNaN(parseInt(W.label,10))?L.label<W.label?-1:1:L.value&&W.value?W.rawValue-L.rawValue:0),Y=h.computed(()=>[{label:s.t("zoom_action_items.zoom"),action:L=>e("zoom-time-range",L)},...o.value?[{label:s.t("zoom_action_items.view_requests"),action:L=>e("view-requests",L)}]:[]]);return h.provide("showLegendValues",u),h.provide("legendPosition",h.toRef(i,"legendPosition")),(L,W)=>{const U=h.resolveComponent("KTooltip"),H=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",$D,[b.value&&g.value&&f.value?(h.openBlock(),h.createElementBlock("div",UD,[h.createVNode(U,{class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createElementVNode("div",XD,h.toDisplayString(h.unref(p)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(nc.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(sM)})`,size:h.unref(oM)},null,8,["color","size"])]),_:1})])):h.createCommentVNode("",!0),b.value?(h.openBlock(),h.createElementBlock("div",qD,[x.value?(h.openBlock(),h.createBlock(VD,{key:0,"chart-data":a.value,"chart-legend-sort-fn":R.value,"chart-tooltip-sort-fn":I.value,"dimension-axes-title":A.value,fill:L.chartOptions.stacked,granularity:C.value,"legend-values":h.unref(d),"metric-axes-title":S.value,"metric-unit":c.value,stacked:L.chartOptions.stacked,"synthetics-data-key":L.syntheticsDataKey,"time-range-ms":l.value,"tooltip-metric-display":D.value,"tooltip-title":L.tooltipTitle,type:L.chartOptions.type,zoom:L.timeseriesZoom,"zoom-action-items":Y.value,onZoomTimeRange:W[0]||(W[0]=st=>e("zoom-time-range",st))},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom","zoom-action-items"])):y.value?(h.openBlock(),h.createBlock(DD,{key:1,annotations:L.showAnnotations,"chart-data":a.value,"chart-legend-sort-fn":R.value,"chart-tooltip-sort-fn":I.value,"data-testid":"bar-chart-container","dimension-axes-title":T.value,"legend-values":h.unref(d),"metric-axes-title":S.value,"metric-unit":c.value,orientation:v.value,stacked:L.chartOptions.stacked,"synthetics-data-key":L.syntheticsDataKey,"tooltip-metric-display":D.value,"tooltip-title":L.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):M.value?(h.openBlock(),h.createBlock(FD,{key:2,"chart-data":a.value,"dataset-colors":L.chartOptions.chartDatasetColors||h.unref(Ir),"legend-position":L.legendPosition,"legend-values":h.unref(d),"metric-unit":c.value,"synthetics-data-key":L.syntheticsDataKey,"tooltip-dimension-display":T.value,"tooltip-metric-display":D.value,"tooltip-title":L.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(H,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(O.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(_.value),1)]),_:1}))])}}}),KD=Re(GD,[["__scopeId","data-v-5aed9a7d"]]),ZD={class:"chart-parent","data-testid":"gauge-chart-parent"},QD={class:"chart-totals-flex"},JD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},tS=Re(h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:on},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=gt.useI18n(),i=h.ref(Jr()),s=h.computed(()=>[t.chartData.datasets.reduce((p,y)=>(p.labels.push(y.label),p.borderColor.push(y.backgroundColor),p.backgroundColor.push(y.backgroundColor),p.data.push(y.data.reduce((x,M)=>x+M,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=h.computed(()=>({...t.chartData,datasets:s.value}));gt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=h.ref(),l=h.computed(()=>{var g;return Ms((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return Ms(((g=s==null?void 0:s.value[0])==null?void 0:g.data[0])+((p=s==null?void 0:s.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>["full","single"].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay==="full");return(g,p)=>(h.openBlock(),h.createElementBlock("div",ZD,[h.createElementVNode("div",QD,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",JD,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(eg),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-4f4e5b76"]]),eS={class:"chart-parent","data-testid":"single-value-parent"},nS={key:1,class:"single-value-wrapper"},iS={class:"single-value","data-testid":"single-value-chart"},sS={key:0,class:"single-value-unit"},rS=Re(h.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:tf}},setup(n){const{i18n:{t}}=gt.useI18n(),e=n,i=h.computed(()=>e.data.data[0]),s=h.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=h.computed(()=>{var u,d;const c=s.value?(d=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:d[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=h.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=h.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=h.computed(()=>{var d;const c=a.value;if(c===null)return"";if((d=s.value)!=null&&d.includes("_size_"))return Nr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:tf;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return h.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",eS,[a.value===null?(h.openBlock(),h.createBlock(d,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:h.unref(t)("singleValue.valueError")},null,8,["title"])):(h.openBlock(),h.createElementBlock("div",nS,[h.createElementVNode("span",iS,h.toDisplayString(l.value),1),o.value?(h.openBlock(),h.createElementBlock("span",sS," "+h.toDisplayString(r.value),1)):h.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),oS={class:"simple-chart-shell"},aS={key:1,class:"analytics-chart-parent"},lS=Re(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=gt.useI18n(),i=h.computed(()=>{var u;const c=gt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},h.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=h.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=h.computed(()=>t.chartOptions.type==="gauge"),o=h.computed(()=>t.chartOptions.type==="single_value"),a=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=h.computed(()=>{var u,d;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(d=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:d[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",oS,[l.value?(h.openBlock(),h.createElementBlock("div",aS,[r.value?(h.openBlock(),h.createBlock(tS,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0),o.value?(h.openBlock(),h.createBlock(rS,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(d,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),cS={class:"top-n-card-title","data-testid":"top-n-card-title"},uS={class:"top-n-card-description","data-testid":"top-n-card-description"},dS={key:3,class:"top-n-table","data-testid":"top-n-table"},hS={class:"table-headings"},fS={class:"table-row"},gS={class:"column-1"},pS={class:"column-2"},mS={class:"table-body","data-testid":"top-n-data"},yS=["data-testid"],bS={class:"column-1"},_S={class:"column-2"},xS=Re(h.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=gt.useI18n(),i=h.computed(()=>t.data.data),s=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=h.computed(()=>{var p,y;return(p=t.data.meta)!=null&&p.display&&((y=Object.keys(t.data.meta.display))==null?void 0:y[0])||""}),o=h.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=h.computed(()=>{var p,y;return(y=(p=t.data.meta)==null?void 0:p.metric_names)!=null&&y.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=h.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=p=>{const y=p.event;return String(y[r.value])},d=p=>{const y=u(p),x=o.value&&o.value[y];return x?x.name:"-"},f=p=>{const y=u(p),x=o.value&&o.value[y];return x?!!x.deleted:!1},g=p=>{if(!a.value)return"–";const x=p.event[a.value];return x?Ms(x,{capital:!0,round:!0}):"–"};return(p,y)=>{const x=h.resolveComponent("KEmptyState"),M=h.resolveComponent("KSkeleton"),v=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(v,{class:"kong-ui-public-top-n-table","title-tag":p.titleTag},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):p.isLoading?(h.openBlock(),h.createBlock(M,{key:1,"table-columns":2,type:"table"})):s.value?(h.openBlock(),h.createElementBlock("div",dS,[h.createElementVNode("div",hS,[h.createElementVNode("div",fS,[h.createElementVNode("div",gS,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",pS,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",mS,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(D,S)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${S}`,class:"table-row","data-testid":`row-${u(D)}`},[h.createElementVNode("div",bS,[h.renderSlot(p.$slots,"name",{record:{id:u(D),name:d(D),deleted:f(D),dimension:r.value}},()=>[h.createTextVNode(h.toDisplayString(d(D)),1)],!0)]),h.createElementVNode("div",_S," "+h.toDisplayString(g(D)),1)],8,yS))),128))])])):(h.openBlock(),h.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[p.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",cS,h.toDisplayString(p.title),1)]),key:"0"}:void 0,p.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",uS,h.toDisplayString(p.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var to={exports:{}};to.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",d="[object Date]",f="[object Error]",g="[object Function]",p="[object GeneratorFunction]",y="[object Map]",x="[object Number]",M="[object Object]",v="[object Promise]",D="[object RegExp]",S="[object Set]",T="[object String]",A="[object Symbol]",O="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",C="[object Float32Array]",R="[object Float64Array]",I="[object Int8Array]",Y="[object Int16Array]",L="[object Int32Array]",W="[object Uint8Array]",U="[object Uint8ClampedArray]",H="[object Uint16Array]",st="[object Uint32Array]",$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,X=/^\./,B=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,wt=/\\(\\)?/g,dt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,et={};et[C]=et[R]=et[I]=et[Y]=et[L]=et[W]=et[U]=et[H]=et[st]=!0,et[l]=et[c]=et[_]=et[u]=et[b]=et[d]=et[f]=et[g]=et[y]=et[x]=et[M]=et[D]=et[S]=et[T]=et[O]=!1;var At=typeof be=="object"&&be&&be.Object===Object&&be,F=typeof self=="object"&&self&&self.Object===Object&&self,j=At||F||Function("return this")(),K=t&&!t.nodeType&&t,J=K&&!0&&n&&!n.nodeType&&n,q=J&&J.exports===K,lt=q&&At.process,rt=function(){try{return lt&<.binding("util")}catch{}}(),ht=rt&&rt.isTypedArray;function bt(m,k){for(var N=-1,V=m?m.length:0;++N<V;)if(k(m[N],N,m))return!0;return!1}function Jt(m){return function(k){return k==null?void 0:k[m]}}function ue(m,k){for(var N=-1,V=Array(m);++N<m;)V[N]=k(N);return V}function qt(m){return function(k){return m(k)}}function Ht(m,k){return m==null?void 0:m[k]}function _t(m){var k=!1;if(m!=null&&typeof m.toString!="function")try{k=!!(m+"")}catch{}return k}function Pt(m){var k=-1,N=Array(m.size);return m.forEach(function(V,ct){N[++k]=[ct,V]}),N}function Wt(m,k){return function(N){return m(k(N))}}function mt(m){var k=-1,N=Array(m.size);return m.forEach(function(V){N[++k]=V}),N}var Ge=Array.prototype,_e=Function.prototype,de=Object.prototype,he=j["__core-js_shared__"],De=function(){var m=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""}(),Se=_e.toString,Lt=de.hasOwnProperty,Te=de.toString,ne=RegExp("^"+Se.call(Lt).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),si=j.Symbol,Rn=j.Uint8Array,Ls=de.propertyIsEnumerable,ri=Ge.splice,Ns=Wt(Object.keys,Object),oi=fn(j,"DataView"),cn=fn(j,"Map"),un=fn(j,"Promise"),Fs=fn(j,"Set"),zs=fn(j,"WeakMap"),ai=fn(Object,"create"),_l=pn(oi),xl=pn(cn),eo=pn(un),no=pn(Fs),dn=pn(zs),Ai=si?si.prototype:void 0,Bs=Ai?Ai.valueOf:void 0,io=Ai?Ai.toString:void 0;function hn(m){var k=-1,N=m?m.length:0;for(this.clear();++k<N;){var V=m[k];this.set(V[0],V[1])}}function wl(){this.__data__=ai?ai(null):{}}function Be(m){return this.has(m)&&delete this.__data__[m]}function vl(m){var k=this.__data__;if(ai){var N=k[m];return N===s?void 0:N}return Lt.call(k,m)?k[m]:void 0}function Ml(m){var k=this.__data__;return ai?k[m]!==void 0:Lt.call(k,m)}function kl(m,k){var N=this.__data__;return N[m]=ai&&k===void 0?s:k,this}hn.prototype.clear=wl,hn.prototype.delete=Be,hn.prototype.get=vl,hn.prototype.has=Ml,hn.prototype.set=kl;function He(m){var k=-1,N=m?m.length:0;for(this.clear();++k<N;){var V=m[k];this.set(V[0],V[1])}}function Dl(){this.__data__=[]}function In(m){var k=this.__data__,N=Li(k,m);if(N<0)return!1;var V=k.length-1;return N==V?k.pop():ri.call(k,N,1),!0}function Sl(m){var k=this.__data__,N=Li(k,m);return N<0?void 0:k[N][1]}function Tl(m){return Li(this.__data__,m)>-1}function Cl(m,k){var N=this.__data__,V=Li(N,m);return V<0?N.push([m,k]):N[V][1]=k,this}He.prototype.clear=Dl,He.prototype.delete=In,He.prototype.get=Sl,He.prototype.has=Tl,He.prototype.set=Cl;function We(m){var k=-1,N=m?m.length:0;for(this.clear();++k<N;){var V=m[k];this.set(V[0],V[1])}}function Pl(){this.__data__={hash:new hn,map:new(cn||He),string:new hn}}function Ln(m){return zi(this,m).delete(m)}function Ol(m){return zi(this,m).get(m)}function El(m){return zi(this,m).has(m)}function Al(m,k){return zi(this,m).set(m,k),this}We.prototype.clear=Pl,We.prototype.delete=Ln,We.prototype.get=Ol,We.prototype.has=El,We.prototype.set=Al;function Ri(m){var k=-1,N=m?m.length:0;for(this.__data__=new We;++k<N;)this.add(m[k])}function Rl(m){return this.__data__.set(m,s),this}function Il(m){return this.__data__.has(m)}Ri.prototype.add=Ri.prototype.push=Rl,Ri.prototype.has=Il;function Ie(m){this.__data__=new He(m)}function Ii(){this.__data__=new He}function Ll(m){return this.__data__.delete(m)}function Hs(m){return this.__data__.get(m)}function Nl(m){return this.__data__.has(m)}function Fl(m,k){var N=this.__data__;if(N instanceof He){var V=N.__data__;if(!cn||V.length<e-1)return V.push([m,k]),this;N=this.__data__=new We(V)}return N.set(m,k),this}Ie.prototype.clear=Ii,Ie.prototype.delete=Ll,Ie.prototype.get=Hs,Ie.prototype.has=Nl,Ie.prototype.set=Fl;function zl(m,k){var N=w(m)||uo(m)?ue(m.length,String):[],V=N.length,ct=!!V;for(var Z in m)Lt.call(m,Z)&&!(ct&&(Z=="length"||Ys(Z,V)))&&N.push(Z);return N}function Li(m,k){for(var N=m.length;N--;)if(co(m[N][0],k))return N;return-1}var Bl=Gl();function Hl(m,k){return m&&Bl(m,k,ci)}function Ni(m,k){k=Bi(k,m)?[k]:Ke(k);for(var N=0,V=k.length;m!=null&&N<V;)m=m[gn(k[N++])];return N&&N==V?m:void 0}function Wl(m){return Te.call(m)}function Yl(m,k){return m!=null&&k in Object(m)}function Ws(m,k,N,V,ct){return m===k?!0:m==null||k==null||!Gt(m)&&!xe(k)?m!==m&&k!==k:jl(m,k,Ws,N,V,ct)}function jl(m,k,N,V,ct,Z){var yt=w(m),Kt=w(k),Yt=c,oe=c;yt||(Yt=re(m),Yt=Yt==l?M:Yt),Kt||(oe=re(k),oe=oe==l?M:oe);var we=Yt==M&&!_t(m),ve=oe==M&&!_t(k),fe=Yt==oe;if(fe&&!we)return Z||(Z=new Ie),yt||ho(m)?oo(m,k,N,V,ct,Z):Kl(m,k,Yt,N,V,ct,Z);if(!(ct&o)){var Le=we&&Lt.call(m,"__wrapped__"),Ne=ve&&Lt.call(k,"__wrapped__");if(Le||Ne){var zn=Le?m.value():m,mn=Ne?k.value():k;return Z||(Z=new Ie),N(zn,mn,V,ct,Z)}}return fe?(Z||(Z=new Ie),Zl(m,k,N,V,ct,Z)):!1}function Vl(m,k,N,V){var ct=N.length,Z=ct;if(m==null)return!Z;for(m=Object(m);ct--;){var yt=N[ct];if(yt[2]?yt[1]!==m[yt[0]]:!(yt[0]in m))return!1}for(;++ct<Z;){yt=N[ct];var Kt=yt[0],Yt=m[Kt],oe=yt[1];if(yt[2]){if(Yt===void 0&&!(Kt in m))return!1}else{var we=new Ie,ve;if(!(ve===void 0?Ws(oe,Yt,V,r|o,we):ve))return!1}}return!0}function $l(m){if(!Gt(m)||ao(m))return!1;var k=G(m)||_t(m)?ne:dt;return k.test(pn(m))}function Ul(m){return xe(m)&&$t(m.length)&&!!et[Te.call(m)]}function so(m){return typeof m=="function"?m:m==null?Hi:typeof m=="object"?w(m)?Fi(m[0],m[1]):ql(m):lT(m)}function Xl(m){if(!tc(m))return Ns(m);var k=[];for(var N in Object(m))Lt.call(m,N)&&N!="constructor"&&k.push(N);return k}function ql(m){var k=Ql(m);return k.length==1&&k[0][2]?Vs(k[0][0],k[0][1]):function(N){return N===m||Vl(N,m,k)}}function Fi(m,k){return Bi(m)&&lo(k)?Vs(gn(m),k):function(N){var V=fo(N,m);return V===void 0&&V===k?go(N,m):Ws(k,V,void 0,r|o)}}function Nn(m){return function(k){return Ni(k,m)}}function ro(m){if(typeof m=="string")return m;if(te(m))return io?io.call(m):"";var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function Ke(m){return w(m)?m:ec(m)}function Gl(m){return function(k,N,V){for(var ct=-1,Z=Object(k),yt=V(k),Kt=yt.length;Kt--;){var Yt=yt[++ct];if(N(Z[Yt],Yt,Z)===!1)break}return k}}function oo(m,k,N,V,ct,Z){var yt=ct&o,Kt=m.length,Yt=k.length;if(Kt!=Yt&&!(yt&&Yt>Kt))return!1;var oe=Z.get(m);if(oe&&Z.get(k))return oe==k;var we=-1,ve=!0,fe=ct&r?new Ri:void 0;for(Z.set(m,k),Z.set(k,m);++we<Kt;){var Le=m[we],Ne=k[we];if(V)var zn=yt?V(Ne,Le,we,k,m,Z):V(Le,Ne,we,m,k,Z);if(zn!==void 0){if(zn)continue;ve=!1;break}if(fe){if(!bt(k,function(mn,ui){if(!fe.has(ui)&&(Le===mn||N(Le,mn,V,ct,Z)))return fe.add(ui)})){ve=!1;break}}else if(!(Le===Ne||N(Le,Ne,V,ct,Z))){ve=!1;break}}return Z.delete(m),Z.delete(k),ve}function Kl(m,k,N,V,ct,Z,yt){switch(N){case b:if(m.byteLength!=k.byteLength||m.byteOffset!=k.byteOffset)return!1;m=m.buffer,k=k.buffer;case _:return!(m.byteLength!=k.byteLength||!V(new Rn(m),new Rn(k)));case u:case d:case x:return co(+m,+k);case f:return m.name==k.name&&m.message==k.message;case D:case T:return m==k+"";case y:var Kt=Pt;case S:var Yt=Z&o;if(Kt||(Kt=mt),m.size!=k.size&&!Yt)return!1;var oe=yt.get(m);if(oe)return oe==k;Z|=r,yt.set(m,k);var we=oo(Kt(m),Kt(k),V,ct,Z,yt);return yt.delete(m),we;case A:if(Bs)return Bs.call(m)==Bs.call(k)}return!1}function Zl(m,k,N,V,ct,Z){var yt=ct&o,Kt=ci(m),Yt=Kt.length,oe=ci(k),we=oe.length;if(Yt!=we&&!yt)return!1;for(var ve=Yt;ve--;){var fe=Kt[ve];if(!(yt?fe in k:Lt.call(k,fe)))return!1}var Le=Z.get(m);if(Le&&Z.get(k))return Le==k;var Ne=!0;Z.set(m,k),Z.set(k,m);for(var zn=yt;++ve<Yt;){fe=Kt[ve];var mn=m[fe],ui=k[fe];if(V)var hg=yt?V(ui,mn,fe,k,m,Z):V(mn,ui,fe,m,k,Z);if(!(hg===void 0?mn===ui||N(mn,ui,V,ct,Z):hg)){Ne=!1;break}zn||(zn=fe=="constructor")}if(Ne&&!zn){var po=m.constructor,mo=k.constructor;po!=mo&&"constructor"in m&&"constructor"in k&&!(typeof po=="function"&&po instanceof po&&typeof mo=="function"&&mo instanceof mo)&&(Ne=!1)}return Z.delete(m),Z.delete(k),Ne}function zi(m,k){var N=m.__data__;return js(k)?N[typeof k=="string"?"string":"hash"]:N.map}function Ql(m){for(var k=ci(m),N=k.length;N--;){var V=k[N],ct=m[V];k[N]=[V,ct,lo(ct)]}return k}function fn(m,k){var N=Ht(m,k);return $l(N)?N:void 0}var re=Wl;(oi&&re(new oi(new ArrayBuffer(1)))!=b||cn&&re(new cn)!=y||un&&re(un.resolve())!=v||Fs&&re(new Fs)!=S||zs&&re(new zs)!=O)&&(re=function(m){var k=Te.call(m),N=k==M?m.constructor:void 0,V=N?pn(N):void 0;if(V)switch(V){case _l:return b;case xl:return y;case eo:return v;case no:return S;case dn:return O}return k});function Jl(m,k,N){k=Bi(k,m)?[k]:Ke(k);for(var V,ct=-1,yt=k.length;++ct<yt;){var Z=gn(k[ct]);if(!(V=m!=null&&N(m,Z)))break;m=m[Z]}if(V)return V;var yt=m?m.length:0;return!!yt&&$t(yt)&&Ys(Z,yt)&&(w(m)||uo(m))}function Ys(m,k){return k=k??a,!!k&&(typeof m=="number"||vt.test(m))&&m>-1&&m%1==0&&m<k}function Bi(m,k){if(w(m))return!1;var N=typeof m;return N=="number"||N=="symbol"||N=="boolean"||m==null||te(m)?!0:tt.test(m)||!$.test(m)||k!=null&&m in Object(k)}function js(m){var k=typeof m;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?m!=="__proto__":m===null}function ao(m){return!!De&&De in m}function tc(m){var k=m&&m.constructor,N=typeof k=="function"&&k.prototype||de;return m===N}function lo(m){return m===m&&!Gt(m)}function Vs(m,k){return function(N){return N==null?!1:N[m]===k&&(k!==void 0||m in Object(N))}}var ec=li(function(m){m=Fn(m);var k=[];return X.test(m)&&k.push(""),m.replace(B,function(N,V,ct,Z){k.push(ct?Z.replace(wt,"$1"):V||N)}),k});function gn(m){if(typeof m=="string"||te(m))return m;var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function pn(m){if(m!=null){try{return Se.call(m)}catch{}try{return m+""}catch{}}return""}function li(m,k){if(typeof m!="function"||k&&typeof k!="function")throw new TypeError(i);var N=function(){var V=arguments,ct=k?k.apply(this,V):V[0],Z=N.cache;if(Z.has(ct))return Z.get(ct);var yt=m.apply(this,V);return N.cache=Z.set(ct,yt),yt};return N.cache=new(li.Cache||We),N}li.Cache=We;function co(m,k){return m===k||m!==m&&k!==k}function uo(m){return z(m)&&Lt.call(m,"callee")&&(!Ls.call(m,"callee")||Te.call(m)==l)}var w=Array.isArray;function E(m){return m!=null&&$t(m.length)&&!G(m)}function z(m){return xe(m)&&E(m)}function G(m){var k=Gt(m)?Te.call(m):"";return k==g||k==p}function $t(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=a}function Gt(m){var k=typeof m;return!!m&&(k=="object"||k=="function")}function xe(m){return!!m&&typeof m=="object"}function te(m){return typeof m=="symbol"||xe(m)&&Te.call(m)==A}var ho=ht?qt(ht):Ul;function Fn(m){return m==null?"":ro(m)}function fo(m,k,N){var V=m==null?void 0:Ni(m,k);return V===void 0?N:V}function go(m,k){return m!=null&&Jl(m,k,Yl)}function ci(m){return E(m)?zl(m):Xl(m)}function $s(m,k){var N={};return k=so(k),Hl(m,function(V,ct,Z){N[k(V,ct,Z)]=V}),N}function Hi(m){return m}function lT(m){return Bi(m)?Jt(gn(m)):Nn(m)}n.exports=$s}(to,to.exports);var wS=to.exports;const vS=za(wS);var MS=9007199254740991,kS="[object Arguments]",DS="[object Function]",SS="[object GeneratorFunction]",TS="[object Symbol]",CS=typeof be=="object"&&be&&be.Object===Object&&be,PS=typeof self=="object"&&self&&self.Object===Object&&self,OS=CS||PS||Function("return this")();function ES(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function AS(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function RS(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var yl=Object.prototype,IS=yl.hasOwnProperty,bl=yl.toString,sg=OS.Symbol,LS=yl.propertyIsEnumerable,rg=sg?sg.isConcatSpreadable:void 0,og=Math.max;function NS(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=HS),s||(s=[]);++r<o;){var a=n[r];e(a)?RS(s,a):s[s.length]=a}return s}function FS(n,t){return n=Object(n),zS(n,t,function(e,i){return i in n})}function zS(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function BS(n,t){return t=og(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=og(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,ES(n,this,o)}}function HS(n){return jS(n)||YS(n)||!!(rg&&n&&n[rg])}function WS(n){if(typeof n=="string"||GS(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function YS(n){return $S(n)&&IS.call(n,"callee")&&(!LS.call(n,"callee")||bl.call(n)==kS)}var jS=Array.isArray;function VS(n){return n!=null&&XS(n.length)&&!US(n)}function $S(n){return ag(n)&&VS(n)}function US(n){var t=qS(n)?bl.call(n):"";return t==DS||t==SS}function XS(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=MS}function qS(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function ag(n){return!!n&&typeof n=="object"}function GS(n){return typeof n=="symbol"||ag(n)&&bl.call(n)==TS}var KS=BS(function(n,t){return n==null?{}:FS(n,AS(NS(t),WS))}),ZS=KS;const QS=za(ZS);var lg={exports:{}};(function(n,t){(function(e,i){i()})(be,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof be=="object"&&be.global===be?be:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,d){var f=o.URL||o.webkitURL,g=document.createElement("a");u=u||c.name||"download",g.download=u,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?r(g):s(g.href)?i(c,u,d):r(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){r(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(s(c))i(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||g&&p||a)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var D=x.result;D=y?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=D:location=D,f=null},x.readAsDataURL(c)}else{var M=o.URL||o.webkitURL,v=M.createObjectURL(c);f?f.location=v:location.href=v,f=null,setTimeout(function(){M.revokeObjectURL(v)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(lg);var JS=lg.exports,cg={exports:{}};/* @license
|
|
29
29
|
Papa Parse
|
|
30
30
|
v5.4.1
|
|
31
31
|
https://github.com/mholt/PapaParse
|
|
32
32
|
License: MIT
|
|
33
|
-
*/(function(n,t){(function(e,i){n.exports=i()})(be,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s=!i.document&&!!i.postMessage,r=i.IS_PAPA_WORKER||!1,o={},a=0,l={parse:function(_,b){var
|
|
34
|
-
`,
|
|
35
|
-
`,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!s&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=M,l.ParserHandle=y,l.NetworkStreamer=d,l.FileStreamer=f,l.StringStreamer=g,l.ReadableStreamStreamer=p,i.jQuery){var c=i.jQuery;c.fn.parse=function(_){var b=_.config||{},
|
|
33
|
+
*/(function(n,t){(function(e,i){n.exports=i()})(be,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s=!i.document&&!!i.postMessage,r=i.IS_PAPA_WORKER||!1,o={},a=0,l={parse:function(_,b){var C=(b=b||{}).dynamicTyping||!1;if(O(C)&&(b.dynamicTypingFunction=C,C={}),b.dynamicTyping=C,b.transform=!!O(b.transform)&&b.transform,b.worker&&l.WORKERS_SUPPORTED){var R=function(){if(!l.WORKERS_SUPPORTED)return!1;var Y=(W=i.URL||i.webkitURL||null,U=e.toString(),l.BLOB_URL||(l.BLOB_URL=W.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",U,")();"],{type:"text/javascript"})))),L=new i.Worker(Y),W,U;return L.onmessage=v,L.id=a++,o[L.id]=L}();return R.userStep=b.step,R.userChunk=b.chunk,R.userComplete=b.complete,R.userError=b.error,b.step=O(b.step),b.chunk=O(b.chunk),b.complete=O(b.complete),b.error=O(b.error),delete b.worker,void R.postMessage({input:_,config:b,workerId:R.id})}var I=null;return l.NODE_STREAM_INPUT,typeof _=="string"?(_=function(Y){return Y.charCodeAt(0)===65279?Y.slice(1):Y}(_),I=b.download?new d(b):new g(b)):_.readable===!0&&O(_.read)&&O(_.on)?I=new p(b):(i.File&&_ instanceof File||_ instanceof Object)&&(I=new f(b)),I.stream(_)},unparse:function(_,b){var C=!1,R=!0,I=",",Y=`\r
|
|
34
|
+
`,L='"',W=L+L,U=!1,H=null,st=!1;(function(){if(typeof b=="object"){if(typeof b.delimiter!="string"||l.BAD_DELIMITERS.filter(function(B){return b.delimiter.indexOf(B)!==-1}).length||(I=b.delimiter),(typeof b.quotes=="boolean"||typeof b.quotes=="function"||Array.isArray(b.quotes))&&(C=b.quotes),typeof b.skipEmptyLines!="boolean"&&typeof b.skipEmptyLines!="string"||(U=b.skipEmptyLines),typeof b.newline=="string"&&(Y=b.newline),typeof b.quoteChar=="string"&&(L=b.quoteChar),typeof b.header=="boolean"&&(R=b.header),Array.isArray(b.columns)){if(b.columns.length===0)throw new Error("Option columns is empty");H=b.columns}b.escapeChar!==void 0&&(W=b.escapeChar+L),(typeof b.escapeFormulae=="boolean"||b.escapeFormulae instanceof RegExp)&&(st=b.escapeFormulae instanceof RegExp?b.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var $=new RegExp(x(L),"g");if(typeof _=="string"&&(_=JSON.parse(_)),Array.isArray(_)){if(!_.length||Array.isArray(_[0]))return tt(null,_,U);if(typeof _[0]=="object")return tt(H||Object.keys(_[0]),_,U)}else if(typeof _=="object")return typeof _.data=="string"&&(_.data=JSON.parse(_.data)),Array.isArray(_.data)&&(_.fields||(_.fields=_.meta&&_.meta.fields||H),_.fields||(_.fields=Array.isArray(_.data[0])?_.fields:typeof _.data[0]=="object"?Object.keys(_.data[0]):[]),Array.isArray(_.data[0])||typeof _.data[0]=="object"||(_.data=[_.data])),tt(_.fields||[],_.data||[],U);throw new Error("Unable to serialize unrecognized input");function tt(B,Q,wt){var dt="";typeof B=="string"&&(B=JSON.parse(B)),typeof Q=="string"&&(Q=JSON.parse(Q));var vt=Array.isArray(B)&&0<B.length,et=!Array.isArray(Q[0]);if(vt&&R){for(var At=0;At<B.length;At++)0<At&&(dt+=I),dt+=X(B[At],At);0<Q.length&&(dt+=Y)}for(var F=0;F<Q.length;F++){var j=vt?B.length:Q[F].length,K=!1,J=vt?Object.keys(Q[F]).length===0:Q[F].length===0;if(wt&&!vt&&(K=wt==="greedy"?Q[F].join("").trim()==="":Q[F].length===1&&Q[F][0].length===0),wt==="greedy"&&vt){for(var q=[],lt=0;lt<j;lt++){var rt=et?B[lt]:lt;q.push(Q[F][rt])}K=q.join("").trim()===""}if(!K){for(var ht=0;ht<j;ht++){0<ht&&!J&&(dt+=I);var bt=vt&&et?B[ht]:ht;dt+=X(Q[F][bt],ht)}F<Q.length-1&&(!wt||0<j&&!J)&&(dt+=Y)}}return dt}function X(B,Q){if(B==null)return"";if(B.constructor===Date)return JSON.stringify(B).slice(1,25);var wt=!1;st&&typeof B=="string"&&st.test(B)&&(B="'"+B,wt=!0);var dt=B.toString().replace($,W);return(wt=wt||C===!0||typeof C=="function"&&C(B,Q)||Array.isArray(C)&&C[Q]||function(vt,et){for(var At=0;At<et.length;At++)if(-1<vt.indexOf(et[At]))return!0;return!1}(dt,l.BAD_DELIMITERS)||-1<dt.indexOf(I)||dt.charAt(0)===" "||dt.charAt(dt.length-1)===" ")?L+dt+L:dt}}};if(l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
|
|
35
|
+
`,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!s&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=M,l.ParserHandle=y,l.NetworkStreamer=d,l.FileStreamer=f,l.StringStreamer=g,l.ReadableStreamStreamer=p,i.jQuery){var c=i.jQuery;c.fn.parse=function(_){var b=_.config||{},C=[];return this.each(function(Y){if(!(c(this).prop("tagName").toUpperCase()==="INPUT"&&c(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var L=0;L<this.files.length;L++)C.push({file:this.files[L],inputElem:this,instanceConfig:c.extend({},b)})}),R(),this;function R(){if(C.length!==0){var Y,L,W,U,H=C[0];if(O(_.before)){var st=_.before(H.file,H.inputElem);if(typeof st=="object"){if(st.action==="abort")return Y="AbortError",L=H.file,W=H.inputElem,U=st.reason,void(O(_.error)&&_.error({name:Y},L,W,U));if(st.action==="skip")return void I();typeof st.config=="object"&&(H.instanceConfig=c.extend(H.instanceConfig,st.config))}else if(st==="skip")return void I()}var $=H.instanceConfig.complete;H.instanceConfig.complete=function(tt){O($)&&$(tt,H.file,H.inputElem),I()},l.parse(H.file,H.instanceConfig)}else O(_.complete)&&_.complete()}function I(){C.splice(0,1),R()}}}function u(_){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(b){var C=T(b);C.chunkSize=parseInt(C.chunkSize),b.step||b.chunk||(C.chunkSize=null),this._handle=new y(C),(this._handle.streamer=this)._config=C}).call(this,_),this.parseChunk=function(b,C){if(this.isFirstChunk&&O(this._config.beforeFirstChunk)){var R=this._config.beforeFirstChunk(b);R!==void 0&&(b=R)}this.isFirstChunk=!1,this._halted=!1;var I=this._partialLine+b;this._partialLine="";var Y=this._handle.parse(I,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var L=Y.meta.cursor;this._finished||(this._partialLine=I.substring(L-this._baseIndex),this._baseIndex=L),Y&&Y.data&&(this._rowCount+=Y.data.length);var W=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)i.postMessage({results:Y,workerId:l.WORKER_ID,finished:W});else if(O(this._config.chunk)&&!C){if(this._config.chunk(Y,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);Y=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(Y.data),this._completeResults.errors=this._completeResults.errors.concat(Y.errors),this._completeResults.meta=Y.meta),this._completed||!W||!O(this._config.complete)||Y&&Y.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),W||Y&&Y.meta.paused||this._nextChunk(),Y}this._halted=!0},this._sendError=function(b){O(this._config.error)?this._config.error(b):r&&this._config.error&&i.postMessage({workerId:l.WORKER_ID,error:b,finished:!1})}}function d(_){var b;(_=_||{}).chunkSize||(_.chunkSize=l.RemoteChunkSize),u.call(this,_),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(C){this._input=C,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(b=new XMLHttpRequest,this._config.withCredentials&&(b.withCredentials=this._config.withCredentials),s||(b.onload=A(this._chunkLoaded,this),b.onerror=A(this._chunkError,this)),b.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var C=this._config.downloadRequestHeaders;for(var R in C)b.setRequestHeader(R,C[R])}if(this._config.chunkSize){var I=this._start+this._config.chunkSize-1;b.setRequestHeader("Range","bytes="+this._start+"-"+I)}try{b.send(this._config.downloadRequestBody)}catch(Y){this._chunkError(Y.message)}s&&b.status===0&&this._chunkError()}},this._chunkLoaded=function(){b.readyState===4&&(b.status<200||400<=b.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:b.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(C){var R=C.getResponseHeader("Content-Range");return R===null?-1:parseInt(R.substring(R.lastIndexOf("/")+1))}(b),this.parseChunk(b.responseText)))},this._chunkError=function(C){var R=b.statusText||C;this._sendError(new Error(R))}}function f(_){var b,C;(_=_||{}).chunkSize||(_.chunkSize=l.LocalChunkSize),u.call(this,_);var R=typeof FileReader<"u";this.stream=function(I){this._input=I,C=I.slice||I.webkitSlice||I.mozSlice,R?((b=new FileReader).onload=A(this._chunkLoaded,this),b.onerror=A(this._chunkError,this)):b=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var I=this._input;if(this._config.chunkSize){var Y=Math.min(this._start+this._config.chunkSize,this._input.size);I=C.call(I,this._start,Y)}var L=b.readAsText(I,this._config.encoding);R||this._chunkLoaded({target:{result:L}})},this._chunkLoaded=function(I){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(I.target.result)},this._chunkError=function(){this._sendError(b.error)}}function g(_){var b;u.call(this,_=_||{}),this.stream=function(C){return b=C,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var C,R=this._config.chunkSize;return R?(C=b.substring(0,R),b=b.substring(R)):(C=b,b=""),this._finished=!b,this.parseChunk(C)}}}function p(_){u.call(this,_=_||{});var b=[],C=!0,R=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(I){this._input=I,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){R&&b.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),b.length?this.parseChunk(b.shift()):C=!0},this._streamData=A(function(I){try{b.push(typeof I=="string"?I:I.toString(this._config.encoding)),C&&(C=!1,this._checkIsFinished(),this.parseChunk(b.shift()))}catch(Y){this._streamError(Y)}},this),this._streamError=A(function(I){this._streamCleanUp(),this._sendError(I)},this),this._streamEnd=A(function(){this._streamCleanUp(),R=!0,this._streamData("")},this),this._streamCleanUp=A(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(_){var b,C,R,I=Math.pow(2,53),Y=-I,L=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,W=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,U=this,H=0,st=0,$=!1,tt=!1,X=[],B={data:[],errors:[],meta:{}};if(O(_.step)){var Q=_.step;_.step=function(F){if(B=F,vt())dt();else{if(dt(),B.data.length===0)return;H+=F.data.length,_.preview&&H>_.preview?C.abort():(B.data=B.data[0],Q(B,U))}}}function wt(F){return _.skipEmptyLines==="greedy"?F.join("").trim()==="":F.length===1&&F[0].length===0}function dt(){return B&&R&&(At("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),R=!1),_.skipEmptyLines&&(B.data=B.data.filter(function(F){return!wt(F)})),vt()&&function(){if(!B)return;function F(K,J){O(_.transformHeader)&&(K=_.transformHeader(K,J)),X.push(K)}if(Array.isArray(B.data[0])){for(var j=0;vt()&&j<B.data.length;j++)B.data[j].forEach(F);B.data.splice(0,1)}else B.data.forEach(F)}(),function(){if(!B||!_.header&&!_.dynamicTyping&&!_.transform)return B;function F(K,J){var q,lt=_.header?{}:[];for(q=0;q<K.length;q++){var rt=q,ht=K[q];_.header&&(rt=q>=X.length?"__parsed_extra":X[q]),_.transform&&(ht=_.transform(ht,rt)),ht=et(rt,ht),rt==="__parsed_extra"?(lt[rt]=lt[rt]||[],lt[rt].push(ht)):lt[rt]=ht}return _.header&&(q>X.length?At("FieldMismatch","TooManyFields","Too many fields: expected "+X.length+" fields but parsed "+q,st+J):q<X.length&&At("FieldMismatch","TooFewFields","Too few fields: expected "+X.length+" fields but parsed "+q,st+J)),lt}var j=1;return!B.data.length||Array.isArray(B.data[0])?(B.data=B.data.map(F),j=B.data.length):B.data=F(B.data,0),_.header&&B.meta&&(B.meta.fields=X),st+=j,B}()}function vt(){return _.header&&X.length===0}function et(F,j){return K=F,_.dynamicTypingFunction&&_.dynamicTyping[K]===void 0&&(_.dynamicTyping[K]=_.dynamicTypingFunction(K)),(_.dynamicTyping[K]||_.dynamicTyping)===!0?j==="true"||j==="TRUE"||j!=="false"&&j!=="FALSE"&&(function(J){if(L.test(J)){var q=parseFloat(J);if(Y<q&&q<I)return!0}return!1}(j)?parseFloat(j):W.test(j)?new Date(j):j===""?null:j):j;var K}function At(F,j,K,J){var q={type:F,code:j,message:K};J!==void 0&&(q.row=J),B.errors.push(q)}this.parse=function(F,j,K){var J=_.quoteChar||'"';if(_.newline||(_.newline=function(rt,ht){rt=rt.substring(0,1048576);var bt=new RegExp(x(ht)+"([^]*?)"+x(ht),"gm"),Jt=(rt=rt.replace(bt,"")).split("\r"),ue=rt.split(`
|
|
36
36
|
`),qt=1<ue.length&&ue[0].length<Jt[0].length;if(Jt.length===1||qt)return`
|
|
37
37
|
`;for(var Ht=0,_t=0;_t<Jt.length;_t++)Jt[_t][0]===`
|
|
38
38
|
`&&Ht++;return Ht>=Jt.length/2?`\r
|
|
39
|
-
`:"\r"}(F,J)),
|
|
40
|
-
`&&
|
|
41
|
-
`&&(
|
|
42
|
-
`);var H=0,
|
|
43
|
-
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const d=new Blob([u],{type:"text/csv;charset="+i.encoding});JS.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,eT))}}),iT=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,s)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(nT,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),sT={class:"kong-ui-public-csv-export-modal"},rT={key:0,class:"selected-range"},oT={key:1,class:"text-muted",tag:"span"},ug=3,aT=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=gt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=h.ref(!0),a=h.computed(()=>{var y,x;return!!((x=(y=i.chartData)==null?void 0:y.data)!=null&&x.length)}),l=h.ref(1),c=h.computed(()=>g.value.rows.length),u=gt.useChartSelectedRange(h.toRef(i,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ug,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{s("toggleModal",!1)},g=h.computed(()=>{var T,
|
|
39
|
+
`:"\r"}(F,J)),R=!1,_.delimiter)O(_.delimiter)&&(_.delimiter=_.delimiter(F),B.meta.delimiter=_.delimiter);else{var q=function(rt,ht,bt,Jt,ue){var qt,Ht,_t,Pt;ue=ue||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Wt=0;Wt<ue.length;Wt++){var mt=ue[Wt],Ge=0,_e=0,de=0;_t=void 0;for(var he=new M({comments:Jt,delimiter:mt,newline:ht,preview:10}).parse(rt),De=0;De<he.data.length;De++)if(bt&&wt(he.data[De]))de++;else{var Se=he.data[De].length;_e+=Se,_t!==void 0?0<Se&&(Ge+=Math.abs(Se-_t),_t=Se):_t=Se}0<he.data.length&&(_e/=he.data.length-de),(Ht===void 0||Ge<=Ht)&&(Pt===void 0||Pt<_e)&&1.99<_e&&(Ht=Ge,qt=mt,Pt=_e)}return{successful:!!(_.delimiter=qt),bestDelimiter:qt}}(F,_.newline,_.skipEmptyLines,_.comments,_.delimitersToGuess);q.successful?_.delimiter=q.bestDelimiter:(R=!0,_.delimiter=l.DefaultDelimiter),B.meta.delimiter=_.delimiter}var lt=T(_);return _.preview&&_.header&<.preview++,b=F,C=new M(lt),B=C.parse(b,j,K),dt(),$?{meta:{paused:!0}}:B||{meta:{paused:!1}}},this.paused=function(){return $},this.pause=function(){$=!0,C.abort(),b=O(_.chunk)?"":b.substring(C.getCharIndex())},this.resume=function(){U.streamer._halted?($=!1,U.streamer.parseChunk(b,!0)):setTimeout(U.resume,3)},this.aborted=function(){return tt},this.abort=function(){tt=!0,C.abort(),B.meta.aborted=!0,O(_.complete)&&_.complete(B),b=""}}function x(_){return _.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(_){var b,C=(_=_||{}).delimiter,R=_.newline,I=_.comments,Y=_.step,L=_.preview,W=_.fastMode,U=b=_.quoteChar===void 0||_.quoteChar===null?'"':_.quoteChar;if(_.escapeChar!==void 0&&(U=_.escapeChar),(typeof C!="string"||-1<l.BAD_DELIMITERS.indexOf(C))&&(C=","),I===C)throw new Error("Comment character same as delimiter");I===!0?I="#":(typeof I!="string"||-1<l.BAD_DELIMITERS.indexOf(I))&&(I=!1),R!==`
|
|
40
|
+
`&&R!=="\r"&&R!==`\r
|
|
41
|
+
`&&(R=`
|
|
42
|
+
`);var H=0,st=!1;this.parse=function($,tt,X){if(typeof $!="string")throw new Error("Input must be a string");var B=$.length,Q=C.length,wt=R.length,dt=I.length,vt=O(Y),et=[],At=[],F=[],j=H=0;if(!$)return Lt();if(_.header&&!tt){var K=$.split(R)[0].split(C),J=[],q={},lt=!1;for(var rt in K){var ht=K[rt];O(_.transformHeader)&&(ht=_.transformHeader(ht,rt));var bt=ht,Jt=q[ht]||0;for(0<Jt&&(lt=!0,bt=ht+"_"+Jt),q[ht]=Jt+1;J.includes(bt);)bt=bt+"_"+Jt;J.push(bt)}if(lt){var ue=$.split(R);ue[0]=J.join(C),$=ue.join(R)}}if(W||W!==!1&&$.indexOf(b)===-1){for(var qt=$.split(R),Ht=0;Ht<qt.length;Ht++){if(F=qt[Ht],H+=F.length,Ht!==qt.length-1)H+=R.length;else if(X)return Lt();if(!I||F.substring(0,dt)!==I){if(vt){if(et=[],de(F.split(C)),Te(),st)return Lt()}else de(F.split(C));if(L&&L<=Ht)return et=et.slice(0,L),Lt(!0)}}return Lt()}for(var _t=$.indexOf(C,H),Pt=$.indexOf(R,H),Wt=new RegExp(x(U)+x(b),"g"),mt=$.indexOf(b,H);;)if($[H]!==b)if(I&&F.length===0&&$.substring(H,H+dt)===I){if(Pt===-1)return Lt();H=Pt+wt,Pt=$.indexOf(R,H),_t=$.indexOf(C,H)}else if(_t!==-1&&(_t<Pt||Pt===-1))F.push($.substring(H,_t)),H=_t+Q,_t=$.indexOf(C,H);else{if(Pt===-1)break;if(F.push($.substring(H,Pt)),Se(Pt+wt),vt&&(Te(),st))return Lt();if(L&&et.length>=L)return Lt(!0)}else for(mt=H,H++;;){if((mt=$.indexOf(b,mt+1))===-1)return X||At.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:et.length,index:H}),De();if(mt===B-1)return De($.substring(H,mt).replace(Wt,b));if(b!==U||$[mt+1]!==U){if(b===U||mt===0||$[mt-1]!==U){_t!==-1&&_t<mt+1&&(_t=$.indexOf(C,mt+1)),Pt!==-1&&Pt<mt+1&&(Pt=$.indexOf(R,mt+1));var Ge=he(Pt===-1?_t:Math.min(_t,Pt));if($.substr(mt+1+Ge,Q)===C){F.push($.substring(H,mt).replace(Wt,b)),$[H=mt+1+Ge+Q]!==b&&(mt=$.indexOf(b,H)),_t=$.indexOf(C,H),Pt=$.indexOf(R,H);break}var _e=he(Pt);if($.substring(mt+1+_e,mt+1+_e+wt)===R){if(F.push($.substring(H,mt).replace(Wt,b)),Se(mt+1+_e+wt),_t=$.indexOf(C,H),mt=$.indexOf(b,H),vt&&(Te(),st))return Lt();if(L&&et.length>=L)return Lt(!0);break}At.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:et.length,index:H}),mt++}}else mt++}return De();function de(ne){et.push(ne),j=H}function he(ne){var si=0;if(ne!==-1){var Rn=$.substring(mt+1,ne);Rn&&Rn.trim()===""&&(si=Rn.length)}return si}function De(ne){return X||(ne===void 0&&(ne=$.substring(H)),F.push(ne),H=B,de(F),vt&&Te()),Lt()}function Se(ne){H=ne,de(F),F=[],Pt=$.indexOf(R,H)}function Lt(ne){return{data:et,errors:At,meta:{delimiter:C,linebreak:R,aborted:st,truncated:!!ne,cursor:j+(tt||0)}}}function Te(){Y(Lt()),et=[],At=[]}},this.abort=function(){st=!0},this.getCharIndex=function(){return H}}function v(_){var b=_.data,C=o[b.workerId],R=!1;if(b.error)C.userError(b.error,b.file);else if(b.results&&b.results.data){var I={abort:function(){R=!0,D(b.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(O(C.userStep)){for(var Y=0;Y<b.results.data.length&&(C.userStep({data:b.results.data[Y],errors:b.results.errors,meta:b.results.meta},I),!R);Y++);delete b.results}else O(C.userChunk)&&(C.userChunk(b.results,I,b.file),delete b.results)}b.finished&&!R&&D(b.workerId,b.results)}function D(_,b){var C=o[_];O(C.userComplete)&&C.userComplete(b),C.terminate(),delete o[_]}function S(){throw new Error("Not implemented.")}function T(_){if(typeof _!="object"||_===null)return _;var b=Array.isArray(_)?[]:{};for(var C in _)b[C]=T(_[C]);return b}function A(_,b){return function(){_.apply(b,arguments)}}function O(_){return typeof _=="function"}return r&&(i.onmessage=function(_){var b=_.data;if(l.WORKER_ID===void 0&&b&&(l.WORKER_ID=b.workerId),typeof b.input=="string")i.postMessage({workerId:l.WORKER_ID,results:l.parse(b.input,b.config),finished:!0});else if(i.File&&b.input instanceof File||b.input instanceof Object){var C=l.parse(b.input,b.config);C&&i.postMessage({workerId:l.WORKER_ID,results:C,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(f.prototype=Object.create(u.prototype)).constructor=f,(g.prototype=Object.create(g.prototype)).constructor=g,(p.prototype=Object.create(u.prototype)).constructor=p,l})})(cg);var tT=cg.exports;const eT=["id"],nT=h.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,s=h.computed(()=>`export_${new Date().getTime()}`),r=h.computed(()=>{const u=l();return u.length?u:null}),o=()=>{const u=i.labels;if(typeof i.fields!==ii.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ii.Object?d=>vS(d,(f,g)=>u[g]||g):d=>d},a=()=>{const u=i.fields;if(typeof i.fields!==ii.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>QS(d,u):d=>d},l=()=>{if(typeof i.fields===ii.Undefined&&typeof i.labels===ii.Undefined)return i.data;const u=o(),d=a();return i.data.map(f=>u(d(f)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=tT.unparse(r.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
|
|
43
|
+
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const d=new Blob([u],{type:"text/csv;charset="+i.encoding});JS.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,eT))}}),iT=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,s)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(nT,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),sT={class:"kong-ui-public-csv-export-modal"},rT={key:0,class:"selected-range"},oT={key:1,class:"text-muted",tag:"span"},ug=3,aT=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=gt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=h.ref(!0),a=h.computed(()=>{var y,x;return!!((x=(y=i.chartData)==null?void 0:y.data)!=null&&x.length)}),l=h.ref(1),c=h.computed(()=>g.value.rows.length),u=gt.useChartSelectedRange(h.toRef(i,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ug,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{s("toggleModal",!1)},g=h.computed(()=>{var T,A,O;if(!a.value||!((T=i.chartData)!=null&&T.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const y=i.chartData.data.some(_=>_.timestamp!==i.chartData.data[0].timestamp),x=i.chartData.data.map(_=>{const b=new Date(_.timestamp);return{...Object.keys(_.event).reduce((R,I)=>{if(I in i.chartData.meta.display){const Y=_.event[I],L=i.chartData.meta.display[I];R[I]=Y&&L&&L[Y].name||_.event[I]}else R[I]=_.event[I];return R},{}),...y?{timestamp:Fa(b,"yyyy-MM-dd HH:mm:ss"),tzOffset:Fa(b,"XXX")}:{}}});let M=[];y&&(M=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const v="display"in i.chartData.meta&&((A=i.chartData.meta)!=null&&A.display)?(O=i.chartData.meta)==null?void 0:O.display:{},D=[...M,...Object.keys(v).map(_=>({label:e.t(`chartLabels.${_}`),key:_})),...i.chartData.meta.metric_names.map(_=>({label:e.t(`chartLabels.${_}`),key:_}))],S=D.reduce((_,b)=>(_[b.key]=b.label,_),{});return{headers:D,csvHeaders:S,rows:x}}),p=async()=>{const{rows:y}=g.value;return o.value=!1,{total:Number(y.length)||0,data:y.slice(0,ug)}};return h.watch(g,()=>{l.value++}),(y,x)=>{const M=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KTableData"),D=h.resolveComponent("KButton"),S=h.resolveComponent("KModal");return h.openBlock(),h.createElementBlock("div",sT,[h.createVNode(S,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:h.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:f,onKeyup:h.withKeys(f,["esc"])},{default:h.withCtx(()=>{var T;return[h.createElementVNode("div",null,[a.value?(h.openBlock(),h.createElementBlock("div",rT,[h.createElementVNode("p",null,h.toDisplayString(y.modalDescription?y.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(h.unref(u)),1)])):h.createCommentVNode("",!0),h.createVNode(v,{class:"vitals-table",fetcher:p,"fetcher-cache-key":String(l.value),headers:((T=g.value)==null?void 0:T.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":h.withCtx(()=>[h.createVNode(M,{"action-button-visible":!1},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),default:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!o.value&&a.value?(h.openBlock(),h.createElementBlock("div",oT,h.toDisplayString(d.value),1)):h.createCommentVNode("",!0)])]}),"footer-actions":h.withCtx(()=>[h.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(iT,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:h.withCtx(()=>[h.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:o.value||!a.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});nt.AnalyticsChart=KD,nt.ChartLegendPosition=Ft,nt.CsvExportModal=aT,nt.DECIMAL_DISPLAY=iw,nt.EMPTY_COLOR=nh,nt.FONT_SIZE_REGULAR=Zd,nt.FONT_SIZE_SMALL=Kd,nt.MAX_LABEL_LENGTH=Ar,nt.OTHERS_COLOR=lw,nt.SimpleChart=lS,nt.TopNTable=xS,nt.ValidType=ii,nt.accessibleGrey=th,nt.apiRequestStatusCodeColors=eh,nt.chartTypes=YD,nt.codesInSpec=oh,nt.darkenColor=Jd,nt.datavisPalette=on,nt.defaultStatusCodeColors=Ir,nt.determineBaseColor=Da,nt.errorRateColors=ow,nt.latencyColors=aw,nt.lightGrey=Ca,nt.lookupColor=cw,nt.lookupDatavisColor=Rr,nt.lookupStatusCodeCategoryColor=mw,nt.lookupStatusCodeColor=Pa,nt.numberFormatter=ka,nt.simpleChartMetricDisplay=WD,nt.simpleChartTypes=jD,nt.statusCodeBadgeBackgroundColor=sw,nt.trafficColors=rw,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});
|