@stigg/embed-sdk 7.1.0 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (window.webpackJsonpStigg=window.webpackJsonpStigg||[]).push([[1],{582:function(t,e,i){var n=i(43),r=i(583),s=i(274),a=Math.max,o=Math.min;t.exports=function(t,e,i){var l,h,d,c,u,f,g=0,p=!1,x=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function b(e){var i=l,n=h;return l=h=void 0,g=e,c=t.apply(n,i)}function y(t){return g=t,u=setTimeout(_,e),p?b(t):c}function v(t){var i=t-f;return void 0===f||i>=e||i<0||x&&t-g>=d}function _(){var t=r();if(v(t))return w(t);u=setTimeout(_,function(t){var i=e-(t-f);return x?o(i,d-(t-g)):i}(t))}function w(t){return u=void 0,m&&l?b(t):(l=h=void 0,c)}function M(){var t=r(),i=v(t);if(l=arguments,h=this,f=t,i){if(void 0===u)return y(f);if(x)return clearTimeout(u),u=setTimeout(_,e),b(f)}return void 0===u&&(u=setTimeout(_,e)),c}return e=s(e)||0,n(i)&&(p=!!i.leading,d=(x="maxWait"in i)?a(s(i.maxWait)||0,e):d,m="trailing"in i?!!i.trailing:m),M.cancel=function(){void 0!==u&&clearTimeout(u),g=0,l=f=h=u=void 0},M.flush=function(){return void 0===u?c:w(r())},M}},583:function(t,e,i){var n=i(42);t.exports=function(){return n.Date.now()}},585:function(t,e,i){"use strict";i.r(e),i.d(e,"CreditUsageChart",(function(){return Yh}));var n=i(2),r=i(0),s=i.n(r),a=i(6),o=i(133),l=i.n(o),h=i(581),d=i(582),c=i.n(d),u=i(1),f=i(18),g=i(576),p=i(580),x=i(574);function m(){}var b=function(){let t=0;return function(){return t++}}();function y(t){return null==t}function v(t){if(Array.isArray&&Array.isArray(t))return!0;let e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function _(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}var w=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function M(t,e){return w(t)?t:e}function k(t,e){return void 0===t?e:t}var S=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function O(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function P(t,e,i,n){let r,s,a;if(v(t))if(s=t.length,n);else for(r=0;r<s;r++)e.call(i,t[r],r);else if(_(t))for(a=Object.keys(t),s=a.length,r=0;r<s;r++)e.call(i,t[a[r]],a[r])}function D(t,e){let i,n,r,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(r=t[i],s=e[i],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function C(t){if(v(t))return t.map(C);if(_(t)){let e=Object.create(null),i=Object.keys(t),n=i.length,r=0;for(;r<n;++r)e[i[r]]=C(t[i[r]]);return e}return t}function A(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function T(t,e,i,n){if(!A(t))return;let r=e[t],s=i[t];_(r)&&_(s)?j(r,s,n):e[t]=C(s)}function j(t,e,i){let n=v(e)?e:[e],r=n.length;if(!_(t))return t;let s=(i=i||{}).merger||T;for(let a=0;a<r;++a){if(!_(e=n[a]))continue;let r=Object.keys(e);for(let n=0,a=r.length;n<a;++n)s(r[n],t,e,i)}return t}function I(t,e){return j(t,e,{merger:R})}function R(t,e,i){if(!A(t))return;let n=e[t],r=i[t];_(n)&&_(r)?I(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=C(r))}var E={"":t=>t,x:t=>t.x,y:t=>t.y};function L(t,e){return(E[e]||(E[e]=function(t){let e=function(t){let e=t.split("."),i=[],n="";for(let t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(let i of e){if(""===i)break;t=t&&t[i]}return t}}(e)))(t)}function z(t){return t.charAt(0).toUpperCase()+t.slice(1)}var F=t=>void 0!==t,W=t=>"function"==typeof t,N=(t,e)=>{if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0};var V=Math.PI,B=2*V,H=B+V,Y=Number.POSITIVE_INFINITY,$=V/180,X=V/2,U=V/4,q=2*V/3,K=Math.log10,G=Math.sign;function J(t){let e=Math.round(t);t=Q(t,e,t/1e3)?e:t;let i=Math.pow(10,Math.floor(K(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function Z(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Q(t,e,i){return Math.abs(t-e)<i}function tt(t,e,i){let n,r,s;for(n=0,r=t.length;n<r;n++)s=t[n][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function et(t){return t*(V/180)}function it(t){return t*(180/V)}function nt(t){if(!w(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function rt(t,e){let i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n),s=Math.atan2(n,i);return s<-.5*V&&(s+=B),{angle:s,distance:r}}function st(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function at(t,e){return(t-e+H)%B-V}function ot(t){return(t%B+B)%B}function lt(t,e,i,n){let r=ot(t),s=ot(e),a=ot(i),o=ot(s-r),l=ot(a-r),h=ot(r-s),d=ot(r-a);return r===s||r===a||n&&s===a||o>l&&h<d}function ht(t,e,i){return Math.max(e,Math.min(i,t))}function dt(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function ct(t,e,i){i=i||(i=>t[i]<e);let n,r=t.length-1,s=0;for(;r-s>1;)n=s+r>>1,i(n)?s=n:r=n;return{lo:s,hi:r}}var ut=(t,e,i,n)=>ct(t,i,n?n=>t[n][e]<=i:n=>t[n][e]<i),ft=(t,e,i)=>ct(t,i,n=>t[n][e]>=i);var gt=["push","pop","shift","splice","unshift"];function pt(t,e){let i=t._chartjs;if(!i)return;let n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),!(n.length>0)&&(gt.forEach(e=>{delete t[e]}),delete t._chartjs)}function xt(t){let e,i,n=new Set;for(e=0,i=t.length;e<i;++e)n.add(t[e]);return n.size===i?t:Array.from(n)}var mt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function bt(t,e,i){let n=i||(t=>Array.prototype.slice.call(t)),r=!1,s=[];return function(...i){s=n(i),r||(r=!0,mt.call(window,()=>{r=!1,t.apply(e,s)}))}}var yt=t=>"start"===t?"left":"end"===t?"right":"center",vt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function _t(t,e,i){let n=e.length,r=0,s=n;if(t._sorted){let{iScale:a,_parsed:o}=t,l=a.axis,{min:h,max:d,minDefined:c,maxDefined:u}=a.getUserBounds();c&&(r=ht(Math.min(ut(o,a.axis,h).lo,i?n:ut(e,l,a.getPixelForValue(h)).lo),0,n-1)),s=u?ht(Math.max(ut(o,a.axis,d,!0).hi+1,i?0:ut(e,l,a.getPixelForValue(d),!0).hi+1),r,n)-r:n-r}return{start:r,count:s}}function wt(t){let{xScale:e,yScale:i,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;let s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),s}var Mt=t=>0===t||1===t,kt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*B/i),St=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*B/i)+1,Ot={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*X),easeOutSine:t=>Math.sin(t*X),easeInOutSine:t=>-.5*(Math.cos(V*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Mt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Mt(t)?t:kt(t,.075,.3),easeOutElastic:t=>Mt(t)?t:St(t,.075,.3),easeInOutElastic:t=>Mt(t)?t:t<.5?.5*kt(2*t,.1125,.45):.5+.5*St(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Ot.easeOutBounce(1-t),easeOutBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,easeInOutBounce:t=>t<.5?.5*Ot.easeInBounce(2*t):.5*Ot.easeOutBounce(2*t-1)+.5};function Pt(t){return t+.5|0}var Dt=(t,e,i)=>Math.max(Math.min(t,i),e);function Ct(t){return Dt(Pt(2.55*t),0,255)}function At(t){return Dt(Pt(255*t),0,255)}function Tt(t){return Dt(Pt(t/2.55)/100,0,1)}function jt(t){return Dt(Pt(100*t),0,100)}var It={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},Rt=[..."0123456789ABCDEF"],Et=t=>Rt[15&t],Lt=t=>Rt[(240&t)>>4]+Rt[15&t],zt=t=>(240&t)>>4==(15&t);function Ft(t){var e=(t=>zt(t.r)&&zt(t.g)&&zt(t.b)&&zt(t.a))(t)?Et:Lt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}var Wt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Nt(t,e,i){let n=e*Math.min(i,1-i),r=(e,r=(e+t/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function Vt(t,e,i){let n=(n,r=(n+t/60)%6)=>i-i*e*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function Bt(t,e,i){let n,r=Nt(t,1,.5);for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)r[n]*=1-e-i,r[n]+=e;return r}function Ht(t){let e,i,n,r=t.r/255,s=t.g/255,a=t.b/255,o=Math.max(r,s,a),l=Math.min(r,s,a),h=(o+l)/2;return o!==l&&(n=o-l,i=h>.5?n/(2-o-l):n/(o+l),e=function(t,e,i,n,r){return t===r?(e-i)/n+(e<i?6:0):e===r?(i-t)/n+2:(t-e)/n+4}(r,s,a,n,o),e=60*e+.5),[0|e,i||0,h]}function Yt(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(At)}function $t(t,e,i){return Yt(Nt,t,e,i)}function Xt(t){return(t%360+360)%360}function Ut(t){let e,i=Wt.exec(t),n=255;if(!i)return;i[5]!==e&&(n=i[6]?Ct(+i[5]):At(+i[5]));let r=Xt(+i[2]),s=+i[3]/100,a=+i[4]/100;return e="hwb"===i[1]?function(t,e,i){return Yt(Bt,t,e,i)}(r,s,a):"hsv"===i[1]?function(t,e,i){return Yt(Vt,t,e,i)}(r,s,a):$t(r,s,a),{r:e[0],g:e[1],b:e[2],a:n}}var qt,Kt={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"},Gt={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 Jt(t){qt||((qt=function(){let t,e,i,n,r,s={},a=Object.keys(Gt),o=Object.keys(Kt);for(t=0;t<a.length;t++){for(n=r=a[t],e=0;e<o.length;e++)i=o[e],r=r.replace(i,Kt[i]);i=parseInt(Gt[n],16),s[r]=[i>>16&255,i>>8&255,255&i]}return s}()).transparent=[0,0,0,0]);let e=qt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}var Zt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;var Qt=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,te=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function ee(t,e,i){if(t){let n=Ht(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=$t(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function ie(t,e){return t&&Object.assign(e||{},t)}function ne(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=At(t[3]))):(e=ie(t,{r:0,g:0,b:0,a:1})).a=At(e.a),e}function re(t){return"r"===t.charAt(0)?function(t){let e,i,n,r=Zt.exec(t),s=255;if(r){if(r[7]!==e){let t=+r[7];s=r[8]?Ct(t):Dt(255*t,0,255)}return e=+r[1],i=+r[3],n=+r[5],e=255&(r[2]?Ct(e):Dt(e,0,255)),i=255&(r[4]?Ct(i):Dt(i,0,255)),n=255&(r[6]?Ct(n):Dt(n,0,255)),{r:e,g:i,b:n,a:s}}}(t):Ut(t)}function se(t){return new class t{constructor(e){if(e instanceof t)return e;let i,n=typeof e;"object"===n?i=ne(e):"string"===n&&(i=function(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*It[t[1]],g:255&17*It[t[2]],b:255&17*It[t[3]],a:5===i?17*It[t[4]]:255}:(7===i||9===i)&&(e={r:It[t[1]]<<4|It[t[2]],g:It[t[3]]<<4|It[t[4]],b:It[t[5]]<<4|It[t[6]],a:9===i?It[t[7]]<<4|It[t[8]]:255})),e}(e)||Jt(e)||re(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ie(this._rgb);return t&&(t.a=Tt(t.a)),t}set rgb(t){this._rgb=ne(t)}rgbString(){return this._valid?function(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Tt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}(this._rgb):void 0}hexString(){return this._valid?Ft(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=Ht(t),i=e[0],n=jt(e[1]),r=jt(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${r}%, ${Tt(t.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){let i,n=this.rgb,r=t.rgb,s=e===i?.5:e,a=2*s-1,o=n.a-r.a,l=((a*o==-1?a:(a+o)/(1+a*o))+1)/2;i=1-l,n.r=255&l*n.r+i*r.r+.5,n.g=255&l*n.g+i*r.g+.5,n.b=255&l*n.b+i*r.b+.5,n.a=s*n.a+(1-s)*r.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){let n=te(Tt(t.r)),r=te(Tt(t.g)),s=te(Tt(t.b));return{r:At(Qt(n+i*(te(Tt(e.r))-n))),g:At(Qt(r+i*(te(Tt(e.g))-r))),b:At(Qt(s+i*(te(Tt(e.b))-s))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new t(this.rgb)}alpha(t){return this._rgb.a=At(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){let t=this._rgb,e=Pt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ee(this._rgb,2,t),this}darken(t){return ee(this._rgb,2,-t),this}saturate(t){return ee(this._rgb,1,t),this}desaturate(t){return ee(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Ht(t);i[0]=Xt(i[0]+e),i=$t(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}(t)}function ae(t){if(t&&"object"==typeof t){let e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function oe(t){return ae(t)?t:se(t)}function le(t){return ae(t)?t:se(t).saturate(.5).darken(.1).hexString()}var he=Object.create(null),de=Object.create(null);function ce(t,e){if(!e)return t;let i=e.split(".");for(let e=0,n=i.length;e<n;++e){let n=i[e];t=t[n]||(t[n]=Object.create(null))}return t}function ue(t,e,i){return"string"==typeof e?j(ce(t,e),i):j(ce(t,""),e)}var fe=new class{constructor(t){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=t=>t.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=(t,e)=>le(e.backgroundColor),this.hoverBorderColor=(t,e)=>le(e.borderColor),this.hoverColor=(t,e)=>le(e.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)}set(t,e){return ue(this,t,e)}get(t){return ce(this,t)}describe(t,e){return ue(de,t,e)}override(t,e){return ue(he,t,e)}route(t,e,i,n){let r=ce(this,t),s=ce(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){let t=this[a],e=s[n];return _(t)?Object.assign({},e,t):k(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function ge(t,e,i,n,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,i.push(r)),s>n&&(n=s),n}function pe(t,e,i,n){let r=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let a,o,l,h,d,c=0,u=i.length;for(a=0;a<u;a++)if(h=i[a],null!=h&&!0!==v(h))c=ge(t,r,s,c,h);else if(v(h))for(o=0,l=h.length;o<l;o++)d=h[o],null!=d&&!v(d)&&(c=ge(t,r,s,c,d));t.restore();let f=s.length/2;if(f>i.length){for(a=0;a<f;a++)delete r[s[a]];s.splice(0,f)}return c}function xe(t,e,i){let n=t.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((e-r)*n)/n+r}function me(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function be(t,e,i,n){ye(t,e,i,n,null)}function ye(t,e,i,n,r){let s,a,o,l,h,d,c=e.pointStyle,u=e.rotation,f=e.radius,g=(u||0)*$;if(c&&"object"==typeof c&&(s=c.toString(),"[object HTMLImageElement]"===s||"[object HTMLCanvasElement]"===s))return t.save(),t.translate(i,n),t.rotate(g),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),void t.restore();if(!(isNaN(f)||f<=0)){switch(t.beginPath(),c){default:r?t.ellipse(i,n,r/2,f,0,0,B):t.arc(i,n,f,0,B),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(g)*f,n-Math.cos(g)*f),g+=q,t.lineTo(i+Math.sin(g)*f,n-Math.cos(g)*f),g+=q,t.lineTo(i+Math.sin(g)*f,n-Math.cos(g)*f),t.closePath();break;case"rectRounded":h=.516*f,l=f-h,a=Math.cos(g+U)*l,o=Math.sin(g+U)*l,t.arc(i-a,n-o,h,g-V,g-X),t.arc(i+o,n-a,h,g-X,g),t.arc(i+a,n+o,h,g,g+X),t.arc(i-o,n+a,h,g+X,g+V),t.closePath();break;case"rect":if(!u){l=Math.SQRT1_2*f,d=r?r/2:l,t.rect(i-d,n-l,2*d,2*l);break}g+=U;case"rectRot":a=Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+o,n-a),t.lineTo(i+a,n+o),t.lineTo(i-o,n+a),t.closePath();break;case"crossRot":g+=U;case"cross":a=Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+a,n+o),t.moveTo(i+o,n-a),t.lineTo(i-o,n+a);break;case"star":a=Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+a,n+o),t.moveTo(i+o,n-a),t.lineTo(i-o,n+a),g+=U,a=Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+a,n+o),t.moveTo(i+o,n-a),t.lineTo(i-o,n+a);break;case"line":a=r?r/2:Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+a,n+o);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(g)*f,n+Math.sin(g)*f)}t.fill(),e.borderWidth>0&&t.stroke()}}function ve(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function _e(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function we(t){t.restore()}function Me(t,e,i,n,r){if(!e)return t.lineTo(i.x,i.y);if("middle"===r){let n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===r!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function ke(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Se(t,e,i,n,r,s={}){let a,o,l=v(e)?e:[e],h=s.strokeWidth>0&&""!==s.strokeColor;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),y(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),a=0;a<l.length;++a)o=l[a],h&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),y(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(o,i,n,s.maxWidth)),t.fillText(o,i,n,s.maxWidth),Oe(t,i,n,o,s),n+=r.lineHeight;t.restore()}function Oe(t,e,i,n,r){if(r.strikethrough||r.underline){let s=t.measureText(n),a=e-s.actualBoundingBoxLeft,o=e+s.actualBoundingBoxRight,l=i-s.actualBoundingBoxAscent,h=i+s.actualBoundingBoxDescent,d=r.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(a,d),t.lineTo(o,d),t.stroke()}}function Pe(t,e){let{x:i,y:n,w:r,h:s,radius:a}=e;t.arc(i+a.topLeft,n+a.topLeft,a.topLeft,-X,V,!0),t.lineTo(i,n+s-a.bottomLeft),t.arc(i+a.bottomLeft,n+s-a.bottomLeft,a.bottomLeft,V,X,!0),t.lineTo(i+r-a.bottomRight,n+s),t.arc(i+r-a.bottomRight,n+s-a.bottomRight,a.bottomRight,X,0,!0),t.lineTo(i+r,n+a.topRight),t.arc(i+r-a.topRight,n+a.topRight,a.topRight,0,-X,!0),t.lineTo(i+a.topLeft,n)}var De=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Ce=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Ae(t,e){let i=(""+t).match(De);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}var Te=t=>+t||0;function je(t,e){let i={},n=_(e),r=n?Object.keys(e):e,s=_(t)?n?i=>k(t[i],t[e[i]]):e=>t[e]:()=>t;for(let t of r)i[t]=Te(s(t));return i}function Ie(t){return je(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Re(t){return je(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ee(t){let e=Ie(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Le(t,e){t=t||{},e=e||fe.font;let i=k(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=k(t.style,e.style);n&&!(""+n).match(Ce)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");let r={family:k(t.family,e.family),lineHeight:Ae(k(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:k(t.weight,e.weight),string:""};return r.string=function(t){return!t||y(t.size)||y(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function ze(t,e,i,n){let r,s,a;for(r=0,s=t.length;r<s;++r)if(a=t[r],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e)),void 0!==i&&v(a)&&(a=a[i%a.length]),void 0!==a))return a}function Fe(t,e){return Object.assign(Object.create(t),e)}function We(t,e=[""],i=t,n,r=(()=>t[0])){F(n)||(n=Ge("_fallback",t));let s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:r=>We([r,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Ye(i,n,()=>function(t,e,i,n){let r;for(let s of e)if(r=Ge(Be(s,t),i),F(r))return He(t,r)?qe(i,n,t,r):r}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Je(t).includes(e),ownKeys:t=>Je(t),set(t,e,i){let n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Ne(t,e,i,n){let r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ve(t,n),setContext:e=>Ne(t,e,i,n),override:r=>Ne(t.override(r),e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ye(t,e,()=>function(t,e,i){let{_proxy:n,_context:r,_subProxy:s,_descriptors:a}=t,o=n[e];return W(o)&&a.isScriptable(e)&&(o=function(t,e,i,n){let{_proxy:r,_context:s,_subProxy:a,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(s,a||n),o.delete(t),He(t,e)&&(e=qe(r._scopes,r,t,e)),e}(e,o,t,i)),v(o)&&o.length&&(o=function(t,e,i,n){let{_proxy:r,_context:s,_subProxy:a,_descriptors:o}=i;if(F(s.index)&&n(t))e=e[s.index%e.length];else if(_(e[0])){let i=e,n=r._scopes.filter(t=>t!==i);e=[];for(let l of i){let i=qe(n,r,t,l);e.push(Ne(i,s,a&&a[t],o))}}return e}(e,o,t,a.isIndexable)),He(e,o)&&(o=Ne(o,r,s&&s[e],a)),o}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Ve(t,e={scriptable:!0,indexable:!0}){let{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:i,indexable:n,isScriptable:W(i)?i:()=>i,isIndexable:W(n)?n:()=>n}}var Be=(t,e)=>t?t+z(e):e,He=(t,e)=>_(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ye(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];let n=i();return t[e]=n,n}function $e(t,e,i){return W(t)?t(e,i):t}var Xe=(t,e)=>!0===t?e:"string"==typeof t?L(e,t):void 0;function Ue(t,e,i,n,r){for(let s of e){let e=Xe(i,s);if(e){t.add(e);let s=$e(e._fallback,i,r);if(F(s)&&s!==i&&s!==n)return s}else if(!1===e&&F(n)&&i!==n)return null}return!1}function qe(t,e,i,n){let r=e._rootScopes,s=$e(e._fallback,i,n),a=[...t,...r],o=new Set;o.add(n);let l=Ke(o,a,i,s||i,n);return!(null===l||F(s)&&s!==i&&(l=Ke(o,a,s,l,n),null===l))&&We(Array.from(o),[""],r,s,()=>function(t,e,i){let n=t._getTarget();e in n||(n[e]={});let r=n[e];return v(r)&&_(i)?i:r}(e,i,n))}function Ke(t,e,i,n,r){for(;i;)i=Ue(t,e,i,n,r);return i}function Ge(t,e){for(let i of e){if(!i)continue;let e=i[t];if(F(e))return e}}function Je(t){let e=t._keys;return e||(e=t._keys=function(t){let e=new Set;for(let i of t)for(let t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Ze(t,e,i,n){let r,s,a,o,{iScale:l}=t,{key:h="r"}=this._parsing,d=new Array(n);for(r=0,s=n;r<s;++r)a=r+i,o=e[a],d[r]={r:l.parse(L(o,h),a)};return d}var Qe=Number.EPSILON||1e-14,ti=(t,e)=>e<t.length&&!t[e].skip&&t[e],ei=t=>"x"===t?"y":"x";function ii(t,e,i,n){let r=t.skip?e:t,s=e,a=i.skip?e:i,o=st(s,r),l=st(a,s),h=o/(o+l),d=l/(o+l);h=isNaN(h)?0:h,d=isNaN(d)?0:d;let c=n*h,u=n*d;return{previous:{x:s.x-c*(a.x-r.x),y:s.y-c*(a.y-r.y)},next:{x:s.x+u*(a.x-r.x),y:s.y+u*(a.y-r.y)}}}function ni(t,e="x"){let i,n,r,s=ei(e),a=t.length,o=Array(a).fill(0),l=Array(a),h=ti(t,0);for(i=0;i<a;++i)if(n=r,r=h,h=ti(t,i+1),r){if(h){let t=h[e]-r[e];o[i]=0!==t?(h[s]-r[s])/t:0}l[i]=n?h?G(o[i-1])!==G(o[i])?0:(o[i-1]+o[i])/2:o[i-1]:o[i]}(function(t,e,i){let n,r,s,a,o,l=t.length,h=ti(t,0);for(let d=0;d<l-1;++d)if(o=h,h=ti(t,d+1),o&&h){if(Q(e[d],0,Qe)){i[d]=i[d+1]=0;continue}n=i[d]/e[d],r=i[d+1]/e[d],a=Math.pow(n,2)+Math.pow(r,2),!(a<=9)&&(s=3/Math.sqrt(a),i[d]=n*s*e[d],i[d+1]=r*s*e[d])}})(t,o,l),function(t,e,i="x"){let n,r,s,a=ei(i),o=t.length,l=ti(t,0);for(let h=0;h<o;++h){if(r=s,s=l,l=ti(t,h+1),!s)continue;let o=s[i],d=s[a];r&&(n=(o-r[i])/3,s["cp1"+i]=o-n,s["cp1"+a]=d-n*e[h]),l&&(n=(l[i]-o)/3,s["cp2"+i]=o+n,s["cp2"+a]=d+n*e[h])}}(t,l,e)}function ri(t,e,i){return Math.max(Math.min(t,i),e)}function si(t,e,i,n,r){let s,a,o,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)ni(t,r);else{let i=n?t[t.length-1]:t[0];for(s=0,a=t.length;s<a;++s)o=t[s],l=ii(i,o,t[Math.min(s+1,a-(n?0:1))%a],e.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,i=o}e.capBezierPoints&&function(t,e){let i,n,r,s,a,o=ve(t[0],e);for(i=0,n=t.length;i<n;++i)a=s,s=o,o=i<n-1&&ve(t[i+1],e),s&&(r=t[i],a&&(r.cp1x=ri(r.cp1x,e.left,e.right),r.cp1y=ri(r.cp1y,e.top,e.bottom)),o&&(r.cp2x=ri(r.cp2x,e.left,e.right),r.cp2y=ri(r.cp2y,e.top,e.bottom)))}(t,i)}function ai(){return"undefined"!=typeof window&&"undefined"!=typeof document}function oi(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function li(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}var hi=t=>window.getComputedStyle(t,null);var di=["top","right","bottom","left"];function ci(t,e,i){let n={};i=i?"-"+i:"";for(let r=0;r<4;r++){let s=di[r];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function ui(t,e){if("native"in t)return t;let{canvas:i,currentDevicePixelRatio:n}=e,r=hi(i),s="border-box"===r.boxSizing,a=ci(r,"padding"),o=ci(r,"border","width"),{x:l,y:h,box:d}=function(t,e){let i,n,r=t.touches,s=r&&r.length?r[0]:t,{offsetX:a,offsetY:o}=s,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(a,o,t.target))i=a,n=o;else{let t=e.getBoundingClientRect();i=s.clientX-t.left,n=s.clientY-t.top,l=!0}return{x:i,y:n,box:l}}(t,i),c=a.left+(d&&o.left),u=a.top+(d&&o.top),{width:f,height:g}=e;return s&&(f-=a.width+o.width,g-=a.height+o.height),{x:Math.round((l-c)/f*i.width/n),y:Math.round((h-u)/g*i.height/n)}}var fi=t=>Math.round(10*t)/10;function gi(t,e,i,n){let r=hi(t),s=ci(r,"margin"),a=li(r.maxWidth,t,"clientWidth")||Y,o=li(r.maxHeight,t,"clientHeight")||Y,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){let s=oi(t);if(s){let t=s.getBoundingClientRect(),a=hi(s),o=ci(a,"border","width"),l=ci(a,"padding");e=t.width-l.width-o.width,i=t.height-l.height-o.height,n=li(a.maxWidth,s,"clientWidth"),r=li(a.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Y,maxHeight:r||Y}}(t,e,i),{width:h,height:d}=l;if("content-box"===r.boxSizing){let t=ci(r,"border","width"),e=ci(r,"padding");h-=e.width+t.width,d-=e.height+t.height}return h=Math.max(0,h-s.width),d=Math.max(0,n?Math.floor(h/n):d-s.height),h=fi(Math.min(h,a,l.maxWidth)),d=fi(Math.min(d,o,l.maxHeight)),h&&!d&&(d=fi(h/2)),{width:h,height:d}}function pi(t,e,i){let n=e||1,r=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=r/n,t.width=s/n;let a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=t.height+"px",a.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||a.height!==r||a.width!==s)&&(t.currentDevicePixelRatio=n,a.height=r,a.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}var xi=function(){let t=!1;try{let e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function mi(t,e){let i=function(t,e){return hi(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function bi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function yi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function vi(t,e,i,n){let r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},a=bi(t,r,i),o=bi(r,s,i),l=bi(s,e,i),h=bi(a,o,i),d=bi(o,l,i);return bi(h,d,i)}var _i=new Map;function wi(t,e,i){return function(t,e){e=e||{};let i=t+JSON.stringify(e),n=_i.get(i);return n||(n=new Intl.NumberFormat(t,e),_i.set(i,n)),n}(e,i).format(t)}function Mi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ki(t,e){let i,n;("ltr"===e||"rtl"===e)&&(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Si(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Oi(t){return"angle"===t?{between:lt,compare:at,normalize:ot}:{between:dt,compare:(t,e)=>t-e,normalize:t=>t}}function Pi({start:t,end:e,count:i,loop:n,style:r}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:r}}function Di(t,e,i){if(!i)return[t];let n,r,s,{property:a,start:o,end:l}=i,h=e.length,{compare:d,between:c,normalize:u}=Oi(a),{start:f,end:g,loop:p,style:x}=function(t,e,i){let n,r,{property:s,start:a,end:o}=i,{between:l,normalize:h}=Oi(s),d=e.length,{start:c,end:u,loop:f}=t;if(f){for(c+=d,u+=d,n=0,r=d;n<r&&l(h(e[c%d][s]),a,o);++n)c--,u--;c%=d,u%=d}return u<c&&(u+=d),{start:c,end:u,loop:f,style:t.style}}(t,e,i),m=[],b=!1,y=null,v=()=>b||c(o,s,n)&&0!==d(o,s),_=()=>!b||0===d(l,n)||c(l,s,n);for(let t=f,i=f;t<=g;++t)r=e[t%h],!r.skip&&(n=u(r[a]),n!==s&&(b=c(n,o,l),null===y&&v()&&(y=0===d(n,o)?t:i),null!==y&&_()&&(m.push(Pi({start:y,end:t,loop:p,count:h,style:x})),y=null),i=t,s=n));return null!==y&&m.push(Pi({start:y,end:g,loop:p,count:h,style:x})),m}function Ci(t,e){let i=[],n=t.segments;for(let r=0;r<n.length;r++){let s=Di(n[r],t.points,e);s.length&&i.push(...s)}return i}function Ai(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){let r=t._chart.getContext(),s=Ti(t.options),{_datasetIndex:a,options:{spanGaps:o}}=t,l=i.length,h=[],d=s,c=e[0].start,u=c;function f(t,e,n,r){let s=o?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:n,style:r}),d=r,c=e%l)}}for(let t of e){c=o?c:t.start;let e,s=i[c%l];for(u=c+1;u<=t.end;u++){let o=i[u%l];e=Ti(n.setContext(Fe(r,{type:"segment",p0:s,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),ji(e,d)&&f(c,u-1,t.loop,d),s=o,d=e}c<u-1&&f(c,u-1,t.loop,d)}return h}(t,e,i,n):e}function Ti(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function ji(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var Ii=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){let r=e.listeners[n],s=e.duration;r.forEach(n=>n({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=mt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;let r,s=i.items,a=s.length-1,o=!1;for(;a>=0;--a)r=s[a],r._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),o=!0):(s[a]=s[s.length-1],s.pop());o&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,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){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Ri="transparent",Ei={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let n=oe(t||Ri),r=n.valid&&oe(e||Ri);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i},Li=class{constructor(t,e,i,n){let r=e[i];n=ze([t.to,n,r,t.from]);let s=ze([t.from,r,n]);this._active=!0,this._fn=t.fn||Ei[t.type||typeof s],this._easing=Ot[t.easing]||Ot.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=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let n=this._target[this._prop],r=i-this._start,s=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ze([t.to,e,n,t.from]),this._from=ze([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e,i=t-this._start,n=this._duration,r=this._prop,s=this._from,a=this._loop,o=this._to;if(this._active=s!==o&&(a||i<n),!this._active)return this._target[r]=o,void this._notify(!0);i<0?this._target[r]=s:(e=i/n%2,e=a&&e>1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[r]=this._fn(s,o,e))}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}};fe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var zi=Object.keys(fe.animation);fe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),fe.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),fe.describe("animations",{_fallback:"animation"}),fe.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=>0|t}}}});var Fi=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!_(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{let n=t[i];if(!_(n))return;let r={};for(let t of zi)r[t]=n[t];(v(n.properties)&&n.properties||[i]).forEach(t=>{(t===i||!e.has(t))&&e.set(t,r)})})}_animateOptions(t,e){let i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!n)return[];let r=this._createAnimations(n,i);return i.$shared&&function(t,e){let i=[],n=Object.keys(e);for(let e=0;e<n.length;e++){let r=t[n[e]];r&&r.active()&&i.push(r.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){let i,n=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();for(i=a.length-1;i>=0;--i){let l=a[i];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(t,e));continue}let h=e[l],d=s[l],c=n.get(l);if(d){if(c&&d.active()){d.update(c,h,o);continue}d.cancel()}c&&c.duration?(s[l]=d=new Li(c,t,l,h),r.push(d)):t[l]=h}return r}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);let i=this._createAnimations(t,e);return i.length?(Ii.add(this._chart,i),!0):void 0}};function Wi(t,e){let i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:r,end:n?r:s}}function Ni(t,e){let i,n,r=[],s=t._getSortedDatasetMetas(e);for(i=0,n=s.length;i<n;++i)r.push(s[i].index);return r}function Vi(t,e,i,n={}){let r,s,a,o,l=t.keys,h="single"===n.mode;if(null!==e){for(r=0,s=l.length;r<s;++r){if(a=+l[r],a===i){if(n.all)continue;break}o=t.values[a],w(o)&&(h||0===e||G(e)===G(o))&&(e+=o)}return e}}function Bi(t,e){let i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Hi(t,e,i){let n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Yi(t,e,i,n){for(let r of e.getMatchingVisibleMetas(n).reverse()){let e=t[r.index];if(i&&e>0||!i&&e<0)return r.index}return null}function $i(t,e){let i,{chart:n,_cachedMeta:r}=t,s=n._stacks||(n._stacks={}),{iScale:a,vScale:o,index:l}=r,h=a.axis,d=o.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(a,o,r),u=e.length;for(let t=0;t<u;++t){let n=e[t],{[h]:a,[d]:u}=n;i=(n._stacks||(n._stacks={}))[d]=Hi(s,c,a),i[l]=u,i._top=Yi(i,o,!0,r.type),i._bottom=Yi(i,o,!1,r.type)}}function Xi(t,e){let i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function Ui(t,e){let i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(let t of e){let e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}var qi=t=>"reset"===t||"none"===t,Ki=(t,e)=>e?t:Object.assign({},t),Gi=class{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.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Bi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ui(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,r=e.xAxisID=k(i.xAxisID,Xi(t,"x")),s=e.yAxisID=k(i.yAxisID,Xi(t,"y")),a=e.rAxisID=k(i.rAxisID,Xi(t,"r")),o=e.indexAxis,l=e.iAxisID=n(o,r,s,a),h=e.vAxisID=n(o,s,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&pt(this._data,this),t._stacked&&Ui(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(_(e))this._data=function(t){let e,i,n,r=Object.keys(t),s=new Array(r.length);for(e=0,i=r.length;e<i;++e)n=r[e],s[e]={x:n,y:t[n]};return s}(e);else if(i!==e){if(i){pt(i,this);let t=this._cachedMeta;Ui(t),t._parsed=[]}e&&Object.isExtensible(e)&&function(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),gt.forEach(e=>{let i="_onData"+z(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){let r=n.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),r}})}))}(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),n=!1;this._dataCheck();let r=e._stacked;e._stacked=Bi(e.vScale,e),e.stack!==i.stack&&(n=!0,Ui(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&$i(this,e._parsed)}configure(){let 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){let i,n,r,{_cachedMeta:s,_data:a}=this,{iScale:o,_stacked:l}=s,h=o.axis,d=0===t&&e===a.length||s._sorted,c=t>0&&s._parsed[t-1];if(!1===this._parsing)s._parsed=a,s._sorted=!0,r=a;else{r=v(a[t])?this.parseArrayData(s,a,t,e):_(a[t])?this.parseObjectData(s,a,t,e):this.parsePrimitiveData(s,a,t,e);let o=()=>null===n[h]||c&&n[h]<c[h];for(i=0;i<e;++i)s._parsed[i+t]=n=r[i],d&&(o()&&(d=!1),c=n);s._sorted=d}l&&$i(this,r)}parsePrimitiveData(t,e,i,n){let r,s,a,{iScale:o,vScale:l}=t,h=o.axis,d=l.axis,c=o.getLabels(),u=o===l,f=new Array(n);for(r=0,s=n;r<s;++r)a=r+i,f[r]={[h]:u||o.parse(c[a],a),[d]:l.parse(e[a],a)};return f}parseArrayData(t,e,i,n){let r,s,a,o,{xScale:l,yScale:h}=t,d=new Array(n);for(r=0,s=n;r<s;++r)a=r+i,o=e[a],d[r]={x:l.parse(o[0],a),y:h.parse(o[1],a)};return d}parseObjectData(t,e,i,n){let r,s,a,o,{xScale:l,yScale:h}=t,{xAxisKey:d="x",yAxisKey:c="y"}=this._parsing,u=new Array(n);for(r=0,s=n;r<s;++r)a=r+i,o=e[a],u[r]={x:l.parse(L(o,d),a),y:h.parse(L(o,c),a)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let n=this.chart,r=this._cachedMeta,s=e[t.axis];return Vi({keys:Ni(n,!0),values:e._stacks[t.axis]},s,r.index,{mode:i})}updateRangeFromParsed(t,e,i,n){let r=i[e.axis],s=null===r?NaN:r,a=n&&i._stacks[e.axis];n&&a&&(n.values=a,s=Vi(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){let i,n,r=this._cachedMeta,s=r._parsed,a=r._sorted&&t===r.iScale,o=s.length,l=this._getOtherScale(t),h=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Ni(i,!0),values:null})(e,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){let{min:e,max:i,minDefined:n,maxDefined:r}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?i:Number.POSITIVE_INFINITY}}(l);function f(){n=s[i];let e=n[l.axis];return!w(n[t.axis])||c>e||u<e}for(i=0;i<o&&(f()||(this.updateRangeFromParsed(d,t,n,h),!a));++i);if(a)for(i=o-1;i>=0;--i)if(!f()){this.updateRangeFromParsed(d,t,n,h);break}return d}getAllParsedValues(t){let e,i,n,r=this._cachedMeta._parsed,s=[];for(e=0,i=r.length;e<i;++e)n=r[e][t.axis],w(n)&&s.push(n);return s}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){let e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,r;return _(t)?(e=t.top,i=t.right,n=t.bottom,r=t.left):e=i=n=r=t,{top:e,right:i,bottom:n,left:r,disabled:!1===t}}(k(this.options.clip,function(t,e,i){if(!1===i)return!1;let n=Wi(t,i),r=Wi(e,i);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){let t,e=this._ctx,i=this.chart,n=this._cachedMeta,r=n.data||[],s=i.chartArea,a=[],o=this._drawStart||0,l=this._drawCount||r.length-o,h=this.options.drawActiveElementsOnTop;for(n.dataset&&n.dataset.draw(e,s,o,l),t=o;t<o+l;++t){let i=r[t];i.hidden||(i.active&&h?a.push(i):i.draw(e,s))}for(t=0;t<a.length;++t)a[t].draw(e,s)}getStyle(t,e){let i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){let n,r=this.getDataset();if(t>=0&&t<this._cachedMeta.data.length){let e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return Fe(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=r.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return Fe(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=r,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}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){let n="active"===e,r=this._cachedDataOpts,s=t+"-"+e,a=r[s],o=this.enableOptionSharing&&F(i);if(a)return Ki(a,o);let l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),d=n?[t+"Hover","hover",t,""]:[t,""],c=l.getOptionScopes(this.getDataset(),h),u=Object.keys(fe.elements[t]),f=l.resolveNamedOptions(c,u,()=>this.getContext(i,n),d);return f.$shared&&(f.$shared=o,r[s]=Object.freeze(Ki(f,o))),f}_resolveAnimations(t,e,i){let n,r=this.chart,s=this._cachedDataOpts,a="animation-"+e,o=s[a];if(o)return o;if(!1!==r.options.animation){let r=this.chart.config,s=r.datasetAnimationScopeKeys(this._type,e),a=r.getOptionScopes(this.getDataset(),s);n=r.createResolver(a,this.getContext(t,i,e))}let l=new Fi(r,n&&n.animations);return n&&n._cacheable&&(s[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||qi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),s=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:s}}updateElement(t,e,i,n){qi(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!qi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;let r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&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(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let n=i.length,r=e.length,s=Math.min(r,n);s&&this.parse(0,s),r>n?this._insertElements(n,r-n,t):r<n&&this._removeElements(r,n-r)}_insertElements(t,e,i=!0){let n,r=this._cachedMeta,s=r.data,a=t+e,o=t=>{for(t.length+=e,n=t.length-1;n>=a;n--)t[n]=t[n-e]};for(o(s),n=t;n<a;++n)s[n]=new this.dataElementType;this._parsing&&o(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let n=i._parsed.splice(t,e);i._stacked&&Ui(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let 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]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};function Ji(t){let e,i,n,r,s=t.iScale,a=function(t,e){if(!t._cache.$bar){let i=t.getMatchingVisibleMetas(e),n=[];for(let e=0,r=i.length;e<r;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=xt(n.sort((t,e)=>t-e))}return t._cache.$bar}(s,t.type),o=s._length,l=()=>{32767===n||-32768===n||(F(r)&&(o=Math.min(o,Math.abs(n-r)||o)),r=n)};for(e=0,i=a.length;e<i;++e)n=s.getPixelForValue(a[e]),l();for(r=void 0,e=0,i=s.ticks.length;e<i;++e)n=s.getPixelForTick(e),l();return o}function Zi(t,e,i,n){return v(t)?function(t,e,i,n){let r=i.parse(t[0],n),s=i.parse(t[1],n),a=Math.min(r,s),o=Math.max(r,s),l=a,h=o;Math.abs(a)>Math.abs(o)&&(l=o,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:r,end:s,min:a,max:o}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Qi(t,e,i,n){let r,s,a,o,l=t.iScale,h=t.vScale,d=l.getLabels(),c=l===h,u=[];for(r=i,s=i+n;r<s;++r)o=e[r],a={},a[l.axis]=c||l.parse(d[r],r),u.push(Zi(o,a,h,r));return u}function tn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function en(t,e,i,n){let r=e.borderSkipped,s={};if(!r)return void(t.borderSkipped=s);if(!0===r)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});let{start:a,end:o,reverse:l,top:h,bottom:d}=function(t){let e,i,n,r,s;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(r="end",s="start"):(r="start",s="end"),{start:i,end:n,reverse:e,top:r,bottom:s}}(t);"middle"===r&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?r=h:(i._bottom||0)===n?r=d:(s[nn(d,a,o,l)]=!0,r=h)),s[nn(r,a,o,l)]=!0,t.borderSkipped=s}function nn(t,e,i,n){return n?t=rn(t=function(t,e,i){return t===e?i:t===i?e:t}(t,e,i),i,e):t=rn(t,e,i),t}function rn(t,e,i){return"start"===t?e:"end"===t?i:t}function sn(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}Gi.defaults={},Gi.prototype.datasetElementType=null,Gi.prototype.dataElementType=null;var an=class extends Gi{parsePrimitiveData(t,e,i,n){return Qi(t,e,i,n)}parseArrayData(t,e,i,n){return Qi(t,e,i,n)}parseObjectData(t,e,i,n){let r,s,a,o,{iScale:l,vScale:h}=t,{xAxisKey:d="x",yAxisKey:c="y"}=this._parsing,u="x"===l.axis?d:c,f="x"===h.axis?d:c,g=[];for(r=i,s=i+n;r<s;++r)o=e[r],a={},a[l.axis]=l.parse(L(o,u),r),g.push(Zi(L(o,f),a,h,r));return g}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);let 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){let e=this._cachedMeta,{iScale:i,vScale:n}=e,r=this.getParsed(t),s=r._custom,a=tn(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){let e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){let r="reset"===n,{index:s,_cachedMeta:{vScale:a}}=this,o=a.getBasePixel(),l=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:c}=this._getSharedOptions(e,n);for(let u=e;u<e+i;u++){let e=this.getParsed(u),i=r||y(e[a.axis])?{base:o,head:o}:this._calculateBarValuePixels(u),f=this._calculateBarIndexPixels(u,h),g=(e._stacks||{})[a.axis],p={horizontal:l,base:i.base,enableBorderRadius:!g||tn(e._custom)||s===g._top||s===g._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:Math.abs(i.size),width:l?Math.abs(i.size):f.size};c&&(p.options=d||this.resolveDataElementOptions(u,t[u].active?"active":n));let x=p.options||t[u].options;en(p,x,g,s),sn(p,x,h.ratio),this.updateElement(t[u],u,p,n)}}_getStacks(t,e){let{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),r=i.options.stacked,s=[],a=t=>{let i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(y(n)||isNaN(n))return!0};for(let i of n)if((void 0===e||!a(i))&&((!1===r||-1===s.indexOf(i.stack)||void 0===r&&void 0===i.stack)&&s.push(i.stack),i.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return-1===r?n.length-1:r}_getRuler(){let t,e,i=this.options,n=this._cachedMeta,r=n.iScale,s=[];for(t=0,e=n.data.length;t<e;++t)s.push(r.getPixelForValue(this.getParsed(t)[r.axis],t));let a=i.barThickness;return{min:a||Ji(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:i.grouped,ratio:a?1:i.categoryPercentage*i.barPercentage}}_calculateBarValuePixels(t){let e,i,{_cachedMeta:{vScale:n,_stacked:r},options:{base:s,minBarLength:a}}=this,o=s||0,l=this.getParsed(t),h=l._custom,d=tn(h),c=l[n.axis],u=0,f=r?this.applyStack(n,l,r):c;f!==c&&(u=f-c,f=c),d&&(c=h.barStart,f=h.barEnd-h.barStart,0!==c&&G(c)!==G(h.barEnd)&&(u=0),u+=c);let g=y(s)||d?u:s,p=n.getPixelForValue(g);if(e=this.chart.getDataVisibility(t)?n.getPixelForValue(u+f):p,i=e-p,Math.abs(i)<a){i=function(t,e,i){return 0!==t?G(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(i,n,o)*a,c===o&&(p-=i/2);let t=n.getPixelForDecimal(0),r=n.getPixelForDecimal(1),s=Math.min(t,r),l=Math.max(t,r);p=Math.max(Math.min(p,l),s),e=p+i}if(p===n.getPixelForValue(o)){let t=G(i)*n.getLineWidthForValue(o)/2;p+=t,i-=t}return{size:i,base:p,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){let i,n,r=e.scale,s=this.options,a=s.skipNull,o=k(s.maxBarThickness,1/0);if(e.grouped){let r=a?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?function(t,e,i,n){let r=e.pixels,s=r[t],a=t>0?r[t-1]:null,o=t<r.length-1?r[t+1]:null,l=i.categoryPercentage;null===a&&(a=s-(null===o?e.end-e.start:o-s)),null===o&&(o=s+s-a);let h=s-(s-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/n,ratio:i.barPercentage,start:h}}(t,e,s,r):function(t,e,i,n){let r,s,a=i.barThickness;return y(a)?(r=e.min*i.categoryPercentage,s=i.barPercentage):(r=a*n,s=1),{chunk:r/n,ratio:s,start:e.pixels[t]-r/2}}(t,e,s,r),h=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);i=l.start+l.chunk*h+l.chunk/2,n=Math.min(o,l.chunk*l.ratio)}else i=r.getPixelForValue(this.getParsed(t)[r.axis],t),n=Math.min(o,e.min*e.ratio);return{base:i-n/2,head:i+n/2,center:i,size:n}}draw(){let t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length,r=0;for(;r<n;++r)null!==this.getParsed(r)[e.axis]&&i[r].draw(this._ctx)}};an.id="bar",an.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},an.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};var on=class extends Gi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){let r=super.parsePrimitiveData(t,e,i,n);for(let t=0;t<r.length;t++)r[t]._custom=this.resolveDataElementOptions(t+i).radius;return r}parseArrayData(t,e,i,n){let r=super.parseArrayData(t,e,i,n);for(let t=0;t<r.length;t++){let n=e[i+t];r[t]._custom=k(n[2],this.resolveDataElementOptions(t+i).radius)}return r}parseObjectData(t,e,i,n){let r=super.parseObjectData(t,e,i,n);for(let t=0;t<r.length;t++){let n=e[i+t];r[t]._custom=k(n&&n.r&&+n.r,this.resolveDataElementOptions(t+i).radius)}return r}getMaxOverflow(){let t=this._cachedMeta.data,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){let e=this._cachedMeta,{xScale:i,yScale:n}=e,r=this.getParsed(t),s=i.getLabelForValue(r.x),a=n.getLabelForValue(r.y),o=r._custom;return{label:e.label,value:"("+s+", "+a+(o?", "+o:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){let r="reset"===n,{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:o,includeOptions:l}=this._getSharedOptions(e,n),h=s.axis,d=a.axis;for(let c=e;c<e+i;c++){let e=t[c],i=!r&&this.getParsed(c),u={},f=u[h]=r?s.getPixelForDecimal(.5):s.getPixelForValue(i[h]),g=u[d]=r?a.getBasePixel():a.getPixelForValue(i[d]);u.skip=isNaN(f)||isNaN(g),l&&(u.options=o||this.resolveDataElementOptions(c,e.active?"active":n),r&&(u.options.radius=0)),this.updateElement(e,c,u,n)}}resolveDataElementOptions(t,e){let i=this.getParsed(t),n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));let r=n.radius;return"active"!==e&&(n.radius=0),n.radius+=k(i&&i._custom,r),n}};on.id="bubble",on.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},on.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};var ln=class extends Gi{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){let i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let r,s,a=t=>+i[t];if(_(i[t])){let{key:t="value"}=this._parsing;a=e=>+L(i[e],t)}for(r=t,s=t+e;r<s;++r)n._parsed[r]=a(r)}}_getRotation(){return et(this.options.rotation-90)}_getCircumference(){return et(this.options.circumference)}_getRotationExtents(){let t=B,e=-B;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){let n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),s=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+s)}return{rotation:t,circumference:e-t}}update(t){let e=this.chart,{chartArea:i}=e,n=this._cachedMeta,r=n.data,s=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-s)/2,0),o=Math.min(((t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e)(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:c,ratioY:u,offsetX:f,offsetY:g}=function(t,e,i){let n=1,r=1,s=0,a=0;if(e<B){let o=t,l=o+e,h=Math.cos(o),d=Math.sin(o),c=Math.cos(l),u=Math.sin(l),f=(t,e,n)=>lt(t,o,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>lt(t,o,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,h,c),x=f(X,d,u),m=g(V,h,c),b=g(V+X,d,u);n=(p-m)/2,r=(x-b)/2,s=-(p+m)/2,a=-(x+b)/2}return{ratioX:n,ratioY:r,offsetX:s,offsetY:a}}(d,h,o),p=(i.width-s)/c,x=(i.height-s)/u,m=Math.max(Math.min(p,x)/2,0),b=S(this.options.radius,m),y=(b-Math.max(b*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*b,this.offsetY=g*b,n.total=this.calculateTotal(),this.outerRadius=b-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){let i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/B)}updateElements(t,e,i,n){let r,s="reset"===n,a=this.chart,o=a.chartArea,l=a.options.animation,h=(o.left+o.right)/2,d=(o.top+o.bottom)/2,c=s&&l.animateScale,u=c?0:this.innerRadius,f=c?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,n),x=this._getRotation();for(r=0;r<e;++r)x+=this._circumference(r,s);for(r=e;r<e+i;++r){let e=this._circumference(r,s),i=t[r],a={x:h+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:f,innerRadius:u};p&&(a.options=g||this.resolveDataElementOptions(r,i.active?"active":n)),x+=e,this.updateElement(i,r,a,n)}}calculateTotal(){let t,e=this._cachedMeta,i=e.data,n=0;for(t=0;t<i.length;t++){let r=e._parsed[t];null!==r&&!isNaN(r)&&this.chart.getDataVisibility(t)&&!i[t].hidden&&(n+=Math.abs(r))}return n}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?B*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=wi(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e,i,n,r,s,a=0,o=this.chart;if(!t)for(e=0,i=o.data.datasets.length;e<i;++e)if(o.isDatasetVisible(e)){n=o.getDatasetMeta(e),t=n.data,r=n.controller;break}if(!t)return 0;for(e=0,i=t.length;e<i;++e)s=r.resolveDataElementOptions(e),"inner"!==s.borderAlign&&(a=Math.max(a,s.borderWidth||0,s.hoverBorderWidth||0));return a}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){let t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.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(k(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};ln.id="doughnut",ln.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"},ln.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},ln.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{let r=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label,i=": "+t.formattedValue;return v(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};var hn=class extends Gi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,s=this.chart._animationsDisabled,{start:a,count:o}=_t(e,n,s);this._drawStart=a,this._drawCount=o,wt(e)&&(a=0,o=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,a,o,t)}updateElements(t,e,i,n){let r="reset"===n,{iScale:s,vScale:a,_stacked:o,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),c=s.axis,u=a.axis,{spanGaps:f,segment:g}=this.options,p=Z(f)?f:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||"none"===n,m=e>0&&this.getParsed(e-1);for(let f=e;f<e+i;++f){let e=t[f],i=this.getParsed(f),b=x?e:{},v=y(i[u]),_=b[c]=s.getPixelForValue(i[c],f),w=b[u]=r||v?a.getBasePixel():a.getPixelForValue(o?this.applyStack(a,i,o):i[u],f);b.skip=isNaN(_)||isNaN(w)||v,b.stop=f>0&&Math.abs(i[c]-m[c])>p,g&&(b.parsed=i,b.raw=l.data[f]),d&&(b.options=h||this.resolveDataElementOptions(f,e.active?"active":n)),x||this.updateElement(e,f,b,n),m=i}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;let r=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,s)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};hn.id="line",hn.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},hn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var dn=class extends Gi{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=wi(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return Ze.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{let n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),s=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){let r,s="reset"===n,a=this.chart,o=a.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,d=l.yCenter,c=l.getIndexAngle(0)-.5*V,u=c,f=360/this.countVisibleElements();for(r=0;r<e;++r)u+=this._computeAngle(r,n,f);for(r=e;r<e+i;r++){let e=t[r],i=u,g=u+this._computeAngle(r,n,f),p=a.getDataVisibility(r)?l.getDistanceFromCenterForValue(this.getParsed(r).r):0;u=g,s&&(o.animateScale&&(p=0),o.animateRotate&&(i=g=c));let x={x:h,y:d,innerRadius:0,outerRadius:p,startAngle:i,endAngle:g,options:this.resolveDataElementOptions(r,e.active?"active":n)};this.updateElement(e,r,x,n)}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?et(this.resolveDataElementOptions(t,e).angle||i):0}};dn.id="polarArea",dn.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},dn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{let r=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var cn=class extends ln{};cn.id="pie",cn.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var un=class extends Gi{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Ze.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);let s={_loop:!0,_fullLoop:r.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){let r=this._cachedMeta.rScale,s="reset"===n;for(let a=e;a<e+i;a++){let e=t[a],i=this.resolveDataElementOptions(a,e.active?"active":n),o=r.getPointPositionForValue(a,this.getParsed(a).r),l=s?r.xCenter:o.x,h=s?r.yCenter:o.y,d={x:l,y:h,angle:o.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,a,d,n)}}};un.id="radar",un.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},un.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};var fn=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Z(this.x)&&Z(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}};fn.defaults={},fn.defaultRoutes=void 0;var gn={values:t=>v(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";let n,r=this.chart.options.locale,s=t;if(i.length>1){let e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}let a=K(Math.abs(s)),o=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),wi(t,r,l)},logarithmic(t,e,i){if(0===t)return"0";let n=t/Math.pow(10,Math.floor(K(t)));return 1===n||2===n||5===n?gn.numeric.call(this,t,e,i):""}};var pn={formatters:gn};function xn(t,e){let i=t.options.ticks,n=i.maxTicksLimit||function(t){let e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),r=t._maxLength/i;return Math.floor(Math.min(n,r))}(t),r=i.major.enabled?function(t){let e,i,n=[];for(e=0,i=t.length;e<i;e++)t[e].major&&n.push(e);return n}(e):[],s=r.length,a=r[0],o=r[s-1],l=[];if(s>n)return function(t,e,i,n){let r,s=0,a=i[0];for(n=Math.ceil(n),r=0;r<t.length;r++)r===a&&(e.push(t[r]),s++,a=i[s*n])}(e,l,r,s/n),l;let h=function(t,e,i){let n=function(t){let e,i,n=t.length;if(n<2)return!1;for(i=t[0],e=1;e<n;++e)if(t[e]-t[e-1]!==i)return!1;return i}(t),r=e.length/i;if(!n)return Math.max(r,1);let s=function(t){let e,i=[],n=Math.sqrt(t);for(e=1;e<n;e++)t%e==0&&(i.push(e),i.push(t/e));return n===(0|n)&&i.push(n),i.sort((t,e)=>t-e).pop(),i}(n);for(let t=0,e=s.length-1;t<e;t++){let e=s[t];if(e>r)return e}return Math.max(r,1)}(r,e,n);if(s>0){let t,i,n=s>1?Math.round((o-a)/(s-1)):null;for(mn(e,l,h,y(n)?0:a-n,a),t=0,i=s-1;t<i;t++)mn(e,l,h,r[t],r[t+1]);return mn(e,l,h,o,y(n)?e.length:o+n),l}return mn(e,l,h),l}function mn(t,e,i,n,r){let s,a,o,l=k(n,0),h=Math.min(k(r,t.length),t.length),d=0;for(i=Math.ceil(i),r&&(s=r-n,i=s/Math.floor(s/i)),o=l;o<0;)d++,o=Math.round(l+d*i);for(a=Math.max(l,0);a<h;a++)a===o&&(e.push(t[a]),d++,o=Math.round(l+d*i))}fe.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:pn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),fe.route("scale.ticks","color","","color"),fe.route("scale.grid","color","","borderColor"),fe.route("scale.grid","borderColor","","borderColor"),fe.route("scale.title","color","","color"),fe.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),fe.describe("scales",{_fallback:"scale"}),fe.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});var bn=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function yn(t,e){let i=[],n=t.length/e,r=t.length,s=0;for(;s<r;s+=n)i.push(t[Math.floor(s)]);return i}function vn(t,e,i){let n,r=t.ticks.length,s=Math.min(e,r-1),a=t._startPixel,o=t._endPixel,l=1e-6,h=t.getPixelForTick(s);if(!(i&&(n=1===r?Math.max(h-a,o-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(s-1))/2,h+=s<e?n:-n,h<a-l||h>o+l)))return h}function _n(t){return t.drawTicks?t.tickLength:0}function wn(t,e){if(!t.display)return 0;let i=Le(t.font,e),n=Ee(t.padding);return(v(t.text)?t.text.length:1)*i.lineHeight+n.height}function Mn(t,e,i){let n=yt(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}var kn=class t extends fn{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:n}=this;return t=M(t,Number.POSITIVE_INFINITY),e=M(e,Number.NEGATIVE_INFINITY),i=M(i,Number.POSITIVE_INFINITY),n=M(n,Number.NEGATIVE_INFINITY),{min:M(t,i),max:M(e,n),minDefined:w(t),maxDefined:w(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:i,max:n};let a=this.getMatchingVisibleMetas();for(let o=0,l=a.length;o<l;++o)e=a[o].controller.getMinMax(this,t),r||(i=Math.min(i,e.min)),s||(n=Math.max(n,e.max));return i=s&&i>n?n:i,n=r&&i>n?i:n,{min:M(i,M(n,i)),max:M(n,M(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){O(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:n,grace:r,ticks:s}=this.options,a=s.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=function(t,e,i){let{min:n,max:r}=t,s=S(e,(r-n)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(n,-Math.abs(s)),max:a(r,s)}}(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let o=a<this.ticks.length;this._convertTicksToLabels(o?yn(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||"auto"===s.source)&&(this.ticks=xn(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),o&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){O(this.options.afterUpdate,[this])}beforeSetDimensions(){O(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(){O(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),O(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){O(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e,i,n,r=this.options.ticks;for(e=0,i=t.length;e<i;e++)n=t[e],n.label=O(r.callback,[n.value,e,t],this)}afterTickToLabelConversion(){O(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){O(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t,e,i,n=this.options,r=n.ticks,s=this.ticks.length,a=r.minRotation||0,o=r.maxRotation,l=a;if(!this._isVisible()||!r.display||a>=o||s<=1||!this.isHorizontal())return void(this.labelRotation=a);let h=this._getLabelSizes(),d=h.widest.width,c=h.highest.height,u=ht(this.chart.width-d,0,this.maxWidth);t=n.offset?this.maxWidth/s:u/(s-1),d+6>t&&(t=u/(s-(n.offset?.5:1)),e=this.maxHeight-_n(n.grid)-r.padding-wn(n.title,this.chart.options.font),i=Math.sqrt(d*d+c*c),l=it(Math.min(Math.asin(ht((h.highest.height+6)/t,-1,1)),Math.asin(ht(e/i,-1,1))-Math.asin(ht(c/i,-1,1)))),l=Math.max(a,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){O(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){O(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){let s=wn(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=_n(r)+s):(t.height=this.maxHeight,t.width=_n(r)+s),i.display&&this.ticks.length){let{first:e,last:n,widest:r,highest:s}=this._getLabelSizes(),o=2*i.padding,l=et(this.labelRotation),h=Math.cos(l),d=Math.sin(l);if(a){let e=i.mirror?0:d*r.width+h*s.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{let e=i.mirror?0:h*r.width+d*s.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,n,d,h)}}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,n){let{ticks:{align:r,padding:s},position:a}=this.options,o=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){let a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),d=0,c=0;o?l?(d=n*t.width,c=i*e.height):(d=i*t.height,c=n*e.width):"start"===r?c=e.width:"end"===r?d=t.width:"inner"!==r&&(d=t.width/2,c=e.width/2),this.paddingLeft=Math.max((d-a+s)*this.width/(this.width-a),0),this.paddingRight=Math.max((c-h+s)*this.width/(this.width-h),0)}else{let i=e.height/2,n=t.height/2;"start"===r?(i=0,n=t.height):"end"===r&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_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(){O(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)y(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=yn(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){let i,n,r,s,a,o,l,h,d,c,u,{ctx:f,_longestTextCache:g}=this,p=[],x=[],m=0,b=0;for(i=0;i<e;++i){if(s=t[i].label,a=this._resolveTickFontOptions(i),f.font=o=a.string,l=g[o]=g[o]||{data:{},gc:[]},h=a.lineHeight,d=c=0,y(s)||v(s)){if(v(s))for(n=0,r=s.length;n<r;++n)u=s[n],!y(u)&&!v(u)&&(d=ge(f,l.data,l.gc,d,u),c+=h)}else d=ge(f,l.data,l.gc,d,s),c=h;p.push(d),x.push(c),m=Math.max(d,m),b=Math.max(c,b)}!function(t,e){P(t,t=>{let i,n=t.gc,r=n.length/2;if(r>e){for(i=0;i<r;++i)delete t.data[n[i]];n.splice(0,r)}})}(g,e);let _=p.indexOf(m),w=x.indexOf(b),M=t=>({width:p[t]||0,height:x[t]||0});return{first:M(0),last:M(e-1),widest:M(_),highest:M(w),widths:p,heights:x}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return function(t){return ht(t,-32768,32767)}(this._alignToPixels?xe(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let i=e[t];return i.$context||(i.$context=function(t,e,i){return Fe(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=function(t,e){return Fe(t,{scale:e,type:"scale"})}(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,e=et(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),s=t.autoSkipPadding||0,a=r?r.widest.width+s:0,o=r?r.highest.height+s:0;return this.isHorizontal()?o*i>a*n?a/i:o/n:o*n<a*i?o/i:a/n}_isVisible(){let t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e,i,n,r,s,a,o,l,h,d,c,u,f=this.axis,g=this.chart,p=this.options,{grid:x,position:m}=p,b=x.offset,y=this.isHorizontal(),v=this.ticks.length+(b?1:0),w=_n(x),M=[],S=x.setContext(this.getContext()),O=S.drawBorder?S.borderWidth:0,P=O/2,D=function(t){return xe(g,t,O)};if("top"===m)e=D(this.bottom),a=this.bottom-w,l=e-P,d=D(t.top)+P,u=t.bottom;else if("bottom"===m)e=D(this.top),d=t.top,u=D(t.bottom)-P,a=e+P,l=this.top+w;else if("left"===m)e=D(this.right),s=this.right-w,o=e-P,h=D(t.left)+P,c=t.right;else if("right"===m)e=D(this.left),h=t.left,c=D(t.right)-P,s=e+P,o=this.left+w;else if("x"===f){if("center"===m)e=D((t.top+t.bottom)/2+.5);else if(_(m)){let t=Object.keys(m)[0],i=m[t];e=D(this.chart.scales[t].getPixelForValue(i))}d=t.top,u=t.bottom,a=e+P,l=a+w}else if("y"===f){if("center"===m)e=D((t.left+t.right)/2);else if(_(m)){let t=Object.keys(m)[0],i=m[t];e=D(this.chart.scales[t].getPixelForValue(i))}s=e-P,o=s-w,h=t.left,c=t.right}let C=k(p.ticks.maxTicksLimit,v),A=Math.max(1,Math.ceil(v/C));for(i=0;i<v;i+=A){let t=x.setContext(this.getContext(i)),e=t.lineWidth,f=t.color,p=t.borderDash||[],m=t.borderDashOffset,v=t.tickWidth,_=t.tickColor,w=t.tickBorderDash||[],k=t.tickBorderDashOffset;n=vn(this,i,b),void 0!==n&&(r=xe(g,n,e),y?s=o=h=c=r:a=l=d=u=r,M.push({tx1:s,ty1:a,tx2:o,ty2:l,x1:h,y1:d,x2:c,y2:u,width:e,color:f,borderDash:p,borderDashOffset:m,tickWidth:v,tickColor:_,tickBorderDash:w,tickBorderDashOffset:k}))}return this._ticksLength=v,this._borderValue=e,M}_computeLabelItems(t){let e,i,n,r,s,a,o,l,h,d,c,u,f=this.axis,g=this.options,{position:p,ticks:x}=g,m=this.isHorizontal(),b=this.ticks,{align:y,crossAlign:w,padding:M,mirror:k}=x,S=_n(g.grid),O=S+M,P=k?-M:O,D=-et(this.labelRotation),C=[],A="middle";if("top"===p)a=this.bottom-P,o=this._getXAxisLabelAlignment();else if("bottom"===p)a=this.top+P,o=this._getXAxisLabelAlignment();else if("left"===p){let t=this._getYAxisLabelAlignment(S);o=t.textAlign,s=t.x}else if("right"===p){let t=this._getYAxisLabelAlignment(S);o=t.textAlign,s=t.x}else if("x"===f){if("center"===p)a=(t.top+t.bottom)/2+O;else if(_(p)){let t=Object.keys(p)[0],e=p[t];a=this.chart.scales[t].getPixelForValue(e)+O}o=this._getXAxisLabelAlignment()}else if("y"===f){if("center"===p)s=(t.left+t.right)/2-O;else if(_(p)){let t=Object.keys(p)[0],e=p[t];s=this.chart.scales[t].getPixelForValue(e)}o=this._getYAxisLabelAlignment(S).textAlign}"y"===f&&("start"===y?A="top":"end"===y&&(A="bottom"));let T=this._getLabelSizes();for(e=0,i=b.length;e<i;++e){n=b[e],r=n.label;let t=x.setContext(this.getContext(e));l=this.getPixelForTick(e)+x.labelOffset,h=this._resolveTickFontOptions(e),d=h.lineHeight,c=v(r)?r.length:1;let f,g=c/2,y=t.color,_=t.textStrokeColor,M=t.textStrokeWidth,S=o;if(m?(s=l,"inner"===o&&(S=e===i-1?this.options.reverse?"left":"right":0===e?this.options.reverse?"right":"left":"center"),u="top"===p?"near"===w||0!==D?-c*d+d/2:"center"===w?-T.highest.height/2-g*d+d:-T.highest.height+d/2:"near"===w||0!==D?d/2:"center"===w?T.highest.height/2-g*d:T.highest.height-c*d,k&&(u*=-1)):(a=l,u=(1-c)*d/2),t.showLabelBackdrop){let i=Ee(t.backdropPadding),n=T.heights[e],r=T.widths[e],l=a+u-i.top,h=s-i.left;switch(A){case"middle":l-=n/2;break;case"bottom":l-=n}switch(o){case"center":h-=r/2;break;case"right":h-=r}f={left:h,top:l,width:r+i.width,height:n+i.height,color:t.backdropColor}}C.push({rotation:D,label:r,font:h,color:y,strokeColor:_,strokeWidth:M,textOffset:u,textAlign:S,textBaseline:A,translation:[s,a],backdrop:f})}return C}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-et(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){let e,i,{position:n,ticks:{crossAlign:r,mirror:s,padding:a}}=this.options,o=t+a,l=this._getLabelSizes().widest.width;return"left"===n?s?(i=this.right+a,"near"===r?e="left":"center"===r?(e="center",i+=l/2):(e="right",i+=l)):(i=this.right-o,"near"===r?e="right":"center"===r?(e="center",i-=l/2):(e="left",i=this.left)):"right"===n?s?(i=this.left+a,"near"===r?e="right":"center"===r?(e="center",i-=l/2):(e="left",i-=l)):(i=this.left+o,"near"===r?e="left":"center"===r?(e="center",i+=l/2):(e="right",i=this.right)):e="right",{textAlign:e,x:i}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){let{ctx:t,options:{backgroundColor:e},left:i,top:n,width:r,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,s),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){let e,i,n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),a=(t,e,i)=>{!i.width||!i.color||(r.save(),r.lineWidth=i.width,r.strokeStyle=i.color,r.setLineDash(i.borderDash||[]),r.lineDashOffset=i.borderDashOffset,r.beginPath(),r.moveTo(t.x,t.y),r.lineTo(e.x,e.y),r.stroke(),r.restore())};if(n.display)for(e=0,i=s.length;e<i;++e){let t=s[e];n.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),n.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:e,options:{grid:i}}=this,n=i.setContext(this.getContext()),r=i.drawBorder?n.borderWidth:0;if(!r)return;let s,a,o,l,h=i.setContext(this.getContext(0)).lineWidth,d=this._borderValue;this.isHorizontal()?(s=xe(t,this.left,r)-r/2,a=xe(t,this.right,h)+h/2,o=l=d):(o=xe(t,this.top,r)-r/2,l=xe(t,this.bottom,h)+h/2,s=a=d),e.save(),e.lineWidth=n.borderWidth,e.strokeStyle=n.borderColor,e.beginPath(),e.moveTo(s,o),e.lineTo(a,l),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;let e=this.ctx,i=this._computeLabelArea();i&&_e(e,i);let n,r,s=this._labelItems||(this._labelItems=this._computeLabelItems(t));for(n=0,r=s.length;n<r;++n){let t=s[n],i=t.font,r=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Se(e,r,0,t.textOffset,i,t)}i&&we(e)}drawTitle(){let{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;let r=Le(i.font),s=Ee(i.padding),a=i.align,o=r.lineHeight/2;"bottom"===e||"center"===e||_(e)?(o+=s.bottom,v(i.text)&&(o+=r.lineHeight*(i.text.length-1))):o+=s.top;let{titleX:l,titleY:h,maxWidth:d,rotation:c}=function(t,e,i,n){let r,s,a,{top:o,left:l,bottom:h,right:d,chart:c}=t,{chartArea:u,scales:f}=c,g=0,p=h-o,x=d-l;if(t.isHorizontal()){if(s=vt(n,l,d),_(i)){let t=Object.keys(i)[0],n=i[t];a=f[t].getPixelForValue(n)+p-e}else a="center"===i?(u.bottom+u.top)/2+p-e:bn(t,i,e);r=d-l}else{if(_(i)){let t=Object.keys(i)[0],n=i[t];s=f[t].getPixelForValue(n)-x+e}else s="center"===i?(u.left+u.right)/2-x+e:bn(t,i,e);a=vt(n,h,o),g="left"===i?-X:X}return{titleX:s,titleY:a,maxWidth:r,rotation:g}}(this,o,e,a);Se(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:c,textAlign:Mn(a,e,n),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let e=this.options,i=e.ticks&&e.ticks.z||0,n=k(e.grid&&e.grid.z,-1);return this._isVisible()&&this.draw===t.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:i,draw:t=>{this.drawLabels(t)}}]:[{z:i,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i,n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];for(e=0,i=n.length;e<i;++e){let i=n[e];i[r]===this.id&&(!t||i.type===t)&&s.push(i)}return s}_resolveTickFontOptions(t){return Le(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Sn=class{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){let e,i=Object.getPrototypeOf(t);var n;"id"in(n=i)&&"defaults"in n&&(e=this.register(i));let r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,function(t,e,i){let n=j(Object.create(null),[i?fe.get(i):{},fe.get(e),t.defaults]);fe.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{let n=i.split("."),r=n.pop(),s=[t].concat(n).join("."),a=e[i].split("."),o=a.pop(),l=a.join(".");fe.route(s,r,l,o)})}(e,t.defaultRoutes),t.descriptors&&fe.describe(e,t.descriptors)}(t,a,e),this.override&&fe.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in fe[n]&&(delete fe[n][i],this.override&&delete he[i])}};var On=new class{constructor(){this.controllers=new Sn(Gi,"datasets",!0),this.elements=new Sn(fn,"elements"),this.plugins=new Sn(Object,"plugins"),this.scales=new Sn(kn,"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(e=>{let n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):P(e,e=>{let n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){let n=z(t);O(i["before"+n],[],i),e[t](i),O(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}},Pn=class extends Gi{update(t){let e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled,{start:r,count:s}=_t(e,i,n);if(this._drawStart=r,this._drawCount=s,wt(e)&&(r=0,s=i.length),this.options.showLine){let{dataset:r,_dataset:s}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;let a=this.resolveDatasetElementOptions(t);a.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:a},t)}this.updateElements(i,r,s,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=On.getElement("line")),super.addElements()}updateElements(t,e,i,n){let r="reset"===n,{iScale:s,vScale:a,_stacked:o,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(h),c=this.includeOptions(n,d),u=s.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,x=Z(g)?g:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||r||"none"===n,b=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){let e=t[h],i=this.getParsed(h),g=m?e:{},v=y(i[f]),_=g[u]=s.getPixelForValue(i[u],h),w=g[f]=r||v?a.getBasePixel():a.getPixelForValue(o?this.applyStack(a,i,o):i[f],h);g.skip=isNaN(_)||isNaN(w)||v,g.stop=h>0&&Math.abs(i[u]-b[u])>x,p&&(g.parsed=i,g.raw=l.data[h]),c&&(g.options=d||this.resolveDataElementOptions(h,e.active?"active":n)),m||this.updateElement(e,h,g,n),b=i}this.updateSharedOptions(d,n,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}let i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;let r=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,s)/2}};function Dn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Pn.id="scatter",Pn.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Pn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Cn=class{constructor(t){this.options=t||{}}init(t){}formats(){return Dn()}parse(t,e){return Dn()}format(t,e){return Dn()}add(t,e,i){return Dn()}diff(t,e,i){return Dn()}startOf(t,e,i){return Dn()}endOf(t,e){return Dn()}};Cn.override=function(t){Object.assign(Cn.prototype,t)};var An={_date:Cn};function Tn(t,e,i,n){let{controller:r,data:s,_sorted:a}=t,o=r._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&a&&s.length){let t=o._reversePixels?ft:ut;if(!n)return t(s,e,i);if(r._sharedOptions){let n=s[0],r="function"==typeof n.getRange&&n.getRange(e);if(r){let n=t(s,e,i-r),a=t(s,e,i+r);return{lo:n.lo,hi:a.hi}}}}return{lo:0,hi:s.length-1}}function jn(t,e,i,n,r){let s=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=s.length;t<i;++t){let{index:i,data:o}=s[t],{lo:l,hi:h}=Tn(s[t],e,a,r);for(let t=l;t<=h;++t){let e=o[t];e.skip||n(e,i,t)}}}function In(t,e,i,n,r){let s=[];return!r&&!t.isPointInArea(e)||jn(t,i,e,(function(i,a,o){!r&&!ve(i,t.chartArea,0)||i.inRange(e.x,e.y,n)&&s.push({element:i,datasetIndex:a,index:o})}),!0),s}function Rn(t,e,i,n,r,s){let a=[],o=function(t){let e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){let r=e?Math.abs(t.x-n.x):0,s=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}(i),l=Number.POSITIVE_INFINITY;return jn(t,i,e,(function(i,h,d){let c=i.inRange(e.x,e.y,r);if(n&&!c)return;let u=i.getCenterPoint(r);if(!s&&!t.isPointInArea(u)&&!c)return;let f=o(e,u);f<l?(a=[{element:i,datasetIndex:h,index:d}],l=f):f===l&&a.push({element:i,datasetIndex:h,index:d})})),a}function En(t,e,i,n,r,s){return s||t.isPointInArea(e)?"r"!==i||n?Rn(t,e,i,n,r,s):function(t,e,i,n){let r=[];return jn(t,i,e,(function(t,i,s){let{startAngle:a,endAngle:o}=t.getProps(["startAngle","endAngle"],n),{angle:l}=rt(t,{x:e.x,y:e.y});lt(l,a,o)&&r.push({element:t,datasetIndex:i,index:s})})),r}(t,e,i,r):[]}function Ln(t,e,i,n,r){let s=[],a="x"===i?"inXRange":"inYRange",o=!1;return jn(t,i,e,(t,n,l)=>{t[a](e[i],r)&&(s.push({element:t,datasetIndex:n,index:l}),o=o||t.inRange(e.x,e.y,r))}),n&&!o?[]:s}var zn={modes:{index(t,e,i,n){let r=ui(e,t),s=i.axis||"x",a=i.includeInvisible||!1,o=i.intersect?In(t,r,s,n,a):En(t,r,s,!1,n,a),l=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=o[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){let r=ui(e,t),s=i.axis||"xy",a=i.includeInvisible||!1,o=i.intersect?In(t,r,s,n,a):En(t,r,s,!1,n,a);if(o.length>0){let e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;t<i.length;++t)o.push({element:i[t],datasetIndex:e,index:t})}return o},point:(t,e,i,n)=>In(t,ui(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){let r=ui(e,t),s=i.axis||"xy",a=i.includeInvisible||!1;return En(t,r,s,i.intersect,n,a)},x:(t,e,i,n)=>Ln(t,ui(e,t),"x",i.intersect,n),y:(t,e,i,n)=>Ln(t,ui(e,t),"y",i.intersect,n)}},Fn=["left","top","right","bottom"];function Wn(t,e){return t.filter(t=>t.pos===e)}function Nn(t,e){return t.filter(t=>-1===Fn.indexOf(t.pos)&&t.box.axis===e)}function Vn(t,e){return t.sort((t,i)=>{let n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function Bn(t,e){let i,n,r,s=function(t){let e={};for(let i of t){let{stack:t,pos:n,stackWeight:r}=i;if(!t||!Fn.includes(n))continue;let s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=r}return e}(t),{vBoxMaxWidth:a,hBoxMaxHeight:o}=e;for(i=0,n=t.length;i<n;++i){r=t[i];let{fullSize:n}=r.box,l=s[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*a:n&&e.availableWidth,r.height=o):(r.width=a,r.height=h?h*o:n&&e.availableHeight)}return s}function Hn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function Yn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function $n(t,e,i,n){let{pos:r,box:s}=i,a=t.maxPadding;if(!_(r)){i.size&&(t[r]-=i.size);let e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[r]+=i.size}s.getPadding&&Yn(a,s.getPadding());let o=Math.max(0,e.outerWidth-Hn(a,t,"left","right")),l=Math.max(0,e.outerHeight-Hn(a,t,"top","bottom")),h=o!==t.w,d=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:h,other:d}:{same:d,other:h}}function Xn(t,e){let i=e.maxPadding;return function(t){let n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function Un(t,e,i,n){let r,s,a,o,l,h,d=[];for(r=0,s=t.length,l=0;r<s;++r){a=t[r],o=a.box,o.update(a.width||e.w,a.height||e.h,Xn(a.horizontal,e));let{same:s,other:c}=$n(e,i,a,n);l|=s&&d.length,h=h||c,o.fullSize||d.push(a)}return l&&Un(d,e,i,n)||h}function qn(t,e,i,n,r){t.top=i,t.left=e,t.right=e+n,t.bottom=i+r,t.width=n,t.height=r}function Kn(t,e,i,n){let r=i.padding,{x:s,y:a}=e;for(let o of t){let t=o.box,l=n[o.stack]||{placed:0,weight:1},h=o.stackWeight/l.weight||1;if(o.horizontal){let n=e.w*h,s=l.size||t.height;F(l.start)&&(a=l.start),t.fullSize?qn(t,r.left,a,i.outerWidth-r.right-r.left,s):qn(t,e.left+l.placed,a,n,s),l.start=a,l.placed+=n,a=t.bottom}else{let n=e.h*h,a=l.size||t.width;F(l.start)&&(s=l.start),t.fullSize?qn(t,s,r.top,a,i.outerHeight-r.bottom-r.top):qn(t,s,e.top+l.placed,a,n),l.start=s,l.placed+=n,s=t.right}}e.x=s,e.y=a}fe.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Gn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;let r=Ee(t.options.layout.padding),s=Math.max(e-r.width,0),a=Math.max(i-r.height,0),o=function(t){let e=function(t){let e,i,n,r,s,a,o=[];for(e=0,i=(t||[]).length;e<i;++e)n=t[e],({position:r,options:{stack:s,stackWeight:a=1}}=n),o.push({index:e,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:s&&r+s,stackWeight:a});return o}(t),i=Vn(e.filter(t=>t.box.fullSize),!0),n=Vn(Wn(e,"left"),!0),r=Vn(Wn(e,"right")),s=Vn(Wn(e,"top"),!0),a=Vn(Wn(e,"bottom")),o=Nn(e,"x"),l=Nn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(a).concat(o),chartArea:Wn(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(a).concat(o)}}(t.boxes),l=o.vertical,h=o.horizontal;P(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let d=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/d,hBoxMaxHeight:a/2}),u=Object.assign({},r);Yn(u,Ee(n));let f=Object.assign({maxPadding:u,w:s,h:a,x:r.left,y:r.top},r),g=Bn(l.concat(h),c);Un(o.fullSize,f,c,g),Un(l,f,c,g),Un(h,f,c,g)&&Un(l,f,c,g),function(t){let e=t.maxPadding;function i(i){let n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),Kn(o.leftAndTop,f,c,g),f.x+=f.w,f.y+=f.h,Kn(o.rightAndBottom,f,c,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},P(o.chartArea,e=>{let i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},Jn=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}},Zn=class extends Jn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Qn="$chartjs",tr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},er=t=>null===t||""===t;var ir=!!xi&&{passive:!0};function nr(t,e,i){t.canvas.removeEventListener(e,i,ir)}function rr(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function sr(t,e,i){let n=t.canvas,r=new MutationObserver(t=>{let e=!1;for(let i of t)e=e||rr(i.addedNodes,n),e=e&&!rr(i.removedNodes,n);e&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}function ar(t,e,i){let n=t.canvas,r=new MutationObserver(t=>{let e=!1;for(let i of t)e=e||rr(i.removedNodes,n),e=e&&!rr(i.addedNodes,n);e&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}var or=new Map,lr=0;function hr(){let t=window.devicePixelRatio;t!==lr&&(lr=t,or.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function dr(t,e,i){let n=t.canvas,r=n&&oi(n);if(!r)return;let s=bt((t,e)=>{let n=r.clientWidth;i(t,e),n<r.clientWidth&&i()},window),a=new ResizeObserver(t=>{let e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)});return a.observe(r),function(t,e){or.size||window.addEventListener("resize",hr),or.set(t,e)}(t,s),a}function cr(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){or.delete(t),or.size||window.removeEventListener("resize",hr)}(t)}function ur(t,e,i){let n=t.canvas,r=bt(e=>{null!==t.ctx&&i(function(t,e){let i=tr[t.type]||t.type,{x:n,y:r}=ui(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==r?r:null}}(e,t))},t,t=>{let e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,ir)}(n,e,r),r}var fr=class extends Jn{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){let i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[Qn]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",er(r)){let e=mi(t,"width");void 0!==e&&(t.width=e)}if(er(n))if(""===t.style.height)t.height=t.width/(e||2);else{let e=mi(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[Qn])return!1;let i=e[Qn].initial;["height","width"].forEach(t=>{let n=i[t];y(n)?e.removeAttribute(t):e.setAttribute(t,n)});let n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[Qn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),r={attach:sr,detach:ar,resize:dr}[e]||ur;n[e]=r(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:cr,detach:cr,resize:cr}[e]||nr)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return gi(t,e,i,n)}isAttached(t){let e=oi(t);return!(!e||!e.isConnected)}};function gr(t,e){return e||!1!==t?!0===t?{}:t:null}function pr(t,{plugin:e,local:i},n,r){let s=t.pluginScopeKeys(e),a=t.getOptionScopes(n,s);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function xr(t,e){let i=fe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function mr(t,e){return"x"===t||"y"===t?t:e.axis||function(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}(e.position)||t.charAt(0).toLowerCase()}function br(t){let e=t.options||(t.options={});e.plugins=k(e.plugins,{}),e.scales=function(t,e){let i=he[t.type]||{scales:{}},n=e.scales||{},r=xr(t.type,e),s=Object.create(null),a=Object.create(null);return Object.keys(n).forEach(t=>{let e=n[t];if(!_(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);let o=mr(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(o,r),h=i.scales||{};s[o]=s[o]||t,a[t]=I(Object.create(null),[{axis:o},e,h[o],h[l]])}),t.data.datasets.forEach(i=>{let r=i.type||t.type,o=i.indexAxis||xr(r,e),l=(he[r]||{}).scales||{};Object.keys(l).forEach(t=>{let e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),r=i[e+"AxisID"]||s[e]||e;a[r]=a[r]||Object.create(null),I(a[r],[{axis:e},n[r],l[t]])})}),Object.keys(a).forEach(t=>{let e=a[t];I(e,[fe.scales[e.type],fe.scale])}),a}(t,e)}function yr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}var vr=new Map,_r=new Set;function wr(t,e){let i=vr.get(t);return i||(i=e(),vr.set(t,i),_r.add(i)),i}var Mr=(t,e,i)=>{let n=L(e,i);void 0!==n&&t.add(n)};function kr(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));let r=i.join(),s=n.get(r);return s||(s={resolver:We(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(r,s)),s}var Sr=t=>_(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||W(t[i]),!1);var Or=["top","bottom","left","right","chartArea"];function Pr(t,e){return"top"===t||"bottom"===t||-1===Or.indexOf(t)&&"x"===e}function Dr(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Cr(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),O(i&&i.onComplete,[t],e)}function Ar(t){let e=t.chart,i=e.options.animation;O(i&&i.onProgress,[t],e)}function Tr(t){return ai()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}var jr={},Ir=t=>{let e=Tr(t);return Object.values(jr).filter(t=>t.canvas===e).pop()};function Rr(t,e,i){let n=Object.keys(t);for(let r of n){let n=+r;if(n>=e){let s=t[r];delete t[r],(i>0||n>e)&&(t[n+i]=s)}}}var Er=class{constructor(t,e){let i=this.config=new class{constructor(t){var e;this._config=((e=(e=t)||{}).data=yr(e.data),br(e),e),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=yr(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),br(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return wr(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return wr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return wr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){let e=t.id;return wr(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){let{options:n,type:r}=this,s=this._cachedScopes(t,i),a=s.get(e);if(a)return a;let o=new Set;e.forEach(e=>{t&&(o.add(t),e.forEach(e=>Mr(o,t,e))),e.forEach(t=>Mr(o,n,t)),e.forEach(t=>Mr(o,he[r]||{},t)),e.forEach(t=>Mr(o,fe,t)),e.forEach(t=>Mr(o,de,t))});let l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),_r.has(e)&&s.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,he[e]||{},fe.datasets[e]||{},{type:e},fe,de]}resolveNamedOptions(t,e,i,n=[""]){let r={$shared:!0},{resolver:s,subPrefixes:a}=kr(this._resolverCache,t,n),o=s;if(function(t,e){let{isScriptable:i,isIndexable:n}=Ve(t);for(let r of e){let e=i(r),s=n(r),a=(s||e)&&t[r];if(e&&(W(a)||Sr(a))||s&&v(a))return!0}return!1}(s,e)){r.$shared=!1,o=Ne(s,i=W(i)?i():i,this.createResolver(t,i,a))}for(let t of e)r[t]=o[t];return r}createResolver(t,e,i=[""],n){let{resolver:r}=kr(this._resolverCache,t,i);return _(e)?Ne(r,e,void 0,n):r}}(e),n=Tr(t),r=Ir(n);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.");let s=i.createResolver(i.chartOptionScopes(),this.getContext());var a;this.platform=new(i.platform||(a=n,!ai()||"undefined"!=typeof OffscreenCanvas&&a instanceof OffscreenCanvas?Zn:fr)),this.platform.updateConfig(i);let o=this.platform.acquireContext(n,s.aspectRatio),l=o&&o.canvas,h=l&&l.height,d=l&&l.width;this.id=b(),this.ctx=o,this.canvas=l,this.width=d,this.height=h,this._options=s,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 class{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let r=n?this._descriptors(t).filter(n):this._descriptors(t),s=this._notify(r,t,e,i);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,n){n=n||{};for(let r of t){let t=r.plugin;if(!1===O(t[i],[e,n,r.options],t)&&n.cancelable)return!1}return!0}invalidate(){y(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,n=k(i.options&&i.options.plugins,{}),r=function(t){let e={},i=[],n=Object.keys(On.plugins.items);for(let t=0;t<n.length;t++)i.push(On.getPlugin(n[t]));let r=t.plugins||[];for(let t=0;t<r.length;t++){let n=r[t];-1===i.indexOf(n)&&(i.push(n),e[n.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},n,r){let s=[],a=t.getContext();for(let o of e){let e=o.id,l=gr(n[e],r);null!==l&&s.push({plugin:o,options:pr(t.config,{plugin:o,local:i[e]},l,a)})}return s}(t,r,n,e):[]}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}},this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),s.resizeDelay||0),this._dataChanges=[],jr[this.id]=this,o&&l?(Ii.listen(this,"complete",Cr),Ii.listen(this,"progress",Ar),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return y(t)?e&&r?r:n?i/n: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return me(this.canvas,this.ctx),this}stop(){return Ii.stop(this),this}resize(t,e){Ii.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,pi(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),O(i.onResize,[this,s],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){P(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),r=[];e&&(r=r.concat(Object.keys(e).map(t=>{let i=e[t],n=mr(t,i),r="r"===n,s="x"===n;return{options:i,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}}))),P(r,e=>{let r=e.options,s=r.id,a=mr(s,r),o=k(r.type,e.dtype);(void 0===r.position||Pr(r.position,a)!==Pr(e.dposition))&&(r.position=e.dposition),n[s]=!0;let l=null;if(s in i&&i[s].type===o)l=i[s];else{l=new(On.getScale(o))({id:s,type:o,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(r,t)}),P(n,(t,e)=>{t||delete i[e]}),P(i,t=>{Gn.configure(this,t,t.options),Gn.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Dr("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e,i=[],n=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=n.length;t<e;t++){let e=n[t],r=this.getDatasetMeta(t),s=e.type||this.config.type;if(r.type&&r.type!==s&&(this._destroyDatasetMeta(t),r=this.getDatasetMeta(t)),r.type=s,r.indexAxis=e.indexAxis||xr(s,this.options),r.order=e.order||0,r.index=t,r.label=""+e.label,r.visible=this.isDatasetVisible(t),r.controller)r.controller.updateIndex(t),r.controller.linkScales();else{let e=On.getController(s),{datasetElementType:n,dataElementType:a}=fe.datasets[s];Object.assign(e.prototype,{dataElementType:On.getElement(a),datasetElementType:n&&On.getElement(n)}),r.controller=new e(this,t),i.push(r.controller)}}return this._updateMetasets(),i}_resetElements(){P(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t<e;t++){let{controller:e}=this.getDatasetMeta(t),i=!n&&-1===r.indexOf(e);e.buildOrUpdateElements(i),s=Math.max(+e.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),n||P(r,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Dr("z","_idx"));let{_active:a,_lastEvent:o}=this;o?this._eventHandler(o,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){P(this.scales,t=>{Gn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!N(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:n,count:r}of e){Rr(t,n,"_removeElements"===i?-r:r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;t<e;t++)if(!N(n,i(t)))return;return Array.from(n).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Gn.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],P(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,W(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Ii.has(this)?this.attached&&!Ii.running(this)&&Ii.start(this):(this.draw(),Cr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;let 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){let e,i,n=this._sortedMetasets,r=[];for(e=0,i=n.length;e<i;++e){let i=n[e];(!t||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,n=!i.disabled,r=this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&_e(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&we(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){let r=zn.modes[e];return"function"==typeof r?r(this,t,i,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={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(n)),n}getContext(){return this.$context||(this.$context=Fe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let n=i?"show":"hide",r=this.getDatasetMeta(t),s=r.controller._resolveAnimations(void 0,n);F(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(r,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ii.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),me(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete jr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};P(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t,e=this._responsiveListeners,i=this.platform,n=(t,n)=>{i.addEventListener(this,t,n),e[t]=n},r=(t,n)=>{e[t]&&(i.removeEventListener(this,t,n),delete e[t])},s=(t,e)=>{this.canvas&&this.resize(t,e)},a=()=>{r("attach",a),this.attached=!0,this.resize(),n("resize",s),n("detach",t)};t=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),n("attach",a)},i.isAttached(this.canvas)?a():t()}unbindEvents(){P(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},P(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let n,r,s,a,o=i?"set":"remove";for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+o+"DatasetHoverStyle"]()),s=0,a=t.length;s<a;++s){r=t[s];let e=r&&this.getDatasetMeta(r.datasetIndex).controller;e&&e[o+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{let i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!D(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){let n=this.options.hover,r=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=r(e,t),a=i?t:r(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;let r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:n=[],options:r}=this,s=e,a=this._getActiveElements(t,n,i,s),o="mouseup"===(h=t).type||"click"===h.type||"contextmenu"===h.type,l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,o);var h;i&&(this._lastEvent=null,O(r.onHover,[t,a,this],this),o&&O(r.onClick,[t,a,this],this));let d=!D(a,n);return(d||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=l,d}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}},Lr=()=>P(Er.instances,t=>t._plugins.invalidate());function zr(t,e,i){let{startAngle:n,pixelMargin:r,x:s,y:a,outerRadius:o,innerRadius:l}=e,h=r/o;t.beginPath(),t.arc(s,a,o,n-h,i+h),l>r?(h=r/l,t.arc(s,a,l,i+h,n-h,!0)):t.arc(s,a,r,i+X,n-X),t.closePath(),t.clip()}function Fr(t,e,i,n){let r=function(t){return je(t,["outerStart","outerEnd","innerStart","innerEnd"])}(t.options.borderRadius),s=(i-e)/2,a=Math.min(s,n*e/2),o=t=>{let e=(i-Math.min(s,t))*n/2;return ht(t,0,Math.min(s,e))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:ht(r.innerStart,0,a),innerEnd:ht(r.innerEnd,0,a)}}function Wr(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Nr(t,e,i,n,r,s){let{x:a,y:o,startAngle:l,pixelMargin:h,innerRadius:d}=e,c=Math.max(e.outerRadius+n+i-h,0),u=d>0?d+n+i+h:0,f=0,g=r-l;if(n){let t=((d>0?d-n:0)+(c>0?c-n:0))/2;f=(g-(0!==t?g*t/(t+n):g))/2}let p=(g-Math.max(.001,g*c-i/V)/c)/2,x=l+p+f,m=r-p-f,{outerStart:b,outerEnd:y,innerStart:v,innerEnd:_}=Fr(e,u,c,m-x),w=c-b,M=c-y,k=x+b/w,S=m-y/M,O=u+v,P=u+_,D=x+v/O,C=m-_/P;if(t.beginPath(),s){if(t.arc(a,o,c,k,S),y>0){let e=Wr(M,S,a,o);t.arc(e.x,e.y,y,S,m+X)}let e=Wr(P,m,a,o);if(t.lineTo(e.x,e.y),_>0){let e=Wr(P,C,a,o);t.arc(e.x,e.y,_,m+X,C+Math.PI)}if(t.arc(a,o,u,m-_/u,x+v/u,!0),v>0){let e=Wr(O,D,a,o);t.arc(e.x,e.y,v,D+Math.PI,x-X)}let i=Wr(w,x,a,o);if(t.lineTo(i.x,i.y),b>0){let e=Wr(w,k,a,o);t.arc(e.x,e.y,b,x-X,k)}}else{t.moveTo(a,o);let e=Math.cos(k)*c+a,i=Math.sin(k)*c+o;t.lineTo(e,i);let n=Math.cos(S)*c+a,r=Math.sin(S)*c+o;t.lineTo(n,r)}t.closePath()}function Vr(t,e,i,n,r,s){let{options:a}=e,{borderWidth:o,borderJoinStyle:l}=a,h="inner"===a.borderAlign;o&&(h?(t.lineWidth=2*o,t.lineJoin=l||"round"):(t.lineWidth=o,t.lineJoin=l||"bevel"),e.fullCircles&&function(t,e,i){let n,{x:r,y:s,startAngle:a,pixelMargin:o,fullCircles:l}=e,h=Math.max(e.outerRadius-o,0),d=e.innerRadius+o;for(i&&zr(t,e,a+B),t.beginPath(),t.arc(r,s,d,a+B,a,!0),n=0;n<l;++n)t.stroke();for(t.beginPath(),t.arc(r,s,h,a,a+B),n=0;n<l;++n)t.stroke()}(t,e,h),h&&zr(t,e,r),Nr(t,e,i,n,r,s),t.stroke())}Object.defineProperties(Er,{defaults:{enumerable:!0,value:fe},instances:{enumerable:!0,value:jr},overrides:{enumerable:!0,value:he},registry:{enumerable:!0,value:On},version:{enumerable:!0,value:"3.9.1"},getChart:{enumerable:!0,value:Ir},register:{enumerable:!0,value:(...t)=>{On.add(...t),Lr()}},unregister:{enumerable:!0,value:(...t)=>{On.remove(...t),Lr()}}});var Br=class extends fn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){let n=this.getProps(["x","y"],i),{angle:r,distance:s}=rt(n,{x:t,y:e}),{startAngle:a,endAngle:o,innerRadius:l,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),c=this.options.spacing/2,u=k(d,o-a)>=B||lt(r,a,o),f=dt(s,l+c,h+c);return u&&f}getCenterPoint(t){let{x:e,y:i,startAngle:n,endAngle:r,innerRadius:s,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:l}=this.options,h=(n+r)/2,d=(s+a+l+o)/2;return{x:e+Math.cos(h)*d,y:i+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,n=(e.offset||0)/2,r=(e.spacing||0)/2,s=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>B?Math.floor(i/B):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;let e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=V&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,Vr(t,this,a,r,function(t,e,i,n,r){let{fullCircles:s,startAngle:a,circumference:o}=e,l=e.endAngle;if(s){Nr(t,e,i,n,a+B,r);for(let e=0;e<s;++e)t.fill();isNaN(o)||(l=a+o%B,o%B==0&&(l+=B))}return Nr(t,e,i,n,l,r),t.fill(),l}(t,this,a,r,s),s),t.restore()}};function Hr(t,e,i=e){t.lineCap=k(i.borderCapStyle,e.borderCapStyle),t.setLineDash(k(i.borderDash,e.borderDash)),t.lineDashOffset=k(i.borderDashOffset,e.borderDashOffset),t.lineJoin=k(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=k(i.borderWidth,e.borderWidth),t.strokeStyle=k(i.borderColor,e.borderColor)}function Yr(t,e,i){t.lineTo(i.x,i.y)}function $r(t,e,i={}){let n=t.length,{start:r=0,end:s=n-1}=i,{start:a,end:o}=e,l=Math.max(r,a),h=Math.min(s,o),d=r<a&&s<a||r>o&&s>o;return{count:n,start:l,loop:e.loop,ilen:h<l&&!d?n+h-l:h-l}}function Xr(t,e,i,n){let r,s,a,{points:o,options:l}=e,{count:h,start:d,loop:c,ilen:u}=$r(o,i,n),f=function(t){return t.stepped?Me:t.tension||"monotone"===t.cubicInterpolationMode?ke:Yr}(l),{move:g=!0,reverse:p}=n||{};for(r=0;r<=u;++r)s=o[(d+(p?u-r:r))%h],!s.skip&&(g?(t.moveTo(s.x,s.y),g=!1):f(t,a,s,p,l.stepped),a=s);return c&&(s=o[(d+(p?u:0))%h],f(t,a,s,p,l.stepped)),!!c}function Ur(t,e,i,n){let r,s,a,o,l,h,d=e.points,{count:c,start:u,ilen:f}=$r(d,i,n),{move:g=!0,reverse:p}=n||{},x=0,m=0,b=t=>(u+(p?f-t:t))%c,y=()=>{o!==l&&(t.lineTo(x,l),t.lineTo(x,o),t.lineTo(x,h))};for(g&&(s=d[b(0)],t.moveTo(s.x,s.y)),r=0;r<=f;++r){if(s=d[b(r)],s.skip)continue;let e=s.x,i=s.y,n=0|e;n===a?(i<o?o=i:i>l&&(l=i),x=(m*x+e)/++m):(y(),t.lineTo(e,i),a=n,m=0,o=l=i),h=i}y()}function qr(t){let e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Xr:Ur}Br.id="arc",Br.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},Br.defaultRoutes={backgroundColor:"backgroundColor"};var Kr="function"==typeof Path2D;function Gr(t,e,i,n){Kr&&!e.options.segment?function(t,e,i,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,i,n)&&r.closePath()),Hr(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){let{segments:r,options:s}=e,a=qr(e);for(let o of r)Hr(t,s,o.style),t.beginPath(),a(t,e,o,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}var Jr=class extends fn{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){let i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){let n=i.spanGaps?this._loop:this._fullLoop;si(this._points,i,t,n,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=function(t,e){let i=t.points,n=t.options.spanGaps,r=i.length;if(!r)return[];let s=!!t._loop,{start:a,end:o}=function(t,e,i,n){let r=0,s=e-1;if(i&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,i&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(i,r,s,n);return Ai(t,!0===n?[{start:a,end:o,loop:s}]:function(t,e,i,n){let r,s=t.length,a=[],o=e,l=t[e];for(r=e+1;r<=i;++r){let i=t[r%s];i.skip||i.stop?l.skip||(n=!1,a.push({start:e%s,end:(r-1)%s,loop:n}),e=o=i.stop?r:null):(o=r,l.skip&&(e=r)),l=i}return null!==o&&a.push({start:e%s,end:o%s,loop:n}),a}(i,a,o<a?o+r:o,!!t._fullLoop&&0===a&&o===r-1),i,e)}(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,n=t[e],r=this.points,s=Ci(this,{property:e,start:n,end:n});if(!s.length)return;let a,o,l=[],h=(d=i).stepped?yi:d.tension||"monotone"===d.cubicInterpolationMode?vi:bi;var d;for(a=0,o=s.length;a<o;++a){let{start:o,end:d}=s[a],c=r[o],u=r[d];if(c===u){l.push(c);continue}let f=h(c,u,Math.abs((n-c[e])/(u[e]-c[e])),i.stepped);f[e]=t[e],l.push(f)}return 1===l.length?l[0]:l}pathSegment(t,e,i){return qr(this)(t,this,e,i)}path(t,e,i){let n=this.segments,r=qr(this),s=this._loop;e=e||0,i=i||this.points.length-e;for(let a of n)s&=r(t,this,a,{start:e,end:e+i-1});return!!s}draw(t,e,i,n){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Gr(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function Zr(t,e,i,n){let r=t.options,{[i]:s}=t.getProps([i],n);return Math.abs(e-s)<r.radius+r.hitRadius}Jr.id="line",Jr.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Jr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Jr.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};var Qr=class extends fn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){let n=this.options,{x:r,y:s}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(e-s,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Zr(this,t,"x",e)}inYRange(t,e){return Zr(this,t,"y",e)}getCenterPoint(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){let i=this.options;this.skip||i.radius<.1||!ve(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,be(t,i,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};function ts(t,e){let i,n,r,s,a,{x:o,y:l,base:h,width:d,height:c}=t.getProps(["x","y","base","width","height"],e);return t.horizontal?(a=c/2,i=Math.min(o,h),n=Math.max(o,h),r=l-a,s=l+a):(a=d/2,i=o-a,n=o+a,r=Math.min(l,h),s=Math.max(l,h)),{left:i,top:r,right:n,bottom:s}}function es(t,e,i,n){return t?0:ht(e,i,n)}function is(t){let e=ts(t),i=e.right-e.left,n=e.bottom-e.top,r=function(t,e,i){let n=t.options.borderWidth,r=t.borderSkipped,s=Ie(n);return{t:es(r.top,s.top,0,i),r:es(r.right,s.right,0,e),b:es(r.bottom,s.bottom,0,i),l:es(r.left,s.left,0,e)}}(t,i/2,n/2),s=function(t,e,i){let{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=Re(r),a=Math.min(e,i),o=t.borderSkipped,l=n||_(r);return{topLeft:es(!l||o.top||o.left,s.topLeft,0,a),topRight:es(!l||o.top||o.right,s.topRight,0,a),bottomLeft:es(!l||o.bottom||o.left,s.bottomLeft,0,a),bottomRight:es(!l||o.bottom||o.right,s.bottomRight,0,a)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:i-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function ns(t,e,i,n){let r=null===e,s=null===i,a=t&&!(r&&s)&&ts(t,n);return a&&(r||dt(e,a.left,a.right))&&(s||dt(i,a.top,a.bottom))}function rs(t,e){t.rect(e.x,e.y,e.w,e.h)}function ss(t,e,i={}){let n=t.x!==i.x?-e:0,r=t.y!==i.y?-e:0,s=(t.x+t.w!==i.x+i.w?e:0)-n,a=(t.y+t.h!==i.y+i.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+s,h:t.h+a,radius:t.radius}}Qr.id="point",Qr.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Qr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var as=class extends fn{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){let{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:r,outer:s}=is(this),a=(o=s.radius).topLeft||o.topRight||o.bottomLeft||o.bottomRight?Pe:rs;var o;t.save(),(s.w!==r.w||s.h!==r.h)&&(t.beginPath(),a(t,ss(s,e,r)),t.clip(),a(t,ss(r,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ss(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return ns(this,t,e,i)}inXRange(t,e){return ns(this,t,null,e)}inYRange(t,e){return ns(this,null,t,e)}getCenterPoint(t){let{x:e,y:i,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+n)/2:e,y:r?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}};function os(t,e,i,n){if(n)return;let r=e[t],s=i[t];return"angle"===t&&(r=ot(r),s=ot(s)),{property:t,start:r,end:s}}function ls(t,e,i){for(;e>t;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function hs(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ds(t,e){let i=[],n=!1;return v(t)?(n=!0,i=t):i=function(t,e){let{x:i=null,y:n=null}=t||{},r=e.points,s=[];return e.segments.forEach(({start:t,end:e})=>{e=ls(t,e,r);let a=r[t],o=r[e];null!==n?(s.push({x:a.x,y:n}),s.push({x:o.x,y:n})):null!==i&&(s.push({x:i,y:a.y}),s.push({x:i,y:o.y}))}),s}(t,e),i.length?new Jr({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function cs(t){return t&&!1!==t.fill}function us(t,e,i){let n,r=t[e].fill,s=[e];if(!i)return r;for(;!1!==r&&-1===s.indexOf(r);){if(!w(r))return r;if(n=t[r],!n)return!1;if(n.visible)return r;s.push(r),r=n.fill}return!1}function fs(t,e,i){let n=function(t){let e=t.options,i=e.fill,n=k(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if(_(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return w(r)&&Math.floor(r)===r?function(t,e,i,n){return("-"===t||"+"===t)&&(i=e+i),!(i===e||i<0||i>=n)&&i}(n[0],e,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function gs(t,e,i){let n=[];for(let r=0;r<i.length;r++){let s=i[r],{first:a,last:o,point:l}=ps(s,e,"x");if(!(!l||a&&o))if(a)n.unshift(l);else if(t.push(l),!o)break}t.push(...n)}function ps(t,e,i){let n=t.interpolate(e,i);if(!n)return{};let r=n[i],s=t.segments,a=t.points,o=!1,l=!1;for(let t=0;t<s.length;t++){let e=s[t],n=a[e.start][i],h=a[e.end][i];if(dt(r,n,h)){o=r===n,l=r===h;break}}return{first:o,last:l,point:n}}as.id="bar",as.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},as.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var xs=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){let{x:n,y:r,radius:s}=this;return e=e||{start:0,end:B},t.arc(n,r,s,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}};function ms(t){let{chart:e,fill:i,line:n}=t;if(w(i))return function(t,e){let i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){let{scale:e,index:i,line:n}=t,r=[],s=n.segments,a=n.points,o=function(t,e){let i=[],n=t.getMatchingVisibleMetas("line");for(let t=0;t<n.length;t++){let r=n[t];if(r.index===e)break;r.hidden||i.unshift(r.dataset)}return i}(e,i);o.push(ds({x:null,y:e.bottom},n));for(let t=0;t<s.length;t++){let e=s[t];for(let t=e.start;t<=e.end;t++)gs(r,a[t],o)}return new Jr({points:r,options:{}})}(t);if("shape"===i)return!0;let r=function(t){return(t.scale||{}).getPointPositionForValue?function(t){let{scale:e,fill:i}=t,n=e.options,r=e.getLabels().length,s=n.reverse?e.max:e.min,a=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:_(t)?t.value:e.getBaseValue(),n}(i,e,s),o=[];if(n.grid.circular){let t=e.getPointPositionForValue(0,s);return new xs({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(a)})}for(let t=0;t<r;++t)o.push(e.getPointPositionForValue(t,a));return o}(t):function(t){let{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:_(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(w(n)){let t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return r instanceof xs?r:ds(r,n)}function bs(t,e,i){let n=ms(e),{line:r,scale:s,axis:a}=e,o=r.options,l=o.fill,h=o.backgroundColor,{above:d=h,below:c=h}=l||{};n&&r.points.length&&(_e(t,i),function(t,e){let{line:i,target:n,above:r,below:s,area:a,scale:o}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==r&&(ys(t,n,a.top),vs(t,{line:i,target:n,color:r,scale:o,property:l}),t.restore(),t.save(),ys(t,n,a.bottom)),vs(t,{line:i,target:n,color:s,scale:o,property:l}),t.restore()}(t,{line:r,target:n,above:d,below:c,area:i,scale:s,axis:a}),we(t))}function ys(t,e,i){let{segments:n,points:r}=e,s=!0,a=!1;t.beginPath();for(let o of n){let{start:n,end:l}=o,h=r[n],d=r[ls(n,l,r)];s?(t.moveTo(h.x,h.y),s=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,o,{move:a}),a?t.closePath():t.lineTo(d.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function vs(t,e){let{line:i,target:n,property:r,color:s,scale:a}=e,o=function(t,e,i){let n=t.segments,r=t.points,s=e.points,a=[];for(let t of n){let{start:n,end:o}=t;o=ls(n,o,r);let l=os(i,r[n],r[o],t.loop);if(!e.segments){a.push({source:t,target:l,start:r[n],end:r[o]});continue}let h=Ci(e,l);for(let e of h){let n=os(i,s[e.start],s[e.end],e.loop),o=Di(t,r,n);for(let t of o)a.push({source:t,target:e,start:{[i]:hs(l,n,"start",Math.max)},end:{[i]:hs(l,n,"end",Math.min)}})}}return a}(i,n,r);for(let{source:e,target:l,start:h,end:d}of o){let{style:{backgroundColor:o=s}={}}=e,c=!0!==n;t.save(),t.fillStyle=o,_s(t,a,c&&os(r,h,d)),t.beginPath();let u,f=!!i.pathSegment(t,e);if(c){f?t.closePath():ws(t,n,d,r);let e=!!n.pathSegment(t,l,{move:f,reverse:!0});u=f&&e,u||ws(t,n,h,r)}t.closePath(),t.fill(u?"evenodd":"nonzero"),t.restore()}}function _s(t,e,i){let{top:n,bottom:r}=e.chart.chartArea,{property:s,start:a,end:o}=i||{};"x"===s&&(t.beginPath(),t.rect(a,n,o-a,r-n),t.clip())}function ws(t,e,i,n){let r=e.interpolate(i,n);r&&t.lineTo(r.x,r.y)}var Ms={id:"filler",afterDatasetsUpdate(t,e,i){let n,r,s,a,o=(t.data.datasets||[]).length,l=[];for(r=0;r<o;++r)n=t.getDatasetMeta(r),s=n.dataset,a=null,s&&s.options&&s instanceof Jr&&(a={visible:t.isDatasetVisible(r),index:r,fill:fs(s,r,o),chart:t,axis:n.controller.options.indexAxis,scale:n.vScale,line:s}),n.$filler=a,l.push(a);for(r=0;r<o;++r)a=l[r],a&&!1!==a.fill&&(a.fill=us(l,r,i.propagate))},beforeDraw(t,e,i){let n="beforeDraw"===i.drawTime,r=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let e=r.length-1;e>=0;--e){let i=r[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&i.fill&&bs(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;let n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){let i=n[e].$filler;cs(i)&&bs(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){let n=e.meta.$filler;!cs(n)||"beforeDatasetDraw"!==i.drawTime||bs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},ks=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}},Ss=class extends fn{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(){let t=this.options.labels||{},e=O(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);let i,n,r=t.labels,s=Le(r.font),a=s.size,o=this._computeTitleHeight(),{boxWidth:l,itemHeight:h}=ks(r,a);e.font=s.string,this.isHorizontal()?(i=this.maxWidth,n=this._fitRows(o,a,l,h)+10):(n=this.maxHeight,i=this._fitCols(o,a,l,h)+10),this.width=Math.min(i,t.maxWidth||this.maxWidth),this.height=Math.min(n,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){let{ctx:r,maxWidth:s,options:{labels:{padding:a}}}=this,o=this.legendHitBoxes=[],l=this.lineWidths=[0],h=n+a,d=t;r.textAlign="left",r.textBaseline="middle";let c=-1,u=-h;return this.legendItems.forEach((t,f)=>{let g=i+e/2+r.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>s)&&(d+=h,l[l.length-(f>0?0:1)]=0,u+=h,c++),o[f]={left:0,top:u,row:c,width:g,height:n},l[l.length-1]+=g+a}),d}_fitCols(t,e,i,n){let{ctx:r,maxHeight:s,options:{labels:{padding:a}}}=this,o=this.legendHitBoxes=[],l=this.columnSizes=[],h=s-t,d=a,c=0,u=0,f=0,g=0;return this.legendItems.forEach((t,s)=>{let p=i+e/2+r.measureText(t.text).width;s>0&&u+n+2*a>h&&(d+=c+a,l.push({width:c,height:u}),f+=c+a,g++,c=u=0),o[s]={left:f,top:u,col:g,width:p,height:n},c=Math.max(c,p),u+=n+a}),d+=c,l.push({width:c,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,s=Mi(r,this.left,this.width);if(this.isHorizontal()){let r=0,a=vt(i,this.left+n,this.right-this.lineWidths[r]);for(let o of e)r!==o.row&&(r=o.row,a=vt(i,this.left+n,this.right-this.lineWidths[r])),o.top+=this.top+t+n,o.left=s.leftForLtr(s.x(a),o.width),a+=o.width+n}else{let r=0,a=vt(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(let o of e)o.col!==r&&(r=o.col,a=vt(i,this.top+t+n,this.bottom-this.columnSizes[r].height)),o.top=a,o.left+=this.left+n,o.left=s.leftForLtr(s.x(o.left),o.width),a+=o.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;_e(t,this),this._draw(),we(t)}}_draw(){let t,{options:e,columnSizes:i,lineWidths:n,ctx:r}=this,{align:s,labels:a}=e,o=fe.color,l=Mi(e.rtl,this.left,this.width),h=Le(a.font),{color:d,padding:c}=a,u=h.size,f=u/2;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=h.string;let{boxWidth:g,boxHeight:p,itemHeight:x}=ks(a,u),m=this.isHorizontal(),b=this._computeTitleHeight();t=m?{x:vt(s,this.left+c,this.right-n[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:vt(s,this.top+b+c,this.bottom-i[0].height),line:0},ki(this.ctx,e.textDirection);let y=x+c;this.legendItems.forEach((v,_)=>{r.strokeStyle=v.fontColor||d,r.fillStyle=v.fontColor||d;let w=r.measureText(v.text).width,M=l.textAlign(v.textAlign||(v.textAlign=a.textAlign)),S=g+f+w,O=t.x,P=t.y;l.setWidth(this.width),m?_>0&&O+S+c>this.right&&(P=t.y+=y,t.line++,O=t.x=vt(s,this.left+c,this.right-n[t.line])):_>0&&P+y>this.bottom&&(O=t.x=O+i[t.line].width+c,t.line++,P=t.y=vt(s,this.top+b+c,this.bottom-i[t.line].height)),function(t,e,i){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;r.save();let n=k(i.lineWidth,1);if(r.fillStyle=k(i.fillStyle,o),r.lineCap=k(i.lineCap,"butt"),r.lineDashOffset=k(i.lineDashOffset,0),r.lineJoin=k(i.lineJoin,"miter"),r.lineWidth=n,r.strokeStyle=k(i.strokeStyle,o),r.setLineDash(k(i.lineDash,[])),a.usePointStyle){let s={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},o=l.xPlus(t,g/2);ye(r,s,o,e+f,a.pointStyleWidth&&g)}else{let s=e+Math.max((u-p)/2,0),a=l.leftForLtr(t,g),o=Re(i.borderRadius);r.beginPath(),Object.values(o).some(t=>0!==t)?Pe(r,{x:a,y:s,w:g,h:p,radius:o}):r.rect(a,s,g,p),r.fill(),0!==n&&r.stroke()}r.restore()}(l.x(O),P,v),O=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(M,O+g+f,m?O+S:this.right,e.rtl),function(t,e,i){Se(r,i.text,t,e+x/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})}(l.x(O),P,v),m?t.x+=S+c:t.y+=y}),Si(this.ctx,e.textDirection)}drawTitle(){let t=this.options,e=t.title,i=Le(e.font),n=Ee(e.padding);if(!e.display)return;let r,s=Mi(t.rtl,this.left,this.width),a=this.ctx,o=e.position,l=i.size/2,h=n.top+l,d=this.left,c=this.width;if(this.isHorizontal())c=Math.max(...this.lineWidths),r=this.top+h,d=vt(t.align,d,this.right-c);else{let e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);r=h+vt(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}let u=vt(o,d,d+c);a.textAlign=s.textAlign(yt(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Se(a,e.text,u,r,i)}_computeTitleHeight(){let t=this.options.title,e=Le(t.font),i=Ee(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(dt(t,this.left,this.right)&&dt(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(n=r[i],dt(t,n.left,n.left+n.width)&&dt(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){let e=this.options;if(!function(t,e){return!(("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)&&(!e.onClick||"click"!==t&&"mouseup"!==t))}(t.type,e))return;let i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){let n=this._hoveredItem,r=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(n,i);n&&!r&&O(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!r&&O(e.onHover,[t,i,this],this)}else i&&O(e.onClick,[t,i,this],this)}};var Os={id:"legend",_element:Ss,start(t,e,i){let n=t.legend=new Ss({ctx:t.ctx,options:i,chart:t});Gn.configure(t,n,i),Gn.addBox(t,n)},stop(t){Gn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let n=t.legend;Gn.configure(t,n,i),n.options=i},afterUpdate(t){let e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){let n=e.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:r,color:s}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{let a=t.controller.getStyle(i?0:void 0),o=Ee(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(o.width+o.height)/4,strokeStyle:a.borderColor,pointStyle:n||a.pointStyle,rotation:a.rotation,textAlign:r||a.textAlign,borderRadius:0,datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}},Ps=class extends fn{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){let i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;let n=v(i.text)?i.text.length:1;this._padding=Ee(i.padding);let r=n*Le(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){let e,i,n,{top:r,left:s,bottom:a,right:o,options:l}=this,h=l.align,d=0;return this.isHorizontal()?(i=vt(h,s,o),n=r+t,e=o-s):("left"===l.position?(i=s+t,n=vt(h,a,r),d=-.5*V):(i=o-t,n=vt(h,r,a),d=.5*V),e=a-r),{titleX:i,titleY:n,maxWidth:e,rotation:d}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=Le(e.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:a,rotation:o}=this._drawArgs(n);Se(t,e.text,0,0,i,{color:e.color,maxWidth:a,rotation:o,textAlign:yt(e.align),textBaseline:"middle",translation:[r,s]})}};var Ds={id:"title",_element:Ps,start(t,e,i){!function(t,e){let i=new Ps({ctx:t.ctx,options:e,chart:t});Gn.configure(t,i,e),Gn.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){let e=t.titleBlock;Gn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let n=t.titleBlock;Gn.configure(t,n,i),n.options=i},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}},Cs={average(t){if(!t.length)return!1;let e,i,n=0,r=0,s=0;for(e=0,i=t.length;e<i;++e){let i=t[e].element;if(i&&i.hasValue()){let t=i.tooltipPosition();n+=t.x,r+=t.y,++s}}return{x:n/s,y:r/s}},nearest(t,e){if(!t.length)return!1;let i,n,r,s=e.x,a=e.y,o=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){let n=t[i].element;if(n&&n.hasValue()){let t=st(e,n.getCenterPoint());t<o&&(o=t,r=n)}}if(r){let t=r.tooltipPosition();s=t.x,a=t.y}return{x:s,y:a}}};function As(t,e){return e&&(v(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ts(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function js(t,e){let{element:i,datasetIndex:n,index:r}=e,s=t.getDatasetMeta(n).controller,{label:a,value:o}=s.getLabelAndValue(r);return{chart:t,label:a,parsed:s.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:o,dataset:s.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function Is(t,e){let i=t.chart.ctx,{body:n,footer:r,title:s}=t,{boxWidth:a,boxHeight:o}=e,l=Le(e.bodyFont),h=Le(e.titleFont),d=Le(e.footerFont),c=s.length,u=r.length,f=n.length,g=Ee(e.padding),p=g.height,x=0,m=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(m+=t.beforeBody.length+t.afterBody.length,c&&(p+=c*h.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),m){p+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(m-f)*l.lineHeight+(m-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*d.lineHeight+(u-1)*e.footerSpacing);let b=0,y=function(t){x=Math.max(x,i.measureText(t).width+b)};return i.save(),i.font=h.string,P(t.title,y),i.font=l.string,P(t.beforeBody.concat(t.afterBody),y),b=e.displayColors?a+2+e.boxPadding:0,P(n,t=>{P(t.before,y),P(t.lines,y),P(t.after,y)}),b=0,i.font=d.string,P(t.footer,y),i.restore(),x+=g.width,{width:x,height:p}}function Rs(t,e,i,n){let{x:r,width:s}=i,{width:a,chartArea:{left:o,right:l}}=t,h="center";return"center"===n?h=r<=(o+l)/2?"left":"right":r<=s/2?h="left":r>=a-s/2&&(h="right"),function(t,e,i,n){let{x:r,width:s}=n,a=i.caretSize+i.caretPadding;if("left"===t&&r+s+a>e.width||"right"===t&&r-s-a<0)return!0}(h,t,e,i)&&(h="center"),h}function Es(t,e,i){let n=i.yAlign||e.yAlign||function(t,e){let{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Rs(t,e,i,n),yAlign:n}}function Ls(t,e,i,n){let{caretSize:r,caretPadding:s,cornerRadius:a}=t,{xAlign:o,yAlign:l}=i,h=r+s,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=Re(a),g=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,o),p=function(t,e,i){let{y:n,height:r}=t;return"top"===e?n+=i:n-="bottom"===e?r+i:r/2,n}(e,l,h);return"center"===l?"left"===o?g+=h:"right"===o&&(g-=h):"left"===o?g-=Math.max(d,u)+r:"right"===o&&(g+=Math.max(c,f)+r),{x:ht(g,0,n.width-e.width),y:ht(p,0,n.height-e.height)}}function zs(t,e,i){let n=Ee(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Fs(t){return As([],Ts(t))}function Ws(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}var Ns=class extends fn{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||t._chart,this._chart=this.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(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Fi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,Fe(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){let{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]),a=[];return a=As(a,Ts(n)),a=As(a,Ts(r)),a=As(a,Ts(s)),a}getBeforeBody(t,e){return Fs(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){let{callbacks:i}=e,n=[];return P(t,t=>{let e={before:[],lines:[],after:[]},r=Ws(i,t);As(e.before,Ts(r.beforeLabel.call(this,t))),As(e.lines,r.label.call(this,t)),As(e.after,Ts(r.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return Fs(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){let{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]),a=[];return a=As(a,Ts(n)),a=As(a,Ts(r)),a=As(a,Ts(s)),a}_createItems(t){let e,i,n=this._active,r=this.chart.data,s=[],a=[],o=[],l=[];for(e=0,i=n.length;e<i;++e)l.push(js(this.chart,n[e]));return t.filter&&(l=l.filter((e,i,n)=>t.filter(e,i,n,r))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,r))),P(l,e=>{let i=Ws(t.callbacks,e);s.push(i.labelColor.call(this,e)),a.push(i.labelPointStyle.call(this,e)),o.push(i.labelTextColor.call(this,e))}),this.labelColors=s,this.labelPointStyles=a,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){let i,n=this.options.setContext(this.getContext()),r=this._active,s=[];if(r.length){let t=Cs[n.position].call(this,r,this._eventPosition);s=this._createItems(n),this.title=this.getTitle(s,n),this.beforeBody=this.getBeforeBody(s,n),this.body=this.getBody(s,n),this.afterBody=this.getAfterBody(s,n),this.footer=this.getFooter(s,n);let e=this._size=Is(this,n),a=Object.assign({},t,e),o=Es(this.chart,n,a),l=Ls(n,a,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){let r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){let n,r,s,a,o,l,{xAlign:h,yAlign:d}=this,{caretSize:c,cornerRadius:u}=i,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:x}=Re(u),{x:m,y:b}=t,{width:y,height:v}=e;return"center"===d?(o=b+v/2,"left"===h?(n=m,r=n-c,a=o+c,l=o-c):(n=m+y,r=n+c,a=o-c,l=o+c),s=n):(r="left"===h?m+Math.max(f,p)+c:"right"===h?m+y-Math.max(g,x)-c:this.caretX,"top"===d?(a=b,o=a-c,n=r-c,s=r+c):(a=b+v,o=a+c,n=r+c,s=r-c),l=a),{x1:n,x2:r,x3:s,y1:a,y2:o,y3:l}}drawTitle(t,e,i){let n,r,s,a=this.title,o=a.length;if(o){let l=Mi(i.rtl,this.x,this.width);for(t.x=zs(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",n=Le(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=n.string,s=0;s<o;++s)e.fillText(a[s],l.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+r,s+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,r){let s=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:o,boxWidth:l,boxPadding:h}=r,d=Le(r.bodyFont),c=zs(this,"left",r),u=n.x(c),f=o<d.lineHeight?(d.lineHeight-o)/2:0,g=e.y+f;if(r.usePointStyle){let e={radius:Math.min(l,o)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=n.leftForLtr(u,l)+l/2,h=g+o/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,be(t,e,i,h),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,be(t,e,i,h)}else{t.lineWidth=_(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;let e=n.leftForLtr(u,l-h),i=n.leftForLtr(n.xPlus(u,1),l-h-2),a=Re(s.borderRadius);Object.values(a).some(t=>0!==t)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Pe(t,{x:e,y:g,w:l,h:o,radius:a}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Pe(t,{x:i,y:g+1,w:l-2,h:o-2,radius:a}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,g,l,o),t.strokeRect(e,g,l,o),t.fillStyle=s.backgroundColor,t.fillRect(i,g+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let n,r,s,a,o,l,h,{body:d}=this,{bodySpacing:c,bodyAlign:u,displayColors:f,boxHeight:g,boxWidth:p,boxPadding:x}=i,m=Le(i.bodyFont),b=m.lineHeight,y=0,v=Mi(i.rtl,this.x,this.width),_=function(i){e.fillText(i,v.x(t.x+y),t.y+b/2),t.y+=b+c},w=v.textAlign(u);for(e.textAlign=u,e.textBaseline="middle",e.font=m.string,t.x=zs(this,w,i),e.fillStyle=i.bodyColor,P(this.beforeBody,_),y=f&&"right"!==w?"center"===u?p/2+x:p+2+x:0,a=0,l=d.length;a<l;++a){for(n=d[a],r=this.labelTextColors[a],e.fillStyle=r,P(n.before,_),s=n.lines,f&&s.length&&(this._drawColorBox(e,t,a,v,i),b=Math.max(m.lineHeight,g)),o=0,h=s.length;o<h;++o)_(s[o]),b=m.lineHeight;P(n.after,_)}y=0,b=m.lineHeight,P(this.afterBody,_),t.y-=c}drawFooter(t,e,i){let n,r,s=this.footer,a=s.length;if(a){let o=Mi(i.rtl,this.x,this.width);for(t.x=zs(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=o.textAlign(i.footerAlign),e.textBaseline="middle",n=Le(i.footerFont),e.fillStyle=i.footerColor,e.font=n.string,r=0;r<a;++r)e.fillText(s[r],o.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){let{xAlign:r,yAlign:s}=this,{x:a,y:o}=t,{width:l,height:h}=i,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=Re(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,o),"top"===s&&this.drawCaret(t,e,i,n),e.lineTo(a+l-c,o),e.quadraticCurveTo(a+l,o,a+l,o+c),"center"===s&&"right"===r&&this.drawCaret(t,e,i,n),e.lineTo(a+l,o+h-f),e.quadraticCurveTo(a+l,o+h,a+l-f,o+h),"bottom"===s&&this.drawCaret(t,e,i,n),e.lineTo(a+u,o+h),e.quadraticCurveTo(a,o+h,a,o+h-u),"center"===s&&"left"===r&&this.drawCaret(t,e,i,n),e.lineTo(a,o+d),e.quadraticCurveTo(a,o,a+d,o),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){let i=Cs[t.position].call(this,this._active,this._eventPosition);if(!i)return;let s=this._size=Is(this,t),a=Object.assign({},i,this._size),o=Es(e,t,a),l=Ls(t,a,o,e);(n._to!==l.x||r._to!==l.y)&&(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let s=Ee(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,n,e),ki(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Si(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,n=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),r=!D(i,n),s=this._positionChanged(n,e);(r||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,r=this._active||[],s=this._getActiveElements(t,r,e,i),a=this._positionChanged(s,t),o=e||!D(s,r)||a;return o&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,n){let r=this.options;if("mouseout"===t.type)return[];if(!n)return e;let s=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&s.reverse(),s}_positionChanged(t,e){let{caretX:i,caretY:n,options:r}=this,s=Cs[r.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}};Ns.positioners=Cs;var Vs={id:"tooltip",_element:Ns,positioners:Cs,afterInit(t,e,i){i&&(t.tooltip=new Ns({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:{beforeTitle:m,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:m,beforeBody:m,beforeLabel:m,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");let i=t.formattedValue;return y(i)||(e+=i),e},labelColor(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:m,afterBody:m,beforeFooter:m,footer:m,afterFooter:m}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Bs(t,e,i,n){let r=t.indexOf(e);return-1===r?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):r!==t.lastIndexOf(e)?i:r}var Hs=class extends kn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let t=this.getLabels();for(let{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(y(t))return null;let i=this.getLabels();return((t,e)=>null===t?null:ht(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Bs(i,t,k(e,t),this._addedLabels),i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,n=[],r=this.getLabels();r=0===t&&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 i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){let e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};function Ys(t,e){let i,n,r,s,a=[],{bounds:o,step:l,min:h,max:d,precision:c,count:u,maxTicks:f,maxDigits:g,includeBounds:p}=t,x=l||1,m=f-1,{min:b,max:v}=e,_=!y(h),w=!y(d),M=!y(u),k=(v-b)/(g+1),S=J((v-b)/m/x)*x;if(S<1e-14&&!_&&!w)return[{value:b},{value:v}];s=Math.ceil(v/S)-Math.floor(b/S),s>m&&(S=J(s*S/m/x)*x),y(c)||(i=Math.pow(10,c),S=Math.ceil(S*i)/i),"ticks"===o?(n=Math.floor(b/S)*S,r=Math.ceil(v/S)*S):(n=b,r=v),_&&w&&l&&function(t,e){let i=Math.round(t);return i-e<=t&&i+e>=t}((d-h)/l,S/1e3)?(s=Math.round(Math.min((d-h)/S,f)),S=(d-h)/s,n=h,r=d):M?(n=_?h:n,r=w?d:r,s=u-1,S=(r-n)/s):(s=(r-n)/S,s=Q(s,Math.round(s),S/1e3)?Math.round(s):Math.ceil(s));let O=Math.max(nt(S),nt(n));i=Math.pow(10,y(c)?O:c),n=Math.round(n*i)/i,r=Math.round(r*i)/i;let P=0;for(_&&(p&&n!==h?(a.push({value:h}),n<h&&P++,Q(Math.round((n+P*S)*i)/i,h,$s(h,k,t))&&P++):n<h&&P++);P<s;++P)a.push({value:Math.round((n+P*S)*i)/i});return w&&p&&r!==d?a.length&&Q(a[a.length-1].value,d,$s(d,k,t))?a[a.length-1].value=d:a.push({value:d}):(!w||r===d)&&a.push({value:r}),a}function $s(t,e,{horizontal:i,minRotation:n}){let r=et(n),s=(i?Math.sin(r):Math.cos(r))||.001,a=.75*e*(""+t).length;return Math.min(e/s,a)}Hs.id="category",Hs.defaults={ticks:{callback:Hs.prototype.getLabelForValue}};var Xs=class extends kn{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 y(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:n,max:r}=this,s=t=>n=e?n:t,a=t=>r=i?r:t;if(t){let t=G(n),e=G(r);t<0&&e<0?a(0):t>0&&e>0&&s(0)}if(n===r){let e=1;(r>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*r)),a(r+e),t||s(n-e)}this.min=n,this.max=r}getTickLimit(){let t,e=this.options.ticks,{maxTicksLimit:i,stepSize:n}=e;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let n=Ys({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:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&tt(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return wi(t,this.chart.options.locale,this.options.ticks.format)}},Us=class extends Xs{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=w(t)?t:0,this.max=w(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=et(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};function qs(t){return t/Math.pow(10,Math.floor(K(t)))==1}Us.id="linear",Us.defaults={ticks:{callback:pn.formatters.numeric}};var Ks=class extends kn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let i=Xs.prototype.parse.apply(this,[t,e]);if(0!==i)return w(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=w(t)?Math.max(0,t):null,this.max=w(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,n=this.max,r=e=>i=t?i:e,s=t=>n=e?n:t,a=(t,e)=>Math.pow(10,Math.floor(K(t))+e);i===n&&(i<=0?(r(1),s(10)):(r(a(i,-1)),s(a(n,1)))),i<=0&&r(a(n,-1)),n<=0&&s(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=n}buildTicks(){let t=this.options,e=function(t,e){let i=Math.floor(K(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),r=[],s=M(t.min,Math.pow(10,Math.floor(K(e.min)))),a=Math.floor(K(s)),o=Math.floor(s/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{r.push({value:s,major:qs(s)}),++o,10===o&&(o=1,++a,l=a>=0?1:l),s=Math.round(o*Math.pow(10,a)*l)/l}while(a<i||a===i&&o<n);let h=M(t.max,s);return r.push({value:h,major:qs(s)}),r}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&tt(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":wi(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=K(t),this._valueRange=K(this.max)-K(t)}getPixelForValue(t){return(void 0===t||0===t)&&(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(K(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};function Gs(t){let e=t.ticks;if(e.display&&t.display){let t=Ee(e.backdropPadding);return k(e.font&&e.font.size,fe.font.size)+t.height}return 0}function Js(t,e,i){return i=v(i)?i:[i],{w:pe(t,e.string,i),h:i.length*e.lineHeight}}function Zs(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:t<n||t>r?{start:e-i,end:e}:{start:e,end:e+i}}function Qs(t){let e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],r=[],s=t._pointLabels.length,a=t.options.pointLabels,o=a.centerPointLabels?V/s:0;for(let l=0;l<s;l++){let s=a.setContext(t.getPointLabelContext(l));r[l]=s.padding;let h=t.getPointPosition(l,t.drawingArea+r[l],o),d=Le(s.font),c=Js(t.ctx,d,t._pointLabels[l]);n[l]=c;let u=ot(t.getIndexAngle(l)+o),f=Math.round(it(u));ta(i,e,u,Zs(f,h.x,c.w,0,180),Zs(f,h.y,c.h,90,270))}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){let n=[],r=t._pointLabels.length,s=t.options,a=Gs(s)/2,o=t.drawingArea,l=s.pointLabels.centerPointLabels?V/r:0;for(let s=0;s<r;s++){let r=t.getPointPosition(s,o+a+i[s],l),h=Math.round(it(ot(r.angle+X))),d=e[s],c=na(r.y,d.h,h),u=ea(h),f=ia(r.x,d.w,u);n.push({x:r.x,y:c,textAlign:u,left:f,top:c,right:f+d.w,bottom:c+d.h})}return n}(t,n,r)}function ta(t,e,i,n,r){let s=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i)),o=0,l=0;n.start<e.l?(o=(e.l-n.start)/s,t.l=Math.min(t.l,e.l-o)):n.end>e.r&&(o=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+o)),r.start<e.t?(l=(e.t-r.start)/a,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function ea(t){return 0===t||180===t?"center":t<180?"left":"right"}function ia(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function na(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function ra(t,e,i,n){let{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,B);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let s=1;s<n;s++)i=t.getPointPosition(s,e),r.lineTo(i.x,i.y)}}Ks.id="logarithmic",Ks.defaults={ticks:{callback:pn.formatters.logarithmic,major:{enabled:!0}}};var sa=class extends Xs{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=Ee(Gs(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(){let{min:t,max:e}=this.getMinMax(!1);this.min=w(t)&&!isNaN(t)?t:0,this.max=w(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gs(this.options))}generateTickLabels(t){Xs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{let i=O(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){let t=this.options;t.display&&t.pointLabels.display?Qs(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return ot(t*(B/(this._pointLabels.length||1))+et(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(y(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(y(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let i=e[t];return function(t,e,i){return Fe(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){let n=this.getIndexAngle(t)-X+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:e,top:i,right:n,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:r}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),ra(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t,e,i,n=this.ctx,r=this.options,{angleLines:s,grid:a}=r,o=this._pointLabels.length;if(r.pointLabels.display&&function(t,e){let{ctx:i,options:{pointLabels:n}}=t;for(let r=e-1;r>=0;r--){let e=n.setContext(t.getPointLabelContext(r)),s=Le(e.font),{x:a,y:o,textAlign:l,left:h,top:d,right:c,bottom:u}=t._pointLabelItems[r],{backdropColor:f}=e;if(!y(f)){let t=Re(e.borderRadius),n=Ee(e.backdropPadding);i.fillStyle=f;let r=h-n.left,s=d-n.top,a=c-h+n.width,o=u-d+n.height;Object.values(t).some(t=>0!==t)?(i.beginPath(),Pe(i,{x:r,y:s,w:a,h:o,radius:t}),i.fill()):i.fillRect(r,s,a,o)}Se(i,t._pointLabels[r],a,o+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,o),a.display&&this.ticks.forEach((t,i)=>{if(0!==i){e=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){let r=t.ctx,s=e.circular,{color:a,lineWidth:o}=e;!s&&!n||!a||!o||i<0||(r.save(),r.strokeStyle=a,r.lineWidth=o,r.setLineDash(e.borderDash),r.lineDashOffset=e.borderDashOffset,r.beginPath(),ra(t,i,s,n),r.closePath(),r.stroke(),r.restore())}(this,a.setContext(this.getContext(i-1)),e,o)}}),s.display){for(n.save(),t=o-1;t>=0;t--){let a=s.setContext(this.getPointLabelContext(t)),{color:o,lineWidth:l}=a;!l||!o||(n.lineWidth=l,n.strokeStyle=o,n.setLineDash(a.borderDash),n.lineDashOffset=a.borderDashOffset,e=this.getDistanceFromCenterForValue(r.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),n.beginPath(),n.moveTo(this.xCenter,this.yCenter),n.lineTo(i.x,i.y),n.stroke())}n.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let n,r,s=this.getIndexAngle(0);t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,a)=>{if(0===a&&!e.reverse)return;let o=i.setContext(this.getContext(a)),l=Le(o.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),o.showLabelBackdrop){t.font=l.string,r=t.measureText(s.label).width,t.fillStyle=o.backdropColor;let e=Ee(o.backdropPadding);t.fillRect(-r/2-e.left,-n-l.size/2-e.top,r+e.width,l.size+e.height)}Se(t,s.label,0,-n,l,{color:o.color})}),t.restore()}drawTitle(){}};sa.id="radialLinear",sa.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:pn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},sa.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},sa.descriptors={angleLines:{_fallback:"grid"}};var aa={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}},oa=Object.keys(aa);function la(t,e){return t-e}function ha(t,e){if(y(e))return null;let i=t._adapter,{parser:n,round:r,isoWeekday:s}=t._parseOpts,a=e;return"function"==typeof n&&(a=n(a)),w(a)||(a="string"==typeof n?i.parse(a,n):i.parse(a)),null===a?null:(r&&(a="week"!==r||!Z(s)&&!0!==s?i.startOf(a,r):i.startOf(a,"isoWeek",s)),+a)}function da(t,e,i,n){let r=oa.length;for(let s=oa.indexOf(t);s<r-1;++s){let t=aa[oa[s]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(r*t.size))<=n)return oa[s]}return oa[r-1]}function ca(t,e,i){if(i){if(i.length){let{lo:n,hi:r}=ct(i,e);t[i[n]>=e?i[n]:i[r]]=!0}}else t[e]=!0}function ua(t,e,i){let n,r,s=[],a={},o=e.length;for(n=0;n<o;++n)r=e[n],a[r]=n,s.push({value:r,major:!1});return 0!==o&&i?function(t,e,i,n){let r,s,a=t._adapter,o=+a.startOf(e[0].value,n),l=e[e.length-1].value;for(r=o;r<=l;r=+a.add(r,1,n))s=i[r],s>=0&&(e[s].major=!0);return e}(t,s,a,i):s}var fa=class extends kn{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){let i=t.time||(t.time={}),n=this._adapter=new An._date(t.adapters.date);n.init(e),I(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ha(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:n,max:r,minDefined:s,maxDefined:a}=this.getUserBounds();function o(t){!s&&!isNaN(t.min)&&(n=Math.min(n,t.min)),!a&&!isNaN(t.max)&&(r=Math.max(r,t.max))}(!s||!a)&&(o(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&o(this.getMinMax(!1))),n=w(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=w(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);let r=this.min,s=function(t,e,i){let n=0,r=t.length;for(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>i;)r--;return n>0||r<t.length?t.slice(n,r):t}(n,r,this.max);return this._unit=e.unit||(i.autoSkip?da(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,i,n,r){for(let s=oa.length-1;s>=oa.indexOf(i);s--){let i=oa[s];if(aa[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return oa[i?oa.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=oa.indexOf(t)+1,i=oa.length;e<i;++e)if(aa[oa[e]].common)return oa[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&s.reverse(),ua(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t){let e,i,n=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),r=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let s=t.length<3?.5:.25;n=ht(n,0,s),r=ht(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){let t,e,i=this._adapter,n=this.min,r=this.max,s=this.options,a=s.time,o=a.unit||da(a.minUnit,n,r,this._getLabelCapacity(n)),l=k(a.stepSize,1),h="week"===o&&a.isoWeekday,d=Z(h)||!0===h,c={},u=n;if(d&&(u=+i.startOf(u,"isoWeek",h)),u=+i.startOf(u,d?"day":o),i.diff(r,n,o)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+o);let f="data"===s.ticks.source&&this.getDataTimestamps();for(t=u,e=0;t<r;t=+i.add(t,l,o),e++)ca(c,t,f);return(t===r||"ticks"===s.bounds||1===e)&&ca(c,t,f),Object.keys(c).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){let r=this.options,s=r.time.displayFormats,a=this._unit,o=this._majorUnit,l=a&&s[a],h=o&&s[o],d=i[e],c=o&&h&&d&&d.major,u=this._adapter.format(t,n||(c?h:l)),f=r.ticks.callback;return f?O(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,n=et(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),s=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*s,h:i*s+a*r}}_getLabelCapacity(t){let e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,ua(this,[t],this._majorUnit),n),s=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){let t,e,i=this._cache.labels||[];if(i.length)return i;let n=this.getLabels();for(t=0,e=n.length;t<e;++t)i.push(ha(this,n[t]));return this._cache.labels=this._normalized?i:this.normalize(i)}normalize(t){return xt(t.sort(la))}};function ga(t,e,i){let n,r,s,a,o=0,l=t.length-1;i?(e>=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=ut(t,"pos",e)),({pos:n,time:s}=t[o]),({pos:r,time:a}=t[l])):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=ut(t,"time",e)),({time:n,pos:s}=t[o]),({time:r,pos:a}=t[l]));let h=r-n;return h?s+(a-s)*(e-n)/h:s}fa.id="time",fa.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};var pa=class extends fa{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ga(e,this.min),this._tableRange=ga(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let e,i,n,r,s,{min:a,max:o}=this,l=[],h=[];for(e=0,i=t.length;e<i;++e)r=t[e],r>=a&&r<=o&&l.push(r);if(l.length<2)return[{time:a,pos:0},{time:o,pos:1}];for(e=0,i=l.length;e<i;++e)s=l[e+1],n=l[e-1],r=l[e],Math.round((s+n)/2)!==r&&h.push({time:r,pos:e/(i-1)});return h}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ga(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ga(this._table,i*this._tableRange+this._minPos,!0)}};pa.id="timeseries",pa.defaults=fa.defaults;var xa=function(){if("undefined"!=typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var t=window.screen;if(t)return(t.deviceXDPI||1)/(t.logicalXDPI||1)}return 1}(),ma=function(t){var e,i=[];for(t=[].concat(t);t.length;)"string"==typeof(e=t.pop())?i.unshift.apply(i,e.split("\n")):Array.isArray(e)?t.push.apply(t,e):y(t)||i.unshift(""+e);return i},ba=function(t,e,i){var n,r=[].concat(e),s=r.length,a=t.font,o=0;for(t.font=i.string,n=0;n<s;++n)o=Math.max(t.measureText(r[n]).width,o);return t.font=a,{height:s*i.lineHeight,width:o}},ya=function(t,e,i){return Math.max(t,Math.min(e,i))},va=function(t,e){var i,n,r,s,a=t.slice(),o=[];for(i=0,r=e.length;i<r;++i)s=e[i],-1===(n=a.indexOf(s))?o.push([s,1]):a.splice(n,1);for(i=0,r=a.length;i<r;++i)o.push([a[i],-1]);return o};function _a(t,e){var i=e.x,n=e.y;if(null===i)return{x:0,y:-1};if(null===n)return{x:1,y:0};var r=t.x-i,s=t.y-n,a=Math.sqrt(r*r+s*s);return{x:a?r/a:0,y:a?s/a:-1}}function wa(t,e,i){var n=0;return t<i.left?n|=1:t>i.right&&(n|=2),e<i.top?n|=8:e>i.bottom&&(n|=4),n}function Ma(t,e){var i,n,r=e.anchor,s=t;return e.clamp&&(s=function(t,e){for(var i,n,r,s=t.x0,a=t.y0,o=t.x1,l=t.y1,h=wa(s,a,e),d=wa(o,l,e);h|d&&!(h&d);)8&(i=h||d)?(n=s+(o-s)*(e.top-a)/(l-a),r=e.top):4&i?(n=s+(o-s)*(e.bottom-a)/(l-a),r=e.bottom):2&i?(r=a+(l-a)*(e.right-s)/(o-s),n=e.right):1&i&&(r=a+(l-a)*(e.left-s)/(o-s),n=e.left),i===h?h=wa(s=n,a=r,e):d=wa(o=n,l=r,e);return{x0:s,x1:o,y0:a,y1:l}}(s,e.area)),"start"===r?(i=s.x0,n=s.y0):"end"===r?(i=s.x1,n=s.y1):(i=(s.x0+s.x1)/2,n=(s.y0+s.y1)/2),function(t,e,i,n,r){switch(r){case"center":i=n=0;break;case"bottom":i=0,n=1;break;case"right":i=1,n=0;break;case"left":i=-1,n=0;break;case"top":i=0,n=-1;break;case"start":i=-i,n=-n;break;case"end":break;default:r*=Math.PI/180,i=Math.cos(r),n=Math.sin(r)}return{x:t,y:e,vx:i,vy:n}}(i,n,t.vx,t.vy,e.align)}var ka={arc:function(t,e){var i=(t.startAngle+t.endAngle)/2,n=Math.cos(i),r=Math.sin(i),s=t.innerRadius,a=t.outerRadius;return Ma({x0:t.x+n*s,y0:t.y+r*s,x1:t.x+n*a,y1:t.y+r*a,vx:n,vy:r},e)},point:function(t,e){var i=_a(t,e.origin),n=i.x*t.options.radius,r=i.y*t.options.radius;return Ma({x0:t.x-n,y0:t.y-r,x1:t.x+n,y1:t.y+r,vx:i.x,vy:i.y},e)},bar:function(t,e){var i=_a(t,e.origin),n=t.x,r=t.y,s=0,a=0;return t.horizontal?(n=Math.min(t.x,t.base),s=Math.abs(t.base-t.x)):(r=Math.min(t.y,t.base),a=Math.abs(t.base-t.y)),Ma({x0:n,y0:r+a,x1:n+s,y1:r,vx:i.x,vy:i.y},e)},fallback:function(t,e){var i=_a(t,e.origin);return Ma({x0:t.x,y0:t.y,x1:t.x+(t.width||0),y1:t.y+(t.height||0),vx:i.x,vy:i.y},e)}},Sa=function(t){return Math.round(t*xa)/xa};function Oa(t,e){var i=e.chart.getDatasetMeta(e.datasetIndex).vScale;if(!i)return null;if(void 0!==i.xCenter&&void 0!==i.yCenter)return{x:i.xCenter,y:i.yCenter};var n=i.getBasePixel();return t.horizontal?{x:n,y:null}:{x:null,y:n}}function Pa(t){return t instanceof Br?ka.arc:t instanceof Qr?ka.point:t instanceof as?ka.bar:ka.fallback}function Da(t,e,i){var n=i.backgroundColor,r=i.borderColor,s=i.borderWidth;!n&&(!r||!s)||(t.beginPath(),function(t,e,i,n,r,s){var a=Math.PI/2;if(s){var o=Math.min(s,r/2,n/2),l=e+o,h=i+o,d=e+n-o,c=i+r-o;t.moveTo(e,h),l<d&&h<c?(t.arc(l,h,o,-Math.PI,-a),t.arc(d,h,o,-a,0),t.arc(d,c,o,0,a),t.arc(l,c,o,a,Math.PI)):l<d?(t.moveTo(l,i),t.arc(d,h,o,-a,a),t.arc(l,h,o,a,Math.PI+a)):h<c?(t.arc(l,h,o,-Math.PI,0),t.arc(l,c,o,0,Math.PI)):t.arc(l,h,o,-Math.PI,Math.PI),t.closePath(),t.moveTo(e,i)}else t.rect(e,i,n,r)}(t,Sa(e.x)+s/2,Sa(e.y)+s/2,Sa(e.w)-s,Sa(e.h)-s,i.borderRadius),t.closePath(),n&&(t.fillStyle=n,t.fill()),r&&s&&(t.strokeStyle=r,t.lineWidth=s,t.lineJoin="miter",t.stroke()))}function Ca(t,e,i){var n=t.shadowBlur,r=i.stroked,s=Sa(i.x),a=Sa(i.y),o=Sa(i.w);r&&t.strokeText(e,s,a,o),i.filled&&(n&&r&&(t.shadowBlur=0),t.fillText(e,s,a,o),n&&r&&(t.shadowBlur=n))}var Aa=function(t,e,i,n){var r=this;r._config=t,r._index=n,r._model=null,r._rects=null,r._ctx=e,r._el=i};j(Aa.prototype,{_modelize:function(t,e,i,n){var r=this,s=r._index,a=Le(ze([i.font,{}],n,s)),o=ze([i.color,fe.color],n,s);return{align:ze([i.align,"center"],n,s),anchor:ze([i.anchor,"center"],n,s),area:n.chart.chartArea,backgroundColor:ze([i.backgroundColor,null],n,s),borderColor:ze([i.borderColor,null],n,s),borderRadius:ze([i.borderRadius,0],n,s),borderWidth:ze([i.borderWidth,0],n,s),clamp:ze([i.clamp,!1],n,s),clip:ze([i.clip,!1],n,s),color:o,display:t,font:a,lines:e,offset:ze([i.offset,4],n,s),opacity:ze([i.opacity,1],n,s),origin:Oa(r._el,n),padding:Ee(ze([i.padding,4],n,s)),positioner:Pa(r._el),rotation:ze([i.rotation,0],n,s)*(Math.PI/180),size:ba(r._ctx,e,a),textAlign:ze([i.textAlign,"start"],n,s),textShadowBlur:ze([i.textShadowBlur,0],n,s),textShadowColor:ze([i.textShadowColor,o],n,s),textStrokeColor:ze([i.textStrokeColor,o],n,s),textStrokeWidth:ze([i.textStrokeWidth,0],n,s)}},update:function(t){var e,i,n,r=this,s=null,a=null,o=r._index,l=r._config,h=ze([l.display,!0],t,o);h&&(e=t.dataset.data[o],(n=y(i=k(O(l.formatter,[e,t]),e))?[]:ma(i)).length&&(a=function(t){var e=t.borderWidth||0,i=t.padding,n=t.size.height,r=t.size.width,s=-r/2,a=-n/2;return{frame:{x:s-i.left-e,y:a-i.top-e,w:r+i.width+2*e,h:n+i.height+2*e},text:{x:s,y:a,w:r,h:n}}}(s=r._modelize(h,n,l,t)))),r._model=s,r._rects=a},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(t,e){var i,n=t.ctx,r=this._model,s=this._rects;this.visible()&&(n.save(),r.clip&&(i=r.area,n.beginPath(),n.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),n.clip()),n.globalAlpha=ya(0,r.opacity,1),n.translate(Sa(e.x),Sa(e.y)),n.rotate(r.rotation),Da(n,s.frame,r),function(t,e,i,n){var r,s=n.textAlign,a=n.color,o=!!a,l=n.font,h=e.length,d=n.textStrokeColor,c=n.textStrokeWidth,u=d&&c;if(h&&(o||u))for(i=function(t,e,i){var n=i.lineHeight,r=t.w,s=t.x;return"center"===e?s+=r/2:("end"===e||"right"===e)&&(s+=r),{h:n,w:r,x:s,y:t.y+n/2}}(i,s,l),t.font=l.string,t.textAlign=s,t.textBaseline="middle",t.shadowBlur=n.textShadowBlur,t.shadowColor=n.textShadowColor,o&&(t.fillStyle=a),u&&(t.lineJoin="round",t.lineWidth=c,t.strokeStyle=d),r=0,h=e.length;r<h;++r)Ca(t,e[r],{stroked:u,filled:o,w:i.w,x:i.x,y:i.y+i.h*r})}(n,r.lines,s.text,r),n.restore())}});var Ta=Number.MIN_SAFE_INTEGER||-9007199254740991,ja=Number.MAX_SAFE_INTEGER||9007199254740991;function Ia(t,e,i){var n=Math.cos(i),r=Math.sin(i),s=e.x,a=e.y;return{x:s+n*(t.x-s)-r*(t.y-a),y:a+r*(t.x-s)+n*(t.y-a)}}function Ra(t,e){var i,n,r,s,a,o=ja,l=Ta,h=e.origin;for(i=0;i<t.length;++i)r=(n=t[i]).x-h.x,s=n.y-h.y,a=e.vx*r+e.vy*s,o=Math.min(o,a),l=Math.max(l,a);return{min:o,max:l}}function Ea(t,e){var i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n);return{vx:(e.x-t.x)/r,vy:(e.y-t.y)/r,origin:t,ln:r}}var La=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function za(t,e,i){var n=e.positioner(t,e),r=n.vx,s=n.vy;if(!r&&!s)return{x:n.x,y:n.y};var a=i.w,o=i.h,l=e.rotation,h=Math.abs(a/2*Math.cos(l))+Math.abs(o/2*Math.sin(l)),d=Math.abs(a/2*Math.sin(l))+Math.abs(o/2*Math.cos(l)),c=1/Math.max(Math.abs(r),Math.abs(s));return h*=r*c,d*=s*c,h+=e.offset*r,d+=e.offset*s,{x:n.x+h,y:n.y+d}}j(La.prototype,{center:function(){var t=this._rect;return{x:t.x+t.w/2,y:t.y+t.h/2}},update:function(t,e,i){this._rotation=i,this._rect={x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},contains:function(t){var e=this,i=e._rect;return!((t=Ia(t,e.center(),-e._rotation)).x<i.x-1||t.y<i.y-1||t.x>i.x+i.w+2||t.y>i.y+i.h+2)},intersects:function(t){var e,i,n,r=this._points(),s=t._points(),a=[Ea(r[0],r[1]),Ea(r[0],r[3])];for(this._rotation!==t._rotation&&a.push(Ea(s[0],s[1]),Ea(s[0],s[3])),e=0;e<a.length;++e)if(i=Ra(r,a[e]),n=Ra(s,a[e]),i.max<n.min||n.max<i.min)return!1;return!0},_points:function(){var t=this,e=t._rect,i=t._rotation,n=t.center();return[Ia({x:e.x,y:e.y},n,i),Ia({x:e.x+e.w,y:e.y},n,i),Ia({x:e.x+e.w,y:e.y+e.h},n,i),Ia({x:e.x,y:e.y+e.h},n,i)]}});var Fa={prepare:function(t){var e,i,n,r,s,a=[];for(e=0,n=t.length;e<n;++e)for(i=0,r=t[e].length;i<r;++i)s=t[e][i],a.push(s),s.$layout={_box:new La,_hidable:!1,_visible:!0,_set:e,_idx:s._index};return a.sort((function(t,e){var i=t.$layout,n=e.$layout;return i._idx===n._idx?n._set-i._set:n._idx-i._idx})),this.update(a),a},update:function(t){var e,i,n,r,s,a=!1;for(e=0,i=t.length;e<i;++e)r=(n=t[e]).model(),(s=n.$layout)._hidable=r&&"auto"===r.display,s._visible=n.visible(),a|=s._hidable;a&&function(t){var e,i,n,r,s,a,o;for(e=0,i=t.length;e<i;++e)(r=(n=t[e]).$layout)._visible&&(o=new Proxy(n._el,{get:(t,e)=>t.getProps([e],!0)[e]}),s=n.geometry(),a=za(o,n.model(),s),r._box.update(a,s,n.rotation()));(function(t,e){var i,n,r,s;for(i=t.length-1;i>=0;--i)for(r=t[i].$layout,n=i-1;n>=0&&r._visible;--n)(s=t[n].$layout)._visible&&r._box.intersects(s._box)&&e(r,s)})(t,(function(t,e){var i=t._hidable,n=e._hidable;i&&n||n?e._visible=!1:i&&(t._visible=!1)}))}(t)},lookup:function(t,e){var i,n;for(i=t.length-1;i>=0;--i)if((n=t[i].$layout)&&n._visible&&n._box.contains(e))return t[i];return null},draw:function(t,e){var i,n,r,s,a,o;for(i=0,n=e.length;i<n;++i)(s=(r=e[i]).$layout)._visible&&(a=r.geometry(),o=za(r._el,r.model(),a),s._box.update(o,a,r.rotation()),r.draw(t,o))}},Wa="$datalabels",Na="$default";function Va(t,e,i,n){if(e){var r,s=i.$context,a=i.$groups;e[a._set]&&((r=e[a._set][a._key])&&!0===O(r,[s,n])&&(t[Wa]._dirty=!0,i.update(s)))}}function Ba(t,e){var i,n,r=t[Wa],s=r._listeners;if(s.enter||s.leave){if("mousemove"===e.type)n=Fa.lookup(r._labels,e);else if("mouseout"!==e.type)return;i=r._hovered,r._hovered=n,function(t,e,i,n,r){var s,a;!i&&!n||(i?n?i!==n&&(a=s=!0):a=!0:s=!0,a&&Va(t,e.leave,i,r),s&&Va(t,e.enter,n,r))}(t,s,i,n,e)}}var Ha={id:"datalabels",defaults:{align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:function(t){if(y(t))return null;var e,i,n,r=t;if(_(t))if(y(t.label))if(y(t.r))for(r="",n=0,i=(e=Object.keys(t)).length;n<i;++n)r+=(0!==n?", ":"")+e[n]+": "+t[e[n]];else r=t.r;else r=t.label;return""+r},labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},beforeInit:function(t){t[Wa]={_actives:[]}},beforeUpdate:function(t){var e=t[Wa];e._listened=!1,e._listeners={},e._datasets=[],e._labels=[]},afterDatasetUpdate:function(t,e,i){var n,r,s,a,o,l,h,d,c=e.index,u=t[Wa],f=u._datasets[c]=[],g=t.isDatasetVisible(c),p=t.data.datasets[c],x=function(t,e){var i,n,r=t.datalabels,s={},a=[];return!1===r?null:(!0===r&&(r={}),e=j({},[e,r]),i=e.labels||{},n=Object.keys(i),delete e.labels,n.length?n.forEach((function(t){i[t]&&a.push(j({},[e,i[t],{_key:t}]))})):a.push(e),s=a.reduce((function(t,e){return P(e.listeners||{},(function(i,n){t[n]=t[n]||{},t[n][e._key||Na]=i})),delete e.listeners,t}),{}),{labels:a,listeners:s})}(p,i),m=e.meta.data||[],b=t.ctx;for(b.save(),n=0,s=m.length;n<s;++n)if((h=m[n])[Wa]=[],g&&h&&t.getDataVisibility(n)&&!h.skip)for(r=0,a=x.labels.length;r<a;++r)l=(o=x.labels[r])._key,(d=new Aa(o,b,h,n)).$groups={_set:c,_key:l||Na},d.$context={active:!1,chart:t,dataIndex:n,dataset:p,datasetIndex:c},d.update(d.$context),h[Wa].push(d),f.push(d);b.restore(),j(u._listeners,x.listeners,{merger:function(t,i,n){i[t]=i[t]||{},i[t][e.index]=n[t],u._listened=!0}})},afterUpdate:function(t){t[Wa]._labels=Fa.prepare(t[Wa]._datasets)},afterDatasetsDraw:function(t){Fa.draw(t,t[Wa]._labels)},beforeEvent:function(t,e){if(t[Wa]._listened){var i=e.event;switch(i.type){case"mousemove":case"mouseout":Ba(t,i);break;case"click":!function(t,e){var i=t[Wa],n=i._listeners.click,r=n&&Fa.lookup(i._labels,e);r&&Va(t,n,r,e)}(t,i)}}},afterEvent:function(t){var e,i,n,r,s,a,o,l=t[Wa],h=l._actives,d=l._actives=t.getActiveElements(),c=va(h,d);for(e=0,i=c.length;e<i;++e)if((s=c[e])[1])for(n=0,r=(o=s[0].element[Wa]||[]).length;n<r;++n)(a=o[n]).$context.active=1===s[1],a.update(a.$context);(l._dirty||c.length)&&(Fa.update(l._labels),t.render()),delete l._dirty}},Ya={point:(t,e)=>Xa(t,e,{intersect:!0}),nearest:(t,e,i)=>function(t,e,i){let n=Number.POSITIVE_INFINITY;return Xa(t,e,i).reduce((t,r)=>{let s=r.getCenterPoint(),a=function(t,e,i){return"x"===i?{x:t.x,y:e.y}:"y"===i?{x:e.x,y:t.y}:e}(e,s,i.axis),o=st(e,a);return o<n?(t=[r],n=o):o===n&&t.push(r),t},[]).sort((t,e)=>t._index-e._index).slice(0,1)}(t,e,i),x:(t,e,i)=>Xa(t,e,{intersect:i.intersect,axis:"x"}),y:(t,e,i)=>Xa(t,e,{intersect:i.intersect,axis:"y"})};function $a(t,e,i){return(Ya[i.mode]||Ya.nearest)(t,e,i)}function Xa(t,e,i){return t.visibleElements.filter(t=>i.intersect?t.inRange(e.x,e.y):function(t,e,i){return"x"!==i&&"y"!==i?t.inRange(e.x,e.y,"x",!0)||t.inRange(e.x,e.y,"y",!0):t.inRange(e.x,e.y,i,!0)}(t,e,i.axis))}var Ua=(t,e)=>e>t||t.length>e.length&&t.slice(0,e.length)===e,qa=.001,Ka=(t,e,i)=>Math.min(i,Math.max(e,t));function Ga(t,e,i){for(let n of Object.keys(t))t[n]=Ka(t[n],e,i);return t}function Ja(t,{x:e,y:i,x2:n,y2:r},s,a){let o=a/2,l=t.x>=e-o-qa&&t.x<=n+o+qa,h=t.y>=i-o-qa&&t.y<=r+o+qa;return"x"===s?l:("y"===s||l)&&h}function Za(t,e){let{centerX:i,centerY:n}=t.getProps(["centerX","centerY"],e);return{x:i,y:n}}var Qa=t=>"string"==typeof t&&t.endsWith("%"),to=t=>parseFloat(t)/100,eo=t=>Ka(to(t),0,1);function io(t,e){return"start"===e?0:"end"===e?t:Qa(e)?eo(e)*t:t/2}function no(t,e,i=!0){return"number"==typeof e?e:Qa(e)?(i?eo(e):to(e))*t:t}function ro(t,e="center"){return _(t)?{x:k(t.x,e),y:k(t.y,e)}:{x:t=k(t,e),y:t}}function so(t){return t&&(F(t.xValue)||F(t.yValue))}function ao(t,e,i,n=!1){let r=i.init;if(r)return!0===r?lo(e,n):function(t,e,i){if(!0===i)return lo(t,e);if(_(i))return i}(e,n,O(r,[{chart:t,properties:e,options:i}]))}function oo(t,e,i){let n=!1;return e.forEach(e=>{W(t[e])?(n=!0,i[e]=t[e]):F(i[e])&&delete i[e]}),n}function lo({centerX:t,centerY:e},i){return i?{centerX:t,centerY:e,radius:0,width:0,height:0}:{x:t,y:e,x2:t,y2:e,width:0,height:0}}var ho=new Map;function co(t){if(t&&"object"==typeof t){let e=t.toString();return"[object HTMLImageElement]"===e||"[object HTMLCanvasElement]"===e}}function uo(t,{x:e,y:i},n){n&&(t.translate(e,i),t.rotate(et(n)),t.translate(-e,-i))}function fo(t,e){if(e&&e.borderWidth)return t.lineCap=e.borderCapStyle,t.setLineDash(e.borderDash),t.lineDashOffset=e.borderDashOffset,t.lineJoin=e.borderJoinStyle,t.lineWidth=e.borderWidth,t.strokeStyle=e.borderColor,!0}function go(t,e){t.shadowColor=e.backgroundShadowColor,t.shadowBlur=e.shadowBlur,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY}function po(t,e){let i=e.content;if(co(i))return{width:no(i.width,e.width),height:no(i.height,e.height)};let n=e.font,r=v(n)?n.map(t=>Le(t)):[Le(n)],s=e.textStrokeWidth,a=v(i)?i:[i],o=a.join()+(t=>t.reduce((function(t,e){return t+=e.string}),""))(r)+s+(t._measureText?"-spriting":"");return ho.has(o)||ho.set(o,function(t,e,i,n){t.save();let r=e.length,s=0,a=n;for(let o=0;o<r;o++){let r=i[Math.min(o,i.length-1)];t.font=r.string;let l=e[o];s=Math.max(s,t.measureText(l).width+n),a+=r.lineHeight}return t.restore(),{width:s,height:a}}(t,a,r,s)),ho.get(o)}function xo(t,e,i){let{x:n,y:r,width:s,height:a}=e;t.save(),go(t,i);let o=fo(t,i);t.fillStyle=i.backgroundColor,t.beginPath(),Pe(t,{x:n,y:r,w:s,h:a,radius:Ga(Re(i.borderRadius),0,Math.min(s,a)/2)}),t.closePath(),t.fill(),o&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}function mo(t,e,i){let n=i.content;if(co(n))return t.save(),t.globalAlpha=function(t,e){let i=Z(t)?t:e;return Z(i)?Ka(i,0,1):1}(i.opacity,n.style.opacity),t.drawImage(n,e.x,e.y,e.width,e.height),void t.restore();let r=v(n)?n:[n],s=i.font,a=v(s)?s.map(t=>Le(t)):[Le(s)],o=i.color,l=v(o)?o:[o],h=function(t,e){let{x:i,width:n}=t,r=e.textAlign;return"center"===r?i+n/2:"end"===r||"right"===r?i+n:i}(e,i),d=e.y+i.textStrokeWidth/2;t.save(),t.textBaseline="middle",t.textAlign=i.textAlign,function(t,e){if(e.textStrokeWidth>0)return t.lineJoin="round",t.miterLimit=2,t.lineWidth=e.textStrokeWidth,t.strokeStyle=e.textStrokeColor,!0}(t,i)&&function(t,{x:e,y:i},n,r){t.beginPath();let s=0;n.forEach((function(n,a){let o=r[Math.min(a,r.length-1)],l=o.lineHeight;t.font=o.string,t.strokeText(n,e,i+l/2+s),s+=l})),t.stroke()}(t,{x:h,y:d},r,a),function(t,{x:e,y:i},n,{fonts:r,colors:s}){let a=0;n.forEach((function(n,o){let l=s[Math.min(o,s.length-1)],h=r[Math.min(o,r.length-1)],d=h.lineHeight;t.beginPath(),t.font=h.string,t.fillStyle=l,t.fillText(n,e,i+d/2+a),a+=d,t.fill()}))}(t,{x:h,y:d},r,{fonts:a,colors:l}),t.restore()}function bo(t,e,i,n){let{radius:r,options:s}=e,a=s.pointStyle,o=s.rotation,l=(o||0)*$;if(co(a))return t.save(),t.translate(i,n),t.rotate(l),t.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),void t.restore();(t=>isNaN(t)||t<=0)(r)||function(t,{x:e,y:i,radius:n,rotation:r,style:s,rad:a}){let o,l,h,d;switch(t.beginPath(),s){default:t.arc(e,i,n,0,B),t.closePath();break;case"triangle":t.moveTo(e+Math.sin(a)*n,i-Math.cos(a)*n),a+=q,t.lineTo(e+Math.sin(a)*n,i-Math.cos(a)*n),a+=q,t.lineTo(e+Math.sin(a)*n,i-Math.cos(a)*n),t.closePath();break;case"rectRounded":d=.516*n,h=n-d,o=Math.cos(a+U)*h,l=Math.sin(a+U)*h,t.arc(e-o,i-l,d,a-V,a-X),t.arc(e+l,i-o,d,a-X,a),t.arc(e+o,i+l,d,a,a+X),t.arc(e-l,i+o,d,a+X,a+V),t.closePath();break;case"rect":if(!r){h=Math.SQRT1_2*n,t.rect(e-h,i-h,2*h,2*h);break}a+=U;case"rectRot":o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+l,i-o),t.lineTo(e+o,i+l),t.lineTo(e-l,i+o),t.closePath();break;case"crossRot":a+=U;case"cross":o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+o,i+l),t.moveTo(e+l,i-o),t.lineTo(e-l,i+o);break;case"star":o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+o,i+l),t.moveTo(e+l,i-o),t.lineTo(e-l,i+o),a+=U,o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+o,i+l),t.moveTo(e+l,i-o),t.lineTo(e-l,i+o);break;case"line":o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+o,i+l);break;case"dash":t.moveTo(e,i),t.lineTo(e+Math.cos(a)*n,i+Math.sin(a)*n)}t.fill()}(t,{x:i,y:n,radius:r,rotation:o,style:a,rad:l})}var yo={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 vo(t,e,i){return e="number"==typeof e?e:t.parse(e),w(e)?t.getPixelForValue(e):i}function _o(t,e,i){let n=e[i];if(n||"scaleID"===i)return n;let r=i.charAt(0),s=Object.values(t).filter(t=>t.axis&&t.axis===r);return s.length?s[0].id:r}function wo(t,e){if(t){let i=t.options.reverse;return{start:vo(t,e.min,i?e.end:e.start),end:vo(t,e.max,i?e.start:e.end)}}}function Mo(t,e){let{chartArea:i,scales:n}=t,r=n[_o(n,e,"xScaleID")],s=n[_o(n,e,"yScaleID")],a=i.width/2,o=i.height/2;return r&&(a=vo(r,e.xValue,r.left+r.width/2)),s&&(o=vo(s,e.yValue,s.top+s.height/2)),{x:a,y:o}}function ko(t,e){let i=t.scales,n=i[_o(i,e,"xScaleID")],r=i[_o(i,e,"yScaleID")];if(!n&&!r)return{};let{left:s,right:a}=n||t.chartArea,{top:o,bottom:l}=r||t.chartArea,h=Do(n,{min:e.xMin,max:e.xMax,start:s,end:a});s=h.start,a=h.end;let d=Do(r,{min:e.yMin,max:e.yMax,start:l,end:o});return o=d.start,l=d.end,{x:s,y:o,x2:a,y2:l,width:a-s,height:l-o,centerX:s+(a-s)/2,centerY:o+(l-o)/2}}function So(t,e){if(!so(e)){let i=ko(t,e),n=e.radius;(!n||isNaN(n))&&(n=Math.min(i.width,i.height)/2,e.radius=n);let r=2*n,s=i.centerX+e.xAdjust,a=i.centerY+e.yAdjust;return{x:s-n,y:a-n,x2:s+n,y2:a+n,centerX:s,centerY:a,width:r,height:r,radius:n}}return function(t,e){let i=Mo(t,e),n=2*e.radius;return{x:i.x-e.radius+e.xAdjust,y:i.y-e.radius+e.yAdjust,x2:i.x+e.radius+e.xAdjust,y2:i.y+e.radius+e.yAdjust,centerX:i.x+e.xAdjust,centerY:i.y+e.yAdjust,radius:e.radius,width:n,height:n}}(t,e)}function Oo(t,e){let{scales:i,chartArea:n}=t,r=i[e.scaleID],s={x:n.left,y:n.top,x2:n.right,y2:n.bottom};return r?function(t,e,i){let n=vo(t,i.value,NaN),r=vo(t,i.endValue,n);t.isHorizontal()?(e.x=n,e.x2=r):(e.y=n,e.y2=r)}(r,s,e):function(t,e,i){for(let n of Object.keys(yo)){let r=t[_o(t,i,n)];if(r){let{min:t,max:s,start:a,end:o,startProp:l,endProp:h}=yo[n],d=wo(r,{min:i[t],max:i[s],start:r[a],end:r[o]});e[l]=d.start,e[h]=d.end}}}(i,s,e),s}function Po(t,e,i){let n=ko(t,e);return n.initProperties=ao(t,n,e,i),n.elements=[{type:"label",optionScope:"label",properties:Ao(t,n,e),initProperties:n.initProperties}],n}function Do(t,e){let i=wo(t,e)||e;return{start:Math.min(i.start,i.end),end:Math.max(i.start,i.end)}}function Co(t,e){let{start:i,end:n,borderWidth:r}=t,{position:s,padding:{start:a,end:o},adjust:l}=e;return i+r/2+l+io(n-r-i-a-o-e.size,s)}function Ao(t,e,i){let n=i.label;n.backgroundColor="transparent",n.callout.display=!1;let r=ro(n.position),s=Ee(n.padding),a=po(t.ctx,n),o=function({properties:t,options:e},i,n,r){let{x:s,x2:a,width:o}=t;return Co({start:s,end:a,borderWidth:e.borderWidth},{position:n.x,padding:{start:r.left,end:r.right},adjust:e.label.xAdjust,size:i.width})}({properties:e,options:i},a,r,s),l=function({properties:t,options:e},i,n,r){let{y:s,y2:a,height:o}=t;return Co({start:s,end:a,borderWidth:e.borderWidth},{position:n.y,padding:{start:r.top,end:r.bottom},adjust:e.label.yAdjust,size:i.height})}({properties:e,options:i},a,r,s),h=a.width+s.width,d=a.height+s.height;return{x:o,y:l,x2:o+h,y2:l+d,width:h,height:d,centerX:o+h/2,centerY:l+d/2,rotation:n.rotation}}function To(t,e,i){let n=Math.cos(i),r=Math.sin(i),s=e.x,a=e.y;return{x:s+n*(t.x-s)-r*(t.y-a),y:a+r*(t.x-s)+n*(t.y-a)}}var jo=["enter","leave"],Io=jo.concat("click");function Ro(t,e,i){if(t.listened)switch(e.type){case"mousemove":case"mouseout":return function(t,e,i){if(!t.moveListened)return;let n;n="mousemove"===e.type?$a(t,e,i.interaction):[];let r=t.hovered;t.hovered=n;let s={state:t,event:e},a=Eo(s,"leave",r,n);return Eo(s,"enter",n,r)||a}(t,e,i);case"click":return function(t,e,i){let n,r=t.listeners,s=$a(t,e,i.interaction);for(let t of s)n=Lo(t.options.click||r.click,t,e)||n;return n}(t,e,i)}}function Eo({state:t,event:e},i,n,r){let s;for(let a of n)r.indexOf(a)<0&&(s=Lo(a.options[i]||t.listeners[i],a,e)||s);return s}function Lo(t,e,i){return!0===O(t,[e.$context,i])}var zo=["afterDraw","beforeDraw"];function Fo(t,e,i){if(t.hooked){return O(e.options[i]||t.hooks[i],[e.$context])}}function Wo(t,e,i){let n=function(t,e,i){let n=e.axis,r=e.id,s=n+"ScaleID",a={min:k(e.min,Number.NEGATIVE_INFINITY),max:k(e.max,Number.POSITIVE_INFINITY)};for(let o of i)o.scaleID===r?Ho(o,e,["value","endValue"],a):_o(t,o,s)===r&&Ho(o,e,[n+"Min",n+"Max",n+"Value"],a);return a}(t.scales,e,i),r=No(e,n,"min","suggestedMin");r=No(e,n,"max","suggestedMax")||r,r&&W(e.handleTickRangeOptions)&&e.handleTickRangeOptions()}function No(t,e,i,n){if(w(e[i])&&!function(t,e,i){return F(t[e])||F(t[i])}(t.options,i,n)){let n=t[i]!==e[i];return t[i]=e[i],n}}function Vo(t,e){for(let i of["scaleID","xScaleID","yScaleID"]){let n=_o(e,t,i);n&&!e[n]&&Bo(t,i)&&console.warn(`No scale found with id '${n}' for annotation '${t.id}'`)}}function Bo(t,e){if("scaleID"===e)return!0;let i=e.charAt(0);for(let e of["Min","Max","Value"])if(F(t[i+e]))return!0;return!1}function Ho(t,e,i,n){for(let r of i){let i=t[r];if(F(i)){let t=e.parse(i);n.min=Math.min(n.min,t),n.max=Math.max(n.max,t)}}}var Yo=class extends fn{inRange(t,e,i,n){let{x:r,y:s}=To({x:t,y:e},this.getCenterPoint(n),et(-this.options.rotation));return Ja({x:r,y:s},this.getProps(["x","y","x2","y2"],n),i,this.options.borderWidth)}getCenterPoint(t){return Za(this,t)}draw(t){t.save(),uo(t,this.getCenterPoint(),this.options.rotation),xo(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Po(t,e)}};Yo.id="boxAnnotation",Yo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 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,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},Yo.defaultRoutes={borderColor:"color",backgroundColor:"color"},Yo.descriptors={label:{_fallback:!0}};var $o=["left","bottom","top","right"],Xo=class extends fn{inRange(t,e,i,n){let{x:r,y:s}=To({x:t,y:e},this.getCenterPoint(n),et(-this.rotation));return Ja({x:r,y:s},this.getProps(["x","y","x2","y2"],n),i,this.options.borderWidth)}getCenterPoint(t){return Za(this,t)}draw(t){let e=this.options,i=!F(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),uo(t,this.getCenterPoint(),this.rotation),function(t,e){let{pointX:i,pointY:n,options:r}=e,s=r.callout,a=s&&s.display&&function(t,e){let i=e.position;return $o.includes(i)?i:function(t,e){let{x:i,y:n,x2:r,y2:s,width:a,height:o,pointX:l,pointY:h,centerX:d,centerY:c,rotation:u}=t,f={x:d,y:c},g=e.start,p=no(a,g),x=no(o,g),m=[i,i+p,i+p,r],b=[n+x,s,n,s],y=[];for(let t=0;t<4;t++){let e=To({x:m[t],y:b[t]},f,et(u));y.push({position:$o[t],distance:st(e,{x:l,y:h})})}return y.sort((t,e)=>t.distance-e.distance)[0].position}(t,e)}(e,s);if(!a||function(t,e,i){let{pointX:n,pointY:r}=t,s=e.margin,a=n,o=r;return"left"===i?a+=s:"right"===i?a-=s:"top"===i?o+=s:"bottom"===i&&(o-=s),t.inRange(a,o)}(e,s,a))return;if(t.save(),t.beginPath(),!fo(t,s))return t.restore();let{separatorStart:o,separatorEnd:l}=function(t,e){let i,n,{x:r,y:s,x2:a,y2:o}=t,l=function(t,e){let{width:i,height:n,options:r}=t,s=r.callout.margin+r.borderWidth/2;return"right"===e?i+s:"bottom"===e?n+s:-s}(t,e);return"left"===e||"right"===e?(i={x:r+l,y:s},n={x:i.x,y:o}):(i={x:r,y:s+l},n={x:a,y:i.y}),{separatorStart:i,separatorEnd:n}}(e,a),{sideStart:h,sideEnd:d}=function(t,e,i){let n,r,{y:s,width:a,height:o,options:l}=t,h=l.callout.start,d=function(t,e){let i=e.side;return"left"===t||"top"===t?-i:i}(e,l.callout);return"left"===e||"right"===e?(n={x:i.x,y:s+no(o,h)},r={x:n.x+d,y:n.y}):(n={x:i.x+no(a,h),y:i.y},r={x:n.x,y:n.y+d}),{sideStart:n,sideEnd:r}}(e,a,o);(s.margin>0||0===r.borderWidth)&&(t.moveTo(o.x,o.y),t.lineTo(l.x,l.y)),t.moveTo(h.x,h.y),t.lineTo(d.x,d.y);let c=To({x:i,y:n},e.getCenterPoint(),et(-e.rotation));t.lineTo(c.x,c.y),t.stroke(),t.restore()}(t,this),xo(t,this,e),mo(t,function({x:t,y:e,width:i,height:n,options:r}){let s=r.borderWidth/2,a=Ee(r.padding);return{x:t+a.left+s,y:e+a.top+s,width:i-a.left-a.right-r.borderWidth,height:n-a.top-a.bottom-r.borderWidth}}(this),e),t.restore())}resolveElementProperties(t,e){let i;if(so(e))i=Mo(t,e);else{let{centerX:n,centerY:r}=ko(t,e);i={x:n,y:r}}let r=Ee(e.padding),s=function(t,e,i,n){let r=e.width+n.width+i.borderWidth,s=e.height+n.height+i.borderWidth,a=ro(i.position,"center"),o=Uo(t.x,r,i.xAdjust,a.x),l=Uo(t.y,s,i.yAdjust,a.y);return{x:o,y:l,x2:o+r,y2:l+s,width:r,height:s,centerX:o+r/2,centerY:l+s/2}}(i,po(t.ctx,e),e,r);return Object(n.k)(Object(n.j)({initProperties:ao(t,s,e),pointX:i.x,pointY:i.y},s),{rotation:e.rotation})}};function Uo(t,e,i=0,n){return t-io(e,n)+i}Xo.id="labelAnnotation",Xo.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,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},Xo.defaultRoutes={borderColor:"color"};var qo=(t,e,i)=>({x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}),Ko=(t,e,i)=>qo(e,i,Math.abs((t-e.y)/(i.y-e.y))).x,Go=(t,e,i)=>qo(e,i,Math.abs((t-e.x)/(i.x-e.x))).y,Jo=t=>t*t,Zo=(t,e,i,n)=>(1-n)*(1-n)*t+2*(1-n)*n*e+n*n*i,Qo=(t,e,i,n)=>({x:Zo(t.x,e.x,i.x,n),y:Zo(t.y,e.y,i.y,n)}),tl=(t,e,i,n)=>2*(1-n)*(e-t)+2*n*(i-e),el=(t,e,i,n)=>-Math.atan2(tl(t.x,e.x,i.x,n),tl(t.y,e.y,i.y,n))+.5*V,il=class extends fn{inRange(t,e,i,n){let r=this.options.borderWidth/2;if("x"!==i&&"y"!==i){let i={mouseX:t,mouseY:e},{path:s,ctx:a}=this;if(s){fo(a,this.options);let{chart:r}=this.$context,o=t*r.currentDevicePixelRatio,l=e*r.currentDevicePixelRatio,h=a.isPointInStroke(s,o,l)||sl(this,i,n);return a.restore(),h}return function(t,{mouseX:e,mouseY:i},n=qa,r){let s,a,{x:o,y:l,x2:h,y2:d}=t.getProps(["x","y","x2","y2"],r),c=h-o,u=d-l,f=Jo(c)+Jo(u),g=0===f?-1:((e-o)*c+(i-l)*u)/f;return g<0?(s=o,a=l):g>1?(s=h,a=d):(s=o+g*c,a=l+g*u),Jo(e-s)+Jo(i-a)<=n}(this,i,Jo(r),n)||sl(this,i,n)}return function(t,{mouseX:e,mouseY:i},n,{hBorderWidth:r,useFinalPosition:s}){let a=((t,e,{x:i,y:n,x2:r,y2:s},a)=>"y"===a?{start:Math.min(n,s),end:Math.max(n,s),value:e}:{start:Math.min(i,r),end:Math.max(i,r),value:t})(e,i,t.getProps(["x","y","x2","y2"],s),n);return a.value>=a.start-r&&a.value<=a.end+r||sl(t,{mouseX:e,mouseY:i},s,n)}(this,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:n})}getCenterPoint(t){return Za(this,t)}draw(t){let{x:e,y:i,x2:n,y2:r,cp:s,options:a}=this;if(t.save(),!fo(t,a))return t.restore();go(t,a);let o=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-i,2));if(a.curve&&s)return function(t,e,i,n){let{x:r,y:s,x2:a,y2:o,options:l}=e,{startOpts:h,endOpts:d,startAdjust:c,endAdjust:u}=ll(e),f={x:r,y:s},g={x:a,y:o},p=el(f,i,g,0),x=el(f,i,g,1)-V,m=Qo(f,i,g,c/n),b=Qo(f,i,g,1-u/n),y=new Path2D;t.beginPath(),y.moveTo(m.x,m.y),y.quadraticCurveTo(i.x,i.y,b.x,b.y),t.shadowColor=l.borderShadowColor,t.stroke(y),e.path=y,e.ctx=t,cl(t,m,{angle:p,adjust:c},h),cl(t,b,{angle:x,adjust:u},d)}(t,this,s,o),t.restore();let{startOpts:l,endOpts:h,startAdjust:d,endAdjust:c}=ll(this),u=Math.atan2(r-i,n-e);t.translate(e,i),t.rotate(u),t.beginPath(),t.moveTo(0+d,0),t.lineTo(o-c,0),t.shadowColor=a.borderShadowColor,t.stroke(),dl(t,0,d,l),dl(t,o,-c,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){let i=Oo(t,e),{x:n,y:r,x2:s,y2:a}=i,o=function({x:t,y:e,x2:i,y2:n},{top:r,right:s,bottom:a,left:o}){return!(t<o&&i<o||t>s&&i>s||e<r&&n<r||e>a&&n>a)}(i,t.chartArea),l=o?function(t,e,i){let{x:n,y:r}=rl(t,e,i),{x:s,y:a}=rl(e,t,i);return{x:n,y:r,x2:s,y2:a,width:Math.abs(s-n),height:Math.abs(a-r)}}({x:n,y:r},{x:s,y:a},t.chartArea):{x:n,y:r,x2:s,y2:a,width:Math.abs(s-n),height:Math.abs(a-r)};if(l.centerX=(s+n)/2,l.centerY=(a+r)/2,l.initProperties=ao(t,l,e),e.curve){let t={x:l.x,y:l.y},i={x:l.x2,y:l.y2};l.cp=function(t,e,i){let{x:n,y:r,x2:s,y2:a,centerX:o,centerY:l}=t,h=Math.atan2(a-r,s-n),d=ro(e.controlPoint,0);return To({x:o+no(i,d.x,!1),y:l+no(i,d.y,!1)},{x:o,y:l},h)}(l,e,st(t,i))}let h=function(t,e,i){let n=i.borderWidth,r=Ee(i.padding),s=po(t.ctx,i),a=s.width+r.width+n,o=s.height+r.height+n;return function(t,e,i,n){let{width:r,height:s,padding:a}=i,{xAdjust:o,yAdjust:l}=e,h={x:t.x,y:t.y},d={x:t.x2,y:t.y2},c="auto"===e.rotation?function(t){let{x:e,y:i,x2:n,y2:r}=t,s=Math.atan2(r-i,n-e);return s>V/2?s-V:s<V/-2?s+V:s}(t):et(e.rotation),u=function(t,e,i){let n=Math.cos(i),r=Math.sin(i);return{w:Math.abs(t*n)+Math.abs(e*r),h:Math.abs(t*r)+Math.abs(e*n)}}(r,s,c),f=function(t,e,i,n){let r,s=function(t,e){let{x:i,x2:n,y:r,y2:s}=t,a=Math.min(r,s)-e.top,o=Math.min(i,n)-e.left,l=e.bottom-Math.max(r,s),h=e.right-Math.max(i,n);return{x:Math.min(o,h),y:Math.min(a,l),dx:o<=h?1:-1,dy:a<=l?1:-1}}(t,n);return r="start"===e.position?al({w:t.x2-t.x,h:t.y2-t.y},i,e,s):"end"===e.position?1-al({w:t.x-t.x2,h:t.y-t.y2},i,e,s):io(1,e.position),r}(t,e,{labelSize:u,padding:a},n),g=t.cp?Qo(h,t.cp,d,f):qo(h,d,f),p={size:u.w,min:n.left,max:n.right,padding:a.left},x={size:u.h,min:n.top,max:n.bottom,padding:a.top},m=ol(g.x,p)+o,b=ol(g.y,x)+l;return{x:m-r/2,y:b-s/2,x2:m+r/2,y2:b+s/2,centerX:m,centerY:b,pointX:g.x,pointY:g.y,width:r,height:s,rotation:it(c)}}(e,i,{width:a,height:o,padding:r},t.chartArea)}(t,l,e.label);return h._visible=o,l.elements=[{type:"label",optionScope:"label",properties:h,initProperties:l.initProperties}],l}};il.id="lineAnnotation";var nl={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};function rl({x:t,y:e},i,{top:n,right:r,bottom:s,left:a}){return t<a&&(e=Go(a,{x:t,y:e},i),t=a),t>r&&(e=Go(r,{x:t,y:e},i),t=r),e<n&&(t=Ko(n,{x:t,y:e},i),e=n),e>s&&(t=Ko(s,{x:t,y:e},i),e=s),{x:t,y:e}}function sl(t,{mouseX:e,mouseY:i},n,r){let s=t.label;return s.options.display&&s.inRange(e,i,r,n)}function al(t,e,i,n){let{labelSize:r,padding:s}=e,a=t.w*n.dx,o=t.h*n.dy,l=a>0&&(r.w/2+s.left-n.x)/a,h=o>0&&(r.h/2+s.top-n.y)/o;return Ka(Math.max(l,h),0,.25)}function ol(t,e){let{size:i,min:n,max:r,padding:s}=e,a=i/2;return i>r-n?(r+n)/2:(n>=t-s-a&&(t=n+s+a),r<=t+s+a&&(t=r-s-a),t)}function ll(t){let e=t.options,i=e.arrowHeads&&e.arrowHeads.start,n=e.arrowHeads&&e.arrowHeads.end;return{startOpts:i,endOpts:n,startAdjust:hl(t,i),endAdjust:hl(t,n)}}function hl(t,e){if(!e||!e.display)return 0;let{length:i,width:n}=e,r=t.options.borderWidth/2,s={x:i,y:n+r};return Math.abs(Ko(0,s,{x:0,y:r}))}function dl(t,e,i,n){if(!n||!n.display)return;let{length:r,width:s,fill:a,backgroundColor:o,borderColor:l}=n,h=Math.abs(e-r)+i;t.beginPath(),go(t,n),fo(t,n),t.moveTo(h,-s),t.lineTo(e+i,0),t.lineTo(h,s),!0===a?(t.fillStyle=o||l,t.closePath(),t.fill(),t.shadowColor="transparent"):t.shadowColor=n.borderShadowColor,t.stroke()}function cl(t,{x:e,y:i},{angle:n,adjust:r},s){!s||!s.display||(t.save(),t.translate(e,i),t.rotate(n),dl(t,0,-r,s),t.restore())}il.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},nl),fill:!1,length:12,start:Object.assign({},nl),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 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({},Xo.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,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},il.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},il.defaultRoutes={borderColor:"color"};var ul=class extends fn{inRange(t,e,i,n){let r=this.options.rotation,s=this.options.borderWidth;if("x"!==i&&"y"!==i)return function(t,e,i,n){let{width:r,height:s,centerX:a,centerY:o}=e,l=r/2,h=s/2;if(l<=0||h<=0)return!1;let d=et(i||0),c=n/2||0,u=Math.cos(d),f=Math.sin(d),g=Math.pow(u*(t.x-a)+f*(t.y-o),2),p=Math.pow(f*(t.x-a)-u*(t.y-o),2);return g/Math.pow(l+c,2)+p/Math.pow(h+c,2)<=1.0001}({x:t,y:e},this.getProps(["width","height","centerX","centerY"],n),r,s);let{x:a,y:o,x2:l,y2:h}=this.getProps(["x","y","x2","y2"],n),d=s/2,c="y"===i?{start:o,end:h}:{start:a,end:l},u=To({x:t,y:e},this.getCenterPoint(n),et(-r));return u[i]>=c.start-d-qa&&u[i]<=c.end+d+qa}getCenterPoint(t){return Za(this,t)}draw(t){let{width:e,height:i,centerX:n,centerY:r,options:s}=this;t.save(),uo(t,this.getCenterPoint(),s.rotation),go(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;let a=fo(t,s);t.ellipse(n,r,i/2,e/2,V/2,0,2*V),t.fill(),a&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Po(t,e,!0)}};ul.id="ellipseAnnotation",ul.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},Yo.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},ul.defaultRoutes={borderColor:"color",backgroundColor:"color"},ul.descriptors={label:{_fallback:!0}};var fl=class extends fn{inRange(t,e,i,n){let{x:r,y:s,x2:a,y2:o,width:l}=this.getProps(["x","y","x2","y2","width"],n),h=this.options.borderWidth;if("x"!==i&&"y"!==i)return function(t,e,i,n){if(!t||!e||i<=0)return!1;let r=n/2;return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(i+r,2)}({x:t,y:e},this.getCenterPoint(n),l/2,h);let d=h/2,c="y"===i?{start:s,end:o,value:e}:{start:r,end:a,value:t};return c.value>=c.start-d&&c.value<=c.end+d}getCenterPoint(t){return Za(this,t)}draw(t){let e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,go(t,e);let n=fo(t,e);bo(t,this,this.centerX,this.centerY),n&&!co(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){let i=So(t,e);return i.initProperties=ao(t,i,e,!0),i}};fl.id="pointAnnotation",fl.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!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},fl.defaultRoutes={borderColor:"color",backgroundColor:"color"};var gl=class extends fn{inRange(t,e,i,n){if("x"!==i&&"y"!==i)return this.options.radius>=.1&&this.elements.length>1&&function(t,e,i,n){let r=!1,s=t[t.length-1].getProps(["bX","bY"],n);for(let a of t){let t=a.getProps(["bX","bY"],n);t.bY>i!=s.bY>i&&e<(s.bX-t.bX)*(i-t.bY)/(s.bY-t.bY)+t.bX&&(r=!r),s=t}return r}(this.elements,t,e,n);let r=To({x:t,y:e},this.getCenterPoint(n),et(-this.options.rotation)),s=this.elements.map(t=>"y"===i?t.bY:t.bX),a=Math.min(...s),o=Math.max(...s);return r[i]>=a&&r[i]<=o}getCenterPoint(t){return Za(this,t)}draw(t){let{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,go(t,i);let n=fo(t,i),r=!0;for(let i of e)r?(t.moveTo(i.x,i.y),r=!1):t.lineTo(i.x,i.y);t.closePath(),t.fill(),n&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){let i=So(t,e),{sides:n,rotation:r}=e,s=[],a=2*V/n,o=r*$;for(let r=0;r<n;r++,o+=a){let n=pl(i,e,o);n.initProperties=ao(t,i,e),s.push(n)}return i.elements=s,i}};function pl({centerX:t,centerY:e},{radius:i,borderWidth:n},r){let s=n/2,a=Math.sin(r),o=Math.cos(r),l={x:t+a*i,y:e-o*i};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:t+a*(i+s),bY:e-o*(i+s)}}}gl.id="polygonAnnotation",gl.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!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},gl.defaultRoutes={borderColor:"color",backgroundColor:"color"};var xl={box:Yo,ellipse:ul,label:Xo,line:il,point:fl,polygon:gl};Object.keys(xl).forEach(t=>{fe.describe("elements."+xl[t].id,{_fallback:"plugins.annotation.common"})});var ml={update:Object.assign},bl=Io.concat(zo),yl=(t,e)=>_(e)?Pl(t,e):t,vl=t=>"color"===t||"font"===t;function _l(t="line"){return xl[t]?t:(console.warn(`Unknown annotation type: '${t}', defaulting to 'line'`),"line")}function wl(t,e,i,n){let r=function(t,e,i){return"reset"===i||"none"===i||"resize"===i?ml:new Fi(t,e)}(t,i.animations,n),s=e.annotations,a=function(t,e){let i=e.length,n=t.length;if(n<i){let e=i-n;t.splice(n,0,...new Array(e))}else n>i&&t.splice(i,n-i);return t}(e.elements,s);for(let e=0;e<s.length;e++){let i=s[e],n=Sl(a,e,i.type),o=i.setContext(Dl(t,n,i)),l=n.resolveElementProperties(t,o);l.skip=Ml(l),"elements"in l&&(kl(n,l.elements,o,r),delete l.elements),F(n.x)||Object.assign(n,l),Object.assign(n,l.initProperties),l.options=Ol(o),r.update(n,l)}}function Ml(t){return isNaN(t.x)||isNaN(t.y)}function kl(t,e,i,n){let r=t.elements||(t.elements=[]);r.length=e.length;for(let t=0;t<e.length;t++){let s=e[t],a=s.properties,o=Sl(r,t,s.type,s.initProperties),l=i[s.optionScope].override(s);a.options=Ol(l),n.update(o,a)}}function Sl(t,e,i,n){let r=xl[_l(i)],s=t[e];return(!s||!(s instanceof r))&&(s=t[e]=new r,Object.assign(s,n)),s}function Ol(t){let e=xl[_l(t.type)],i={};i.id=t.id,i.type=t.type,i.drawTime=t.drawTime,Object.assign(i,Pl(t,e.defaults),Pl(t,e.defaultRoutes));for(let e of bl)i[e]=t[e];return i}function Pl(t,e){let i={};for(let n of Object.keys(e)){let r=e[n],s=t[n];vl(n)&&v(s)?i[n]=s.map(t=>yl(t,r)):i[n]=yl(s,r)}return i}function Dl(t,e,i){return e.$context||(e.$context=Object.assign(Object.create(t.getContext()),{element:e,id:i.id,type:"annotation"}))}var Cl=new Map,Al=Io.concat(zo),Tl={id:"annotation",version:"2.2.1",beforeRegister(){!function(t,e,i,n=!0){let r=i.split("."),s=0;for(let a of e.split(".")){let o=r[s++];if(parseInt(a,10)<parseInt(o,10))break;if(Ua(o,a)){if(n)throw new Error(`${t} v${i} is not supported. v${e} or newer is required.`);return!1}}}("chart.js","3.7",Er.version)},afterRegister(){Er.register(xl)},afterUnregister(){Er.unregister(xl)},beforeInit(t){Cl.set(t,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(t,e,i){let n=Cl.get(t).annotations=[],r=i.annotations;_(r)?Object.keys(r).forEach(t=>{let e=r[t];_(e)&&(e.id=t,n.push(e))}):v(r)&&n.push(...r),function(t,e){for(let i of t)Vo(i,e)}(n,t.scales)},afterDataLimits(t,e){let i=Cl.get(t);Wo(t,e.scale,i.annotations.filter(t=>t.display&&t.adjustScaleRange))},afterUpdate(t,e,i){let n=Cl.get(t);(function(t,e,i){e.listened=oo(i,Io,e.listeners),e.moveListened=!1,e._getElements=$a,jo.forEach(t=>{W(i[t])&&(e.moveListened=!0)}),(!e.listened||!e.moveListened)&&e.annotations.forEach(t=>{!e.listened&&W(t.click)&&(e.listened=!0),e.moveListened||jo.forEach(i=>{W(t[i])&&(e.listened=!0,e.moveListened=!0)})})})(0,n,i),wl(t,n,i,e.mode),n.visibleElements=n.elements.filter(t=>!t.skip&&t.options.display),function(t,e,i){let n=e.visibleElements;e.hooked=oo(i,zo,e.hooks),e.hooked||n.forEach(t=>{e.hooked||zo.forEach(i=>{W(t.options[i])&&(e.hooked=!0)})})}(0,n,i)},beforeDatasetsDraw(t,e,i){jl(t,"beforeDatasetsDraw",i.clip)},afterDatasetsDraw(t,e,i){jl(t,"afterDatasetsDraw",i.clip)},beforeDraw(t,e,i){jl(t,"beforeDraw",i.clip)},afterDraw(t,e,i){jl(t,"afterDraw",i.clip)},beforeEvent(t,e,i){Ro(Cl.get(t),e.event,i)&&(e.changed=!0)},afterDestroy(t){Cl.delete(t)},_getState:t=>Cl.get(t),defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:t=>!Al.includes(t)&&"init"!==t,annotations:{_allKeys:!1,_fallback:(t,e)=>"elements."+xl[_l(e.type)].id},interaction:{_fallback:!0},common:{label:{_indexable:vl,_fallback:!0},_indexable:vl}},additionalOptionScopes:[""]};function jl(t,e,i){let{ctx:n,chartArea:r}=t,s=Cl.get(t);i&&_e(n,r);let a=function(t,e){let i=[];for(let n of t)if(n.options.drawTime===e&&i.push({element:n,main:!0}),n.elements&&n.elements.length)for(let t of n.elements)t.options.display&&t.options.drawTime===e&&i.push({element:t});return i}(s.visibleElements,e).sort((t,e)=>t.element.options.z-e.element.options.z);for(let t of a)Il(n,r,s,t);i&&we(n)}function Il(t,e,i,n){let r=n.element;n.main?(Fo(i,r,"beforeDraw"),r.draw(t,e),Fo(i,r,"afterDraw")):r.draw(t,e)}var Rl=Er.version,El=Rl?(t,e)=>t.parse(e):(t,e)=>e;var Ll=t=>t&&t.right>t.left&&t.bottom>t.top;function zl(t,e,i){return"r"===e?t.createRadialGradient(i.xCenter,i.yCenter,0,i.xCenter,i.yCenter,i.drawingArea):"y"===e?t.createLinearGradient(0,i.bottom,0,i.top):t.createLinearGradient(i.left,0,i.right,0)}function Fl(t,e){e.forEach((function(e){t.addColorStop(e.stop,e.color.rgbString())}))}function Wl(t,e,i){if(t.options.has(e.key)){let n=t.options.get(e.key).filter(t=>t.datasetIndex===i);if(n.length)return n[0]}}function Nl(t,e){if("radialLinear"===t.type){let i=t.getDistanceFromCenterForValue(e);return{pixel:i,stop:i/t.drawingArea}}let i=t.options.reverse,n=function(t,e){let i=Z(e)?parseFloat(e):El(t,e);return t.getPixelForValue(i)}(t,e),r=t.getDecimalForPixel(n);return{pixel:n,stop:i?1-r:r}}var Vl=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Bl=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Hl(t,e,i,n){let r=Wl(t,e,i);if(!r||!r.stopColors.length)return;let s,a,{stop:o}=Nl(r.scale,n);for(let t of r.stopColors){if(t.stop===o)return t.color;t.stop<o?s=t:t.stop>o&&!a&&(a=t)}return a?function(t,e,i){let n=e.color.rgb,r=Bl(n.r/255),s=Bl(n.g/255),a=Bl(n.b/255),o=i.color.rgb,l=Bl(o.r/255),h=Bl(o.g/255),d=Bl(o.b/255);return oe({r:Math.round(255*Vl(r+t*(l-r))),g:Math.round(255*Vl(s+t*(h-s))),b:Math.round(255*Vl(a+t*(d-a))),a:n.a+t*Math.abs(o.a-n.a)})}(o,s,a):s}var Yl=[{key:"backgroundColor",legendItemKey:"fillStyle"},{key:"borderColor",legendItemKey:"strokeStyle"}];function $l(t,e,i,n){let r=function(t,{boxWidth:e,boxHeight:i}){return{top:t.top,left:t.left,bottom:t.top+i,right:t.left+e,xCenter:t.left+e/2,yCenter:t.top+i/2,drawingArea:Math.max(e,i)/2}}(t.legend.legendHitBoxes[i.datasetIndex],n);Ll(r)&&Yl.forEach((function(n){!function(t,e,i,n,r){let s=Wl(t,i,n.datasetIndex);if(!s||!s.stopColors.length)return;let a=zl(e,s.axis,r);Fl(a,s.stopColors),n[i.legendItemKey]=a}(e,t.ctx,n,i,r)}))}function Xl(t,e,i,n){for(let r of t.legend.legendItems)Yl.forEach((function(t){let s=i.data[r.index],a=Hl(e,t,n,s);a&&a.valid&&(r[t.legendItemKey]=a.rgbString())}))}function Ul(t,e){let i=t.legend,n=i.options,r=n.labels.boxHeight?n.labels.boxHeight:((t,e)=>e.labels&&e.labels.font&&F(e.labels.font.size)?e.labels.font.size:t.options.font.size)(t,n),s=n.labels.boxWidth,a=t.data.datasets;for(let n=0;n<a.length;n++){let o=i.legendItems[n];o.datasetIndex===n?$l(t,e,o,{boxWidth:s,boxHeight:r}):Xl(t,e,a[n],n)}}var ql=new Map,Kl=Rl?(t,e)=>t[e+"Scale"]:(t,e)=>t.controller["_"+e+"Scale"];function Gl(t,e,i){for(let n of Object.keys(e)){let{pixel:r,stop:s}=Nl(t,n);if(isFinite(r)&&isFinite(s)){let t=oe(e[n]);t&&t.valid&&i.push({stop:Math.max(0,Math.min(1,s)),color:t})}}i.sort((t,e)=>t.stop-e.stop)}function Jl(t,e,i,n){e[i]=n,t.dataset&&(t.dataset.options?t.dataset.options[i]=n:t.dataset[i]=n)}function Zl(t,e,i,n){let r=t.options.get(i);return r?e.hidden||(r=r.filter(t=>t.datasetIndex!==n),t.options.set(i,r)):(r=[],t.options.set(i,r)),r}function Ql(t,e,i,n,r){let s=t.ctx,a=t.getDatasetMeta(r);if(!a.hidden)for(let[o,l]of Object.entries(i)){let{axis:i,colors:h}=l;if(!h)continue;let d=Kl(a,i);if(!d){console.warn(`Scale not found for '${i}'-axis in datasets[${r}] of chart id ${t.id}, skipping.`);continue}let c={datasetIndex:r,axis:i,scale:d,stopColors:[]};Zl(e,a,o,r).push(c);let u=zl(s,i,d);Gl(d,h,c.stopColors),c.stopColors.length&&(Fl(u,c.stopColors),Jl(a,n,o,u))}}var th=[Hs,Us,as,Ds,Vs,Os,Ha,Qr,Jr,Ms,Br,Tl,{id:"gradient",beforeInit(t){let e={};e.options=new Map,ql.set(t,e)},beforeDatasetsUpdate(t){let e=t.chartArea;if(!Ll(e))return;let i=ql.get(t),n=t.data.datasets;for(let e=0;e<n.length;e++){let r=n[e],s=r.gradient;s&&Ql(t,i,s,r,e)}},afterUpdate(t){let e=ql.get(t);t.legend&&!1!==t.legend.options.display&&Rl&&Ul(t,e)},destroy(t){ql.delete(t)}}];Er.register(...th);var eh="label";function ih(t,e){"function"==typeof t?t(e):t&&(t.current=e)}function nh(t,e){t.labels=e}function rh(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eh,r=[];t.datasets=e.map(e=>{let s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!r.includes(s)?(r.push(s),Object.assign(s,e),s):Object(n.j)({},e)})}function sh(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eh,i={labels:[],datasets:[]};return nh(i,t.labels),rh(i,t.datasets,e),i}var ah=Object(r.forwardRef)((function(t,e){let i=t,{height:a=150,width:o=300,redraw:l=!1,datasetIdKey:h,type:d,data:c,options:u,plugins:f=[],fallbackContent:g,updateMode:p}=i,x=Object(n.l)(i,["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"]),m=Object(r.useRef)(null),b=Object(r.useRef)(),y=()=>{m.current&&(b.current=new Er(m.current,{type:d,data:sh(c,h),options:u&&Object(n.j)({},u),plugins:f}),ih(e,b.current))},v=()=>{ih(e,null),b.current&&(b.current.destroy(),b.current=null)};return Object(r.useEffect)(()=>{!l&&b.current&&u&&function(t,e){Object.assign(t.options,e)}(b.current,u)},[l,u]),Object(r.useEffect)(()=>{!l&&b.current&&nh(b.current.config.data,c.labels)},[l,c.labels]),Object(r.useEffect)(()=>{!l&&b.current&&c.datasets&&rh(b.current.config.data,c.datasets,h)},[l,c.datasets]),Object(r.useEffect)(()=>{b.current&&(l?(v(),setTimeout(y)):b.current.update(p))},[l,u,c.labels,c.datasets,p]),Object(r.useEffect)(()=>{b.current&&(v(),setTimeout(y))},[d]),Object(r.useEffect)(()=>(y(),()=>v()),[]),s.a.createElement("canvas",Object.assign({ref:m,role:"img",height:a,width:o},x),g)}));var oh,lh,hh=(oh="bar",lh=an,Er.register(lh),Object(r.forwardRef)((t,e)=>s.a.createElement(ah,Object.assign({},t,{ref:e,type:oh})))),dh={id:"redrawBeforeFirstDrawPlugin",beforeDraw(t){t.$rendered||(t.$rendered=!0,t.update("none"))}},ch=(t,e=1)=>`${t}${Math.round(255*e).toString(16).padStart(2,"0")}`,uh=t=>t.palette.text.secondary,fh=t=>t.palette.outlinedBorder,gh=t=>({family:t.typography.fontFamily,size:parseInt(t.typography.body.fontSize)});function ph(t){let e=["#4caf50","#2196f3","#ff5722","#ff9800","#e91e63","#3f51b5","#00bcd4","#81c784","#64b5f6","#ff8a65","#ffb74d","#f06292","#7986cb","#4dd0e1","#a5d6a7","#90caf9","#ffab91","#ffcc80","#f48fb1","#9fa8da","#80deea"];return e[t%e.length]}function xh(t,e,i,r){let s=function(t){let e=[],i=new Date;switch(t){case a.h.LastDay:{let t=new Date(i);t.setHours(t.getHours()-23),t.setMinutes(0,0,0);for(let i=0;i<24;i++){let n=new Date(t);n.setHours(n.getHours()+i),e.push(n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}))}break}case a.h.LastWeek:for(let t=6;t>=0;t--){let n=new Date(i);n.setDate(n.getDate()-t),e.push(n.toLocaleDateString("en-US",{month:"short",day:"2-digit"}))}break;case a.h.LastYear:for(let t=11;t>=0;t--){let n=new Date(i);n.setMonth(n.getMonth()-t),e.push(n.toLocaleDateString("en-US",{month:"short",year:"2-digit"}))}break;case a.h.LastMonth:default:for(let t=29;t>=0;t--){let n=new Date(i);n.setDate(n.getDate()-t),e.push(n.toLocaleDateString("en-US",{month:"short",day:"2-digit"}))}}return e}(r);if(!t||!t.series||0===t.series.length)return{data:null,options:null};let o=t.series.map((t,e)=>{let i=t.featureName,n=new Map;t.points.forEach(t=>{let e=function(t,e){let i=new Date(t);switch(i.setMinutes(0,0,0),e){case a.h.LastDay:return i.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});case a.h.LastYear:return t.toLocaleDateString("en-US",{month:"short",year:"2-digit"});case a.h.LastWeek:case a.h.LastMonth:default:return t.toLocaleDateString("en-US",{month:"short",day:"2-digit"})}}(new Date(t.timestamp),r),i=n.get(e)||0;n.set(e,i+t.value)});let o=s.map(t=>n.get(t)||0),l=ph(e);return{label:i,data:o,backgroundColor:ch(l,.8),borderColor:l,borderWidth:1}}).reverse();return{data:{labels:s,datasets:o},options:function(t,e){return{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"point",intersect:!0},elements:{bar:{borderRadius:4,borderSkipped:"bottom"}},plugins:{legend:{display:!1},tooltip:{enabled:!1,external:e},datalabels:{display:!1}},scales:{x:{type:"category",stacked:!0,ticks:{color:uh(t),font:gh(t),maxRotation:45,maxTicksLimit:15},grid:{color:fh(t),drawOnChartArea:!1,drawTicks:!1}},y:{type:"linear",stacked:!0,beginAtZero:!0,ticks:{color:uh(t),font:gh(t),callback:t=>Object(n.t)(Number(t))},grid:{color:ch(fh(t),.5),drawOnChartArea:!0,drawTicks:!1,borderDash:[5,5]}}}}}(e,i)}}function mh(t,e){let i=e.dataPoints[0],n=i.parsed.y,r=t.scales.y,s=n/r.max*(r.bottom-r.top),a=e.caretY+s/2,o=t.getDatasetMeta(i.datasetIndex).data[i.dataIndex],l=o.x-o.width/2;return{top:t.canvas.offsetTop+a,left:t.canvas.offsetLeft+l}}function bh(t,e){return{top:t.canvas.offsetTop+e.caretY,left:t.canvas.offsetLeft+e.caretX}}var yh=Object(n.n)(h.a)`
1
+ (window.webpackJsonpStigg=window.webpackJsonpStigg||[]).push([[1],{582:function(t,e,i){var n=i(43),r=i(583),s=i(274),a=Math.max,o=Math.min;t.exports=function(t,e,i){var l,h,d,c,u,f,g=0,p=!1,x=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function b(e){var i=l,n=h;return l=h=void 0,g=e,c=t.apply(n,i)}function y(t){return g=t,u=setTimeout(_,e),p?b(t):c}function v(t){var i=t-f;return void 0===f||i>=e||i<0||x&&t-g>=d}function _(){var t=r();if(v(t))return w(t);u=setTimeout(_,function(t){var i=e-(t-f);return x?o(i,d-(t-g)):i}(t))}function w(t){return u=void 0,m&&l?b(t):(l=h=void 0,c)}function M(){var t=r(),i=v(t);if(l=arguments,h=this,f=t,i){if(void 0===u)return y(f);if(x)return clearTimeout(u),u=setTimeout(_,e),b(f)}return void 0===u&&(u=setTimeout(_,e)),c}return e=s(e)||0,n(i)&&(p=!!i.leading,d=(x="maxWait"in i)?a(s(i.maxWait)||0,e):d,m="trailing"in i?!!i.trailing:m),M.cancel=function(){void 0!==u&&clearTimeout(u),g=0,l=f=h=u=void 0},M.flush=function(){return void 0===u?c:w(r())},M}},583:function(t,e,i){var n=i(42);t.exports=function(){return n.Date.now()}},585:function(t,e,i){"use strict";i.r(e),i.d(e,"CreditUsageChart",(function(){return Yh}));var n=i(2),r=i(0),s=i.n(r),a=i(5),o=i(133),l=i.n(o),h=i(581),d=i(582),c=i.n(d),u=i(1),f=i(18),g=i(576),p=i(580),x=i(574);function m(){}var b=function(){let t=0;return function(){return t++}}();function y(t){return null==t}function v(t){if(Array.isArray&&Array.isArray(t))return!0;let e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function _(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}var w=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function M(t,e){return w(t)?t:e}function k(t,e){return void 0===t?e:t}var S=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function O(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function P(t,e,i,n){let r,s,a;if(v(t))if(s=t.length,n);else for(r=0;r<s;r++)e.call(i,t[r],r);else if(_(t))for(a=Object.keys(t),s=a.length,r=0;r<s;r++)e.call(i,t[a[r]],a[r])}function D(t,e){let i,n,r,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(r=t[i],s=e[i],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function C(t){if(v(t))return t.map(C);if(_(t)){let e=Object.create(null),i=Object.keys(t),n=i.length,r=0;for(;r<n;++r)e[i[r]]=C(t[i[r]]);return e}return t}function A(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function T(t,e,i,n){if(!A(t))return;let r=e[t],s=i[t];_(r)&&_(s)?j(r,s,n):e[t]=C(s)}function j(t,e,i){let n=v(e)?e:[e],r=n.length;if(!_(t))return t;let s=(i=i||{}).merger||T;for(let a=0;a<r;++a){if(!_(e=n[a]))continue;let r=Object.keys(e);for(let n=0,a=r.length;n<a;++n)s(r[n],t,e,i)}return t}function I(t,e){return j(t,e,{merger:R})}function R(t,e,i){if(!A(t))return;let n=e[t],r=i[t];_(n)&&_(r)?I(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=C(r))}var E={"":t=>t,x:t=>t.x,y:t=>t.y};function L(t,e){return(E[e]||(E[e]=function(t){let e=function(t){let e=t.split("."),i=[],n="";for(let t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(let i of e){if(""===i)break;t=t&&t[i]}return t}}(e)))(t)}function z(t){return t.charAt(0).toUpperCase()+t.slice(1)}var F=t=>void 0!==t,W=t=>"function"==typeof t,N=(t,e)=>{if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0};var V=Math.PI,B=2*V,H=B+V,Y=Number.POSITIVE_INFINITY,$=V/180,X=V/2,U=V/4,q=2*V/3,K=Math.log10,G=Math.sign;function J(t){let e=Math.round(t);t=Q(t,e,t/1e3)?e:t;let i=Math.pow(10,Math.floor(K(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function Z(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Q(t,e,i){return Math.abs(t-e)<i}function tt(t,e,i){let n,r,s;for(n=0,r=t.length;n<r;n++)s=t[n][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function et(t){return t*(V/180)}function it(t){return t*(180/V)}function nt(t){if(!w(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function rt(t,e){let i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n),s=Math.atan2(n,i);return s<-.5*V&&(s+=B),{angle:s,distance:r}}function st(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function at(t,e){return(t-e+H)%B-V}function ot(t){return(t%B+B)%B}function lt(t,e,i,n){let r=ot(t),s=ot(e),a=ot(i),o=ot(s-r),l=ot(a-r),h=ot(r-s),d=ot(r-a);return r===s||r===a||n&&s===a||o>l&&h<d}function ht(t,e,i){return Math.max(e,Math.min(i,t))}function dt(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function ct(t,e,i){i=i||(i=>t[i]<e);let n,r=t.length-1,s=0;for(;r-s>1;)n=s+r>>1,i(n)?s=n:r=n;return{lo:s,hi:r}}var ut=(t,e,i,n)=>ct(t,i,n?n=>t[n][e]<=i:n=>t[n][e]<i),ft=(t,e,i)=>ct(t,i,n=>t[n][e]>=i);var gt=["push","pop","shift","splice","unshift"];function pt(t,e){let i=t._chartjs;if(!i)return;let n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),!(n.length>0)&&(gt.forEach(e=>{delete t[e]}),delete t._chartjs)}function xt(t){let e,i,n=new Set;for(e=0,i=t.length;e<i;++e)n.add(t[e]);return n.size===i?t:Array.from(n)}var mt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function bt(t,e,i){let n=i||(t=>Array.prototype.slice.call(t)),r=!1,s=[];return function(...i){s=n(i),r||(r=!0,mt.call(window,()=>{r=!1,t.apply(e,s)}))}}var yt=t=>"start"===t?"left":"end"===t?"right":"center",vt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function _t(t,e,i){let n=e.length,r=0,s=n;if(t._sorted){let{iScale:a,_parsed:o}=t,l=a.axis,{min:h,max:d,minDefined:c,maxDefined:u}=a.getUserBounds();c&&(r=ht(Math.min(ut(o,a.axis,h).lo,i?n:ut(e,l,a.getPixelForValue(h)).lo),0,n-1)),s=u?ht(Math.max(ut(o,a.axis,d,!0).hi+1,i?0:ut(e,l,a.getPixelForValue(d),!0).hi+1),r,n)-r:n-r}return{start:r,count:s}}function wt(t){let{xScale:e,yScale:i,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;let s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),s}var Mt=t=>0===t||1===t,kt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*B/i),St=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*B/i)+1,Ot={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*X),easeOutSine:t=>Math.sin(t*X),easeInOutSine:t=>-.5*(Math.cos(V*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Mt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Mt(t)?t:kt(t,.075,.3),easeOutElastic:t=>Mt(t)?t:St(t,.075,.3),easeInOutElastic:t=>Mt(t)?t:t<.5?.5*kt(2*t,.1125,.45):.5+.5*St(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Ot.easeOutBounce(1-t),easeOutBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,easeInOutBounce:t=>t<.5?.5*Ot.easeInBounce(2*t):.5*Ot.easeOutBounce(2*t-1)+.5};function Pt(t){return t+.5|0}var Dt=(t,e,i)=>Math.max(Math.min(t,i),e);function Ct(t){return Dt(Pt(2.55*t),0,255)}function At(t){return Dt(Pt(255*t),0,255)}function Tt(t){return Dt(Pt(t/2.55)/100,0,1)}function jt(t){return Dt(Pt(100*t),0,100)}var It={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},Rt=[..."0123456789ABCDEF"],Et=t=>Rt[15&t],Lt=t=>Rt[(240&t)>>4]+Rt[15&t],zt=t=>(240&t)>>4==(15&t);function Ft(t){var e=(t=>zt(t.r)&&zt(t.g)&&zt(t.b)&&zt(t.a))(t)?Et:Lt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}var Wt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Nt(t,e,i){let n=e*Math.min(i,1-i),r=(e,r=(e+t/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function Vt(t,e,i){let n=(n,r=(n+t/60)%6)=>i-i*e*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function Bt(t,e,i){let n,r=Nt(t,1,.5);for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)r[n]*=1-e-i,r[n]+=e;return r}function Ht(t){let e,i,n,r=t.r/255,s=t.g/255,a=t.b/255,o=Math.max(r,s,a),l=Math.min(r,s,a),h=(o+l)/2;return o!==l&&(n=o-l,i=h>.5?n/(2-o-l):n/(o+l),e=function(t,e,i,n,r){return t===r?(e-i)/n+(e<i?6:0):e===r?(i-t)/n+2:(t-e)/n+4}(r,s,a,n,o),e=60*e+.5),[0|e,i||0,h]}function Yt(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(At)}function $t(t,e,i){return Yt(Nt,t,e,i)}function Xt(t){return(t%360+360)%360}function Ut(t){let e,i=Wt.exec(t),n=255;if(!i)return;i[5]!==e&&(n=i[6]?Ct(+i[5]):At(+i[5]));let r=Xt(+i[2]),s=+i[3]/100,a=+i[4]/100;return e="hwb"===i[1]?function(t,e,i){return Yt(Bt,t,e,i)}(r,s,a):"hsv"===i[1]?function(t,e,i){return Yt(Vt,t,e,i)}(r,s,a):$t(r,s,a),{r:e[0],g:e[1],b:e[2],a:n}}var qt,Kt={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"},Gt={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 Jt(t){qt||((qt=function(){let t,e,i,n,r,s={},a=Object.keys(Gt),o=Object.keys(Kt);for(t=0;t<a.length;t++){for(n=r=a[t],e=0;e<o.length;e++)i=o[e],r=r.replace(i,Kt[i]);i=parseInt(Gt[n],16),s[r]=[i>>16&255,i>>8&255,255&i]}return s}()).transparent=[0,0,0,0]);let e=qt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}var Zt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;var Qt=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,te=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function ee(t,e,i){if(t){let n=Ht(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=$t(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function ie(t,e){return t&&Object.assign(e||{},t)}function ne(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=At(t[3]))):(e=ie(t,{r:0,g:0,b:0,a:1})).a=At(e.a),e}function re(t){return"r"===t.charAt(0)?function(t){let e,i,n,r=Zt.exec(t),s=255;if(r){if(r[7]!==e){let t=+r[7];s=r[8]?Ct(t):Dt(255*t,0,255)}return e=+r[1],i=+r[3],n=+r[5],e=255&(r[2]?Ct(e):Dt(e,0,255)),i=255&(r[4]?Ct(i):Dt(i,0,255)),n=255&(r[6]?Ct(n):Dt(n,0,255)),{r:e,g:i,b:n,a:s}}}(t):Ut(t)}function se(t){return new class t{constructor(e){if(e instanceof t)return e;let i,n=typeof e;"object"===n?i=ne(e):"string"===n&&(i=function(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*It[t[1]],g:255&17*It[t[2]],b:255&17*It[t[3]],a:5===i?17*It[t[4]]:255}:(7===i||9===i)&&(e={r:It[t[1]]<<4|It[t[2]],g:It[t[3]]<<4|It[t[4]],b:It[t[5]]<<4|It[t[6]],a:9===i?It[t[7]]<<4|It[t[8]]:255})),e}(e)||Jt(e)||re(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ie(this._rgb);return t&&(t.a=Tt(t.a)),t}set rgb(t){this._rgb=ne(t)}rgbString(){return this._valid?function(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Tt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}(this._rgb):void 0}hexString(){return this._valid?Ft(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=Ht(t),i=e[0],n=jt(e[1]),r=jt(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${r}%, ${Tt(t.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){let i,n=this.rgb,r=t.rgb,s=e===i?.5:e,a=2*s-1,o=n.a-r.a,l=((a*o==-1?a:(a+o)/(1+a*o))+1)/2;i=1-l,n.r=255&l*n.r+i*r.r+.5,n.g=255&l*n.g+i*r.g+.5,n.b=255&l*n.b+i*r.b+.5,n.a=s*n.a+(1-s)*r.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){let n=te(Tt(t.r)),r=te(Tt(t.g)),s=te(Tt(t.b));return{r:At(Qt(n+i*(te(Tt(e.r))-n))),g:At(Qt(r+i*(te(Tt(e.g))-r))),b:At(Qt(s+i*(te(Tt(e.b))-s))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new t(this.rgb)}alpha(t){return this._rgb.a=At(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){let t=this._rgb,e=Pt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ee(this._rgb,2,t),this}darken(t){return ee(this._rgb,2,-t),this}saturate(t){return ee(this._rgb,1,t),this}desaturate(t){return ee(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Ht(t);i[0]=Xt(i[0]+e),i=$t(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}(t)}function ae(t){if(t&&"object"==typeof t){let e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function oe(t){return ae(t)?t:se(t)}function le(t){return ae(t)?t:se(t).saturate(.5).darken(.1).hexString()}var he=Object.create(null),de=Object.create(null);function ce(t,e){if(!e)return t;let i=e.split(".");for(let e=0,n=i.length;e<n;++e){let n=i[e];t=t[n]||(t[n]=Object.create(null))}return t}function ue(t,e,i){return"string"==typeof e?j(ce(t,e),i):j(ce(t,""),e)}var fe=new class{constructor(t){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=t=>t.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=(t,e)=>le(e.backgroundColor),this.hoverBorderColor=(t,e)=>le(e.borderColor),this.hoverColor=(t,e)=>le(e.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)}set(t,e){return ue(this,t,e)}get(t){return ce(this,t)}describe(t,e){return ue(de,t,e)}override(t,e){return ue(he,t,e)}route(t,e,i,n){let r=ce(this,t),s=ce(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){let t=this[a],e=s[n];return _(t)?Object.assign({},e,t):k(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function ge(t,e,i,n,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,i.push(r)),s>n&&(n=s),n}function pe(t,e,i,n){let r=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let a,o,l,h,d,c=0,u=i.length;for(a=0;a<u;a++)if(h=i[a],null!=h&&!0!==v(h))c=ge(t,r,s,c,h);else if(v(h))for(o=0,l=h.length;o<l;o++)d=h[o],null!=d&&!v(d)&&(c=ge(t,r,s,c,d));t.restore();let f=s.length/2;if(f>i.length){for(a=0;a<f;a++)delete r[s[a]];s.splice(0,f)}return c}function xe(t,e,i){let n=t.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((e-r)*n)/n+r}function me(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function be(t,e,i,n){ye(t,e,i,n,null)}function ye(t,e,i,n,r){let s,a,o,l,h,d,c=e.pointStyle,u=e.rotation,f=e.radius,g=(u||0)*$;if(c&&"object"==typeof c&&(s=c.toString(),"[object HTMLImageElement]"===s||"[object HTMLCanvasElement]"===s))return t.save(),t.translate(i,n),t.rotate(g),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),void t.restore();if(!(isNaN(f)||f<=0)){switch(t.beginPath(),c){default:r?t.ellipse(i,n,r/2,f,0,0,B):t.arc(i,n,f,0,B),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(g)*f,n-Math.cos(g)*f),g+=q,t.lineTo(i+Math.sin(g)*f,n-Math.cos(g)*f),g+=q,t.lineTo(i+Math.sin(g)*f,n-Math.cos(g)*f),t.closePath();break;case"rectRounded":h=.516*f,l=f-h,a=Math.cos(g+U)*l,o=Math.sin(g+U)*l,t.arc(i-a,n-o,h,g-V,g-X),t.arc(i+o,n-a,h,g-X,g),t.arc(i+a,n+o,h,g,g+X),t.arc(i-o,n+a,h,g+X,g+V),t.closePath();break;case"rect":if(!u){l=Math.SQRT1_2*f,d=r?r/2:l,t.rect(i-d,n-l,2*d,2*l);break}g+=U;case"rectRot":a=Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+o,n-a),t.lineTo(i+a,n+o),t.lineTo(i-o,n+a),t.closePath();break;case"crossRot":g+=U;case"cross":a=Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+a,n+o),t.moveTo(i+o,n-a),t.lineTo(i-o,n+a);break;case"star":a=Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+a,n+o),t.moveTo(i+o,n-a),t.lineTo(i-o,n+a),g+=U,a=Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+a,n+o),t.moveTo(i+o,n-a),t.lineTo(i-o,n+a);break;case"line":a=r?r/2:Math.cos(g)*f,o=Math.sin(g)*f,t.moveTo(i-a,n-o),t.lineTo(i+a,n+o);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(g)*f,n+Math.sin(g)*f)}t.fill(),e.borderWidth>0&&t.stroke()}}function ve(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function _e(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function we(t){t.restore()}function Me(t,e,i,n,r){if(!e)return t.lineTo(i.x,i.y);if("middle"===r){let n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===r!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function ke(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Se(t,e,i,n,r,s={}){let a,o,l=v(e)?e:[e],h=s.strokeWidth>0&&""!==s.strokeColor;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),y(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),a=0;a<l.length;++a)o=l[a],h&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),y(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(o,i,n,s.maxWidth)),t.fillText(o,i,n,s.maxWidth),Oe(t,i,n,o,s),n+=r.lineHeight;t.restore()}function Oe(t,e,i,n,r){if(r.strikethrough||r.underline){let s=t.measureText(n),a=e-s.actualBoundingBoxLeft,o=e+s.actualBoundingBoxRight,l=i-s.actualBoundingBoxAscent,h=i+s.actualBoundingBoxDescent,d=r.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(a,d),t.lineTo(o,d),t.stroke()}}function Pe(t,e){let{x:i,y:n,w:r,h:s,radius:a}=e;t.arc(i+a.topLeft,n+a.topLeft,a.topLeft,-X,V,!0),t.lineTo(i,n+s-a.bottomLeft),t.arc(i+a.bottomLeft,n+s-a.bottomLeft,a.bottomLeft,V,X,!0),t.lineTo(i+r-a.bottomRight,n+s),t.arc(i+r-a.bottomRight,n+s-a.bottomRight,a.bottomRight,X,0,!0),t.lineTo(i+r,n+a.topRight),t.arc(i+r-a.topRight,n+a.topRight,a.topRight,0,-X,!0),t.lineTo(i+a.topLeft,n)}var De=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Ce=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Ae(t,e){let i=(""+t).match(De);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}var Te=t=>+t||0;function je(t,e){let i={},n=_(e),r=n?Object.keys(e):e,s=_(t)?n?i=>k(t[i],t[e[i]]):e=>t[e]:()=>t;for(let t of r)i[t]=Te(s(t));return i}function Ie(t){return je(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Re(t){return je(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ee(t){let e=Ie(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Le(t,e){t=t||{},e=e||fe.font;let i=k(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=k(t.style,e.style);n&&!(""+n).match(Ce)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");let r={family:k(t.family,e.family),lineHeight:Ae(k(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:k(t.weight,e.weight),string:""};return r.string=function(t){return!t||y(t.size)||y(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function ze(t,e,i,n){let r,s,a;for(r=0,s=t.length;r<s;++r)if(a=t[r],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e)),void 0!==i&&v(a)&&(a=a[i%a.length]),void 0!==a))return a}function Fe(t,e){return Object.assign(Object.create(t),e)}function We(t,e=[""],i=t,n,r=(()=>t[0])){F(n)||(n=Ge("_fallback",t));let s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:r=>We([r,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Ye(i,n,()=>function(t,e,i,n){let r;for(let s of e)if(r=Ge(Be(s,t),i),F(r))return He(t,r)?qe(i,n,t,r):r}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Je(t).includes(e),ownKeys:t=>Je(t),set(t,e,i){let n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Ne(t,e,i,n){let r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ve(t,n),setContext:e=>Ne(t,e,i,n),override:r=>Ne(t.override(r),e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ye(t,e,()=>function(t,e,i){let{_proxy:n,_context:r,_subProxy:s,_descriptors:a}=t,o=n[e];return W(o)&&a.isScriptable(e)&&(o=function(t,e,i,n){let{_proxy:r,_context:s,_subProxy:a,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(s,a||n),o.delete(t),He(t,e)&&(e=qe(r._scopes,r,t,e)),e}(e,o,t,i)),v(o)&&o.length&&(o=function(t,e,i,n){let{_proxy:r,_context:s,_subProxy:a,_descriptors:o}=i;if(F(s.index)&&n(t))e=e[s.index%e.length];else if(_(e[0])){let i=e,n=r._scopes.filter(t=>t!==i);e=[];for(let l of i){let i=qe(n,r,t,l);e.push(Ne(i,s,a&&a[t],o))}}return e}(e,o,t,a.isIndexable)),He(e,o)&&(o=Ne(o,r,s&&s[e],a)),o}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Ve(t,e={scriptable:!0,indexable:!0}){let{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:i,indexable:n,isScriptable:W(i)?i:()=>i,isIndexable:W(n)?n:()=>n}}var Be=(t,e)=>t?t+z(e):e,He=(t,e)=>_(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ye(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];let n=i();return t[e]=n,n}function $e(t,e,i){return W(t)?t(e,i):t}var Xe=(t,e)=>!0===t?e:"string"==typeof t?L(e,t):void 0;function Ue(t,e,i,n,r){for(let s of e){let e=Xe(i,s);if(e){t.add(e);let s=$e(e._fallback,i,r);if(F(s)&&s!==i&&s!==n)return s}else if(!1===e&&F(n)&&i!==n)return null}return!1}function qe(t,e,i,n){let r=e._rootScopes,s=$e(e._fallback,i,n),a=[...t,...r],o=new Set;o.add(n);let l=Ke(o,a,i,s||i,n);return!(null===l||F(s)&&s!==i&&(l=Ke(o,a,s,l,n),null===l))&&We(Array.from(o),[""],r,s,()=>function(t,e,i){let n=t._getTarget();e in n||(n[e]={});let r=n[e];return v(r)&&_(i)?i:r}(e,i,n))}function Ke(t,e,i,n,r){for(;i;)i=Ue(t,e,i,n,r);return i}function Ge(t,e){for(let i of e){if(!i)continue;let e=i[t];if(F(e))return e}}function Je(t){let e=t._keys;return e||(e=t._keys=function(t){let e=new Set;for(let i of t)for(let t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Ze(t,e,i,n){let r,s,a,o,{iScale:l}=t,{key:h="r"}=this._parsing,d=new Array(n);for(r=0,s=n;r<s;++r)a=r+i,o=e[a],d[r]={r:l.parse(L(o,h),a)};return d}var Qe=Number.EPSILON||1e-14,ti=(t,e)=>e<t.length&&!t[e].skip&&t[e],ei=t=>"x"===t?"y":"x";function ii(t,e,i,n){let r=t.skip?e:t,s=e,a=i.skip?e:i,o=st(s,r),l=st(a,s),h=o/(o+l),d=l/(o+l);h=isNaN(h)?0:h,d=isNaN(d)?0:d;let c=n*h,u=n*d;return{previous:{x:s.x-c*(a.x-r.x),y:s.y-c*(a.y-r.y)},next:{x:s.x+u*(a.x-r.x),y:s.y+u*(a.y-r.y)}}}function ni(t,e="x"){let i,n,r,s=ei(e),a=t.length,o=Array(a).fill(0),l=Array(a),h=ti(t,0);for(i=0;i<a;++i)if(n=r,r=h,h=ti(t,i+1),r){if(h){let t=h[e]-r[e];o[i]=0!==t?(h[s]-r[s])/t:0}l[i]=n?h?G(o[i-1])!==G(o[i])?0:(o[i-1]+o[i])/2:o[i-1]:o[i]}(function(t,e,i){let n,r,s,a,o,l=t.length,h=ti(t,0);for(let d=0;d<l-1;++d)if(o=h,h=ti(t,d+1),o&&h){if(Q(e[d],0,Qe)){i[d]=i[d+1]=0;continue}n=i[d]/e[d],r=i[d+1]/e[d],a=Math.pow(n,2)+Math.pow(r,2),!(a<=9)&&(s=3/Math.sqrt(a),i[d]=n*s*e[d],i[d+1]=r*s*e[d])}})(t,o,l),function(t,e,i="x"){let n,r,s,a=ei(i),o=t.length,l=ti(t,0);for(let h=0;h<o;++h){if(r=s,s=l,l=ti(t,h+1),!s)continue;let o=s[i],d=s[a];r&&(n=(o-r[i])/3,s["cp1"+i]=o-n,s["cp1"+a]=d-n*e[h]),l&&(n=(l[i]-o)/3,s["cp2"+i]=o+n,s["cp2"+a]=d+n*e[h])}}(t,l,e)}function ri(t,e,i){return Math.max(Math.min(t,i),e)}function si(t,e,i,n,r){let s,a,o,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)ni(t,r);else{let i=n?t[t.length-1]:t[0];for(s=0,a=t.length;s<a;++s)o=t[s],l=ii(i,o,t[Math.min(s+1,a-(n?0:1))%a],e.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,i=o}e.capBezierPoints&&function(t,e){let i,n,r,s,a,o=ve(t[0],e);for(i=0,n=t.length;i<n;++i)a=s,s=o,o=i<n-1&&ve(t[i+1],e),s&&(r=t[i],a&&(r.cp1x=ri(r.cp1x,e.left,e.right),r.cp1y=ri(r.cp1y,e.top,e.bottom)),o&&(r.cp2x=ri(r.cp2x,e.left,e.right),r.cp2y=ri(r.cp2y,e.top,e.bottom)))}(t,i)}function ai(){return"undefined"!=typeof window&&"undefined"!=typeof document}function oi(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function li(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}var hi=t=>window.getComputedStyle(t,null);var di=["top","right","bottom","left"];function ci(t,e,i){let n={};i=i?"-"+i:"";for(let r=0;r<4;r++){let s=di[r];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function ui(t,e){if("native"in t)return t;let{canvas:i,currentDevicePixelRatio:n}=e,r=hi(i),s="border-box"===r.boxSizing,a=ci(r,"padding"),o=ci(r,"border","width"),{x:l,y:h,box:d}=function(t,e){let i,n,r=t.touches,s=r&&r.length?r[0]:t,{offsetX:a,offsetY:o}=s,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(a,o,t.target))i=a,n=o;else{let t=e.getBoundingClientRect();i=s.clientX-t.left,n=s.clientY-t.top,l=!0}return{x:i,y:n,box:l}}(t,i),c=a.left+(d&&o.left),u=a.top+(d&&o.top),{width:f,height:g}=e;return s&&(f-=a.width+o.width,g-=a.height+o.height),{x:Math.round((l-c)/f*i.width/n),y:Math.round((h-u)/g*i.height/n)}}var fi=t=>Math.round(10*t)/10;function gi(t,e,i,n){let r=hi(t),s=ci(r,"margin"),a=li(r.maxWidth,t,"clientWidth")||Y,o=li(r.maxHeight,t,"clientHeight")||Y,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){let s=oi(t);if(s){let t=s.getBoundingClientRect(),a=hi(s),o=ci(a,"border","width"),l=ci(a,"padding");e=t.width-l.width-o.width,i=t.height-l.height-o.height,n=li(a.maxWidth,s,"clientWidth"),r=li(a.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Y,maxHeight:r||Y}}(t,e,i),{width:h,height:d}=l;if("content-box"===r.boxSizing){let t=ci(r,"border","width"),e=ci(r,"padding");h-=e.width+t.width,d-=e.height+t.height}return h=Math.max(0,h-s.width),d=Math.max(0,n?Math.floor(h/n):d-s.height),h=fi(Math.min(h,a,l.maxWidth)),d=fi(Math.min(d,o,l.maxHeight)),h&&!d&&(d=fi(h/2)),{width:h,height:d}}function pi(t,e,i){let n=e||1,r=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=r/n,t.width=s/n;let a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=t.height+"px",a.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||a.height!==r||a.width!==s)&&(t.currentDevicePixelRatio=n,a.height=r,a.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}var xi=function(){let t=!1;try{let e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function mi(t,e){let i=function(t,e){return hi(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function bi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function yi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function vi(t,e,i,n){let r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},a=bi(t,r,i),o=bi(r,s,i),l=bi(s,e,i),h=bi(a,o,i),d=bi(o,l,i);return bi(h,d,i)}var _i=new Map;function wi(t,e,i){return function(t,e){e=e||{};let i=t+JSON.stringify(e),n=_i.get(i);return n||(n=new Intl.NumberFormat(t,e),_i.set(i,n)),n}(e,i).format(t)}function Mi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ki(t,e){let i,n;("ltr"===e||"rtl"===e)&&(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Si(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Oi(t){return"angle"===t?{between:lt,compare:at,normalize:ot}:{between:dt,compare:(t,e)=>t-e,normalize:t=>t}}function Pi({start:t,end:e,count:i,loop:n,style:r}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:r}}function Di(t,e,i){if(!i)return[t];let n,r,s,{property:a,start:o,end:l}=i,h=e.length,{compare:d,between:c,normalize:u}=Oi(a),{start:f,end:g,loop:p,style:x}=function(t,e,i){let n,r,{property:s,start:a,end:o}=i,{between:l,normalize:h}=Oi(s),d=e.length,{start:c,end:u,loop:f}=t;if(f){for(c+=d,u+=d,n=0,r=d;n<r&&l(h(e[c%d][s]),a,o);++n)c--,u--;c%=d,u%=d}return u<c&&(u+=d),{start:c,end:u,loop:f,style:t.style}}(t,e,i),m=[],b=!1,y=null,v=()=>b||c(o,s,n)&&0!==d(o,s),_=()=>!b||0===d(l,n)||c(l,s,n);for(let t=f,i=f;t<=g;++t)r=e[t%h],!r.skip&&(n=u(r[a]),n!==s&&(b=c(n,o,l),null===y&&v()&&(y=0===d(n,o)?t:i),null!==y&&_()&&(m.push(Pi({start:y,end:t,loop:p,count:h,style:x})),y=null),i=t,s=n));return null!==y&&m.push(Pi({start:y,end:g,loop:p,count:h,style:x})),m}function Ci(t,e){let i=[],n=t.segments;for(let r=0;r<n.length;r++){let s=Di(n[r],t.points,e);s.length&&i.push(...s)}return i}function Ai(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){let r=t._chart.getContext(),s=Ti(t.options),{_datasetIndex:a,options:{spanGaps:o}}=t,l=i.length,h=[],d=s,c=e[0].start,u=c;function f(t,e,n,r){let s=o?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:n,style:r}),d=r,c=e%l)}}for(let t of e){c=o?c:t.start;let e,s=i[c%l];for(u=c+1;u<=t.end;u++){let o=i[u%l];e=Ti(n.setContext(Fe(r,{type:"segment",p0:s,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),ji(e,d)&&f(c,u-1,t.loop,d),s=o,d=e}c<u-1&&f(c,u-1,t.loop,d)}return h}(t,e,i,n):e}function Ti(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function ji(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var Ii=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){let r=e.listeners[n],s=e.duration;r.forEach(n=>n({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=mt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;let r,s=i.items,a=s.length-1,o=!1;for(;a>=0;--a)r=s[a],r._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),o=!0):(s[a]=s[s.length-1],s.pop());o&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){let e=this._charts,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){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Ri="transparent",Ei={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let n=oe(t||Ri),r=n.valid&&oe(e||Ri);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i},Li=class{constructor(t,e,i,n){let r=e[i];n=ze([t.to,n,r,t.from]);let s=ze([t.from,r,n]);this._active=!0,this._fn=t.fn||Ei[t.type||typeof s],this._easing=Ot[t.easing]||Ot.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=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let n=this._target[this._prop],r=i-this._start,s=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ze([t.to,e,n,t.from]),this._from=ze([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e,i=t-this._start,n=this._duration,r=this._prop,s=this._from,a=this._loop,o=this._to;if(this._active=s!==o&&(a||i<n),!this._active)return this._target[r]=o,void this._notify(!0);i<0?this._target[r]=s:(e=i/n%2,e=a&&e>1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[r]=this._fn(s,o,e))}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}};fe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var zi=Object.keys(fe.animation);fe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),fe.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),fe.describe("animations",{_fallback:"animation"}),fe.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=>0|t}}}});var Fi=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!_(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{let n=t[i];if(!_(n))return;let r={};for(let t of zi)r[t]=n[t];(v(n.properties)&&n.properties||[i]).forEach(t=>{(t===i||!e.has(t))&&e.set(t,r)})})}_animateOptions(t,e){let i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!n)return[];let r=this._createAnimations(n,i);return i.$shared&&function(t,e){let i=[],n=Object.keys(e);for(let e=0;e<n.length;e++){let r=t[n[e]];r&&r.active()&&i.push(r.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){let i,n=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();for(i=a.length-1;i>=0;--i){let l=a[i];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(t,e));continue}let h=e[l],d=s[l],c=n.get(l);if(d){if(c&&d.active()){d.update(c,h,o);continue}d.cancel()}c&&c.duration?(s[l]=d=new Li(c,t,l,h),r.push(d)):t[l]=h}return r}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);let i=this._createAnimations(t,e);return i.length?(Ii.add(this._chart,i),!0):void 0}};function Wi(t,e){let i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:r,end:n?r:s}}function Ni(t,e){let i,n,r=[],s=t._getSortedDatasetMetas(e);for(i=0,n=s.length;i<n;++i)r.push(s[i].index);return r}function Vi(t,e,i,n={}){let r,s,a,o,l=t.keys,h="single"===n.mode;if(null!==e){for(r=0,s=l.length;r<s;++r){if(a=+l[r],a===i){if(n.all)continue;break}o=t.values[a],w(o)&&(h||0===e||G(e)===G(o))&&(e+=o)}return e}}function Bi(t,e){let i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Hi(t,e,i){let n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Yi(t,e,i,n){for(let r of e.getMatchingVisibleMetas(n).reverse()){let e=t[r.index];if(i&&e>0||!i&&e<0)return r.index}return null}function $i(t,e){let i,{chart:n,_cachedMeta:r}=t,s=n._stacks||(n._stacks={}),{iScale:a,vScale:o,index:l}=r,h=a.axis,d=o.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(a,o,r),u=e.length;for(let t=0;t<u;++t){let n=e[t],{[h]:a,[d]:u}=n;i=(n._stacks||(n._stacks={}))[d]=Hi(s,c,a),i[l]=u,i._top=Yi(i,o,!0,r.type),i._bottom=Yi(i,o,!1,r.type)}}function Xi(t,e){let i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function Ui(t,e){let i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(let t of e){let e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}var qi=t=>"reset"===t||"none"===t,Ki=(t,e)=>e?t:Object.assign({},t),Gi=class{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.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Bi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ui(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,r=e.xAxisID=k(i.xAxisID,Xi(t,"x")),s=e.yAxisID=k(i.yAxisID,Xi(t,"y")),a=e.rAxisID=k(i.rAxisID,Xi(t,"r")),o=e.indexAxis,l=e.iAxisID=n(o,r,s,a),h=e.vAxisID=n(o,s,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&pt(this._data,this),t._stacked&&Ui(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(_(e))this._data=function(t){let e,i,n,r=Object.keys(t),s=new Array(r.length);for(e=0,i=r.length;e<i;++e)n=r[e],s[e]={x:n,y:t[n]};return s}(e);else if(i!==e){if(i){pt(i,this);let t=this._cachedMeta;Ui(t),t._parsed=[]}e&&Object.isExtensible(e)&&function(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),gt.forEach(e=>{let i="_onData"+z(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){let r=n.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),r}})}))}(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),n=!1;this._dataCheck();let r=e._stacked;e._stacked=Bi(e.vScale,e),e.stack!==i.stack&&(n=!0,Ui(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&$i(this,e._parsed)}configure(){let 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){let i,n,r,{_cachedMeta:s,_data:a}=this,{iScale:o,_stacked:l}=s,h=o.axis,d=0===t&&e===a.length||s._sorted,c=t>0&&s._parsed[t-1];if(!1===this._parsing)s._parsed=a,s._sorted=!0,r=a;else{r=v(a[t])?this.parseArrayData(s,a,t,e):_(a[t])?this.parseObjectData(s,a,t,e):this.parsePrimitiveData(s,a,t,e);let o=()=>null===n[h]||c&&n[h]<c[h];for(i=0;i<e;++i)s._parsed[i+t]=n=r[i],d&&(o()&&(d=!1),c=n);s._sorted=d}l&&$i(this,r)}parsePrimitiveData(t,e,i,n){let r,s,a,{iScale:o,vScale:l}=t,h=o.axis,d=l.axis,c=o.getLabels(),u=o===l,f=new Array(n);for(r=0,s=n;r<s;++r)a=r+i,f[r]={[h]:u||o.parse(c[a],a),[d]:l.parse(e[a],a)};return f}parseArrayData(t,e,i,n){let r,s,a,o,{xScale:l,yScale:h}=t,d=new Array(n);for(r=0,s=n;r<s;++r)a=r+i,o=e[a],d[r]={x:l.parse(o[0],a),y:h.parse(o[1],a)};return d}parseObjectData(t,e,i,n){let r,s,a,o,{xScale:l,yScale:h}=t,{xAxisKey:d="x",yAxisKey:c="y"}=this._parsing,u=new Array(n);for(r=0,s=n;r<s;++r)a=r+i,o=e[a],u[r]={x:l.parse(L(o,d),a),y:h.parse(L(o,c),a)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let n=this.chart,r=this._cachedMeta,s=e[t.axis];return Vi({keys:Ni(n,!0),values:e._stacks[t.axis]},s,r.index,{mode:i})}updateRangeFromParsed(t,e,i,n){let r=i[e.axis],s=null===r?NaN:r,a=n&&i._stacks[e.axis];n&&a&&(n.values=a,s=Vi(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){let i,n,r=this._cachedMeta,s=r._parsed,a=r._sorted&&t===r.iScale,o=s.length,l=this._getOtherScale(t),h=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Ni(i,!0),values:null})(e,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){let{min:e,max:i,minDefined:n,maxDefined:r}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?i:Number.POSITIVE_INFINITY}}(l);function f(){n=s[i];let e=n[l.axis];return!w(n[t.axis])||c>e||u<e}for(i=0;i<o&&(f()||(this.updateRangeFromParsed(d,t,n,h),!a));++i);if(a)for(i=o-1;i>=0;--i)if(!f()){this.updateRangeFromParsed(d,t,n,h);break}return d}getAllParsedValues(t){let e,i,n,r=this._cachedMeta._parsed,s=[];for(e=0,i=r.length;e<i;++e)n=r[e][t.axis],w(n)&&s.push(n);return s}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){let e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,r;return _(t)?(e=t.top,i=t.right,n=t.bottom,r=t.left):e=i=n=r=t,{top:e,right:i,bottom:n,left:r,disabled:!1===t}}(k(this.options.clip,function(t,e,i){if(!1===i)return!1;let n=Wi(t,i),r=Wi(e,i);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){let t,e=this._ctx,i=this.chart,n=this._cachedMeta,r=n.data||[],s=i.chartArea,a=[],o=this._drawStart||0,l=this._drawCount||r.length-o,h=this.options.drawActiveElementsOnTop;for(n.dataset&&n.dataset.draw(e,s,o,l),t=o;t<o+l;++t){let i=r[t];i.hidden||(i.active&&h?a.push(i):i.draw(e,s))}for(t=0;t<a.length;++t)a[t].draw(e,s)}getStyle(t,e){let i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){let n,r=this.getDataset();if(t>=0&&t<this._cachedMeta.data.length){let e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return Fe(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=r.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return Fe(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=r,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}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){let n="active"===e,r=this._cachedDataOpts,s=t+"-"+e,a=r[s],o=this.enableOptionSharing&&F(i);if(a)return Ki(a,o);let l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),d=n?[t+"Hover","hover",t,""]:[t,""],c=l.getOptionScopes(this.getDataset(),h),u=Object.keys(fe.elements[t]),f=l.resolveNamedOptions(c,u,()=>this.getContext(i,n),d);return f.$shared&&(f.$shared=o,r[s]=Object.freeze(Ki(f,o))),f}_resolveAnimations(t,e,i){let n,r=this.chart,s=this._cachedDataOpts,a="animation-"+e,o=s[a];if(o)return o;if(!1!==r.options.animation){let r=this.chart.config,s=r.datasetAnimationScopeKeys(this._type,e),a=r.getOptionScopes(this.getDataset(),s);n=r.createResolver(a,this.getContext(t,i,e))}let l=new Fi(r,n&&n.animations);return n&&n._cacheable&&(s[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||qi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),s=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:s}}updateElement(t,e,i,n){qi(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!qi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;let r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&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(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];let n=i.length,r=e.length,s=Math.min(r,n);s&&this.parse(0,s),r>n?this._insertElements(n,r-n,t):r<n&&this._removeElements(r,n-r)}_insertElements(t,e,i=!0){let n,r=this._cachedMeta,s=r.data,a=t+e,o=t=>{for(t.length+=e,n=t.length-1;n>=a;n--)t[n]=t[n-e]};for(o(s),n=t;n<a;++n)s[n]=new this.dataElementType;this._parsing&&o(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let n=i._parsed.splice(t,e);i._stacked&&Ui(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let 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]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};function Ji(t){let e,i,n,r,s=t.iScale,a=function(t,e){if(!t._cache.$bar){let i=t.getMatchingVisibleMetas(e),n=[];for(let e=0,r=i.length;e<r;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=xt(n.sort((t,e)=>t-e))}return t._cache.$bar}(s,t.type),o=s._length,l=()=>{32767===n||-32768===n||(F(r)&&(o=Math.min(o,Math.abs(n-r)||o)),r=n)};for(e=0,i=a.length;e<i;++e)n=s.getPixelForValue(a[e]),l();for(r=void 0,e=0,i=s.ticks.length;e<i;++e)n=s.getPixelForTick(e),l();return o}function Zi(t,e,i,n){return v(t)?function(t,e,i,n){let r=i.parse(t[0],n),s=i.parse(t[1],n),a=Math.min(r,s),o=Math.max(r,s),l=a,h=o;Math.abs(a)>Math.abs(o)&&(l=o,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:r,end:s,min:a,max:o}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Qi(t,e,i,n){let r,s,a,o,l=t.iScale,h=t.vScale,d=l.getLabels(),c=l===h,u=[];for(r=i,s=i+n;r<s;++r)o=e[r],a={},a[l.axis]=c||l.parse(d[r],r),u.push(Zi(o,a,h,r));return u}function tn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function en(t,e,i,n){let r=e.borderSkipped,s={};if(!r)return void(t.borderSkipped=s);if(!0===r)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});let{start:a,end:o,reverse:l,top:h,bottom:d}=function(t){let e,i,n,r,s;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(r="end",s="start"):(r="start",s="end"),{start:i,end:n,reverse:e,top:r,bottom:s}}(t);"middle"===r&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?r=h:(i._bottom||0)===n?r=d:(s[nn(d,a,o,l)]=!0,r=h)),s[nn(r,a,o,l)]=!0,t.borderSkipped=s}function nn(t,e,i,n){return n?t=rn(t=function(t,e,i){return t===e?i:t===i?e:t}(t,e,i),i,e):t=rn(t,e,i),t}function rn(t,e,i){return"start"===t?e:"end"===t?i:t}function sn(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}Gi.defaults={},Gi.prototype.datasetElementType=null,Gi.prototype.dataElementType=null;var an=class extends Gi{parsePrimitiveData(t,e,i,n){return Qi(t,e,i,n)}parseArrayData(t,e,i,n){return Qi(t,e,i,n)}parseObjectData(t,e,i,n){let r,s,a,o,{iScale:l,vScale:h}=t,{xAxisKey:d="x",yAxisKey:c="y"}=this._parsing,u="x"===l.axis?d:c,f="x"===h.axis?d:c,g=[];for(r=i,s=i+n;r<s;++r)o=e[r],a={},a[l.axis]=l.parse(L(o,u),r),g.push(Zi(L(o,f),a,h,r));return g}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);let 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){let e=this._cachedMeta,{iScale:i,vScale:n}=e,r=this.getParsed(t),s=r._custom,a=tn(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){let e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){let r="reset"===n,{index:s,_cachedMeta:{vScale:a}}=this,o=a.getBasePixel(),l=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:c}=this._getSharedOptions(e,n);for(let u=e;u<e+i;u++){let e=this.getParsed(u),i=r||y(e[a.axis])?{base:o,head:o}:this._calculateBarValuePixels(u),f=this._calculateBarIndexPixels(u,h),g=(e._stacks||{})[a.axis],p={horizontal:l,base:i.base,enableBorderRadius:!g||tn(e._custom)||s===g._top||s===g._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:Math.abs(i.size),width:l?Math.abs(i.size):f.size};c&&(p.options=d||this.resolveDataElementOptions(u,t[u].active?"active":n));let x=p.options||t[u].options;en(p,x,g,s),sn(p,x,h.ratio),this.updateElement(t[u],u,p,n)}}_getStacks(t,e){let{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),r=i.options.stacked,s=[],a=t=>{let i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(y(n)||isNaN(n))return!0};for(let i of n)if((void 0===e||!a(i))&&((!1===r||-1===s.indexOf(i.stack)||void 0===r&&void 0===i.stack)&&s.push(i.stack),i.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return-1===r?n.length-1:r}_getRuler(){let t,e,i=this.options,n=this._cachedMeta,r=n.iScale,s=[];for(t=0,e=n.data.length;t<e;++t)s.push(r.getPixelForValue(this.getParsed(t)[r.axis],t));let a=i.barThickness;return{min:a||Ji(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:i.grouped,ratio:a?1:i.categoryPercentage*i.barPercentage}}_calculateBarValuePixels(t){let e,i,{_cachedMeta:{vScale:n,_stacked:r},options:{base:s,minBarLength:a}}=this,o=s||0,l=this.getParsed(t),h=l._custom,d=tn(h),c=l[n.axis],u=0,f=r?this.applyStack(n,l,r):c;f!==c&&(u=f-c,f=c),d&&(c=h.barStart,f=h.barEnd-h.barStart,0!==c&&G(c)!==G(h.barEnd)&&(u=0),u+=c);let g=y(s)||d?u:s,p=n.getPixelForValue(g);if(e=this.chart.getDataVisibility(t)?n.getPixelForValue(u+f):p,i=e-p,Math.abs(i)<a){i=function(t,e,i){return 0!==t?G(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(i,n,o)*a,c===o&&(p-=i/2);let t=n.getPixelForDecimal(0),r=n.getPixelForDecimal(1),s=Math.min(t,r),l=Math.max(t,r);p=Math.max(Math.min(p,l),s),e=p+i}if(p===n.getPixelForValue(o)){let t=G(i)*n.getLineWidthForValue(o)/2;p+=t,i-=t}return{size:i,base:p,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){let i,n,r=e.scale,s=this.options,a=s.skipNull,o=k(s.maxBarThickness,1/0);if(e.grouped){let r=a?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?function(t,e,i,n){let r=e.pixels,s=r[t],a=t>0?r[t-1]:null,o=t<r.length-1?r[t+1]:null,l=i.categoryPercentage;null===a&&(a=s-(null===o?e.end-e.start:o-s)),null===o&&(o=s+s-a);let h=s-(s-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/n,ratio:i.barPercentage,start:h}}(t,e,s,r):function(t,e,i,n){let r,s,a=i.barThickness;return y(a)?(r=e.min*i.categoryPercentage,s=i.barPercentage):(r=a*n,s=1),{chunk:r/n,ratio:s,start:e.pixels[t]-r/2}}(t,e,s,r),h=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);i=l.start+l.chunk*h+l.chunk/2,n=Math.min(o,l.chunk*l.ratio)}else i=r.getPixelForValue(this.getParsed(t)[r.axis],t),n=Math.min(o,e.min*e.ratio);return{base:i-n/2,head:i+n/2,center:i,size:n}}draw(){let t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length,r=0;for(;r<n;++r)null!==this.getParsed(r)[e.axis]&&i[r].draw(this._ctx)}};an.id="bar",an.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},an.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};var on=class extends Gi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){let r=super.parsePrimitiveData(t,e,i,n);for(let t=0;t<r.length;t++)r[t]._custom=this.resolveDataElementOptions(t+i).radius;return r}parseArrayData(t,e,i,n){let r=super.parseArrayData(t,e,i,n);for(let t=0;t<r.length;t++){let n=e[i+t];r[t]._custom=k(n[2],this.resolveDataElementOptions(t+i).radius)}return r}parseObjectData(t,e,i,n){let r=super.parseObjectData(t,e,i,n);for(let t=0;t<r.length;t++){let n=e[i+t];r[t]._custom=k(n&&n.r&&+n.r,this.resolveDataElementOptions(t+i).radius)}return r}getMaxOverflow(){let t=this._cachedMeta.data,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){let e=this._cachedMeta,{xScale:i,yScale:n}=e,r=this.getParsed(t),s=i.getLabelForValue(r.x),a=n.getLabelForValue(r.y),o=r._custom;return{label:e.label,value:"("+s+", "+a+(o?", "+o:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){let r="reset"===n,{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:o,includeOptions:l}=this._getSharedOptions(e,n),h=s.axis,d=a.axis;for(let c=e;c<e+i;c++){let e=t[c],i=!r&&this.getParsed(c),u={},f=u[h]=r?s.getPixelForDecimal(.5):s.getPixelForValue(i[h]),g=u[d]=r?a.getBasePixel():a.getPixelForValue(i[d]);u.skip=isNaN(f)||isNaN(g),l&&(u.options=o||this.resolveDataElementOptions(c,e.active?"active":n),r&&(u.options.radius=0)),this.updateElement(e,c,u,n)}}resolveDataElementOptions(t,e){let i=this.getParsed(t),n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));let r=n.radius;return"active"!==e&&(n.radius=0),n.radius+=k(i&&i._custom,r),n}};on.id="bubble",on.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},on.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};var ln=class extends Gi{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){let i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let r,s,a=t=>+i[t];if(_(i[t])){let{key:t="value"}=this._parsing;a=e=>+L(i[e],t)}for(r=t,s=t+e;r<s;++r)n._parsed[r]=a(r)}}_getRotation(){return et(this.options.rotation-90)}_getCircumference(){return et(this.options.circumference)}_getRotationExtents(){let t=B,e=-B;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){let n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),s=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+s)}return{rotation:t,circumference:e-t}}update(t){let e=this.chart,{chartArea:i}=e,n=this._cachedMeta,r=n.data,s=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-s)/2,0),o=Math.min(((t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e)(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:c,ratioY:u,offsetX:f,offsetY:g}=function(t,e,i){let n=1,r=1,s=0,a=0;if(e<B){let o=t,l=o+e,h=Math.cos(o),d=Math.sin(o),c=Math.cos(l),u=Math.sin(l),f=(t,e,n)=>lt(t,o,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>lt(t,o,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,h,c),x=f(X,d,u),m=g(V,h,c),b=g(V+X,d,u);n=(p-m)/2,r=(x-b)/2,s=-(p+m)/2,a=-(x+b)/2}return{ratioX:n,ratioY:r,offsetX:s,offsetY:a}}(d,h,o),p=(i.width-s)/c,x=(i.height-s)/u,m=Math.max(Math.min(p,x)/2,0),b=S(this.options.radius,m),y=(b-Math.max(b*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*b,this.offsetY=g*b,n.total=this.calculateTotal(),this.outerRadius=b-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){let i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/B)}updateElements(t,e,i,n){let r,s="reset"===n,a=this.chart,o=a.chartArea,l=a.options.animation,h=(o.left+o.right)/2,d=(o.top+o.bottom)/2,c=s&&l.animateScale,u=c?0:this.innerRadius,f=c?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,n),x=this._getRotation();for(r=0;r<e;++r)x+=this._circumference(r,s);for(r=e;r<e+i;++r){let e=this._circumference(r,s),i=t[r],a={x:h+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:f,innerRadius:u};p&&(a.options=g||this.resolveDataElementOptions(r,i.active?"active":n)),x+=e,this.updateElement(i,r,a,n)}}calculateTotal(){let t,e=this._cachedMeta,i=e.data,n=0;for(t=0;t<i.length;t++){let r=e._parsed[t];null!==r&&!isNaN(r)&&this.chart.getDataVisibility(t)&&!i[t].hidden&&(n+=Math.abs(r))}return n}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?B*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=wi(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e,i,n,r,s,a=0,o=this.chart;if(!t)for(e=0,i=o.data.datasets.length;e<i;++e)if(o.isDatasetVisible(e)){n=o.getDatasetMeta(e),t=n.data,r=n.controller;break}if(!t)return 0;for(e=0,i=t.length;e<i;++e)s=r.resolveDataElementOptions(e),"inner"!==s.borderAlign&&(a=Math.max(a,s.borderWidth||0,s.hoverBorderWidth||0));return a}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){let t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.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(k(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};ln.id="doughnut",ln.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"},ln.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},ln.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{let r=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label,i=": "+t.formattedValue;return v(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};var hn=class extends Gi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,s=this.chart._animationsDisabled,{start:a,count:o}=_t(e,n,s);this._drawStart=a,this._drawCount=o,wt(e)&&(a=0,o=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,a,o,t)}updateElements(t,e,i,n){let r="reset"===n,{iScale:s,vScale:a,_stacked:o,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),c=s.axis,u=a.axis,{spanGaps:f,segment:g}=this.options,p=Z(f)?f:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||"none"===n,m=e>0&&this.getParsed(e-1);for(let f=e;f<e+i;++f){let e=t[f],i=this.getParsed(f),b=x?e:{},v=y(i[u]),_=b[c]=s.getPixelForValue(i[c],f),w=b[u]=r||v?a.getBasePixel():a.getPixelForValue(o?this.applyStack(a,i,o):i[u],f);b.skip=isNaN(_)||isNaN(w)||v,b.stop=f>0&&Math.abs(i[c]-m[c])>p,g&&(b.parsed=i,b.raw=l.data[f]),d&&(b.options=h||this.resolveDataElementOptions(f,e.active?"active":n)),x||this.updateElement(e,f,b,n),m=i}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;let r=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,s)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};hn.id="line",hn.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},hn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var dn=class extends Gi{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=wi(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return Ze.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{let n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),s=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){let r,s="reset"===n,a=this.chart,o=a.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,d=l.yCenter,c=l.getIndexAngle(0)-.5*V,u=c,f=360/this.countVisibleElements();for(r=0;r<e;++r)u+=this._computeAngle(r,n,f);for(r=e;r<e+i;r++){let e=t[r],i=u,g=u+this._computeAngle(r,n,f),p=a.getDataVisibility(r)?l.getDistanceFromCenterForValue(this.getParsed(r).r):0;u=g,s&&(o.animateScale&&(p=0),o.animateRotate&&(i=g=c));let x={x:h,y:d,innerRadius:0,outerRadius:p,startAngle:i,endAngle:g,options:this.resolveDataElementOptions(r,e.active?"active":n)};this.updateElement(e,r,x,n)}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?et(this.resolveDataElementOptions(t,e).angle||i):0}};dn.id="polarArea",dn.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},dn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{let r=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var cn=class extends ln{};cn.id="pie",cn.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var un=class extends Gi{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Ze.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);let s={_loop:!0,_fullLoop:r.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){let r=this._cachedMeta.rScale,s="reset"===n;for(let a=e;a<e+i;a++){let e=t[a],i=this.resolveDataElementOptions(a,e.active?"active":n),o=r.getPointPositionForValue(a,this.getParsed(a).r),l=s?r.xCenter:o.x,h=s?r.yCenter:o.y,d={x:l,y:h,angle:o.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,a,d,n)}}};un.id="radar",un.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},un.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};var fn=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Z(this.x)&&Z(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}};fn.defaults={},fn.defaultRoutes=void 0;var gn={values:t=>v(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";let n,r=this.chart.options.locale,s=t;if(i.length>1){let e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}let a=K(Math.abs(s)),o=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),wi(t,r,l)},logarithmic(t,e,i){if(0===t)return"0";let n=t/Math.pow(10,Math.floor(K(t)));return 1===n||2===n||5===n?gn.numeric.call(this,t,e,i):""}};var pn={formatters:gn};function xn(t,e){let i=t.options.ticks,n=i.maxTicksLimit||function(t){let e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),r=t._maxLength/i;return Math.floor(Math.min(n,r))}(t),r=i.major.enabled?function(t){let e,i,n=[];for(e=0,i=t.length;e<i;e++)t[e].major&&n.push(e);return n}(e):[],s=r.length,a=r[0],o=r[s-1],l=[];if(s>n)return function(t,e,i,n){let r,s=0,a=i[0];for(n=Math.ceil(n),r=0;r<t.length;r++)r===a&&(e.push(t[r]),s++,a=i[s*n])}(e,l,r,s/n),l;let h=function(t,e,i){let n=function(t){let e,i,n=t.length;if(n<2)return!1;for(i=t[0],e=1;e<n;++e)if(t[e]-t[e-1]!==i)return!1;return i}(t),r=e.length/i;if(!n)return Math.max(r,1);let s=function(t){let e,i=[],n=Math.sqrt(t);for(e=1;e<n;e++)t%e==0&&(i.push(e),i.push(t/e));return n===(0|n)&&i.push(n),i.sort((t,e)=>t-e).pop(),i}(n);for(let t=0,e=s.length-1;t<e;t++){let e=s[t];if(e>r)return e}return Math.max(r,1)}(r,e,n);if(s>0){let t,i,n=s>1?Math.round((o-a)/(s-1)):null;for(mn(e,l,h,y(n)?0:a-n,a),t=0,i=s-1;t<i;t++)mn(e,l,h,r[t],r[t+1]);return mn(e,l,h,o,y(n)?e.length:o+n),l}return mn(e,l,h),l}function mn(t,e,i,n,r){let s,a,o,l=k(n,0),h=Math.min(k(r,t.length),t.length),d=0;for(i=Math.ceil(i),r&&(s=r-n,i=s/Math.floor(s/i)),o=l;o<0;)d++,o=Math.round(l+d*i);for(a=Math.max(l,0);a<h;a++)a===o&&(e.push(t[a]),d++,o=Math.round(l+d*i))}fe.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:pn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),fe.route("scale.ticks","color","","color"),fe.route("scale.grid","color","","borderColor"),fe.route("scale.grid","borderColor","","borderColor"),fe.route("scale.title","color","","color"),fe.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),fe.describe("scales",{_fallback:"scale"}),fe.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});var bn=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function yn(t,e){let i=[],n=t.length/e,r=t.length,s=0;for(;s<r;s+=n)i.push(t[Math.floor(s)]);return i}function vn(t,e,i){let n,r=t.ticks.length,s=Math.min(e,r-1),a=t._startPixel,o=t._endPixel,l=1e-6,h=t.getPixelForTick(s);if(!(i&&(n=1===r?Math.max(h-a,o-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(s-1))/2,h+=s<e?n:-n,h<a-l||h>o+l)))return h}function _n(t){return t.drawTicks?t.tickLength:0}function wn(t,e){if(!t.display)return 0;let i=Le(t.font,e),n=Ee(t.padding);return(v(t.text)?t.text.length:1)*i.lineHeight+n.height}function Mn(t,e,i){let n=yt(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}var kn=class t extends fn{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:n}=this;return t=M(t,Number.POSITIVE_INFINITY),e=M(e,Number.NEGATIVE_INFINITY),i=M(i,Number.POSITIVE_INFINITY),n=M(n,Number.NEGATIVE_INFINITY),{min:M(t,i),max:M(e,n),minDefined:w(t),maxDefined:w(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:i,max:n};let a=this.getMatchingVisibleMetas();for(let o=0,l=a.length;o<l;++o)e=a[o].controller.getMinMax(this,t),r||(i=Math.min(i,e.min)),s||(n=Math.max(n,e.max));return i=s&&i>n?n:i,n=r&&i>n?i:n,{min:M(i,M(n,i)),max:M(n,M(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){O(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:n,grace:r,ticks:s}=this.options,a=s.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=function(t,e,i){let{min:n,max:r}=t,s=S(e,(r-n)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(n,-Math.abs(s)),max:a(r,s)}}(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let o=a<this.ticks.length;this._convertTicksToLabels(o?yn(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||"auto"===s.source)&&(this.ticks=xn(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),o&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){O(this.options.afterUpdate,[this])}beforeSetDimensions(){O(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(){O(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),O(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){O(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e,i,n,r=this.options.ticks;for(e=0,i=t.length;e<i;e++)n=t[e],n.label=O(r.callback,[n.value,e,t],this)}afterTickToLabelConversion(){O(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){O(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t,e,i,n=this.options,r=n.ticks,s=this.ticks.length,a=r.minRotation||0,o=r.maxRotation,l=a;if(!this._isVisible()||!r.display||a>=o||s<=1||!this.isHorizontal())return void(this.labelRotation=a);let h=this._getLabelSizes(),d=h.widest.width,c=h.highest.height,u=ht(this.chart.width-d,0,this.maxWidth);t=n.offset?this.maxWidth/s:u/(s-1),d+6>t&&(t=u/(s-(n.offset?.5:1)),e=this.maxHeight-_n(n.grid)-r.padding-wn(n.title,this.chart.options.font),i=Math.sqrt(d*d+c*c),l=it(Math.min(Math.asin(ht((h.highest.height+6)/t,-1,1)),Math.asin(ht(e/i,-1,1))-Math.asin(ht(c/i,-1,1)))),l=Math.max(a,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){O(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){O(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){let s=wn(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=_n(r)+s):(t.height=this.maxHeight,t.width=_n(r)+s),i.display&&this.ticks.length){let{first:e,last:n,widest:r,highest:s}=this._getLabelSizes(),o=2*i.padding,l=et(this.labelRotation),h=Math.cos(l),d=Math.sin(l);if(a){let e=i.mirror?0:d*r.width+h*s.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{let e=i.mirror?0:h*r.width+d*s.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,n,d,h)}}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,n){let{ticks:{align:r,padding:s},position:a}=this.options,o=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){let a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),d=0,c=0;o?l?(d=n*t.width,c=i*e.height):(d=i*t.height,c=n*e.width):"start"===r?c=e.width:"end"===r?d=t.width:"inner"!==r&&(d=t.width/2,c=e.width/2),this.paddingLeft=Math.max((d-a+s)*this.width/(this.width-a),0),this.paddingRight=Math.max((c-h+s)*this.width/(this.width-h),0)}else{let i=e.height/2,n=t.height/2;"start"===r?(i=0,n=t.height):"end"===r&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_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(){O(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)y(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=yn(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){let i,n,r,s,a,o,l,h,d,c,u,{ctx:f,_longestTextCache:g}=this,p=[],x=[],m=0,b=0;for(i=0;i<e;++i){if(s=t[i].label,a=this._resolveTickFontOptions(i),f.font=o=a.string,l=g[o]=g[o]||{data:{},gc:[]},h=a.lineHeight,d=c=0,y(s)||v(s)){if(v(s))for(n=0,r=s.length;n<r;++n)u=s[n],!y(u)&&!v(u)&&(d=ge(f,l.data,l.gc,d,u),c+=h)}else d=ge(f,l.data,l.gc,d,s),c=h;p.push(d),x.push(c),m=Math.max(d,m),b=Math.max(c,b)}!function(t,e){P(t,t=>{let i,n=t.gc,r=n.length/2;if(r>e){for(i=0;i<r;++i)delete t.data[n[i]];n.splice(0,r)}})}(g,e);let _=p.indexOf(m),w=x.indexOf(b),M=t=>({width:p[t]||0,height:x[t]||0});return{first:M(0),last:M(e-1),widest:M(_),highest:M(w),widths:p,heights:x}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return function(t){return ht(t,-32768,32767)}(this._alignToPixels?xe(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let i=e[t];return i.$context||(i.$context=function(t,e,i){return Fe(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=function(t,e){return Fe(t,{scale:e,type:"scale"})}(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,e=et(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),s=t.autoSkipPadding||0,a=r?r.widest.width+s:0,o=r?r.highest.height+s:0;return this.isHorizontal()?o*i>a*n?a/i:o/n:o*n<a*i?o/i:a/n}_isVisible(){let t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e,i,n,r,s,a,o,l,h,d,c,u,f=this.axis,g=this.chart,p=this.options,{grid:x,position:m}=p,b=x.offset,y=this.isHorizontal(),v=this.ticks.length+(b?1:0),w=_n(x),M=[],S=x.setContext(this.getContext()),O=S.drawBorder?S.borderWidth:0,P=O/2,D=function(t){return xe(g,t,O)};if("top"===m)e=D(this.bottom),a=this.bottom-w,l=e-P,d=D(t.top)+P,u=t.bottom;else if("bottom"===m)e=D(this.top),d=t.top,u=D(t.bottom)-P,a=e+P,l=this.top+w;else if("left"===m)e=D(this.right),s=this.right-w,o=e-P,h=D(t.left)+P,c=t.right;else if("right"===m)e=D(this.left),h=t.left,c=D(t.right)-P,s=e+P,o=this.left+w;else if("x"===f){if("center"===m)e=D((t.top+t.bottom)/2+.5);else if(_(m)){let t=Object.keys(m)[0],i=m[t];e=D(this.chart.scales[t].getPixelForValue(i))}d=t.top,u=t.bottom,a=e+P,l=a+w}else if("y"===f){if("center"===m)e=D((t.left+t.right)/2);else if(_(m)){let t=Object.keys(m)[0],i=m[t];e=D(this.chart.scales[t].getPixelForValue(i))}s=e-P,o=s-w,h=t.left,c=t.right}let C=k(p.ticks.maxTicksLimit,v),A=Math.max(1,Math.ceil(v/C));for(i=0;i<v;i+=A){let t=x.setContext(this.getContext(i)),e=t.lineWidth,f=t.color,p=t.borderDash||[],m=t.borderDashOffset,v=t.tickWidth,_=t.tickColor,w=t.tickBorderDash||[],k=t.tickBorderDashOffset;n=vn(this,i,b),void 0!==n&&(r=xe(g,n,e),y?s=o=h=c=r:a=l=d=u=r,M.push({tx1:s,ty1:a,tx2:o,ty2:l,x1:h,y1:d,x2:c,y2:u,width:e,color:f,borderDash:p,borderDashOffset:m,tickWidth:v,tickColor:_,tickBorderDash:w,tickBorderDashOffset:k}))}return this._ticksLength=v,this._borderValue=e,M}_computeLabelItems(t){let e,i,n,r,s,a,o,l,h,d,c,u,f=this.axis,g=this.options,{position:p,ticks:x}=g,m=this.isHorizontal(),b=this.ticks,{align:y,crossAlign:w,padding:M,mirror:k}=x,S=_n(g.grid),O=S+M,P=k?-M:O,D=-et(this.labelRotation),C=[],A="middle";if("top"===p)a=this.bottom-P,o=this._getXAxisLabelAlignment();else if("bottom"===p)a=this.top+P,o=this._getXAxisLabelAlignment();else if("left"===p){let t=this._getYAxisLabelAlignment(S);o=t.textAlign,s=t.x}else if("right"===p){let t=this._getYAxisLabelAlignment(S);o=t.textAlign,s=t.x}else if("x"===f){if("center"===p)a=(t.top+t.bottom)/2+O;else if(_(p)){let t=Object.keys(p)[0],e=p[t];a=this.chart.scales[t].getPixelForValue(e)+O}o=this._getXAxisLabelAlignment()}else if("y"===f){if("center"===p)s=(t.left+t.right)/2-O;else if(_(p)){let t=Object.keys(p)[0],e=p[t];s=this.chart.scales[t].getPixelForValue(e)}o=this._getYAxisLabelAlignment(S).textAlign}"y"===f&&("start"===y?A="top":"end"===y&&(A="bottom"));let T=this._getLabelSizes();for(e=0,i=b.length;e<i;++e){n=b[e],r=n.label;let t=x.setContext(this.getContext(e));l=this.getPixelForTick(e)+x.labelOffset,h=this._resolveTickFontOptions(e),d=h.lineHeight,c=v(r)?r.length:1;let f,g=c/2,y=t.color,_=t.textStrokeColor,M=t.textStrokeWidth,S=o;if(m?(s=l,"inner"===o&&(S=e===i-1?this.options.reverse?"left":"right":0===e?this.options.reverse?"right":"left":"center"),u="top"===p?"near"===w||0!==D?-c*d+d/2:"center"===w?-T.highest.height/2-g*d+d:-T.highest.height+d/2:"near"===w||0!==D?d/2:"center"===w?T.highest.height/2-g*d:T.highest.height-c*d,k&&(u*=-1)):(a=l,u=(1-c)*d/2),t.showLabelBackdrop){let i=Ee(t.backdropPadding),n=T.heights[e],r=T.widths[e],l=a+u-i.top,h=s-i.left;switch(A){case"middle":l-=n/2;break;case"bottom":l-=n}switch(o){case"center":h-=r/2;break;case"right":h-=r}f={left:h,top:l,width:r+i.width,height:n+i.height,color:t.backdropColor}}C.push({rotation:D,label:r,font:h,color:y,strokeColor:_,strokeWidth:M,textOffset:u,textAlign:S,textBaseline:A,translation:[s,a],backdrop:f})}return C}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-et(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){let e,i,{position:n,ticks:{crossAlign:r,mirror:s,padding:a}}=this.options,o=t+a,l=this._getLabelSizes().widest.width;return"left"===n?s?(i=this.right+a,"near"===r?e="left":"center"===r?(e="center",i+=l/2):(e="right",i+=l)):(i=this.right-o,"near"===r?e="right":"center"===r?(e="center",i-=l/2):(e="left",i=this.left)):"right"===n?s?(i=this.left+a,"near"===r?e="right":"center"===r?(e="center",i-=l/2):(e="left",i-=l)):(i=this.left+o,"near"===r?e="left":"center"===r?(e="center",i+=l/2):(e="right",i=this.right)):e="right",{textAlign:e,x:i}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){let{ctx:t,options:{backgroundColor:e},left:i,top:n,width:r,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,s),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){let e,i,n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),a=(t,e,i)=>{!i.width||!i.color||(r.save(),r.lineWidth=i.width,r.strokeStyle=i.color,r.setLineDash(i.borderDash||[]),r.lineDashOffset=i.borderDashOffset,r.beginPath(),r.moveTo(t.x,t.y),r.lineTo(e.x,e.y),r.stroke(),r.restore())};if(n.display)for(e=0,i=s.length;e<i;++e){let t=s[e];n.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),n.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:e,options:{grid:i}}=this,n=i.setContext(this.getContext()),r=i.drawBorder?n.borderWidth:0;if(!r)return;let s,a,o,l,h=i.setContext(this.getContext(0)).lineWidth,d=this._borderValue;this.isHorizontal()?(s=xe(t,this.left,r)-r/2,a=xe(t,this.right,h)+h/2,o=l=d):(o=xe(t,this.top,r)-r/2,l=xe(t,this.bottom,h)+h/2,s=a=d),e.save(),e.lineWidth=n.borderWidth,e.strokeStyle=n.borderColor,e.beginPath(),e.moveTo(s,o),e.lineTo(a,l),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;let e=this.ctx,i=this._computeLabelArea();i&&_e(e,i);let n,r,s=this._labelItems||(this._labelItems=this._computeLabelItems(t));for(n=0,r=s.length;n<r;++n){let t=s[n],i=t.font,r=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Se(e,r,0,t.textOffset,i,t)}i&&we(e)}drawTitle(){let{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;let r=Le(i.font),s=Ee(i.padding),a=i.align,o=r.lineHeight/2;"bottom"===e||"center"===e||_(e)?(o+=s.bottom,v(i.text)&&(o+=r.lineHeight*(i.text.length-1))):o+=s.top;let{titleX:l,titleY:h,maxWidth:d,rotation:c}=function(t,e,i,n){let r,s,a,{top:o,left:l,bottom:h,right:d,chart:c}=t,{chartArea:u,scales:f}=c,g=0,p=h-o,x=d-l;if(t.isHorizontal()){if(s=vt(n,l,d),_(i)){let t=Object.keys(i)[0],n=i[t];a=f[t].getPixelForValue(n)+p-e}else a="center"===i?(u.bottom+u.top)/2+p-e:bn(t,i,e);r=d-l}else{if(_(i)){let t=Object.keys(i)[0],n=i[t];s=f[t].getPixelForValue(n)-x+e}else s="center"===i?(u.left+u.right)/2-x+e:bn(t,i,e);a=vt(n,h,o),g="left"===i?-X:X}return{titleX:s,titleY:a,maxWidth:r,rotation:g}}(this,o,e,a);Se(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:c,textAlign:Mn(a,e,n),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let e=this.options,i=e.ticks&&e.ticks.z||0,n=k(e.grid&&e.grid.z,-1);return this._isVisible()&&this.draw===t.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:i,draw:t=>{this.drawLabels(t)}}]:[{z:i,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i,n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];for(e=0,i=n.length;e<i;++e){let i=n[e];i[r]===this.id&&(!t||i.type===t)&&s.push(i)}return s}_resolveTickFontOptions(t){return Le(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Sn=class{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){let e,i=Object.getPrototypeOf(t);var n;"id"in(n=i)&&"defaults"in n&&(e=this.register(i));let r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,function(t,e,i){let n=j(Object.create(null),[i?fe.get(i):{},fe.get(e),t.defaults]);fe.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{let n=i.split("."),r=n.pop(),s=[t].concat(n).join("."),a=e[i].split("."),o=a.pop(),l=a.join(".");fe.route(s,r,l,o)})}(e,t.defaultRoutes),t.descriptors&&fe.describe(e,t.descriptors)}(t,a,e),this.override&&fe.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in fe[n]&&(delete fe[n][i],this.override&&delete he[i])}};var On=new class{constructor(){this.controllers=new Sn(Gi,"datasets",!0),this.elements=new Sn(fn,"elements"),this.plugins=new Sn(Object,"plugins"),this.scales=new Sn(kn,"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(e=>{let n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):P(e,e=>{let n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){let n=z(t);O(i["before"+n],[],i),e[t](i),O(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}},Pn=class extends Gi{update(t){let e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled,{start:r,count:s}=_t(e,i,n);if(this._drawStart=r,this._drawCount=s,wt(e)&&(r=0,s=i.length),this.options.showLine){let{dataset:r,_dataset:s}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;let a=this.resolveDatasetElementOptions(t);a.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:a},t)}this.updateElements(i,r,s,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=On.getElement("line")),super.addElements()}updateElements(t,e,i,n){let r="reset"===n,{iScale:s,vScale:a,_stacked:o,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(h),c=this.includeOptions(n,d),u=s.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,x=Z(g)?g:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||r||"none"===n,b=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){let e=t[h],i=this.getParsed(h),g=m?e:{},v=y(i[f]),_=g[u]=s.getPixelForValue(i[u],h),w=g[f]=r||v?a.getBasePixel():a.getPixelForValue(o?this.applyStack(a,i,o):i[f],h);g.skip=isNaN(_)||isNaN(w)||v,g.stop=h>0&&Math.abs(i[u]-b[u])>x,p&&(g.parsed=i,g.raw=l.data[h]),c&&(g.options=d||this.resolveDataElementOptions(h,e.active?"active":n)),m||this.updateElement(e,h,g,n),b=i}this.updateSharedOptions(d,n,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}let i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;let r=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,s)/2}};function Dn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Pn.id="scatter",Pn.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Pn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Cn=class{constructor(t){this.options=t||{}}init(t){}formats(){return Dn()}parse(t,e){return Dn()}format(t,e){return Dn()}add(t,e,i){return Dn()}diff(t,e,i){return Dn()}startOf(t,e,i){return Dn()}endOf(t,e){return Dn()}};Cn.override=function(t){Object.assign(Cn.prototype,t)};var An={_date:Cn};function Tn(t,e,i,n){let{controller:r,data:s,_sorted:a}=t,o=r._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&a&&s.length){let t=o._reversePixels?ft:ut;if(!n)return t(s,e,i);if(r._sharedOptions){let n=s[0],r="function"==typeof n.getRange&&n.getRange(e);if(r){let n=t(s,e,i-r),a=t(s,e,i+r);return{lo:n.lo,hi:a.hi}}}}return{lo:0,hi:s.length-1}}function jn(t,e,i,n,r){let s=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=s.length;t<i;++t){let{index:i,data:o}=s[t],{lo:l,hi:h}=Tn(s[t],e,a,r);for(let t=l;t<=h;++t){let e=o[t];e.skip||n(e,i,t)}}}function In(t,e,i,n,r){let s=[];return!r&&!t.isPointInArea(e)||jn(t,i,e,(function(i,a,o){!r&&!ve(i,t.chartArea,0)||i.inRange(e.x,e.y,n)&&s.push({element:i,datasetIndex:a,index:o})}),!0),s}function Rn(t,e,i,n,r,s){let a=[],o=function(t){let e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){let r=e?Math.abs(t.x-n.x):0,s=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}(i),l=Number.POSITIVE_INFINITY;return jn(t,i,e,(function(i,h,d){let c=i.inRange(e.x,e.y,r);if(n&&!c)return;let u=i.getCenterPoint(r);if(!s&&!t.isPointInArea(u)&&!c)return;let f=o(e,u);f<l?(a=[{element:i,datasetIndex:h,index:d}],l=f):f===l&&a.push({element:i,datasetIndex:h,index:d})})),a}function En(t,e,i,n,r,s){return s||t.isPointInArea(e)?"r"!==i||n?Rn(t,e,i,n,r,s):function(t,e,i,n){let r=[];return jn(t,i,e,(function(t,i,s){let{startAngle:a,endAngle:o}=t.getProps(["startAngle","endAngle"],n),{angle:l}=rt(t,{x:e.x,y:e.y});lt(l,a,o)&&r.push({element:t,datasetIndex:i,index:s})})),r}(t,e,i,r):[]}function Ln(t,e,i,n,r){let s=[],a="x"===i?"inXRange":"inYRange",o=!1;return jn(t,i,e,(t,n,l)=>{t[a](e[i],r)&&(s.push({element:t,datasetIndex:n,index:l}),o=o||t.inRange(e.x,e.y,r))}),n&&!o?[]:s}var zn={modes:{index(t,e,i,n){let r=ui(e,t),s=i.axis||"x",a=i.includeInvisible||!1,o=i.intersect?In(t,r,s,n,a):En(t,r,s,!1,n,a),l=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=o[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){let r=ui(e,t),s=i.axis||"xy",a=i.includeInvisible||!1,o=i.intersect?In(t,r,s,n,a):En(t,r,s,!1,n,a);if(o.length>0){let e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;t<i.length;++t)o.push({element:i[t],datasetIndex:e,index:t})}return o},point:(t,e,i,n)=>In(t,ui(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){let r=ui(e,t),s=i.axis||"xy",a=i.includeInvisible||!1;return En(t,r,s,i.intersect,n,a)},x:(t,e,i,n)=>Ln(t,ui(e,t),"x",i.intersect,n),y:(t,e,i,n)=>Ln(t,ui(e,t),"y",i.intersect,n)}},Fn=["left","top","right","bottom"];function Wn(t,e){return t.filter(t=>t.pos===e)}function Nn(t,e){return t.filter(t=>-1===Fn.indexOf(t.pos)&&t.box.axis===e)}function Vn(t,e){return t.sort((t,i)=>{let n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function Bn(t,e){let i,n,r,s=function(t){let e={};for(let i of t){let{stack:t,pos:n,stackWeight:r}=i;if(!t||!Fn.includes(n))continue;let s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=r}return e}(t),{vBoxMaxWidth:a,hBoxMaxHeight:o}=e;for(i=0,n=t.length;i<n;++i){r=t[i];let{fullSize:n}=r.box,l=s[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*a:n&&e.availableWidth,r.height=o):(r.width=a,r.height=h?h*o:n&&e.availableHeight)}return s}function Hn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function Yn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function $n(t,e,i,n){let{pos:r,box:s}=i,a=t.maxPadding;if(!_(r)){i.size&&(t[r]-=i.size);let e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[r]+=i.size}s.getPadding&&Yn(a,s.getPadding());let o=Math.max(0,e.outerWidth-Hn(a,t,"left","right")),l=Math.max(0,e.outerHeight-Hn(a,t,"top","bottom")),h=o!==t.w,d=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:h,other:d}:{same:d,other:h}}function Xn(t,e){let i=e.maxPadding;return function(t){let n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function Un(t,e,i,n){let r,s,a,o,l,h,d=[];for(r=0,s=t.length,l=0;r<s;++r){a=t[r],o=a.box,o.update(a.width||e.w,a.height||e.h,Xn(a.horizontal,e));let{same:s,other:c}=$n(e,i,a,n);l|=s&&d.length,h=h||c,o.fullSize||d.push(a)}return l&&Un(d,e,i,n)||h}function qn(t,e,i,n,r){t.top=i,t.left=e,t.right=e+n,t.bottom=i+r,t.width=n,t.height=r}function Kn(t,e,i,n){let r=i.padding,{x:s,y:a}=e;for(let o of t){let t=o.box,l=n[o.stack]||{placed:0,weight:1},h=o.stackWeight/l.weight||1;if(o.horizontal){let n=e.w*h,s=l.size||t.height;F(l.start)&&(a=l.start),t.fullSize?qn(t,r.left,a,i.outerWidth-r.right-r.left,s):qn(t,e.left+l.placed,a,n,s),l.start=a,l.placed+=n,a=t.bottom}else{let n=e.h*h,a=l.size||t.width;F(l.start)&&(s=l.start),t.fullSize?qn(t,s,r.top,a,i.outerHeight-r.bottom-r.top):qn(t,s,e.top+l.placed,a,n),l.start=s,l.placed+=n,s=t.right}}e.x=s,e.y=a}fe.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Gn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;let r=Ee(t.options.layout.padding),s=Math.max(e-r.width,0),a=Math.max(i-r.height,0),o=function(t){let e=function(t){let e,i,n,r,s,a,o=[];for(e=0,i=(t||[]).length;e<i;++e)n=t[e],({position:r,options:{stack:s,stackWeight:a=1}}=n),o.push({index:e,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:s&&r+s,stackWeight:a});return o}(t),i=Vn(e.filter(t=>t.box.fullSize),!0),n=Vn(Wn(e,"left"),!0),r=Vn(Wn(e,"right")),s=Vn(Wn(e,"top"),!0),a=Vn(Wn(e,"bottom")),o=Nn(e,"x"),l=Nn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(a).concat(o),chartArea:Wn(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(a).concat(o)}}(t.boxes),l=o.vertical,h=o.horizontal;P(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let d=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/d,hBoxMaxHeight:a/2}),u=Object.assign({},r);Yn(u,Ee(n));let f=Object.assign({maxPadding:u,w:s,h:a,x:r.left,y:r.top},r),g=Bn(l.concat(h),c);Un(o.fullSize,f,c,g),Un(l,f,c,g),Un(h,f,c,g)&&Un(l,f,c,g),function(t){let e=t.maxPadding;function i(i){let n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),Kn(o.leftAndTop,f,c,g),f.x+=f.w,f.y+=f.h,Kn(o.rightAndBottom,f,c,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},P(o.chartArea,e=>{let i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},Jn=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}},Zn=class extends Jn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Qn="$chartjs",tr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},er=t=>null===t||""===t;var ir=!!xi&&{passive:!0};function nr(t,e,i){t.canvas.removeEventListener(e,i,ir)}function rr(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function sr(t,e,i){let n=t.canvas,r=new MutationObserver(t=>{let e=!1;for(let i of t)e=e||rr(i.addedNodes,n),e=e&&!rr(i.removedNodes,n);e&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}function ar(t,e,i){let n=t.canvas,r=new MutationObserver(t=>{let e=!1;for(let i of t)e=e||rr(i.removedNodes,n),e=e&&!rr(i.addedNodes,n);e&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}var or=new Map,lr=0;function hr(){let t=window.devicePixelRatio;t!==lr&&(lr=t,or.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function dr(t,e,i){let n=t.canvas,r=n&&oi(n);if(!r)return;let s=bt((t,e)=>{let n=r.clientWidth;i(t,e),n<r.clientWidth&&i()},window),a=new ResizeObserver(t=>{let e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)});return a.observe(r),function(t,e){or.size||window.addEventListener("resize",hr),or.set(t,e)}(t,s),a}function cr(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){or.delete(t),or.size||window.removeEventListener("resize",hr)}(t)}function ur(t,e,i){let n=t.canvas,r=bt(e=>{null!==t.ctx&&i(function(t,e){let i=tr[t.type]||t.type,{x:n,y:r}=ui(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==r?r:null}}(e,t))},t,t=>{let e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,ir)}(n,e,r),r}var fr=class extends Jn{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){let i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[Qn]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",er(r)){let e=mi(t,"width");void 0!==e&&(t.width=e)}if(er(n))if(""===t.style.height)t.height=t.width/(e||2);else{let e=mi(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[Qn])return!1;let i=e[Qn].initial;["height","width"].forEach(t=>{let n=i[t];y(n)?e.removeAttribute(t):e.setAttribute(t,n)});let n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[Qn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),r={attach:sr,detach:ar,resize:dr}[e]||ur;n[e]=r(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:cr,detach:cr,resize:cr}[e]||nr)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return gi(t,e,i,n)}isAttached(t){let e=oi(t);return!(!e||!e.isConnected)}};function gr(t,e){return e||!1!==t?!0===t?{}:t:null}function pr(t,{plugin:e,local:i},n,r){let s=t.pluginScopeKeys(e),a=t.getOptionScopes(n,s);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function xr(t,e){let i=fe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function mr(t,e){return"x"===t||"y"===t?t:e.axis||function(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}(e.position)||t.charAt(0).toLowerCase()}function br(t){let e=t.options||(t.options={});e.plugins=k(e.plugins,{}),e.scales=function(t,e){let i=he[t.type]||{scales:{}},n=e.scales||{},r=xr(t.type,e),s=Object.create(null),a=Object.create(null);return Object.keys(n).forEach(t=>{let e=n[t];if(!_(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);let o=mr(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(o,r),h=i.scales||{};s[o]=s[o]||t,a[t]=I(Object.create(null),[{axis:o},e,h[o],h[l]])}),t.data.datasets.forEach(i=>{let r=i.type||t.type,o=i.indexAxis||xr(r,e),l=(he[r]||{}).scales||{};Object.keys(l).forEach(t=>{let e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),r=i[e+"AxisID"]||s[e]||e;a[r]=a[r]||Object.create(null),I(a[r],[{axis:e},n[r],l[t]])})}),Object.keys(a).forEach(t=>{let e=a[t];I(e,[fe.scales[e.type],fe.scale])}),a}(t,e)}function yr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}var vr=new Map,_r=new Set;function wr(t,e){let i=vr.get(t);return i||(i=e(),vr.set(t,i),_r.add(i)),i}var Mr=(t,e,i)=>{let n=L(e,i);void 0!==n&&t.add(n)};function kr(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));let r=i.join(),s=n.get(r);return s||(s={resolver:We(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(r,s)),s}var Sr=t=>_(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||W(t[i]),!1);var Or=["top","bottom","left","right","chartArea"];function Pr(t,e){return"top"===t||"bottom"===t||-1===Or.indexOf(t)&&"x"===e}function Dr(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Cr(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),O(i&&i.onComplete,[t],e)}function Ar(t){let e=t.chart,i=e.options.animation;O(i&&i.onProgress,[t],e)}function Tr(t){return ai()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}var jr={},Ir=t=>{let e=Tr(t);return Object.values(jr).filter(t=>t.canvas===e).pop()};function Rr(t,e,i){let n=Object.keys(t);for(let r of n){let n=+r;if(n>=e){let s=t[r];delete t[r],(i>0||n>e)&&(t[n+i]=s)}}}var Er=class{constructor(t,e){let i=this.config=new class{constructor(t){var e;this._config=((e=(e=t)||{}).data=yr(e.data),br(e),e),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=yr(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),br(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return wr(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return wr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return wr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){let e=t.id;return wr(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){let{options:n,type:r}=this,s=this._cachedScopes(t,i),a=s.get(e);if(a)return a;let o=new Set;e.forEach(e=>{t&&(o.add(t),e.forEach(e=>Mr(o,t,e))),e.forEach(t=>Mr(o,n,t)),e.forEach(t=>Mr(o,he[r]||{},t)),e.forEach(t=>Mr(o,fe,t)),e.forEach(t=>Mr(o,de,t))});let l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),_r.has(e)&&s.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,he[e]||{},fe.datasets[e]||{},{type:e},fe,de]}resolveNamedOptions(t,e,i,n=[""]){let r={$shared:!0},{resolver:s,subPrefixes:a}=kr(this._resolverCache,t,n),o=s;if(function(t,e){let{isScriptable:i,isIndexable:n}=Ve(t);for(let r of e){let e=i(r),s=n(r),a=(s||e)&&t[r];if(e&&(W(a)||Sr(a))||s&&v(a))return!0}return!1}(s,e)){r.$shared=!1,o=Ne(s,i=W(i)?i():i,this.createResolver(t,i,a))}for(let t of e)r[t]=o[t];return r}createResolver(t,e,i=[""],n){let{resolver:r}=kr(this._resolverCache,t,i);return _(e)?Ne(r,e,void 0,n):r}}(e),n=Tr(t),r=Ir(n);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.");let s=i.createResolver(i.chartOptionScopes(),this.getContext());var a;this.platform=new(i.platform||(a=n,!ai()||"undefined"!=typeof OffscreenCanvas&&a instanceof OffscreenCanvas?Zn:fr)),this.platform.updateConfig(i);let o=this.platform.acquireContext(n,s.aspectRatio),l=o&&o.canvas,h=l&&l.height,d=l&&l.width;this.id=b(),this.ctx=o,this.canvas=l,this.width=d,this.height=h,this._options=s,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 class{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let r=n?this._descriptors(t).filter(n):this._descriptors(t),s=this._notify(r,t,e,i);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,n){n=n||{};for(let r of t){let t=r.plugin;if(!1===O(t[i],[e,n,r.options],t)&&n.cancelable)return!1}return!0}invalidate(){y(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,n=k(i.options&&i.options.plugins,{}),r=function(t){let e={},i=[],n=Object.keys(On.plugins.items);for(let t=0;t<n.length;t++)i.push(On.getPlugin(n[t]));let r=t.plugins||[];for(let t=0;t<r.length;t++){let n=r[t];-1===i.indexOf(n)&&(i.push(n),e[n.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},n,r){let s=[],a=t.getContext();for(let o of e){let e=o.id,l=gr(n[e],r);null!==l&&s.push({plugin:o,options:pr(t.config,{plugin:o,local:i[e]},l,a)})}return s}(t,r,n,e):[]}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}},this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),s.resizeDelay||0),this._dataChanges=[],jr[this.id]=this,o&&l?(Ii.listen(this,"complete",Cr),Ii.listen(this,"progress",Ar),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return y(t)?e&&r?r:n?i/n: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return me(this.canvas,this.ctx),this}stop(){return Ii.stop(this),this}resize(t,e){Ii.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,pi(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),O(i.onResize,[this,s],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){P(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),r=[];e&&(r=r.concat(Object.keys(e).map(t=>{let i=e[t],n=mr(t,i),r="r"===n,s="x"===n;return{options:i,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}}))),P(r,e=>{let r=e.options,s=r.id,a=mr(s,r),o=k(r.type,e.dtype);(void 0===r.position||Pr(r.position,a)!==Pr(e.dposition))&&(r.position=e.dposition),n[s]=!0;let l=null;if(s in i&&i[s].type===o)l=i[s];else{l=new(On.getScale(o))({id:s,type:o,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(r,t)}),P(n,(t,e)=>{t||delete i[e]}),P(i,t=>{Gn.configure(this,t,t.options),Gn.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Dr("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e,i=[],n=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=n.length;t<e;t++){let e=n[t],r=this.getDatasetMeta(t),s=e.type||this.config.type;if(r.type&&r.type!==s&&(this._destroyDatasetMeta(t),r=this.getDatasetMeta(t)),r.type=s,r.indexAxis=e.indexAxis||xr(s,this.options),r.order=e.order||0,r.index=t,r.label=""+e.label,r.visible=this.isDatasetVisible(t),r.controller)r.controller.updateIndex(t),r.controller.linkScales();else{let e=On.getController(s),{datasetElementType:n,dataElementType:a}=fe.datasets[s];Object.assign(e.prototype,{dataElementType:On.getElement(a),datasetElementType:n&&On.getElement(n)}),r.controller=new e(this,t),i.push(r.controller)}}return this._updateMetasets(),i}_resetElements(){P(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t<e;t++){let{controller:e}=this.getDatasetMeta(t),i=!n&&-1===r.indexOf(e);e.buildOrUpdateElements(i),s=Math.max(+e.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),n||P(r,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Dr("z","_idx"));let{_active:a,_lastEvent:o}=this;o?this._eventHandler(o,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){P(this.scales,t=>{Gn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!N(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:n,count:r}of e){Rr(t,n,"_removeElements"===i?-r:r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;t<e;t++)if(!N(n,i(t)))return;return Array.from(n).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Gn.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],P(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,W(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Ii.has(this)?this.attached&&!Ii.running(this)&&Ii.start(this):(this.draw(),Cr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;let 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){let e,i,n=this._sortedMetasets,r=[];for(e=0,i=n.length;e<i;++e){let i=n[e];(!t||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,n=!i.disabled,r=this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&_e(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&we(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){let r=zn.modes[e];return"function"==typeof r?r(this,t,i,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={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(n)),n}getContext(){return this.$context||(this.$context=Fe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let n=i?"show":"hide",r=this.getDatasetMeta(t),s=r.controller._resolveAnimations(void 0,n);F(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(r,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ii.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),me(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete jr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};P(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t,e=this._responsiveListeners,i=this.platform,n=(t,n)=>{i.addEventListener(this,t,n),e[t]=n},r=(t,n)=>{e[t]&&(i.removeEventListener(this,t,n),delete e[t])},s=(t,e)=>{this.canvas&&this.resize(t,e)},a=()=>{r("attach",a),this.attached=!0,this.resize(),n("resize",s),n("detach",t)};t=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),n("attach",a)},i.isAttached(this.canvas)?a():t()}unbindEvents(){P(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},P(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let n,r,s,a,o=i?"set":"remove";for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+o+"DatasetHoverStyle"]()),s=0,a=t.length;s<a;++s){r=t[s];let e=r&&this.getDatasetMeta(r.datasetIndex).controller;e&&e[o+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{let i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!D(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){let n=this.options.hover,r=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=r(e,t),a=i?t:r(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;let r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:n=[],options:r}=this,s=e,a=this._getActiveElements(t,n,i,s),o="mouseup"===(h=t).type||"click"===h.type||"contextmenu"===h.type,l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,o);var h;i&&(this._lastEvent=null,O(r.onHover,[t,a,this],this),o&&O(r.onClick,[t,a,this],this));let d=!D(a,n);return(d||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=l,d}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}},Lr=()=>P(Er.instances,t=>t._plugins.invalidate());function zr(t,e,i){let{startAngle:n,pixelMargin:r,x:s,y:a,outerRadius:o,innerRadius:l}=e,h=r/o;t.beginPath(),t.arc(s,a,o,n-h,i+h),l>r?(h=r/l,t.arc(s,a,l,i+h,n-h,!0)):t.arc(s,a,r,i+X,n-X),t.closePath(),t.clip()}function Fr(t,e,i,n){let r=function(t){return je(t,["outerStart","outerEnd","innerStart","innerEnd"])}(t.options.borderRadius),s=(i-e)/2,a=Math.min(s,n*e/2),o=t=>{let e=(i-Math.min(s,t))*n/2;return ht(t,0,Math.min(s,e))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:ht(r.innerStart,0,a),innerEnd:ht(r.innerEnd,0,a)}}function Wr(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Nr(t,e,i,n,r,s){let{x:a,y:o,startAngle:l,pixelMargin:h,innerRadius:d}=e,c=Math.max(e.outerRadius+n+i-h,0),u=d>0?d+n+i+h:0,f=0,g=r-l;if(n){let t=((d>0?d-n:0)+(c>0?c-n:0))/2;f=(g-(0!==t?g*t/(t+n):g))/2}let p=(g-Math.max(.001,g*c-i/V)/c)/2,x=l+p+f,m=r-p-f,{outerStart:b,outerEnd:y,innerStart:v,innerEnd:_}=Fr(e,u,c,m-x),w=c-b,M=c-y,k=x+b/w,S=m-y/M,O=u+v,P=u+_,D=x+v/O,C=m-_/P;if(t.beginPath(),s){if(t.arc(a,o,c,k,S),y>0){let e=Wr(M,S,a,o);t.arc(e.x,e.y,y,S,m+X)}let e=Wr(P,m,a,o);if(t.lineTo(e.x,e.y),_>0){let e=Wr(P,C,a,o);t.arc(e.x,e.y,_,m+X,C+Math.PI)}if(t.arc(a,o,u,m-_/u,x+v/u,!0),v>0){let e=Wr(O,D,a,o);t.arc(e.x,e.y,v,D+Math.PI,x-X)}let i=Wr(w,x,a,o);if(t.lineTo(i.x,i.y),b>0){let e=Wr(w,k,a,o);t.arc(e.x,e.y,b,x-X,k)}}else{t.moveTo(a,o);let e=Math.cos(k)*c+a,i=Math.sin(k)*c+o;t.lineTo(e,i);let n=Math.cos(S)*c+a,r=Math.sin(S)*c+o;t.lineTo(n,r)}t.closePath()}function Vr(t,e,i,n,r,s){let{options:a}=e,{borderWidth:o,borderJoinStyle:l}=a,h="inner"===a.borderAlign;o&&(h?(t.lineWidth=2*o,t.lineJoin=l||"round"):(t.lineWidth=o,t.lineJoin=l||"bevel"),e.fullCircles&&function(t,e,i){let n,{x:r,y:s,startAngle:a,pixelMargin:o,fullCircles:l}=e,h=Math.max(e.outerRadius-o,0),d=e.innerRadius+o;for(i&&zr(t,e,a+B),t.beginPath(),t.arc(r,s,d,a+B,a,!0),n=0;n<l;++n)t.stroke();for(t.beginPath(),t.arc(r,s,h,a,a+B),n=0;n<l;++n)t.stroke()}(t,e,h),h&&zr(t,e,r),Nr(t,e,i,n,r,s),t.stroke())}Object.defineProperties(Er,{defaults:{enumerable:!0,value:fe},instances:{enumerable:!0,value:jr},overrides:{enumerable:!0,value:he},registry:{enumerable:!0,value:On},version:{enumerable:!0,value:"3.9.1"},getChart:{enumerable:!0,value:Ir},register:{enumerable:!0,value:(...t)=>{On.add(...t),Lr()}},unregister:{enumerable:!0,value:(...t)=>{On.remove(...t),Lr()}}});var Br=class extends fn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){let n=this.getProps(["x","y"],i),{angle:r,distance:s}=rt(n,{x:t,y:e}),{startAngle:a,endAngle:o,innerRadius:l,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),c=this.options.spacing/2,u=k(d,o-a)>=B||lt(r,a,o),f=dt(s,l+c,h+c);return u&&f}getCenterPoint(t){let{x:e,y:i,startAngle:n,endAngle:r,innerRadius:s,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:l}=this.options,h=(n+r)/2,d=(s+a+l+o)/2;return{x:e+Math.cos(h)*d,y:i+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,n=(e.offset||0)/2,r=(e.spacing||0)/2,s=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>B?Math.floor(i/B):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;let e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=V&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,Vr(t,this,a,r,function(t,e,i,n,r){let{fullCircles:s,startAngle:a,circumference:o}=e,l=e.endAngle;if(s){Nr(t,e,i,n,a+B,r);for(let e=0;e<s;++e)t.fill();isNaN(o)||(l=a+o%B,o%B==0&&(l+=B))}return Nr(t,e,i,n,l,r),t.fill(),l}(t,this,a,r,s),s),t.restore()}};function Hr(t,e,i=e){t.lineCap=k(i.borderCapStyle,e.borderCapStyle),t.setLineDash(k(i.borderDash,e.borderDash)),t.lineDashOffset=k(i.borderDashOffset,e.borderDashOffset),t.lineJoin=k(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=k(i.borderWidth,e.borderWidth),t.strokeStyle=k(i.borderColor,e.borderColor)}function Yr(t,e,i){t.lineTo(i.x,i.y)}function $r(t,e,i={}){let n=t.length,{start:r=0,end:s=n-1}=i,{start:a,end:o}=e,l=Math.max(r,a),h=Math.min(s,o),d=r<a&&s<a||r>o&&s>o;return{count:n,start:l,loop:e.loop,ilen:h<l&&!d?n+h-l:h-l}}function Xr(t,e,i,n){let r,s,a,{points:o,options:l}=e,{count:h,start:d,loop:c,ilen:u}=$r(o,i,n),f=function(t){return t.stepped?Me:t.tension||"monotone"===t.cubicInterpolationMode?ke:Yr}(l),{move:g=!0,reverse:p}=n||{};for(r=0;r<=u;++r)s=o[(d+(p?u-r:r))%h],!s.skip&&(g?(t.moveTo(s.x,s.y),g=!1):f(t,a,s,p,l.stepped),a=s);return c&&(s=o[(d+(p?u:0))%h],f(t,a,s,p,l.stepped)),!!c}function Ur(t,e,i,n){let r,s,a,o,l,h,d=e.points,{count:c,start:u,ilen:f}=$r(d,i,n),{move:g=!0,reverse:p}=n||{},x=0,m=0,b=t=>(u+(p?f-t:t))%c,y=()=>{o!==l&&(t.lineTo(x,l),t.lineTo(x,o),t.lineTo(x,h))};for(g&&(s=d[b(0)],t.moveTo(s.x,s.y)),r=0;r<=f;++r){if(s=d[b(r)],s.skip)continue;let e=s.x,i=s.y,n=0|e;n===a?(i<o?o=i:i>l&&(l=i),x=(m*x+e)/++m):(y(),t.lineTo(e,i),a=n,m=0,o=l=i),h=i}y()}function qr(t){let e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Xr:Ur}Br.id="arc",Br.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},Br.defaultRoutes={backgroundColor:"backgroundColor"};var Kr="function"==typeof Path2D;function Gr(t,e,i,n){Kr&&!e.options.segment?function(t,e,i,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,i,n)&&r.closePath()),Hr(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){let{segments:r,options:s}=e,a=qr(e);for(let o of r)Hr(t,s,o.style),t.beginPath(),a(t,e,o,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}var Jr=class extends fn{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){let i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){let n=i.spanGaps?this._loop:this._fullLoop;si(this._points,i,t,n,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=function(t,e){let i=t.points,n=t.options.spanGaps,r=i.length;if(!r)return[];let s=!!t._loop,{start:a,end:o}=function(t,e,i,n){let r=0,s=e-1;if(i&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,i&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(i,r,s,n);return Ai(t,!0===n?[{start:a,end:o,loop:s}]:function(t,e,i,n){let r,s=t.length,a=[],o=e,l=t[e];for(r=e+1;r<=i;++r){let i=t[r%s];i.skip||i.stop?l.skip||(n=!1,a.push({start:e%s,end:(r-1)%s,loop:n}),e=o=i.stop?r:null):(o=r,l.skip&&(e=r)),l=i}return null!==o&&a.push({start:e%s,end:o%s,loop:n}),a}(i,a,o<a?o+r:o,!!t._fullLoop&&0===a&&o===r-1),i,e)}(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,n=t[e],r=this.points,s=Ci(this,{property:e,start:n,end:n});if(!s.length)return;let a,o,l=[],h=(d=i).stepped?yi:d.tension||"monotone"===d.cubicInterpolationMode?vi:bi;var d;for(a=0,o=s.length;a<o;++a){let{start:o,end:d}=s[a],c=r[o],u=r[d];if(c===u){l.push(c);continue}let f=h(c,u,Math.abs((n-c[e])/(u[e]-c[e])),i.stepped);f[e]=t[e],l.push(f)}return 1===l.length?l[0]:l}pathSegment(t,e,i){return qr(this)(t,this,e,i)}path(t,e,i){let n=this.segments,r=qr(this),s=this._loop;e=e||0,i=i||this.points.length-e;for(let a of n)s&=r(t,this,a,{start:e,end:e+i-1});return!!s}draw(t,e,i,n){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Gr(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function Zr(t,e,i,n){let r=t.options,{[i]:s}=t.getProps([i],n);return Math.abs(e-s)<r.radius+r.hitRadius}Jr.id="line",Jr.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Jr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Jr.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};var Qr=class extends fn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){let n=this.options,{x:r,y:s}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(e-s,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Zr(this,t,"x",e)}inYRange(t,e){return Zr(this,t,"y",e)}getCenterPoint(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){let i=this.options;this.skip||i.radius<.1||!ve(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,be(t,i,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};function ts(t,e){let i,n,r,s,a,{x:o,y:l,base:h,width:d,height:c}=t.getProps(["x","y","base","width","height"],e);return t.horizontal?(a=c/2,i=Math.min(o,h),n=Math.max(o,h),r=l-a,s=l+a):(a=d/2,i=o-a,n=o+a,r=Math.min(l,h),s=Math.max(l,h)),{left:i,top:r,right:n,bottom:s}}function es(t,e,i,n){return t?0:ht(e,i,n)}function is(t){let e=ts(t),i=e.right-e.left,n=e.bottom-e.top,r=function(t,e,i){let n=t.options.borderWidth,r=t.borderSkipped,s=Ie(n);return{t:es(r.top,s.top,0,i),r:es(r.right,s.right,0,e),b:es(r.bottom,s.bottom,0,i),l:es(r.left,s.left,0,e)}}(t,i/2,n/2),s=function(t,e,i){let{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=Re(r),a=Math.min(e,i),o=t.borderSkipped,l=n||_(r);return{topLeft:es(!l||o.top||o.left,s.topLeft,0,a),topRight:es(!l||o.top||o.right,s.topRight,0,a),bottomLeft:es(!l||o.bottom||o.left,s.bottomLeft,0,a),bottomRight:es(!l||o.bottom||o.right,s.bottomRight,0,a)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:i-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function ns(t,e,i,n){let r=null===e,s=null===i,a=t&&!(r&&s)&&ts(t,n);return a&&(r||dt(e,a.left,a.right))&&(s||dt(i,a.top,a.bottom))}function rs(t,e){t.rect(e.x,e.y,e.w,e.h)}function ss(t,e,i={}){let n=t.x!==i.x?-e:0,r=t.y!==i.y?-e:0,s=(t.x+t.w!==i.x+i.w?e:0)-n,a=(t.y+t.h!==i.y+i.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+s,h:t.h+a,radius:t.radius}}Qr.id="point",Qr.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Qr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var as=class extends fn{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){let{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:r,outer:s}=is(this),a=(o=s.radius).topLeft||o.topRight||o.bottomLeft||o.bottomRight?Pe:rs;var o;t.save(),(s.w!==r.w||s.h!==r.h)&&(t.beginPath(),a(t,ss(s,e,r)),t.clip(),a(t,ss(r,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ss(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return ns(this,t,e,i)}inXRange(t,e){return ns(this,t,null,e)}inYRange(t,e){return ns(this,null,t,e)}getCenterPoint(t){let{x:e,y:i,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+n)/2:e,y:r?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}};function os(t,e,i,n){if(n)return;let r=e[t],s=i[t];return"angle"===t&&(r=ot(r),s=ot(s)),{property:t,start:r,end:s}}function ls(t,e,i){for(;e>t;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function hs(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ds(t,e){let i=[],n=!1;return v(t)?(n=!0,i=t):i=function(t,e){let{x:i=null,y:n=null}=t||{},r=e.points,s=[];return e.segments.forEach(({start:t,end:e})=>{e=ls(t,e,r);let a=r[t],o=r[e];null!==n?(s.push({x:a.x,y:n}),s.push({x:o.x,y:n})):null!==i&&(s.push({x:i,y:a.y}),s.push({x:i,y:o.y}))}),s}(t,e),i.length?new Jr({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function cs(t){return t&&!1!==t.fill}function us(t,e,i){let n,r=t[e].fill,s=[e];if(!i)return r;for(;!1!==r&&-1===s.indexOf(r);){if(!w(r))return r;if(n=t[r],!n)return!1;if(n.visible)return r;s.push(r),r=n.fill}return!1}function fs(t,e,i){let n=function(t){let e=t.options,i=e.fill,n=k(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if(_(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return w(r)&&Math.floor(r)===r?function(t,e,i,n){return("-"===t||"+"===t)&&(i=e+i),!(i===e||i<0||i>=n)&&i}(n[0],e,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function gs(t,e,i){let n=[];for(let r=0;r<i.length;r++){let s=i[r],{first:a,last:o,point:l}=ps(s,e,"x");if(!(!l||a&&o))if(a)n.unshift(l);else if(t.push(l),!o)break}t.push(...n)}function ps(t,e,i){let n=t.interpolate(e,i);if(!n)return{};let r=n[i],s=t.segments,a=t.points,o=!1,l=!1;for(let t=0;t<s.length;t++){let e=s[t],n=a[e.start][i],h=a[e.end][i];if(dt(r,n,h)){o=r===n,l=r===h;break}}return{first:o,last:l,point:n}}as.id="bar",as.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},as.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var xs=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){let{x:n,y:r,radius:s}=this;return e=e||{start:0,end:B},t.arc(n,r,s,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}};function ms(t){let{chart:e,fill:i,line:n}=t;if(w(i))return function(t,e){let i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){let{scale:e,index:i,line:n}=t,r=[],s=n.segments,a=n.points,o=function(t,e){let i=[],n=t.getMatchingVisibleMetas("line");for(let t=0;t<n.length;t++){let r=n[t];if(r.index===e)break;r.hidden||i.unshift(r.dataset)}return i}(e,i);o.push(ds({x:null,y:e.bottom},n));for(let t=0;t<s.length;t++){let e=s[t];for(let t=e.start;t<=e.end;t++)gs(r,a[t],o)}return new Jr({points:r,options:{}})}(t);if("shape"===i)return!0;let r=function(t){return(t.scale||{}).getPointPositionForValue?function(t){let{scale:e,fill:i}=t,n=e.options,r=e.getLabels().length,s=n.reverse?e.max:e.min,a=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:_(t)?t.value:e.getBaseValue(),n}(i,e,s),o=[];if(n.grid.circular){let t=e.getPointPositionForValue(0,s);return new xs({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(a)})}for(let t=0;t<r;++t)o.push(e.getPointPositionForValue(t,a));return o}(t):function(t){let{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:_(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(w(n)){let t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return r instanceof xs?r:ds(r,n)}function bs(t,e,i){let n=ms(e),{line:r,scale:s,axis:a}=e,o=r.options,l=o.fill,h=o.backgroundColor,{above:d=h,below:c=h}=l||{};n&&r.points.length&&(_e(t,i),function(t,e){let{line:i,target:n,above:r,below:s,area:a,scale:o}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==r&&(ys(t,n,a.top),vs(t,{line:i,target:n,color:r,scale:o,property:l}),t.restore(),t.save(),ys(t,n,a.bottom)),vs(t,{line:i,target:n,color:s,scale:o,property:l}),t.restore()}(t,{line:r,target:n,above:d,below:c,area:i,scale:s,axis:a}),we(t))}function ys(t,e,i){let{segments:n,points:r}=e,s=!0,a=!1;t.beginPath();for(let o of n){let{start:n,end:l}=o,h=r[n],d=r[ls(n,l,r)];s?(t.moveTo(h.x,h.y),s=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,o,{move:a}),a?t.closePath():t.lineTo(d.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function vs(t,e){let{line:i,target:n,property:r,color:s,scale:a}=e,o=function(t,e,i){let n=t.segments,r=t.points,s=e.points,a=[];for(let t of n){let{start:n,end:o}=t;o=ls(n,o,r);let l=os(i,r[n],r[o],t.loop);if(!e.segments){a.push({source:t,target:l,start:r[n],end:r[o]});continue}let h=Ci(e,l);for(let e of h){let n=os(i,s[e.start],s[e.end],e.loop),o=Di(t,r,n);for(let t of o)a.push({source:t,target:e,start:{[i]:hs(l,n,"start",Math.max)},end:{[i]:hs(l,n,"end",Math.min)}})}}return a}(i,n,r);for(let{source:e,target:l,start:h,end:d}of o){let{style:{backgroundColor:o=s}={}}=e,c=!0!==n;t.save(),t.fillStyle=o,_s(t,a,c&&os(r,h,d)),t.beginPath();let u,f=!!i.pathSegment(t,e);if(c){f?t.closePath():ws(t,n,d,r);let e=!!n.pathSegment(t,l,{move:f,reverse:!0});u=f&&e,u||ws(t,n,h,r)}t.closePath(),t.fill(u?"evenodd":"nonzero"),t.restore()}}function _s(t,e,i){let{top:n,bottom:r}=e.chart.chartArea,{property:s,start:a,end:o}=i||{};"x"===s&&(t.beginPath(),t.rect(a,n,o-a,r-n),t.clip())}function ws(t,e,i,n){let r=e.interpolate(i,n);r&&t.lineTo(r.x,r.y)}var Ms={id:"filler",afterDatasetsUpdate(t,e,i){let n,r,s,a,o=(t.data.datasets||[]).length,l=[];for(r=0;r<o;++r)n=t.getDatasetMeta(r),s=n.dataset,a=null,s&&s.options&&s instanceof Jr&&(a={visible:t.isDatasetVisible(r),index:r,fill:fs(s,r,o),chart:t,axis:n.controller.options.indexAxis,scale:n.vScale,line:s}),n.$filler=a,l.push(a);for(r=0;r<o;++r)a=l[r],a&&!1!==a.fill&&(a.fill=us(l,r,i.propagate))},beforeDraw(t,e,i){let n="beforeDraw"===i.drawTime,r=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let e=r.length-1;e>=0;--e){let i=r[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&i.fill&&bs(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;let n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){let i=n[e].$filler;cs(i)&&bs(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){let n=e.meta.$filler;!cs(n)||"beforeDatasetDraw"!==i.drawTime||bs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},ks=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}},Ss=class extends fn{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(){let t=this.options.labels||{},e=O(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);let i,n,r=t.labels,s=Le(r.font),a=s.size,o=this._computeTitleHeight(),{boxWidth:l,itemHeight:h}=ks(r,a);e.font=s.string,this.isHorizontal()?(i=this.maxWidth,n=this._fitRows(o,a,l,h)+10):(n=this.maxHeight,i=this._fitCols(o,a,l,h)+10),this.width=Math.min(i,t.maxWidth||this.maxWidth),this.height=Math.min(n,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){let{ctx:r,maxWidth:s,options:{labels:{padding:a}}}=this,o=this.legendHitBoxes=[],l=this.lineWidths=[0],h=n+a,d=t;r.textAlign="left",r.textBaseline="middle";let c=-1,u=-h;return this.legendItems.forEach((t,f)=>{let g=i+e/2+r.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>s)&&(d+=h,l[l.length-(f>0?0:1)]=0,u+=h,c++),o[f]={left:0,top:u,row:c,width:g,height:n},l[l.length-1]+=g+a}),d}_fitCols(t,e,i,n){let{ctx:r,maxHeight:s,options:{labels:{padding:a}}}=this,o=this.legendHitBoxes=[],l=this.columnSizes=[],h=s-t,d=a,c=0,u=0,f=0,g=0;return this.legendItems.forEach((t,s)=>{let p=i+e/2+r.measureText(t.text).width;s>0&&u+n+2*a>h&&(d+=c+a,l.push({width:c,height:u}),f+=c+a,g++,c=u=0),o[s]={left:f,top:u,col:g,width:p,height:n},c=Math.max(c,p),u+=n+a}),d+=c,l.push({width:c,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,s=Mi(r,this.left,this.width);if(this.isHorizontal()){let r=0,a=vt(i,this.left+n,this.right-this.lineWidths[r]);for(let o of e)r!==o.row&&(r=o.row,a=vt(i,this.left+n,this.right-this.lineWidths[r])),o.top+=this.top+t+n,o.left=s.leftForLtr(s.x(a),o.width),a+=o.width+n}else{let r=0,a=vt(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(let o of e)o.col!==r&&(r=o.col,a=vt(i,this.top+t+n,this.bottom-this.columnSizes[r].height)),o.top=a,o.left+=this.left+n,o.left=s.leftForLtr(s.x(o.left),o.width),a+=o.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;_e(t,this),this._draw(),we(t)}}_draw(){let t,{options:e,columnSizes:i,lineWidths:n,ctx:r}=this,{align:s,labels:a}=e,o=fe.color,l=Mi(e.rtl,this.left,this.width),h=Le(a.font),{color:d,padding:c}=a,u=h.size,f=u/2;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=h.string;let{boxWidth:g,boxHeight:p,itemHeight:x}=ks(a,u),m=this.isHorizontal(),b=this._computeTitleHeight();t=m?{x:vt(s,this.left+c,this.right-n[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:vt(s,this.top+b+c,this.bottom-i[0].height),line:0},ki(this.ctx,e.textDirection);let y=x+c;this.legendItems.forEach((v,_)=>{r.strokeStyle=v.fontColor||d,r.fillStyle=v.fontColor||d;let w=r.measureText(v.text).width,M=l.textAlign(v.textAlign||(v.textAlign=a.textAlign)),S=g+f+w,O=t.x,P=t.y;l.setWidth(this.width),m?_>0&&O+S+c>this.right&&(P=t.y+=y,t.line++,O=t.x=vt(s,this.left+c,this.right-n[t.line])):_>0&&P+y>this.bottom&&(O=t.x=O+i[t.line].width+c,t.line++,P=t.y=vt(s,this.top+b+c,this.bottom-i[t.line].height)),function(t,e,i){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;r.save();let n=k(i.lineWidth,1);if(r.fillStyle=k(i.fillStyle,o),r.lineCap=k(i.lineCap,"butt"),r.lineDashOffset=k(i.lineDashOffset,0),r.lineJoin=k(i.lineJoin,"miter"),r.lineWidth=n,r.strokeStyle=k(i.strokeStyle,o),r.setLineDash(k(i.lineDash,[])),a.usePointStyle){let s={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},o=l.xPlus(t,g/2);ye(r,s,o,e+f,a.pointStyleWidth&&g)}else{let s=e+Math.max((u-p)/2,0),a=l.leftForLtr(t,g),o=Re(i.borderRadius);r.beginPath(),Object.values(o).some(t=>0!==t)?Pe(r,{x:a,y:s,w:g,h:p,radius:o}):r.rect(a,s,g,p),r.fill(),0!==n&&r.stroke()}r.restore()}(l.x(O),P,v),O=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(M,O+g+f,m?O+S:this.right,e.rtl),function(t,e,i){Se(r,i.text,t,e+x/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})}(l.x(O),P,v),m?t.x+=S+c:t.y+=y}),Si(this.ctx,e.textDirection)}drawTitle(){let t=this.options,e=t.title,i=Le(e.font),n=Ee(e.padding);if(!e.display)return;let r,s=Mi(t.rtl,this.left,this.width),a=this.ctx,o=e.position,l=i.size/2,h=n.top+l,d=this.left,c=this.width;if(this.isHorizontal())c=Math.max(...this.lineWidths),r=this.top+h,d=vt(t.align,d,this.right-c);else{let e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);r=h+vt(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}let u=vt(o,d,d+c);a.textAlign=s.textAlign(yt(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Se(a,e.text,u,r,i)}_computeTitleHeight(){let t=this.options.title,e=Le(t.font),i=Ee(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(dt(t,this.left,this.right)&&dt(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(n=r[i],dt(t,n.left,n.left+n.width)&&dt(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){let e=this.options;if(!function(t,e){return!(("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)&&(!e.onClick||"click"!==t&&"mouseup"!==t))}(t.type,e))return;let i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){let n=this._hoveredItem,r=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(n,i);n&&!r&&O(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!r&&O(e.onHover,[t,i,this],this)}else i&&O(e.onClick,[t,i,this],this)}};var Os={id:"legend",_element:Ss,start(t,e,i){let n=t.legend=new Ss({ctx:t.ctx,options:i,chart:t});Gn.configure(t,n,i),Gn.addBox(t,n)},stop(t){Gn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let n=t.legend;Gn.configure(t,n,i),n.options=i},afterUpdate(t){let e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){let n=e.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:r,color:s}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{let a=t.controller.getStyle(i?0:void 0),o=Ee(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(o.width+o.height)/4,strokeStyle:a.borderColor,pointStyle:n||a.pointStyle,rotation:a.rotation,textAlign:r||a.textAlign,borderRadius:0,datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}},Ps=class extends fn{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){let i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;let n=v(i.text)?i.text.length:1;this._padding=Ee(i.padding);let r=n*Le(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){let e,i,n,{top:r,left:s,bottom:a,right:o,options:l}=this,h=l.align,d=0;return this.isHorizontal()?(i=vt(h,s,o),n=r+t,e=o-s):("left"===l.position?(i=s+t,n=vt(h,a,r),d=-.5*V):(i=o-t,n=vt(h,r,a),d=.5*V),e=a-r),{titleX:i,titleY:n,maxWidth:e,rotation:d}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=Le(e.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:a,rotation:o}=this._drawArgs(n);Se(t,e.text,0,0,i,{color:e.color,maxWidth:a,rotation:o,textAlign:yt(e.align),textBaseline:"middle",translation:[r,s]})}};var Ds={id:"title",_element:Ps,start(t,e,i){!function(t,e){let i=new Ps({ctx:t.ctx,options:e,chart:t});Gn.configure(t,i,e),Gn.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){let e=t.titleBlock;Gn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let n=t.titleBlock;Gn.configure(t,n,i),n.options=i},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}},Cs={average(t){if(!t.length)return!1;let e,i,n=0,r=0,s=0;for(e=0,i=t.length;e<i;++e){let i=t[e].element;if(i&&i.hasValue()){let t=i.tooltipPosition();n+=t.x,r+=t.y,++s}}return{x:n/s,y:r/s}},nearest(t,e){if(!t.length)return!1;let i,n,r,s=e.x,a=e.y,o=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){let n=t[i].element;if(n&&n.hasValue()){let t=st(e,n.getCenterPoint());t<o&&(o=t,r=n)}}if(r){let t=r.tooltipPosition();s=t.x,a=t.y}return{x:s,y:a}}};function As(t,e){return e&&(v(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ts(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function js(t,e){let{element:i,datasetIndex:n,index:r}=e,s=t.getDatasetMeta(n).controller,{label:a,value:o}=s.getLabelAndValue(r);return{chart:t,label:a,parsed:s.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:o,dataset:s.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function Is(t,e){let i=t.chart.ctx,{body:n,footer:r,title:s}=t,{boxWidth:a,boxHeight:o}=e,l=Le(e.bodyFont),h=Le(e.titleFont),d=Le(e.footerFont),c=s.length,u=r.length,f=n.length,g=Ee(e.padding),p=g.height,x=0,m=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(m+=t.beforeBody.length+t.afterBody.length,c&&(p+=c*h.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),m){p+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(m-f)*l.lineHeight+(m-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*d.lineHeight+(u-1)*e.footerSpacing);let b=0,y=function(t){x=Math.max(x,i.measureText(t).width+b)};return i.save(),i.font=h.string,P(t.title,y),i.font=l.string,P(t.beforeBody.concat(t.afterBody),y),b=e.displayColors?a+2+e.boxPadding:0,P(n,t=>{P(t.before,y),P(t.lines,y),P(t.after,y)}),b=0,i.font=d.string,P(t.footer,y),i.restore(),x+=g.width,{width:x,height:p}}function Rs(t,e,i,n){let{x:r,width:s}=i,{width:a,chartArea:{left:o,right:l}}=t,h="center";return"center"===n?h=r<=(o+l)/2?"left":"right":r<=s/2?h="left":r>=a-s/2&&(h="right"),function(t,e,i,n){let{x:r,width:s}=n,a=i.caretSize+i.caretPadding;if("left"===t&&r+s+a>e.width||"right"===t&&r-s-a<0)return!0}(h,t,e,i)&&(h="center"),h}function Es(t,e,i){let n=i.yAlign||e.yAlign||function(t,e){let{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Rs(t,e,i,n),yAlign:n}}function Ls(t,e,i,n){let{caretSize:r,caretPadding:s,cornerRadius:a}=t,{xAlign:o,yAlign:l}=i,h=r+s,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=Re(a),g=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,o),p=function(t,e,i){let{y:n,height:r}=t;return"top"===e?n+=i:n-="bottom"===e?r+i:r/2,n}(e,l,h);return"center"===l?"left"===o?g+=h:"right"===o&&(g-=h):"left"===o?g-=Math.max(d,u)+r:"right"===o&&(g+=Math.max(c,f)+r),{x:ht(g,0,n.width-e.width),y:ht(p,0,n.height-e.height)}}function zs(t,e,i){let n=Ee(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Fs(t){return As([],Ts(t))}function Ws(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}var Ns=class extends fn{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||t._chart,this._chart=this.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(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Fi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,Fe(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){let{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]),a=[];return a=As(a,Ts(n)),a=As(a,Ts(r)),a=As(a,Ts(s)),a}getBeforeBody(t,e){return Fs(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){let{callbacks:i}=e,n=[];return P(t,t=>{let e={before:[],lines:[],after:[]},r=Ws(i,t);As(e.before,Ts(r.beforeLabel.call(this,t))),As(e.lines,r.label.call(this,t)),As(e.after,Ts(r.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return Fs(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){let{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]),a=[];return a=As(a,Ts(n)),a=As(a,Ts(r)),a=As(a,Ts(s)),a}_createItems(t){let e,i,n=this._active,r=this.chart.data,s=[],a=[],o=[],l=[];for(e=0,i=n.length;e<i;++e)l.push(js(this.chart,n[e]));return t.filter&&(l=l.filter((e,i,n)=>t.filter(e,i,n,r))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,r))),P(l,e=>{let i=Ws(t.callbacks,e);s.push(i.labelColor.call(this,e)),a.push(i.labelPointStyle.call(this,e)),o.push(i.labelTextColor.call(this,e))}),this.labelColors=s,this.labelPointStyles=a,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){let i,n=this.options.setContext(this.getContext()),r=this._active,s=[];if(r.length){let t=Cs[n.position].call(this,r,this._eventPosition);s=this._createItems(n),this.title=this.getTitle(s,n),this.beforeBody=this.getBeforeBody(s,n),this.body=this.getBody(s,n),this.afterBody=this.getAfterBody(s,n),this.footer=this.getFooter(s,n);let e=this._size=Is(this,n),a=Object.assign({},t,e),o=Es(this.chart,n,a),l=Ls(n,a,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){let r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){let n,r,s,a,o,l,{xAlign:h,yAlign:d}=this,{caretSize:c,cornerRadius:u}=i,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:x}=Re(u),{x:m,y:b}=t,{width:y,height:v}=e;return"center"===d?(o=b+v/2,"left"===h?(n=m,r=n-c,a=o+c,l=o-c):(n=m+y,r=n+c,a=o-c,l=o+c),s=n):(r="left"===h?m+Math.max(f,p)+c:"right"===h?m+y-Math.max(g,x)-c:this.caretX,"top"===d?(a=b,o=a-c,n=r-c,s=r+c):(a=b+v,o=a+c,n=r+c,s=r-c),l=a),{x1:n,x2:r,x3:s,y1:a,y2:o,y3:l}}drawTitle(t,e,i){let n,r,s,a=this.title,o=a.length;if(o){let l=Mi(i.rtl,this.x,this.width);for(t.x=zs(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",n=Le(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=n.string,s=0;s<o;++s)e.fillText(a[s],l.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+r,s+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,r){let s=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:o,boxWidth:l,boxPadding:h}=r,d=Le(r.bodyFont),c=zs(this,"left",r),u=n.x(c),f=o<d.lineHeight?(d.lineHeight-o)/2:0,g=e.y+f;if(r.usePointStyle){let e={radius:Math.min(l,o)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=n.leftForLtr(u,l)+l/2,h=g+o/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,be(t,e,i,h),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,be(t,e,i,h)}else{t.lineWidth=_(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;let e=n.leftForLtr(u,l-h),i=n.leftForLtr(n.xPlus(u,1),l-h-2),a=Re(s.borderRadius);Object.values(a).some(t=>0!==t)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Pe(t,{x:e,y:g,w:l,h:o,radius:a}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Pe(t,{x:i,y:g+1,w:l-2,h:o-2,radius:a}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,g,l,o),t.strokeRect(e,g,l,o),t.fillStyle=s.backgroundColor,t.fillRect(i,g+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let n,r,s,a,o,l,h,{body:d}=this,{bodySpacing:c,bodyAlign:u,displayColors:f,boxHeight:g,boxWidth:p,boxPadding:x}=i,m=Le(i.bodyFont),b=m.lineHeight,y=0,v=Mi(i.rtl,this.x,this.width),_=function(i){e.fillText(i,v.x(t.x+y),t.y+b/2),t.y+=b+c},w=v.textAlign(u);for(e.textAlign=u,e.textBaseline="middle",e.font=m.string,t.x=zs(this,w,i),e.fillStyle=i.bodyColor,P(this.beforeBody,_),y=f&&"right"!==w?"center"===u?p/2+x:p+2+x:0,a=0,l=d.length;a<l;++a){for(n=d[a],r=this.labelTextColors[a],e.fillStyle=r,P(n.before,_),s=n.lines,f&&s.length&&(this._drawColorBox(e,t,a,v,i),b=Math.max(m.lineHeight,g)),o=0,h=s.length;o<h;++o)_(s[o]),b=m.lineHeight;P(n.after,_)}y=0,b=m.lineHeight,P(this.afterBody,_),t.y-=c}drawFooter(t,e,i){let n,r,s=this.footer,a=s.length;if(a){let o=Mi(i.rtl,this.x,this.width);for(t.x=zs(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=o.textAlign(i.footerAlign),e.textBaseline="middle",n=Le(i.footerFont),e.fillStyle=i.footerColor,e.font=n.string,r=0;r<a;++r)e.fillText(s[r],o.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){let{xAlign:r,yAlign:s}=this,{x:a,y:o}=t,{width:l,height:h}=i,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=Re(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,o),"top"===s&&this.drawCaret(t,e,i,n),e.lineTo(a+l-c,o),e.quadraticCurveTo(a+l,o,a+l,o+c),"center"===s&&"right"===r&&this.drawCaret(t,e,i,n),e.lineTo(a+l,o+h-f),e.quadraticCurveTo(a+l,o+h,a+l-f,o+h),"bottom"===s&&this.drawCaret(t,e,i,n),e.lineTo(a+u,o+h),e.quadraticCurveTo(a,o+h,a,o+h-u),"center"===s&&"left"===r&&this.drawCaret(t,e,i,n),e.lineTo(a,o+d),e.quadraticCurveTo(a,o,a+d,o),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){let i=Cs[t.position].call(this,this._active,this._eventPosition);if(!i)return;let s=this._size=Is(this,t),a=Object.assign({},i,this._size),o=Es(e,t,a),l=Ls(t,a,o,e);(n._to!==l.x||r._to!==l.y)&&(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let s=Ee(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,n,e),ki(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Si(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,n=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),r=!D(i,n),s=this._positionChanged(n,e);(r||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,r=this._active||[],s=this._getActiveElements(t,r,e,i),a=this._positionChanged(s,t),o=e||!D(s,r)||a;return o&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,n){let r=this.options;if("mouseout"===t.type)return[];if(!n)return e;let s=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&s.reverse(),s}_positionChanged(t,e){let{caretX:i,caretY:n,options:r}=this,s=Cs[r.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}};Ns.positioners=Cs;var Vs={id:"tooltip",_element:Ns,positioners:Cs,afterInit(t,e,i){i&&(t.tooltip=new Ns({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:{beforeTitle:m,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:m,beforeBody:m,beforeLabel:m,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");let i=t.formattedValue;return y(i)||(e+=i),e},labelColor(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:m,afterBody:m,beforeFooter:m,footer:m,afterFooter:m}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Bs(t,e,i,n){let r=t.indexOf(e);return-1===r?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):r!==t.lastIndexOf(e)?i:r}var Hs=class extends kn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let t=this.getLabels();for(let{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(y(t))return null;let i=this.getLabels();return((t,e)=>null===t?null:ht(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Bs(i,t,k(e,t),this._addedLabels),i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,n=[],r=this.getLabels();r=0===t&&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 i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){let e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};function Ys(t,e){let i,n,r,s,a=[],{bounds:o,step:l,min:h,max:d,precision:c,count:u,maxTicks:f,maxDigits:g,includeBounds:p}=t,x=l||1,m=f-1,{min:b,max:v}=e,_=!y(h),w=!y(d),M=!y(u),k=(v-b)/(g+1),S=J((v-b)/m/x)*x;if(S<1e-14&&!_&&!w)return[{value:b},{value:v}];s=Math.ceil(v/S)-Math.floor(b/S),s>m&&(S=J(s*S/m/x)*x),y(c)||(i=Math.pow(10,c),S=Math.ceil(S*i)/i),"ticks"===o?(n=Math.floor(b/S)*S,r=Math.ceil(v/S)*S):(n=b,r=v),_&&w&&l&&function(t,e){let i=Math.round(t);return i-e<=t&&i+e>=t}((d-h)/l,S/1e3)?(s=Math.round(Math.min((d-h)/S,f)),S=(d-h)/s,n=h,r=d):M?(n=_?h:n,r=w?d:r,s=u-1,S=(r-n)/s):(s=(r-n)/S,s=Q(s,Math.round(s),S/1e3)?Math.round(s):Math.ceil(s));let O=Math.max(nt(S),nt(n));i=Math.pow(10,y(c)?O:c),n=Math.round(n*i)/i,r=Math.round(r*i)/i;let P=0;for(_&&(p&&n!==h?(a.push({value:h}),n<h&&P++,Q(Math.round((n+P*S)*i)/i,h,$s(h,k,t))&&P++):n<h&&P++);P<s;++P)a.push({value:Math.round((n+P*S)*i)/i});return w&&p&&r!==d?a.length&&Q(a[a.length-1].value,d,$s(d,k,t))?a[a.length-1].value=d:a.push({value:d}):(!w||r===d)&&a.push({value:r}),a}function $s(t,e,{horizontal:i,minRotation:n}){let r=et(n),s=(i?Math.sin(r):Math.cos(r))||.001,a=.75*e*(""+t).length;return Math.min(e/s,a)}Hs.id="category",Hs.defaults={ticks:{callback:Hs.prototype.getLabelForValue}};var Xs=class extends kn{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 y(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:n,max:r}=this,s=t=>n=e?n:t,a=t=>r=i?r:t;if(t){let t=G(n),e=G(r);t<0&&e<0?a(0):t>0&&e>0&&s(0)}if(n===r){let e=1;(r>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*r)),a(r+e),t||s(n-e)}this.min=n,this.max=r}getTickLimit(){let t,e=this.options.ticks,{maxTicksLimit:i,stepSize:n}=e;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let n=Ys({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:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&tt(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return wi(t,this.chart.options.locale,this.options.ticks.format)}},Us=class extends Xs{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=w(t)?t:0,this.max=w(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=et(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};function qs(t){return t/Math.pow(10,Math.floor(K(t)))==1}Us.id="linear",Us.defaults={ticks:{callback:pn.formatters.numeric}};var Ks=class extends kn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let i=Xs.prototype.parse.apply(this,[t,e]);if(0!==i)return w(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=w(t)?Math.max(0,t):null,this.max=w(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,n=this.max,r=e=>i=t?i:e,s=t=>n=e?n:t,a=(t,e)=>Math.pow(10,Math.floor(K(t))+e);i===n&&(i<=0?(r(1),s(10)):(r(a(i,-1)),s(a(n,1)))),i<=0&&r(a(n,-1)),n<=0&&s(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=n}buildTicks(){let t=this.options,e=function(t,e){let i=Math.floor(K(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),r=[],s=M(t.min,Math.pow(10,Math.floor(K(e.min)))),a=Math.floor(K(s)),o=Math.floor(s/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{r.push({value:s,major:qs(s)}),++o,10===o&&(o=1,++a,l=a>=0?1:l),s=Math.round(o*Math.pow(10,a)*l)/l}while(a<i||a===i&&o<n);let h=M(t.max,s);return r.push({value:h,major:qs(s)}),r}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&tt(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":wi(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=K(t),this._valueRange=K(this.max)-K(t)}getPixelForValue(t){return(void 0===t||0===t)&&(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(K(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};function Gs(t){let e=t.ticks;if(e.display&&t.display){let t=Ee(e.backdropPadding);return k(e.font&&e.font.size,fe.font.size)+t.height}return 0}function Js(t,e,i){return i=v(i)?i:[i],{w:pe(t,e.string,i),h:i.length*e.lineHeight}}function Zs(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:t<n||t>r?{start:e-i,end:e}:{start:e,end:e+i}}function Qs(t){let e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],r=[],s=t._pointLabels.length,a=t.options.pointLabels,o=a.centerPointLabels?V/s:0;for(let l=0;l<s;l++){let s=a.setContext(t.getPointLabelContext(l));r[l]=s.padding;let h=t.getPointPosition(l,t.drawingArea+r[l],o),d=Le(s.font),c=Js(t.ctx,d,t._pointLabels[l]);n[l]=c;let u=ot(t.getIndexAngle(l)+o),f=Math.round(it(u));ta(i,e,u,Zs(f,h.x,c.w,0,180),Zs(f,h.y,c.h,90,270))}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){let n=[],r=t._pointLabels.length,s=t.options,a=Gs(s)/2,o=t.drawingArea,l=s.pointLabels.centerPointLabels?V/r:0;for(let s=0;s<r;s++){let r=t.getPointPosition(s,o+a+i[s],l),h=Math.round(it(ot(r.angle+X))),d=e[s],c=na(r.y,d.h,h),u=ea(h),f=ia(r.x,d.w,u);n.push({x:r.x,y:c,textAlign:u,left:f,top:c,right:f+d.w,bottom:c+d.h})}return n}(t,n,r)}function ta(t,e,i,n,r){let s=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i)),o=0,l=0;n.start<e.l?(o=(e.l-n.start)/s,t.l=Math.min(t.l,e.l-o)):n.end>e.r&&(o=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+o)),r.start<e.t?(l=(e.t-r.start)/a,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function ea(t){return 0===t||180===t?"center":t<180?"left":"right"}function ia(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function na(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function ra(t,e,i,n){let{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,B);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let s=1;s<n;s++)i=t.getPointPosition(s,e),r.lineTo(i.x,i.y)}}Ks.id="logarithmic",Ks.defaults={ticks:{callback:pn.formatters.logarithmic,major:{enabled:!0}}};var sa=class extends Xs{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=Ee(Gs(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(){let{min:t,max:e}=this.getMinMax(!1);this.min=w(t)&&!isNaN(t)?t:0,this.max=w(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gs(this.options))}generateTickLabels(t){Xs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{let i=O(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){let t=this.options;t.display&&t.pointLabels.display?Qs(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return ot(t*(B/(this._pointLabels.length||1))+et(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(y(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(y(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let i=e[t];return function(t,e,i){return Fe(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){let n=this.getIndexAngle(t)-X+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:e,top:i,right:n,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:r}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),ra(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t,e,i,n=this.ctx,r=this.options,{angleLines:s,grid:a}=r,o=this._pointLabels.length;if(r.pointLabels.display&&function(t,e){let{ctx:i,options:{pointLabels:n}}=t;for(let r=e-1;r>=0;r--){let e=n.setContext(t.getPointLabelContext(r)),s=Le(e.font),{x:a,y:o,textAlign:l,left:h,top:d,right:c,bottom:u}=t._pointLabelItems[r],{backdropColor:f}=e;if(!y(f)){let t=Re(e.borderRadius),n=Ee(e.backdropPadding);i.fillStyle=f;let r=h-n.left,s=d-n.top,a=c-h+n.width,o=u-d+n.height;Object.values(t).some(t=>0!==t)?(i.beginPath(),Pe(i,{x:r,y:s,w:a,h:o,radius:t}),i.fill()):i.fillRect(r,s,a,o)}Se(i,t._pointLabels[r],a,o+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,o),a.display&&this.ticks.forEach((t,i)=>{if(0!==i){e=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){let r=t.ctx,s=e.circular,{color:a,lineWidth:o}=e;!s&&!n||!a||!o||i<0||(r.save(),r.strokeStyle=a,r.lineWidth=o,r.setLineDash(e.borderDash),r.lineDashOffset=e.borderDashOffset,r.beginPath(),ra(t,i,s,n),r.closePath(),r.stroke(),r.restore())}(this,a.setContext(this.getContext(i-1)),e,o)}}),s.display){for(n.save(),t=o-1;t>=0;t--){let a=s.setContext(this.getPointLabelContext(t)),{color:o,lineWidth:l}=a;!l||!o||(n.lineWidth=l,n.strokeStyle=o,n.setLineDash(a.borderDash),n.lineDashOffset=a.borderDashOffset,e=this.getDistanceFromCenterForValue(r.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),n.beginPath(),n.moveTo(this.xCenter,this.yCenter),n.lineTo(i.x,i.y),n.stroke())}n.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let n,r,s=this.getIndexAngle(0);t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,a)=>{if(0===a&&!e.reverse)return;let o=i.setContext(this.getContext(a)),l=Le(o.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),o.showLabelBackdrop){t.font=l.string,r=t.measureText(s.label).width,t.fillStyle=o.backdropColor;let e=Ee(o.backdropPadding);t.fillRect(-r/2-e.left,-n-l.size/2-e.top,r+e.width,l.size+e.height)}Se(t,s.label,0,-n,l,{color:o.color})}),t.restore()}drawTitle(){}};sa.id="radialLinear",sa.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:pn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},sa.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},sa.descriptors={angleLines:{_fallback:"grid"}};var aa={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}},oa=Object.keys(aa);function la(t,e){return t-e}function ha(t,e){if(y(e))return null;let i=t._adapter,{parser:n,round:r,isoWeekday:s}=t._parseOpts,a=e;return"function"==typeof n&&(a=n(a)),w(a)||(a="string"==typeof n?i.parse(a,n):i.parse(a)),null===a?null:(r&&(a="week"!==r||!Z(s)&&!0!==s?i.startOf(a,r):i.startOf(a,"isoWeek",s)),+a)}function da(t,e,i,n){let r=oa.length;for(let s=oa.indexOf(t);s<r-1;++s){let t=aa[oa[s]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(r*t.size))<=n)return oa[s]}return oa[r-1]}function ca(t,e,i){if(i){if(i.length){let{lo:n,hi:r}=ct(i,e);t[i[n]>=e?i[n]:i[r]]=!0}}else t[e]=!0}function ua(t,e,i){let n,r,s=[],a={},o=e.length;for(n=0;n<o;++n)r=e[n],a[r]=n,s.push({value:r,major:!1});return 0!==o&&i?function(t,e,i,n){let r,s,a=t._adapter,o=+a.startOf(e[0].value,n),l=e[e.length-1].value;for(r=o;r<=l;r=+a.add(r,1,n))s=i[r],s>=0&&(e[s].major=!0);return e}(t,s,a,i):s}var fa=class extends kn{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){let i=t.time||(t.time={}),n=this._adapter=new An._date(t.adapters.date);n.init(e),I(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ha(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:n,max:r,minDefined:s,maxDefined:a}=this.getUserBounds();function o(t){!s&&!isNaN(t.min)&&(n=Math.min(n,t.min)),!a&&!isNaN(t.max)&&(r=Math.max(r,t.max))}(!s||!a)&&(o(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&o(this.getMinMax(!1))),n=w(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=w(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);let r=this.min,s=function(t,e,i){let n=0,r=t.length;for(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>i;)r--;return n>0||r<t.length?t.slice(n,r):t}(n,r,this.max);return this._unit=e.unit||(i.autoSkip?da(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,i,n,r){for(let s=oa.length-1;s>=oa.indexOf(i);s--){let i=oa[s];if(aa[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return oa[i?oa.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=oa.indexOf(t)+1,i=oa.length;e<i;++e)if(aa[oa[e]].common)return oa[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&s.reverse(),ua(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t){let e,i,n=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),r=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let s=t.length<3?.5:.25;n=ht(n,0,s),r=ht(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){let t,e,i=this._adapter,n=this.min,r=this.max,s=this.options,a=s.time,o=a.unit||da(a.minUnit,n,r,this._getLabelCapacity(n)),l=k(a.stepSize,1),h="week"===o&&a.isoWeekday,d=Z(h)||!0===h,c={},u=n;if(d&&(u=+i.startOf(u,"isoWeek",h)),u=+i.startOf(u,d?"day":o),i.diff(r,n,o)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+o);let f="data"===s.ticks.source&&this.getDataTimestamps();for(t=u,e=0;t<r;t=+i.add(t,l,o),e++)ca(c,t,f);return(t===r||"ticks"===s.bounds||1===e)&&ca(c,t,f),Object.keys(c).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){let r=this.options,s=r.time.displayFormats,a=this._unit,o=this._majorUnit,l=a&&s[a],h=o&&s[o],d=i[e],c=o&&h&&d&&d.major,u=this._adapter.format(t,n||(c?h:l)),f=r.ticks.callback;return f?O(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,n=et(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),s=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*s,h:i*s+a*r}}_getLabelCapacity(t){let e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,ua(this,[t],this._majorUnit),n),s=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){let t,e,i=this._cache.labels||[];if(i.length)return i;let n=this.getLabels();for(t=0,e=n.length;t<e;++t)i.push(ha(this,n[t]));return this._cache.labels=this._normalized?i:this.normalize(i)}normalize(t){return xt(t.sort(la))}};function ga(t,e,i){let n,r,s,a,o=0,l=t.length-1;i?(e>=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=ut(t,"pos",e)),({pos:n,time:s}=t[o]),({pos:r,time:a}=t[l])):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=ut(t,"time",e)),({time:n,pos:s}=t[o]),({time:r,pos:a}=t[l]));let h=r-n;return h?s+(a-s)*(e-n)/h:s}fa.id="time",fa.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};var pa=class extends fa{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ga(e,this.min),this._tableRange=ga(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let e,i,n,r,s,{min:a,max:o}=this,l=[],h=[];for(e=0,i=t.length;e<i;++e)r=t[e],r>=a&&r<=o&&l.push(r);if(l.length<2)return[{time:a,pos:0},{time:o,pos:1}];for(e=0,i=l.length;e<i;++e)s=l[e+1],n=l[e-1],r=l[e],Math.round((s+n)/2)!==r&&h.push({time:r,pos:e/(i-1)});return h}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ga(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ga(this._table,i*this._tableRange+this._minPos,!0)}};pa.id="timeseries",pa.defaults=fa.defaults;var xa=function(){if("undefined"!=typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var t=window.screen;if(t)return(t.deviceXDPI||1)/(t.logicalXDPI||1)}return 1}(),ma=function(t){var e,i=[];for(t=[].concat(t);t.length;)"string"==typeof(e=t.pop())?i.unshift.apply(i,e.split("\n")):Array.isArray(e)?t.push.apply(t,e):y(t)||i.unshift(""+e);return i},ba=function(t,e,i){var n,r=[].concat(e),s=r.length,a=t.font,o=0;for(t.font=i.string,n=0;n<s;++n)o=Math.max(t.measureText(r[n]).width,o);return t.font=a,{height:s*i.lineHeight,width:o}},ya=function(t,e,i){return Math.max(t,Math.min(e,i))},va=function(t,e){var i,n,r,s,a=t.slice(),o=[];for(i=0,r=e.length;i<r;++i)s=e[i],-1===(n=a.indexOf(s))?o.push([s,1]):a.splice(n,1);for(i=0,r=a.length;i<r;++i)o.push([a[i],-1]);return o};function _a(t,e){var i=e.x,n=e.y;if(null===i)return{x:0,y:-1};if(null===n)return{x:1,y:0};var r=t.x-i,s=t.y-n,a=Math.sqrt(r*r+s*s);return{x:a?r/a:0,y:a?s/a:-1}}function wa(t,e,i){var n=0;return t<i.left?n|=1:t>i.right&&(n|=2),e<i.top?n|=8:e>i.bottom&&(n|=4),n}function Ma(t,e){var i,n,r=e.anchor,s=t;return e.clamp&&(s=function(t,e){for(var i,n,r,s=t.x0,a=t.y0,o=t.x1,l=t.y1,h=wa(s,a,e),d=wa(o,l,e);h|d&&!(h&d);)8&(i=h||d)?(n=s+(o-s)*(e.top-a)/(l-a),r=e.top):4&i?(n=s+(o-s)*(e.bottom-a)/(l-a),r=e.bottom):2&i?(r=a+(l-a)*(e.right-s)/(o-s),n=e.right):1&i&&(r=a+(l-a)*(e.left-s)/(o-s),n=e.left),i===h?h=wa(s=n,a=r,e):d=wa(o=n,l=r,e);return{x0:s,x1:o,y0:a,y1:l}}(s,e.area)),"start"===r?(i=s.x0,n=s.y0):"end"===r?(i=s.x1,n=s.y1):(i=(s.x0+s.x1)/2,n=(s.y0+s.y1)/2),function(t,e,i,n,r){switch(r){case"center":i=n=0;break;case"bottom":i=0,n=1;break;case"right":i=1,n=0;break;case"left":i=-1,n=0;break;case"top":i=0,n=-1;break;case"start":i=-i,n=-n;break;case"end":break;default:r*=Math.PI/180,i=Math.cos(r),n=Math.sin(r)}return{x:t,y:e,vx:i,vy:n}}(i,n,t.vx,t.vy,e.align)}var ka={arc:function(t,e){var i=(t.startAngle+t.endAngle)/2,n=Math.cos(i),r=Math.sin(i),s=t.innerRadius,a=t.outerRadius;return Ma({x0:t.x+n*s,y0:t.y+r*s,x1:t.x+n*a,y1:t.y+r*a,vx:n,vy:r},e)},point:function(t,e){var i=_a(t,e.origin),n=i.x*t.options.radius,r=i.y*t.options.radius;return Ma({x0:t.x-n,y0:t.y-r,x1:t.x+n,y1:t.y+r,vx:i.x,vy:i.y},e)},bar:function(t,e){var i=_a(t,e.origin),n=t.x,r=t.y,s=0,a=0;return t.horizontal?(n=Math.min(t.x,t.base),s=Math.abs(t.base-t.x)):(r=Math.min(t.y,t.base),a=Math.abs(t.base-t.y)),Ma({x0:n,y0:r+a,x1:n+s,y1:r,vx:i.x,vy:i.y},e)},fallback:function(t,e){var i=_a(t,e.origin);return Ma({x0:t.x,y0:t.y,x1:t.x+(t.width||0),y1:t.y+(t.height||0),vx:i.x,vy:i.y},e)}},Sa=function(t){return Math.round(t*xa)/xa};function Oa(t,e){var i=e.chart.getDatasetMeta(e.datasetIndex).vScale;if(!i)return null;if(void 0!==i.xCenter&&void 0!==i.yCenter)return{x:i.xCenter,y:i.yCenter};var n=i.getBasePixel();return t.horizontal?{x:n,y:null}:{x:null,y:n}}function Pa(t){return t instanceof Br?ka.arc:t instanceof Qr?ka.point:t instanceof as?ka.bar:ka.fallback}function Da(t,e,i){var n=i.backgroundColor,r=i.borderColor,s=i.borderWidth;!n&&(!r||!s)||(t.beginPath(),function(t,e,i,n,r,s){var a=Math.PI/2;if(s){var o=Math.min(s,r/2,n/2),l=e+o,h=i+o,d=e+n-o,c=i+r-o;t.moveTo(e,h),l<d&&h<c?(t.arc(l,h,o,-Math.PI,-a),t.arc(d,h,o,-a,0),t.arc(d,c,o,0,a),t.arc(l,c,o,a,Math.PI)):l<d?(t.moveTo(l,i),t.arc(d,h,o,-a,a),t.arc(l,h,o,a,Math.PI+a)):h<c?(t.arc(l,h,o,-Math.PI,0),t.arc(l,c,o,0,Math.PI)):t.arc(l,h,o,-Math.PI,Math.PI),t.closePath(),t.moveTo(e,i)}else t.rect(e,i,n,r)}(t,Sa(e.x)+s/2,Sa(e.y)+s/2,Sa(e.w)-s,Sa(e.h)-s,i.borderRadius),t.closePath(),n&&(t.fillStyle=n,t.fill()),r&&s&&(t.strokeStyle=r,t.lineWidth=s,t.lineJoin="miter",t.stroke()))}function Ca(t,e,i){var n=t.shadowBlur,r=i.stroked,s=Sa(i.x),a=Sa(i.y),o=Sa(i.w);r&&t.strokeText(e,s,a,o),i.filled&&(n&&r&&(t.shadowBlur=0),t.fillText(e,s,a,o),n&&r&&(t.shadowBlur=n))}var Aa=function(t,e,i,n){var r=this;r._config=t,r._index=n,r._model=null,r._rects=null,r._ctx=e,r._el=i};j(Aa.prototype,{_modelize:function(t,e,i,n){var r=this,s=r._index,a=Le(ze([i.font,{}],n,s)),o=ze([i.color,fe.color],n,s);return{align:ze([i.align,"center"],n,s),anchor:ze([i.anchor,"center"],n,s),area:n.chart.chartArea,backgroundColor:ze([i.backgroundColor,null],n,s),borderColor:ze([i.borderColor,null],n,s),borderRadius:ze([i.borderRadius,0],n,s),borderWidth:ze([i.borderWidth,0],n,s),clamp:ze([i.clamp,!1],n,s),clip:ze([i.clip,!1],n,s),color:o,display:t,font:a,lines:e,offset:ze([i.offset,4],n,s),opacity:ze([i.opacity,1],n,s),origin:Oa(r._el,n),padding:Ee(ze([i.padding,4],n,s)),positioner:Pa(r._el),rotation:ze([i.rotation,0],n,s)*(Math.PI/180),size:ba(r._ctx,e,a),textAlign:ze([i.textAlign,"start"],n,s),textShadowBlur:ze([i.textShadowBlur,0],n,s),textShadowColor:ze([i.textShadowColor,o],n,s),textStrokeColor:ze([i.textStrokeColor,o],n,s),textStrokeWidth:ze([i.textStrokeWidth,0],n,s)}},update:function(t){var e,i,n,r=this,s=null,a=null,o=r._index,l=r._config,h=ze([l.display,!0],t,o);h&&(e=t.dataset.data[o],(n=y(i=k(O(l.formatter,[e,t]),e))?[]:ma(i)).length&&(a=function(t){var e=t.borderWidth||0,i=t.padding,n=t.size.height,r=t.size.width,s=-r/2,a=-n/2;return{frame:{x:s-i.left-e,y:a-i.top-e,w:r+i.width+2*e,h:n+i.height+2*e},text:{x:s,y:a,w:r,h:n}}}(s=r._modelize(h,n,l,t)))),r._model=s,r._rects=a},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(t,e){var i,n=t.ctx,r=this._model,s=this._rects;this.visible()&&(n.save(),r.clip&&(i=r.area,n.beginPath(),n.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),n.clip()),n.globalAlpha=ya(0,r.opacity,1),n.translate(Sa(e.x),Sa(e.y)),n.rotate(r.rotation),Da(n,s.frame,r),function(t,e,i,n){var r,s=n.textAlign,a=n.color,o=!!a,l=n.font,h=e.length,d=n.textStrokeColor,c=n.textStrokeWidth,u=d&&c;if(h&&(o||u))for(i=function(t,e,i){var n=i.lineHeight,r=t.w,s=t.x;return"center"===e?s+=r/2:("end"===e||"right"===e)&&(s+=r),{h:n,w:r,x:s,y:t.y+n/2}}(i,s,l),t.font=l.string,t.textAlign=s,t.textBaseline="middle",t.shadowBlur=n.textShadowBlur,t.shadowColor=n.textShadowColor,o&&(t.fillStyle=a),u&&(t.lineJoin="round",t.lineWidth=c,t.strokeStyle=d),r=0,h=e.length;r<h;++r)Ca(t,e[r],{stroked:u,filled:o,w:i.w,x:i.x,y:i.y+i.h*r})}(n,r.lines,s.text,r),n.restore())}});var Ta=Number.MIN_SAFE_INTEGER||-9007199254740991,ja=Number.MAX_SAFE_INTEGER||9007199254740991;function Ia(t,e,i){var n=Math.cos(i),r=Math.sin(i),s=e.x,a=e.y;return{x:s+n*(t.x-s)-r*(t.y-a),y:a+r*(t.x-s)+n*(t.y-a)}}function Ra(t,e){var i,n,r,s,a,o=ja,l=Ta,h=e.origin;for(i=0;i<t.length;++i)r=(n=t[i]).x-h.x,s=n.y-h.y,a=e.vx*r+e.vy*s,o=Math.min(o,a),l=Math.max(l,a);return{min:o,max:l}}function Ea(t,e){var i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n);return{vx:(e.x-t.x)/r,vy:(e.y-t.y)/r,origin:t,ln:r}}var La=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function za(t,e,i){var n=e.positioner(t,e),r=n.vx,s=n.vy;if(!r&&!s)return{x:n.x,y:n.y};var a=i.w,o=i.h,l=e.rotation,h=Math.abs(a/2*Math.cos(l))+Math.abs(o/2*Math.sin(l)),d=Math.abs(a/2*Math.sin(l))+Math.abs(o/2*Math.cos(l)),c=1/Math.max(Math.abs(r),Math.abs(s));return h*=r*c,d*=s*c,h+=e.offset*r,d+=e.offset*s,{x:n.x+h,y:n.y+d}}j(La.prototype,{center:function(){var t=this._rect;return{x:t.x+t.w/2,y:t.y+t.h/2}},update:function(t,e,i){this._rotation=i,this._rect={x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},contains:function(t){var e=this,i=e._rect;return!((t=Ia(t,e.center(),-e._rotation)).x<i.x-1||t.y<i.y-1||t.x>i.x+i.w+2||t.y>i.y+i.h+2)},intersects:function(t){var e,i,n,r=this._points(),s=t._points(),a=[Ea(r[0],r[1]),Ea(r[0],r[3])];for(this._rotation!==t._rotation&&a.push(Ea(s[0],s[1]),Ea(s[0],s[3])),e=0;e<a.length;++e)if(i=Ra(r,a[e]),n=Ra(s,a[e]),i.max<n.min||n.max<i.min)return!1;return!0},_points:function(){var t=this,e=t._rect,i=t._rotation,n=t.center();return[Ia({x:e.x,y:e.y},n,i),Ia({x:e.x+e.w,y:e.y},n,i),Ia({x:e.x+e.w,y:e.y+e.h},n,i),Ia({x:e.x,y:e.y+e.h},n,i)]}});var Fa={prepare:function(t){var e,i,n,r,s,a=[];for(e=0,n=t.length;e<n;++e)for(i=0,r=t[e].length;i<r;++i)s=t[e][i],a.push(s),s.$layout={_box:new La,_hidable:!1,_visible:!0,_set:e,_idx:s._index};return a.sort((function(t,e){var i=t.$layout,n=e.$layout;return i._idx===n._idx?n._set-i._set:n._idx-i._idx})),this.update(a),a},update:function(t){var e,i,n,r,s,a=!1;for(e=0,i=t.length;e<i;++e)r=(n=t[e]).model(),(s=n.$layout)._hidable=r&&"auto"===r.display,s._visible=n.visible(),a|=s._hidable;a&&function(t){var e,i,n,r,s,a,o;for(e=0,i=t.length;e<i;++e)(r=(n=t[e]).$layout)._visible&&(o=new Proxy(n._el,{get:(t,e)=>t.getProps([e],!0)[e]}),s=n.geometry(),a=za(o,n.model(),s),r._box.update(a,s,n.rotation()));(function(t,e){var i,n,r,s;for(i=t.length-1;i>=0;--i)for(r=t[i].$layout,n=i-1;n>=0&&r._visible;--n)(s=t[n].$layout)._visible&&r._box.intersects(s._box)&&e(r,s)})(t,(function(t,e){var i=t._hidable,n=e._hidable;i&&n||n?e._visible=!1:i&&(t._visible=!1)}))}(t)},lookup:function(t,e){var i,n;for(i=t.length-1;i>=0;--i)if((n=t[i].$layout)&&n._visible&&n._box.contains(e))return t[i];return null},draw:function(t,e){var i,n,r,s,a,o;for(i=0,n=e.length;i<n;++i)(s=(r=e[i]).$layout)._visible&&(a=r.geometry(),o=za(r._el,r.model(),a),s._box.update(o,a,r.rotation()),r.draw(t,o))}},Wa="$datalabels",Na="$default";function Va(t,e,i,n){if(e){var r,s=i.$context,a=i.$groups;e[a._set]&&((r=e[a._set][a._key])&&!0===O(r,[s,n])&&(t[Wa]._dirty=!0,i.update(s)))}}function Ba(t,e){var i,n,r=t[Wa],s=r._listeners;if(s.enter||s.leave){if("mousemove"===e.type)n=Fa.lookup(r._labels,e);else if("mouseout"!==e.type)return;i=r._hovered,r._hovered=n,function(t,e,i,n,r){var s,a;!i&&!n||(i?n?i!==n&&(a=s=!0):a=!0:s=!0,a&&Va(t,e.leave,i,r),s&&Va(t,e.enter,n,r))}(t,s,i,n,e)}}var Ha={id:"datalabels",defaults:{align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:function(t){if(y(t))return null;var e,i,n,r=t;if(_(t))if(y(t.label))if(y(t.r))for(r="",n=0,i=(e=Object.keys(t)).length;n<i;++n)r+=(0!==n?", ":"")+e[n]+": "+t[e[n]];else r=t.r;else r=t.label;return""+r},labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},beforeInit:function(t){t[Wa]={_actives:[]}},beforeUpdate:function(t){var e=t[Wa];e._listened=!1,e._listeners={},e._datasets=[],e._labels=[]},afterDatasetUpdate:function(t,e,i){var n,r,s,a,o,l,h,d,c=e.index,u=t[Wa],f=u._datasets[c]=[],g=t.isDatasetVisible(c),p=t.data.datasets[c],x=function(t,e){var i,n,r=t.datalabels,s={},a=[];return!1===r?null:(!0===r&&(r={}),e=j({},[e,r]),i=e.labels||{},n=Object.keys(i),delete e.labels,n.length?n.forEach((function(t){i[t]&&a.push(j({},[e,i[t],{_key:t}]))})):a.push(e),s=a.reduce((function(t,e){return P(e.listeners||{},(function(i,n){t[n]=t[n]||{},t[n][e._key||Na]=i})),delete e.listeners,t}),{}),{labels:a,listeners:s})}(p,i),m=e.meta.data||[],b=t.ctx;for(b.save(),n=0,s=m.length;n<s;++n)if((h=m[n])[Wa]=[],g&&h&&t.getDataVisibility(n)&&!h.skip)for(r=0,a=x.labels.length;r<a;++r)l=(o=x.labels[r])._key,(d=new Aa(o,b,h,n)).$groups={_set:c,_key:l||Na},d.$context={active:!1,chart:t,dataIndex:n,dataset:p,datasetIndex:c},d.update(d.$context),h[Wa].push(d),f.push(d);b.restore(),j(u._listeners,x.listeners,{merger:function(t,i,n){i[t]=i[t]||{},i[t][e.index]=n[t],u._listened=!0}})},afterUpdate:function(t){t[Wa]._labels=Fa.prepare(t[Wa]._datasets)},afterDatasetsDraw:function(t){Fa.draw(t,t[Wa]._labels)},beforeEvent:function(t,e){if(t[Wa]._listened){var i=e.event;switch(i.type){case"mousemove":case"mouseout":Ba(t,i);break;case"click":!function(t,e){var i=t[Wa],n=i._listeners.click,r=n&&Fa.lookup(i._labels,e);r&&Va(t,n,r,e)}(t,i)}}},afterEvent:function(t){var e,i,n,r,s,a,o,l=t[Wa],h=l._actives,d=l._actives=t.getActiveElements(),c=va(h,d);for(e=0,i=c.length;e<i;++e)if((s=c[e])[1])for(n=0,r=(o=s[0].element[Wa]||[]).length;n<r;++n)(a=o[n]).$context.active=1===s[1],a.update(a.$context);(l._dirty||c.length)&&(Fa.update(l._labels),t.render()),delete l._dirty}},Ya={point:(t,e)=>Xa(t,e,{intersect:!0}),nearest:(t,e,i)=>function(t,e,i){let n=Number.POSITIVE_INFINITY;return Xa(t,e,i).reduce((t,r)=>{let s=r.getCenterPoint(),a=function(t,e,i){return"x"===i?{x:t.x,y:e.y}:"y"===i?{x:e.x,y:t.y}:e}(e,s,i.axis),o=st(e,a);return o<n?(t=[r],n=o):o===n&&t.push(r),t},[]).sort((t,e)=>t._index-e._index).slice(0,1)}(t,e,i),x:(t,e,i)=>Xa(t,e,{intersect:i.intersect,axis:"x"}),y:(t,e,i)=>Xa(t,e,{intersect:i.intersect,axis:"y"})};function $a(t,e,i){return(Ya[i.mode]||Ya.nearest)(t,e,i)}function Xa(t,e,i){return t.visibleElements.filter(t=>i.intersect?t.inRange(e.x,e.y):function(t,e,i){return"x"!==i&&"y"!==i?t.inRange(e.x,e.y,"x",!0)||t.inRange(e.x,e.y,"y",!0):t.inRange(e.x,e.y,i,!0)}(t,e,i.axis))}var Ua=(t,e)=>e>t||t.length>e.length&&t.slice(0,e.length)===e,qa=.001,Ka=(t,e,i)=>Math.min(i,Math.max(e,t));function Ga(t,e,i){for(let n of Object.keys(t))t[n]=Ka(t[n],e,i);return t}function Ja(t,{x:e,y:i,x2:n,y2:r},s,a){let o=a/2,l=t.x>=e-o-qa&&t.x<=n+o+qa,h=t.y>=i-o-qa&&t.y<=r+o+qa;return"x"===s?l:("y"===s||l)&&h}function Za(t,e){let{centerX:i,centerY:n}=t.getProps(["centerX","centerY"],e);return{x:i,y:n}}var Qa=t=>"string"==typeof t&&t.endsWith("%"),to=t=>parseFloat(t)/100,eo=t=>Ka(to(t),0,1);function io(t,e){return"start"===e?0:"end"===e?t:Qa(e)?eo(e)*t:t/2}function no(t,e,i=!0){return"number"==typeof e?e:Qa(e)?(i?eo(e):to(e))*t:t}function ro(t,e="center"){return _(t)?{x:k(t.x,e),y:k(t.y,e)}:{x:t=k(t,e),y:t}}function so(t){return t&&(F(t.xValue)||F(t.yValue))}function ao(t,e,i,n=!1){let r=i.init;if(r)return!0===r?lo(e,n):function(t,e,i){if(!0===i)return lo(t,e);if(_(i))return i}(e,n,O(r,[{chart:t,properties:e,options:i}]))}function oo(t,e,i){let n=!1;return e.forEach(e=>{W(t[e])?(n=!0,i[e]=t[e]):F(i[e])&&delete i[e]}),n}function lo({centerX:t,centerY:e},i){return i?{centerX:t,centerY:e,radius:0,width:0,height:0}:{x:t,y:e,x2:t,y2:e,width:0,height:0}}var ho=new Map;function co(t){if(t&&"object"==typeof t){let e=t.toString();return"[object HTMLImageElement]"===e||"[object HTMLCanvasElement]"===e}}function uo(t,{x:e,y:i},n){n&&(t.translate(e,i),t.rotate(et(n)),t.translate(-e,-i))}function fo(t,e){if(e&&e.borderWidth)return t.lineCap=e.borderCapStyle,t.setLineDash(e.borderDash),t.lineDashOffset=e.borderDashOffset,t.lineJoin=e.borderJoinStyle,t.lineWidth=e.borderWidth,t.strokeStyle=e.borderColor,!0}function go(t,e){t.shadowColor=e.backgroundShadowColor,t.shadowBlur=e.shadowBlur,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY}function po(t,e){let i=e.content;if(co(i))return{width:no(i.width,e.width),height:no(i.height,e.height)};let n=e.font,r=v(n)?n.map(t=>Le(t)):[Le(n)],s=e.textStrokeWidth,a=v(i)?i:[i],o=a.join()+(t=>t.reduce((function(t,e){return t+=e.string}),""))(r)+s+(t._measureText?"-spriting":"");return ho.has(o)||ho.set(o,function(t,e,i,n){t.save();let r=e.length,s=0,a=n;for(let o=0;o<r;o++){let r=i[Math.min(o,i.length-1)];t.font=r.string;let l=e[o];s=Math.max(s,t.measureText(l).width+n),a+=r.lineHeight}return t.restore(),{width:s,height:a}}(t,a,r,s)),ho.get(o)}function xo(t,e,i){let{x:n,y:r,width:s,height:a}=e;t.save(),go(t,i);let o=fo(t,i);t.fillStyle=i.backgroundColor,t.beginPath(),Pe(t,{x:n,y:r,w:s,h:a,radius:Ga(Re(i.borderRadius),0,Math.min(s,a)/2)}),t.closePath(),t.fill(),o&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}function mo(t,e,i){let n=i.content;if(co(n))return t.save(),t.globalAlpha=function(t,e){let i=Z(t)?t:e;return Z(i)?Ka(i,0,1):1}(i.opacity,n.style.opacity),t.drawImage(n,e.x,e.y,e.width,e.height),void t.restore();let r=v(n)?n:[n],s=i.font,a=v(s)?s.map(t=>Le(t)):[Le(s)],o=i.color,l=v(o)?o:[o],h=function(t,e){let{x:i,width:n}=t,r=e.textAlign;return"center"===r?i+n/2:"end"===r||"right"===r?i+n:i}(e,i),d=e.y+i.textStrokeWidth/2;t.save(),t.textBaseline="middle",t.textAlign=i.textAlign,function(t,e){if(e.textStrokeWidth>0)return t.lineJoin="round",t.miterLimit=2,t.lineWidth=e.textStrokeWidth,t.strokeStyle=e.textStrokeColor,!0}(t,i)&&function(t,{x:e,y:i},n,r){t.beginPath();let s=0;n.forEach((function(n,a){let o=r[Math.min(a,r.length-1)],l=o.lineHeight;t.font=o.string,t.strokeText(n,e,i+l/2+s),s+=l})),t.stroke()}(t,{x:h,y:d},r,a),function(t,{x:e,y:i},n,{fonts:r,colors:s}){let a=0;n.forEach((function(n,o){let l=s[Math.min(o,s.length-1)],h=r[Math.min(o,r.length-1)],d=h.lineHeight;t.beginPath(),t.font=h.string,t.fillStyle=l,t.fillText(n,e,i+d/2+a),a+=d,t.fill()}))}(t,{x:h,y:d},r,{fonts:a,colors:l}),t.restore()}function bo(t,e,i,n){let{radius:r,options:s}=e,a=s.pointStyle,o=s.rotation,l=(o||0)*$;if(co(a))return t.save(),t.translate(i,n),t.rotate(l),t.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),void t.restore();(t=>isNaN(t)||t<=0)(r)||function(t,{x:e,y:i,radius:n,rotation:r,style:s,rad:a}){let o,l,h,d;switch(t.beginPath(),s){default:t.arc(e,i,n,0,B),t.closePath();break;case"triangle":t.moveTo(e+Math.sin(a)*n,i-Math.cos(a)*n),a+=q,t.lineTo(e+Math.sin(a)*n,i-Math.cos(a)*n),a+=q,t.lineTo(e+Math.sin(a)*n,i-Math.cos(a)*n),t.closePath();break;case"rectRounded":d=.516*n,h=n-d,o=Math.cos(a+U)*h,l=Math.sin(a+U)*h,t.arc(e-o,i-l,d,a-V,a-X),t.arc(e+l,i-o,d,a-X,a),t.arc(e+o,i+l,d,a,a+X),t.arc(e-l,i+o,d,a+X,a+V),t.closePath();break;case"rect":if(!r){h=Math.SQRT1_2*n,t.rect(e-h,i-h,2*h,2*h);break}a+=U;case"rectRot":o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+l,i-o),t.lineTo(e+o,i+l),t.lineTo(e-l,i+o),t.closePath();break;case"crossRot":a+=U;case"cross":o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+o,i+l),t.moveTo(e+l,i-o),t.lineTo(e-l,i+o);break;case"star":o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+o,i+l),t.moveTo(e+l,i-o),t.lineTo(e-l,i+o),a+=U,o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+o,i+l),t.moveTo(e+l,i-o),t.lineTo(e-l,i+o);break;case"line":o=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-o,i-l),t.lineTo(e+o,i+l);break;case"dash":t.moveTo(e,i),t.lineTo(e+Math.cos(a)*n,i+Math.sin(a)*n)}t.fill()}(t,{x:i,y:n,radius:r,rotation:o,style:a,rad:l})}var yo={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 vo(t,e,i){return e="number"==typeof e?e:t.parse(e),w(e)?t.getPixelForValue(e):i}function _o(t,e,i){let n=e[i];if(n||"scaleID"===i)return n;let r=i.charAt(0),s=Object.values(t).filter(t=>t.axis&&t.axis===r);return s.length?s[0].id:r}function wo(t,e){if(t){let i=t.options.reverse;return{start:vo(t,e.min,i?e.end:e.start),end:vo(t,e.max,i?e.start:e.end)}}}function Mo(t,e){let{chartArea:i,scales:n}=t,r=n[_o(n,e,"xScaleID")],s=n[_o(n,e,"yScaleID")],a=i.width/2,o=i.height/2;return r&&(a=vo(r,e.xValue,r.left+r.width/2)),s&&(o=vo(s,e.yValue,s.top+s.height/2)),{x:a,y:o}}function ko(t,e){let i=t.scales,n=i[_o(i,e,"xScaleID")],r=i[_o(i,e,"yScaleID")];if(!n&&!r)return{};let{left:s,right:a}=n||t.chartArea,{top:o,bottom:l}=r||t.chartArea,h=Do(n,{min:e.xMin,max:e.xMax,start:s,end:a});s=h.start,a=h.end;let d=Do(r,{min:e.yMin,max:e.yMax,start:l,end:o});return o=d.start,l=d.end,{x:s,y:o,x2:a,y2:l,width:a-s,height:l-o,centerX:s+(a-s)/2,centerY:o+(l-o)/2}}function So(t,e){if(!so(e)){let i=ko(t,e),n=e.radius;(!n||isNaN(n))&&(n=Math.min(i.width,i.height)/2,e.radius=n);let r=2*n,s=i.centerX+e.xAdjust,a=i.centerY+e.yAdjust;return{x:s-n,y:a-n,x2:s+n,y2:a+n,centerX:s,centerY:a,width:r,height:r,radius:n}}return function(t,e){let i=Mo(t,e),n=2*e.radius;return{x:i.x-e.radius+e.xAdjust,y:i.y-e.radius+e.yAdjust,x2:i.x+e.radius+e.xAdjust,y2:i.y+e.radius+e.yAdjust,centerX:i.x+e.xAdjust,centerY:i.y+e.yAdjust,radius:e.radius,width:n,height:n}}(t,e)}function Oo(t,e){let{scales:i,chartArea:n}=t,r=i[e.scaleID],s={x:n.left,y:n.top,x2:n.right,y2:n.bottom};return r?function(t,e,i){let n=vo(t,i.value,NaN),r=vo(t,i.endValue,n);t.isHorizontal()?(e.x=n,e.x2=r):(e.y=n,e.y2=r)}(r,s,e):function(t,e,i){for(let n of Object.keys(yo)){let r=t[_o(t,i,n)];if(r){let{min:t,max:s,start:a,end:o,startProp:l,endProp:h}=yo[n],d=wo(r,{min:i[t],max:i[s],start:r[a],end:r[o]});e[l]=d.start,e[h]=d.end}}}(i,s,e),s}function Po(t,e,i){let n=ko(t,e);return n.initProperties=ao(t,n,e,i),n.elements=[{type:"label",optionScope:"label",properties:Ao(t,n,e),initProperties:n.initProperties}],n}function Do(t,e){let i=wo(t,e)||e;return{start:Math.min(i.start,i.end),end:Math.max(i.start,i.end)}}function Co(t,e){let{start:i,end:n,borderWidth:r}=t,{position:s,padding:{start:a,end:o},adjust:l}=e;return i+r/2+l+io(n-r-i-a-o-e.size,s)}function Ao(t,e,i){let n=i.label;n.backgroundColor="transparent",n.callout.display=!1;let r=ro(n.position),s=Ee(n.padding),a=po(t.ctx,n),o=function({properties:t,options:e},i,n,r){let{x:s,x2:a,width:o}=t;return Co({start:s,end:a,borderWidth:e.borderWidth},{position:n.x,padding:{start:r.left,end:r.right},adjust:e.label.xAdjust,size:i.width})}({properties:e,options:i},a,r,s),l=function({properties:t,options:e},i,n,r){let{y:s,y2:a,height:o}=t;return Co({start:s,end:a,borderWidth:e.borderWidth},{position:n.y,padding:{start:r.top,end:r.bottom},adjust:e.label.yAdjust,size:i.height})}({properties:e,options:i},a,r,s),h=a.width+s.width,d=a.height+s.height;return{x:o,y:l,x2:o+h,y2:l+d,width:h,height:d,centerX:o+h/2,centerY:l+d/2,rotation:n.rotation}}function To(t,e,i){let n=Math.cos(i),r=Math.sin(i),s=e.x,a=e.y;return{x:s+n*(t.x-s)-r*(t.y-a),y:a+r*(t.x-s)+n*(t.y-a)}}var jo=["enter","leave"],Io=jo.concat("click");function Ro(t,e,i){if(t.listened)switch(e.type){case"mousemove":case"mouseout":return function(t,e,i){if(!t.moveListened)return;let n;n="mousemove"===e.type?$a(t,e,i.interaction):[];let r=t.hovered;t.hovered=n;let s={state:t,event:e},a=Eo(s,"leave",r,n);return Eo(s,"enter",n,r)||a}(t,e,i);case"click":return function(t,e,i){let n,r=t.listeners,s=$a(t,e,i.interaction);for(let t of s)n=Lo(t.options.click||r.click,t,e)||n;return n}(t,e,i)}}function Eo({state:t,event:e},i,n,r){let s;for(let a of n)r.indexOf(a)<0&&(s=Lo(a.options[i]||t.listeners[i],a,e)||s);return s}function Lo(t,e,i){return!0===O(t,[e.$context,i])}var zo=["afterDraw","beforeDraw"];function Fo(t,e,i){if(t.hooked){return O(e.options[i]||t.hooks[i],[e.$context])}}function Wo(t,e,i){let n=function(t,e,i){let n=e.axis,r=e.id,s=n+"ScaleID",a={min:k(e.min,Number.NEGATIVE_INFINITY),max:k(e.max,Number.POSITIVE_INFINITY)};for(let o of i)o.scaleID===r?Ho(o,e,["value","endValue"],a):_o(t,o,s)===r&&Ho(o,e,[n+"Min",n+"Max",n+"Value"],a);return a}(t.scales,e,i),r=No(e,n,"min","suggestedMin");r=No(e,n,"max","suggestedMax")||r,r&&W(e.handleTickRangeOptions)&&e.handleTickRangeOptions()}function No(t,e,i,n){if(w(e[i])&&!function(t,e,i){return F(t[e])||F(t[i])}(t.options,i,n)){let n=t[i]!==e[i];return t[i]=e[i],n}}function Vo(t,e){for(let i of["scaleID","xScaleID","yScaleID"]){let n=_o(e,t,i);n&&!e[n]&&Bo(t,i)&&console.warn(`No scale found with id '${n}' for annotation '${t.id}'`)}}function Bo(t,e){if("scaleID"===e)return!0;let i=e.charAt(0);for(let e of["Min","Max","Value"])if(F(t[i+e]))return!0;return!1}function Ho(t,e,i,n){for(let r of i){let i=t[r];if(F(i)){let t=e.parse(i);n.min=Math.min(n.min,t),n.max=Math.max(n.max,t)}}}var Yo=class extends fn{inRange(t,e,i,n){let{x:r,y:s}=To({x:t,y:e},this.getCenterPoint(n),et(-this.options.rotation));return Ja({x:r,y:s},this.getProps(["x","y","x2","y2"],n),i,this.options.borderWidth)}getCenterPoint(t){return Za(this,t)}draw(t){t.save(),uo(t,this.getCenterPoint(),this.options.rotation),xo(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Po(t,e)}};Yo.id="boxAnnotation",Yo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 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,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},Yo.defaultRoutes={borderColor:"color",backgroundColor:"color"},Yo.descriptors={label:{_fallback:!0}};var $o=["left","bottom","top","right"],Xo=class extends fn{inRange(t,e,i,n){let{x:r,y:s}=To({x:t,y:e},this.getCenterPoint(n),et(-this.rotation));return Ja({x:r,y:s},this.getProps(["x","y","x2","y2"],n),i,this.options.borderWidth)}getCenterPoint(t){return Za(this,t)}draw(t){let e=this.options,i=!F(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),uo(t,this.getCenterPoint(),this.rotation),function(t,e){let{pointX:i,pointY:n,options:r}=e,s=r.callout,a=s&&s.display&&function(t,e){let i=e.position;return $o.includes(i)?i:function(t,e){let{x:i,y:n,x2:r,y2:s,width:a,height:o,pointX:l,pointY:h,centerX:d,centerY:c,rotation:u}=t,f={x:d,y:c},g=e.start,p=no(a,g),x=no(o,g),m=[i,i+p,i+p,r],b=[n+x,s,n,s],y=[];for(let t=0;t<4;t++){let e=To({x:m[t],y:b[t]},f,et(u));y.push({position:$o[t],distance:st(e,{x:l,y:h})})}return y.sort((t,e)=>t.distance-e.distance)[0].position}(t,e)}(e,s);if(!a||function(t,e,i){let{pointX:n,pointY:r}=t,s=e.margin,a=n,o=r;return"left"===i?a+=s:"right"===i?a-=s:"top"===i?o+=s:"bottom"===i&&(o-=s),t.inRange(a,o)}(e,s,a))return;if(t.save(),t.beginPath(),!fo(t,s))return t.restore();let{separatorStart:o,separatorEnd:l}=function(t,e){let i,n,{x:r,y:s,x2:a,y2:o}=t,l=function(t,e){let{width:i,height:n,options:r}=t,s=r.callout.margin+r.borderWidth/2;return"right"===e?i+s:"bottom"===e?n+s:-s}(t,e);return"left"===e||"right"===e?(i={x:r+l,y:s},n={x:i.x,y:o}):(i={x:r,y:s+l},n={x:a,y:i.y}),{separatorStart:i,separatorEnd:n}}(e,a),{sideStart:h,sideEnd:d}=function(t,e,i){let n,r,{y:s,width:a,height:o,options:l}=t,h=l.callout.start,d=function(t,e){let i=e.side;return"left"===t||"top"===t?-i:i}(e,l.callout);return"left"===e||"right"===e?(n={x:i.x,y:s+no(o,h)},r={x:n.x+d,y:n.y}):(n={x:i.x+no(a,h),y:i.y},r={x:n.x,y:n.y+d}),{sideStart:n,sideEnd:r}}(e,a,o);(s.margin>0||0===r.borderWidth)&&(t.moveTo(o.x,o.y),t.lineTo(l.x,l.y)),t.moveTo(h.x,h.y),t.lineTo(d.x,d.y);let c=To({x:i,y:n},e.getCenterPoint(),et(-e.rotation));t.lineTo(c.x,c.y),t.stroke(),t.restore()}(t,this),xo(t,this,e),mo(t,function({x:t,y:e,width:i,height:n,options:r}){let s=r.borderWidth/2,a=Ee(r.padding);return{x:t+a.left+s,y:e+a.top+s,width:i-a.left-a.right-r.borderWidth,height:n-a.top-a.bottom-r.borderWidth}}(this),e),t.restore())}resolveElementProperties(t,e){let i;if(so(e))i=Mo(t,e);else{let{centerX:n,centerY:r}=ko(t,e);i={x:n,y:r}}let r=Ee(e.padding),s=function(t,e,i,n){let r=e.width+n.width+i.borderWidth,s=e.height+n.height+i.borderWidth,a=ro(i.position,"center"),o=Uo(t.x,r,i.xAdjust,a.x),l=Uo(t.y,s,i.yAdjust,a.y);return{x:o,y:l,x2:o+r,y2:l+s,width:r,height:s,centerX:o+r/2,centerY:l+s/2}}(i,po(t.ctx,e),e,r);return Object(n.k)(Object(n.j)({initProperties:ao(t,s,e),pointX:i.x,pointY:i.y},s),{rotation:e.rotation})}};function Uo(t,e,i=0,n){return t-io(e,n)+i}Xo.id="labelAnnotation",Xo.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,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},Xo.defaultRoutes={borderColor:"color"};var qo=(t,e,i)=>({x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}),Ko=(t,e,i)=>qo(e,i,Math.abs((t-e.y)/(i.y-e.y))).x,Go=(t,e,i)=>qo(e,i,Math.abs((t-e.x)/(i.x-e.x))).y,Jo=t=>t*t,Zo=(t,e,i,n)=>(1-n)*(1-n)*t+2*(1-n)*n*e+n*n*i,Qo=(t,e,i,n)=>({x:Zo(t.x,e.x,i.x,n),y:Zo(t.y,e.y,i.y,n)}),tl=(t,e,i,n)=>2*(1-n)*(e-t)+2*n*(i-e),el=(t,e,i,n)=>-Math.atan2(tl(t.x,e.x,i.x,n),tl(t.y,e.y,i.y,n))+.5*V,il=class extends fn{inRange(t,e,i,n){let r=this.options.borderWidth/2;if("x"!==i&&"y"!==i){let i={mouseX:t,mouseY:e},{path:s,ctx:a}=this;if(s){fo(a,this.options);let{chart:r}=this.$context,o=t*r.currentDevicePixelRatio,l=e*r.currentDevicePixelRatio,h=a.isPointInStroke(s,o,l)||sl(this,i,n);return a.restore(),h}return function(t,{mouseX:e,mouseY:i},n=qa,r){let s,a,{x:o,y:l,x2:h,y2:d}=t.getProps(["x","y","x2","y2"],r),c=h-o,u=d-l,f=Jo(c)+Jo(u),g=0===f?-1:((e-o)*c+(i-l)*u)/f;return g<0?(s=o,a=l):g>1?(s=h,a=d):(s=o+g*c,a=l+g*u),Jo(e-s)+Jo(i-a)<=n}(this,i,Jo(r),n)||sl(this,i,n)}return function(t,{mouseX:e,mouseY:i},n,{hBorderWidth:r,useFinalPosition:s}){let a=((t,e,{x:i,y:n,x2:r,y2:s},a)=>"y"===a?{start:Math.min(n,s),end:Math.max(n,s),value:e}:{start:Math.min(i,r),end:Math.max(i,r),value:t})(e,i,t.getProps(["x","y","x2","y2"],s),n);return a.value>=a.start-r&&a.value<=a.end+r||sl(t,{mouseX:e,mouseY:i},s,n)}(this,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:n})}getCenterPoint(t){return Za(this,t)}draw(t){let{x:e,y:i,x2:n,y2:r,cp:s,options:a}=this;if(t.save(),!fo(t,a))return t.restore();go(t,a);let o=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-i,2));if(a.curve&&s)return function(t,e,i,n){let{x:r,y:s,x2:a,y2:o,options:l}=e,{startOpts:h,endOpts:d,startAdjust:c,endAdjust:u}=ll(e),f={x:r,y:s},g={x:a,y:o},p=el(f,i,g,0),x=el(f,i,g,1)-V,m=Qo(f,i,g,c/n),b=Qo(f,i,g,1-u/n),y=new Path2D;t.beginPath(),y.moveTo(m.x,m.y),y.quadraticCurveTo(i.x,i.y,b.x,b.y),t.shadowColor=l.borderShadowColor,t.stroke(y),e.path=y,e.ctx=t,cl(t,m,{angle:p,adjust:c},h),cl(t,b,{angle:x,adjust:u},d)}(t,this,s,o),t.restore();let{startOpts:l,endOpts:h,startAdjust:d,endAdjust:c}=ll(this),u=Math.atan2(r-i,n-e);t.translate(e,i),t.rotate(u),t.beginPath(),t.moveTo(0+d,0),t.lineTo(o-c,0),t.shadowColor=a.borderShadowColor,t.stroke(),dl(t,0,d,l),dl(t,o,-c,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){let i=Oo(t,e),{x:n,y:r,x2:s,y2:a}=i,o=function({x:t,y:e,x2:i,y2:n},{top:r,right:s,bottom:a,left:o}){return!(t<o&&i<o||t>s&&i>s||e<r&&n<r||e>a&&n>a)}(i,t.chartArea),l=o?function(t,e,i){let{x:n,y:r}=rl(t,e,i),{x:s,y:a}=rl(e,t,i);return{x:n,y:r,x2:s,y2:a,width:Math.abs(s-n),height:Math.abs(a-r)}}({x:n,y:r},{x:s,y:a},t.chartArea):{x:n,y:r,x2:s,y2:a,width:Math.abs(s-n),height:Math.abs(a-r)};if(l.centerX=(s+n)/2,l.centerY=(a+r)/2,l.initProperties=ao(t,l,e),e.curve){let t={x:l.x,y:l.y},i={x:l.x2,y:l.y2};l.cp=function(t,e,i){let{x:n,y:r,x2:s,y2:a,centerX:o,centerY:l}=t,h=Math.atan2(a-r,s-n),d=ro(e.controlPoint,0);return To({x:o+no(i,d.x,!1),y:l+no(i,d.y,!1)},{x:o,y:l},h)}(l,e,st(t,i))}let h=function(t,e,i){let n=i.borderWidth,r=Ee(i.padding),s=po(t.ctx,i),a=s.width+r.width+n,o=s.height+r.height+n;return function(t,e,i,n){let{width:r,height:s,padding:a}=i,{xAdjust:o,yAdjust:l}=e,h={x:t.x,y:t.y},d={x:t.x2,y:t.y2},c="auto"===e.rotation?function(t){let{x:e,y:i,x2:n,y2:r}=t,s=Math.atan2(r-i,n-e);return s>V/2?s-V:s<V/-2?s+V:s}(t):et(e.rotation),u=function(t,e,i){let n=Math.cos(i),r=Math.sin(i);return{w:Math.abs(t*n)+Math.abs(e*r),h:Math.abs(t*r)+Math.abs(e*n)}}(r,s,c),f=function(t,e,i,n){let r,s=function(t,e){let{x:i,x2:n,y:r,y2:s}=t,a=Math.min(r,s)-e.top,o=Math.min(i,n)-e.left,l=e.bottom-Math.max(r,s),h=e.right-Math.max(i,n);return{x:Math.min(o,h),y:Math.min(a,l),dx:o<=h?1:-1,dy:a<=l?1:-1}}(t,n);return r="start"===e.position?al({w:t.x2-t.x,h:t.y2-t.y},i,e,s):"end"===e.position?1-al({w:t.x-t.x2,h:t.y-t.y2},i,e,s):io(1,e.position),r}(t,e,{labelSize:u,padding:a},n),g=t.cp?Qo(h,t.cp,d,f):qo(h,d,f),p={size:u.w,min:n.left,max:n.right,padding:a.left},x={size:u.h,min:n.top,max:n.bottom,padding:a.top},m=ol(g.x,p)+o,b=ol(g.y,x)+l;return{x:m-r/2,y:b-s/2,x2:m+r/2,y2:b+s/2,centerX:m,centerY:b,pointX:g.x,pointY:g.y,width:r,height:s,rotation:it(c)}}(e,i,{width:a,height:o,padding:r},t.chartArea)}(t,l,e.label);return h._visible=o,l.elements=[{type:"label",optionScope:"label",properties:h,initProperties:l.initProperties}],l}};il.id="lineAnnotation";var nl={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};function rl({x:t,y:e},i,{top:n,right:r,bottom:s,left:a}){return t<a&&(e=Go(a,{x:t,y:e},i),t=a),t>r&&(e=Go(r,{x:t,y:e},i),t=r),e<n&&(t=Ko(n,{x:t,y:e},i),e=n),e>s&&(t=Ko(s,{x:t,y:e},i),e=s),{x:t,y:e}}function sl(t,{mouseX:e,mouseY:i},n,r){let s=t.label;return s.options.display&&s.inRange(e,i,r,n)}function al(t,e,i,n){let{labelSize:r,padding:s}=e,a=t.w*n.dx,o=t.h*n.dy,l=a>0&&(r.w/2+s.left-n.x)/a,h=o>0&&(r.h/2+s.top-n.y)/o;return Ka(Math.max(l,h),0,.25)}function ol(t,e){let{size:i,min:n,max:r,padding:s}=e,a=i/2;return i>r-n?(r+n)/2:(n>=t-s-a&&(t=n+s+a),r<=t+s+a&&(t=r-s-a),t)}function ll(t){let e=t.options,i=e.arrowHeads&&e.arrowHeads.start,n=e.arrowHeads&&e.arrowHeads.end;return{startOpts:i,endOpts:n,startAdjust:hl(t,i),endAdjust:hl(t,n)}}function hl(t,e){if(!e||!e.display)return 0;let{length:i,width:n}=e,r=t.options.borderWidth/2,s={x:i,y:n+r};return Math.abs(Ko(0,s,{x:0,y:r}))}function dl(t,e,i,n){if(!n||!n.display)return;let{length:r,width:s,fill:a,backgroundColor:o,borderColor:l}=n,h=Math.abs(e-r)+i;t.beginPath(),go(t,n),fo(t,n),t.moveTo(h,-s),t.lineTo(e+i,0),t.lineTo(h,s),!0===a?(t.fillStyle=o||l,t.closePath(),t.fill(),t.shadowColor="transparent"):t.shadowColor=n.borderShadowColor,t.stroke()}function cl(t,{x:e,y:i},{angle:n,adjust:r},s){!s||!s.display||(t.save(),t.translate(e,i),t.rotate(n),dl(t,0,-r,s),t.restore())}il.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},nl),fill:!1,length:12,start:Object.assign({},nl),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 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({},Xo.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,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},il.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},il.defaultRoutes={borderColor:"color"};var ul=class extends fn{inRange(t,e,i,n){let r=this.options.rotation,s=this.options.borderWidth;if("x"!==i&&"y"!==i)return function(t,e,i,n){let{width:r,height:s,centerX:a,centerY:o}=e,l=r/2,h=s/2;if(l<=0||h<=0)return!1;let d=et(i||0),c=n/2||0,u=Math.cos(d),f=Math.sin(d),g=Math.pow(u*(t.x-a)+f*(t.y-o),2),p=Math.pow(f*(t.x-a)-u*(t.y-o),2);return g/Math.pow(l+c,2)+p/Math.pow(h+c,2)<=1.0001}({x:t,y:e},this.getProps(["width","height","centerX","centerY"],n),r,s);let{x:a,y:o,x2:l,y2:h}=this.getProps(["x","y","x2","y2"],n),d=s/2,c="y"===i?{start:o,end:h}:{start:a,end:l},u=To({x:t,y:e},this.getCenterPoint(n),et(-r));return u[i]>=c.start-d-qa&&u[i]<=c.end+d+qa}getCenterPoint(t){return Za(this,t)}draw(t){let{width:e,height:i,centerX:n,centerY:r,options:s}=this;t.save(),uo(t,this.getCenterPoint(),s.rotation),go(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;let a=fo(t,s);t.ellipse(n,r,i/2,e/2,V/2,0,2*V),t.fill(),a&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Po(t,e,!0)}};ul.id="ellipseAnnotation",ul.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},Yo.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},ul.defaultRoutes={borderColor:"color",backgroundColor:"color"},ul.descriptors={label:{_fallback:!0}};var fl=class extends fn{inRange(t,e,i,n){let{x:r,y:s,x2:a,y2:o,width:l}=this.getProps(["x","y","x2","y2","width"],n),h=this.options.borderWidth;if("x"!==i&&"y"!==i)return function(t,e,i,n){if(!t||!e||i<=0)return!1;let r=n/2;return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(i+r,2)}({x:t,y:e},this.getCenterPoint(n),l/2,h);let d=h/2,c="y"===i?{start:s,end:o,value:e}:{start:r,end:a,value:t};return c.value>=c.start-d&&c.value<=c.end+d}getCenterPoint(t){return Za(this,t)}draw(t){let e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,go(t,e);let n=fo(t,e);bo(t,this,this.centerX,this.centerY),n&&!co(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){let i=So(t,e);return i.initProperties=ao(t,i,e,!0),i}};fl.id="pointAnnotation",fl.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!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},fl.defaultRoutes={borderColor:"color",backgroundColor:"color"};var gl=class extends fn{inRange(t,e,i,n){if("x"!==i&&"y"!==i)return this.options.radius>=.1&&this.elements.length>1&&function(t,e,i,n){let r=!1,s=t[t.length-1].getProps(["bX","bY"],n);for(let a of t){let t=a.getProps(["bX","bY"],n);t.bY>i!=s.bY>i&&e<(s.bX-t.bX)*(i-t.bY)/(s.bY-t.bY)+t.bX&&(r=!r),s=t}return r}(this.elements,t,e,n);let r=To({x:t,y:e},this.getCenterPoint(n),et(-this.options.rotation)),s=this.elements.map(t=>"y"===i?t.bY:t.bX),a=Math.min(...s),o=Math.max(...s);return r[i]>=a&&r[i]<=o}getCenterPoint(t){return Za(this,t)}draw(t){let{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,go(t,i);let n=fo(t,i),r=!0;for(let i of e)r?(t.moveTo(i.x,i.y),r=!1):t.lineTo(i.x,i.y);t.closePath(),t.fill(),n&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){let i=So(t,e),{sides:n,rotation:r}=e,s=[],a=2*V/n,o=r*$;for(let r=0;r<n;r++,o+=a){let n=pl(i,e,o);n.initProperties=ao(t,i,e),s.push(n)}return i.elements=s,i}};function pl({centerX:t,centerY:e},{radius:i,borderWidth:n},r){let s=n/2,a=Math.sin(r),o=Math.cos(r),l={x:t+a*i,y:e-o*i};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:t+a*(i+s),bY:e-o*(i+s)}}}gl.id="polygonAnnotation",gl.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!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},gl.defaultRoutes={borderColor:"color",backgroundColor:"color"};var xl={box:Yo,ellipse:ul,label:Xo,line:il,point:fl,polygon:gl};Object.keys(xl).forEach(t=>{fe.describe("elements."+xl[t].id,{_fallback:"plugins.annotation.common"})});var ml={update:Object.assign},bl=Io.concat(zo),yl=(t,e)=>_(e)?Pl(t,e):t,vl=t=>"color"===t||"font"===t;function _l(t="line"){return xl[t]?t:(console.warn(`Unknown annotation type: '${t}', defaulting to 'line'`),"line")}function wl(t,e,i,n){let r=function(t,e,i){return"reset"===i||"none"===i||"resize"===i?ml:new Fi(t,e)}(t,i.animations,n),s=e.annotations,a=function(t,e){let i=e.length,n=t.length;if(n<i){let e=i-n;t.splice(n,0,...new Array(e))}else n>i&&t.splice(i,n-i);return t}(e.elements,s);for(let e=0;e<s.length;e++){let i=s[e],n=Sl(a,e,i.type),o=i.setContext(Dl(t,n,i)),l=n.resolveElementProperties(t,o);l.skip=Ml(l),"elements"in l&&(kl(n,l.elements,o,r),delete l.elements),F(n.x)||Object.assign(n,l),Object.assign(n,l.initProperties),l.options=Ol(o),r.update(n,l)}}function Ml(t){return isNaN(t.x)||isNaN(t.y)}function kl(t,e,i,n){let r=t.elements||(t.elements=[]);r.length=e.length;for(let t=0;t<e.length;t++){let s=e[t],a=s.properties,o=Sl(r,t,s.type,s.initProperties),l=i[s.optionScope].override(s);a.options=Ol(l),n.update(o,a)}}function Sl(t,e,i,n){let r=xl[_l(i)],s=t[e];return(!s||!(s instanceof r))&&(s=t[e]=new r,Object.assign(s,n)),s}function Ol(t){let e=xl[_l(t.type)],i={};i.id=t.id,i.type=t.type,i.drawTime=t.drawTime,Object.assign(i,Pl(t,e.defaults),Pl(t,e.defaultRoutes));for(let e of bl)i[e]=t[e];return i}function Pl(t,e){let i={};for(let n of Object.keys(e)){let r=e[n],s=t[n];vl(n)&&v(s)?i[n]=s.map(t=>yl(t,r)):i[n]=yl(s,r)}return i}function Dl(t,e,i){return e.$context||(e.$context=Object.assign(Object.create(t.getContext()),{element:e,id:i.id,type:"annotation"}))}var Cl=new Map,Al=Io.concat(zo),Tl={id:"annotation",version:"2.2.1",beforeRegister(){!function(t,e,i,n=!0){let r=i.split("."),s=0;for(let a of e.split(".")){let o=r[s++];if(parseInt(a,10)<parseInt(o,10))break;if(Ua(o,a)){if(n)throw new Error(`${t} v${i} is not supported. v${e} or newer is required.`);return!1}}}("chart.js","3.7",Er.version)},afterRegister(){Er.register(xl)},afterUnregister(){Er.unregister(xl)},beforeInit(t){Cl.set(t,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(t,e,i){let n=Cl.get(t).annotations=[],r=i.annotations;_(r)?Object.keys(r).forEach(t=>{let e=r[t];_(e)&&(e.id=t,n.push(e))}):v(r)&&n.push(...r),function(t,e){for(let i of t)Vo(i,e)}(n,t.scales)},afterDataLimits(t,e){let i=Cl.get(t);Wo(t,e.scale,i.annotations.filter(t=>t.display&&t.adjustScaleRange))},afterUpdate(t,e,i){let n=Cl.get(t);(function(t,e,i){e.listened=oo(i,Io,e.listeners),e.moveListened=!1,e._getElements=$a,jo.forEach(t=>{W(i[t])&&(e.moveListened=!0)}),(!e.listened||!e.moveListened)&&e.annotations.forEach(t=>{!e.listened&&W(t.click)&&(e.listened=!0),e.moveListened||jo.forEach(i=>{W(t[i])&&(e.listened=!0,e.moveListened=!0)})})})(0,n,i),wl(t,n,i,e.mode),n.visibleElements=n.elements.filter(t=>!t.skip&&t.options.display),function(t,e,i){let n=e.visibleElements;e.hooked=oo(i,zo,e.hooks),e.hooked||n.forEach(t=>{e.hooked||zo.forEach(i=>{W(t.options[i])&&(e.hooked=!0)})})}(0,n,i)},beforeDatasetsDraw(t,e,i){jl(t,"beforeDatasetsDraw",i.clip)},afterDatasetsDraw(t,e,i){jl(t,"afterDatasetsDraw",i.clip)},beforeDraw(t,e,i){jl(t,"beforeDraw",i.clip)},afterDraw(t,e,i){jl(t,"afterDraw",i.clip)},beforeEvent(t,e,i){Ro(Cl.get(t),e.event,i)&&(e.changed=!0)},afterDestroy(t){Cl.delete(t)},_getState:t=>Cl.get(t),defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:t=>!Al.includes(t)&&"init"!==t,annotations:{_allKeys:!1,_fallback:(t,e)=>"elements."+xl[_l(e.type)].id},interaction:{_fallback:!0},common:{label:{_indexable:vl,_fallback:!0},_indexable:vl}},additionalOptionScopes:[""]};function jl(t,e,i){let{ctx:n,chartArea:r}=t,s=Cl.get(t);i&&_e(n,r);let a=function(t,e){let i=[];for(let n of t)if(n.options.drawTime===e&&i.push({element:n,main:!0}),n.elements&&n.elements.length)for(let t of n.elements)t.options.display&&t.options.drawTime===e&&i.push({element:t});return i}(s.visibleElements,e).sort((t,e)=>t.element.options.z-e.element.options.z);for(let t of a)Il(n,r,s,t);i&&we(n)}function Il(t,e,i,n){let r=n.element;n.main?(Fo(i,r,"beforeDraw"),r.draw(t,e),Fo(i,r,"afterDraw")):r.draw(t,e)}var Rl=Er.version,El=Rl?(t,e)=>t.parse(e):(t,e)=>e;var Ll=t=>t&&t.right>t.left&&t.bottom>t.top;function zl(t,e,i){return"r"===e?t.createRadialGradient(i.xCenter,i.yCenter,0,i.xCenter,i.yCenter,i.drawingArea):"y"===e?t.createLinearGradient(0,i.bottom,0,i.top):t.createLinearGradient(i.left,0,i.right,0)}function Fl(t,e){e.forEach((function(e){t.addColorStop(e.stop,e.color.rgbString())}))}function Wl(t,e,i){if(t.options.has(e.key)){let n=t.options.get(e.key).filter(t=>t.datasetIndex===i);if(n.length)return n[0]}}function Nl(t,e){if("radialLinear"===t.type){let i=t.getDistanceFromCenterForValue(e);return{pixel:i,stop:i/t.drawingArea}}let i=t.options.reverse,n=function(t,e){let i=Z(e)?parseFloat(e):El(t,e);return t.getPixelForValue(i)}(t,e),r=t.getDecimalForPixel(n);return{pixel:n,stop:i?1-r:r}}var Vl=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Bl=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Hl(t,e,i,n){let r=Wl(t,e,i);if(!r||!r.stopColors.length)return;let s,a,{stop:o}=Nl(r.scale,n);for(let t of r.stopColors){if(t.stop===o)return t.color;t.stop<o?s=t:t.stop>o&&!a&&(a=t)}return a?function(t,e,i){let n=e.color.rgb,r=Bl(n.r/255),s=Bl(n.g/255),a=Bl(n.b/255),o=i.color.rgb,l=Bl(o.r/255),h=Bl(o.g/255),d=Bl(o.b/255);return oe({r:Math.round(255*Vl(r+t*(l-r))),g:Math.round(255*Vl(s+t*(h-s))),b:Math.round(255*Vl(a+t*(d-a))),a:n.a+t*Math.abs(o.a-n.a)})}(o,s,a):s}var Yl=[{key:"backgroundColor",legendItemKey:"fillStyle"},{key:"borderColor",legendItemKey:"strokeStyle"}];function $l(t,e,i,n){let r=function(t,{boxWidth:e,boxHeight:i}){return{top:t.top,left:t.left,bottom:t.top+i,right:t.left+e,xCenter:t.left+e/2,yCenter:t.top+i/2,drawingArea:Math.max(e,i)/2}}(t.legend.legendHitBoxes[i.datasetIndex],n);Ll(r)&&Yl.forEach((function(n){!function(t,e,i,n,r){let s=Wl(t,i,n.datasetIndex);if(!s||!s.stopColors.length)return;let a=zl(e,s.axis,r);Fl(a,s.stopColors),n[i.legendItemKey]=a}(e,t.ctx,n,i,r)}))}function Xl(t,e,i,n){for(let r of t.legend.legendItems)Yl.forEach((function(t){let s=i.data[r.index],a=Hl(e,t,n,s);a&&a.valid&&(r[t.legendItemKey]=a.rgbString())}))}function Ul(t,e){let i=t.legend,n=i.options,r=n.labels.boxHeight?n.labels.boxHeight:((t,e)=>e.labels&&e.labels.font&&F(e.labels.font.size)?e.labels.font.size:t.options.font.size)(t,n),s=n.labels.boxWidth,a=t.data.datasets;for(let n=0;n<a.length;n++){let o=i.legendItems[n];o.datasetIndex===n?$l(t,e,o,{boxWidth:s,boxHeight:r}):Xl(t,e,a[n],n)}}var ql=new Map,Kl=Rl?(t,e)=>t[e+"Scale"]:(t,e)=>t.controller["_"+e+"Scale"];function Gl(t,e,i){for(let n of Object.keys(e)){let{pixel:r,stop:s}=Nl(t,n);if(isFinite(r)&&isFinite(s)){let t=oe(e[n]);t&&t.valid&&i.push({stop:Math.max(0,Math.min(1,s)),color:t})}}i.sort((t,e)=>t.stop-e.stop)}function Jl(t,e,i,n){e[i]=n,t.dataset&&(t.dataset.options?t.dataset.options[i]=n:t.dataset[i]=n)}function Zl(t,e,i,n){let r=t.options.get(i);return r?e.hidden||(r=r.filter(t=>t.datasetIndex!==n),t.options.set(i,r)):(r=[],t.options.set(i,r)),r}function Ql(t,e,i,n,r){let s=t.ctx,a=t.getDatasetMeta(r);if(!a.hidden)for(let[o,l]of Object.entries(i)){let{axis:i,colors:h}=l;if(!h)continue;let d=Kl(a,i);if(!d){console.warn(`Scale not found for '${i}'-axis in datasets[${r}] of chart id ${t.id}, skipping.`);continue}let c={datasetIndex:r,axis:i,scale:d,stopColors:[]};Zl(e,a,o,r).push(c);let u=zl(s,i,d);Gl(d,h,c.stopColors),c.stopColors.length&&(Fl(u,c.stopColors),Jl(a,n,o,u))}}var th=[Hs,Us,as,Ds,Vs,Os,Ha,Qr,Jr,Ms,Br,Tl,{id:"gradient",beforeInit(t){let e={};e.options=new Map,ql.set(t,e)},beforeDatasetsUpdate(t){let e=t.chartArea;if(!Ll(e))return;let i=ql.get(t),n=t.data.datasets;for(let e=0;e<n.length;e++){let r=n[e],s=r.gradient;s&&Ql(t,i,s,r,e)}},afterUpdate(t){let e=ql.get(t);t.legend&&!1!==t.legend.options.display&&Rl&&Ul(t,e)},destroy(t){ql.delete(t)}}];Er.register(...th);var eh="label";function ih(t,e){"function"==typeof t?t(e):t&&(t.current=e)}function nh(t,e){t.labels=e}function rh(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eh,r=[];t.datasets=e.map(e=>{let s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!r.includes(s)?(r.push(s),Object.assign(s,e),s):Object(n.j)({},e)})}function sh(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eh,i={labels:[],datasets:[]};return nh(i,t.labels),rh(i,t.datasets,e),i}var ah=Object(r.forwardRef)((function(t,e){let i=t,{height:a=150,width:o=300,redraw:l=!1,datasetIdKey:h,type:d,data:c,options:u,plugins:f=[],fallbackContent:g,updateMode:p}=i,x=Object(n.l)(i,["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"]),m=Object(r.useRef)(null),b=Object(r.useRef)(),y=()=>{m.current&&(b.current=new Er(m.current,{type:d,data:sh(c,h),options:u&&Object(n.j)({},u),plugins:f}),ih(e,b.current))},v=()=>{ih(e,null),b.current&&(b.current.destroy(),b.current=null)};return Object(r.useEffect)(()=>{!l&&b.current&&u&&function(t,e){Object.assign(t.options,e)}(b.current,u)},[l,u]),Object(r.useEffect)(()=>{!l&&b.current&&nh(b.current.config.data,c.labels)},[l,c.labels]),Object(r.useEffect)(()=>{!l&&b.current&&c.datasets&&rh(b.current.config.data,c.datasets,h)},[l,c.datasets]),Object(r.useEffect)(()=>{b.current&&(l?(v(),setTimeout(y)):b.current.update(p))},[l,u,c.labels,c.datasets,p]),Object(r.useEffect)(()=>{b.current&&(v(),setTimeout(y))},[d]),Object(r.useEffect)(()=>(y(),()=>v()),[]),s.a.createElement("canvas",Object.assign({ref:m,role:"img",height:a,width:o},x),g)}));var oh,lh,hh=(oh="bar",lh=an,Er.register(lh),Object(r.forwardRef)((t,e)=>s.a.createElement(ah,Object.assign({},t,{ref:e,type:oh})))),dh={id:"redrawBeforeFirstDrawPlugin",beforeDraw(t){t.$rendered||(t.$rendered=!0,t.update("none"))}},ch=(t,e=1)=>`${t}${Math.round(255*e).toString(16).padStart(2,"0")}`,uh=t=>t.palette.text.secondary,fh=t=>t.palette.outlinedBorder,gh=t=>({family:t.typography.fontFamily,size:parseInt(t.typography.body.fontSize)});function ph(t){let e=["#4caf50","#2196f3","#ff5722","#ff9800","#e91e63","#3f51b5","#00bcd4","#81c784","#64b5f6","#ff8a65","#ffb74d","#f06292","#7986cb","#4dd0e1","#a5d6a7","#90caf9","#ffab91","#ffcc80","#f48fb1","#9fa8da","#80deea"];return e[t%e.length]}function xh(t,e,i,r){let s=function(t){let e=[],i=new Date;switch(t){case a.j.LastDay:{let t=new Date(i);t.setHours(t.getHours()-23),t.setMinutes(0,0,0);for(let i=0;i<24;i++){let n=new Date(t);n.setHours(n.getHours()+i),e.push(n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}))}break}case a.j.LastWeek:for(let t=6;t>=0;t--){let n=new Date(i);n.setDate(n.getDate()-t),e.push(n.toLocaleDateString("en-US",{month:"short",day:"2-digit"}))}break;case a.j.LastYear:for(let t=11;t>=0;t--){let n=new Date(i);n.setMonth(n.getMonth()-t),e.push(n.toLocaleDateString("en-US",{month:"short",year:"2-digit"}))}break;case a.j.LastMonth:default:for(let t=29;t>=0;t--){let n=new Date(i);n.setDate(n.getDate()-t),e.push(n.toLocaleDateString("en-US",{month:"short",day:"2-digit"}))}}return e}(r);if(!t||!t.series||0===t.series.length)return{data:null,options:null};let o=t.series.map((t,e)=>{let i=t.featureName,n=new Map;t.points.forEach(t=>{let e=function(t,e){let i=new Date(t);switch(i.setMinutes(0,0,0),e){case a.j.LastDay:return i.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});case a.j.LastYear:return t.toLocaleDateString("en-US",{month:"short",year:"2-digit"});case a.j.LastWeek:case a.j.LastMonth:default:return t.toLocaleDateString("en-US",{month:"short",day:"2-digit"})}}(new Date(t.timestamp),r),i=n.get(e)||0;n.set(e,i+t.value)});let o=s.map(t=>n.get(t)||0),l=ph(e);return{label:i,data:o,backgroundColor:ch(l,.8),borderColor:l,borderWidth:1}}).reverse();return{data:{labels:s,datasets:o},options:function(t,e){return{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"point",intersect:!0},elements:{bar:{borderRadius:4,borderSkipped:"bottom"}},plugins:{legend:{display:!1},tooltip:{enabled:!1,external:e},datalabels:{display:!1}},scales:{x:{type:"category",stacked:!0,ticks:{color:uh(t),font:gh(t),maxRotation:45,maxTicksLimit:15},grid:{color:fh(t),drawOnChartArea:!1,drawTicks:!1}},y:{type:"linear",stacked:!0,beginAtZero:!0,ticks:{color:uh(t),font:gh(t),callback:t=>Object(n.t)(Number(t))},grid:{color:ch(fh(t),.5),drawOnChartArea:!0,drawTicks:!1,borderDash:[5,5]}}}}}(e,i)}}function mh(t,e){let i=e.dataPoints[0],n=i.parsed.y,r=t.scales.y,s=n/r.max*(r.bottom-r.top),a=e.caretY+s/2,o=t.getDatasetMeta(i.datasetIndex).data[i.dataIndex],l=o.x-o.width/2;return{top:t.canvas.offsetTop+a,left:t.canvas.offsetLeft+l}}function bh(t,e){return{top:t.canvas.offsetTop+e.caretY,left:t.canvas.offsetLeft+e.caretX}}var yh=Object(n.n)(h.a)`
2
2
  position: absolute;
3
3
  `,vh=n.n.div`
4
4
  position: absolute;
@@ -78,7 +78,7 @@
78
78
  justify-content: center;
79
79
  align-items: center;
80
80
  height: 100%;
81
- `;function Lh(){return Object(u.jsx)(Eh,{className:"stigg-credit-usage-chart-error-state",children:Object(u.jsx)(n.o,{variant:"body1",color:"error",children:"Failed to load credit usage"})})}var zh=[{value:a.h.LastDay,label:"Last 24 Hours"},{value:a.h.LastWeek,label:"Last 7 Days"},{value:a.h.LastMonth,label:"Last 30 Days"},{value:a.h.LastYear,label:"Last 12 Months"}],Fh=Object(n.n)(x.a)`
81
+ `;function Lh(){return Object(u.jsx)(Eh,{className:"stigg-credit-usage-chart-error-state",children:Object(u.jsx)(n.o,{variant:"body1",color:"error",children:"Failed to load credit usage"})})}var zh=[{value:a.j.LastDay,label:"Last 24 Hours"},{value:a.j.LastWeek,label:"Last 7 Days"},{value:a.j.LastMonth,label:"Last 30 Days"},{value:a.j.LastYear,label:"Last 12 Months"}],Fh=Object(n.n)(x.a)`
82
82
  border-radius: 10px;
83
83
  height: 38px;
84
84
  min-width: 150px;