(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0f00ac"],{"9b4a":function(t,e,i){"use strict";i.r(e),i.d(e,"defaults",(function(){return ae})),i.d(e,"Animation",(function(){return on})),i.d(e,"Animations",(function(){return ln})),i.d(e,"ArcElement",(function(){return lr})),i.d(e,"BarController",(function(){return Vn})),i.d(e,"BarElement",(function(){return zr})),i.d(e,"BasePlatform",(function(){return ko})),i.d(e,"BasicPlatform",(function(){return So})),i.d(e,"BubbleController",(function(){return Bn})),i.d(e,"CategoryScale",(function(){return Ua})),i.d(e,"Chart",(function(){return Gs})),i.d(e,"DatasetController",(function(){return On})),i.d(e,"Decimation",(function(){return jr})),i.d(e,"DomPlatform",(function(){return $o})),i.d(e,"DoughnutController",(function(){return Hn})),i.d(e,"Element",(function(){return Yo})),i.d(e,"Filler",(function(){return pa})),i.d(e,"Interaction",(function(){return ao})),i.d(e,"Legend",(function(){return ya})),i.d(e,"LineController",(function(){return Nn})),i.d(e,"LineElement",(function(){return vr})),i.d(e,"LinearScale",(function(){return Za})),i.d(e,"LogarithmicScale",(function(){return Qa})),i.d(e,"PieController",(function(){return Un})),i.d(e,"PointElement",(function(){return Mr})),i.d(e,"PolarAreaController",(function(){return Yn})),i.d(e,"RadarController",(function(){return Xn})),i.d(e,"RadialLinearScale",(function(){return hl})),i.d(e,"Scale",(function(){return fs})),i.d(e,"ScatterController",(function(){return qn})),i.d(e,"Ticks",(function(){return qo})),i.d(e,"TimeScale",(function(){return vl})),i.d(e,"TimeSeriesScale",(function(){return Ml})),i.d(e,"Title",(function(){return Ma})),i.d(e,"Tooltip",(function(){return Ha})),i.d(e,"_adapters",(function(){return Jn})),i.d(e,"animator",(function(){return tn})),i.d(e,"controllers",(function(){return Kn})),i.d(e,"elements",(function(){return Fr})),i.d(e,"layouts",(function(){return Mo})),i.d(e,"plugins",(function(){return Na})),i.d(e,"registerables",(function(){return Sl})),i.d(e,"registry",(function(){return _s})),i.d(e,"scales",(function(){return kl}));const n=function(){return"undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame}();function o(t,e,i){const o=i||(t=>Array.prototype.slice.call(t));let s=!1,r=[];return function(...i){r=o(i),s||(s=!0,n.call(window,()=>{s=!1,t.apply(e,r)}))}}function s(t,e){let i;return function(){return e?(clearTimeout(i),i=setTimeout(t,e)):t(),e}}const r=t=>"start"===t?"left":"end"===t?"right":"center",a=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,l=(t,e,i)=>"right"===t?i:"center"===t?(e+i)/2:e;function c(){}const h=function(){let t=0;return function(){return t++}}();function d(t){return null===t||"undefined"===typeof t}function u(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function f(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const g=t=>("number"===typeof t||t instanceof Number)&&isFinite(+t);function p(t,e){return g(t)?t:e}function m(t,e){return"undefined"===typeof t?e:t}const x=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,b=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function _(t,e,i){if(t&&"function"===typeof t.call)return t.apply(i,e)}function y(t,e,i,n){let o,s,r;if(u(t))if(s=t.length,n)for(o=s-1;o>=0;o--)e.call(i,t[o],o);else for(o=0;o<s;o++)e.call(i,t[o],o);else if(f(t))for(r=Object.keys(t),s=r.length,o=0;o<s;o++)e.call(i,t[r[o]],r[o])}function v(t,e){let i,n,o,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(o=t[i],s=e[i],o.datasetIndex!==s.datasetIndex||o.index!==s.index)return!1;return!0}function w(t){if(u(t))return t.map(w);if(f(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let o=0;for(;o<n;++o)e[i[o]]=w(t[i[o]]);return e}return t}function M(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function k(t,e,i,n){if(!M(t))return;const o=e[t],s=i[t];f(o)&&f(s)?S(o,s,n):e[t]=w(s)}function S(t,e,i){const n=u(e)?e:[e],o=n.length;if(!f(t))return t;i=i||{};const s=i.merger||k;for(let r=0;r<o;++r){if(e=n[r],!f(e))continue;const o=Object.keys(e);for(let n=0,r=o.length;n<r;++n)s(o[n],t,e,i)}return t}function P(t,e){return S(t,e,{merger:D})}function D(t,e,i){if(!M(t))return;const n=e[t],o=i[t];f(n)&&f(o)?P(n,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=w(o))}const C="",O=".";function A(t,e){const i=t.indexOf(O,e);return-1===i?t.length:i}function T(t,e){if(e===C)return t;let i=0,n=A(e,i);while(t&&n>i)t=t[e.substr(i,n-i)],i=n+1,n=A(e,i);return t}function L(t){return t.charAt(0).toUpperCase()+t.slice(1)}const R=t=>"undefined"!==typeof t,E=t=>"function"===typeof t,I=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},z=Math.PI,F=2*z,V=F+z,B=Number.POSITIVE_INFINITY,W=z/180,H=z/2,N=z/4,j=2*z/3,$=Math.log10,Y=Math.sign;function U(t){const e=Math.pow(10,Math.floor($(t))),i=t/e,n=i<=1?1:i<=2?2:i<=5?5:10;return n*e}function X(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n===0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function K(t,e,i){return Math.abs(t-e)<i}function Z(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function G(t,e,i){let n,o,s;for(n=0,o=t.length;n<o;n++)s=t[n][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function J(t){return t*(z/180)}function Q(t){return t*(180/z)}function tt(t){if(!g(t))return;let e=1,i=0;while(Math.round(t*e)/e!==t)e*=10,i++;return i}function et(t,e){const i=e.x-t.x,n=e.y-t.y,o=Math.sqrt(i*i+n*n);let s=Math.atan2(n,i);return s<-.5*z&&(s+=F),{angle:s,distance:o}}function it(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function nt(t,e){return(t-e+V)%F-z}function ot(t){return(t%F+F)%F}function st(t,e,i,n){const o=ot(t),s=ot(e),r=ot(i),a=ot(s-o),l=ot(r-o),c=ot(o-s),h=ot(o-r);return o===s||o===r||n&&s===r||a>l&&c<h}function rt(t,e,i){return Math.max(e,Math.min(i,t))}function at(t){return rt(t,-32768,32767)}const lt=t=>0===t||1===t,ct=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*F/i),ht=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*F/i)+1,dt={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*H),easeOutSine:t=>Math.sin(t*H),easeInOutSine:t=>-.5*(Math.cos(z*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=>lt(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=>lt(t)?t:ct(t,.075,.3),easeOutElastic:t=>lt(t)?t:ht(t,.075,.3),easeInOutElastic(t){const e=.1125,i=.45;return lt(t)?t:t<.5?.5*ct(2*t,e,i):.5+.5*ht(2*t-1,e,i)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+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-dt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*dt.easeInBounce(2*t):.5*dt.easeOutBounce(2*t-1)+.5},ut={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},ft="0123456789ABCDEF",gt=t=>ft[15&t],pt=t=>ft[(240&t)>>4]+ft[15&t],mt=t=>(240&t)>>4===(15&t);function xt(t){return mt(t.r)&&mt(t.g)&&mt(t.b)&&mt(t.a)}function bt(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*ut[t[1]],g:255&17*ut[t[2]],b:255&17*ut[t[3]],a:5===i?17*ut[t[4]]:255}:7!==i&&9!==i||(e={r:ut[t[1]]<<4|ut[t[2]],g:ut[t[3]]<<4|ut[t[4]],b:ut[t[5]]<<4|ut[t[6]],a:9===i?ut[t[7]]<<4|ut[t[8]]:255})),e}function _t(t){var e=xt(t)?gt:pt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function yt(t){return t+.5|0}const vt=(t,e,i)=>Math.max(Math.min(t,i),e);function wt(t){return vt(yt(2.55*t),0,255)}function Mt(t){return vt(yt(255*t),0,255)}function kt(t){return vt(yt(t/2.55)/100,0,1)}function St(t){return vt(yt(100*t),0,100)}const Pt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Dt(t){const e=Pt.exec(t);let i,n,o,s=255;if(e){if(e[7]!==i){const t=+e[7];s=255&(e[8]?wt(t):255*t)}return i=+e[1],n=+e[3],o=+e[5],i=255&(e[2]?wt(i):i),n=255&(e[4]?wt(n):n),o=255&(e[6]?wt(o):o),{r:i,g:n,b:o,a:s}}}function Ct(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${kt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Ot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function At(t,e,i){const n=e*Math.min(i,1-i),o=(e,o=(e+t/30)%12)=>i-n*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}function Tt(t,e,i){const n=(n,o=(n+t/60)%6)=>i-i*e*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Lt(t,e,i){const n=At(t,1,.5);let o;for(e+i>1&&(o=1/(e+i),e*=o,i*=o),o=0;o<3;o++)n[o]*=1-e-i,n[o]+=e;return n}function Rt(t){const e=255,i=t.r/e,n=t.g/e,o=t.b/e,s=Math.max(i,n,o),r=Math.min(i,n,o),a=(s+r)/2;let l,c,h;return s!==r&&(h=s-r,c=a>.5?h/(2-s-r):h/(s+r),l=s===i?(n-o)/h+(n<o?6:0):s===n?(o-i)/h+2:(i-n)/h+4,l=60*l+.5),[0|l,c||0,a]}function Et(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(Mt)}function It(t,e,i){return Et(At,t,e,i)}function zt(t,e,i){return Et(Lt,t,e,i)}function Ft(t,e,i){return Et(Tt,t,e,i)}function Vt(t){return(t%360+360)%360}function Bt(t){const e=Ot.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?wt(+e[5]):Mt(+e[5]));const o=Vt(+e[2]),s=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?zt(o,s,r):"hsv"===e[1]?Ft(o,s,r):It(o,s,r),{r:i[0],g:i[1],b:i[2],a:n}}function Wt(t,e){var i=Rt(t);i[0]=Vt(i[0]+e),i=It(i),t.r=i[0],t.g=i[1],t.b=i[2]}function Ht(t){if(!t)return;const e=Rt(t),i=e[0],n=St(e[1]),o=St(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${o}%, ${kt(t.a)})`:`hsl(${i}, ${n}%, ${o}%)`}const Nt={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"},jt={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 $t(){const t={},e=Object.keys(jt),i=Object.keys(Nt);let n,o,s,r,a;for(n=0;n<e.length;n++){for(r=a=e[n],o=0;o<i.length;o++)s=i[o],a=a.replace(s,Nt[s]);s=parseInt(jt[r],16),t[a]=[s>>16&255,s>>8&255,255&s]}return t}let Yt;function Ut(t){Yt||(Yt=$t(),Yt.transparent=[0,0,0,0]);const e=Yt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function Xt(t,e,i){if(t){let n=Rt(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=It(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function qt(t,e){return t?Object.assign(e||{},t):t}function Kt(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=Mt(t[3]))):(e=qt(t,{r:0,g:0,b:0,a:1}),e.a=Mt(e.a)),e}function Zt(t){return"r"===t.charAt(0)?Dt(t):Bt(t)}class Gt{constructor(t){if(t instanceof Gt)return t;const e=typeof t;let i;"object"===e?i=Kt(t):"string"===e&&(i=bt(t)||Ut(t)||Zt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=qt(this._rgb);return t&&(t.a=kt(t.a)),t}set rgb(t){this._rgb=Kt(t)}rgbString(){return this._valid?Ct(this._rgb):this._rgb}hexString(){return this._valid?_t(this._rgb):this._rgb}hslString(){return this._valid?Ht(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,o=t.rgb;let s;const r=e===s?.5:e,a=2*r-1,l=n.a-o.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-c,n.r=255&c*n.r+s*o.r+.5,n.g=255&c*n.g+s*o.g+.5,n.b=255&c*n.b+s*o.b+.5,n.a=r*n.a+(1-r)*o.a,i.rgb=n}return i}clone(){return new Gt(this.rgb)}alpha(t){return this._rgb.a=Mt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=yt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Xt(this._rgb,2,t),this}darken(t){return Xt(this._rgb,2,-t),this}saturate(t){return Xt(this._rgb,1,t),this}desaturate(t){return Xt(this._rgb,1,-t),this}rotate(t){return Wt(this._rgb,t),this}}function Jt(t){return new Gt(t)}const Qt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function te(t){return Qt(t)?t:Jt(t)}function ee(t){return Qt(t)?t:Jt(t).saturate(.5).darken(.1).hexString()}const ie=Object.create(null),ne=Object.create(null);function oe(t,e){if(!e)return t;const i=e.split(".");for(let n=0,o=i.length;n<o;++n){const e=i[n];t=t[e]||(t[e]=Object.create(null))}return t}function se(t,e,i){return"string"===typeof e?S(oe(t,e),i):S(oe(t,""),e)}class re{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)=>ee(e.backgroundColor),this.hoverBorderColor=(t,e)=>ee(e.borderColor),this.hoverColor=(t,e)=>ee(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},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.describe(t)}set(t,e){return se(this,t,e)}get(t){return oe(this,t)}describe(t,e){return se(ne,t,e)}override(t,e){return se(ie,t,e)}route(t,e,i,n){const o=oe(this,t),s=oe(this,i),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=s[n];return f(t)?Object.assign({},e,t):m(t,e)},set(t){this[r]=t}}})}}var ae=new re({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function le(t){return!t||d(t.size)||d(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function ce(t,e,i,n,o){let s=e[o];return s||(s=e[o]=t.measureText(o).width,i.push(o)),s>n&&(n=s),n}function he(t,e,i,n){n=n||{};let o=n.data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(o=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,f;for(l=0;l<a;l++)if(d=i[l],void 0!==d&&null!==d&&!0!==u(d))r=ce(t,o,s,r,d);else if(u(d))for(c=0,h=d.length;c<h;c++)f=d[c],void 0===f||null===f||u(f)||(r=ce(t,o,s,r,f));t.restore();const g=s.length/2;if(g>i.length){for(l=0;l<g;l++)delete o[s[l]];s.splice(0,g)}return r}function de(t,e,i){const n=t.currentDevicePixelRatio,o=0!==i?Math.max(i/2,.5):0;return Math.round((e-o)*n)/n+o}function ue(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function fe(t,e,i,n){let o,s,r,a,l;const c=e.pointStyle,h=e.rotation,d=e.radius;let u=(h||0)*W;if(c&&"object"===typeof c&&(o=c.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,n),t.rotate(u),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),c){default:t.arc(i,n,d,0,F),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(u)*d,n-Math.cos(u)*d),u+=j,t.lineTo(i+Math.sin(u)*d,n-Math.cos(u)*d),u+=j,t.lineTo(i+Math.sin(u)*d,n-Math.cos(u)*d),t.closePath();break;case"rectRounded":l=.516*d,a=d-l,s=Math.cos(u+N)*a,r=Math.sin(u+N)*a,t.arc(i-s,n-r,l,u-z,u-H),t.arc(i+r,n-s,l,u-H,u),t.arc(i+s,n+r,l,u,u+H),t.arc(i-r,n+s,l,u+H,u+z),t.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*d,t.rect(i-a,n-a,2*a,2*a);break}u+=N;case"rectRot":s=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-s,n-r),t.lineTo(i+r,n-s),t.lineTo(i+s,n+r),t.lineTo(i-r,n+s),t.closePath();break;case"crossRot":u+=N;case"cross":s=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-s,n-r),t.lineTo(i+s,n+r),t.moveTo(i+r,n-s),t.lineTo(i-r,n+s);break;case"star":s=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-s,n-r),t.lineTo(i+s,n+r),t.moveTo(i+r,n-s),t.lineTo(i-r,n+s),u+=N,s=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-s,n-r),t.lineTo(i+s,n+r),t.moveTo(i+r,n-s),t.lineTo(i-r,n+s);break;case"line":s=Math.cos(u)*d,r=Math.sin(u)*d,t.moveTo(i-s,n-r),t.lineTo(i+s,n+r);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(u)*d,n+Math.sin(u)*d);break}t.fill(),e.borderWidth>0&&t.stroke()}}function ge(t,e,i){return i=i||.5,t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function pe(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function me(t){t.restore()}function xe(t,e,i,n,o){if(!e)return t.lineTo(i.x,i.y);if("middle"===o){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===o!==!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function be(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 _e(t,e,i,n,o,s={}){const r=u(e)?e:[e],a=s.strokeWidth>0&&""!==s.strokeColor;let l,c;for(t.save(),s.translation&&t.translate(s.translation[0],s.translation[1]),d(s.rotation)||t.rotate(s.rotation),t.font=o.string,s.color&&(t.fillStyle=s.color),s.textAlign&&(t.textAlign=s.textAlign),s.textBaseline&&(t.textBaseline=s.textBaseline),l=0;l<r.length;++l){if(c=r[l],a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),d(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(c,i,n,s.maxWidth)),t.fillText(c,i,n,s.maxWidth),s.strikethrough||s.underline){const e=t.measureText(c),o=i-e.actualBoundingBoxLeft,r=i+e.actualBoundingBoxRight,a=n-e.actualBoundingBoxAscent,l=n+e.actualBoundingBoxDescent,h=s.strikethrough?(a+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(o,h),t.lineTo(r,h),t.stroke()}n+=o.lineHeight}t.restore()}function ye(t,e){const{x:i,y:n,w:o,h:s,radius:r}=e;t.arc(i+r.topLeft,n+r.topLeft,r.topLeft,-H,z,!0),t.lineTo(i,n+s-r.bottomLeft),t.arc(i+r.bottomLeft,n+s-r.bottomLeft,r.bottomLeft,z,H,!0),t.lineTo(i+o-r.bottomRight,n+s),t.arc(i+o-r.bottomRight,n+s-r.bottomRight,r.bottomRight,H,0,!0),t.lineTo(i+o,n+r.topRight),t.arc(i+o-r.topRight,n+r.topRight,r.topRight,0,-H,!0),t.lineTo(i+r.topLeft,n)}const ve=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),we=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Me(t,e){const i=(""+t).match(ve);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100;break}return e*t}const ke=t=>+t||0;function Se(t,e){const i={},n=f(e),o=n?Object.keys(e):e,s=f(t)?n?i=>m(t[i],t[e[i]]):e=>t[e]:()=>t;for(const r of o)i[r]=ke(s(r));return i}function Pe(t){return Se(t,{top:"y",right:"x",bottom:"y",left:"x"})}function De(t){return Se(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ce(t){const e=Pe(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Oe(t,e){t=t||{},e=e||ae.font;let i=m(t.size,e.size);"string"===typeof i&&(i=parseInt(i,10));let n=m(t.style,e.style);n&&!(""+n).match(we)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const o={family:m(t.family,e.family),lineHeight:Me(m(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:m(t.weight,e.weight),string:""};return o.string=le(o),o}function Ae(t,e,i,n){let o,s,r,a=!0;for(o=0,s=t.length;o<s;++o)if(r=t[o],void 0!==r&&(void 0!==e&&"function"===typeof r&&(r=r(e),a=!1),void 0!==i&&u(r)&&(r=r[i%r.length],a=!1),void 0!==r))return n&&!a&&(n.cacheable=!1),r}function Te(t,e){const{min:i,max:n}=t;return{min:i-Math.abs(b(e,i)),max:n+b(e,n)}}function Le(t,e,i){i=i||(i=>t[i]<e);let n,o=t.length-1,s=0;while(o-s>1)n=s+o>>1,i(n)?s=n:o=n;return{lo:s,hi:o}}const Re=(t,e,i)=>Le(t,i,n=>t[n][e]<i),Ee=(t,e,i)=>Le(t,i,n=>t[n][e]>=i);function Ie(t,e,i){let n=0,o=t.length;while(n<o&&t[n]<e)n++;while(o>n&&t[o-1]>i)o--;return n>0||o<t.length?t.slice(n,o):t}const ze=["push","pop","shift","splice","unshift"];function Fe(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ze.forEach(e=>{const i="_onData"+L(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const o=n.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"===typeof t[i]&&t[i](...e)}),o}})}))}function Ve(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,o=n.indexOf(e);-1!==o&&n.splice(o,1),n.length>0||(ze.forEach(e=>{delete t[e]}),delete t._chartjs)}function Be(t){const e=new Set;let i,n;for(i=0,n=t.length;i<n;++i)e.add(t[i]);if(e.size===n)return t;const o=[];return e.forEach(t=>{o.push(t)}),o}function We(t,e=[""],i=t,n,o=(()=>t[0])){R(n)||(n=ii("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:o,override:o=>We([o,...t],e,i,n)};return new Proxy(s,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,n){return Ye(i,n,()=>ei(n,e,t,i))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return ni(t).includes(e)},ownKeys(t){return ni(t)},set(t,e,i){const n=t._storage||(t._storage=o());return n[e]=i,delete t[e],delete t._keys,!0}})}function He(t,e,i,n){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ne(t,n),setContext:e=>He(t,e,i,n),override:o=>He(t.override(o),e,i,n)};return new Proxy(o,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return Ye(t,e,()=>Ue(t,e,i))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,n){return t[i]=n,delete e[i],!0}})}function Ne(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:i,indexable:n,isScriptable:E(i)?i:()=>i,isIndexable:E(n)?n:()=>n}}const je=(t,e)=>t?t+L(e):e,$e=(t,e)=>f(e)&&"adapters"!==t;function Ye(t,e,i){let n=t[e];return R(n)||(n=i(),R(n)&&(t[e]=n)),n}function Ue(t,e,i){const{_proxy:n,_context:o,_subProxy:s,_descriptors:r}=t;let a=n[e];return E(a)&&r.isScriptable(e)&&(a=Xe(e,a,t,i)),u(a)&&a.length&&(a=qe(e,a,t,r.isIndexable)),$e(e,a)&&(a=He(a,o,s&&s[e],r)),a}function Xe(t,e,i,n){const{_proxy:o,_context:s,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+[...a].join("->")+"->"+t);return a.add(t),e=e(s,r||n),a.delete(t),f(e)&&(e=Je(o._scopes,o,t,e)),e}function qe(t,e,i,n){const{_proxy:o,_context:s,_subProxy:r,_descriptors:a}=i;if(R(s.index)&&n(t))e=e[s.index%e.length];else if(f(e[0])){const i=e,n=o._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Je(n,o,t,l);e.push(He(i,s,r&&r[t],a))}}return e}function Ke(t,e,i){return E(t)?t(e,i):t}const Ze=(t,e)=>!0===t?e:"string"===typeof t?T(e,t):void 0;function Ge(t,e,i,n){for(const o of e){const e=Ze(i,o);if(e){t.add(e);const o=Ke(e._fallback,i,e);if(R(o)&&o!==i&&o!==n)return o}else if(!1===e&&R(n)&&i!==n)return null}return!1}function Je(t,e,i,n){const o=e._rootScopes,s=Ke(e._fallback,i,n),r=[...t,...o],a=new Set;a.add(n);let l=Qe(a,r,i,s||i);return null!==l&&((!R(s)||s===i||(l=Qe(a,r,s,l),null!==l))&&We([...a],[""],o,s,()=>ti(e,i,n)))}function Qe(t,e,i,n){while(i)i=Ge(t,e,i,n);return i}function ti(t,e,i){const n=t._getTarget();e in n||(n[e]={});const o=n[e];return u(o)&&f(i)?i:o}function ei(t,e,i,n){let o;for(const s of e)if(o=ii(je(s,t),i),R(o))return $e(t,o)?Je(i,n,t,o):o}function ii(t,e){for(const i of e){if(!i)continue;const e=i[t];if(R(e))return e}}function ni(t){let e=t._keys;return e||(e=t._keys=oi(t._scopes)),e}function oi(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return[...e]}const si=Number.EPSILON||1e-14,ri=(t,e)=>e<t.length&&!t[e].skip&&t[e],ai=t=>"x"===t?"y":"x";function li(t,e,i,n){const o=t.skip?e:t,s=e,r=i.skip?e:i,a=it(s,o),l=it(r,s);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:s.x-d*(r.x-o.x),y:s.y-d*(r.y-o.y)},next:{x:s.x+u*(r.x-o.x),y:s.y+u*(r.y-o.y)}}}function ci(t,e,i){const n=t.length;let o,s,r,a,l,c=ri(t,0);for(let h=0;h<n-1;++h)l=c,c=ri(t,h+1),l&&c&&(K(e[h],0,si)?i[h]=i[h+1]=0:(o=i[h]/e[h],s=i[h+1]/e[h],a=Math.pow(o,2)+Math.pow(s,2),a<=9||(r=3/Math.sqrt(a),i[h]=o*r*e[h],i[h+1]=s*r*e[h])))}function hi(t,e,i="x"){const n=ai(i),o=t.length;let s,r,a,l=ri(t,0);for(let c=0;c<o;++c){if(r=a,a=l,l=ri(t,c+1),!a)continue;const o=a[i],h=a[n];r&&(s=(o-r[i])/3,a["cp1"+i]=o-s,a["cp1"+n]=h-s*e[c]),l&&(s=(l[i]-o)/3,a["cp2"+i]=o+s,a["cp2"+n]=h+s*e[c])}}function di(t,e="x"){const i=ai(e),n=t.length,o=Array(n).fill(0),s=Array(n);let r,a,l,c=ri(t,0);for(r=0;r<n;++r)if(a=l,l=c,c=ri(t,r+1),l){if(c){const t=c[e]-l[e];o[r]=0!==t?(c[i]-l[i])/t:0}s[r]=a?c?Y(o[r-1])!==Y(o[r])?0:(o[r-1]+o[r])/2:o[r-1]:o[r]}ci(t,o,s),hi(t,s,e)}function ui(t,e,i){return Math.max(Math.min(t,i),e)}function fi(t,e){let i,n,o,s,r,a=ge(t[0],e);for(i=0,n=t.length;i<n;++i)r=s,s=a,a=i<n-1&&ge(t[i+1],e),s&&(o=t[i],r&&(o.cp1x=ui(o.cp1x,e.left,e.right),o.cp1y=ui(o.cp1y,e.top,e.bottom)),a&&(o.cp2x=ui(o.cp2x,e.left,e.right),o.cp2y=ui(o.cp2y,e.top,e.bottom)))}function gi(t,e,i,n,o){let s,r,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)di(t,o);else{let i=n?t[t.length-1]:t[0];for(s=0,r=t.length;s<r;++s)a=t[s],l=li(i,a,t[Math.min(s+1,r-(n?0:1))%r],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&fi(t,i)}function pi(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function mi(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}const xi=t=>window.getComputedStyle(t,null);function bi(t,e){return xi(t).getPropertyValue(e)}const _i=["top","right","bottom","left"];function yi(t,e,i){const n={};i=i?"-"+i:"";for(let o=0;o<4;o++){const s=_i[o];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const vi=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function wi(t,e){const i=t.native||t,n=i.touches,o=n&&n.length?n[0]:i,{offsetX:s,offsetY:r}=o;let a,l,c=!1;if(vi(s,r,i.target))a=s,l=r;else{const t=e.getBoundingClientRect();a=o.clientX-t.left,l=o.clientY-t.top,c=!0}return{x:a,y:l,box:c}}function Mi(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,o=xi(i),s="border-box"===o.boxSizing,r=yi(o,"padding"),a=yi(o,"border","width"),{x:l,y:c,box:h}=wi(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=e;return s&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/g*i.height/n)}}function ki(t,e,i){let n,o;if(void 0===e||void 0===i){const s=pi(t);if(s){const t=s.getBoundingClientRect(),r=xi(s),a=yi(r,"border","width"),l=yi(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=mi(r.maxWidth,s,"clientWidth"),o=mi(r.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||B,maxHeight:o||B}}const Si=t=>Math.round(10*t)/10;function Pi(t,e,i,n){const o=xi(t),s=yi(o,"margin"),r=mi(o.maxWidth,t,"clientWidth")||B,a=mi(o.maxHeight,t,"clientHeight")||B,l=ki(t,e,i);let{width:c,height:h}=l;if("content-box"===o.boxSizing){const t=yi(o,"border","width"),e=yi(o,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-s.width),h=Math.max(0,n?Math.floor(c/n):h-s.height),c=Si(Math.min(c,r,l.maxWidth)),h=Si(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Si(c/2)),{width:c,height:h}}function Di(t,e,i){const n=e||1,o=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=o/n,t.width=s/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==o||r.width!==s)&&(t.currentDevicePixelRatio=n,r.height=o,r.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ci=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function Oi(t,e){const i=bi(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Ai(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ti(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 Li(t,e,i,n){const o={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},r=Ai(t,o,i),a=Ai(o,s,i),l=Ai(s,e,i),c=Ai(r,a,i),h=Ai(a,l,i);return Ai(c,h,i)}const Ri=new Map;function Ei(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Ri.get(i);return n||(n=new Intl.NumberFormat(t,e),Ri.set(i,n)),n}function Ii(t,e,i){return Ei(e,i).format(t)}const zi=function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}},Fi=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Vi(t,e,i){return t?zi(e,i):Fi()}function Bi(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 Wi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Hi(t){return"angle"===t?{between:st,compare:nt,normalize:ot}:{between:(t,e,i)=>t>=Math.min(e,i)&&t<=Math.max(i,e),compare:(t,e)=>t-e,normalize:t=>t}}function Ni({start:t,end:e,count:i,loop:n,style:o}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i===0,style:o}}function ji(t,e,i){const{property:n,start:o,end:s}=i,{between:r,normalize:a}=Hi(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;c<h;++c){if(!r(a(e[d%l][n]),o,s))break;d--,u--}d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}function $i(t,e,i){if(!i)return[t];const{property:n,start:o,end:s}=i,r=e.length,{compare:a,between:l,normalize:c}=Hi(n),{start:h,end:d,loop:u,style:f}=ji(t,e,i),g=[];let p,m,x,b=!1,_=null;const y=()=>l(o,x,p)&&0!==a(o,x),v=()=>0===a(s,p)||l(s,x,p),w=()=>b||y(),M=()=>!b||v();for(let k=h,S=h;k<=d;++k)m=e[k%r],m.skip||(p=c(m[n]),p!==x&&(b=l(p,o,s),null===_&&w()&&(_=0===a(p,o)?k:S),null!==_&&M()&&(g.push(Ni({start:_,end:k,loop:u,count:r,style:f})),_=null),S=k,x=p));return null!==_&&g.push(Ni({start:_,end:d,loop:u,count:r,style:f})),g}function Yi(t,e){const i=[],n=t.segments;for(let o=0;o<n.length;o++){const s=$i(n[o],t.points,e);s.length&&i.push(...s)}return i}function Ui(t,e,i,n){let o=0,s=e-1;if(i&&!n)while(o<e&&!t[o].skip)o++;while(o<e&&t[o].skip)o++;o%=e,i&&(s+=o);while(s>o&&t[s%e].skip)s--;return s%=e,{start:o,end:s}}function Xi(t,e,i,n){const o=t.length,s=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%o];i.skip||i.stop?l.skip||(n=!1,s.push({start:e%o,end:(r-1)%o,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&s.push({start:e%o,end:a%o,loop:n}),s}function qi(t,e){const i=t.points,n=t.options.spanGaps,o=i.length;if(!o)return[];const s=!!t._loop,{start:r,end:a}=Ui(i,o,s,n);if(!0===n)return Ki([{start:r,end:a,loop:s}],i,e);const l=a<r?a+o:a,c=!!t._fullLoop&&0===r&&a===o-1;return Ki(Xi(i,r,l,c),i,e)}function Ki(t,e,i){return i&&i.setContext&&e?Zi(t,e,i):t}function Zi(t,e,i){const n=e.length,o=[];let s=t[0].start,r=s;for(const a of t){let t,l,c=e[s%n];for(r=s+1;r<=a.end;r++){const h=e[r%n];l=Gi(i.setContext({type:"segment",p0:c,p1:h})),Ji(l,t)&&(o.push({start:s,end:r-1,loop:a.loop,style:t}),t=l,s=r-1),c=h,t=l}s<r-1&&(o.push({start:s,end:r-1,loop:a.loop,style:l}),s=r-1)}return o}function Gi(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)}
/*!
 * Chart.js v3.3.0
 * https://www.chartjs.org
 * (c) 2021 Chart.js Contributors
 * Released under the MIT License
 */class Qi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],s=e.duration;o.forEach(n=>n({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){const t=this;t._request||(t._running=!0,t._request=n.call(window,()=>{t._update(),t._request=null,t._running&&t._refresh()}))}_update(t=Date.now()){const e=this;let i=0;e._charts.forEach((n,o)=>{if(!n.running||!n.items.length)return;const s=n.items;let r,a=s.length-1,l=!1;for(;a>=0;--a)r=s[a],r._active?(r._total>n.duration&&(n.duration=r._total),r.tick(t),l=!0):(s[a]=s[s.length-1],s.pop());l&&(o.draw(),e._notify(o,n,t,"progress")),s.length||(n.running=!1,e._notify(o,n,t,"complete"),n.initial=!1),i+=s.length}),e._lastDate=t,0===i&&(e._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let 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)}}var tn=new Qi;const en="transparent",nn={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const n=te(t||en),o=n.valid&&te(e||en);return o&&o.valid?o.mix(n,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class on{constructor(t,e,i,n){const o=e[i];n=Ae([t.to,n,o,t.from]);const s=Ae([t.from,o,n]);this._active=!0,this._fn=t.fn||nn[t.type||typeof s],this._easing=dt[t.easing]||dt.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){const n=this;if(n._active){n._notify(!1);const o=n._target[n._prop],s=i-n._start,r=n._duration-s;n._start=i,n._duration=Math.floor(Math.max(r,t.duration)),n._total+=s,n._loop=!!t.loop,n._to=Ae([t.to,e,o,t.from]),n._from=Ae([t.from,o,e])}}cancel(){const t=this;t._active&&(t.tick(Date.now()),t._active=!1,t._notify(!1))}tick(t){const e=this,i=t-e._start,n=e._duration,o=e._prop,s=e._from,r=e._loop,a=e._to;let l;if(e._active=s!==a&&(r||i<n),!e._active)return e._target[o]=a,void e._notify(!0);i<0?e._target[o]=s:(l=i/n%2,l=r&&l>1?2-l:l,l=e._easing(Math.min(1,Math.max(0,l))),e._target[o]=e._fn(s,a,l))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}const sn=["x","y","borderWidth","radius","tension"],rn=["color","borderColor","backgroundColor"];ae.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const an=Object.keys(ae.animation);ae.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),ae.set("animations",{colors:{type:"color",properties:rn},numbers:{type:"number",properties:sn}}),ae.describe("animations",{_fallback:"animation"}),ae.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}}}});class ln{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!f(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!f(n))return;const o={};for(const t of an)o[t]=n[t];(u(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=hn(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&cn(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),s=Object.keys(e),r=Date.now();let a;for(a=s.length-1;a>=0;--a){const l=s[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=o[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(o[l]=h=new on(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(tn.add(this._chart,i),!0):void 0}}function cn(t,e){const i=[],n=Object.keys(e);for(let o=0;o<n.length;o++){const e=t[n[o]];e&&e.active()&&i.push(e.wait())}return Promise.all(i)}function hn(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}function dn(t,e){const i=t&&t.options||{},n=i.reverse,o=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:o,end:n?o:s}}function un(t,e,i){if(!1===i)return!1;const n=dn(t,i),o=dn(e,i);return{top:o.end,right:n.end,bottom:o.start,left:n.start}}function fn(t){let e,i,n,o;return f(t)?(e=t.top,i=t.right,n=t.bottom,o=t.left):e=i=n=o=t,{top:e,right:i,bottom:n,left:o}}function gn(t,e){const i=[],n=t._getSortedDatasetMetas(e);let o,s;for(o=0,s=n.length;o<s;++o)i.push(n[o].index);return i}function pn(t,e,i,n){const o=t.keys,s="single"===n.mode;let r,a,l,c;if(null!==e){for(r=0,a=o.length;r<a;++r){if(l=+o[r],l===i){if(n.all)continue;break}c=t.values[l],g(c)&&(s||0===e||Y(e)===Y(c))&&(e+=c)}return e}}function mn(t){const e=Object.keys(t),i=new Array(e.length);let n,o,s;for(n=0,o=e.length;n<o;++n)s=e[n],i[n]={x:s,y:t[s]};return i}function xn(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function bn(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}function _n(t){const{min:e,max:i,minDefined:n,maxDefined:o}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:o?i:Number.POSITIVE_INFINITY}}function yn(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function vn(t,e,i){for(const n of e.getMatchingVisibleMetas("bar").reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function wn(t,e){const{chart:i,_cachedMeta:n}=t,o=i._stacks||(i._stacks={}),{iScale:s,vScale:r,index:a}=n,l=s.axis,c=r.axis,h=bn(s,r,n),d=e.length;let u;for(let f=0;f<d;++f){const t=e[f],{[l]:i,[c]:n}=t,s=t._stacks||(t._stacks={});u=s[c]=yn(o,h,i),u[a]=n,u._top=vn(u,r,!0),u._bottom=vn(u,r,!1)}}function Mn(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function kn(t,e){return Object.assign(Object.create(t),{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Sn(t,e,i){return Object.assign(Object.create(t),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function Pn(t,e){e=e||t._parsed;for(const i of e){const e=i._stacks;if(!e||void 0===e[t.vScale.id]||void 0===e[t.vScale.id][t.index])return;delete e[t.vScale.id][t.index]}}const Dn=t=>"reset"===t||"none"===t,Cn=(t,e)=>e?t:Object.assign({},t);class On{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.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this,e=t._cachedMeta;t.configure(),t.linkScales(),e._stacked=xn(e.vScale,e),t.addElements()}updateIndex(t){this.index!==t&&Pn(this._cachedMeta),this.index=t}linkScales(){const t=this,e=t.chart,i=t._cachedMeta,n=t.getDataset(),o=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=i.xAxisID=m(n.xAxisID,Mn(e,"x")),r=i.yAxisID=m(n.yAxisID,Mn(e,"y")),a=i.rAxisID=m(n.rAxisID,Mn(e,"r")),l=i.indexAxis,c=i.iAxisID=o(l,s,r,a),h=i.vAxisID=o(l,r,s,a);i.xScale=t.getScaleForId(s),i.yScale=t.getScaleForId(r),i.rScale=t.getScaleForId(a),i.iScale=t.getScaleForId(c),i.vScale=t.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ve(this._data,this),t._stacked&&Pn(t)}_dataCheck(){const t=this,e=t.getDataset(),i=e.data||(e.data=[]),n=t._data;if(f(i))t._data=mn(i);else if(n!==i){if(n){Ve(n,t);const e=t._cachedMeta;Pn(e),e._parsed=[]}i&&Object.isExtensible(i)&&Fe(i,t),t._syncList=[],t._data=i}}addElements(){const t=this,e=t._cachedMeta;t._dataCheck(),t.datasetElementType&&(e.dataset=new t.datasetElementType)}buildOrUpdateElements(t){const e=this,i=e._cachedMeta,n=e.getDataset();let o=!1;e._dataCheck();const s=i._stacked;i._stacked=xn(i.vScale,i),i.stack!==n.stack&&(o=!0,Pn(i),i.stack=n.stack),e._resyncElements(t),(o||s!==i._stacked)&&wn(e,i._parsed)}configure(){const t=this,e=t.chart.config,i=e.datasetScopeKeys(t._type),n=e.getOptionScopes(t.getDataset(),i,!0);t.options=e.createResolver(n,t.getContext()),t._parsing=t.options.parsing}parse(t,e){const i=this,{_cachedMeta:n,_data:o}=i,{iScale:s,_stacked:r}=n,a=s.axis;let l,c,h,d=0===t&&e===o.length||n._sorted,g=t>0&&n._parsed[t-1];if(!1===i._parsing)n._parsed=o,n._sorted=!0,h=o;else{h=u(o[t])?i.parseArrayData(n,o,t,e):f(o[t])?i.parseObjectData(n,o,t,e):i.parsePrimitiveData(n,o,t,e);const s=()=>null===c[a]||g&&c[a]<g[a];for(l=0;l<e;++l)n._parsed[l+t]=c=h[l],d&&(s()&&(d=!1),g=c);n._sorted=d}r&&wn(i,h)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:s}=t,r=o.axis,a=s.axis,l=o.getLabels(),c=o===s,h=new Array(n);let d,u,f;for(d=0,u=n;d<u;++d)f=d+i,h[d]={[r]:c||o.parse(l[f],f),[a]:s.parse(e[f],f)};return h}parseArrayData(t,e,i,n){const{xScale:o,yScale:s}=t,r=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=e[c],r[a]={x:o.parse(h[0],c),y:s.parse(h[1],c)};return r}parseObjectData(t,e,i,n){const{xScale:o,yScale:s}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l=new Array(n);let c,h,d,u;for(c=0,h=n;c<h;++c)d=c+i,u=e[d],l[c]={x:o.parse(T(u,r),d),y:s.parse(T(u,a),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,o=this._cachedMeta,s=e[t.axis],r={keys:gn(n,!0),values:e._stacks[t.axis]};return pn(r,s,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const o=i[e.axis];let s=null===o?NaN:o;const r=n&&i._stacks[e.axis];n&&r&&(n.values=r,t.min=Math.min(t.min,s),t.max=Math.max(t.max,s),s=pn(n,o,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this,n=i._cachedMeta,o=n._parsed,s=n._sorted&&t===n.iScale,r=o.length,a=i._getOtherScale(t),l=e&&n._stacked&&{keys:gn(i.chart,!0),values:null},c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=_n(a);let u,f,p,m;function x(){return p=o[u],f=p[t.axis],m=p[a.axis],!g(f)||h>m||d<m}for(u=0;u<r;++u)if(!x()&&(i.updateRangeFromParsed(c,t,p,l),s))break;if(s)for(u=r-1;u>=0;--u)if(!x()){i.updateRangeFromParsed(c,t,p,l);break}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,s;for(n=0,o=e.length;n<o;++n)s=e[n][t.axis],g(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this,i=e._cachedMeta,n=i.iScale,o=i.vScale,s=e.getParsed(t);return{label:n?""+n.getLabelForValue(s[n.axis]):"",value:o?""+o.getLabelForValue(s[o.axis]):""}}_update(t){const e=this,i=e._cachedMeta;e.configure(),e._cachedDataOpts={},e.update(t||"default"),i._clip=fn(m(e.options.clip,un(i.xScale,i.yScale,e.getMaxOverflow())))}update(t){}draw(){const t=this,e=t._ctx,i=t.chart,n=t._cachedMeta,o=n.data||[],s=i.chartArea,r=[],a=t._drawStart||0,l=t._drawCount||o.length-a;let c;for(n.dataset&&n.dataset.draw(e,s,a,l),c=a;c<a+l;++c){const t=o[c];t.active?r.push(t):t.draw(e,s)}for(c=0;c<r.length;++c)r[c].draw(e,s)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this,o=n.getDataset();let s;if(t>=0&&t<n._cachedMeta.data.length){const e=n._cachedMeta.data[t];s=e.$context||(e.$context=Sn(n.getContext(),t,e)),s.parsed=n.getParsed(t),s.raw=o.data[t],s.index=s.dataIndex=t}else s=n.$context||(n.$context=kn(n.chart.getContext(),n.index)),s.dataset=o,s.index=s.datasetIndex=n.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n=this,o="active"===e,s=n._cachedDataOpts,r=t+"-"+e,a=s[r],l=n.enableOptionSharing&&R(i);if(a)return Cn(a,l);const c=n.chart.config,h=c.datasetElementScopeKeys(n._type,t),d=o?[t+"Hover","hover",t,""]:[t,""],u=c.getOptionScopes(n.getDataset(),h),f=Object.keys(ae.elements[t]),g=()=>n.getContext(i,o),p=c.resolveNamedOptions(u,f,g,d);return p.$shared&&(p.$shared=l,s[r]=Object.freeze(Cn(p,l))),p}_resolveAnimations(t,e,i){const n=this,o=n.chart,s=n._cachedDataOpts,r="animation-"+e,a=s[r];if(a)return a;let l;if(!1!==o.options.animation){const o=n.chart.config,s=o.datasetAnimationScopeKeys(n._type,e),r=o.getOptionScopes(n.getDataset(),s);l=o.createResolver(r,n.getContext(t,i,e))}const c=new ln(o,l&&l.animations);return l&&l._cacheable&&(s[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Dn(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){Dn(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Dn(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this,i=e._data,n=e._cachedMeta.data;for(const[a,l,c]of e._syncList)e[a](l,c);e._syncList=[];const o=n.length,s=i.length,r=Math.min(s,o);s>o?e._insertElements(o,s-o,t):s<o&&e._removeElements(s,o-s),r&&e.parse(0,r)}_insertElements(t,e,i=!0){const n=this,o=n._cachedMeta,s=o.data,r=t+e;let a;const l=t=>{for(t.length+=e,a=t.length-1;a>=r;a--)t[a]=t[a-e]};for(l(s),a=t;a<r;++a)s[a]=new n.dataElementType;n._parsing&&l(o._parsed),n.parse(t,e),i&&n.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this,n=i._cachedMeta;if(i._parsing){const i=n._parsed.splice(t,e);n._stacked&&Pn(n,i)}n.data.splice(t,e)}_onDataPush(){const t=arguments.length;this._syncList.push(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._syncList.push(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._syncList.push(["_removeElements",0,1])}_onDataSplice(t,e){this._syncList.push(["_removeElements",t,e]),this._syncList.push(["_insertElements",t,arguments.length-2])}_onDataUnshift(){this._syncList.push(["_insertElements",0,arguments.length])}}function An(t){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas("bar");let i=[];for(let n=0,o=e.length;n<o;n++)i=i.concat(e[n].controller.getAllParsedValues(t));t._cache.$bar=Be(i.sort((t,e)=>t-e))}return t._cache.$bar}function Tn(t){const e=An(t);let i,n,o,s,r=t._length;const a=()=>{32767!==o&&-32768!==o&&(R(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,n=e.length;i<n;++i)o=t.getPixelForValue(e[i]),a();for(s=void 0,i=0,n=t.ticks.length;i<n;++i)o=t.getPixelForTick(i),a();return r}function Ln(t,e,i,n){const o=i.barThickness;let s,r;return d(o)?(s=e.min*i.categoryPercentage,r=i.barPercentage):(s=o*n,r=1),{chunk:s/n,ratio:r,start:e.pixels[t]-s/2}}function Rn(t,e,i,n){const o=e.pixels,s=o[t];let r=t>0?o[t-1]:null,a=t<o.length-1?o[t+1]:null;const l=i.categoryPercentage;null===r&&(r=s-(null===a?e.end-e.start:a-s)),null===a&&(a=s+s-r);const c=s-(s-Math.min(r,a))/2*l,h=Math.abs(a-r)/2*l;return{chunk:h/n,ratio:i.barPercentage,start:c}}function En(t,e,i,n){const o=i.parse(t[0],n),s=i.parse(t[1],n),r=Math.min(o,s),a=Math.max(o,s);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:o,end:s,min:r,max:a}}function In(t,e,i,n){return u(t)?En(t,e,i,n):e[i.axis]=i.parse(t,n),e}function zn(t,e,i,n){const o=t.iScale,s=t.vScale,r=o.getLabels(),a=o===s,l=[];let c,h,d,u;for(c=i,h=i+n;c<h;++c)u=e[c],d={},d[o.axis]=a||o.parse(r[c],c),l.push(In(u,d,s,c));return l}function Fn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}On.defaults={},On.prototype.datasetElementType=null,On.prototype.dataElementType=null;class Vn extends On{parsePrimitiveData(t,e,i,n){return zn(t,e,i,n)}parseArrayData(t,e,i,n){return zn(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:o,vScale:s}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===o.axis?r:a,c="x"===s.axis?r:a,h=[];let d,u,f,g;for(d=i,u=i+n;d<u;++d)g=e[d],f={},f[o.axis]=o.parse(T(g,l),d),h.push(In(T(g,c),f,s,d));return h}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getLabelAndValue(t){const e=this,i=e._cachedMeta,{iScale:n,vScale:o}=i,s=e.getParsed(t),r=s._custom,a=Fn(r)?"["+r.start+", "+r.end+"]":""+o.getLabelForValue(s[o.axis]);return{label:""+n.getLabelForValue(s[n.axis]),value:a}}initialize(){const t=this;t.enableOptionSharing=!0,super.initialize();const e=t._cachedMeta;e.stack=t.getDataset().stack}update(t){const e=this,i=e._cachedMeta;e.updateElements(i.data,0,i.data.length,t)}updateElements(t,e,i,n){const o=this,s="reset"===n,r=o._cachedMeta.vScale,a=r.getBasePixel(),l=r.isHorizontal(),c=o._getRuler(),h=o.resolveDataElementOptions(e,n),u=o.getSharedOptions(h),f=o.includeOptions(n,u);o.updateSharedOptions(u,n,h);for(let g=e;g<e+i;g++){const e=o.getParsed(g),i=s||d(e[r.axis])?{base:a,head:a}:o._calculateBarValuePixels(g),h=o._calculateBarIndexPixels(g,c),p=(e._stacks||{})[r.axis],m={horizontal:l,base:i.base,enableBorderRadius:!p||Fn(e._custom)||o.index===p._top||o.index===p._bottom,x:l?i.head:h.center,y:l?h.center:i.head,height:l?h.size:void 0,width:l?void 0:h.size};f&&(m.options=u||o.resolveDataElementOptions(g,n)),o.updateElement(t[g],g,m,n)}}_getStacks(t,e){const i=this,n=i._cachedMeta,o=n.iScale,s=o.getMatchingVisibleMetas(i._type),r=o.options.stacked,a=s.length,l=[];let c,h;for(c=0;c<a;++c){if(h=s[c],"undefined"!==typeof e){const t=h.controller.getParsed(e)[h.controller._cachedMeta.vScale.axis];if(d(t)||isNaN(t))continue}if((!1===r||-1===l.indexOf(h.stack)||void 0===r&&void 0===h.stack)&&l.push(h.stack),h.index===t)break}return l.length||l.push(void 0),l}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),o=void 0!==e?n.indexOf(e):-1;return-1===o?n.length-1:o}_getRuler(){const t=this,e=t.options,i=t._cachedMeta,n=i.iScale,o=[];let s,r;for(s=0,r=i.data.length;s<r;++s)o.push(n.getPixelForValue(t.getParsed(s)[n.axis],s));const a=e.barThickness,l=a||Tn(n);return{min:l,pixels:o,start:n._startPixel,end:n._endPixel,stackCount:t._getStackCount(),scale:n,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(t){const e=this,{vScale:i,_stacked:n}=e._cachedMeta,{base:o,minBarLength:s}=e.options,r=e.getParsed(t),a=r._custom,l=Fn(a);let c,h,u=r[i.axis],f=0,g=n?e.applyStack(i,r,n):u;g!==u&&(f=g-u,g=u),l&&(u=a.barStart,g=a.barEnd-a.barStart,0!==u&&Y(u)!==Y(a.barEnd)&&(f=0),f+=u);const p=d(o)||l?f:o;let m=i.getPixelForValue(p);c=this.chart.getDataVisibility(t)?i.getPixelForValue(f+g):m,h=c-m,void 0!==s&&Math.abs(h)<s&&(h=h<0?-s:s,0===u&&(m-=h/2),c=m+h);const x=o||0;if(m===i.getPixelForValue(x)){const t=i.getLineWidthForValue(x)/2;h>0?(m+=t,h-=t):h<0&&(m-=t,h+=t)}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=this,n=e.scale,o=i.options,s=o.skipNull,r=m(o.maxBarThickness,1/0);let a,l;if(e.grouped){const n=s?i._getStackCount(t):e.stackCount,c="flex"===o.barThickness?Rn(t,e,o,n):Ln(t,e,o,n),h=i._getStackIndex(i.index,i._cachedMeta.stack,s?t:void 0);a=c.start+c.chunk*h+c.chunk/2,l=Math.min(r,c.chunk*c.ratio)}else a=n.getPixelForValue(i.getParsed(t)[n.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this,e=t.chart,i=t._cachedMeta,n=i.vScale,o=i.data,s=o.length;let r=0;for(pe(e.ctx,e.chartArea);r<s;++r)null!==t.getParsed(r)[n.axis]&&o[r].draw(t._ctx);me(e.ctx)}}Vn.id="bar",Vn.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Vn.overrides={interaction:{mode:"index"},scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Bn extends On{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(t,e,i,n){const{xScale:o,yScale:s}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l=[];let c,h,d;for(c=i,h=i+n;c<h;++c)d=e[c],l.push({x:o.parse(T(d,r),c),y:s.parse(T(d,a),c),_custom:d&&d.r&&+d.r});return l}getMaxOverflow(){const{data:t,_parsed:e}=this._cachedMeta;let i=0;for(let n=t.length-1;n>=0;--n)i=Math.max(i,t[n].size()/2,e[n]._custom);return i>0&&i}getLabelAndValue(t){const e=this,i=e._cachedMeta,{xScale:n,yScale:o}=i,s=e.getParsed(t),r=n.getLabelForValue(s.x),a=o.getLabelForValue(s.y),l=s._custom;return{label:i.label,value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this,i=e._cachedMeta.data;e.updateElements(i,0,i.length,t)}updateElements(t,e,i,n){const o=this,s="reset"===n,{iScale:r,vScale:a}=o._cachedMeta,l=o.resolveDataElementOptions(e,n),c=o.getSharedOptions(l),h=o.includeOptions(n,c),d=r.axis,u=a.axis;for(let f=e;f<e+i;f++){const e=t[f],i=!s&&o.getParsed(f),l={},c=l[d]=s?r.getPixelForDecimal(.5):r.getPixelForValue(i[d]),g=l[u]=s?a.getBasePixel():a.getPixelForValue(i[u]);l.skip=isNaN(c)||isNaN(g),h&&(l.options=o.resolveDataElementOptions(f,n),s&&(l.options.radius=0)),o.updateElement(e,f,l,n)}o.updateSharedOptions(c,n,l)}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const o=n.radius;return"active"!==e&&(n.radius=0),n.radius+=m(i&&i._custom,o),n}}function Wn(t,e,i){let n=1,o=1,s=0,r=0;if(e<F){const a=t,l=a+e,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(t,e,n)=>st(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>st(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,c,d),m=f(H,h,u),x=g(z,c,d),b=g(z+H,h,u);n=(p-x)/2,o=(m-b)/2,s=-(p+x)/2,r=-(m+b)/2}return{ratioX:n,ratioY:o,offsetX:s,offsetY:r}}Bn.id="bubble",Bn.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Bn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};class Hn extends On{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;let o,s;for(o=t,s=t+e;o<s;++o)n._parsed[o]=+i[o]}_getRotation(){return J(this.options.rotation-90)}_getCircumference(){return J(this.options.circumference)}_getRotationExtents(){let t=F,e=-F;const i=this;for(let n=0;n<i.chart.data.datasets.length;++n)if(i.chart.isDatasetVisible(n)){const o=i.chart.getDatasetMeta(n).controller,s=o._getRotation(),r=o._getCircumference();t=Math.min(t,s),e=Math.max(e,s+r)}return{rotation:t,circumference:e-t}}update(t){const e=this,i=e.chart,{chartArea:n}=i,o=e._cachedMeta,s=o.data,r=e.getMaxBorderWidth()+e.getMaxOffset(s),a=Math.max((Math.min(n.width,n.height)-r)/2,0),l=Math.min(x(e.options.cutout,a),1),c=e._getRingWeight(e.index),{circumference:h,rotation:d}=e._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:g,offsetY:p}=Wn(d,h,l),m=(n.width-r)/u,_=(n.height-r)/f,y=Math.max(Math.min(m,_)/2,0),v=b(e.options.radius,y),w=Math.max(v*l,0),M=(v-w)/e._getVisibleDatasetWeightTotal();e.offsetX=g*v,e.offsetY=p*v,o.total=e.calculateTotal(),e.outerRadius=v-M*e._getRingWeightOffset(e.index),e.innerRadius=Math.max(e.outerRadius-M*c,0),e.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this,n=i.options,o=i._cachedMeta,s=i._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===o._parsed[t]?0:i.calculateCircumference(o._parsed[t]*s/F)}updateElements(t,e,i,n){const o=this,s="reset"===n,r=o.chart,a=r.chartArea,l=r.options,c=l.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,u=s&&c.animateScale,f=u?0:o.innerRadius,g=u?0:o.outerRadius,p=o.resolveDataElementOptions(e,n),m=o.getSharedOptions(p),x=o.includeOptions(n,m);let b,_=o._getRotation();for(b=0;b<e;++b)_+=o._circumference(b,s);for(b=e;b<e+i;++b){const e=o._circumference(b,s),i=t[b],r={x:h+o.offsetX,y:d+o.offsetY,startAngle:_,endAngle:_+e,circumference:e,outerRadius:g,innerRadius:f};x&&(r.options=m||o.resolveDataElementOptions(b,n)),_+=e,o.updateElement(i,b,r,n)}o.updateSharedOptions(m,n,p)}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const e=t._parsed[i];null!==e&&!isNaN(e)&&this.chart.getDataVisibility(i)&&(n+=Math.abs(e))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?F*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this,i=e._cachedMeta,n=e.chart,o=n.data.labels||[],s=Ii(i._parsed[t],n.options.locale);return{label:o[t]||"",value:s}}getMaxBorderWidth(t){const e=this;let i=0;const n=e.chart;let o,s,r,a,l;if(!t)for(o=0,s=n.data.datasets.length;o<s;++o)if(n.isDatasetVisible(o)){r=n.getDatasetMeta(o),t=r.data,a=r.controller,a!==e&&a.configure();break}if(!t)return 0;for(o=0,s=t.length;o<s;++o)l=a.resolveDataElementOptions(o),"inner"!==l.borderAlign&&(i=Math.max(i,l.borderWidth||0,l.hoverBorderWidth||0));return i}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const 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(m(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Hn.id="doughnut",Hn.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",indexAxis:"r"},Hn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((e,i)=>{const n=t.getDatasetMeta(0),o=n.controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,hidden:!t.getDataVisibility(i),index:i}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){let e=t.label;const i=": "+t.formattedValue;return u(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Nn extends On{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this,i=e._cachedMeta,{dataset:n,data:o=[],_dataset:s}=i,r=e.chart._animationsDisabled;let{start:a,count:l}=jn(i,o,r);e._drawStart=a,e._drawCount=l,$n(i)&&(a=0,l=o.length),n._decimated=!!s._decimated,n.points=o;const c=e.resolveDatasetElementOptions(t);e.options.showLine||(c.borderWidth=0),c.segment=e.options.segment,e.updateElement(n,void 0,{animated:!r,options:c},t),e.updateElements(o,a,l,t)}updateElements(t,e,i,n){const o=this,s="reset"===n,{iScale:r,vScale:a,_stacked:l}=o._cachedMeta,c=o.resolveDataElementOptions(e,n),h=o.getSharedOptions(c),u=o.includeOptions(n,h),f=r.axis,g=a.axis,p=o.options.spanGaps,m=q(p)?p:Number.POSITIVE_INFINITY,x=o.chart._animationsDisabled||s||"none"===n;let b=e>0&&o.getParsed(e-1);for(let _=e;_<e+i;++_){const e=t[_],i=o.getParsed(_),c=x?e:{},p=d(i[g]),y=c[f]=r.getPixelForValue(i[f],_),v=c[g]=s||p?a.getBasePixel():a.getPixelForValue(l?o.applyStack(a,i,l):i[g],_);c.skip=isNaN(y)||isNaN(v)||p,c.stop=_>0&&i[f]-b[f]>m,c.parsed=i,u&&(c.options=h||o.resolveDataElementOptions(_,n)),x||o.updateElement(e,_,c,n),b=i}o.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this,e=t._cachedMeta,i=e.dataset,n=i.options&&i.options.borderWidth||0,o=e.data||[];if(!o.length)return n;const s=o[0].size(t.resolveDataElementOptions(0)),r=o[o.length-1].size(t.resolveDataElementOptions(o.length-1));return Math.max(n,s,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function jn(t,e,i){const n=e.length;let o=0,s=n;if(t._sorted){const{iScale:r,_parsed:a}=t,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(o=rt(Math.min(Re(a,r.axis,c).lo,i?n:Re(e,l,r.getPixelForValue(c)).lo),0,n-1)),s=u?rt(Math.max(Re(a,r.axis,h).hi+1,i?0:Re(e,l,r.getPixelForValue(h)).hi+1),o,n)-o:n-o}return{start:o,count:s}}function $n(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,o={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=o,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,o),s}Nn.id="line",Nn.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Nn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Yn extends On{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this,i=e._cachedMeta,n=e.chart,o=n.data.labels||[],s=Ii(i._parsed[t].r,n.options.locale);return{label:o[t]||"",value:s}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this,e=t.chart,i=e.chartArea,n=e.options,o=Math.min(i.right-i.left,i.bottom-i.top),s=Math.max(o/2,0),r=Math.max(n.cutoutPercentage?s/100*n.cutoutPercentage:1,0),a=(s-r)/e.getVisibleDatasetCount();t.outerRadius=s-a*t.index,t.innerRadius=t.outerRadius-a}updateElements(t,e,i,n){const o=this,s="reset"===n,r=o.chart,a=o.getDataset(),l=r.options,c=l.animation,h=o._cachedMeta.rScale,d=h.xCenter,u=h.yCenter,f=h.getIndexAngle(0)-.5*z;let g,p=f;const m=360/o.countVisibleElements();for(g=0;g<e;++g)p+=o._computeAngle(g,n,m);for(g=e;g<e+i;g++){const e=t[g];let i=p,l=p+o._computeAngle(g,n,m),x=r.getDataVisibility(g)?h.getDistanceFromCenterForValue(a.data[g]):0;p=l,s&&(c.animateScale&&(x=0),c.animateRotate&&(i=l=f));const b={x:d,y:u,innerRadius:0,outerRadius:x,startAngle:i,endAngle:l,options:o.resolveDataElementOptions(g,n)};o.updateElement(e,g,b,n)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let i=0;return e.data.forEach((e,n)=>{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?J(this.resolveDataElementOptions(t,e).angle||i):0}}Yn.id="polarArea",Yn.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Yn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((e,i)=>{const n=t.getDatasetMeta(0),o=n.controller.getStyle(i);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,hidden:!t.getDataVisibility(i),index:i}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){return 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}}};class Un extends Hn{}Un.id="pie",Un.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Xn extends On{getLabelAndValue(t){const e=this,i=e._cachedMeta.vScale,n=e.getParsed(t);return{label:i.getLabels()[t],value:""+i.getLabelForValue(n[i.axis])}}update(t){const e=this,i=e._cachedMeta,n=i.dataset,o=i.data||[],s=i.iScale.getLabels();if(n.points=o,"resize"!==t){const i=e.resolveDatasetElementOptions(t);e.options.showLine||(i.borderWidth=0);const r={_loop:!0,_fullLoop:s.length===o.length,options:i};e.updateElement(n,void 0,r,t)}e.updateElements(o,0,o.length,t)}updateElements(t,e,i,n){const o=this,s=o.getDataset(),r=o._cachedMeta.rScale,a="reset"===n;for(let l=e;l<e+i;l++){const e=t[l],i=o.resolveDataElementOptions(l,n),c=r.getPointPositionForValue(l,s.data[l]),h=a?r.xCenter:c.x,d=a?r.yCenter:c.y,u={x:h,y:d,angle:c.angle,skip:isNaN(h)||isNaN(d),options:i};o.updateElement(e,l,u,n)}}}Xn.id="radar",Xn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Xn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class qn extends Nn{}qn.id="scatter",qn.defaults={showLine:!1,fill:!1},qn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Kn=Object.freeze({__proto__:null,BarController:Vn,BubbleController:Bn,DoughnutController:Hn,LineController:Nn,PolarAreaController:Yn,PieController:Un,RadarController:Xn,ScatterController:qn});function Zn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Gn{constructor(t){this.options=t||{}}formats(){return Zn()}parse(t,e){return Zn()}format(t,e){return Zn()}add(t,e,i){return Zn()}diff(t,e,i){return Zn()}startOf(t,e,i){return Zn()}endOf(t,e){return Zn()}}Gn.override=function(t){Object.assign(Gn.prototype,t)};var Jn={_date:Gn};function Qn(t,e){return"native"in t?{x:t.x,y:t.y}:Mi(t,e)}function to(t,e){const i=t.getSortedVisibleDatasetMetas();let n,o,s;for(let r=0,a=i.length;r<a;++r){({index:n,data:o}=i[r]);for(let t=0,i=o.length;t<i;++t)s=o[t],s.skip||e(s,n,t)}}function eo(t,e,i,n){const{controller:o,data:s,_sorted:r}=t,a=o._cachedMeta.iScale;if(a&&e===a.axis&&r&&s.length){const t=a._reversePixels?Ee:Re;if(!n)return t(s,e,i);if(o._sharedOptions){const n=s[0],o="function"===typeof n.getRange&&n.getRange(e);if(o){const n=t(s,e,i-o),r=t(s,e,i+o);return{lo:n.lo,hi:r.hi}}}}return{lo:0,hi:s.length-1}}function io(t,e,i,n,o){const s=t.getSortedVisibleDatasetMetas(),r=i[e];for(let a=0,l=s.length;a<l;++a){const{index:t,data:i}=s[a],{lo:l,hi:c}=eo(s[a],e,r,o);for(let e=l;e<=c;++e){const o=i[e];o.skip||n(o,t,e)}}}function no(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const o=e?Math.abs(t.x-n.x):0,s=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function oo(t,e,i,n){const o=[];if(!ge(e,t.chartArea,t._minPadding))return o;const s=function(t,i,s){t.inRange(e.x,e.y,n)&&o.push({element:t,datasetIndex:i,index:s})};return io(t,i,e,s,!0),o}function so(t,e,i,n,o){const s=no(i);let r=Number.POSITIVE_INFINITY,a=[];if(!ge(e,t.chartArea,t._minPadding))return a;const l=function(t,i,l){if(n&&!t.inRange(e.x,e.y,o))return;const c=t.getCenterPoint(o),h=s(e,c);h<r?(a=[{element:t,datasetIndex:i,index:l}],r=h):h===r&&a.push({element:t,datasetIndex:i,index:l})};return io(t,i,e,l),a}function ro(t,e,i,n){const o=Qn(e,t),s=[],r=i.axis,a="x"===r?"inXRange":"inYRange";let l=!1;return to(t,(t,e,i)=>{t[a](o[r],n)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(o.x,o.y,n)&&(l=!0)}),i.intersect&&!l?[]:s}var ao={modes:{index(t,e,i,n){const o=Qn(e,t),s=i.axis||"x",r=i.intersect?oo(t,o,s,n):so(t,o,s,!1,n),a=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&a.push({element:i,datasetIndex:t.index,index:e})}),a):[]},dataset(t,e,i,n){const o=Qn(e,t),s=i.axis||"xy";let r=i.intersect?oo(t,o,s,n):so(t,o,s,!1,n);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;t<i.length;++t)r.push({element:i[t],datasetIndex:e,index:t})}return r},point(t,e,i,n){const o=Qn(e,t),s=i.axis||"xy";return oo(t,o,s,n)},nearest(t,e,i,n){const o=Qn(e,t),s=i.axis||"xy";return so(t,o,s,i.intersect,n)},x(t,e,i,n){return i.axis="x",ro(t,e,i,n)},y(t,e,i,n){return i.axis="y",ro(t,e,i,n)}}};const lo=["left","top","right","bottom"];function co(t,e){return t.filter(t=>t.pos===e)}function ho(t,e){return t.filter(t=>-1===lo.indexOf(t.pos)&&t.box.axis===e)}function uo(t,e){return t.sort((t,i)=>{const n=e?i:t,o=e?t:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function fo(t){const e=[];let i,n,o;for(i=0,n=(t||[]).length;i<n;++i)o=t[i],e.push({index:i,box:o,pos:o.position,horizontal:o.isHorizontal(),weight:o.weight});return e}function go(t,e){let i,n,o;for(i=0,n=t.length;i<n;++i)o=t[i],o.horizontal?(o.width=o.box.fullSize&&e.availableWidth,o.height=e.hBoxMaxHeight):(o.width=e.vBoxMaxWidth,o.height=o.box.fullSize&&e.availableHeight)}function po(t){const e=fo(t),i=uo(e.filter(t=>t.box.fullSize),!0),n=uo(co(e,"left"),!0),o=uo(co(e,"right")),s=uo(co(e,"top"),!0),r=uo(co(e,"bottom")),a=ho(e,"x"),l=ho(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:o.concat(l).concat(r).concat(a),chartArea:co(e,"chartArea"),vertical:n.concat(o).concat(l),horizontal:s.concat(r).concat(a)}}function mo(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function xo(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 bo(t,e,i){const n=i.box,o=t.maxPadding;f(i.pos)||(i.size&&(t[i.pos]-=i.size),i.size=i.horizontal?n.height:n.width,t[i.pos]+=i.size),n.getPadding&&xo(o,n.getPadding());const s=Math.max(0,e.outerWidth-mo(o,t,"left","right")),r=Math.max(0,e.outerHeight-mo(o,t,"top","bottom")),a=s!==t.w,l=r!==t.h;return t.w=s,t.h=r,i.horizontal?{same:a,other:l}:{same:l,other:a}}function _o(t){const e=t.maxPadding;function i(i){const 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")}function yo(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function vo(t,e,i){const n=[];let o,s,r,a,l,c;for(o=0,s=t.length,l=0;o<s;++o){r=t[o],a=r.box,a.update(r.width||e.w,r.height||e.h,yo(r.horizontal,e));const{same:s,other:h}=bo(e,i,r);l|=s&&n.length,c=c||h,a.fullSize||n.push(r)}return l&&vo(n,e,i)||c}function wo(t,e,i){const n=i.padding;let o,s,r,a,l=e.x,c=e.y;for(o=0,s=t.length;o<s;++o)r=t[o],a=r.box,r.horizontal?(a.left=a.fullSize?n.left:e.left,a.right=a.fullSize?i.outerWidth-n.right:e.left+e.w,a.top=c,a.bottom=c+a.height,a.width=a.right-a.left,c=a.bottom):(a.left=l,a.right=l+a.width,a.top=a.fullSize?n.top:e.top,a.bottom=a.fullSize?i.outerHeight-n.right:e.top+e.h,a.height=a.bottom-a.top,l=a.right);e.x=l,e.y=c}ae.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var Mo={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){const 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;const o=Ce(t.options.layout.padding),s=Math.max(e-o.width,0),r=Math.max(i-o.height,0),a=po(t.boxes),l=a.vertical,c=a.horizontal;y(t.boxes,t=>{"function"===typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:s,availableHeight:r,vBoxMaxWidth:s/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},o);xo(u,Ce(n));const f=Object.assign({maxPadding:u,w:s,h:r,x:o.left,y:o.top},o);go(l.concat(c),d),vo(a.fullSize,f,d),vo(l,f,d),vo(c,f,d)&&vo(l,f,d),_o(f),wo(a.leftAndTop,f,d),f.x+=f.w,f.y+=f.h,wo(a.rightAndBottom,f,d),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},y(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h)})}};class ko{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}}class So extends ko{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}}const Po="$chartjs",Do={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Co=t=>null===t||""===t;function Oo(t,e){const i=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t[Po]={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Co(o)){const e=Oi(t,"width");void 0!==e&&(t.width=e)}if(Co(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Oi(t,"height");void 0!==e&&(t.height=e)}return t}const Ao=!!Ci&&{passive:!0};function To(t,e,i){t.addEventListener(e,i,Ao)}function Lo(t,e,i){t.canvas.removeEventListener(e,i,Ao)}function Ro(t,e){const i=Do[t.type]||t.type,{x:n,y:o}=Mi(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==o?o:null}}function Eo(t,e,i){const n=t.canvas,o=n&&pi(n),s=o||n,r=new MutationObserver(t=>{const e=pi(s);t.forEach(t=>{for(let n=0;n<t.addedNodes.length;n++){const o=t.addedNodes[n];o!==s&&o!==e||i(t.target)}})});return r.observe(document,{childList:!0,subtree:!0}),r}function Io(t,e,i){const n=t.canvas,o=n&&pi(n);if(!o)return;const s=new MutationObserver(t=>{t.forEach(t=>{for(let e=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===n){i();break}})});return s.observe(o,{childList:!0}),s}const zo=new Map;let Fo=0;function Vo(){const t=window.devicePixelRatio;t!==Fo&&(Fo=t,zo.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Bo(t,e){zo.size||window.addEventListener("resize",Vo),zo.set(t,e)}function Wo(t){zo.delete(t),zo.size||window.removeEventListener("resize",Vo)}function Ho(t,e,i){const n=t.canvas,s=n&&pi(n);if(!s)return;const r=o((t,e)=>{const n=s.clientWidth;i(t,e),n<s.clientWidth&&i()},window),a=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return a.observe(s),Bo(t,r),a}function No(t,e,i){i&&i.disconnect(),"resize"===e&&Wo(t)}function jo(t,e,i){const n=t.canvas,s=o(e=>{null!==t.ctx&&i(Ro(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return To(n,e,s),s}class $o extends ko{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Oo(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Po])return!1;const i=e[Po].initial;["height","width"].forEach(t=>{const n=i[t];d(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[Po],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),o={attach:Eo,detach:Io,resize:Ho},s=o[e]||jo;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;const o={attach:No,detach:No,resize:No},s=o[e]||Lo;s(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Pi(t,e,i,n)}isAttached(t){const e=pi(t);return!(!e||!pi(e))}}class Yo{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this,n=this.$animations;if(!e||!n)return i;const o={};return t.forEach(t=>{o[t]=n[t]&&n[t].active()?n[t]._to:i[t]}),o}}Yo.defaults={},Yo.defaultRoutes=void 0;const Uo={values(t){return u(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let o,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),s=Xo(t,i)}const r=$(Math.abs(s)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ii(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor($(t)));return 1===n||2===n||5===n?Uo.numeric.call(this,t,e,i):""}};function Xo(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}var qo={formatters:Uo};function Ko(t,e){const i=t.options.ticks,n=i.maxTicksLimit||Zo(t),o=i.major.enabled?Jo(e):[],s=o.length,r=o[0],a=o[s-1],l=[];if(s>n)return Qo(e,l,o,s/n),l;const c=Go(o,e,n);if(s>0){let t,i;const n=s>1?Math.round((a-r)/(s-1)):null;for(ts(e,l,c,d(n)?0:r-n,r),t=0,i=s-1;t<i;t++)ts(e,l,c,o[t],o[t+1]);return ts(e,l,c,a,d(n)?e.length:a+n),l}return ts(e,l,c),l}function Zo(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),o=t._maxLength/i;return Math.floor(Math.min(n,o))}function Go(t,e,i){const n=es(t),o=e.length/i;if(!n)return Math.max(o,1);const s=X(n);for(let r=0,a=s.length-1;r<a;r++){const t=s[r];if(t>o)return t}return Math.max(o,1)}function Jo(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}function Qo(t,e,i,n){let o,s=0,r=i[0];for(n=Math.ceil(n),o=0;o<t.length;o++)o===r&&(e.push(t[o]),s++,r=i[s*n])}function ts(t,e,i,n,o){const s=m(n,0),r=Math.min(m(o,t.length),t.length);let a,l,c,h=0;i=Math.ceil(i),o&&(a=o-n,i=a/Math.floor(a/i)),c=s;while(c<0)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);l<r;l++)l===c&&(e.push(t[l]),h++,c=Math.round(s+h*i))}function es(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}ae.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:qo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ae.route("scale.ticks","color","","color"),ae.route("scale.grid","color","","borderColor"),ae.route("scale.grid","borderColor","","borderColor"),ae.route("scale.title","color","","color"),ae.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),ae.describe("scales",{_fallback:"scale"});const is=t=>"left"===t?"right":"right"===t?"left":t,ns=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function os(t,e){const i=[],n=t.length/e,o=t.length;let s=0;for(;s<o;s+=n)i.push(t[Math.floor(s)]);return i}function ss(t,e,i){const n=t.ticks.length,o=Math.min(e,n-1),s=t._startPixel,r=t._endPixel,a=1e-6;let l,c=t.getPixelForTick(o);if(!(i&&(l=1===n?Math.max(c-s,r-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(o-1))/2,c+=o<e?l:-l,c<s-a||c>r+a)))return c}function rs(t,e){y(t,t=>{const i=t.gc,n=i.length/2;let o;if(n>e){for(o=0;o<n;++o)delete t.data[i[o]];i.splice(0,n)}})}function as(t){return t.drawTicks?t.tickLength:0}function ls(t,e){if(!t.display)return 0;const i=Oe(t.font,e),n=Ce(t.padding),o=u(t.text)?t.text.length:1;return o*i.lineHeight+n.height}function cs(t,e){return Object.assign(Object.create(t),{scale:e,type:"scale"})}function hs(t,e,i){return Object.assign(Object.create(t),{tick:i,index:e,type:"tick"})}function ds(t,e,i){let n=r(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=is(n)),n}function us(t,e,i,n){const{top:o,left:s,bottom:r,right:l}=t;let c,h,d,u=0;return t.isHorizontal()?(h=a(n,s,l),d=ns(t,i,e),c=l-s):(h=ns(t,i,e),d=a(n,r,o),u="left"===i?-H:H),{titleX:h,titleY:d,maxWidth:c,rotation:u}}class fs extends Yo{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){const e=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=p(t,Number.POSITIVE_INFINITY),e=p(e,Number.NEGATIVE_INFINITY),i=p(i,Number.POSITIVE_INFINITY),n=p(n,Number.NEGATIVE_INFINITY),{min:p(t,i),max:p(e,n),minDefined:g(t),maxDefined:g(e)}}getMinMax(t){const e=this;let i,{min:n,max:o,minDefined:s,maxDefined:r}=e.getUserBounds();if(s&&r)return{min:n,max:o};const a=e.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)i=a[l].controller.getMinMax(e,t),s||(n=Math.min(n,i.min)),r||(o=Math.max(o,i.max));return{min:p(n,p(o,n)),max:p(o,p(n,o))}}getPadding(){const t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){_(this.options.beforeUpdate,[this])}update(t,e,i){const n=this,o=n.options.ticks,s=o.sampleSize;n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),n.ticks=null,n._labelSizes=null,n._gridLineItems=null,n._labelItems=null,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n._maxLength=n.isHorizontal()?n.width+i.left+i.right:n.height+i.top+i.bottom,n._dataLimitsCached||(n.beforeDataLimits(),n.determineDataLimits(),n.afterDataLimits(),n._range=Te(n,n.options.grace),n._dataLimitsCached=!0),n.beforeBuildTicks(),n.ticks=n.buildTicks()||[],n.afterBuildTicks();const r=s<n.ticks.length;n._convertTicksToLabels(r?os(n.ticks,s):n.ticks),n.configure(),n.beforeCalculateLabelRotation(),n.calculateLabelRotation(),n.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(n.ticks=Ko(n,n.ticks),n._labelSizes=null),r&&n._convertTicksToLabels(n.ticks),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate()}configure(){const t=this;let e,i,n=t.options.reverse;t.isHorizontal()?(e=t.left,i=t.right):(e=t.top,i=t.bottom,n=!n),t._startPixel=e,t._endPixel=i,t._reversePixels=n,t._length=i-e,t._alignToPixels=t.options.alignToPixels}afterUpdate(){_(this.options.afterUpdate,[this])}beforeSetDimensions(){_(this.options.beforeSetDimensions,[this])}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0}afterSetDimensions(){_(this.options.afterSetDimensions,[this])}_callHooks(t){const e=this;e.chart.notifyPlugins(t,e.getContext()),_(e.options[t],[e])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){_(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this,i=e.options.ticks;let n,o,s;for(n=0,o=t.length;n<o;n++)s=t[n],s.label=_(i.callback,[s.value,n,t],e);for(n=0;n<o;n++)d(t[n].label)&&(t.splice(n,1),o--,n--)}afterTickToLabelConversion(){_(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){_(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this,e=t.options,i=e.ticks,n=t.ticks.length,o=i.minRotation||0,s=i.maxRotation;let r,a,l,c=o;if(!t._isVisible()||!i.display||o>=s||n<=1||!t.isHorizontal())return void(t.labelRotation=o);const h=t._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=rt(t.chart.width-d,0,t.maxWidth);r=e.offset?t.maxWidth/n:f/(n-1),d+6>r&&(r=f/(n-(e.offset?.5:1)),a=t.maxHeight-as(e.grid)-i.padding-ls(e.title,t.chart.options.font),l=Math.sqrt(d*d+u*u),c=Q(Math.min(Math.asin(Math.min((h.highest.height+6)/r,1)),Math.asin(Math.min(a/l,1))-Math.asin(u/l))),c=Math.max(o,Math.min(s,c))),t.labelRotation=c}afterCalculateLabelRotation(){_(this.options.afterCalculateLabelRotation,[this])}beforeFit(){_(this.options.beforeFit,[this])}fit(){const t=this,e={width:0,height:0},{chart:i,options:{ticks:n,title:o,grid:s}}=t,r=t._isVisible(),a=t.isHorizontal();if(r){const r=ls(o,i.options.font);if(a?(e.width=t.maxWidth,e.height=as(s)+r):(e.height=t.maxHeight,e.width=as(s)+r),n.display&&t.ticks.length){const{first:i,last:o,widest:s,highest:r}=t._getLabelSizes(),l=2*n.padding,c=J(t.labelRotation),h=Math.cos(c),d=Math.sin(c);if(a){const i=n.mirror?0:d*s.width+h*r.height;e.height=Math.min(t.maxHeight,e.height+i+l)}else{const i=n.mirror?0:h*s.width+d*r.height;e.width=Math.min(t.maxWidth,e.width+i+l)}t._calculatePadding(i,o,d,h)}}t._handleMargins(),a?(t.width=t._length=i.width-t._margins.left-t._margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=i.height-t._margins.top-t._margins.bottom)}_calculatePadding(t,e,i,n){const o=this,{ticks:{align:s,padding:r},position:a}=o.options,l=0!==o.labelRotation,c="top"!==a&&"x"===o.axis;if(o.isHorizontal()){const a=o.getPixelForTick(0)-o.left,h=o.right-o.getPixelForTick(o.ticks.length-1);let d=0,u=0;l?c?(d=n*t.width,u=i*e.height):(d=i*t.height,u=n*e.width):"start"===s?u=e.width:"end"===s?d=t.width:(d=t.width/2,u=e.width/2),o.paddingLeft=Math.max((d-a+r)*o.width/(o.width-a),0),o.paddingRight=Math.max((u-h+r)*o.width/(o.width-h),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),o.paddingTop=i+r,o.paddingBottom=n+r}}_handleMargins(){const t=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}afterFit(){_(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){const e=this;e.beforeTickToLabelConversion(),e.generateTickLabels(t),e.afterTickToLabelConversion()}_getLabelSizes(){const t=this;let e=t._labelSizes;if(!e){const i=t.options.ticks.sampleSize;let n=t.ticks;i<n.length&&(n=os(n,i)),t._labelSizes=e=t._computeLabelSizes(n,n.length)}return e}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:n}=this,o=[],s=[];let r,a,l,c,h,f,g,p,m,x,b,_=0,y=0;for(r=0;r<e;++r){if(c=t[r].label,h=this._resolveTickFontOptions(r),i.font=f=h.string,g=n[f]=n[f]||{data:{},gc:[]},p=h.lineHeight,m=x=0,d(c)||u(c)){if(u(c))for(a=0,l=c.length;a<l;++a)b=c[a],d(b)||u(b)||(m=ce(i,g.data,g.gc,m,b),x+=p)}else m=ce(i,g.data,g.gc,m,c),x=p;o.push(m),s.push(x),_=Math.max(m,_),y=Math.max(x,y)}rs(n,e);const v=o.indexOf(_),w=s.indexOf(y),M=t=>({width:o[t]||0,height:s[t]||0});return{first:M(0),last:M(e-1),widest:M(v),highest:M(w),widths:o,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){const e=this;e._reversePixels&&(t=1-t);const i=e._startPixel+t*e._length;return at(e._alignToPixels?de(e.chart,i,0):i)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this,i=e.ticks||[];if(t>=0&&t<i.length){const n=i[t];return n.$context||(n.$context=hs(e.getContext(),t,n))}return e.$context||(e.$context=cs(e.chart.getContext(),e))}_tickSize(){const t=this,e=t.options.ticks,i=J(t.labelRotation),n=Math.abs(Math.cos(i)),o=Math.abs(Math.sin(i)),s=t._getLabelSizes(),r=e.autoSkipPadding||0,a=s?s.widest.width+r:0,l=s?s.highest.height+r:0;return t.isHorizontal()?l*n>a*o?a/n:l/o:l*o<a*n?l/n:a/o}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this,i=e.axis,n=e.chart,o=e.options,{grid:s,position:r}=o,a=s.offset,l=e.isHorizontal(),c=e.ticks,h=c.length+(a?1:0),d=as(s),u=[],g=s.setContext(e.getContext()),p=g.drawBorder?g.borderWidth:0,m=p/2,x=function(t){return de(n,t,p)};let b,_,y,v,w,M,k,S,P,D,C,O;if("top"===r)b=x(e.bottom),M=e.bottom-d,S=b-m,D=x(t.top)+m,O=t.bottom;else if("bottom"===r)b=x(e.top),D=t.top,O=x(t.bottom)-m,M=b+m,S=e.top+d;else if("left"===r)b=x(e.right),w=e.right-d,k=b-m,P=x(t.left)+m,C=t.right;else if("right"===r)b=x(e.left),P=t.left,C=x(t.right)-m,w=b+m,k=e.left+d;else if("x"===i){if("center"===r)b=x((t.top+t.bottom)/2+.5);else if(f(r)){const t=Object.keys(r)[0],i=r[t];b=x(e.chart.scales[t].getPixelForValue(i))}D=t.top,O=t.bottom,M=b+m,S=M+d}else if("y"===i){if("center"===r)b=x((t.left+t.right)/2);else if(f(r)){const t=Object.keys(r)[0],i=r[t];b=x(e.chart.scales[t].getPixelForValue(i))}w=b-m,k=w-d,P=t.left,C=t.right}for(_=0;_<h;++_){const t=s.setContext(e.getContext(_)),i=t.lineWidth,o=t.color,r=s.borderDash||[],c=t.borderDashOffset,h=t.tickWidth,d=t.tickColor,f=t.tickBorderDash||[],g=t.tickBorderDashOffset;y=ss(e,_,a),void 0!==y&&(v=de(n,y,i),l?w=k=P=C=v:M=S=D=O=v,u.push({tx1:w,ty1:M,tx2:k,ty2:S,x1:P,y1:D,x2:C,y2:O,width:i,color:o,borderDash:r,borderDashOffset:c,tickWidth:h,tickColor:d,tickBorderDash:f,tickBorderDashOffset:g}))}return e._ticksLength=h,e._borderValue=b,u}_computeLabelItems(t){const e=this,i=e.axis,n=e.options,{position:o,ticks:s}=n,r=e.isHorizontal(),a=e.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=s,g=as(n.grid),p=g+h,m=d?-h:p,x=-J(e.labelRotation),b=[];let _,y,v,w,M,k,S,P,D,C,O,A,T="middle";if("top"===o)k=e.bottom-m,S=e._getXAxisLabelAlignment();else if("bottom"===o)k=e.top+m,S=e._getXAxisLabelAlignment();else if("left"===o){const t=e._getYAxisLabelAlignment(g);S=t.textAlign,M=t.x}else if("right"===o){const t=e._getYAxisLabelAlignment(g);S=t.textAlign,M=t.x}else if("x"===i){if("center"===o)k=(t.top+t.bottom)/2+p;else if(f(o)){const t=Object.keys(o)[0],i=o[t];k=e.chart.scales[t].getPixelForValue(i)+p}S=e._getXAxisLabelAlignment()}else if("y"===i){if("center"===o)M=(t.left+t.right)/2-p;else if(f(o)){const t=Object.keys(o)[0],i=o[t];M=e.chart.scales[t].getPixelForValue(i)}S=e._getYAxisLabelAlignment(g).textAlign}"y"===i&&("start"===l?T="top":"end"===l&&(T="bottom"));const L=e._getLabelSizes();for(_=0,y=a.length;_<y;++_){v=a[_],w=v.label;const t=s.setContext(e.getContext(_));P=e.getPixelForTick(_)+s.labelOffset,D=e._resolveTickFontOptions(_),C=D.lineHeight,O=u(w)?w.length:1;const i=O/2,n=t.color,l=t.textStrokeColor,h=t.textStrokeWidth;let f;if(r?(M=P,A="top"===o?"near"===c||0!==x?-O*C+C/2:"center"===c?-L.highest.height/2-i*C+C:-L.highest.height+C/2:"near"===c||0!==x?C/2:"center"===c?L.highest.height/2-i*C:L.highest.height-O*C,d&&(A*=-1)):(k=P,A=(1-O)*C/2),t.showLabelBackdrop){const e=Ce(t.backdropPadding),i=L.heights[_],n=L.widths[_];let o=k+A-e.top,s=M-e.left;switch(T){case"middle":o-=i/2;break;case"bottom":o-=i;break}switch(S){case"center":s-=n/2;break;case"right":s-=n;break}f={left:s,top:o,width:n+e.width,height:i+e.height,color:t.backdropColor}}b.push({rotation:x,label:w,font:D,color:n,strokeColor:l,strokeWidth:h,textOffset:A,textAlign:S,textBaseline:T,translation:[M,k],backdrop:f})}return b}_getXAxisLabelAlignment(){const t=this,{position:e,ticks:i}=t.options,n=-J(t.labelRotation);if(n)return"top"===e?"left":"right";let o="center";return"start"===i.align?o="left":"end"===i.align&&(o="right"),o}_getYAxisLabelAlignment(t){const e=this,{position:i,ticks:{crossAlign:n,mirror:o,padding:s}}=e.options,r=e._getLabelSizes(),a=t+s,l=r.widest.width;let c,h;return"left"===i?o?(c="left",h=e.right+s):(h=e.right-a,"near"===n?c="right":"center"===n?(c="center",h-=l/2):(c="left",h=e.left)):"right"===i?o?(c="right",h=e.left+s):(h=e.left+a,"near"===n?c="left":"center"===n?(c="center",h+=l/2):(c="right",h=e.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){const t=this;if(t.options.ticks.mirror)return;const e=t.chart,i=t.options.position;return"left"===i||"right"===i?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===i||"bottom"===i?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,s),t.restore())}getLineWidthForValue(t){const e=this,i=e.options.grid;if(!e._isVisible()||!i.display)return 0;const n=e.ticks,o=n.findIndex(e=>e.value===t);if(o>=0){const t=i.setContext(e.getContext(o));return t.lineWidth}return 0}drawGrid(t){const e=this,i=e.options.grid,n=e.ctx,o=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));let s,r;const a=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(i.display)for(s=0,r=o.length;s<r;++s){const t=o[s];i.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),i.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(){const t=this,{chart:e,ctx:i,options:{grid:n}}=t,o=n.setContext(t.getContext()),s=n.drawBorder?o.borderWidth:0;if(!s)return;const r=n.setContext(t.getContext(0)).lineWidth,a=t._borderValue;let l,c,h,d;t.isHorizontal()?(l=de(e,t.left,s)-s/2,c=de(e,t.right,r)+r/2,h=d=a):(h=de(e,t.top,s)-s/2,d=de(e,t.bottom,r)+r/2,l=c=a),i.save(),i.lineWidth=o.borderWidth,i.strokeStyle=o.borderColor,i.beginPath(),i.moveTo(l,h),i.lineTo(c,d),i.stroke(),i.restore()}drawLabels(t){const e=this,i=e.options.ticks;if(!i.display)return;const n=e.ctx,o=e._computeLabelArea();o&&pe(n,o);const s=e._labelItems||(e._labelItems=e._computeLabelItems(t));let r,a;for(r=0,a=s.length;r<a;++r){const t=s[r],e=t.font,i=t.label;t.backdrop&&(n.fillStyle=t.backdrop.color,n.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height));let o=t.textOffset;_e(n,i,0,o,e,t)}o&&me(n)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=Oe(i.font),s=Ce(i.padding),r=i.align;let a=o.lineHeight/2;"bottom"===e?(a+=s.bottom,u(i.text)&&(a+=o.lineHeight*(i.text.length-1))):a+=s.top;const{titleX:l,titleY:c,maxWidth:h,rotation:d}=us(this,a,e,r);_e(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:d,textAlign:ds(r,e,n),textBaseline:"middle",translation:[l,c]})}draw(t){const e=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}_layers(){const t=this,e=t.options,i=e.ticks&&e.ticks.z||0,n=e.grid&&e.grid.z||0;return t._isVisible()&&t.draw===fs.prototype.draw?[{z:n,draw(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:n+1,draw(){t.drawBorder()}},{z:i,draw(e){t.drawLabels(e)}}]:[{z:i,draw(e){t.draw(e)}}]}getMatchingVisibleMetas(t){const e=this,i=e.chart.getSortedVisibleDatasetMetas(),n=e.axis+"AxisID",o=[];let s,r;for(s=0,r=i.length;s<r;++s){const r=i[s];r[n]!==e.id||t&&r.type!==t||o.push(r)}return o}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Oe(e.font)}_maxDigits(){const t=this,e=t._resolveTickFontOptions(0).lineHeight;return(t.isHorizontal()?t.width:t.height)/e}}class gs{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=this,i=Object.getPrototypeOf(t);let n;xs(i)&&(n=e.register(i));const o=e.items,s=t.id,r=e.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in o||(o[s]=t,ps(t,r,n),e.override&&ae.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in ae[n]&&(delete ae[n][i],this.override&&delete ie[i])}}function ps(t,e,i){const n=S(Object.create(null),[i?ae.get(i):{},ae.get(e),t.defaults]);ae.set(e,n),t.defaultRoutes&&ms(e,t.defaultRoutes),t.descriptors&&ae.describe(e,t.descriptors)}function ms(t,e){Object.keys(e).forEach(i=>{const n=i.split("."),o=n.pop(),s=[t].concat(n).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");ae.route(s,o,l,a)})}function xs(t){return"id"in t&&"defaults"in t}class bs{constructor(){this.controllers=new gs(On,"datasets",!0),this.elements=new gs(Yo,"elements"),this.plugins=new gs(Object,"plugins"),this.scales=new gs(fs,"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){const n=this;[...e].forEach(e=>{const o=i||n._getRegistryForType(e);i||o.isForType(e)||o===n.plugins&&e.id?n._exec(t,o,e):y(e,e=>{const o=i||n._getRegistryForType(e);n._exec(t,o,e)})})}_exec(t,e,i){const n=L(t);_(i["before"+n],[],i),e[t](i),_(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var _s=new bs;class ys{constructor(){this._init=[]}notify(t,e,i,n){const o=this;"beforeInit"===e&&(o._init=o._createDescriptors(t,!0),o._notify(o._init,t,"install"));const s=n?o._descriptors(t).filter(n):o._descriptors(t),r=o._notify(s,t,e,i);return"destroy"===e&&(o._notify(s,t,"stop"),o._notify(o._init,t,"uninstall")),r}_notify(t,e,i,n){n=n||{};for(const o of t){const t=o.plugin,s=t[i],r=[e,n,o.options];if(!1===_(s,r,t)&&n.cancelable)return!1}return!0}invalidate(){d(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=m(i.options&&i.options.plugins,{}),o=vs(i);return!1!==n||e?Ms(t,o,n,e):[]}_notifyStateChanges(t){const 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")}}function vs(t){const e=[],i=Object.keys(_s.plugins.items);for(let o=0;o<i.length;o++)e.push(_s.getPlugin(i[o]));const n=t.plugins||[];for(let o=0;o<n.length;o++){const t=n[o];-1===e.indexOf(t)&&e.push(t)}return e}function ws(t,e){return e||!1!==t?!0===t?{}:t:null}function Ms(t,e,i,n){const o=[],s=t.getContext();for(let r=0;r<e.length;r++){const a=e[r],l=a.id,c=ws(i[l],n);null!==c&&o.push({plugin:a,options:ks(t.config,a,c,s)})}return o}function ks(t,e,i,n){const o=t.pluginScopeKeys(e),s=t.getOptionScopes(i,o);return t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ss(t,e){const i=ae.datasets[t]||{},n=(e.datasets||{})[t]||{};return n.indexAxis||e.indexAxis||i.indexAxis||"x"}function Ps(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}function Ds(t,e){return t===e?"_index_":"_value_"}function Cs(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Os(t,e){return"x"===t||"y"===t?t:e.axis||Cs(e.position)||t.charAt(0).toLowerCase()}function As(t,e){const i=ie[t.type]||{scales:{}},n=e.scales||{},o=Ss(t.type,e),s=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t],a=Os(t,e),l=Ds(a,o),c=i.scales||{};s[a]=s[a]||t,r[t]=P(Object.create(null),[{axis:a},e,c[a],c[l]])}),t.data.datasets.forEach(i=>{const o=i.type||t.type,a=i.indexAxis||Ss(o,e),l=ie[o]||{},c=l.scales||{};Object.keys(c).forEach(t=>{const e=Ps(t,a),o=i[e+"AxisID"]||s[e]||e;r[o]=r[o]||Object.create(null),P(r[o],[{axis:e},n[o],c[t]])})}),Object.keys(r).forEach(t=>{const e=r[t];P(e,[ae.scales[e.type],ae.scale])}),r}function Ts(t){const e=t.options||(t.options={});e.plugins=m(e.plugins,{}),e.scales=As(t,e)}function Ls(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Rs(t){return t=t||{},t.data=Ls(t.data),Ts(t),t}const Es=new Map,Is=new Set;function zs(t,e){let i=Es.get(t);return i||(i=e(),Es.set(t,i),Is.add(i)),i}const Fs=(t,e,i)=>{const n=T(e,i);void 0!==n&&t.add(n)};class Vs{constructor(t){this._config=Rs(t),this._scopeCache=new Map,this._resolverCache=new Map}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=Ls(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ts(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return zs(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return zs(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return zs(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return zs(`${i}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,s=this._cachedScopes(t,i),r=s.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>Fs(a,t,e))),e.forEach(t=>Fs(a,n,t)),e.forEach(t=>Fs(a,ie[o]||{},t)),e.forEach(t=>Fs(a,ae,t)),e.forEach(t=>Fs(a,ne,t))});const l=[...a];return Is.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ie[e]||{},ae.datasets[e]||{},{type:e},ae,ne]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:s,subPrefixes:r}=Bs(this._resolverCache,t,n);let a=s;if(Ws(s,e)){o.$shared=!1,i=E(i)?i():i;const e=this.createResolver(t,i,r);a=He(s,i,e)}for(const l of e)o[l]=a[l];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Bs(this._resolverCache,t,i);return f(e)?He(o,e,void 0,n):o}}function Bs(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const o=i.join();let s=n.get(o);if(!s){const t=We(e,i);s={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(o,s)}return s}function Ws(t,e){const{isScriptable:i,isIndexable:n}=Ne(t);for(const o of e)if(i(o)&&E(t[o])||n(o)&&u(t[o]))return!0;return!1}var Hs="3.3.0";const Ns=["top","bottom","left","right","chartArea"];function js(t,e){return"top"===t||"bottom"===t||-1===Ns.indexOf(t)&&"x"===e}function $s(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Ys(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),_(i&&i.onComplete,[t],e)}function Us(t){const e=t.chart,i=e.options.animation;_(i&&i.onProgress,[t],e)}function Xs(){return"undefined"!==typeof window&&"undefined"!==typeof document}function qs(t){return Xs()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Ks={},Zs=t=>{const e=qs(t);return Object.values(Ks).filter(t=>t.canvas===e).pop()};class Gs{constructor(t,e){const i=this;this.config=e=new Vs(e);const n=qs(t),o=Zs(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas can be reused.");const r=e.createResolver(e.chartOptionScopes(),i.getContext());this.platform=i._initializePlatform(n,e);const a=i.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;this.id=h(),this.ctx=a,this.canvas=l,this.width=d,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this.scale=void 0,this._plugins=new ys,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=s(()=>this.update("resize"),r.resizeDelay||0),Ks[i.id]=i,a&&l?(tn.listen(i,"complete",Ys),tn.listen(i,"progress",Us),i._initialize(),i.attached&&i.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return d(t)?e&&o?o: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(){const t=this;return t.notifyPlugins("beforeInit"),t.options.responsive?t.resize():Di(t,t.options.devicePixelRatio),t.bindEvents(),t.notifyPlugins("afterInit"),t}_initializePlatform(t,e){return e.platform?new e.platform:!Xs()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?new So:new $o}clear(){return ue(this.canvas,this.ctx),this}stop(){return tn.stop(this),this}resize(t,e){tn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this,n=i.options,o=i.canvas,s=n.maintainAspectRatio&&i.aspectRatio,r=i.platform.getMaximumSize(o,t,e,s),a=n.devicePixelRatio||i.platform.getDevicePixelRatio();i.width=r.width,i.height=r.height,i._aspectRatio=i.aspectRatio,Di(i,a,!0)&&(i.notifyPlugins("resize",{size:r}),_(n.onResize,[i,r],i),i.attached&&i._doResize()&&i.render())}ensureScalesHaveIDs(){const t=this.options,e=t.scales||{};y(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this,e=t.options,i=e.scales,n=t.scales,o=Object.keys(n).reduce((t,e)=>(t[e]=!1,t),{});let s=[];i&&(s=s.concat(Object.keys(i).map(t=>{const e=i[t],n=Os(t,e),o="r"===n,s="x"===n;return{options:e,dposition:o?"chartArea":s?"bottom":"left",dtype:o?"radialLinear":s?"category":"linear"}}))),y(s,i=>{const s=i.options,r=s.id,a=Os(r,s),l=m(s.type,i.dtype);void 0!==s.position&&js(s.position,a)===js(i.dposition)||(s.position=i.dposition),o[r]=!0;let c=null;if(r in n&&n[r].type===l)c=n[r];else{const e=_s.getScale(l);c=new e({id:r,type:l,ctx:t.ctx,chart:t}),n[c.id]=c}c.init(s,e)}),y(o,(t,e)=>{t||delete n[e]}),y(n,e=>{Mo.configure(t,e,e.options),Mo.addBox(t,e)})}_updateMetasetIndex(t,e){const i=this._metasets,n=t.index;n!==e&&(i[n]=i[e],i[e]=t,t.index=e)}_updateMetasets(){const t=this,e=t._metasets,i=t.data.datasets.length,n=e.length;if(n>i){for(let e=i;e<n;++e)t._destroyDatasetMeta(e);e.splice(i,n-i)}t._sortedMetasets=e.slice(0).sort($s("order","index"))}_removeUnreferencedMetasets(){const t=this,{_metasets:e,data:{datasets:i}}=t;e.length>i.length&&delete t._stacks,e.forEach((e,n)=>{0===i.filter(t=>t===e._dataset).length&&t._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=this,e=[],i=t.data.datasets;let n,o;for(t._removeUnreferencedMetasets(),n=0,o=i.length;n<o;n++){const o=i[n];let s=t.getDatasetMeta(n);const r=o.type||t.config.type;if(s.type&&s.type!==r&&(t._destroyDatasetMeta(n),s=t.getDatasetMeta(n)),s.type=r,s.indexAxis=o.indexAxis||Ss(r,t.options),s.order=o.order||0,t._updateMetasetIndex(s,n),s.label=""+o.label,s.visible=t.isDatasetVisible(n),s.controller)s.controller.updateIndex(n),s.controller.linkScales();else{const i=_s.getController(r),{datasetElementType:o,dataElementType:a}=ae.datasets[r];Object.assign(i.prototype,{dataElementType:_s.getElement(a),datasetElementType:o&&_s.getElement(o)}),s.controller=new i(t,n),e.push(s.controller)}}return t._updateMetasets(),e}_resetElements(){const t=this;y(t.data.datasets,(e,i)=>{t.getDatasetMeta(i).controller.reset()},t)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this,i=e.config;i.update(),e._options=i.createResolver(i.chartOptionScopes(),e.getContext()),y(e.scales,t=>{Mo.removeBox(e,t)});const n=e._animationsDisabled=!e.options.animation;e.ensureScalesHaveIDs(),e.buildOrUpdateScales();const o=new Set(Object.keys(e._listeners)),s=new Set(e.options.events);if(I(o,s)&&!!this._responsiveListeners===e.options.responsive||(e.unbindEvents(),e.bindEvents()),e._plugins.invalidate(),!1===e.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=e.buildOrUpdateControllers();e.notifyPlugins("beforeElementsUpdate");let a=0;for(let l=0,c=e.data.datasets.length;l<c;l++){const{controller:t}=e.getDatasetMeta(l),i=!n&&-1===r.indexOf(t);t.buildOrUpdateElements(i),a=Math.max(+t.getMaxOverflow(),a)}e._minPadding=a,e._updateLayout(a),n||y(r,t=>{t.reset()}),e._updateDatasets(t),e.notifyPlugins("afterUpdate",{mode:t}),e._layers.sort($s("z","_idx")),e._lastEvent&&e._eventHandler(e._lastEvent,!0),e.render()}_updateLayout(t){const e=this;if(!1===e.notifyPlugins("beforeLayout",{cancelable:!0}))return;Mo.update(e,e.width,e.height,t);const i=e.chartArea,n=i.width<=0||i.height<=0;e._layers=[],y(e.boxes,t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),e._layers.push(...t._layers()))},e),e._layers.forEach((t,e)=>{t._idx=e}),e.notifyPlugins("afterLayout")}_updateDatasets(t){const e=this,i="function"===typeof t;if(!1!==e.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let n=0,o=e.data.datasets.length;n<o;++n)e._updateDataset(n,i?t({datasetIndex:n}):t);e.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this,n=i.getDatasetMeta(t),o={meta:n,index:t,mode:e,cancelable:!0};!1!==i.notifyPlugins("beforeDatasetUpdate",o)&&(n.controller._update(e),o.cancelable=!1,i.notifyPlugins("afterDatasetUpdate",o))}render(){const t=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(tn.has(t)?t.attached&&!tn.running(t)&&tn.start(t):(t.draw(),Ys({chart:t})))}draw(){const t=this;let e;if(t._resizeBeforeDraw){const{width:e,height:i}=t._resizeBeforeDraw;t._resize(e,i),t._resizeBeforeDraw=null}if(t.clear(),t.width<=0||t.height<=0)return;if(!1===t.notifyPlugins("beforeDraw",{cancelable:!0}))return;const i=t._layers;for(e=0;e<i.length&&i[e].z<=0;++e)i[e].draw(t.chartArea);for(t._drawDatasets();e<i.length;++e)i[e].draw(t.chartArea);t.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this,i=e._sortedMetasets,n=[];let o,s;for(o=0,s=i.length;o<s;++o){const e=i[o];t&&!e.visible||n.push(e)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){const t=this;if(!1===t.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=t.getSortedVisibleDatasetMetas();for(let i=e.length-1;i>=0;--i)t._drawDataset(e[i]);t.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this,i=e.ctx,n=t._clip,o=e.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==e.notifyPlugins("beforeDatasetDraw",s)&&(pe(i,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?e.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?e.height:o.bottom+n.bottom}),t.controller.draw(),me(i),s.cancelable=!1,e.notifyPlugins("afterDatasetDraw",s))}getElementsAtEventForMode(t,e,i,n){const o=ao.modes[e];return"function"===typeof o?o(this,t,i,n):[]}getDatasetMeta(t){const e=this,i=e.data.datasets[t],n=e._metasets;let o=n.filter(t=>t&&t._dataset===i).pop();return o||(o=n[t]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1}),o}getContext(){return this.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateDatasetVisibility(t,e){const i=this,n=e?"show":"hide",o=i.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,n);i.setDatasetVisibility(t,e),s.update(o,{visible:e}),i.update(e=>e.datasetIndex===t?n:void 0)}hide(t){this._updateDatasetVisibility(t,!1)}show(t){this._updateDatasetVisibility(t,!0)}_destroyDatasetMeta(t){const e=this,i=e._metasets&&e._metasets[t];i&&i.controller&&(i.controller._destroy(),delete e._metasets[t])}destroy(){const t=this,{canvas:e,ctx:i}=t;let n,o;for(t.stop(),tn.remove(t),n=0,o=t.data.datasets.length;n<o;++n)t._destroyDatasetMeta(n);t.config.clearCache(),e&&(t.unbindEvents(),ue(e,i),t.platform.releaseContext(i),t.canvas=null,t.ctx=null),t.notifyPlugins("destroy"),delete Ks[t.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this,e=t._listeners,i=t.platform,n=(n,o)=>{i.addEventListener(t,n,o),e[n]=o},o=function(e,i,n){e.offsetX=i,e.offsetY=n,t._eventHandler(e)};y(t.options.events,t=>n(t,o))}bindResponsiveEvents(){const t=this;t._responsiveListeners||(t._responsiveListeners={});const e=t._responsiveListeners,i=t.platform,n=(n,o)=>{i.addEventListener(t,n,o),e[n]=o},o=(n,o)=>{e[n]&&(i.removeEventListener(t,n,o),delete e[n])},s=(e,i)=>{t.canvas&&t.resize(e,i)};let r;const a=()=>{o("attach",a),t.attached=!0,t.resize(),n("resize",s),n("detach",r)};r=()=>{t.attached=!1,o("resize",s),n("attach",a)},i.isAttached(t.canvas)?a():r()}unbindEvents(){const t=this;y(t._listeners,(e,i)=>{t.platform.removeEventListener(t,i,e)}),t._listeners={},y(t._responsiveListeners,(e,i)=>{t.platform.removeEventListener(t,i,e)}),t._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,s,r,a;for("dataset"===e&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r<a;++r){s=t[r];const e=s&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this,i=e._active||[],n=t.map(({datasetIndex:t,index:i})=>{const n=e.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[i],index:i}}),o=!v(n,i);o&&(e._active=n,e._updateHoverStyles(n,i))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this,o=n.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),r=s(e,t),a=i?t:s(t,e);r.length&&n.updateHoverStyle(r,o.mode,!1),a.length&&o.mode&&n.updateHoverStyle(a,o.mode,!0)}_eventHandler(t,e){const i=this,n={event:t,replay:e,cancelable:!0},o=e=>(e.options.events||this.options.events).includes(t.type);if(!1===i.notifyPlugins("beforeEvent",n,o))return;const s=i._handleEvent(t,e);return n.cancelable=!1,i.notifyPlugins("afterEvent",n,o),(s||n.changed)&&i.render(),i}_handleEvent(t,e){const i=this,{_active:n=[],options:o}=i,s=o.hover,r=e;let a=[],l=!1,c=null;return"mouseout"!==t.type&&(a=i.getElementsAtEventForMode(t,s.mode,s,r),c="click"===t.type?i._lastEvent:t),i._lastEvent=null,ge(t,i.chartArea,i._minPadding)&&(_(o.onHover,[t,a,i],i),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||_(o.onClick,[t,a,i],i)),l=!v(a,n),(l||e)&&(i._active=a,i._updateHoverStyles(a,n,e)),i._lastEvent=c,l}}const Js=()=>y(Gs.instances,t=>t._plugins.invalidate()),Qs=!0;function tr(t,e){const{startAngle:i,endAngle:n,pixelMargin:o,x:s,y:r,outerRadius:a,innerRadius:l}=e;let c=o/a;t.beginPath(),t.arc(s,r,a,i-c,n+c),l>o?(c=o/l,t.arc(s,r,l,n+c,i-c,!0)):t.arc(s,r,o,n+H,i-H),t.closePath(),t.clip()}function er(t){return Se(t,["outerStart","outerEnd","innerStart","innerEnd"])}function ir(t,e,i,n){const o=er(t.options.borderRadius),s=(i-e)/2,r=Math.min(s,n*e/2),a=t=>{const e=(i-Math.min(s,t))*n/2;return rt(t,0,Math.min(s,e))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:rt(o.innerStart,0,r),innerEnd:rt(o.innerEnd,0,r)}}function nr(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function or(t,e,i){const{x:n,y:o,startAngle:s,endAngle:r,pixelMargin:a,innerRadius:l}=e,c=Math.max(e.outerRadius+i-a,0),h=l>0?l+i+a:0,d=r-s,u=Math.max(.001,d*c-i/z)/c,f=(d-u)/2,g=s+f,p=r-f,{outerStart:m,outerEnd:x,innerStart:b,innerEnd:_}=ir(e,h,c,p-g),y=c-m,v=c-x,w=g+m/y,M=p-x/v,k=h+b,S=h+_,P=g+b/k,D=p-_/S;if(t.beginPath(),t.arc(n,o,c,w,M),x>0){const e=nr(v,M,n,o);t.arc(e.x,e.y,x,M,p+H)}const C=nr(S,p,n,o);if(t.lineTo(C.x,C.y),_>0){const e=nr(S,D,n,o);t.arc(e.x,e.y,_,p+H,D+Math.PI)}if(t.arc(n,o,h,p-_/h,g+b/h,!0),b>0){const e=nr(k,P,n,o);t.arc(e.x,e.y,b,P+Math.PI,g-H)}const O=nr(y,g,n,o);if(t.lineTo(O.x,O.y),m>0){const e=nr(y,w,n,o);t.arc(e.x,e.y,m,g-H,w)}t.closePath()}function sr(t,e,i){if(e.fullCircles){e.endAngle=e.startAngle+F,or(t,e,i);for(let i=0;i<e.fullCircles;++i)t.fill()}isNaN(e.circumference)||(e.endAngle=e.startAngle+e.circumference%F),or(t,e,i),t.fill()}function rr(t,e,i){const{x:n,y:o,startAngle:s,endAngle:r,pixelMargin:a}=e,l=Math.max(e.outerRadius-a,0),c=e.innerRadius+a;let h;for(i&&(e.endAngle=e.startAngle+F,tr(t,e),e.endAngle=r,e.endAngle===e.startAngle&&(e.endAngle+=F,e.fullCircles--)),t.beginPath(),t.arc(n,o,c,s+F,s,!0),h=0;h<e.fullCircles;++h)t.stroke();for(t.beginPath(),t.arc(n,o,l,s,s+F),h=0;h<e.fullCircles;++h)t.stroke()}function ar(t,e,i){const{options:n}=e,o="inner"===n.borderAlign;n.borderWidth&&(o?(t.lineWidth=2*n.borderWidth,t.lineJoin="round"):(t.lineWidth=n.borderWidth,t.lineJoin="bevel"),e.fullCircles&&rr(t,e,o),o&&tr(t,e),or(t,e,i),t.stroke())}Object.defineProperties(Gs,{defaults:{enumerable:Qs,value:ae},instances:{enumerable:Qs,value:Ks},overrides:{enumerable:Qs,value:ie},registry:{enumerable:Qs,value:_s},version:{enumerable:Qs,value:Hs},getChart:{enumerable:Qs,value:Zs},register:{enumerable:Qs,value:(...t)=>{_s.add(...t),Js()}},unregister:{enumerable:Qs,value:(...t)=>{_s.remove(...t),Js()}}});class lr extends Yo{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:o,distance:s}=et(n,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=h>=F||st(o,r,a),u=s>=l&&s<=c;return d&&u}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:o,innerRadius:s,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),a=(n+o)/2,l=(s+r)/2;return{x:e+Math.cos(a)*l,y:i+Math.sin(a)*l}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const e=this,i=e.options,n=(i.offset||0)/2;if(e.pixelMargin="inner"===i.borderAlign?.33:0,e.fullCircles=Math.floor(e.circumference/F),0===e.circumference||e.innerRadius<0||e.outerRadius<0)return;t.save();let o=0;if(n){o=n/2;const i=(e.startAngle+e.endAngle)/2;t.translate(Math.cos(i)*o,Math.sin(i)*o),e.circumference>=z&&(o=n)}t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,sr(t,e,o),ar(t,e,o),t.restore()}}function cr(t,e,i=e){t.lineCap=m(i.borderCapStyle,e.borderCapStyle),t.setLineDash(m(i.borderDash,e.borderDash)),t.lineDashOffset=m(i.borderDashOffset,e.borderDashOffset),t.lineJoin=m(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=m(i.borderWidth,e.borderWidth),t.strokeStyle=m(i.borderColor,e.borderColor)}function hr(t,e,i){t.lineTo(i.x,i.y)}function dr(t){return t.stepped?xe:t.tension||"monotone"===t.cubicInterpolationMode?be:hr}function ur(t,e,i={}){const n=t.length,{start:o=0,end:s=n-1}=i,{start:r,end:a}=e,l=Math.max(o,r),c=Math.min(s,a),h=o<r&&s<r||o>a&&s>a;return{count:n,start:l,loop:e.loop,ilen:c<l&&!h?n+c-l:c-l}}function fr(t,e,i,n){const{points:o,options:s}=e,{count:r,start:a,loop:l,ilen:c}=ur(o,i,n),h=dr(s);let d,u,f,{move:g=!0,reverse:p}=n||{};for(d=0;d<=c;++d)u=o[(a+(p?c-d:d))%r],u.skip||(g?(t.moveTo(u.x,u.y),g=!1):h(t,f,u,p,s.stepped),f=u);return l&&(u=o[(a+(p?c:0))%r],h(t,f,u,p,s.stepped)),!!l}function gr(t,e,i,n){const o=e.points,{count:s,start:r,ilen:a}=ur(o,i,n),{move:l=!0,reverse:c}=n||{};let h,d,u,f,g,p,m=0,x=0;const b=t=>(r+(c?a-t:t))%s,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=o[b(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=o[b(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(i<f?f=i:i>g&&(g=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=n,x=0,f=g=i),p=i}_()}function pr(t){const e=t.options,i=e.borderDash&&e.borderDash.length,n=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return n?gr:fr}function mr(t){return t.stepped?Ti:t.tension||"monotone"===t.cubicInterpolationMode?Li:Ai}function xr(t,e,i,n){let o=e._path;o||(o=e._path=new Path2D,e.path(o,i,n)&&o.closePath()),cr(t,e.options),t.stroke(o)}function br(t,e,i,n){const{segments:o,options:s}=e,r=pr(e);for(const a of o)cr(t,s,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}lr.id="arc",lr.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,angle:void 0},lr.defaultRoutes={backgroundColor:"backgroundColor"};const _r="function"===typeof Path2D;function yr(t,e,i,n){_r&&1===e.segments.length?xr(t,e,i,n):br(t,e,i,n)}class vr extends Yo{constructor(t){super(),this.animated=!0,this.options=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,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this,n=i.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!i._pointsUpdated){const o=n.spanGaps?i._loop:i._fullLoop;gi(i._points,n,t,o,e),i._pointsUpdated=!0}}set points(t){const e=this;e._points=t,delete e._segments,delete e._path,e._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=qi(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this,n=i.options,o=t[e],s=i.points,r=Yi(i,{property:e,start:o,end:o});if(!r.length)return;const a=[],l=mr(n);let c,h;for(c=0,h=r.length;c<h;++c){const{start:i,end:h}=r[c],d=s[i],u=s[h];if(d===u){a.push(d);continue}const f=Math.abs((o-d[e])/(u[e]-d[e])),g=l(d,u,f,n.stepped);g[e]=t[e],a.push(g)}return 1===a.length?a[0]:a}pathSegment(t,e,i){const n=pr(this);return n(t,this,e,i)}path(t,e,i){const n=this,o=n.segments,s=pr(n);let r=n._loop;e=e||0,i=i||n.points.length-e;for(const a of o)r&=s(t,n,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,n){const o=this,s=o.options||{},r=o.points||[];r.length&&s.borderWidth&&(t.save(),yr(t,o,i,n),t.restore(),o.animated&&(o._pointsUpdated=!1,o._path=void 0))}}function wr(t,e,i,n){const o=t.options,{[i]:s}=t.getProps([i],n);return Math.abs(e-s)<o.radius+o.hitRadius}vr.id="line",vr.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},vr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},vr.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class Mr extends Yo{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:o,y:s}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-s,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return wr(this,t,"x",e)}inYRange(t,e){return wr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return 2*(e+i)}draw(t){const e=this,i=e.options;e.skip||i.radius<.1||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,fe(t,i,e.x,e.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function kr(t,e){const{x:i,y:n,base:o,width:s,height:r}=t.getProps(["x","y","base","width","height"],e);let a,l,c,h,d;return t.horizontal?(d=r/2,a=Math.min(i,o),l=Math.max(i,o),c=n-d,h=n+d):(d=s/2,a=i-d,l=i+d,c=Math.min(n,o),h=Math.max(n,o)),{left:a,top:c,right:l,bottom:h}}function Sr(t){let e=t.options.borderSkipped;const i={};return e?(e=t.horizontal?Pr(e,"left","right",t.base>t.x):Pr(e,"bottom","top",t.base<t.y),i[e]=!0,i):i}function Pr(t,e,i,n){return n?(t=Dr(t,e,i),t=Cr(t,i,e)):t=Cr(t,e,i),t}function Dr(t,e,i){return t===e?i:t===i?e:t}function Cr(t,e,i){return"start"===t?e:"end"===t?i:t}function Or(t,e,i,n){return t?0:Math.max(Math.min(e,n),i)}function Ar(t,e,i){const n=t.options.borderWidth,o=Sr(t),s=Pe(n);return{t:Or(o.top,s.top,0,i),r:Or(o.right,s.right,0,e),b:Or(o.bottom,s.bottom,0,i),l:Or(o.left,s.left,0,e)}}function Tr(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,s=De(o),r=Math.min(e,i),a=Sr(t),l=n||f(o);return{topLeft:Or(!l||a.top||a.left,s.topLeft,0,r),topRight:Or(!l||a.top||a.right,s.topRight,0,r),bottomLeft:Or(!l||a.bottom||a.left,s.bottomLeft,0,r),bottomRight:Or(!l||a.bottom||a.right,s.bottomRight,0,r)}}function Lr(t){const e=kr(t),i=e.right-e.left,n=e.bottom-e.top,o=Ar(t,i/2,n/2),s=Tr(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:s},inner:{x:e.left+o.l,y:e.top+o.t,w:i-o.l-o.r,h:n-o.t-o.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,s.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(o.b,o.r))}}}}function Rr(t,e,i,n){const o=null===e,s=null===i,r=o&&s,a=t&&!r&&kr(t,n);return a&&(o||e>=a.left&&e<=a.right)&&(s||i>=a.top&&i<=a.bottom)}function Er(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Ir(t,e){t.rect(e.x,e.y,e.w,e.h)}Mr.id="point",Mr.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Mr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class zr extends Yo{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const e=this.options,{inner:i,outer:n}=Lr(this),o=Er(n.radius)?ye:Ir;t.save(),n.w===i.w&&n.h===i.h||(t.beginPath(),o(t,n),t.clip(),o(t,i),t.fillStyle=e.borderColor,t.fill("evenodd")),t.beginPath(),o(t,i),t.fillStyle=e.backgroundColor,t.fill(),t.restore()}inRange(t,e,i){return Rr(this,t,e,i)}inXRange(t,e){return Rr(this,t,null,e)}inYRange(t,e){return Rr(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}zr.id="bar",zr.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},zr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Fr=Object.freeze({__proto__:null,ArcElement:lr,LineElement:vr,PointElement:Mr,BarElement:zr});function Vr(t,e,i,n,o){const s=o.samples||n;if(s>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(s-2);let l=0;const c=e+i-1;let h,d,u,f,g,p=e;for(r[l++]=t[p],h=0;h<s-2;h++){let n,o=0,s=0;const c=Math.floor((h+1)*a)+1+e,m=Math.min(Math.floor((h+2)*a)+1,i)+e,x=m-c;for(n=c;n<m;n++)o+=t[n].x,s+=t[n].y;o/=x,s/=x;const b=Math.floor(h*a)+1+e,_=Math.floor((h+1)*a)+1+e,{x:y,y:v}=t[p];for(u=f=-1,n=b;n<_;n++)f=.5*Math.abs((y-o)*(t[n].y-v)-(y-t[n].x)*(s-v)),f>u&&(u=f,d=t[n],g=n);r[l++]=d,p=g}return r[l++]=t[c],r}function Br(t,e,i,n){let o,s,r,a,l,c,h,u,f,g,p=0,m=0;const x=[],b=e+i-1,_=t[e].x,y=t[b].x,v=y-_;for(o=e;o<e+i;++o){s=t[o],r=(s.x-_)/v*n,a=s.y;const e=0|r;if(e===l)a<f?(f=a,c=o):a>g&&(g=a,h=o),p=(m*p+s.x)/++m;else{const i=o-1;if(!d(c)&&!d(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==u&&e!==i&&x.push({...t[e],x:p}),n!==u&&n!==i&&x.push({...t[n],x:p})}o>0&&i!==u&&x.push(t[i]),x.push(s),l=e,m=0,f=g=a,c=h=u=o}}return x}function Wr(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function Hr(t){t.data.datasets.forEach(t=>{Wr(t)})}function Nr(t,e){const i=e.length;let n,o=0;const{iScale:s}=t,{min:r,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(o=rt(Re(e,s.axis,r).lo,0,i-1)),n=c?rt(Re(e,s.axis,a).hi+1,o,i)-o:i-o,{start:o,count:n}}var jr={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Hr(t);const n=t.width;t.data.datasets.forEach((e,o)=>{const{_data:s,indexAxis:r}=e,a=t.getDatasetMeta(o),l=s||e.data;if("y"===Ae([r,t.options.indexAxis]))return;if("line"!==a.type)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let h,{start:u,count:f}=Nr(a,l);if(f<=4*n)Wr(e);else{switch(d(s)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":h=Vr(l,u,f,n,i);break;case"min-max":h=Br(l,u,f,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=h}})},destroy(t){Hr(t)}};function $r(t,e){const i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}function Yr(t){const e=t.options,i=e.fill;let n=m(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}function Ur(t,e,i){const n=Yr(t);if(f(n))return!isNaN(n.value)&&n;let o=parseFloat(n);return g(o)&&Math.floor(o)===o?("-"!==n[0]&&"+"!==n[0]||(o=e+o),!(o===e||o<0||o>=i)&&o):["origin","start","end","stack"].indexOf(n)>=0&&n}function Xr(t){const{scale:e={},fill:i}=t;let n,o=null;return"start"===i?o=e.bottom:"end"===i?o=e.top:f(i)?o=e.getPixelForValue(i.value):e.getBasePixel&&(o=e.getBasePixel()),g(o)?(n=e.isHorizontal(),{x:n?o:null,y:n?null:o}):null}class qr{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:s}=this;return e=e||{start:0,end:F},t.arc(n,o,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:i+Math.sin(o)*n,angle:o}}}function Kr(t){const{scale:e,fill:i}=t,n=e.options,o=e.getLabels().length,s=[],r=n.reverse?e.max:e.min,a=n.reverse?e.min:e.max;let l,c,h;if(h="start"===i?r:"end"===i?a:f(i)?i.value:e.getBaseValue(),n.grid.circular)return c=e.getPointPositionForValue(0,r),new qr({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(h)});for(l=0;l<o;++l)s.push(e.getPointPositionForValue(l,h));return s}function Zr(t){const e=t.scale||{};return e.getPointPositionForValue?Kr(t):Xr(t)}function Gr(t,e){const{x:i=null,y:n=null}=t||{},o=e.points,s=[];return e.segments.forEach(t=>{const e=o[t.start],r=o[t.end];null!==n?(s.push({x:e.x,y:n}),s.push({x:r.x,y:n})):null!==i&&(s.push({x:i,y:e.y}),s.push({x:i,y:r.y}))}),s}function Jr(t){const{chart:e,scale:i,index:n,line:o}=t,s=[],r=o.segments,a=o.points,l=ta(e,n);l.push(oa({x:null,y:i.bottom},o));for(let c=0;c<r.length;c++){const t=r[c];for(let e=t.start;e<=t.end;e++)ea(s,a[e],l)}return new vr({points:s,options:{}})}const Qr=t=>"line"===t.type&&!t.hidden;function ta(t,e){const i=[],n=t.getSortedVisibleDatasetMetas();for(let o=0;o<n.length;o++){const t=n[o];if(t.index===e)break;Qr(t)&&i.unshift(t.dataset)}return i}function ea(t,e,i){const n=[];for(let o=0;o<i.length;o++){const s=i[o],{first:r,last:a,point:l}=ia(s,e,"x");if(!(!l||r&&a))if(r)n.unshift(l);else if(t.push(l),!a)break}t.push(...n)}function ia(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const o=n[i],s=t.segments,r=t.points;let a=!1,l=!1;for(let c=0;c<s.length;c++){const t=s[c],e=r[t.start][i],n=r[t.end][i];if(o>=e&&o<=n){a=o===e,l=o===n;break}}return{first:a,last:l,point:n}}function na(t){const{chart:e,fill:i,line:n}=t;if(g(i))return $r(e,i);if("stack"===i)return Jr(t);const o=Zr(t);return o instanceof qr?o:oa(o,n)}function oa(t,e){let i=[],n=!1;return u(t)?(n=!0,i=t):i=Gr(t,e),i.length?new vr({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function sa(t,e,i){const n=t[e];let o=n.fill;const s=[e];let r;if(!i)return o;while(!1!==o&&-1===s.indexOf(o)){if(!g(o))return o;if(r=t[o],!r)return!1;if(r.visible)return o;s.push(o),o=r.fill}return!1}function ra(t,e,i){t.beginPath(),e.path(t),t.lineTo(e.last().x,i),t.lineTo(e.first().x,i),t.closePath(),t.clip()}function aa(t,e,i,n){if(n)return;let o=e[t],s=i[t];return"angle"===t&&(o=ot(o),s=ot(s)),{property:t,start:o,end:s}}function la(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ca(t,e,i){const n=t.segments,o=t.points,s=e.points,r=[];for(const a of n){const t=aa(i,o[a.start],o[a.end],a.loop);if(!e.segments){r.push({source:a,target:t,start:o[a.start],end:o[a.end]});continue}const n=Yi(e,t);for(const e of n){const n=aa(i,s[e.start],s[e.end],e.loop),l=$i(a,o,n);for(const o of l)r.push({source:o,target:e,start:{[i]:la(t,n,"start",Math.max)},end:{[i]:la(t,n,"end",Math.min)}})}}return r}function ha(t,e,i){const{top:n,bottom:o}=e.chart.chartArea,{property:s,start:r,end:a}=i||{};"x"===s&&(t.beginPath(),t.rect(r,n,a-r,o-n),t.clip())}function da(t,e,i,n){const o=e.interpolate(i,n);o&&t.lineTo(o.x,o.y)}function ua(t,e){const{line:i,target:n,property:o,color:s,scale:r}=e,a=ca(i,n,o);for(const{source:l,target:c,start:h,end:d}of a){const{style:{backgroundColor:e=s}={}}=l;t.save(),t.fillStyle=e,ha(t,r,aa(o,h,d)),t.beginPath();const a=!!i.pathSegment(t,l);a?t.closePath():da(t,n,d,o);const u=!!n.pathSegment(t,c,{move:a,reverse:!0}),f=a&&u;f||da(t,n,h,o),t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function fa(t,e){const{line:i,target:n,above:o,below:s,area:r,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==o&&(ra(t,n,r.top),ua(t,{line:i,target:n,color:o,scale:a,property:l}),t.restore(),t.save(),ra(t,n,r.bottom)),ua(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore()}function ga(t,e,i){const n=na(e),{line:o,scale:s,axis:r}=e,a=o.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};n&&o.points.length&&(pe(t,i),fa(t,{line:o,target:n,above:h,below:d,area:i,scale:s,axis:r}),me(t))}var pa={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,o=[];let s,r,a,l;for(r=0;r<n;++r)s=t.getDatasetMeta(r),a=s.dataset,l=null,a&&a.options&&a instanceof vr&&(l={visible:t.isDatasetVisible(r),index:r,fill:Ur(a,r,n),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,o.push(l);for(r=0;r<n;++r)l=o[r],l&&!1!==l.fill&&(l.fill=sa(o,r,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,o=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let r=o.length-1;r>=0;--r){const e=o[r].$filler;e&&(e.line.updateControlPoints(s,e.axis),n&&ga(t.ctx,e,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o){const e=n[o].$filler;e&&ga(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&ga(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ma=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}},xa=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class ba extends Yo{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){const n=this;n.maxWidth=t,n.maxHeight=e,n._margins=i,n.setDimensions(),n.buildLabels(),n.fit()}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height)}buildLabels(){const t=this,e=t.options.labels||{};let i=_(e.generateLabels,[t.chart],t)||[];e.filter&&(i=i.filter(i=>e.filter(i,t.chart.data))),e.sort&&(i=i.sort((i,n)=>e.sort(i,n,t.chart.data))),t.options.reverse&&i.reverse(),t.legendItems=i}fit(){const t=this,{options:e,ctx:i}=t;if(!e.display)return void(t.width=t.height=0);const n=e.labels,o=Oe(n.font),s=o.size,r=t._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ma(n,s);let c,h;i.font=o.string,t.isHorizontal()?(c=t.maxWidth,h=t._fitRows(r,s,a,l)+10):(h=t.maxHeight,c=t._fitCols(r,s,a,l)+10),t.width=Math.min(c,e.maxWidth||t.maxWidth),t.height=Math.min(h,e.maxHeight||t.maxHeight)}_fitRows(t,e,i,n){const o=this,{ctx:s,maxWidth:r,options:{labels:{padding:a}}}=o,l=o.legendHitBoxes=[],c=o.lineWidths=[0],h=n+a;let d=t;s.textAlign="left",s.textBaseline="middle";let u=-1,f=-h;return o.legendItems.forEach((t,o)=>{const g=i+e/2+s.measureText(t.text).width;(0===o||c[c.length-1]+g+2*a>r)&&(d+=h,c[c.length-(o>0?0:1)]=0,f+=h,u++),l[o]={left:0,top:f,row:u,width:g,height:n},c[c.length-1]+=g+a}),d}_fitCols(t,e,i,n){const o=this,{ctx:s,maxHeight:r,options:{labels:{padding:a}}}=o,l=o.legendHitBoxes=[],c=o.columnSizes=[],h=r-t;let d=a,u=0,f=0,g=0,p=0,m=0;return o.legendItems.forEach((t,o)=>{const r=i+e/2+s.measureText(t.text).width;o>0&&f+e+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,m++,p=0,u=f=0),u=Math.max(u,r),f+=e+a,l[o]={left:g,top:p,col:m,width:r,height:n},p+=n+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){const t=this;if(!t.options.display)return;const e=t._computeTitleHeight(),{legendHitBoxes:i,options:{align:n,labels:{padding:o}}}=t;if(this.isHorizontal()){let s=0,r=a(n,t.left+o,t.right-t.lineWidths[s]);for(const l of i)s!==l.row&&(s=l.row,r=a(n,t.left+o,t.right-t.lineWidths[s])),l.top+=t.top+e+o,l.left=r,r+=l.width+o}else{let s=0,r=a(n,t.top+e+o,t.bottom-t.columnSizes[s].height);for(const l of i)l.col!==s&&(s=l.col,r=a(n,t.top+e+o,t.bottom-t.columnSizes[s].height)),l.top=r,l.left+=t.left+o,r+=l.height+o}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){const t=this;if(t.options.display){const e=t.ctx;pe(e,t),t._draw(),me(e)}}_draw(){const t=this,{options:e,columnSizes:i,lineWidths:n,ctx:o}=t,{align:s,labels:r}=e,c=ae.color,h=Vi(e.rtl,t.left,t.width),d=Oe(r.font),{color:u,padding:f}=r,g=d.size,p=g/2;let x;t.drawTitle(),o.textAlign=h.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=d.string;const{boxWidth:b,boxHeight:_,itemHeight:y}=ma(r,g),v=function(t,e,i){if(isNaN(b)||b<=0||isNaN(_)||_<0)return;o.save();const n=m(i.lineWidth,1);if(o.fillStyle=m(i.fillStyle,c),o.lineCap=m(i.lineCap,"butt"),o.lineDashOffset=m(i.lineDashOffset,0),o.lineJoin=m(i.lineJoin,"miter"),o.lineWidth=n,o.strokeStyle=m(i.strokeStyle,c),o.setLineDash(m(i.lineDash,[])),r.usePointStyle){const s={radius:b*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},r=h.xPlus(t,b/2),a=e+p;fe(o,s,r,a)}else{const s=e+Math.max((g-_)/2,0),r=h.leftForLtr(t,b),a=De(i.borderRadius);o.beginPath(),Object.values(a).some(t=>0!==t)?ye(o,{x:r,y:s,w:b,h:_,radius:a}):o.rect(r,s,b,_),o.fill(),0!==n&&o.stroke()}o.restore()},w=function(t,e,i){_e(o,i.text,t,e+y/2,d,{strikethrough:i.hidden,textAlign:i.textAlign})},M=t.isHorizontal(),k=this._computeTitleHeight();x=M?{x:a(s,t.left+f,t.right-n[0]),y:t.top+f+k,line:0}:{x:t.left+f,y:a(s,t.top+k+f,t.bottom-i[0].height),line:0},Bi(t.ctx,e.textDirection);const S=y+f;t.legendItems.forEach((e,c)=>{o.strokeStyle=e.fontColor||u,o.fillStyle=e.fontColor||u;const d=o.measureText(e.text).width,m=h.textAlign(e.textAlign||(e.textAlign=r.textAlign)),_=b+g/2+d;let y=x.x,P=x.y;h.setWidth(t.width),M?c>0&&y+_+f>t.right&&(P=x.y+=S,x.line++,y=x.x=a(s,t.left+f,t.right-n[x.line])):c>0&&P+S>t.bottom&&(y=x.x=y+i[x.line].width+f,x.line++,P=x.y=a(s,t.top+k+f,t.bottom-i[x.line].height));const D=h.x(y);v(D,P,e),y=l(m,y+b+p,t.right),w(h.x(y),P,e),M?x.x+=_+f:x.y+=S}),Wi(t.ctx,e.textDirection)}drawTitle(){const t=this,e=t.options,i=e.title,n=Oe(i.font),o=Ce(i.padding);if(!i.display)return;const s=Vi(e.rtl,t.left,t.width),l=t.ctx,c=i.position,h=n.size/2,d=o.top+h;let u,f=t.left,g=t.width;if(this.isHorizontal())g=Math.max(...t.lineWidths),u=t.top+d,f=a(e.align,f,t.right-g);else{const i=t.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);u=d+a(e.align,t.top,t.bottom-i-e.labels.padding-t._computeTitleHeight())}const p=a(c,f,f+g);l.textAlign=s.textAlign(r(c)),l.textBaseline="middle",l.strokeStyle=i.color,l.fillStyle=i.color,l.font=n.string,_e(l,i.text,p,u,n)}_computeTitleHeight(){const t=this.options.title,e=Oe(t.font),i=Ce(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){const i=this;let n,o,s;if(t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom)for(s=i.legendHitBoxes,n=0;n<s.length;++n)if(o=s[n],t>=o.left&&t<=o.left+o.width&&e>=o.top&&e<=o.top+o.height)return i.legendItems[n];return null}handleEvent(t){const e=this,i=e.options;if(!_a(t.type,i))return;const n=e._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const o=e._hoveredItem,s=xa(o,n);o&&!s&&_(i.onLeave,[t,o,e],e),e._hoveredItem=n,n&&!s&&_(i.onHover,[t,n,e],e)}else n&&_(i.onClick,[t,n,e],e)}}function _a(t,e){return!("mousemove"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}var ya={id:"legend",_element:ba,start(t,e,i){const n=t.legend=new ba({ctx:t.ctx,options:i,chart:t});Mo.configure(t,n,i),Mo.addBox(t,n)},stop(t){Mo.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;Mo.configure(t,n,i),n.options=i},afterUpdate(t){const 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){const n=e.datasetIndex,o=i.chart;o.isDatasetVisible(n)?(o.hide(n),e.hidden=!0):(o.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:o,color:s}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const r=t.controller.getStyle(i?0:void 0),a=Ce(r.borderWidth);return{text:e[t.index].label,fillStyle:r.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:(a.width+a.height)/4,strokeStyle:r.borderColor,pointStyle:n||r.pointStyle,rotation:r.rotation,textAlign:o||r.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)}}};class va extends Yo{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this,n=i.options;if(i.left=0,i.top=0,!n.display)return void(i.width=i.height=i.right=i.bottom=0);i.width=i.right=t,i.height=i.bottom=e;const o=u(n.text)?n.text.length:1;i._padding=Ce(n.padding);const s=o*Oe(n.font).lineHeight+i._padding.height;i.isHorizontal()?i.height=s:i.width=s}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:s}=this,r=s.align;let l,c,h,d=0;return this.isHorizontal()?(c=a(r,i,o),h=e+t,l=o-i):("left"===s.position?(c=i+t,h=a(r,n,e),d=-.5*z):(c=o-t,h=a(r,e,n),d=.5*z),l=n-e),{titleX:c,titleY:h,maxWidth:l,rotation:d}}draw(){const t=this,e=t.ctx,i=t.options;if(!i.display)return;const n=Oe(i.font),o=n.lineHeight,s=o/2+t._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:h}=t._drawArgs(s);_e(e,i.text,0,0,n,{color:i.color,maxWidth:c,rotation:h,textAlign:r(i.align),textBaseline:"middle",translation:[a,l]})}}function wa(t,e){const i=new va({ctx:t.ctx,options:e,chart:t});Mo.configure(t,i,e),Mo.addBox(t,i),t.titleBlock=i}var Ma={id:"title",_element:va,start(t,e,i){wa(t,i)},stop(t){const e=t.titleBlock;Mo.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;Mo.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}};const ka={average(t){if(!t.length)return!1;let e,i,n=0,o=0,s=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n+=t.x,o+=t.y,++s}}return{x:n/s,y:o/s}},nearest(t,e){if(!t.length)return!1;let i,n,o,s=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=n.getCenterPoint(),i=it(e,t);i<a&&(a=i,o=n)}}if(o){const t=o.tooltipPosition();s=t.x,r=t.y}return{x:s,y:r}}};function Sa(t,e){return e&&(u(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Pa(t){return("string"===typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Da(t,e){const{element:i,datasetIndex:n,index:o}=e,s=t.getDatasetMeta(n).controller,{label:r,value:a}=s.getLabelAndValue(o);return{chart:t,label:r,parsed:s.getParsed(o),raw:t.data.datasets[n].data[o],formattedValue:a,dataset:s.getDataset(),dataIndex:o,datasetIndex:n,element:i}}function Ca(t,e){const i=t._chart.ctx,{body:n,footer:o,title:s}=t,{boxWidth:r,boxHeight:a}=e,l=Oe(e.bodyFont),c=Oe(e.titleFont),h=Oe(e.footerFont),d=s.length,u=o.length,f=n.length,g=Ce(e.padding);let p=g.height,m=0,x=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x){const t=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*t+(x-f)*l.lineHeight+(x-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let b=0;const _=function(t){m=Math.max(m,i.measureText(t).width+b)};return i.save(),i.font=c.string,y(t.title,_),i.font=l.string,y(t.beforeBody.concat(t.afterBody),_),b=e.displayColors?r+2:0,y(n,t=>{y(t.before,_),y(t.lines,_),y(t.after,_)}),b=0,i.font=h.string,y(t.footer,_),i.restore(),m+=g.width,{width:m,height:p}}function Oa(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}function Aa(t,e,i,n){const{x:o,width:s}=n,r=i.caretSize+i.caretPadding;return"left"===t&&o+s+r>e.width||("right"===t&&o-s-r<0||void 0)}function Ta(t,e,i,n){const{x:o,width:s}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=o<=(a+l)/2?"left":"right":o<=s/2?c="left":o>=r-s/2&&(c="right"),Aa(c,t,e,i)&&(c="center"),c}function La(t,e,i){const n=e.yAlign||Oa(t,i);return{xAlign:e.xAlign||Ta(t,e,i,n),yAlign:n}}function Ra(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}function Ea(t,e,i){let{y:n,height:o}=t;return"top"===e?n+=i:n-="bottom"===e?o+i:o/2,n}function Ia(t,e,i,n){const{caretSize:o,caretPadding:s,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,c=o+s,h=r+s;let d=Ra(e,a);const u=Ea(e,l,c);return"center"===l?"left"===a?d+=c:"right"===a&&(d-=c):"left"===a?d-=h:"right"===a&&(d+=h),{x:rt(d,0,n.width-e.width),y:rt(u,0,n.height-e.height)}}function za(t,e,i){const n=Ce(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Fa(t){return Sa([],Pa(t))}function Va(t,e,i){return Object.assign(Object.create(t),{tooltip:e,tooltipItems:i,type:"tooltip"})}function Ba(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class Wa extends Yo{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this,e=t._cachedAnimations;if(e)return e;const i=t._chart,n=t.options.setContext(t.getContext()),o=n.enabled&&i.options.animation&&n.animations,s=new ln(t._chart,o);return o._cacheable&&(t._cachedAnimations=Object.freeze(s)),s}getContext(){const t=this;return t.$context||(t.$context=Va(t._chart.getContext(),t,t._tooltipItems))}getTitle(t,e){const i=this,{callbacks:n}=e,o=n.beforeTitle.apply(i,[t]),s=n.title.apply(i,[t]),r=n.afterTitle.apply(i,[t]);let a=[];return a=Sa(a,Pa(o)),a=Sa(a,Pa(s)),a=Sa(a,Pa(r)),a}getBeforeBody(t,e){return Fa(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const i=this,{callbacks:n}=e,o=[];return y(t,t=>{const e={before:[],lines:[],after:[]},s=Ba(n,t);Sa(e.before,Pa(s.beforeLabel.call(i,t))),Sa(e.lines,s.label.call(i,t)),Sa(e.after,Pa(s.afterLabel.call(i,t))),o.push(e)}),o}getAfterBody(t,e){return Fa(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const i=this,{callbacks:n}=e,o=n.beforeFooter.apply(i,[t]),s=n.footer.apply(i,[t]),r=n.afterFooter.apply(i,[t]);let a=[];return a=Sa(a,Pa(o)),a=Sa(a,Pa(s)),a=Sa(a,Pa(r)),a}_createItems(t){const e=this,i=e._active,n=e._chart.data,o=[],s=[],r=[];let a,l,c=[];for(a=0,l=i.length;a<l;++a)c.push(Da(e._chart,i[a]));return t.filter&&(c=c.filter((e,i,o)=>t.filter(e,i,o,n))),t.itemSort&&(c=c.sort((e,i)=>t.itemSort(e,i,n))),y(c,i=>{const n=Ba(t.callbacks,i);o.push(n.labelColor.call(e,i)),s.push(n.labelPointStyle.call(e,i)),r.push(n.labelTextColor.call(e,i))}),e.labelColors=o,e.labelPointStyles=s,e.labelTextColors=r,e.dataPoints=c,c}update(t,e){const i=this,n=i.options.setContext(i.getContext()),o=i._active;let s,r=[];if(o.length){const t=ka[n.position].call(i,o,i._eventPosition);r=i._createItems(n),i.title=i.getTitle(r,n),i.beforeBody=i.getBeforeBody(r,n),i.body=i.getBody(r,n),i.afterBody=i.getAfterBody(r,n),i.footer=i.getFooter(r,n);const e=i._size=Ca(i,n),a=Object.assign({},t,e),l=La(i._chart,n,a),c=Ia(n,a,l,i._chart);i.xAlign=l.xAlign,i.yAlign=l.yAlign,s={opacity:1,x:c.x,y:c.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==i.opacity&&(s={opacity:0});i._tooltipItems=r,i.$context=void 0,s&&i._resolveAnimations().update(i,s),t&&n.external&&n.external.call(i,{chart:i._chart,tooltip:i,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{cornerRadius:s,caretSize:r}=i,{x:a,y:l}=t,{width:c,height:h}=e;let d,u,f,g,p,m;return"center"===o?(p=l+h/2,"left"===n?(d=a,u=d-r,g=p+r,m=p-r):(d=a+c,u=d+r,g=p-r,m=p+r),f=d):(u="left"===n?a+s+r:"right"===n?a+c-s-r:this.caretX,"top"===o?(g=l,p=g-r,d=u-r,f=u+r):(g=l+h,p=g+r,d=u+r,f=u-r),m=g),{x1:d,x2:u,x3:f,y1:g,y2:p,y3:m}}drawTitle(t,e,i){const n=this,o=n.title,s=o.length;let r,a,l;if(s){const c=Vi(i.rtl,n.x,n.width);for(t.x=za(n,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=Oe(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l<s;++l)e.fillText(o[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===s&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,n,o){const s=this,r=s.labelColors[i],a=s.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=Oe(o.bodyFont),d=za(s,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+f;if(o.usePointStyle){const e={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=n.leftForLtr(u,c)+c/2,s=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,fe(t,e,i,s),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,fe(t,e,i,s)}else{t.lineWidth=r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const e=n.leftForLtr(u,c),i=n.leftForLtr(n.xPlus(u,1),c-2),s=De(r.borderRadius);Object.values(s).some(t=>0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ye(t,{x:e,y:g,w:c,h:l,radius:s}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ye(t,{x:i,y:g+1,w:c-2,h:l-2,radius:s}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,g,c,l),t.strokeRect(e,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,c-2,l-2))}t.fillStyle=s.labelTextColors[i]}drawBody(t,e,i){const n=this,{body:o}=n,{bodySpacing:s,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c}=i,h=Oe(i.bodyFont);let d=h.lineHeight,u=0;const f=Vi(i.rtl,n.x,n.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},p=f.textAlign(r);let m,x,b,_,v,w,M;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=za(n,p,i),e.fillStyle=i.bodyColor,y(n.beforeBody,g),u=a&&"right"!==p?"center"===r?c/2+1:c+2:0,_=0,w=o.length;_<w;++_){for(m=o[_],x=n.labelTextColors[_],e.fillStyle=x,y(m.before,g),b=m.lines,a&&b.length&&(n._drawColorBox(e,t,_,f,i),d=Math.max(h.lineHeight,l)),v=0,M=b.length;v<M;++v)g(b[v]),d=h.lineHeight;y(m.after,g)}u=0,d=h.lineHeight,y(n.afterBody,g),t.y-=s}drawFooter(t,e,i){const n=this,o=n.footer,s=o.length;let r,a;if(s){const l=Vi(i.rtl,n.x,n.width);for(t.x=za(n,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=Oe(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<s;++a)e.fillText(o[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:s}=this,{x:r,y:a}=t,{width:l,height:c}=i,h=n.cornerRadius;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+h,a),"top"===s&&this.drawCaret(t,e,i,n),e.lineTo(r+l-h,a),e.quadraticCurveTo(r+l,a,r+l,a+h),"center"===s&&"right"===o&&this.drawCaret(t,e,i,n),e.lineTo(r+l,a+c-h),e.quadraticCurveTo(r+l,a+c,r+l-h,a+c),"bottom"===s&&this.drawCaret(t,e,i,n),e.lineTo(r+h,a+c),e.quadraticCurveTo(r,a+c,r,a+c-h),"center"===s&&"left"===o&&this.drawCaret(t,e,i,n),e.lineTo(r,a+h),e.quadraticCurveTo(r,a,r+h,a),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this,i=e._chart,n=e.$animations,o=n&&n.x,s=n&&n.y;if(o||s){const n=ka[t.position].call(e,e._active,e._eventPosition);if(!n)return;const r=e._size=Ca(e,t),a=Object.assign({},n,e._size),l=La(i,t,a),c=Ia(t,a,l,i);o._to===c.x&&s._to===c.y||(e.xAlign=l.xAlign,e.yAlign=l.yAlign,e.width=r.width,e.height=r.height,e.caretX=n.x,e.caretY=n.y,e._resolveAnimations().update(e,c))}}draw(t){const e=this,i=e.options.setContext(e.getContext());let n=e.opacity;if(!n)return;e._updateAnimationTarget(i);const o={width:e.width,height:e.height},s={x:e.x,y:e.y};n=Math.abs(n)<.001?0:n;const r=Ce(i.padding),a=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;i.enabled&&a&&(t.save(),t.globalAlpha=n,e.drawBackground(s,t,o,i),Bi(t,i.textDirection),s.y+=r.top,e.drawTitle(s,t,i),e.drawBody(s,t,i),e.drawFooter(s,t,i),Wi(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this,n=i._active,o=t.map(({datasetIndex:t,index:e})=>{const n=i._chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}),s=!v(n,o),r=i._positionChanged(o,e);(s||r)&&(i._active=o,i._eventPosition=e,i.update(!0))}handleEvent(t,e){const i=this,n=i.options,o=i._active||[];let s=!1,r=[];"mouseout"!==t.type&&(r=i._chart.getElementsAtEventForMode(t,n.mode,n,e),n.reverse&&r.reverse());const a=i._positionChanged(r,t);return s=e||!v(r,o)||a,s&&(i._active=r,(n.enabled||n.external)&&(i._eventPosition={x:t.x,y:t.y},i.update(!0,e))),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,s=ka[o.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}Wa.positioners=ka;var Ha={id:"tooltip",_element:Wa,positioners:ka,afterInit(t,e,i){i&&(t.tooltip=new Wa({_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){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i)&&(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,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:c,title(t){if(t.length>0){const 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:c,beforeBody:c,beforeLabel:c,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return d(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex),i=e.controller.getStyle(t.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex),i=e.controller.getStyle(t.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:c,afterBody:c,beforeFooter:c,footer:c,afterFooter:c}},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"]},Na=Object.freeze({__proto__:null,Decimation:jr,Filler:pa,Legend:ya,Title:Ma,Tooltip:Ha});const ja=(t,e,i)=>"string"===typeof e?t.push(e)-1:isNaN(e)?null:i;function $a(t,e,i){const n=t.indexOf(e);if(-1===n)return ja(t,e,i);const o=t.lastIndexOf(e);return n!==o?i:n}const Ya=(t,e)=>null===t?null:rt(Math.round(t),0,e);class Ua extends fs{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if(d(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:$a(i,t,m(e,t)),Ya(e,i.length-1)}determineDataLimits(){const t=this,{minDefined:e,maxDefined:i}=t.getUserBounds();let{min:n,max:o}=t.getMinMax(!0);"ticks"===t.options.bounds&&(e||(n=0),i||(o=t.getLabels().length-1)),t.min=n,t.max=o}buildTicks(){const t=this,e=t.min,i=t.max,n=t.options.offset,o=[];let s=t.getLabels();s=0===e&&i===s.length-1?s:s.slice(e,i+1),t._valueRange=Math.max(s.length-(n?0:1),1),t._startValue=t.min-(n?.5:0);for(let r=e;r<=i;r++)o.push({value:r});return o}getLabelForValue(t){const e=this,i=e.getLabels();return t>=0&&t<i.length?i[t]:t}configure(){const t=this;super.configure(),t.isHorizontal()||(t._reversePixels=!t._reversePixels)}getPixelForValue(t){const e=this;return"number"!==typeof t&&(t=e.parse(t)),null===t?NaN:e.getPixelForDecimal((t-e._startValue)/e._valueRange)}getPixelForTick(t){const e=this,i=e.ticks;return t<0||t>i.length-1?null:e.getPixelForValue(i[t].value)}getValueForPixel(t){const e=this;return Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange)}getBasePixel(){return this.bottom}}function Xa(t,e){const i=[],n=1e-14,{step:o,min:s,max:r,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:u}=t,f=o||1,g=c-1,{min:p,max:m}=e,x=!d(s),b=!d(r),_=!d(l),y=(m-p)/(h+1);let v,w,M,k,S=U((m-p)/g/f)*f;if(S<n&&!x&&!b)return[{value:p},{value:m}];k=Math.ceil(m/S)-Math.floor(p/S),k>g&&(S=U(k*S/g/f)*f),d(a)||(v=Math.pow(10,a),S=Math.ceil(S*v)/v),w=Math.floor(p/S)*S,M=Math.ceil(m/S)*S,x&&b&&o&&Z((r-s)/o,S/1e3)?(k=Math.min((r-s)/S,c),S=(r-s)/k,w=s,M=r):_?(w=x?s:w,M=b?r:M,k=l-1,S=(M-w)/k):(k=(M-w)/S,k=K(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const P=Math.max(tt(S),tt(w));v=Math.pow(10,d(a)?P:a),w=Math.round(w*v)/v,M=Math.round(M*v)/v;let D=0;for(x&&(u&&w!==s?(i.push({value:s}),w<s&&D++,K(Math.round((w+D*S)*v)/v,s,qa(s,y,t))&&D++):w<s&&D++);D<k;++D)i.push({value:Math.round((w+D*S)*v)/v});return b&&u&&M!==r?K(i[i.length-1].value,r,qa(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&M!==r||i.push({value:M}),i}function qa(t,e,{horizontal:i,minRotation:n}){const o=J(n),s=(i?Math.sin(o):Math.cos(o))||.001,r=.75*e*(""+t).length;return Math.min(e/s,r)}Ua.id="category",Ua.defaults={ticks:{callback:Ua.prototype.getLabelForValue}};class Ka extends fs{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 d(t)||("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const t=this,{beginAtZero:e}=t.options,{minDefined:i,maxDefined:n}=t.getUserBounds();let{min:o,max:s}=t;const r=t=>o=i?o:t,a=t=>s=n?s:t;if(e){const t=Y(o),e=Y(s);t<0&&e<0?a(0):t>0&&e>0&&r(0)}o===s&&(a(s+1),e||r(o-1)),t.min=o,t.max=s}getTickLimit(){const t=this,e=t.options.ticks;let i,{maxTicksLimit:n,stepSize:o}=e;return o?i=Math.ceil(t.max/o)-Math.floor(t.min/o)+1:(i=t.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this,e=t.options,i=e.ticks;let n=t.getTickLimit();n=Math.max(2,n);const o={maxTicks:n,min:e.min,max:e.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:t._maxDigits(),horizontal:t.isHorizontal(),minRotation:i.minRotation||0,includeBounds:!1!==i.includeBounds},s=t._range||t,r=Xa(o,s);return"ticks"===e.bounds&&G(r,t,"value"),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),r}configure(){const t=this,e=t.ticks;let i=t.min,n=t.max;if(super.configure(),t.options.offset&&e.length){const t=(n-i)/Math.max(e.length-1,1)/2;i-=t,n+=t}t._startValue=i,t._endValue=n,t._valueRange=n-i}getLabelForValue(t){return Ii(t,this.chart.options.locale)}}class Za extends Ka{determineDataLimits(){const t=this,{min:e,max:i}=t.getMinMax(!0);t.min=g(e)?e:0,t.max=g(i)?i:1,t.handleTickRangeOptions()}computeTickLimit(){const t=this,e=t.isHorizontal(),i=e?t.width:t.height,n=J(t.options.ticks.minRotation),o=(e?Math.sin(n):Math.cos(n))||.001,s=t._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,s.lineHeight/o))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Ga(t){const e=t/Math.pow(10,Math.floor($(t)));return 1===e}function Ja(t,e){const i=Math.floor($(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),o=[];let s=p(t.min,Math.pow(10,Math.floor($(e.min)))),r=Math.floor($(s)),a=Math.floor(s/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{o.push({value:s,major:Ga(s)}),++a,10===a&&(a=1,++r,l=r>=0?1:l),s=Math.round(a*Math.pow(10,r)*l)/l}while(r<i||r===i&&a<n);const c=p(t.max,s);return o.push({value:c,major:Ga(s)}),o}Za.id="linear",Za.defaults={ticks:{callback:qo.formatters.numeric}};class Qa extends fs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Ka.prototype.parse.apply(this,[t,e]);if(0!==i)return g(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const t=this,{min:e,max:i}=t.getMinMax(!0);t.min=g(e)?Math.max(0,e):null,t.max=g(i)?Math.max(0,i):null,t.options.beginAtZero&&(t._zero=!0),t.handleTickRangeOptions()}handleTickRangeOptions(){const t=this,{minDefined:e,maxDefined:i}=t.getUserBounds();let n=t.min,o=t.max;const s=t=>n=e?n:t,r=t=>o=i?o:t,a=(t,e)=>Math.pow(10,Math.floor($(t))+e);n===o&&(n<=0?(s(1),r(10)):(s(a(n,-1)),r(a(o,1)))),n<=0&&s(a(o,-1)),o<=0&&r(a(n,1)),t._zero&&t.min!==t._suggestedMin&&n===a(t.min,0)&&s(a(n,-1)),t.min=n,t.max=o}buildTicks(){const t=this,e=t.options,i={min:t._userMin,max:t._userMax},n=Ja(i,t);return"ticks"===e.bounds&&G(n,t,"value"),e.reverse?(n.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n}getLabelForValue(t){return void 0===t?"0":Ii(t,this.chart.options.locale)}configure(){const t=this,e=t.min;super.configure(),t._startValue=$(e),t._valueRange=$(t.max)-$(e)}getPixelForValue(t){const e=this;return void 0!==t&&0!==t||(t=e.min),null===t||isNaN(t)?NaN:e.getPixelForDecimal(t===e.min?0:($(t)-e._startValue)/e._valueRange)}getValueForPixel(t){const e=this,i=e.getDecimalForPixel(t);return Math.pow(10,e._startValue+i*e._valueRange)}}function tl(t){const e=t.ticks;if(e.display&&t.display){const t=Ce(e.backdropPadding);return m(e.font&&e.font.size,ae.font.size)+t.height}return 0}function el(t,e,i){return u(i)?{w:he(t,t.font,i),h:i.length*e}:{w:t.measureText(i).width,h:e}}function il(t,e,i,n,o){return t===n||t===o?{start:e-i/2,end:e+i/2}:t<n||t>o?{start:e-i,end:e}:{start:e,end:e+i}}function nl(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},i={};let n,o,s;const r=[],a=[],l=t.getLabels().length;for(n=0;n<l;n++){const l=t.options.pointLabels.setContext(t.getContext(n));a[n]=l.padding,s=t.getPointPosition(n,t.drawingArea+a[n]);const c=Oe(l.font);t.ctx.font=c.string,o=el(t.ctx,c.lineHeight,t._pointLabels[n]),r[n]=o;const h=t.getIndexAngle(n),d=Q(h),u=il(d,s.x,o.w,0,180),f=il(d,s.y,o.h,90,270);u.start<e.l&&(e.l=u.start,i.l=h),u.end>e.r&&(e.r=u.end,i.r=h),f.start<e.t&&(e.t=f.start,i.t=h),f.end>e.b&&(e.b=f.end,i.b=h)}t._setReductions(t.drawingArea,e,i),t._pointLabelItems=[];const c=t.options,h=tl(c),d=t.getDistanceFromCenterForValue(c.ticks.reverse?t.min:t.max);for(n=0;n<l;n++){const e=0===n?h/2:0,i=t.getPointPosition(n,d+e+a[n]),o=Q(t.getIndexAngle(n)),s=r[n];sl(o,s,i);const l=ol(o);let c;c="left"===l?i.x:"center"===l?i.x-s.w/2:i.x-s.w;const u=c+s.w;t._pointLabelItems[n]={x:i.x,y:i.y,textAlign:l,left:c,top:i.y,right:u,bottom:i.y+s.h}}}function ol(t){return 0===t||180===t?"center":t<180?"left":"right"}function sl(t,e,i){90===t||270===t?i.y-=e.h/2:(t>270||t<90)&&(i.y-=e.h)}function rl(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(let o=e-1;o>=0;o--){const e=n.setContext(t.getContext(o)),s=Oe(e.font),{x:r,y:a,textAlign:l,left:c,top:h,right:u,bottom:f}=t._pointLabelItems[o],{backdropColor:g}=e;if(!d(g)){const t=Ce(e.backdropPadding);i.fillStyle=g,i.fillRect(c-t.left,h-t.top,u-c+t.width,f-h+t.height)}_e(i,t._pointLabels[o],r,a+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}function al(t,e,i,n){const{ctx:o}=t;if(i)o.arc(t.xCenter,t.yCenter,e,0,F);else{let i=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(let s=1;s<n;s++)i=t.getPointPosition(s,e),o.lineTo(i.x,i.y)}}function ll(t,e,i,n){const o=t.ctx,s=e.circular,{color:r,lineWidth:a}=e;!s&&!n||!r||!a||i<0||(o.save(),o.strokeStyle=r,o.lineWidth=a,o.setLineDash(e.borderDash),o.lineDashOffset=e.borderDashOffset,o.beginPath(),al(t,i,s,n),o.closePath(),o.stroke(),o.restore())}function cl(t){return q(t)?t:0}Qa.id="logarithmic",Qa.defaults={ticks:{callback:qo.formatters.logarithmic,major:{enabled:!0}}};class hl extends Ka{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=tl(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}determineDataLimits(){const t=this,{min:e,max:i}=t.getMinMax(!1);t.min=g(e)&&!isNaN(e)?e:0,t.max=g(i)&&!isNaN(i)?i:0,t.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/tl(this.options))}generateTickLabels(t){const e=this;Ka.prototype.generateTickLabels.call(e,t),e._pointLabels=e.getLabels().map((t,i)=>{const n=_(e.options.pointLabels.callback,[t,i],e);return n||0===n?n:""})}fit(){const t=this,e=t.options;e.display&&e.pointLabels.display?nl(t):t.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){const n=this;let o=e.l/Math.sin(i.l),s=Math.max(e.r-n.width,0)/Math.sin(i.r),r=-e.t/Math.cos(i.t),a=-Math.max(e.b-(n.height-n.paddingTop),0)/Math.cos(i.b);o=cl(o),s=cl(s),r=cl(r),a=cl(a),n.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(o+s)/2),Math.floor(t-(r+a)/2))),n.setCenterPoint(o,s,r,a)}setCenterPoint(t,e,i,n){const o=this,s=o.width-e-o.drawingArea,r=t+o.drawingArea,a=i+o.drawingArea,l=o.height-o.paddingTop-n-o.drawingArea;o.xCenter=Math.floor((r+s)/2+o.left),o.yCenter=Math.floor((a+l)/2+o.top+o.paddingTop)}getIndexAngle(t){const e=F/this.getLabels().length,i=this.options.startAngle||0;return ot(t*e+J(i))}getDistanceFromCenterForValue(t){const e=this;if(d(t))return NaN;const i=e.drawingArea/(e.max-e.min);return e.options.reverse?(e.max-t)*i:(t-e.min)*i}getValueForDistanceFromCenter(t){if(d(t))return NaN;const e=this,i=t/(e.drawingArea/(e.max-e.min));return e.options.reverse?e.max-i:e.min+i}getPointPosition(t,e){const i=this,n=i.getIndexAngle(t)-H;return{x:Math.cos(n)*e+i.xCenter,y:Math.sin(n)*e+i.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:o}}drawBackground(){const t=this,{backgroundColor:e,grid:{circular:i}}=t.options;if(e){const n=t.ctx;n.save(),n.beginPath(),al(t,t.getDistanceFromCenterForValue(t._endValue),i,t.getLabels().length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const t=this,e=t.ctx,i=t.options,{angleLines:n,grid:o}=i,s=t.getLabels().length;let r,a,l;if(i.pointLabels.display&&rl(t,s),o.display&&t.ticks.forEach((e,i)=>{if(0!==i){a=t.getDistanceFromCenterForValue(e.value);const n=o.setContext(t.getContext(i-1));ll(t,n,a,s)}}),n.display){for(e.save(),r=t.getLabels().length-1;r>=0;r--){const o=n.setContext(t.getContext(r)),{color:s,lineWidth:c}=o;c&&s&&(e.lineWidth=c,e.strokeStyle=s,e.setLineDash(o.borderDash),e.lineDashOffset=o.borderDashOffset,a=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max),l=t.getPointPosition(r,a),e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const t=this,e=t.ctx,i=t.options,n=i.ticks;if(!n.display)return;const o=t.getIndexAngle(0);let s,r;e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach((o,a)=>{if(0===a&&!i.reverse)return;const l=n.setContext(t.getContext(a)),c=Oe(l.font);if(s=t.getDistanceFromCenterForValue(t.ticks[a].value),l.showLabelBackdrop){r=e.measureText(o.label).width,e.fillStyle=l.backdropColor;const t=Ce(l.backdropPadding);e.fillRect(-r/2-t.left,-s-c.size/2-t.top,r+t.width,c.size+t.height)}_e(e,o.label,0,-s,c,{color:l.color})}),e.restore()}drawTitle(){}}hl.id="radialLinear",hl.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:qo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5}},hl.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},hl.descriptors={angleLines:{_fallback:"grid"}};const dl={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}},ul=Object.keys(dl);function fl(t,e){return t-e}function gl(t,e){if(d(e))return null;const i=t._adapter,{parser:n,round:o,isoWeekday:s}=t._parseOpts;let r=e;return"function"===typeof n&&(r=n(r)),g(r)||(r="string"===typeof n?i.parse(r,n):i.parse(r)),null===r?null:(o&&(r="week"!==o||!q(s)&&!0!==s?i.startOf(r,o):i.startOf(r,"isoWeek",s)),+r)}function pl(t,e,i,n){const o=ul.length;for(let s=ul.indexOf(t);s<o-1;++s){const t=dl[ul[s]],o=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(o*t.size))<=n)return ul[s]}return ul[o-1]}function ml(t,e,i,n,o){for(let s=ul.length-1;s>=ul.indexOf(i);s--){const i=ul[s];if(dl[i].common&&t._adapter.diff(o,n,i)>=e-1)return i}return ul[i?ul.indexOf(i):0]}function xl(t){for(let e=ul.indexOf(t)+1,i=ul.length;e<i;++e)if(dl[ul[e]].common)return ul[e]}function bl(t,e,i){if(i){if(i.length){const{lo:n,hi:o}=Le(i,e),s=i[n]>=e?i[n]:i[o];t[s]=!0}}else t[e]=!0}function _l(t,e,i,n){const o=t._adapter,s=+o.startOf(e[0].value,n),r=e[e.length-1].value;let a,l;for(a=s;a<=r;a=+o.add(a,1,n))l=i[a],l>=0&&(e[l].major=!0);return e}function yl(t,e,i){const n=[],o={},s=e.length;let r,a;for(r=0;r<s;++r)a=e[r],o[a]=r,n.push({value:a,major:!1});return 0!==s&&i?_l(t,n,o,i):n}class vl extends fs{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new Jn._date(t.adapters.date);P(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:gl(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this,e=t.options,i=t._adapter,n=e.time.unit||"day";let{min:o,max:s,minDefined:r,maxDefined:a}=t.getUserBounds();function l(t){r||isNaN(t.min)||(o=Math.min(o,t.min)),a||isNaN(t.max)||(s=Math.max(s,t.max))}r&&a||(l(t._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(t.getMinMax(!1))),o=g(o)&&!isNaN(o)?o:+i.startOf(Date.now(),n),s=g(s)&&!isNaN(s)?s:+i.endOf(Date.now(),n)+1,t.min=Math.min(o,s-1),t.max=Math.max(o+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this,e=t.options,i=e.time,n=e.ticks,o="labels"===n.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&o.length&&(t.min=t._userMin||o[0],t.max=t._userMax||o[o.length-1]);const s=t.min,r=t.max,a=Ie(o,s,r);return t._unit=i.unit||(n.autoSkip?pl(i.minUnit,t.min,t.max,t._getLabelCapacity(s)):ml(t,a.length,i.minUnit,t.min,t.max)),t._majorUnit=n.major.enabled&&"year"!==t._unit?xl(t._unit):void 0,t.initOffsets(o),e.reverse&&a.reverse(),yl(t,a,t._majorUnit)}initOffsets(t){const e=this;let i,n,o=0,s=0;e.options.offset&&t.length&&(i=e.getDecimalForValue(t[0]),o=1===t.length?1-i:(e.getDecimalForValue(t[1])-i)/2,n=e.getDecimalForValue(t[t.length-1]),s=1===t.length?n:(n-e.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;o=rt(o,0,r),s=rt(s,0,r),e._offsets={start:o,end:s,factor:1/(o+1+s)}}_generate(){const t=this,e=t._adapter,i=t.min,n=t.max,o=t.options,s=o.time,r=s.unit||pl(s.minUnit,i,n,t._getLabelCapacity(i)),a=m(s.stepSize,1),l="week"===r&&s.isoWeekday,c=q(l)||!0===l,h={};let d,u,f=i;if(c&&(f=+e.startOf(f,"isoWeek",l)),f=+e.startOf(f,c?"day":r),e.diff(n,i,r)>1e5*a)throw new Error(i+" and "+n+" are too far apart with stepSize of "+a+" "+r);const g="data"===o.ticks.source&&t.getDataTimestamps();for(d=f,u=0;d<n;d=+e.add(d,a,r),u++)bl(h,d,g);return d!==n&&"ticks"!==o.bounds&&1!==u||bl(h,d,g),Object.keys(h).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this,i=e._adapter,n=e.options.time;return n.tooltipFormat?i.format(t,n.tooltipFormat):i.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const o=this,s=o.options,r=s.time.displayFormats,a=o._unit,l=o._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major,f=o._adapter.format(t,n||(u?h:c)),g=s.ticks.callback;return g?_(g,[f,e,i],o):f}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){const e=this;return null===t?NaN:(t-e.min)/(e.max-e.min)}getPixelForValue(t){const e=this,i=e._offsets,n=e.getDecimalForValue(t);return e.getPixelForDecimal((i.start+n)*i.factor)}getValueForPixel(t){const e=this,i=e._offsets,n=e.getDecimalForPixel(t)/i.factor-i.end;return e.min+n*(e.max-e.min)}_getLabelSize(t){const e=this,i=e.options.ticks,n=e.ctx.measureText(t).width,o=J(e.isHorizontal()?i.maxRotation:i.minRotation),s=Math.cos(o),r=Math.sin(o),a=e._resolveTickFontOptions(0).size;return{w:n*s+a*r,h:n*r+a*s}}_getLabelCapacity(t){const e=this,i=e.options.time,n=i.displayFormats,o=n[i.unit]||n.millisecond,s=e._tickFormatFunction(t,0,yl(e,[t],e._majorUnit),o),r=e._getLabelSize(s),a=Math.floor(e.isHorizontal()?e.width/r.w:e.height/r.h)-1;return a>0?a:1}getDataTimestamps(){const t=this;let e,i,n=t._cache.data||[];if(n.length)return n;const o=t.getMatchingVisibleMetas();if(t._normalized&&o.length)return t._cache.data=o[0].controller.getAllParsedValues(t);for(e=0,i=o.length;e<i;++e)n=n.concat(o[e].controller.getAllParsedValues(t));return t._cache.data=t.normalize(n)}getLabelTimestamps(){const t=this,e=t._cache.labels||[];let i,n;if(e.length)return e;const o=t.getLabels();for(i=0,n=o.length;i<n;++i)e.push(gl(t,o[i]));return t._cache.labels=t._normalized?e:t.normalize(e)}normalize(t){return Be(t.sort(fl))}}function wl(t,e,i){let n,o,s,r;if(i)n=Math.floor(e),o=Math.ceil(e),s=t[n],r=t[o];else{const i=Le(t,e);s=i.lo,r=i.hi,n=t[s],o=t[r]}const a=o-n;return a?s+(r-s)*(e-n)/a:s}vl.id="time",vl.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Ml extends vl{constructor(t){super(t),this._table=[],this._maxIndex=void 0}initOffsets(){const t=this,e=t._getTimestampsForTable();t._table=t.buildLookupTable(e),t._maxIndex=t._table.length-1,super.initOffsets(e)}buildLookupTable(t){const e=this,{min:i,max:n}=e;if(!t.length)return[{time:i,pos:0},{time:n,pos:1}];const o=[i];let s,r,a;for(s=0,r=t.length;s<r;++s)a=t[s],a>i&&a<n&&o.push(a);return o.push(n),o}_getTimestampsForTable(){const t=this;let e=t._cache.all||[];if(e.length)return e;const i=t.getDataTimestamps(),n=t.getLabelTimestamps();return e=i.length&&n.length?t.normalize(i.concat(n)):i.length?i:n,e=t._cache.all=e,e}getPixelForValue(t,e){const i=this,n=i._offsets,o=i._normalized&&i._maxIndex>0&&!d(e)?e/i._maxIndex:i.getDecimalForValue(t);return i.getPixelForDecimal((n.start+o)*n.factor)}getDecimalForValue(t){return wl(this._table,t)/this._maxIndex}getValueForPixel(t){const e=this,i=e._offsets,n=e.getDecimalForPixel(t)/i.factor-i.end;return wl(e._table,n*this._maxIndex,!0)}}Ml.id="timeseries",Ml.defaults=vl.defaults;var kl=Object.freeze({__proto__:null,CategoryScale:Ua,LinearScale:Za,LogarithmicScale:Qa,RadialLinearScale:hl,TimeScale:vl,TimeSeriesScale:Ml});const Sl=[Kn,Fr,Na,kl]}}]);