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