4a5feb12465f66947af2f40a4785344e/******/////*///// 请勿使用非法用途


过安全狗、云锁、阿里云、360、护卫神、D盾、百度云、各种杀软!

iamH4CKEERRRRRRRRRRRS

I am a hacker in the dark of a very cold night

path :/home/drive/domains/drive.vcenetwork.com/public_html/public

upload file:

List of files:

name file size edit permission action
.htaccess1125 KBFebruary 26 2023 04:58:260644
1.zip1856 KBMay 26 2025 03:52:060644
arl.txt1 KBMay 26 2025 03:58:190644
build-August 19 2024 20:27:470755
cabs.jpg.phtml34996 KBMay 25 2025 13:50:430644
cool30203 KBMay 26 2025 03:49:270644
cool.php44 KBMay 26 2025 03:50:140644
favicon-May 26 2025 07:38:380755
favicon.ico502 KBAugust 19 2024 21:12:300644
htaccess.example1125 KBMay 20 2024 07:03:520755
images-August 19 2024 20:27:470755
index.php1949 KBMay 20 2024 07:03:520755
install_files-July 31 2023 19:05:060755
invoice.css99133 KBMay 20 2024 07:03:520644
manifest.json1055 KBAugust 19 2024 21:25:160644
robots.txt1154 KBJune 07 2025 12:24:520755
storage-May 25 2025 13:49:550755
style.php26 KBMay 26 2025 03:52:280644
swagger.yaml33646 KBMay 20 2024 07:03:520755
web.config914 KBMay 20 2024 07:03:520755
import{r as Ze,ap as Qn,a as to}from"./main.b7d280d4.js";/*! * Chart.js v3.9.1 * https://www.chartjs.org * (c) 2022 Chart.js Contributors * Released under the MIT License */function at(){}const eo=function(){let i=0;return function(){return i++}}();function R(i){return i===null||typeof i>"u"}function z(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 D(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}const N=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function J(i,t){return N(i)?i:t}function C(i,t){return typeof i>"u"?t:i}const io=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,Js=(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 E(i,t,e,s){let n,o,r;if(z(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 bt(i,t){return(Vi[t]||(Vi[t]=oo(t)))(i)}function oo(i){const t=ro(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function ro(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 ki(i){return i.charAt(0).toUpperCase()+i.slice(1)}const tt=i=>typeof i<"u",_t=i=>typeof i=="function",Wi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function ao(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const V=Math.PI,F=2*V,lo=F+V,Pe=Number.POSITIVE_INFINITY,co=V/180,B=V/2,Nt=V/4,Ni=V*2/3,Q=Math.log10,ot=Math.sign;function Hi(i){const t=Math.round(i);i=Gt(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Q(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function ho(i){const t=[],e=Math.sqrt(i);let s;for(s=1;sn-o).pop(),t}function It(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Gt(i,t,e){return Math.abs(i-t)=i}function tn(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 Si(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 Pt=(i,t,e,s)=>Si(i,e,s?n=>i[n][t]<=e:n=>i[n][t]Si(i,e,s=>i[s][t]>=e);function mo(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{const s="_onData"+ki(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 $i(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)&&(sn.forEach(o=>{delete i[o]}),delete i._chartjs)}function nn(i){const t=new Set;let e,s;for(e=0,s=i.length;e"u"?function(i){return i()}:window.requestAnimationFrame}();function rn(i,t,e){const s=e||(r=>Array.prototype.slice.call(r));let n=!1,o=[];return function(...r){o=s(r),n||(n=!0,on.call(window,()=>{n=!1,i.apply(t,o)}))}}function _o(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const an=i=>i==="start"?"left":i==="end"?"right":"center",q=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,xo=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function ln(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:d,maxDefined:u}=r.getUserBounds();d&&(n=Y(Math.min(Pt(a,r.axis,c).lo,e?s:Pt(t,l,r.getPixelForValue(c)).lo),0,s-1)),u?o=Y(Math.max(Pt(a,r.axis,h,!0).hi+1,e?0:Pt(t,l,r.getPixelForValue(h),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function cn(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 de=i=>i===0||i===1,Yi=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*F/e)),Xi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*F/e)+1,Zt={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*B)+1,easeOutSine:i=>Math.sin(i*B),easeInOutSine:i=>-.5*(Math.cos(V*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=>de(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=>de(i)?i:Yi(i,.075,.3),easeOutElastic:i=>de(i)?i:Xi(i,.075,.3),easeInOutElastic(i){return de(i)?i:i<.5?.5*Yi(i*2,.1125,.45):.5+.5*Xi(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-Zt.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?Zt.easeInBounce(i*2)*.5:Zt.easeOutBounce(i*2-1)*.5+.5};/*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License */function oe(i){return i+.5|0}const ft=(i,t,e)=>Math.max(Math.min(i,e),t);function Ut(i){return ft(oe(i*2.55),0,255)}function mt(i){return ft(oe(i*255),0,255)}function ht(i){return ft(oe(i/2.55)/100,0,1)}function Ui(i){return ft(oe(i*100),0,100)}const Z={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},ui=[..."0123456789ABCDEF"],yo=i=>ui[i&15],vo=i=>ui[(i&240)>>4]+ui[i&15],ue=i=>(i&240)>>4===(i&15),Mo=i=>ue(i.r)&&ue(i.g)&&ue(i.b)&&ue(i.a);function ko(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&Z[i[1]]*17,g:255&Z[i[2]]*17,b:255&Z[i[3]]*17,a:t===5?Z[i[4]]*17:255}:(t===7||t===9)&&(e={r:Z[i[1]]<<4|Z[i[2]],g:Z[i[3]]<<4|Z[i[4]],b:Z[i[5]]<<4|Z[i[6]],a:t===9?Z[i[7]]<<4|Z[i[8]]:255})),e}const wo=(i,t)=>i<255?t(i):"";function So(i){var t=Mo(i)?yo:vo;return i?"#"+t(i.r)+t(i.g)+t(i.b)+wo(i.a,t):void 0}const Po=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hn(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 Co(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 Do(i,t,e){const s=hn(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 Oo(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-r):h/(o+r),l=Oo(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function Ci(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(mt)}function Di(i,t,e){return Ci(hn,i,t,e)}function Ao(i,t,e){return Ci(Do,i,t,e)}function To(i,t,e){return Ci(Co,i,t,e)}function dn(i){return(i%360+360)%360}function Lo(i){const t=Po.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Ut(+t[5]):mt(+t[5]));const n=dn(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=Ao(n,o,r):t[1]==="hsv"?s=To(n,o,r):s=Di(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function Ro(i,t){var e=Pi(i);e[0]=dn(e[0]+t),e=Di(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Eo(i){if(!i)return;const t=Pi(i),e=t[0],s=Ui(t[1]),n=Ui(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${ht(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Ki={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"},qi={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 Fo(){const i={},t=Object.keys(qi),e=Object.keys(Ki);let s,n,o,r,a;for(s=0;s>16&255,o>>8&255,o&255]}return i}let fe;function Io(i){fe||(fe=Fo(),fe.transparent=[0,0,0,0]);const t=fe[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const zo=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Bo(i){const t=zo.exec(i);let e=255,s,n,o;if(!!t){if(t[7]!==s){const r=+t[7];e=t[8]?Ut(r):ft(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Ut(s):ft(s,0,255)),n=255&(t[4]?Ut(n):ft(n,0,255)),o=255&(t[6]?Ut(o):ft(o,0,255)),{r:s,g:n,b:o,a:e}}}function Vo(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ht(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Je=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Rt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Wo(i,t,e){const s=Rt(ht(i.r)),n=Rt(ht(i.g)),o=Rt(ht(i.b));return{r:mt(Je(s+e*(Rt(ht(t.r))-s))),g:mt(Je(n+e*(Rt(ht(t.g))-n))),b:mt(Je(o+e*(Rt(ht(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ge(i,t,e){if(i){let s=Pi(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Di(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function un(i,t){return i&&Object.assign(t||{},i)}function Gi(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=mt(i[3]))):(t=un(i,{r:0,g:0,b:0,a:1}),t.a=mt(t.a)),t}function No(i){return i.charAt(0)==="r"?Bo(i):Lo(i)}class Ce{constructor(t){if(t instanceof Ce)return t;const e=typeof t;let s;e==="object"?s=Gi(t):e==="string"&&(s=ko(t)||Io(t)||No(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=un(this._rgb);return t&&(t.a=ht(t.a)),t}set rgb(t){this._rgb=Gi(t)}rgbString(){return this._valid?Vo(this._rgb):void 0}hexString(){return this._valid?So(this._rgb):void 0}hslString(){return this._valid?Eo(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=Wo(this._rgb,t._rgb,e)),this}clone(){return new Ce(this.rgb)}alpha(t){return this._rgb.a=mt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=oe(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 ge(this._rgb,2,t),this}darken(t){return ge(this._rgb,2,-t),this}saturate(t){return ge(this._rgb,1,t),this}desaturate(t){return ge(this._rgb,1,-t),this}rotate(t){return Ro(this._rgb,t),this}}function fn(i){return new Ce(i)}function gn(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Zi(i){return gn(i)?i:fn(i)}function Qe(i){return gn(i)?i:fn(i).saturate(.5).darken(.1).hexString()}const Ot=Object.create(null),fi=Object.create(null);function Jt(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;se.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=(e,s)=>Qe(s.backgroundColor),this.hoverBorderColor=(e,s)=>Qe(s.borderColor),this.hoverColor=(e,s)=>Qe(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return ti(this,t,e)}get(t){return Jt(this,t)}describe(t,e){return ti(fi,t,e)}override(t,e){return ti(Ot,t,e)}route(t,e,s,n){const o=Jt(this,t),r=Jt(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 D(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}}var A=new Ho({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function jo(i){return!i||R(i.size)||R(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function De(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 $o(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,d,u;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function ie(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,Uo(i,o),l=0;l+i||0;function Oi(i,t){const e={},s=D(t),n=s?Object.keys(t):t,o=D(i)?s?r=>C(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=Jo(o(r));return e}function mn(i){return Oi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Ct(i){return Oi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function U(i){const t=mn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(i,t){i=i||{},t=t||A.font;let e=C(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=C(i.style,t.style);s&&!(""+s).match(Go)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const n={family:C(i.family,t.family),lineHeight:Zo(C(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:C(i.weight,t.weight),string:""};return n.string=jo(n),n}function pe(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 xt(i,t){return Object.assign(Object.create(i),t)}function Ai(i,t=[""],e=i,s,n=()=>i[0]){tt(s)||(s=yn("_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 _n(r,a,()=>ar(a,t,i,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,a){return ts(r).includes(a)},ownKeys(r){return ts(r)},set(r,a,l){const c=r._storage||(r._storage=n());return r[a]=c[a]=l,delete r._keys,!0}})}function Bt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:bn(i,s),setContext:o=>Bt(i,o,e,s),override:o=>Bt(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 _n(o,r,()=>er(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 bn(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:_t(e)?e:()=>e,isIndexable:_t(s)?s:()=>s}}const tr=(i,t)=>i?i+ki(t):t,Ti=(i,t)=>D(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function _n(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function er(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return _t(a)&&r.isScriptable(t)&&(a=ir(t,a,i,e)),z(a)&&a.length&&(a=sr(t,a,i,r.isIndexable)),Ti(t,a)&&(a=Bt(a,n,o&&o[t],r)),a}function ir(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),Ti(i,t)&&(t=Li(n._scopes,n,i,t)),t}function sr(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(tt(o.index)&&s(i))t=t[o.index%t.length];else if(D(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Li(c,n,i,h);t.push(Bt(d,o,r&&r[i],a))}}return t}function xn(i,t,e){return _t(i)?i(t,e):i}const nr=(i,t)=>i===!0?t:typeof i=="string"?bt(t,i):void 0;function or(i,t,e,s,n){for(const o of t){const r=nr(e,o);if(r){i.add(r);const a=xn(r._fallback,e,n);if(tt(a)&&a!==e&&a!==s)return a}else if(r===!1&&tt(s)&&e!==s)return null}return!1}function Li(i,t,e,s){const n=t._rootScopes,o=xn(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Qi(a,r,e,o||e,s);return l===null||tt(o)&&o!==e&&(l=Qi(a,r,o,l,s),l===null)?!1:Ai(Array.from(a),[""],n,o,()=>rr(t,e,s))}function Qi(i,t,e,s,n){for(;e;)e=or(i,t,e,s,n);return e}function rr(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return z(n)&&D(e)?e:n}function ar(i,t,e,s){let n;for(const o of t)if(n=yn(tr(o,i),e),tt(n))return Ti(i,n)?Li(e,s,i,n):n}function yn(i,t){for(const e of t){if(!e)continue;const s=e[i];if(tt(s))return s}}function ts(i){let t=i._keys;return t||(t=i._keys=lr(i._scopes)),t}function lr(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)}function vn(i,t,e,s){const{iScale:n}=i,{key:o="r"}=this._parsing,r=new Array(s);let a,l,c,h;for(a=0,l=s;ati==="x"?"y":"x";function hr(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=di(o,n),l=di(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function dr(i,t,e){const s=i.length;let n,o,r,a,l,c=Vt(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")fr(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;owindow.getComputedStyle(i,null);function mr(i,t){return Ie(i).getPropertyValue(t)}const br=["top","right","bottom","left"];function Dt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=br[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const _r=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function xr(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(_r(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 wt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Ie(e),o=n.boxSizing==="border-box",r=Dt(n,"padding"),a=Dt(n,"border","width"),{x:l,y:c,box:h}=xr(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/g*e.height/s)}}function yr(i,t,e){let s,n;if(t===void 0||e===void 0){const o=Ri(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Ie(o),l=Dt(a,"border","width"),c=Dt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=Oe(a.maxWidth,o,"clientWidth"),n=Oe(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Pe,maxHeight:n||Pe}}const ei=i=>Math.round(i*10)/10;function vr(i,t,e,s){const n=Ie(i),o=Dt(n,"margin"),r=Oe(n.maxWidth,i,"clientWidth")||Pe,a=Oe(n.maxHeight,i,"clientHeight")||Pe,l=yr(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const d=Dt(n,"border","width"),u=Dt(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?Math.floor(c/s):h-o.height),c=ei(Math.min(c,r,l.maxWidth)),h=ei(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ei(c/2)),{width:c,height:h}}function es(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=n/s,i.width=o/s;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 Mr=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 is(i,t){const e=mr(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function St(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function kr(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 wr(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=St(i,n,e),a=St(n,o,e),l=St(o,t,e),c=St(r,a,e),h=St(a,l,e);return St(c,h,e)}const ss=new Map;function Sr(i,t){t=t||{};const e=i+JSON.stringify(t);let s=ss.get(e);return s||(s=new Intl.NumberFormat(i,t),ss.set(e,s)),s}function re(i,t,e){return Sr(t,e).format(i)}const Pr=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}}},Cr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Ft(i,t,e){return i?Pr(t,e):Cr()}function wn(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 Sn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Pn(i){return i==="angle"?{between:ee,compare:fo,normalize:G}:{between:dt,compare:(t,e)=>t-e,normalize:t=>t}}function ns({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 Dr(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=Pn(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(n,y,b)&&a(n,y)!==0,x=()=>a(o,b)===0||l(o,y,b),k=()=>p||v(),M=()=>!p||x();for(let S=h,w=h;S<=d;++S)_=t[S%r],!_.skip&&(b=c(_[s]),b!==y&&(p=l(b,n,o),m===null&&k()&&(m=a(b,n)===0?S:w),m!==null&&M()&&(g.push(ns({start:m,end:S,loop:u,count:r,style:f})),m=null),w=S,y=b));return m!==null&&g.push(ns({start:m,end:d,loop:u,count:r,style:f})),g}function Dn(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 Ar(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 Tr(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 os(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=on.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 lt=new Er;const as="transparent",Fr={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Zi(i||as),n=s.valid&&Zi(t||as);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Ir{constructor(t,e,s,n){const o=e[s];n=pe([t.to,n,o,t.from]);const r=pe([t.from,o,n]);this._active=!0,this._fn=t.fn||Fr[t.type||typeof r],this._easing=Zt[t.easing]||Zt.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=pe([t.to,e,n,t.from]),this._from=pe([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;ni!=="onProgress"&&i!=="onComplete"&&i!=="fn"});A.set("animations",{colors:{type:"color",properties:Br},numbers:{type:"number",properties:zr}});A.describe("animations",{_fallback:"animation"});A.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:i=>i|0}}}});class On{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!D(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const n=t[s];if(!D(n))return;const o={};for(const r of Vr)o[r]=n[r];(z(n.properties)&&n.properties||[s]).forEach(r=>{(r===s||!e.has(r))&&e.set(r,o)})})}_animateOptions(t,e){const s=e.options,n=Nr(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Wr(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 d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new Ir(u,t,c,h),n.push(d)}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 lt.add(this._chart,s),!0}}function Wr(i,t){const e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function us(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=Yr(o,r,s),d=t.length;let u;for(let f=0;fe[s].axis===t).shift()}function Kr(i,t){return xt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function qr(i,t,e){return xt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ht(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]}}}const si=i=>i==="reset"||i==="none",fs=(i,t)=>t?i:Object.assign({},i),Gr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:An(e,!0),values:null};class it{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=hs(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ht(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=C(s.xAxisID,ii(t,"x")),r=e.yAxisID=C(s.yAxisID,ii(t,"y")),a=e.rAxisID=C(s.rAxisID,ii(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&&$i(this._data,this),t._stacked&&Ht(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(D(e))this._data=$r(e);else if(s!==e){if(s){$i(s,this);const n=this._cachedMeta;Ht(n),n._parsed=[]}e&&Object.isExtensible(e)&&bo(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=hs(e.vScale,e),e.stack!==s.stack&&(n=!0,Ht(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&us(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,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{z(n[t])?u=this.parseArrayData(s,n,t,e):D(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]p||d=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,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),p=c.resolveNamedOptions(u,f,g,d);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(fs(p,l))),p}_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,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new On(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||si(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){si(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!si(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;an-o))}return i._cache.$bar}function Jr(i){const t=i.iScale,e=Zr(t,i.type);let s=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(tt(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(n=0,o=e.length;n0?n[i-1]:null,a=iMath.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function Tn(i,t,e,s){return z(i)?ea(i,t,e,s):t[e.axis]=e.parse(i,s),t}function gs(i,t,e,s){const n=i.iScale,o=i.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,u;for(c=e,h=e+s;c=e?1:-1)}function sa(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.basel.controller.options.grouped),o=s.options.stacked,r=[],a=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(R(h)||isNaN(h))return!0};for(const l of n)if(!(e!==void 0&&a(l))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:s,yScale:n}=e,o=this.getParsed(t),r=s.getLabelForValue(o.x),a=n.getLabelForValue(o.y),l=o._custom;return{label:e.label,value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=r.axis,d=a.axis;for(let u=e;uee(y,a,l,!0)?1:Math.max(v,v*e,x,x*e),g=(y,v,x)=>ee(y,a,l,!0)?-1:Math.min(v,v*e,x,x*e),p=f(0,c,d),m=f(B,h,u),b=g(V,c,d),_=g(V+B,h,u);s=(p-b)/2,n=(m-_)/2,o=-(p+b)/2,r=-(m+_)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}class ae extends it{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(D(s[t])){const{key:l="value"}=this._parsing;o=c=>+bt(s[c],l)}let r,a;for(r=t,a=t+e;r0&&!isNaN(t)?F*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=re(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=s.data.datasets.length;ni!=="spacing",_indexable:i=>i!=="spacing"};ae.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{const r=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label;const e=": "+i.formattedValue;return z(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};class Be extends it{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=ln(e,n,r);this._drawStart=a,this._drawCount=l,cn(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=It(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none";let _=e>0&&this.getParsed(e-1);for(let y=e;y0&&Math.abs(x[u]-_[u])>m,p&&(k.parsed=x,k.raw=c.data[y]),d&&(k.options=h||this.resolveDataElementOptions(y,v.active?"active":n)),b||this.updateElement(v,y,k,n),_=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()}}Be.id="line";Be.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Be.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ve extends it{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=re(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return vn.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(oe.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),r=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*V;let f=u,g;const p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?et(this.resolveDataElementOptions(t,e).angle||s):0}}Ve.id="polarArea";Ve.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ve.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{const r=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Ln extends ae{}Ln.id="pie";Ln.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Fi extends it{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return vn.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta,s=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(s.points=n,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===n.length,options:r};this.updateElement(s,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){const o=this._cachedMeta.rScale,r=n==="reset";for(let a=e;a{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}rt.defaults={};rt.defaultRoutes=void 0;const Rn={values(i){return z(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=la(i,e)}const r=Q(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),re(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=i/Math.pow(10,Math.floor(Q(i)));return s===1||s===2||s===5?Rn.numeric.call(this,i,t,e):""}};function la(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 We={formatters:Rn};A.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:We.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});A.route("scale.ticks","color","","color");A.route("scale.grid","color","","borderColor");A.route("scale.grid","borderColor","","borderColor");A.route("scale.title","color","","color");A.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"});A.describe("scales",{_fallback:"scale"});A.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function ca(i,t){const e=i.options.ticks,s=e.maxTicksLimit||ha(i),n=e.major.enabled?ua(t):[],o=n.length,r=n[0],a=n[o-1],l=[];if(o>s)return fa(t,l,n,o/s),l;const c=da(n,t,s);if(o>0){let h,d;const u=o>1?Math.round((a-r)/(o-1)):null;for(be(t,l,c,R(u)?0:r-u,r),h=0,d=o-1;hn)return l}return Math.max(n,1)}function ua(i){const t=[];let e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,bs=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function _s(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;or+a)))return l}function ba(i,t){E(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:J(e,J(s,e)),max:J(s,J(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||[]}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=Qo(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(),d=h.widest.width,u=h.highest.height,f=Y(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-jt(t.grid)-e.padding-xs(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=wi(Math.min(Math.asin(Y((h.highest.height+6)/a,-1,1)),Math.asin(Y(l/c,-1,1))-Math.asin(Y(u/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=xs(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=jt(o)+l):(t.height=this.maxHeight,t.width=jt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,g=et(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=s.mirror?0:m*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:p*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,p)}}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,d=this.right-this.getPixelForTick(this.ticks.length-1);let 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+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*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+r,this.paddingBottom=d+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:o[M]||0,height:r[M]||0});return{first:k(0),last:k(e-1),widest:k(v),highest:k(x),widths:o,heights:r}}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 go(this._alignToPixels?Mt(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}=n,a=o.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),d=jt(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(P){return Mt(s,P,g)};let b,_,y,v,x,k,M,S,w,T,L,O;if(r==="top")b=m(this.bottom),k=this.bottom-d,S=b-p,T=m(t.top)+p,O=t.bottom;else if(r==="bottom")b=m(this.top),T=t.top,O=m(t.bottom)-p,k=b+p,S=this.top+d;else if(r==="left")b=m(this.right),x=this.right-d,M=b-p,w=m(t.left)+p,L=t.right;else if(r==="right")b=m(this.left),w=t.left,L=m(t.right)-p,x=b+p,M=this.left+d;else if(e==="x"){if(r==="center")b=m((t.top+t.bottom)/2+.5);else if(D(r)){const P=Object.keys(r)[0],j=r[P];b=m(this.chart.scales[P].getPixelForValue(j))}T=t.top,O=t.bottom,k=b+p,S=k+d}else if(e==="y"){if(r==="center")b=m((t.left+t.right)/2);else if(D(r)){const P=Object.keys(r)[0],j=r[P];b=m(this.chart.scales[P].getPixelForValue(j))}x=b-p,M=x-d,w=t.left,L=t.right}const H=C(n.ticks.maxTicksLimit,h),X=Math.max(1,Math.ceil(h/H));for(_=0;_o.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(n)}}]:[{z:s,draw:n=>{this.drawBackground(),this.drawGrid(n),this.drawTitle()}},{z:s+1,draw:()=>{this.drawBorder()}},{z:e,draw:n=>{this.drawLabels(n)}}]}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(".");A.route(o,n,l,a)})}function wa(i){return"id"in i&&"defaults"in i}class Sa{constructor(){this.controllers=new _e(it,"datasets",!0),this.elements=new _e(rt,"elements"),this.plugins=new _e(Object,"plugins"),this.scales=new _e(At,"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):E(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=ki(t);I(s["before"+n],[],s),e[t](s),I(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let v=e;v0&&Math.abs(k[f]-y[f])>b,m&&(M.parsed=k,M.raw=c.data[v]),u&&(M.options=d||this.resolveDataElementOptions(v,x.active?"active":n)),_||this.updateElement(x,v,M,n),y=k}this.updateSharedOptions(d,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,r)/2}}Ii.id="scatter";Ii.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ii.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function kt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class pi{constructor(t){this.options=t||{}}init(t){}formats(){return kt()}parse(t,e){return kt()}format(t,e){return kt()}add(t,e,s){return kt()}diff(t,e,s){return kt()}startOf(t,e,s){return kt()}endOf(t,e){return kt()}}pi.override=function(i){Object.assign(pi.prototype,i)};var Pa={_date:pi};function Ca(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?po:Pt;if(s){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function le(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 Ta={evaluateInteractionItems:le,modes:{index(i,t,e,s){const n=wt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?oi(i,n,o,s,r):ri(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=wt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?oi(i,n,o,s,r):ri(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 vs(i,t){return i.filter(e=>En.indexOf(e.pos)===-1&&e.box.axis===t)}function Yt(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 La(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=Yt($t(t,"left"),!0),n=Yt($t(t,"right")),o=Yt($t(t,"top"),!0),r=Yt($t(t,"bottom")),a=vs(t,"x"),l=vs(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:$t(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function Ms(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Fn(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 Ia(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!D(n)){e.size&&(i[n]-=e.size);const 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&&Fn(r,o.getPadding());const a=Math.max(0,t.outerWidth-Ms(r,i,"left","right")),l=Math.max(0,t.outerHeight-Ms(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 za(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 Ba(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 Kt(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Fn(u,U(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),g=Ea(l.concat(c),d);Kt(a.fullSize,f,d,g),Kt(l,f,d,g),Kt(c,f,d,g)&&Kt(l,f,d,g),za(f),ks(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,ks(a.rightAndBottom,f,d,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},E(a.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class In{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 Va extends In{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ke="$chartjs",Wa={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ws=i=>i===null||i==="";function Na(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ke]={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",ws(n)){const o=is(i,"width");o!==void 0&&(i.width=o)}if(ws(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=is(i,"height");o!==void 0&&(i.height=o)}return i}const zn=Mr?{passive:!0}:!1;function Ha(i,t,e){i.addEventListener(t,e,zn)}function ja(i,t,e){i.canvas.removeEventListener(t,e,zn)}function $a(i,t){const e=Wa[i.type]||i.type,{x:s,y:n}=wt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Ae(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Ya(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ae(a.addedNodes,s),r=r&&!Ae(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Xa(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ae(a.removedNodes,s),r=r&&!Ae(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const ne=new Map;let Ss=0;function Bn(){const i=window.devicePixelRatio;i!==Ss&&(Ss=i,ne.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Ua(i,t){ne.size||window.addEventListener("resize",Bn),ne.set(i,t)}function Ka(i){ne.delete(i),ne.size||window.removeEventListener("resize",Bn)}function qa(i,t,e){const s=i.canvas,n=s&&Ri(s);if(!n)return;const o=rn((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),Ua(i,o),r}function ai(i,t,e){e&&e.disconnect(),t==="resize"&&Ka(i)}function Ga(i,t,e){const s=i.canvas,n=rn(o=>{i.ctx!==null&&e($a(o,i))},i,o=>{const r=o[0];return[r,r.offsetX,r.offsetY]});return Ha(s,t,n),n}class Za extends In{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Na(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ke])return!1;const s=e[ke].initial;["height","width"].forEach(o=>{const r=s[o];R(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[ke],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Ya,detach:Xa,resize:qa}[e]||Ga;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ai,detach:ai,resize:ai}[e]||ja)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return vr(t,e,s,n)}isAttached(t){const e=Ri(t);return!!(e&&e.isConnected)}}function Ja(i){return!kn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Va:Za}class Qa{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(I(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){R(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=C(s.options&&s.options.plugins,{}),o=tl(s);return n===!1&&!e?[]:il(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.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 tl(i){const t={},e=[],s=Object.keys(nt.plugins.items);for(let o=0;o{const l=s[a];if(!D(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=bi(a,l),h=ol(c,n),d=e.scales||{};o[c]=o[c]||a,r[a]=qt(Object.create(null),[{axis:c},l,d[c],d[h]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,c=a.indexAxis||mi(l,t),d=(Ot[l]||{}).scales||{};Object.keys(d).forEach(u=>{const f=nl(u,c),g=a[f+"AxisID"]||o[f]||f;r[g]=r[g]||Object.create(null),qt(r[g],[{axis:f},s[g],d[u]])})}),Object.keys(r).forEach(a=>{const l=r[a];qt(l,[A.scales[l.type],A.scale])}),r}function Vn(i){const t=i.options||(i.options={});t.plugins=C(t.plugins,{}),t.scales=al(i,t)}function Wn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function ll(i){return i=i||{},i.data=Wn(i.data),Vn(i),i}const Ps=new Map,Nn=new Set;function ye(i,t){let e=Ps.get(i);return e||(e=t(),Ps.set(i,e),Nn.add(e)),e}const Xt=(i,t,e)=>{const s=bt(t,e);s!==void 0&&i.add(s)};class cl{constructor(t){this._config=ll(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=Wn(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(),Vn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ye(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ye(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ye(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return ye(`${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(d=>Xt(l,t,d))),h.forEach(d=>Xt(l,n,d)),h.forEach(d=>Xt(l,Ot[o]||{},d)),h.forEach(d=>Xt(l,A,d)),h.forEach(d=>Xt(l,fi,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Nn.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ot[e]||{},A.datasets[e]||{},{type:e},A,fi]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Cs(this._resolverCache,t,n);let l=r;if(dl(r,e)){o.$shared=!1,s=_t(s)?s():s;const c=this.createResolver(t,s,a);l=Bt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=Cs(this._resolverCache,t,s);return D(e)?Bt(o,e,void 0,n):o}}function Cs(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 hl=i=>D(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||_t(i[e]),!1);function dl(i,t){const{isScriptable:e,isIndexable:s}=bn(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(_t(a)||hl(a))||r&&z(a))return!0}return!1}var ul="3.9.1";const fl=["top","bottom","left","right","chartArea"];function Ds(i,t){return i==="top"||i==="bottom"||fl.indexOf(i)===-1&&t==="x"}function Os(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function As(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),I(e&&e.onComplete,[i],t)}function gl(i){const t=i.chart,e=t.options.animation;I(e&&e.onProgress,[i],t)}function Hn(i){return kn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Te={},jn=i=>{const t=Hn(i);return Object.values(Te).filter(e=>e.canvas===t).pop()};function pl(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 ml(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}class Ne{constructor(t,e){const s=this.config=new cl(e),n=Hn(t),o=jn(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||Ja(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=eo(),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 Qa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=_o(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Te[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}lt.listen(this,"complete",As),lt.listen(this,"progress",gl),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return R(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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():es(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ji(this.canvas,this.ctx),this}stop(){return lt.stop(this),this}resize(t,e){lt.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,es(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||{};E(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=bi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),E(o,r=>{const a=r.options,l=a.id,c=bi(l,a),h=C(a.type,r.dtype);(a.position===void 0||Ds(a.position,c)!==Ds(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=nt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),E(n,(r,a)=>{r||delete s[a]}),E(s,r=>{gt.configure(this,r,r.options),gt.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(Os("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){E(this.scales,t=>{gt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Wi(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;pl(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;gt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],E(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=this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Ee(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&&Fe(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ie(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Ta.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=xt(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);tt(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(),lt.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)};E(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(){E(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},E(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}});!we(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.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=ao(t),c=ml(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=!we(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)}}const Ts=()=>E(Ne.instances,i=>i._plugins.invalidate()),ut=!0;Object.defineProperties(Ne,{defaults:{enumerable:ut,value:A},instances:{enumerable:ut,value:Te},overrides:{enumerable:ut,value:Ot},registry:{enumerable:ut,value:nt},version:{enumerable:ut,value:ul},getChart:{enumerable:ut,value:jn},register:{enumerable:ut,value:(...i)=>{nt.add(...i),Ts()}},unregister:{enumerable:ut,value:(...i)=>{nt.remove(...i),Ts()}}});function $n(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+B,s-B),i.closePath(),i.clip()}function bl(i){return Oi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function _l(i,t,e,s){const n=bl(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return Y(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:Y(n.innerStart,0,r),innerEnd:Y(n.innerEnd,0,r)}}function Et(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function _i(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),u=h>0?h+s+e+c:0;let f=0;const g=n-l;if(s){const P=h>0?h-s:0,j=d>0?d-s:0,W=(P+j)/2,vt=W!==0?g*W/(W+s):g;f=(g-vt)/2}const p=Math.max(.001,g*d-e/V)/d,m=(g-p)/2,b=l+m+f,_=n-m-f,{outerStart:y,outerEnd:v,innerStart:x,innerEnd:k}=_l(t,u,d,_-b),M=d-y,S=d-v,w=b+y/M,T=_-v/S,L=u+x,O=u+k,H=b+x/L,X=_-k/O;if(i.beginPath(),o){if(i.arc(r,a,d,w,T),v>0){const W=Et(S,T,r,a);i.arc(W.x,W.y,v,T,_+B)}const P=Et(O,_,r,a);if(i.lineTo(P.x,P.y),k>0){const W=Et(O,X,r,a);i.arc(W.x,W.y,k,_+B,X+Math.PI)}if(i.arc(r,a,u,_-k/u,b+x/u,!0),x>0){const W=Et(L,H,r,a);i.arc(W.x,W.y,x,H+Math.PI,b-B)}const j=Et(M,b,r,a);if(i.lineTo(j.x,j.y),y>0){const W=Et(M,w,r,a);i.arc(W.x,W.y,y,b-B,w)}}else{i.moveTo(r,a);const P=Math.cos(w)*d+r,j=Math.sin(w)*d+a;i.lineTo(P,j);const W=Math.cos(T)*d+r,vt=Math.sin(T)*d+a;i.lineTo(W,vt)}i.closePath()}function xl(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){_i(i,t,e,s,r+F,n);for(let c=0;c=F||ee(o,a,l),p=dt(r,c+u,h+u);return g&&p}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:s}=this,n=(e.offset||0)/2,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>F?Math.floor(s/F):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=V&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const l=xl(t,this,a,o,r);vl(t,this,a,o,l,r),t.restore()}}He.id="arc";He.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};He.defaultRoutes={backgroundColor:"backgroundColor"};function Yn(i,t,e=t){i.lineCap=C(e.borderCapStyle,t.borderCapStyle),i.setLineDash(C(e.borderDash,t.borderDash)),i.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),i.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=C(e.borderWidth,t.borderWidth),i.strokeStyle=C(e.borderColor,t.borderColor)}function Ml(i,t,e){i.lineTo(e.x,e.y)}function kl(i){return i.stepped?Yo:i.tension||i.cubicInterpolationMode==="monotone"?Xo:Ml}function Xn(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-v:v))%o,y=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(f=n[_(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[_(u)],f.skip)continue;const v=f.x,x=f.y,k=v|0;k===g?(xm&&(m=x),h=(d*h+v)/++d):(y(),i.lineTo(v,x),g=k,d=0,p=m=x),b=x}y()}function xi(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Sl:wl}function Pl(i){return i.stepped?kr:i.tension||i.cubicInterpolationMode==="monotone"?wr:St}function Cl(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Yn(i,t.options),i.stroke(n)}function Dl(i,t,e,s){const{segments:n,options:o}=t,r=xi(t);for(const a of n)Yn(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Ol=typeof Path2D=="function";function Al(i,t,e,s){Ol&&!t.options.segment?Cl(i,t,e,s):Dl(i,t,e,s)}class yt extends rt{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;pr(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=Tr(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=Dn(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=Pl(s);let c,h;for(c=0,h=r.length;ci!=="borderDash"&&i!=="fill"};function Ls(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o){a=zi(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 zi(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function Rs(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function Kn(i,t){let e=[],s=!1;return z(i)?(s=!0,e=i):e=zl(i,t),e.length?new yt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Es(i){return i&&i.fill!==!1}function Bl(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(!N(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function Vl(i,t,e){const s=jl(i);if(D(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return N(n)&&Math.floor(n)===n?Wl(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Wl(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Nl(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:D(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Hl(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:D(i)?s=i.value:s=t.getBaseValue(),s}function jl(i){const t=i.options,e=t.fill;let s=C(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function $l(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=Yl(t,e);a.push(Kn({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&&hi(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;Es(o)&&hi(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Es(s)||e.drawTime!=="beforeDatasetDraw"||hi(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Bs=(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)}},ic=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Vs extends rt{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=$(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Bs(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,o,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 d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{const m=s+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+a}),d}_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 d=a,u=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const _=s+e/2+o.measureText(m.text).width;b>0&&f+n+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,p++,u=f=0),l[b]={left:g,top:f,col:p,width:_,height:n},u=Math.max(u,_),f+=n+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=Ft(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=q(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=q(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=q(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=q(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;Ee(t,this),this._draw(),Fe(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=A.color,l=Ft(t.rtl,this.left,this.width),c=$(r.font),{color:h,padding:d}=r,u=c.size,f=u/2;let g;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=Bs(r,u),_=function(M,S,w){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const T=C(w.lineWidth,1);if(n.fillStyle=C(w.fillStyle,a),n.lineCap=C(w.lineCap,"butt"),n.lineDashOffset=C(w.lineDashOffset,0),n.lineJoin=C(w.lineJoin,"miter"),n.lineWidth=T,n.strokeStyle=C(w.strokeStyle,a),n.setLineDash(C(w.lineDash,[])),r.usePointStyle){const L={radius:m*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:T},O=l.xPlus(M,p/2),H=S+f;pn(n,L,O,H,r.pointStyleWidth&&p)}else{const L=S+Math.max((u-m)/2,0),O=l.leftForLtr(M,p),H=Ct(w.borderRadius);n.beginPath(),Object.values(H).some(X=>X!==0)?se(n,{x:O,y:L,w:p,h:m,radius:H}):n.rect(O,L,p,m),n.fill(),T!==0&&n.stroke()}n.restore()},y=function(M,S,w){zt(n,w.text,M,S+b/2,c,{strikethrough:w.hidden,textAlign:l.textAlign(w.textAlign)})},v=this.isHorizontal(),x=this._computeTitleHeight();v?g={x:q(o,this.left+d,this.right-s[0]),y:this.top+d+x,line:0}:g={x:this.left+d,y:q(o,this.top+x+d,this.bottom-e[0].height),line:0},wn(this.ctx,t.textDirection);const k=b+d;this.legendItems.forEach((M,S)=>{n.strokeStyle=M.fontColor||h,n.fillStyle=M.fontColor||h;const w=n.measureText(M.text).width,T=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),L=p+f+w;let O=g.x,H=g.y;l.setWidth(this.width),v?S>0&&O+L+d>this.right&&(H=g.y+=k,g.line++,O=g.x=q(o,this.left+d,this.right-s[g.line])):S>0&&H+k>this.bottom&&(O=g.x=O+e[g.line].width+d,g.line++,H=g.y=q(o,this.top+x+d,this.bottom-e[g.line].height));const X=l.x(O);_(X,H,M),O=xo(T,O+p+f,v?O+L:this.right,t.rtl),y(l.x(O),H,M),v?g.x+=L+d:g.y+=k}),Sn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=$(e.font),n=U(e.padding);if(!e.display)return;const o=Ft(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=q(t.align,d,this.right-u);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+q(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=q(a,d,d+u);r.textAlign=o.textAlign(an(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,zt(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=$(t.font),s=U(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;si.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o}}=i.legend.options;return i._getSortedDatasetMetas().map(r=>{const a=r.controller.getStyle(e?0:void 0),l=U(a.borderWidth);return{text:t[r.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!r.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:r.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 Qt={average(i){if(!i.length)return!1;let t,e,s=0,n=0,o=0;for(t=0,e=i.length;t-1?i.split(` `):i}function oc(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Ws(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=$(t.bodyFont),c=$(t.titleFont),h=$(t.footerFont),d=o.length,u=n.length,f=s.length,g=U(t.padding);let p=g.height,m=0,b=s.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let _=0;const y=function(v){m=Math.max(m,e.measureText(v).width+_)};return e.save(),e.font=c.string,E(i.title,y),e.font=l.string,E(i.beforeBody.concat(i.afterBody),y),_=t.displayColors?r+2+t.boxPadding:0,E(s,v=>{E(v.before,y),E(v.lines,y),E(v.after,y)}),_=0,e.font=h.string,E(i.footer,y),e.restore(),m+=g.width,{width:m,height:p}}function rc(i,t){const{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function ac(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function lc(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),ac(c,i,t,e)&&(c="center"),c}function Ns(i,t,e){const s=e.yAlign||t.yAlign||rc(i,e);return{xAlign:e.xAlign||t.xAlign||lc(i,t,e,s),yAlign:s}}function cc(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function hc(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Hs(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Ct(r);let g=cc(t,a);const p=hc(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+n:a==="right"&&(g+=Math.max(d,f)+n),{x:Y(g,0,s.width-t.width),y:Y(p,0,s.height-t.height)}}function ve(i,t,e){const s=U(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function js(i){return st([],ct(i))}function dc(i,t,e){return xt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function $s(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}class vi extends rt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new On(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=dc(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=s.beforeTitle.apply(this,[t]),o=s.title.apply(this,[t]),r=s.afterTitle.apply(this,[t]);let a=[];return a=st(a,ct(n)),a=st(a,ct(o)),a=st(a,ct(r)),a}getBeforeBody(t,e){return js(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:s}=e,n=[];return E(t,o=>{const r={before:[],lines:[],after:[]},a=$s(s,o);st(r.before,ct(a.beforeLabel.call(this,o))),st(r.lines,a.label.call(this,o)),st(r.after,ct(a.afterLabel.call(this,o))),n.push(r)}),n}getAfterBody(t,e){return js(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:s}=e,n=s.beforeFooter.apply(this,[t]),o=s.footer.apply(this,[t]),r=s.afterFooter.apply(this,[t]);let a=[];return a=st(a,ct(n)),a=st(a,ct(o)),a=st(a,ct(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),E(a,h=>{const d=$s(t.callbacks,h);n.push(d.labelColor.call(this,h)),o.push(d.labelPointStyle.call(this,h)),r.push(d.labelTextColor.call(this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Qt[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Ws(this,s),c=Object.assign({},a,l),h=Ns(this.chart,s,c),d=Hs(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Ct(a),{x:u,y:f}=t,{width:g,height:p}=e;let m,b,_,y,v,x;return o==="center"?(v=f+p/2,n==="left"?(m=u,b=m-r,y=v+r,x=v-r):(m=u+g,b=m+r,y=v-r,x=v+r),_=m):(n==="left"?b=u+Math.max(l,h)+r:n==="right"?b=u+g-Math.max(c,d)-r:b=this.caretX,o==="top"?(y=f,v=y-r,m=b-r,_=b+r):(y=f+p,v=y+r,m=b+r,_=b-r),x=y),{x1:m,x2:b,x3:_,y1:y,y2:v,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Ft(s.rtl,this.x,this.width);for(t.x=ve(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=$(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,se(t,{x:m,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),se(t,{x:b,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=$(s.bodyFont);let u=d.lineHeight,f=0;const g=Ft(s.rtl,this.x,this.width),p=function(S){e.fillText(S,g.x(t.x+f),t.y+u/2),t.y+=u+o},m=g.textAlign(r);let b,_,y,v,x,k,M;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=ve(this,m,s),e.fillStyle=s.bodyColor,E(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,k=n.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=Qt[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Ws(this,t),l=Object.assign({},r,this._size),c=Ns(e,t,l),h=Hs(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=U(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),wn(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Sn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!we(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!we(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=Qt[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}vi.positioners=Qt;var uc={id:"tooltip",_element:vi,positioners:Qt,afterInit(i,t,e){e&&(i.tooltip=new vi({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:at,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndexi!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const fc=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function gc(i,t,e,s){const n=i.indexOf(t);if(n===-1)return fc(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const pc=(i,t)=>i===null?null:Y(Math.round(i),0,t);class Le extends At{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(R(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:gc(s,t,C(e,t),this._addedLabels),pc(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Le.id="category";Le.defaults={ticks:{callback:Le.prototype.getLabelForValue}};function mc(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,g=h-1,{min:p,max:m}=t,b=!R(r),_=!R(a),y=!R(c),v=(m-p)/(d+1);let x=Hi((m-p)/g/f)*f,k,M,S,w;if(x<1e-14&&!b&&!_)return[{value:p},{value:m}];w=Math.ceil(m/x)-Math.floor(p/x),w>g&&(x=Hi(w*x/g/f)*f),R(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),n==="ticks"?(M=Math.floor(p/x)*x,S=Math.ceil(m/x)*x):(M=p,S=m),b&&_&&o&&uo((a-r)/o,x/1e3)?(w=Math.round(Math.min((a-r)/x,h)),x=(a-r)/w,M=r,S=a):y?(M=b?r:M,S=_?a:S,w=c-1,x=(S-M)/w):(w=(S-M)/x,Gt(w,Math.round(w),x/1e3)?w=Math.round(w):w=Math.ceil(w));const T=Math.max(ji(x),ji(M));k=Math.pow(10,R(l)?T:l),M=Math.round(M*k)/k,S=Math.round(S*k)/k;let L=0;for(b&&(u&&M!==r?(e.push({value:r}),Mn=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=1;(o>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(l=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=mc(n,o);return t.bounds==="ticks"&&tn(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 re(t,this.chart.options.locale,this.options.ticks.format)}}class Bi extends Re{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=N(t)?t:0,this.max=N(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=et(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}}Bi.id="linear";Bi.defaults={ticks:{callback:We.formatters.numeric}};function Xs(i){return i/Math.pow(10,Math.floor(Q(i)))===1}function bc(i,t){const e=Math.floor(Q(t.max)),s=Math.ceil(t.max/Math.pow(10,e)),n=[];let o=J(i.min,Math.pow(10,Math.floor(Q(t.min)))),r=Math.floor(Q(o)),a=Math.floor(o/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do n.push({value:o,major:Xs(o)}),++a,a===10&&(a=1,++r,l=r>=0?1:l),o=Math.round(a*Math.pow(10,r)*l)/l;while(r0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=N(t)?Math.max(0,t):null,this.max=N(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const o=l=>s=t?s:l,r=l=>n=e?n:l,a=(l,c)=>Math.pow(10,Math.floor(Q(l))+c);s===n&&(s<=0?(o(1),r(10)):(o(a(s,-1)),r(a(n,1)))),s<=0&&o(a(n,-1)),n<=0&&r(a(s,1)),this._zero&&this.min!==this._suggestedMin&&s===a(this.min,0)&&o(a(s,-1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=bc(e,this);return t.bounds==="ticks"&&tn(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":re(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Q(t),this._valueRange=Q(this.max)-Q(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Q(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}Gn.id="logarithmic";Gn.defaults={ticks:{callback:We.formatters.logarithmic,major:{enabled:!0}}};function Mi(i){const t=i.ticks;if(t.display&&i.display){const e=U(t.backdropPadding);return C(t.font&&t.font.size,A.font.size)+e.height}return 0}function _c(i,t,e){return e=z(e)?e:[e],{w:$o(i,t.string,e),h:e.length*t.lineHeight}}function Us(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 xc(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?V/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 vc(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,r=Mi(o)/2,a=i.drawingArea,l=o.pointLabels.centerPointLabels?V/n:0;for(let c=0;c270||e<90)&&(i-=t),i}function Sc(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=$(o.font),{x:a,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=i._pointLabelItems[n],{backdropColor:g}=o;if(!R(g)){const p=Ct(o.borderRadius),m=U(o.backdropPadding);e.fillStyle=g;const b=h-m.left,_=d-m.top,y=u-h+m.width,v=f-d+m.height;Object.values(p).some(x=>x!==0)?(e.beginPath(),se(e,{x:b,y:_,w:y,h:v,radius:p}),e.fill()):e.fillRect(b,_,y,v)}zt(e,i._pointLabels[n],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Zn(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,F);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?xc(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=F/(this._pointLabels.length||1),s=this.options.startAngle||0;return G(t*e+et(s))}getDistanceFromCenterForValue(t){if(R(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(R(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(h!==0){a=this.getDistanceFromCenterForValue(c.value);const d=n.setContext(this.getContext(h-1));Pc(this,d,a,o)}}),s.display){for(t.save(),r=o-1;r>=0;r--){const c=s.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.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=$(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 d=U(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}zt(t,a.label,0,-o,h,{color:c.color})}),t.restore()}drawTitle(){}}ce.id="radialLinear";ce.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:We.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};ce.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};ce.descriptors={angleLines:{_fallback:"grid"}};const Ye={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}},K=Object.keys(Ye);function Dc(i,t){return i-t}function Ks(i,t){if(R(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)),N(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(It(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function qs(i,t,e,s){const n=K.length;for(let o=K.indexOf(i);o=K.indexOf(e);o--){const r=K[o];if(Ye[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return K[e?K.indexOf(e):0]}function Ac(i){for(let t=K.indexOf(i)+1,e=K.length;t=t?e[s]:e[n];i[o]=!0}}function Tc(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 Zs(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=Y(e,0,r),s=Y(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||qs(o.minUnit,e,s,this._getLabelCapacity(e)),a=C(o.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=It(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,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 g=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;up-m).map(p=>+p)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=s[e],u=l&&h&&d&&d.major,f=this._adapter.format(t,n||(u?h:c)),g=o.ticks.callback;return g?I(g,[f,e,s],this):f}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}=Pt(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}=Pt(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 Jn extends Xe{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=Me(e,this.min),this._tableRange=Me(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(n.current&&(o.current=new Ne(n.current,{type:i,data:t,options:Qn({maintainAspectRatio:!1,animation:{duration:250},plugins:{legend:{position:"bottom",display:!s},tooltip:{padding:16,cornerRadius:4,callbacks:{title:([r])=>{var l;return(l=r.raw.tooltipTitle)!=null?l:r.label},label:r=>` ${r.dataset.label}: ${r.formattedValue}`}}}},e)})),()=>{var r;(r=o.current)==null||r.destroy()}),[t,i,e,s]),to("canvas",{ref:n})}export{Rc as default}; //# sourceMappingURL=lazy-chart.f4a51050.js.map