var gn=Object.defineProperty;var pn=(i,t,e)=>t in i?gn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var S=(i,t,e)=>(pn(i,typeof t!="symbol"?t+"":t,e),e);/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License */function te(i){return i+.5|0}const ot=(i,t,e)=>Math.max(Math.min(i,e),t);function Wt(i){return ot(te(i*2.55),0,255)}function ht(i){return ot(te(i*255),0,255)}function st(i){return ot(te(i/2.55)/100,0,1)}function ui(i){return ot(te(i*100),0,100)}const q={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},Ye=[..."0123456789ABCDEF"],mn=i=>Ye[i&15],bn=i=>Ye[(i&240)>>4]+Ye[i&15],oe=i=>(i&240)>>4===(i&15),_n=i=>oe(i.r)&&oe(i.g)&&oe(i.b)&&oe(i.a);function xn(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&q[i[1]]*17,g:255&q[i[2]]*17,b:255&q[i[3]]*17,a:t===5?q[i[4]]*17:255}:(t===7||t===9)&&(e={r:q[i[1]]<<4|q[i[2]],g:q[i[3]]<<4|q[i[4]],b:q[i[5]]<<4|q[i[6]],a:t===9?q[i[7]]<<4|q[i[8]]:255})),e}const yn=(i,t)=>i<255?t(i):"";function vn(i){var t=_n(i)?mn:bn;return i?"#"+t(i.r)+t(i.g)+t(i.b)+yn(i.a,t):void 0}const kn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ps(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function wn(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Mn(i,t,e){const s=Ps(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Sn(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-r):h/(o+r),l=Sn(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function ei(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(ht)}function ii(i,t,e){return ei(Ps,i,t,e)}function Pn(i,t,e){return ei(Mn,i,t,e)}function Dn(i,t,e){return ei(wn,i,t,e)}function Ds(i){return(i%360+360)%360}function On(i){const t=kn.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Wt(+t[5]):ht(+t[5]));const n=Ds(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=Pn(n,o,r):t[1]==="hsv"?s=Dn(n,o,r):s=ii(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function Ln(i,t){var e=ti(i);e[0]=Ds(e[0]+t),e=ii(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Tn(i){if(!i)return;const t=ti(i),e=t[0],s=ui(t[1]),n=ui(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${st(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const gi={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"},pi={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 Cn(){const i={},t=Object.keys(pi),e=Object.keys(gi);let s,n,o,r,a;for(s=0;s>16&255,o>>8&255,o&255]}return i}let re;function In(i){re||(re=Cn(),re.transparent=[0,0,0,0]);const t=re[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const An=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Fn(i){const t=An.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Wt(r):ot(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Wt(s):ot(s,0,255)),n=255&(t[4]?Wt(n):ot(n,0,255)),o=255&(t[6]?Wt(o):ot(o,0,255)),{r:s,g:n,b:o,a:e}}}function zn(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${st(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ee=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Pt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function En(i,t,e){const s=Pt(st(i.r)),n=Pt(st(i.g)),o=Pt(st(i.b));return{r:ht(Ee(s+e*(Pt(st(t.r))-s))),g:ht(Ee(n+e*(Pt(st(t.g))-n))),b:ht(Ee(o+e*(Pt(st(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ae(i,t,e){if(i){let s=ti(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=ii(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function Os(i,t){return i&&Object.assign(t||{},i)}function mi(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=ht(i[3]))):(t=Os(i,{r:0,g:0,b:0,a:1}),t.a=ht(t.a)),t}function Rn(i){return i.charAt(0)==="r"?Fn(i):On(i)}class Kt{constructor(t){if(t instanceof Kt)return t;const e=typeof t;let s;e==="object"?s=mi(t):e==="string"&&(s=xn(t)||In(t)||Rn(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=Os(this._rgb);return t&&(t.a=st(t.a)),t}set rgb(t){this._rgb=mi(t)}rgbString(){return this._valid?zn(this._rgb):void 0}hexString(){return this._valid?vn(this._rgb):void 0}hslString(){return this._valid?Tn(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=En(this._rgb,t._rgb,e)),this}clone(){return new Kt(this.rgb)}alpha(t){return this._rgb.a=ht(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=te(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ae(this._rgb,2,t),this}darken(t){return ae(this._rgb,2,-t),this}saturate(t){return ae(this._rgb,1,t),this}desaturate(t){return ae(this._rgb,1,-t),this}rotate(t){return Ln(this._rgb,t),this}}/*! * Chart.js v4.2.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */const Bn=(()=>{let i=0;return()=>i++})();function A(i){return i===null||typeof i>"u"}function F(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function L(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function z(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function U(i,t){return z(i)?i:t}function O(i,t){return typeof i>"u"?t:i}const Hn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function I(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function N(i,t,e,s){let n,o,r;if(F(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;ni,x:i=>i.x,y:i=>i.y};function Vn(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function jn(i){const t=Vn(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function we(i,t){return(_i[t]||(_i[t]=jn(t)))(i)}function si(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Z=i=>typeof i<"u",ft=i=>typeof i=="function",xi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function $n(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const H=Math.PI,X=2*H,Un=X+H,Me=Number.POSITIVE_INFINITY,Yn=H/180,j=H/2,dt=H/4,yi=H*2/3,rt=Math.log10,Ot=Math.sign;function $t(i,t,e){return Math.abs(i-t)n-o).pop(),t}function Gt(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Kn(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Ts(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function oi(i,t,e){e=e||(r=>i[r]1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const _t=(i,t,e,s)=>oi(i,e,s?n=>{const o=i[n][t];return oi[n][t]oi(i,e,s=>i[s][t]>=e);function Jn(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{const s="_onData"+si(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function Mi(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Is.forEach(o=>{delete i[o]}),delete i._chartjs)}function eo(i){const t=new Set;let e,s;for(e=0,s=i.length;e"u"?function(i){return i()}:window.requestAnimationFrame}();function Fs(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,As.call(window,()=>{s=!1,i.apply(t,e)}))}}function io(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const zs=i=>i==="start"?"left":i==="end"?"right":"center",$=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,so=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function no(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:f,maxDefined:d}=r.getUserBounds();f&&(n=tt(Math.min(_t(a,r.axis,c).lo,e?s:_t(t,l,r.getPixelForValue(c)).lo),0,s-1)),d?o=tt(Math.max(_t(a,r.axis,h,!0).hi+1,e?0:_t(t,l,r.getPixelForValue(h),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function oo(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const le=i=>i===0||i===1,Si=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*X/e)),Pi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*X/e)+1,Ut={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*j)+1,easeOutSine:i=>Math.sin(i*j),easeInOutSine:i=>-.5*(Math.cos(H*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>le(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>le(i)?i:Si(i,.075,.3),easeOutElastic:i=>le(i)?i:Pi(i,.075,.3),easeInOutElastic(i){return le(i)?i:i<.5?.5*Si(i*2,.1125,.45):.5+.5*Pi(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ut.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ut.easeInBounce(i*2)*.5:Ut.easeOutBounce(i*2-1)*.5+.5};function Es(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Di(i){return Es(i)?i:new Kt(i)}function Re(i){return Es(i)?i:new Kt(i).saturate(.5).darken(.1).hexString()}const ro=["x","y","borderWidth","radius","tension"],ao=["color","borderColor","backgroundColor"];function lo(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:ao},numbers:{type:"number",properties:ro}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function co(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Oi=new Map;function ho(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Oi.get(e);return s||(s=new Intl.NumberFormat(i,t),Oi.set(e,s)),s}function ri(i,t,e){return ho(t,e).format(i)}const Rs={values(i){return F(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=fo(i,e)}const r=rt(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ri(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(rt(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?Rs.numeric.call(this,i,t,e):""}};function fo(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Ce={formatters:Rs};function uo(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ce.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const yt=Object.create(null),Xe=Object.create(null);function Yt(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;ss.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=(s,n)=>Re(n.backgroundColor),this.hoverBorderColor=(s,n)=>Re(n.borderColor),this.hoverColor=(s,n)=>Re(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Be(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return Be(Xe,t,e)}override(t,e){return Be(yt,t,e)}route(t,e,s,n){const o=Yt(this,t),r=Yt(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return L(l)?Object.assign({},c,l):O(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var R=new go({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[lo,co,uo]);function po(i){return!i||A(i.size)||A(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Se(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function mo(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,f,d;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function Zt(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,yo(i,o),l=0;l+i||0;function Ns(i,t){const e={},s=L(t),n=s?Object.keys(t):t,o=L(i)?s?r=>O(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=Po(o(r));return e}function Do(i){return Ns(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Ws(i){return Ns(i,["topLeft","topRight","bottomLeft","bottomRight"])}function G(i){const t=Do(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function et(i,t){i=i||{},t=t||R.font;let e=O(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=O(i.style,t.style);s&&!(""+s).match(Mo)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:O(i.family,t.family),lineHeight:So(O(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:O(i.weight,t.weight),string:""};return n.string=po(n),n}function ce(i,t,e,s){let n=!0,o,r,a;for(o=0,r=i.length;oe&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function kt(i,t){return Object.assign(Object.create(i),t)}function ai(i,t=[""],e=i,s,n=()=>i[0]){Z(s)||(s=Us("_fallback",i));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:s,_getTarget:n,override:r=>ai([r,...i],t,e,s)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete i[0][a],!0},get(r,a){return js(r,a,()=>Eo(a,t,i,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,a){return Ci(r).includes(a)},ownKeys(r){return Ci(r)},set(r,a,l){const c=r._storage||(r._storage=n());return r[a]=c[a]=l,delete r._keys,!0}})}function Tt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Vs(i,s),setContext:o=>Tt(i,o,e,s),override:o=>Tt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return js(o,r,()=>To(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function Vs(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:ft(e)?e:()=>e,isIndexable:ft(s)?s:()=>s}}const Lo=(i,t)=>i?i+si(t):t,li=(i,t)=>L(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function js(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function To(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return ft(a)&&r.isScriptable(t)&&(a=Co(t,a,i,e)),F(a)&&a.length&&(a=Io(t,a,i,r.isIndexable)),li(t,a)&&(a=Tt(a,n,o&&o[t],r)),a}function Co(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),t=t(o,r||s),a.delete(i),li(i,t)&&(t=ci(n._scopes,n,i,t)),t}function Io(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(Z(o.index)&&s(i))t=t[o.index%t.length];else if(L(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const f=ci(c,n,i,h);t.push(Tt(f,o,r&&r[i],a))}}return t}function $s(i,t,e){return ft(i)?i(t,e):i}const Ao=(i,t)=>i===!0?t:typeof i=="string"?we(t,i):void 0;function Fo(i,t,e,s,n){for(const o of t){const r=Ao(e,o);if(r){i.add(r);const a=$s(r._fallback,e,n);if(Z(a)&&a!==e&&a!==s)return a}else if(r===!1&&Z(s)&&e!==s)return null}return!1}function ci(i,t,e,s){const n=t._rootScopes,o=$s(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Ti(a,r,e,o||e,s);return l===null||Z(o)&&o!==e&&(l=Ti(a,r,o,l,s),l===null)?!1:ai(Array.from(a),[""],n,o,()=>zo(t,e,s))}function Ti(i,t,e,s,n){for(;e;)e=Fo(i,t,e,s,n);return e}function zo(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return F(n)&&L(e)?e:n||{}}function Eo(i,t,e,s){let n;for(const o of t)if(n=Us(Lo(o,i),e),Z(n))return li(i,n)?ci(e,s,i,n):n}function Us(i,t){for(const e of t){if(!e)continue;const s=e[i];if(Z(s))return s}}function Ci(i){let t=i._keys;return t||(t=i._keys=Ro(i._scopes)),t}function Ro(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const Bo=Number.EPSILON||1e-14,Ct=(i,t)=>ti==="x"?"y":"x";function Ho(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=wi(o,n),l=wi(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const f=s*c,d=s*h;return{previous:{x:o.x-f*(r.x-n.x),y:o.y-f*(r.y-n.y)},next:{x:o.x+d*(r.x-n.x),y:o.y+d*(r.y-n.y)}}}function No(i,t,e){const s=i.length;let n,o,r,a,l,c=Ct(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")Vo(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;oi.ownerDocument.defaultView.getComputedStyle(i,null);function Uo(i,t){return Fe(i).getPropertyValue(t)}const Yo=["top","right","bottom","left"];function xt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Yo[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Xo=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Ko(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(Xo(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function mt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Fe(e),o=n.boxSizing==="border-box",r=xt(n,"padding"),a=xt(n,"border","width"),{x:l,y:c,box:h}=Ko(i,e),f=r.left+(h&&a.left),d=r.top+(h&&a.top);let{width:u,height:m}=t;return o&&(u-=r.width+a.width,m-=r.height+a.height),{x:Math.round((l-f)/u*e.width/s),y:Math.round((c-d)/m*e.height/s)}}function qo(i,t,e){let s,n;if(t===void 0||e===void 0){const o=hi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Fe(o),l=xt(a,"border","width"),c=xt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=Pe(a.maxWidth,o,"clientWidth"),n=Pe(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Me,maxHeight:n||Me}}const fe=i=>Math.round(i*10)/10;function Go(i,t,e,s){const n=Fe(i),o=xt(n,"margin"),r=Pe(n.maxWidth,i,"clientWidth")||Me,a=Pe(n.maxHeight,i,"clientHeight")||Me,l=qo(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const d=xt(n,"border","width"),u=xt(n,"padding");c-=u.width+d.width,h-=u.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=fe(Math.min(c,r,l.maxWidth)),h=fe(Math.min(h,a,l.maxHeight)),c&&!h&&(h=fe(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=fe(Math.floor(h*s))),{width:c,height:h}}function Ii(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Zo=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function Ai(i,t){const e=Uo(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function bt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Qo(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Jo(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=bt(i,n,e),a=bt(n,o,e),l=bt(o,t,e),c=bt(r,a,e),h=bt(a,l,e);return bt(c,h,e)}const tr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},er=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function He(i,t,e){return i?tr(t,e):er()}function ir(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function sr(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Ks(i){return i==="angle"?{between:Cs,compare:Gn,normalize:Y}:{between:Dt,compare:(t,e)=>t-e,normalize:t=>t}}function Fi({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function nr(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=Ks(s),l=t.length;let{start:c,end:h,loop:f}=i,d,u;if(f){for(c+=l,h+=l,d=0,u=l;dl(n,w,b)&&a(n,w)!==0,_=()=>a(o,b)===0||l(o,w,b),k=()=>g||P(),v=()=>!g||_();for(let x=h,M=h;x<=f;++x)y=t[x%r],!y.skip&&(b=c(y[s]),b!==w&&(g=l(b,n,o),p===null&&k()&&(p=a(b,n)===0?x:M),p!==null&&v()&&(m.push(Fi({start:p,end:x,loop:d,count:r,style:u})),p=null),M=x,w=b));return p!==null&&m.push(Fi({start:p,end:f,loop:d,count:r,style:u})),m}function Gs(i,t){const e=[],s=i.segments;for(let n=0;nn&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function rr(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function ar(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=or(e,n,o,s);if(s===!0)return zi(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=As.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}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((s,n)=>Math.max(s,n._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 s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var it=new hr;const Ri="transparent",fr={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Di(i||Ri),n=s.valid&&Di(t||Ri);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class dr{constructor(t,e,s,n){const o=e[s];n=ce([t.to,n,o,t.from]);const r=ce([t.from,o,n]);this._active=!0,this._fn=t.fn||fr[t.type||typeof r],this._easing=Ut[t.easing]||Ut.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=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ce([t.to,e,n,t.from]),this._from=ce([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n{const o=t[n];if(!L(o))return;const r={};for(const a of e)r[a]=o[a];(F(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=pr(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&gr(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let f=o[c];const d=s.get(c);if(f)if(d&&f.active()){f.update(d,h,a);continue}else f.cancel();if(!d||!d.duration){t[c]=h;continue}o[c]=f=new dr(d,t,c,h),n.push(f)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return it.add(this._chart,s),!0}}function gr(i,t){const e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function Vi(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=xr(o,r,s),f=t.length;let d;for(let u=0;ue[s].axis===t).shift()}function kr(i,t){return kt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function wr(i,t,e){return kt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Et(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const We=i=>i==="reset"||i==="none",ji=(i,t)=>t?i:Object.assign({},i),Mr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Zs(e,!0),values:null};class Xt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ni(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Et(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(f,d,u,m)=>f==="x"?d:f==="r"?m:u,o=e.xAxisID=O(s.xAxisID,Ne(t,"x")),r=e.yAxisID=O(s.yAxisID,Ne(t,"y")),a=e.rAxisID=O(s.rAxisID,Ne(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Mi(this._data,this),t._stacked&&Et(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(L(e))this._data=_r(e);else if(s!==e){if(s){Mi(s,this);const n=this._cachedMeta;Et(n),n._parsed=[]}e&&Object.isExtensible(e)&&to(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Ni(e.vScale,e),e.stack!==s.stack&&(n=!0,Et(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&Vi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,f,d;if(this._parsing===!1)s._parsed=n,s._sorted=!0,d=n;else{F(n[t])?d=this.parseArrayData(s,n,t,e):L(n[t])?d=this.parseObjectData(s,n,t,e):d=this.parsePrimitiveData(s,n,t,e);const u=()=>f[a]===null||c&&f[a]g||f=0;--d)if(!m()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(s,n,e),g=c.resolveNamedOptions(d,u,m,f);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(ji(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),f);l=h.createResolver(d,this.getContext(t,s,e))}const c=new ur(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||We(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){We(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!We(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a0&&this.getParsed(e-1);for(let _=0;_=y){v.skip=!0;continue}const x=this.getParsed(_),M=A(x[u]),T=v[d]=r.getPixelForValue(x[d],_),D=v[u]=o||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,x,l):x[u],_);v.skip=isNaN(T)||isNaN(D)||M,v.stop=_>0&&Math.abs(x[d]-P[d])>p,g&&(v.parsed=x,v.raw=c.data[_]),f&&(v.options=h||this.resolveDataElementOptions(_,k.active?"active":n)),b||this.updateElement(k,_,v,n),P=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}S(_e,"id","line"),S(_e,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),S(_e,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function gt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class fi{static override(t){Object.assign(fi.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return gt()}parse(){return gt()}format(){return gt()}add(){return gt()}diff(){return gt()}startOf(){return gt()}endOf(){return gt()}}var Sr={_date:fi};function Pr(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Qn:_t;if(s){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const f=l(o,t,e-h),d=l(o,t,e+h);return{lo:f.lo,hi:d.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function ee(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var Tr={evaluateInteractionItems:ee,modes:{index(i,t,e,s){const n=mt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Ve(i,n,o,s,r):je(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,f=c.data[h];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=mt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Ve(i,n,o,s,r):je(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function Ui(i,t){return i.filter(e=>Qs.indexOf(e.pos)===-1&&e.box.axis===t)}function Bt(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Cr(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=Bt(Rt(t,"left"),!0),n=Bt(Rt(t,"right")),o=Bt(Rt(t,"top"),!0),r=Bt(Rt(t,"bottom")),a=Ui(t,"x"),l=Ui(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:Rt(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function Yi(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Js(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function zr(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!L(n)){e.size&&(i[n]-=e.size);const f=s[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?o.height:o.width),e.size=f.size/f.count,i[n]+=e.size}o.getPadding&&Js(r,o.getPadding());const a=Math.max(0,t.outerWidth-Yi(r,i,"left","right")),l=Math.max(0,t.outerHeight-Yi(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Er(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Rr(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Vt(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),d=Object.assign({},n);Js(d,G(s));const u=Object.assign({maxPadding:d,w:o,h:r,x:n.left,y:n.top},n),m=Ar(l.concat(c),f);Vt(a.fullSize,u,f,m),Vt(l,u,f,m),Vt(c,u,f,m)&&Vt(l,u,f,m),Er(u),Xi(a.leftAndTop,u,f,m),u.x+=u.w,u.y+=u.h,Xi(a.rightAndBottom,u,f,m),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},N(a.chartArea,g=>{const p=g.box;Object.assign(p,i.chartArea),p.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class tn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class Br extends tn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const xe="$chartjs",Hr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ki=i=>i===null||i==="";function Nr(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[xe]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ki(n)){const o=Ai(i,"width");o!==void 0&&(i.width=o)}if(Ki(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Ai(i,"height");o!==void 0&&(i.height=o)}return i}const en=Zo?{passive:!0}:!1;function Wr(i,t,e){i.addEventListener(t,e,en)}function Vr(i,t,e){i.canvas.removeEventListener(t,e,en)}function jr(i,t){const e=Hr[i.type]||i.type,{x:s,y:n}=mt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function De(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function $r(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||De(a.addedNodes,s),r=r&&!De(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Ur(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||De(a.removedNodes,s),r=r&&!De(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Qt=new Map;let qi=0;function sn(){const i=window.devicePixelRatio;i!==qi&&(qi=i,Qt.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Yr(i,t){Qt.size||window.addEventListener("resize",sn),Qt.set(i,t)}function Xr(i){Qt.delete(i),Qt.size||window.removeEventListener("resize",sn)}function Kr(i,t,e){const s=i.canvas,n=s&&hi(s);if(!n)return;const o=Fs((a,l)=>{const c=n.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),Yr(i,o),r}function $e(i,t,e){e&&e.disconnect(),t==="resize"&&Xr(i)}function qr(i,t,e){const s=i.canvas,n=Fs(o=>{i.ctx!==null&&e(jr(o,i))},i);return Wr(s,t,n),n}class Gr extends tn{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Nr(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[xe])return!1;const s=e[xe].initial;["height","width"].forEach(o=>{const r=s[o];A(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[xe],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:$r,detach:Ur,resize:Kr}[e]||qr;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:$e,detach:$e,resize:$e}[e]||Vr)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Go(t,e,s,n)}isAttached(t){const e=hi(t);return!!(e&&e.isConnected)}}function Zr(i){return!Xs()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Br:Gr}class vt{constructor(){S(this,"active",!1)}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Gt(this.x)&&Gt(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}S(vt,"defaults",{}),S(vt,"defaultRoutes");function Qr(i,t){const e=i.options.ticks,s=Jr(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?ea(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return ia(t,c,o,r/n),c;const h=ta(o,t,n);if(r>0){let f,d;const u=r>1?Math.round((l-a)/(r-1)):null;for(ue(t,c,h,A(u)?0:a-u,a),f=0,d=r-1;fn)return l}return Math.max(n,1)}function ea(i){const t=[];let e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,Gi=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Zi=(i,t)=>Math.min(t||i,i);function Qi(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;or+a)))return l}function ra(i,t){N(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;os?s:e,s=n&&e>s?e:s,{min:U(e,U(s,e)),max:U(s,U(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Oo(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),f=h.widest.width,d=h.highest.height,u=tt(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/s:u/(s-1),f+6>a&&(a=u/(s-(t.offset?.5:1)),l=this.maxHeight-Ht(t.grid)-e.padding-Ji(t.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),r=ni(Math.min(Math.asin(tt((h.highest.height+6)/a,-1,1)),Math.asin(tt(l/c,-1,1))-Math.asin(tt(d/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Ji(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ht(o)+l):(t.height=this.maxHeight,t.width=Ht(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:f,highest:d}=this._getLabelSizes(),u=s.padding*2,m=at(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){const b=s.mirror?0:p*f.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+b+u)}else{const b=s.mirror?0:g*f.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+b+u)}this._calculatePadding(c,h,p,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,u=0;l?c?(d=n*t.width,u=s*e.height):(d=s*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,u=e.width/2),this.paddingLeft=Math.max((d-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-f+r)*this.width/(this.width-f),0)}else{let h=e.height/2,f=t.height/2;o==="start"?(h=0,f=t.height):o==="end"&&(h=e.height,f=0),this.paddingTop=h+r,this.paddingBottom=f+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){I(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:r[M]||0,height:a[M]||0});return{first:x(0),last:x(e-1),widest:x(k),highest:x(v),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Zn(this._alignToPixels?ut(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/s:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=Ht(o),u=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,p=g/2,b=function(B){return ut(s,B,g)};let y,w,P,_,k,v,x,M,T,D,C,W;if(r==="top")y=b(this.bottom),v=this.bottom-d,M=y-p,D=b(t.top)+p,W=t.bottom;else if(r==="bottom")y=b(this.top),D=t.top,W=b(t.bottom)-p,v=y+p,M=this.top+d;else if(r==="left")y=b(this.right),k=this.right-d,x=y-p,T=b(t.left)+p,C=t.right;else if(r==="right")y=b(this.left),T=t.left,C=b(t.right)-p,k=y+p,x=this.left+d;else if(e==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(L(r)){const B=Object.keys(r)[0],K=r[B];y=b(this.chart.scales[B].getPixelForValue(K))}D=t.top,W=t.bottom,v=y+p,M=v+d}else if(e==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(L(r)){const B=Object.keys(r)[0],K=r[B];y=b(this.chart.scales[B].getPixelForValue(K))}k=y-p,x=k-d,T=t.left,C=t.right}const Q=O(n.ticks.maxTicksLimit,f),E=Math.max(1,Math.ceil(f/Q));for(w=0;wo.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");R.route(o,n,l,a)})}function ua(i){return"id"in i&&"defaults"in i}class ga{constructor(){this.controllers=new ge(Xt,"datasets",!0),this.elements=new ge(vt,"elements"),this.plugins=new ge(Object,"plugins"),this.scales=new ge(wt,"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,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):N(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=si(t);I(s["before"+n],[],s),e[t](s),I(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function ma(i){const t={},e=[],s=Object.keys(J.plugins.items);for(let o=0;o1&&Oe(i[0].toLowerCase(),t),i))return i;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function wa(i,t){const e=yt[i.type]||{scales:{}},s=t.scales||{},n=Ke(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!L(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Oe(r,a),c=va(l,n),h=e.scales||{};o[r]=jt(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||Ke(a,t),h=(yt[a]||{}).scales||{};Object.keys(h).forEach(f=>{const d=ya(f,l),u=r[d+"AxisID"]||d;o[u]=o[u]||Object.create(null),jt(o[u],[{axis:d},s[u],h[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];jt(a,[R.scales[a.type],R.scale])}),o}function nn(i){const t=i.options||(i.options={});t.plugins=O(t.plugins,{}),t.scales=wa(i,t)}function on(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Ma(i){return i=i||{},i.data=on(i.data),nn(i),i}const ts=new Map,rn=new Set;function pe(i,t){let e=ts.get(i);return e||(e=t(),ts.set(i,e),rn.add(e)),e}const Nt=(i,t,e)=>{const s=we(t,e);s!==void 0&&i.add(s)};class Sa{constructor(t){this._config=Ma(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=on(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(),nn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pe(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return pe(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return pe(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return pe(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(f=>Nt(l,t,f))),h.forEach(f=>Nt(l,n,f)),h.forEach(f=>Nt(l,yt[o]||{},f)),h.forEach(f=>Nt(l,R,f)),h.forEach(f=>Nt(l,Xe,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),rn.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,yt[e]||{},R.datasets[e]||{},{type:e},R,Xe]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=es(this._resolverCache,t,n);let l=r;if(Da(r,e)){o.$shared=!1,s=ft(s)?s():s;const c=this.createResolver(t,s,a);l=Tt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=es(this._resolverCache,t,s);return L(e)?Tt(o,e,void 0,n):o}}function es(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:ai(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const Pa=i=>L(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||ft(i[e]),!1);function Da(i,t){const{isScriptable:e,isIndexable:s}=Vs(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(ft(a)||Pa(a))||r&&F(a))return!0}return!1}var Oa="4.2.1";const La=["top","bottom","left","right","chartArea"];function is(i,t){return i==="top"||i==="bottom"||La.indexOf(i)===-1&&t==="x"}function ss(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function ns(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),I(e&&e.onComplete,[i],t)}function Ta(i){const t=i.chart,e=t.options.animation;I(e&&e.onProgress,[i],t)}function an(i){return Xs()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const ye={},os=i=>{const t=an(i);return Object.values(ye).filter(e=>e.canvas===t).pop()};function Ca(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function Ia(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function Aa(i){const{xScale:t,yScale:e}=i;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}class nt{static register(...t){J.add(...t),rs()}static unregister(...t){J.remove(...t),rs()}constructor(t,e){const s=this.config=new Sa(e),n=an(t),o=os(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Zr(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Bn(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new pa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=io(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],ye[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}it.listen(this,"complete",ns),it.listen(this,"progress",Ta),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return A(t)?e&&o?o:n?s/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}get registry(){return J}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ii(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Li(this.canvas,this.ctx),this}stop(){return it.stop(this),this}resize(t,e){it.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ii(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};N(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Oe(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),N(o,r=>{const a=r.options,l=a.id,c=Oe(l,a),h=O(a.type,r.dtype);(a.position===void 0||is(a.position,c)!==is(r.dposition))&&(a.position=r.dposition),n[l]=!0;let f=null;if(l in s&&s[l].type===h)f=s[l];else{const d=J.getScale(h);f=new d({id:l,type:h,ctx:this.ctx,chart:this}),s[f.id]=f}f.init(a,t)}),N(n,(r,a)=>{r||delete s[a]}),N(s,r=>{lt.configure(this,r,r.options),lt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ss("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){N(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!xi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;Ca(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;lt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],N(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=Aa(t)||this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Ie(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&Ae(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Zt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Tr.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=kt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);Z(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),it.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};N(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){N(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},N(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!bi(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=$n(t),c=Ia(t,this._lastEvent,s,l);s&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const h=!bi(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}S(nt,"defaults",R),S(nt,"instances",ye),S(nt,"overrides",yt),S(nt,"registry",J),S(nt,"version",Oa),S(nt,"getChart",os);function rs(){return N(nt.instances,i=>i._plugins.invalidate())}function ln(i,t,e=t){i.lineCap=O(e.borderCapStyle,t.borderCapStyle),i.setLineDash(O(e.borderDash,t.borderDash)),i.lineDashOffset=O(e.borderDashOffset,t.borderDashOffset),i.lineJoin=O(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=O(e.borderWidth,t.borderWidth),i.strokeStyle=O(e.borderColor,t.borderColor)}function Fa(i,t,e){i.lineTo(e.x,e.y)}function za(i){return i.stepped?_o:i.tension||i.cubicInterpolationMode==="monotone"?xo:Fa}function cn(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=na&&o>a;return{count:s,start:l,loop:t.loop,ilen:c(r+(c?a-P:P))%o,w=()=>{g!==p&&(i.lineTo(h,p),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(u=n[y(0)],i.moveTo(u.x,u.y)),d=0;d<=a;++d){if(u=n[y(d)],u.skip)continue;const P=u.x,_=u.y,k=P|0;k===m?(_p&&(p=_),h=(f*h+P)/++f):(w(),i.lineTo(P,_),m=k,f=0,g=p=_),b=_}w()}function qe(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ra:Ea}function Ba(i){return i.stepped?Qo:i.tension||i.cubicInterpolationMode==="monotone"?Jo:bt}function Ha(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),ln(i,t.options),i.stroke(n)}function Na(i,t,e,s){const{segments:n,options:o}=t,r=qe(t);for(const a of n)ln(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Wa=typeof Path2D=="function";function Va(i,t,e,s){Wa&&!t.options.segment?Ha(i,t,e,s):Na(i,t,e,s)}class ct extends vt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;$o(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=ar(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,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Gs(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=Ba(s);let c,h;for(c=0,h=r.length;ct!=="borderDash"&&t!=="fill"});function as(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o){a=di(r,a,n);const l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function di(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function ls(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function hn(i,t){let e=[],s=!1;return F(i)?(s=!0,e=i):e=$a(i,t),e.length?new ct({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function cs(i){return i&&i.fill!==!1}function Ua(i,t,e){let n=i[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!z(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function Ya(i,t,e){const s=Ga(i);if(L(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return z(n)&&Math.floor(n)===n?Xa(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Xa(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Ka(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:L(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function qa(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:L(i)?s=i.value:s=t.getBaseValue(),s}function Ga(i){const t=i.options,e=t.fill;let s=O(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Za(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=Qa(t,e);a.push(hn({x:null,y:t.bottom},s));for(let l=0;l=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),s&&a.fill&&Ue(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;cs(o)&&Ue(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!cs(s)||e.drawTime!=="beforeDatasetDraw"||Ue(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const us=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},cl=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class gs extends vt{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,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=I(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=et(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=us(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let f=t;o.textAlign="left",o.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach((m,g)=>{const p=s+e/2+o.measureText(m.text).width;(g===0||c[c.length-1]+p+2*a>r)&&(f+=h,c[c.length-(g>0?0:1)]=0,u+=h,d++),l[g]={left:0,top:u,row:d,width:p,height:n},c[c.length-1]+=p+a}),f}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let f=a,d=0,u=0,m=0,g=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:y,itemHeight:w}=hl(s,e,o,p,n);b>0&&u+w+2*a>h&&(f+=d+a,c.push({width:d,height:u}),m+=d+a,g++,d=u=0),l[b]={left:m,top:u,col:g,width:y,height:w},d=Math.max(d,y),u+=w+a}),f+=d,c.push({width:d,height:u}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=He(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=$(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=$(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=$(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=$(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ie(t,this),this._draw(),Ae(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=R.color,l=He(t.rtl,this.left,this.width),c=et(r.font),{padding:h}=r,f=c.size,d=f/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:m,boxHeight:g,itemHeight:p}=us(r,f),b=function(k,v,x){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;n.save();const M=O(x.lineWidth,1);if(n.fillStyle=O(x.fillStyle,a),n.lineCap=O(x.lineCap,"butt"),n.lineDashOffset=O(x.lineDashOffset,0),n.lineJoin=O(x.lineJoin,"miter"),n.lineWidth=M,n.strokeStyle=O(x.strokeStyle,a),n.setLineDash(O(x.lineDash,[])),r.usePointStyle){const T={radius:g*Math.SQRT2/2,pointStyle:x.pointStyle,rotation:x.rotation,borderWidth:M},D=l.xPlus(k,m/2),C=v+d;Bs(n,T,D,C,r.pointStyleWidth&&m)}else{const T=v+Math.max((f-g)/2,0),D=l.leftForLtr(k,m),C=Ws(x.borderRadius);n.beginPath(),Object.values(C).some(W=>W!==0)?Hs(n,{x:D,y:T,w:m,h:g,radius:C}):n.rect(D,T,m,g),n.fill(),M!==0&&n.stroke()}n.restore()},y=function(k,v,x){Lt(n,x.text,k,v+p/2,c,{strikethrough:x.hidden,textAlign:l.textAlign(x.textAlign)})},w=this.isHorizontal(),P=this._computeTitleHeight();w?u={x:$(o,this.left+h,this.right-s[0]),y:this.top+h+P,line:0}:u={x:this.left+h,y:$(o,this.top+P+h,this.bottom-e[0].height),line:0},ir(this.ctx,t.textDirection);const _=p+h;this.legendItems.forEach((k,v)=>{n.strokeStyle=k.fontColor,n.fillStyle=k.fontColor;const x=n.measureText(k.text).width,M=l.textAlign(k.textAlign||(k.textAlign=r.textAlign)),T=m+d+x;let D=u.x,C=u.y;l.setWidth(this.width),w?v>0&&D+T+h>this.right&&(C=u.y+=_,u.line++,D=u.x=$(o,this.left+h,this.right-s[u.line])):v>0&&C+_>this.bottom&&(D=u.x=D+e[u.line].width+h,u.line++,C=u.y=$(o,this.top+P+h,this.bottom-e[u.line].height));const W=l.x(D);if(b(W,C,k),D=so(M,D+m+d,w?D+T:this.right,t.rtl),y(l.x(D),C,k),w)u.x+=T+h;else if(typeof k.text!="string"){const Q=c.lineHeight;u.y+=dn(k,Q)}else u.y+=_}),sr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=et(e.font),n=G(e.padding);if(!e.display)return;const o=He(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,f=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,f=$(t.align,f,this.right-d);else{const m=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);h=c+$(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const u=$(a,f,f+d);r.textAlign=o.textAlign(zs(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,Lt(r,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=et(t.font),s=G(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Dt(t,this.left,this.right)&&Dt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;so.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function dl(i,t,e){let s=i;return typeof t.text!="string"&&(s=dn(t,e)),s}function dn(i,t){const e=i.text?i.text.length+.5:0;return t*e}function ul(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var gl={id:"legend",_element:gs,start(i,t,e){const s=i.legend=new gs({ctx:i.ctx,options:e,chart:i});lt.configure(i,s,e),lt.addBox(i,s)},stop(i){lt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;lt.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=G(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};const pl=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ml(i,t,e,s){const n=i.indexOf(t);if(n===-1)return pl(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const bl=(i,t)=>i===null?null:tt(Math.round(i),0,t);function ps(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}S(Ze,"id","category"),S(Ze,"defaults",{ticks:{callback:ps}});function _l(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:f,includeBounds:d}=i,u=o||1,m=h-1,{min:g,max:p}=t,b=!A(r),y=!A(a),w=!A(c),P=(p-g)/(f+1);let _=vi((p-g)/m/u)*u,k,v,x,M;if(_<1e-14&&!b&&!y)return[{value:g},{value:p}];M=Math.ceil(p/_)-Math.floor(g/_),M>m&&(_=vi(M*_/m/u)*u),A(l)||(k=Math.pow(10,l),_=Math.ceil(_*k)/k),n==="ticks"?(v=Math.floor(g/_)*_,x=Math.ceil(p/_)*_):(v=g,x=p),b&&y&&o&&Kn((a-r)/o,_/1e3)?(M=Math.round(Math.min((a-r)/_,h)),_=(a-r)/M,v=r,x=a):w?(v=b?r:v,x=y?a:x,M=c-1,_=(x-v)/M):(M=(x-v)/_,$t(M,Math.round(M),_/1e3)?M=Math.round(M):M=Math.ceil(M));const T=Math.max(ki(_),ki(v));k=Math.pow(10,A(l)?T:l),v=Math.round(v*k)/k,x=Math.round(x*k)/k;let D=0;for(b&&(d&&v!==r?(e.push({value:r}),vn=e?n:l,a=l=>o=s?o:l;if(t){const l=Ot(n),c=Ot(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=_l(n,o);return t.bounds==="ticks"&&Ts(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return ri(t,this.chart.options.locale,this.options.ticks.format)}}class Qe extends Le{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=z(t)?t:0,this.max=z(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=at(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}S(Qe,"id","linear"),S(Qe,"defaults",{ticks:{callback:Ce.formatters.numeric}});const Jt=i=>Math.floor(rt(i)),pt=(i,t)=>Math.pow(10,Jt(i)+t);function bs(i){return i/Math.pow(10,Jt(i))===1}function _s(i,t,e){const s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function xl(i,t){const e=t-i;let s=Jt(e);for(;_s(i,t,s)>10;)s++;for(;_s(i,t,s)<10;)s--;return Math.min(s,Jt(i))}function yl(i,{min:t,max:e}){t=U(i.min,t);const s=[],n=Jt(t);let o=xl(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-h)/Math.pow(10,o)),d=U(i.min,Math.round((l+h+f*Math.pow(10,o))*r)/r);for(;d=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,r=o>=0?1:r),d=Math.round((l+h+f*Math.pow(10,o))*r)/r;const u=U(i.max,d);return s.push({value:u,major:bs(u),significand:f}),s}class xs extends wt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=Le.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return z(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=z(t)?Math.max(0,t):null,this.max=z(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!z(this._userMin)&&(this.min=t===pt(this.min,0)?pt(this.min,-1):pt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const o=a=>s=t?s:a,r=a=>n=e?n:a;s===n&&(s<=0?(o(1),r(10)):(o(pt(s,-1)),r(pt(n,1)))),s<=0&&o(pt(n,-1)),n<=0&&r(pt(s,1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=yl(e,this);return t.bounds==="ticks"&&Ts(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":ri(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=rt(t),this._valueRange=rt(this.max)-rt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(rt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}S(xs,"id","logarithmic"),S(xs,"defaults",{ticks:{callback:Ce.formatters.logarithmic,major:{enabled:!0}}});function Je(i){const t=i.ticks;if(t.display&&i.display){const e=G(t.backdropPadding);return O(t.font&&t.font.size,R.font.size)+e.height}return 0}function vl(i,t,e){return e=F(e)?e:[e],{w:mo(i,t.string,e),h:e.length*t.lineHeight}}function ys(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:in?{start:t-e,end:t}:{start:t,end:t+e}}function kl(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?H/o:0;for(let l=0;lt.r&&(a=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),n.startt.b&&(l=(n.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function Ml(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,r=Je(o)/2,a=i.drawingArea,l=o.pointLabels.centerPointLabels?H/n:0;for(let c=0;c270||e<90)&&(i-=t),i}function Ol(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const o=s.setContext(i.getPointLabelContext(n)),r=et(o.font),{x:a,y:l,textAlign:c,left:h,top:f,right:d,bottom:u}=i._pointLabelItems[n],{backdropColor:m}=o;if(!A(m)){const g=Ws(o.borderRadius),p=G(o.backdropPadding);e.fillStyle=m;const b=h-p.left,y=f-p.top,w=d-h+p.width,P=u-f+p.height;Object.values(g).some(_=>_!==0)?(e.beginPath(),Hs(e,{x:b,y,w,h:P,radius:g}),e.fill()):e.fillRect(b,y,w,P)}Lt(e,i._pointLabels[n],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function un(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,X);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let r=1;r{const n=I(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?kl(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){const e=X/(this._pointLabels.length||1),s=this.options.startAngle||0;return Y(t*e+at(s))}getDistanceFromCenterForValue(t){if(A(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(A(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t{if(f!==0){l=this.getDistanceFromCenterForValue(h.value);const d=this.getContext(f),u=n.setContext(d),m=o.setContext(d);Ll(this,u,l,r,m)}}),s.display){for(t.save(),a=r-1;a>=0;a--){const h=s.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:d}=h;!d||!f||(t.lineWidth=d,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=s.setContext(this.getContext(l)),h=et(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=G(c.backdropPadding);t.fillRect(-r/2-f.left,-o-h.size/2-f.top,r+f.width,h.size+f.height)}Lt(t,a.label,0,-o,h,{color:c.color})}),t.restore()}drawTitle(){}}S(me,"id","radialLinear"),S(me,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ce.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),S(me,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),S(me,"descriptors",{angleLines:{_fallback:"grid"}});const ze={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}},V=Object.keys(ze);function Cl(i,t){return i-t}function vs(i,t){if(A(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),z(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Gt(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function ks(i,t,e,s){const n=V.length;for(let o=V.indexOf(i);o=V.indexOf(e);o--){const r=V[o];if(ze[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return V[e?V.indexOf(e):0]}function Al(i){for(let t=V.indexOf(i)+1,e=V.length;t=t?e[s]:e[n];i[o]=!0}}function Fl(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function Ms(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=tt(e,0,r),s=tt(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||ks(o.minUnit,e,s,this._getLabelCapacity(e)),a=O(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Gt(l)||l===!0,h={};let f=e,d,u;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const m=n.ticks.source==="data"&&this.getDataTimestamps();for(d=f,u=0;dg-p).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return I(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],f=c&&a[c],d=s[e],u=c&&f&&d&&d.major;return this._adapter.format(t,n||(u?f:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=_t(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=_t(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Ss extends Te{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=be(e,this.min),this._tableRange=be(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r