import{l}from'./chunk-54JF0Aut.js';import{cJ as I$1,bF as Uu,aY as S,cK as A,gI as Y,g,cM as Z$1,cN as kt,gJ as Yhe,cR as ce$1,at as Mn$1,dT as ie$1,b as Pa$1,cT as Ln$1,cU as mn$1,cV as j0e,L as qp,dN as k5,$ as $t$1,ah as c$,bP as D$1,bQ as af,al as H$1,av as E$1,ao as D$2,U as cl$1,gK as qo$1,cf as I0,R as tl$1,s as sp,F as Fp,u as ub,a3 as B0,cs as Lp,d2 as Pj,fh as FV,cE as BV,bV as vz,J as Jn$1,Q as Qn$1,cg as ef,c4 as U,cl as Up,cm as Bp,y as yV,a6 as KV,z as zB,cy as vb,cd as R3,X as Xh$1,ev as hz,T as Tr$1,e as Pp,ae as R2,af as A2,ak as wx,ag as N2,q as qn$1,l as ln$1,as as Yl$1,n as Mx,t as GH,N as Nx,W as WH,m as _2,o as bV,A as w2,_ as _0,D as D$,aj as IV,ce as u$,cG as V0,p as e$,au as ow}from'./main-BiUBeaMj.js';var ur=H$1((Qu,ou)=>{ou.exports=`<svg width="216" height="271" viewBox="0 0 216 271" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 23.1156V-23.002L25.1602 0.0568237L-10.2515 23.1156Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 69.2328V23.1152L25.1602 46.174L-10.2515 69.2328Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M25.1618 46.1742V0.0566406L59.75 23.1154L25.1618 46.1742Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M24.75 98V46L59.75 72L24.75 98Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 23.1136V-23.0039L95.1611 0.0548706L59.7494 23.1136Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 69.2328V23.1152L95.1611 46.174L59.7494 69.2328Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.1638 46.1742V0.0566406L129.752 23.1154L95.1638 46.1742Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 23.1136V-23.0039L165.162 0.0548706L129.75 23.1136Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 69.2328V23.1152L165.162 46.174L129.75 69.2328Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M165.161 46.1742V0.0566406L199.749 23.1154L165.161 46.1742Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 23.1156V-23.002L235.162 0.0568237L199.75 23.1156Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 69.2347V23.1172L235.162 46.176L199.75 69.2347Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 121.121V75.0039L25.1602 98.0627L-10.2515 121.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 167.239V121.121L25.1602 144.18L-10.2515 167.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M25.1618 144.18V98.0625L59.75 121.121L25.1618 144.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 121.121V75.0039L95.1611 98.0627L59.7494 121.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 167.239V121.121L95.1611 144.18L59.7494 167.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.1638 144.18V98.0625L129.752 121.121L95.1638 144.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 121.121V75.0039L165.162 98.0627L129.75 121.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 167.239V121.121L165.162 144.18L129.75 167.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M165.161 144.18V98.0625L199.749 121.121L165.161 144.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 121.121V75.0039L235.162 98.0627L199.75 121.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 167.239V121.121L235.162 144.18L199.75 167.239Z" fill="currentColor" />

    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 121.116V74.998L25.1602 98.0568L-10.2515 121.116Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 167.233V121.115L25.1602 144.174L-10.2515 167.233Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M25.1618 144.174V98.0566L59.75 121.115L25.1618 144.174Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 121.114V74.9961L95.1611 98.0549L59.7494 121.114Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 167.233V121.115L95.1611 144.174L59.7494 167.233Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.1638 144.174V98.0566L129.752 121.115L95.1638 144.174Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 121.114V74.9961L165.162 98.0549L129.75 121.114Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 167.233V121.115L165.162 144.174L129.75 167.233Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M165.161 144.174V98.0566L199.749 121.115L165.161 144.174Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 121.116V74.998L235.162 98.0568L199.75 121.116Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 167.235V121.117L235.162 144.176L199.75 167.235Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 219.121V173.004L25.1602 196.063L-10.2515 219.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 265.239V219.121L25.1602 242.18L-10.2515 265.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M25.1618 242.18V196.062L59.75 219.121L25.1618 242.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 219.121V173.004L95.1611 196.063L59.7494 219.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 265.239V219.121L95.1611 242.18L59.7494 265.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.1638 242.18V196.062L129.752 219.121L95.1638 242.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 219.121V173.004L165.162 196.063L129.75 219.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 265.239V219.121L165.162 242.18L129.75 265.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M165.161 242.18V196.062L199.749 219.121L165.161 242.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 219.121V173.004L235.162 196.063L199.75 219.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 265.239V219.121L235.162 242.18L199.75 265.239Z" fill="currentColor" />

    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.75 98V46L130.75 72L95.75 98Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M164.75 98V46L199.75 72L164.75 98Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.75 199V147L130.75 173L95.75 199Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M26.75 199V147L61.75 173L26.75 199Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M164.75 199V147L199.75 173L164.75 199Z" fill="currentColor" />
  </svg>
`;});function xe(e){return e+.5|0;}var Pt=(e,i,t)=>Math.max(Math.min(e,t),i);function be(e){return Pt(xe(e*2.55),0,255);}function Lt(e){return Pt(xe(e*255),0,255);}function xt(e){return Pt(xe(e/2.55)/100,0,1);}function Xs(e){return Pt(xe(e*100),0,100);}var at={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},Hi=[..."0123456789ABCDEF"],gr=e=>Hi[e&15],pr=e=>Hi[(e&240)>>4]+Hi[e&15],qe=e=>(e&240)>>4===(e&15),mr=e=>qe(e.r)&&qe(e.g)&&qe(e.b)&&qe(e.a);function br(e){var i=e.length,t;return e[0]==="#"&&(i===4||i===5?t={r:255&at[e[1]]*17,g:255&at[e[2]]*17,b:255&at[e[3]]*17,a:i===5?at[e[4]]*17:255}:(i===7||i===9)&&(t={r:at[e[1]]<<4|at[e[2]],g:at[e[3]]<<4|at[e[4]],b:at[e[5]]<<4|at[e[6]],a:i===9?at[e[7]]<<4|at[e[8]]:255})),t;}var _r=(e,i)=>e<255?i(e):"";function xr(e){var i=mr(e)?gr:pr;return e?"#"+i(e.r)+i(e.g)+i(e.b)+_r(e.a,i):void 0;}var yr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Gs(e,i,t){let n=i*Math.min(t,1-t),s=(o,a=(o+e/30)%12)=>t-n*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)];}function vr(e,i,t){let n=(s,o=(s+e/60)%6)=>t-t*i*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)];}function Mr(e,i,t){let n=Gs(e,1,.5),s;for(i+t>1&&(s=1/(i+t),i*=s,t*=s),s=0;s<3;s++)n[s]*=1-i-t,n[s]+=i;return n;}function Cr(e,i,t,n,s){return e===s?(i-t)/n+(i<t?6:0):i===s?(t-e)/n+2:(e-i)/n+4;}function Wi(e){let t=e.r/255,n=e.g/255,s=e.b/255,o=Math.max(t,n,s),a=Math.min(t,n,s),r=(o+a)/2,l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=Cr(t,n,s,h,o),l=l*60+.5),[l|0,c||0,r];}function ji(e,i,t,n){return(Array.isArray(i)?e(i[0],i[1],i[2]):e(i,t,n)).map(Lt);}function $i(e,i,t){return ji(Gs,e,i,t);}function Sr(e,i,t){return ji(Mr,e,i,t);}function wr(e,i,t){return ji(vr,e,i,t);}function Js(e){return(e%360+360)%360;}function kr(e){let i=yr.exec(e),t=255,n;if(!i)return;i[5]!==n&&(t=i[6]?be(+i[5]):Lt(+i[5]));let s=Js(+i[2]),o=+i[3]/100,a=+i[4]/100;return i[1]==="hwb"?n=Sr(s,o,a):i[1]==="hsv"?n=wr(s,o,a):n=$i(s,o,a),{r:n[0],g:n[1],b:n[2],a:t};}function Pr(e,i){var t=Wi(e);t[0]=Js(t[0]+i),t=$i(t),e.r=t[0],e.g=t[1],e.b=t[2];}function Lr(e){if(!e)return;let i=Wi(e),t=i[0],n=Xs(i[1]),s=Xs(i[2]);return e.a<255?`hsla(${t}, ${n}%, ${s}%, ${xt(e.a)})`:`hsl(${t}, ${n}%, ${s}%)`;}var Zs={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"},Ks={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 Or(){let e={},i=Object.keys(Ks),t=Object.keys(Zs),n,s,o,a,r;for(n=0;n<i.length;n++){for(a=r=i[n],s=0;s<t.length;s++)o=t[s],r=r.replace(o,Zs[o]);o=parseInt(Ks[a],16),e[r]=[o>>16&255,o>>8&255,o&255];}return e;}var Ge;function Dr(e){Ge||(Ge=Or(),Ge.transparent=[0,0,0,0]);let i=Ge[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:i.length===4?i[3]:255};}var Ar=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Tr(e){let i=Ar.exec(e),t=255,n,s,o;if(i){if(i[7]!==n){let a=+i[7];t=i[8]?be(a):Pt(a*255,0,255);}return n=+i[1],s=+i[3],o=+i[5],n=255&(i[2]?be(n):Pt(n,0,255)),s=255&(i[4]?be(s):Pt(s,0,255)),o=255&(i[6]?be(o):Pt(o,0,255)),{r:n,g:s,b:o,a:t};}}function Er(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${xt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`);}var Ni=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Jt=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Rr(e,i,t){let n=Jt(xt(e.r)),s=Jt(xt(e.g)),o=Jt(xt(e.b));return{r:Lt(Ni(n+t*(Jt(xt(i.r))-n))),g:Lt(Ni(s+t*(Jt(xt(i.g))-s))),b:Lt(Ni(o+t*(Jt(xt(i.b))-o))),a:e.a+t*(i.a-e.a)};}function Je(e,i,t){if(e){let n=Wi(e);n[i]=Math.max(0,Math.min(n[i]+n[i]*t,i===0?360:1)),n=$i(n),e.r=n[0],e.g=n[1],e.b=n[2];}}function Qs(e,i){return e&&Object.assign(i||{},e);}function qs(e){var i={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(i={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(i.a=Lt(e[3]))):(i=Qs(e,{r:0,g:0,b:0,a:1}),i.a=Lt(i.a)),i;}function Ir(e){return e.charAt(0)==="r"?Tr(e):kr(e);}var _e=class e{constructor(i){if(i instanceof e)return i;let t=typeof i,n;t==="object"?n=qs(i):t==="string"&&(n=br(i)||Dr(i)||Ir(i)),this._rgb=n,this._valid=!!n;}get valid(){return this._valid;}get rgb(){var i=Qs(this._rgb);return i&&(i.a=xt(i.a)),i;}set rgb(i){this._rgb=qs(i);}rgbString(){return this._valid?Er(this._rgb):void 0;}hexString(){return this._valid?xr(this._rgb):void 0;}hslString(){return this._valid?Lr(this._rgb):void 0;}mix(i,t){if(i){let n=this.rgb,s=i.rgb,o,a=t===o?.5:t,r=2*a-1,l=n.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=a*n.a+(1-a)*s.a,this.rgb=n;}return this;}interpolate(i,t){return i&&(this._rgb=Rr(this._rgb,i._rgb,t)),this;}clone(){return new e(this.rgb);}alpha(i){return this._rgb.a=Lt(i),this;}clearer(i){let t=this._rgb;return t.a*=1-i,this;}greyscale(){let i=this._rgb,t=xe(i.r*.3+i.g*.59+i.b*.11);return i.r=i.g=i.b=t,this;}opaquer(i){let t=this._rgb;return t.a*=1+i,this;}negate(){let i=this._rgb;return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,this;}lighten(i){return Je(this._rgb,2,i),this;}darken(i){return Je(this._rgb,2,-i),this;}saturate(i){return Je(this._rgb,1,i),this;}desaturate(i){return Je(this._rgb,1,-i),this;}rotate(i){return Pr(this._rgb,i),this;}};function ft(){}var ho=(()=>{let e=0;return()=>e++;})();function O(e){return e==null;}function F(e){if(Array.isArray&&Array.isArray(e))return true;let i=Object.prototype.toString.call(e);return i.slice(0,7)==="[object"&&i.slice(-6)==="Array]";}function D(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]";}function N(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e);}function Q(e,i){return N(e)?e:i;}function k(e,i){return typeof e>"u"?i:e;}var uo=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/i,Zi=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*i:+e;function I(e,i,t){if(e&&typeof e.call=="function")return e.apply(t,i);}function E(e,i,t,n){let s,o,a;if(F(e)){if(o=e.length,n);else for(s=0;s<o;s++)i.call(t,e[s],s);}else if(D(e))for(a=Object.keys(e),o=a.length,s=0;s<o;s++)i.call(t,e[a[s]],a[s]);}function Me(e,i){let t,n,s,o;if(!e||!i||e.length!==i.length)return false;for(t=0,n=e.length;t<n;++t)if(s=e[t],o=i[t],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return false;return true;}function ii(e){if(F(e))return e.map(ii);if(D(e)){let i=Object.create(null),t=Object.keys(e),n=t.length,s=0;for(;s<n;++s)i[t[s]]=ii(e[t[s]]);return i;}return e;}function fo(e){return["__proto__","prototype","constructor"].indexOf(e)===-1;}function Fr(e,i,t,n){if(!fo(e))return;let s=i[e],o=t[e];D(s)&&D(o)?te(s,o,n):i[e]=ii(o);}function te(e,i,t){let n=F(i)?i:[i],s=n.length;if(!D(e))return e;t=t||{};let o=t.merger||Fr,a;for(let r=0;r<s;++r){if(a=n[r],!D(a))continue;let l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],e,a,t);}return e;}function ie(e,i){return te(e,i,{merger:zr});}function zr(e,i,t){if(!fo(e))return;let n=i[e],s=t[e];D(n)&&D(s)?ie(n,s):Object.prototype.hasOwnProperty.call(i,e)||(i[e]=ii(s));}var to={"":e=>e,x:e=>e.x,y:e=>e.y};function Br(e){let i=e.split("."),t=[],n="";for(let s of i)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(t.push(n),n="");return t;}function Vr(e){let i=Br(e);return t=>{for(let n of i){if(n==="")break;t=t&&t[n];}return t;};}function Mt(e,i){return(to[i]||(to[i]=Vr(i)))(e);}function ai(e){return e.charAt(0).toUpperCase()+e.slice(1);}var ne=e=>typeof e<"u",yt=e=>typeof e=="function",Ki=(e,i)=>{if(e.size!==i.size)return false;for(let t of e)if(!i.has(t))return false;return true;};function go(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu";}var T=Math.PI,z=2*T,Nr=z+T,ni=Number.POSITIVE_INFINITY,Hr=T/180,H=T/2,Ht=T/4,eo=T*2/3,vt=Math.log10,ct=Math.sign;function se(e,i,t){return Math.abs(e-i)<t;}function qi(e){let i=Math.round(e);e=se(e,i,e/1e3)?i:e;let t=Math.pow(10,Math.floor(vt(e))),n=e/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t;}function po(e){let i=[],t=Math.sqrt(e),n;for(n=1;n<t;n++)e%n===0&&(i.push(n),i.push(e/n));return t===(t|0)&&i.push(t),i.sort((s,o)=>s-o).pop(),i;}function Wr(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e);}function $t(e){return!Wr(e)&&!isNaN(parseFloat(e))&&isFinite(e);}function mo(e,i){let t=Math.round(e);return t-i<=e&&t+i>=e;}function Gi(e,i,t){let n,s,o;for(n=0,s=e.length;n<s;n++)o=e[n][t],isNaN(o)||(i.min=Math.min(i.min,o),i.max=Math.max(i.max,o));}function rt(e){return e*(T/180);}function ri(e){return e*(180/T);}function Ji(e){if(!N(e))return;let i=1,t=0;for(;Math.round(e*i)/i!==e;)i*=10,t++;return t;}function Qi(e,i){let t=i.x-e.x,n=i.y-e.y,s=Math.sqrt(t*t+n*n),o=Math.atan2(n,t);return o<-0.5*T&&(o+=z),{angle:o,distance:s};}function si(e,i){return Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2));}function jr(e,i){return(e-i+Nr)%z-T;}function X(e){return(e%z+z)%z;}function oe(e,i,t,n){let s=X(e),o=X(i),a=X(t),r=X(o-s),l=X(a-s),c=X(s-o),h=X(s-a);return s===o||s===a||n&&o===a||r>l&&c<h;}function $(e,i,t){return Math.max(i,Math.min(t,e));}function bo(e){return $(e,-32768,32767);}function gt(e,i,t,n=1e-6){return e>=Math.min(i,t)-n&&e<=Math.max(i,t)+n;}function li(e,i,t){t=t||(a=>e[a]<i);let n=e.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,t(o)?s=o:n=o;return{lo:s,hi:n};}var dt=(e,i,t,n)=>li(e,t,n?s=>{let o=e[s][i];return o<t||o===t&&e[s+1][i]===t;}:s=>e[s][i]<t),_o=(e,i,t)=>li(e,t,n=>e[n][i]>=t);function xo(e,i,t){let n=0,s=e.length;for(;n<s&&e[n]<i;)n++;for(;s>n&&e[s-1]>t;)s--;return n>0||s<e.length?e.slice(n,s):e;}var yo=["push","pop","shift","splice","unshift"];function vo(e,i){if(e._chartjs){e._chartjs.listeners.push(i);return;}Object.defineProperty(e,"_chartjs",{configurable:true,enumerable:false,value:{listeners:[i]}}),yo.forEach(t=>{let n="_onData"+ai(t),s=e[t];Object.defineProperty(e,t,{configurable:true,enumerable:false,value(...o){let a=s.apply(this,o);return e._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o);}),a;}});});}function tn(e,i){let t=e._chartjs;if(!t)return;let n=t.listeners,s=n.indexOf(i);s!==-1&&n.splice(s,1),!(n.length>0)&&(yo.forEach(o=>{delete e[o];}),delete e._chartjs);}function en(e){let i=new Set(e);return i.size===e.length?e:Array.from(i);}var nn=function(){return typeof window>"u"?function(e){return e();}:window.requestAnimationFrame;}();function sn(e,i){let t=[],n=false;return function(...s){t=s,n||(n=true,nn.call(window,()=>{n=false,e.apply(i,t);}));};}function Mo(e,i){let t;return function(...n){return i?(clearTimeout(t),t=setTimeout(e,i,n)):e.apply(this,n),i;};}var ci=e=>e==="start"?"left":e==="end"?"right":"center",Z=(e,i,t)=>e==="start"?i:e==="end"?t:(i+t)/2,Co=(e,i,t,n)=>e===(n?"left":"right")?t:e==="center"?(i+t)/2:i;function on(e,i,t){let n=i.length,s=0,o=n;if(e._sorted){let{iScale:a,vScale:r,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,h=a.axis,{min:d,max:u,minDefined:f,maxDefined:p}=a.getUserBounds();if(f){if(s=Math.min(dt(l,h,d).lo,t?n:dt(i,h,a.getPixelForValue(d)).lo),c){let g=l.slice(0,s+1).reverse().findIndex(m=>!O(m[r.axis]));s-=Math.max(0,g);}s=$(s,0,n-1);}if(p){let g=Math.max(dt(l,a.axis,u,true).hi+1,t?0:dt(i,h,a.getPixelForValue(u),true).hi+1);if(c){let m=l.slice(g-1).findIndex(b=>!O(b[r.axis]));g+=Math.max(0,m);}o=$(g,s,n)-s;}else o=n-s;}return{start:s,count:o};}function an(e){let{xScale:i,yScale:t,_scaleRanges:n}=e,s={xmin:i.min,xmax:i.max,ymin:t.min,ymax:t.max};if(!n)return e._scaleRanges=s,true;let o=n.xmin!==i.min||n.xmax!==i.max||n.ymin!==t.min||n.ymax!==t.max;return Object.assign(n,s),o;}var Qe=e=>e===0||e===1,io=(e,i,t)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-i)*z/t)),no=(e,i,t)=>Math.pow(2,-10*e)*Math.sin((e-i)*z/t)+1,Qt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-0.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*H)+1,easeOutSine:e=>Math.sin(e*H),easeInOutSine:e=>-0.5*(Math.cos(T*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Qe(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Qe(e)?e:io(e,.075,.3),easeOutElastic:e=>Qe(e)?e:no(e,.075,.3),easeInOutElastic(e){return Qe(e)?e:e<.5?.5*io(e*2,.1125,.45):.5+.5*no(e*2-1,.1125,.45);},easeInBack(e){return e*e*((1.70158+1)*e-1.70158);},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1;},easeInOutBack(e){let i=1.70158;return(e/=.5)<1?.5*(e*e*(((i*=1.525)+1)*e-i)):.5*((e-=2)*e*(((i*=1.525)+1)*e+i)+2);},easeInBounce:e=>1-Qt.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375;},easeInOutBounce:e=>e<.5?Qt.easeInBounce(e*2)*.5:Qt.easeOutBounce(e*2-1)*.5+.5};function rn(e){if(e&&typeof e=="object"){let i=e.toString();return i==="[object CanvasPattern]"||i==="[object CanvasGradient]";}return false;}function ln(e){return rn(e)?e:new _e(e);}function Yi(e){return rn(e)?e:new _e(e).saturate(.5).darken(.1).hexString();}var $r=["x","y","borderWidth","radius","tension"],Yr=["color","borderColor","backgroundColor"];function Ur(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:false,_indexable:false,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"}),e.set("animations",{colors:{type:"color",properties:Yr},numbers:{type:"number",properties:$r}}),e.describe("animations",{_fallback:"animation"}),e.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}}}});}function Xr(e){e.set("layout",{autoPadding:true,padding:{top:0,right:0,bottom:0,left:0}});}var so=new Map();function Zr(e,i){i=i||{};let t=e+JSON.stringify(i),n=so.get(t);return n||(n=new Intl.NumberFormat(e,i),so.set(t,n)),n;}function ae(e,i,t){return Zr(i,t).format(e);}var So={values(e){return F(e)?e:""+e;},numeric(e,i,t){if(e===0)return"0";let n=this.chart.options.locale,s,o=e;if(t.length>1){let c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Kr(e,t);}let a=vt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ae(e,n,l);},logarithmic(e,i,t){if(e===0)return"0";let n=t[i].significand||e/Math.pow(10,Math.floor(vt(e)));return[1,2,3,5,10,15].includes(n)||i>.8*t.length?So.numeric.call(this,e,i,t):"";}};function Kr(e,i){let t=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value;return Math.abs(t)>=1&&e!==Math.floor(e)&&(t=e-Math.floor(e)),t;}var Ce={formatters:So};function qr(e){e.set("scale",{display:true,offset:false,reverse:false,beginAtZero:false,bounds:"ticks",clip:true,grace:0,grid:{display:true,lineWidth:1,drawOnChartArea:true,drawTicks:true,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:false},border:{display:true,dash:[],dashOffset:0,width:1},title:{display:false,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:false,textStrokeWidth:0,textStrokeColor:"",padding:3,display:true,autoSkip:true,autoSkipPadding:3,labelOffset:0,callback:Ce.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:false,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:false,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"&&i!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});}var At=Object.create(null),hi=Object.create(null);function ye(e,i){if(!i)return e;let t=i.split(".");for(let n=0,s=t.length;n<s;++n){let o=t[n];e=e[o]||(e[o]=Object.create(null));}return e;}function Ui(e,i,t){return typeof i=="string"?te(ye(e,i),t):te(ye(e,""),i);}var Xi=class{constructor(i,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.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=(n,s)=>Yi(s.backgroundColor),this.hoverBorderColor=(n,s)=>Yi(s.borderColor),this.hoverColor=(n,s)=>Yi(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:true,includeInvisible:false},this.maintainAspectRatio=true,this.onHover=null,this.onClick=null,this.parsing=true,this.plugins={},this.responsive=true,this.scale=void 0,this.scales={},this.showLine=true,this.drawActiveElementsOnTop=true,this.describe(i),this.apply(t);}set(i,t){return Ui(this,i,t);}get(i){return ye(this,i);}describe(i,t){return Ui(hi,i,t);}override(i,t){return Ui(At,i,t);}route(i,t,n,s){let o=ye(this,i),a=ye(this,n),r="_"+t;Object.defineProperties(o,{[r]:{value:o[t],writable:true},[t]:{enumerable:true,get(){let l=this[r],c=a[s];return D(l)?Object.assign({},c,l):k(l,c);},set(l){this[r]=l;}}});}apply(i){i.forEach(t=>t(this));}},B=new Xi({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:false,_indexable:false}},[Ur,Xr,qr]);function Gr(e){return!e||O(e.size)||O(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family;}function ve(e,i,t,n,s){let o=i[s];return o||(o=i[s]=e.measureText(s).width,t.push(s)),o>n&&(n=o),n;}function wo(e,i,t,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==i&&(s=n.data={},o=n.garbageCollect=[],n.font=i),e.save(),e.font=i;let a=0,r=t.length,l,c,h,d,u;for(l=0;l<r;l++)if(d=t[l],d!=null&&!F(d))a=ve(e,s,o,a,d);else if(F(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!F(u)&&(a=ve(e,s,o,a,u));e.restore();let f=o.length/2;if(f>t.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f);}return a;}function Tt(e,i,t){let n=e.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((i-s)*n)/n+s;}function cn(e,i){!i&&!e||(i=i||e.getContext("2d"),i.save(),i.resetTransform(),i.clearRect(0,0,e.width,e.height),i.restore());}function di(e,i,t,n){hn(e,i,t,n,null);}function hn(e,i,t,n,s){let o,a,r,l,c,h,d,u,f=i.pointStyle,p=i.rotation,g=i.radius,m=(p||0)*Hr;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(t,n),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return;}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),f){default:s?e.ellipse(t,n,s/2,g,0,0,z):e.arc(t,n,g,0,z),e.closePath();break;case"triangle":h=s?s/2:g,e.moveTo(t+Math.sin(m)*h,n-Math.cos(m)*g),m+=eo,e.lineTo(t+Math.sin(m)*h,n-Math.cos(m)*g),m+=eo,e.lineTo(t+Math.sin(m)*h,n-Math.cos(m)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,a=Math.cos(m+Ht)*l,d=Math.cos(m+Ht)*(s?s/2-c:l),r=Math.sin(m+Ht)*l,u=Math.sin(m+Ht)*(s?s/2-c:l),e.arc(t-d,n-r,c,m-T,m-H),e.arc(t+u,n-a,c,m-H,m),e.arc(t+d,n+r,c,m,m+H),e.arc(t-u,n+a,c,m+H,m+T),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=s?s/2:l,e.rect(t-h,n-l,2*h,2*l);break;}m+=Ht;case"rectRot":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(t-d,n-r),e.lineTo(t+u,n-a),e.lineTo(t+d,n+r),e.lineTo(t-u,n+a),e.closePath();break;case"crossRot":m+=Ht;case"cross":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(t-d,n-r),e.lineTo(t+d,n+r),e.moveTo(t+u,n-a),e.lineTo(t-u,n+a);break;case"star":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(t-d,n-r),e.lineTo(t+d,n+r),e.moveTo(t+u,n-a),e.lineTo(t-u,n+a),m+=Ht,d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(t-d,n-r),e.lineTo(t+d,n+r),e.moveTo(t+u,n-a),e.lineTo(t-u,n+a);break;case"line":a=s?s/2:Math.cos(m)*g,r=Math.sin(m)*g,e.moveTo(t-a,n-r),e.lineTo(t+a,n+r);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(m)*(s?s/2:g),n+Math.sin(m)*g);break;case false:e.closePath();break;}e.fill(),i.borderWidth>0&&e.stroke();}}function ut(e,i,t){return t=t||.5,!i||e&&e.x>i.left-t&&e.x<i.right+t&&e.y>i.top-t&&e.y<i.bottom+t;}function Se(e,i){e.save(),e.beginPath(),e.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),e.clip();}function we(e){e.restore();}function ko(e,i,t,n,s){if(!i)return e.lineTo(t.x,t.y);if(s==="middle"){let o=(i.x+t.x)/2;e.lineTo(o,i.y),e.lineTo(o,t.y);}else s==="after"!=!!n?e.lineTo(i.x,t.y):e.lineTo(t.x,i.y);e.lineTo(t.x,t.y);}function Po(e,i,t,n){if(!i)return e.lineTo(t.x,t.y);e.bezierCurveTo(n?i.cp1x:i.cp2x,n?i.cp1y:i.cp2y,n?t.cp2x:t.cp1x,n?t.cp2y:t.cp1y,t.x,t.y);}function Jr(e,i){i.translation&&e.translate(i.translation[0],i.translation[1]),O(i.rotation)||e.rotate(i.rotation),i.color&&(e.fillStyle=i.color),i.textAlign&&(e.textAlign=i.textAlign),i.textBaseline&&(e.textBaseline=i.textBaseline);}function Qr(e,i,t,n,s){if(s.strikethrough||s.underline){let o=e.measureText(n),a=i-o.actualBoundingBoxLeft,r=i+o.actualBoundingBoxRight,l=t-o.actualBoundingBoxAscent,c=t+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(a,h),e.lineTo(r,h),e.stroke();}}function tl(e,i){let t=e.fillStyle;e.fillStyle=i.color,e.fillRect(i.left,i.top,i.width,i.height),e.fillStyle=t;}function Et(e,i,t,n,s,o={}){let a=F(i)?i:[i],r=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Jr(e,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&tl(e,o.backdrop),r&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),O(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,t,n,o.maxWidth)),e.fillText(c,t,n,o.maxWidth),Qr(e,t,n,c,o),n+=Number(s.lineHeight);e.restore();}function re(e,i){let{x:t,y:n,w:s,h:o,radius:a}=i;e.arc(t+a.topLeft,n+a.topLeft,a.topLeft,1.5*T,T,true),e.lineTo(t,n+o-a.bottomLeft),e.arc(t+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,T,H,true),e.lineTo(t+s-a.bottomRight,n+o),e.arc(t+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,H,0,true),e.lineTo(t+s,n+a.topRight),e.arc(t+s-a.topRight,n+a.topRight,a.topRight,0,-H,true),e.lineTo(t+a.topLeft,n);}var el=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,il=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function nl(e,i){let t=(""+e).match(el);if(!t||t[1]==="normal")return i*1.2;switch(e=+t[2],t[3]){case"px":return e;case"%":e/=100;break;}return i*e;}var sl=e=>+e||0;function ui(e,i){let t={},n=D(i),s=n?Object.keys(i):i,o=D(e)?n?a=>k(e[a],e[i[a]]):a=>e[a]:()=>e;for(let a of s)t[a]=sl(o(a));return t;}function dn(e){return ui(e,{top:"y",right:"x",bottom:"y",left:"x"});}function Rt(e){return ui(e,["topLeft","topRight","bottomLeft","bottomRight"]);}function K(e){let i=dn(e);return i.width=i.left+i.right,i.height=i.top+i.bottom,i;}function j(e,i){e=e||{},i=i||B.font;let t=k(e.size,i.size);typeof t=="string"&&(t=parseInt(t,10));let n=k(e.style,i.style);n&&!(""+n).match(il)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let s={family:k(e.family,i.family),lineHeight:nl(k(e.lineHeight,i.lineHeight),t),size:t,style:n,weight:k(e.weight,i.weight),string:""};return s.string=Gr(s),s;}function le(e,i,t,n){let o,a,r;for(o=0,a=e.length;o<a;++o)if(r=e[o],r!==void 0&&r!==void 0)return r;}function Lo(e,i,t){let{min:n,max:s}=e,o=Zi(i,(s-n)/2),a=(r,l)=>t&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)};}function Ct(e,i){return Object.assign(Object.create(e),i);}function fi(e,i=[""],t,n,s=()=>e[0]){let o=t||e;typeof n>"u"&&(n=Ao("_fallback",e));let a={[Symbol.toStringTag]:"Object",_cacheable:true,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>fi([r,...e],i,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete e[0][l],true;},get(r,l){return Oo(r,l,()=>ul(l,i,e,r));},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l);},getPrototypeOf(){return Reflect.getPrototypeOf(e[0]);},has(r,l){return ao(r).includes(l);},ownKeys(r){return ao(r);},set(r,l,c){let h=r._storage||(r._storage=s());return r[l]=h[l]=c,delete r._keys,true;}});}function jt(e,i,t,n){let s={_cacheable:false,_proxy:e,_context:i,_subProxy:t,_stack:new Set(),_descriptors:un(e,n),setContext:o=>jt(e,o,t,n),override:o=>jt(e.override(o),i,t,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete e[a],true;},get(o,a,r){return Oo(o,a,()=>al(o,a,r));},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(e,a)?{enumerable:true,configurable:true}:void 0:Reflect.getOwnPropertyDescriptor(e,a);},getPrototypeOf(){return Reflect.getPrototypeOf(e);},has(o,a){return Reflect.has(e,a);},ownKeys(){return Reflect.ownKeys(e);},set(o,a,r){return e[a]=r,delete o[a],true;}});}function un(e,i={scriptable:true,indexable:true}){let{_scriptable:t=i.scriptable,_indexable:n=i.indexable,_allKeys:s=i.allKeys}=e;return{allKeys:s,scriptable:t,indexable:n,isScriptable:yt(t)?t:()=>t,isIndexable:yt(n)?n:()=>n};}var ol=(e,i)=>e?e+ai(i):i,fn=(e,i)=>D(i)&&e!=="adapters"&&(Object.getPrototypeOf(i)===null||i.constructor===Object);function Oo(e,i,t){if(Object.prototype.hasOwnProperty.call(e,i)||i==="constructor")return e[i];let n=t();return e[i]=n,n;}function al(e,i,t){let{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=e,r=n[i];return yt(r)&&a.isScriptable(i)&&(r=rl(i,r,e,t)),F(r)&&r.length&&(r=ll(i,r,e,a.isIndexable)),fn(i,r)&&(r=jt(r,s,o&&o[i],a)),r;}function rl(e,i,t,n){let{_proxy:s,_context:o,_subProxy:a,_stack:r}=t;if(r.has(e))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+e);r.add(e);let l=i(o,a||n);return r.delete(e),fn(e,l)&&(l=gn(s._scopes,s,e,l)),l;}function ll(e,i,t,n){let{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=t;if(typeof o.index<"u"&&n(e))return i[o.index%i.length];if(D(i[0])){let l=i,c=s._scopes.filter(h=>h!==l);i=[];for(let h of l){let d=gn(c,s,e,h);i.push(jt(d,o,a&&a[e],r));}}return i;}function Do(e,i,t){return yt(e)?e(i,t):e;}var cl=(e,i)=>e===true?i:typeof e=="string"?Mt(i,e):void 0;function hl(e,i,t,n,s){for(let o of i){let a=cl(t,o);if(a){e.add(a);let r=Do(a._fallback,t,s);if(typeof r<"u"&&r!==t&&r!==n)return r;}else if(a===false&&typeof n<"u"&&t!==n)return null;}return false;}function gn(e,i,t,n){let s=i._rootScopes,o=Do(i._fallback,t,n),a=[...e,...s],r=new Set();r.add(n);let l=oo(r,a,t,o||t,n);return l===null||typeof o<"u"&&o!==t&&(l=oo(r,a,o,l,n),l===null)?false:fi(Array.from(r),[""],s,o,()=>dl(i,t,n));}function oo(e,i,t,n,s){for(;t;)t=hl(e,i,t,n,s);return t;}function dl(e,i,t){let n=e._getTarget();i in n||(n[i]={});let s=n[i];return F(s)&&D(t)?t:s||{};}function ul(e,i,t,n){let s;for(let o of i)if(s=Ao(ol(o,e),t),typeof s<"u")return fn(e,s)?gn(t,n,e,s):s;}function Ao(e,i){for(let t of i){if(!t)continue;let n=t[e];if(typeof n<"u")return n;}}function ao(e){let i=e._keys;return i||(i=e._keys=fl(e._scopes)),i;}function fl(e){let i=new Set();for(let t of e)for(let n of Object.keys(t).filter(s=>!s.startsWith("_")))i.add(n);return Array.from(i);}function pn(e,i,t,n){let{iScale:s}=e,{key:o="r"}=this._parsing,a=new Array(n),r,l,c,h;for(r=0,l=n;r<l;++r)c=r+t,h=i[c],a[r]={r:s.parse(Mt(h,o),c)};return a;}var gl=Number.EPSILON||1e-14,ee=(e,i)=>i<e.length&&!e[i].skip&&e[i],To=e=>e==="x"?"y":"x";function pl(e,i,t,n){let s=e.skip?i:e,o=i,a=t.skip?i:t,r=si(o,s),l=si(a,o),c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let d=n*c,u=n*h;return{previous:{x:o.x-d*(a.x-s.x),y:o.y-d*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}};}function ml(e,i,t){let n=e.length,s,o,a,r,l,c=ee(e,0);for(let h=0;h<n-1;++h)if(l=c,c=ee(e,h+1),!(!l||!c)){if(se(i[h],0,gl)){t[h]=t[h+1]=0;continue;}s=t[h]/i[h],o=t[h+1]/i[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),t[h]=s*a*i[h],t[h+1]=o*a*i[h]);}}function bl(e,i,t="x"){let n=To(t),s=e.length,o,a,r,l=ee(e,0);for(let c=0;c<s;++c){if(a=r,r=l,l=ee(e,c+1),!r)continue;let h=r[t],d=r[n];a&&(o=(h-a[t])/3,r[`cp1${t}`]=h-o,r[`cp1${n}`]=d-o*i[c]),l&&(o=(l[t]-h)/3,r[`cp2${t}`]=h+o,r[`cp2${n}`]=d+o*i[c]);}}function _l(e,i="x"){let t=To(i),n=e.length,s=Array(n).fill(0),o=Array(n),a,r,l,c=ee(e,0);for(a=0;a<n;++a)if(r=l,l=c,c=ee(e,a+1),!!l){if(c){let h=c[i]-l[i];s[a]=h!==0?(c[t]-l[t])/h:0;}o[a]=r?c?ct(s[a-1])!==ct(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a];}ml(e,s,o),bl(e,o,i);}function ti(e,i,t){return Math.max(Math.min(e,t),i);}function xl(e,i){let t,n,s,o,a,r=ut(e[0],i);for(t=0,n=e.length;t<n;++t)a=o,o=r,r=t<n-1&&ut(e[t+1],i),o&&(s=e[t],a&&(s.cp1x=ti(s.cp1x,i.left,i.right),s.cp1y=ti(s.cp1y,i.top,i.bottom)),r&&(s.cp2x=ti(s.cp2x,i.left,i.right),s.cp2y=ti(s.cp2y,i.top,i.bottom)));}function Eo(e,i,t,n,s){let o,a,r,l;if(i.spanGaps&&(e=e.filter(c=>!c.skip)),i.cubicInterpolationMode==="monotone")_l(e,s);else{let c=n?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)r=e[o],l=pl(c,r,e[Math.min(o+1,a-(n?0:1))%a],i.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r;}i.capBezierPoints&&xl(e,t);}function gi(){return typeof window<"u"&&typeof document<"u";}function pi(e){let i=e.parentNode;return i&&i.toString()==="[object ShadowRoot]"&&(i=i.host),i;}function oi(e,i,t){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*i.parentNode[t])):n=e,n;}var mi=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function yl(e,i){return mi(e).getPropertyValue(i);}var vl=["top","right","bottom","left"];function Wt(e,i,t){let n={};t=t?"-"+t:"";for(let s=0;s<4;s++){let o=vl[s];n[o]=parseFloat(e[i+"-"+o+t])||0;}return n.width=n.left+n.right,n.height=n.top+n.bottom,n;}var Ml=(e,i,t)=>(e>0||i>0)&&(!t||!t.shadowRoot);function Cl(e,i){let t=e.touches,n=t&&t.length?t[0]:e,{offsetX:s,offsetY:o}=n,a=false,r,l;if(Ml(s,o,e.target))r=s,l=o;else{let c=i.getBoundingClientRect();r=n.clientX-c.left,l=n.clientY-c.top,a=true;}return{x:r,y:l,box:a};}function It(e,i){if("native"in e)return e;let{canvas:t,currentDevicePixelRatio:n}=i,s=mi(t),o=s.boxSizing==="border-box",a=Wt(s,"padding"),r=Wt(s,"border","width"),{x:l,y:c,box:h}=Cl(e,t),d=a.left+(h&&r.left),u=a.top+(h&&r.top),{width:f,height:p}=i;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-d)/f*t.width/n),y:Math.round((c-u)/p*t.height/n)};}function Sl(e,i,t){let n,s;if(i===void 0||t===void 0){let o=e&&pi(e);if(!o)i=e.clientWidth,t=e.clientHeight;else{let a=o.getBoundingClientRect(),r=mi(o),l=Wt(r,"border","width"),c=Wt(r,"padding");i=a.width-c.width-l.width,t=a.height-c.height-l.height,n=oi(r.maxWidth,o,"clientWidth"),s=oi(r.maxHeight,o,"clientHeight");}}return{width:i,height:t,maxWidth:n||ni,maxHeight:s||ni};}var Dt=e=>Math.round(e*10)/10;function Ro(e,i,t,n){let s=mi(e),o=Wt(s,"margin"),a=oi(s.maxWidth,e,"clientWidth")||ni,r=oi(s.maxHeight,e,"clientHeight")||ni,l=Sl(e,i,t),{width:c,height:h}=l;if(s.boxSizing==="content-box"){let u=Wt(s,"border","width"),f=Wt(s,"padding");c-=f.width+u.width,h-=f.height+u.height;}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Dt(Math.min(c,a,l.maxWidth)),h=Dt(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Dt(c/2)),(i!==void 0||t!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=Dt(Math.floor(h*n))),{width:c,height:h};}function mn(e,i,t){let n=i||1,s=Dt(e.height*n),o=Dt(e.width*n);e.height=Dt(e.height),e.width=Dt(e.width);let a=e.canvas;return a.style&&(t||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(e.currentDevicePixelRatio=n,a.height=s,a.width=o,e.ctx.setTransform(n,0,0,n,0,0),true):false;}var Io=function(){let e=false;try{let i={get passive(){return e=!0,!1;}};gi()&&(window.addEventListener("test",null,i),window.removeEventListener("test",null,i));}catch(i){}return e;}();function bn(e,i){let t=yl(e,i),n=t&&t.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0;}function Ot(e,i,t,n){return{x:e.x+t*(i.x-e.x),y:e.y+t*(i.y-e.y)};}function Fo(e,i,t,n){return{x:e.x+t*(i.x-e.x),y:n==="middle"?t<.5?e.y:i.y:n==="after"?t<1?e.y:i.y:t>0?i.y:e.y};}function zo(e,i,t,n){let s={x:e.cp2x,y:e.cp2y},o={x:i.cp1x,y:i.cp1y},a=Ot(e,s,t),r=Ot(s,o,t),l=Ot(o,i,t),c=Ot(a,r,t),h=Ot(r,l,t);return Ot(c,h,t);}var wl=function(e,i){return{x(t){return e+e+i-t;},setWidth(t){i=t;},textAlign(t){return t==="center"?t:t==="right"?"left":"right";},xPlus(t,n){return t-n;},leftForLtr(t,n){return t-n;}};},kl=function(){return{x(e){return e;},setWidth(e){},textAlign(e){return e;},xPlus(e,i){return e+i;},leftForLtr(e,i){return e;}};};function Yt(e,i,t){return e?wl(i,t):kl();}function _n(e,i){let t,n;(i==="ltr"||i==="rtl")&&(t=e.canvas.style,n=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",i,"important"),e.prevTextDirection=n);}function xn(e,i){i!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",i[0],i[1]));}function Bo(e){return e==="angle"?{between:oe,compare:jr,normalize:X}:{between:gt,compare:(i,t)=>i-t,normalize:i=>i};}function ro({start:e,end:i,count:t,loop:n,style:s}){return{start:e%t,end:i%t,loop:n&&(i-e+1)%t===0,style:s};}function Pl(e,i,t){let{property:n,start:s,end:o}=t,{between:a,normalize:r}=Bo(n),l=i.length,{start:c,end:h,loop:d}=e,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&a(r(i[c%l][n]),s,o);++u)c--,h--;c%=l,h%=l;}return h<c&&(h+=l),{start:c,end:h,loop:d,style:e.style};}function yn(e,i,t){if(!t)return[e];let{property:n,start:s,end:o}=t,a=i.length,{compare:r,between:l,normalize:c}=Bo(n),{start:h,end:d,loop:u,style:f}=Pl(e,i,t),p=[],g=false,m=null,b,_,y,M=()=>l(s,y,b)&&r(s,y)!==0,x=()=>r(o,b)===0||l(o,y,b),v=()=>g||M(),S=()=>!g||x();for(let C=h,w=h;C<=d;++C)_=i[C%a],!_.skip&&(b=c(_[n]),b!==y&&(g=l(b,s,o),m===null&&v()&&(m=r(b,s)===0?C:w),m!==null&&S()&&(p.push(ro({start:m,end:C,loop:u,count:a,style:f})),m=null),w=C,y=b));return m!==null&&p.push(ro({start:m,end:d,loop:u,count:a,style:f})),p;}function vn(e,i){let t=[],n=e.segments;for(let s=0;s<n.length;s++){let o=yn(n[s],e.points,i);o.length&&t.push(...o);}return t;}function Ll(e,i,t,n){let s=0,o=i-1;if(t&&!n)for(;s<i&&!e[s].skip;)s++;for(;s<i&&e[s].skip;)s++;for(s%=i,t&&(o+=s);o>s&&e[o%i].skip;)o--;return o%=i,{start:s,end:o};}function Ol(e,i,t,n){let s=e.length,o=[],a=i,r=e[i],l;for(l=i+1;l<=t;++l){let c=e[l%s];c.skip||c.stop?r.skip||(n=false,o.push({start:i%s,end:(l-1)%s,loop:n}),i=a=c.stop?l:null):(a=l,r.skip&&(i=l)),r=c;}return a!==null&&o.push({start:i%s,end:a%s,loop:n}),o;}function Vo(e,i){let t=e.points,n=e.options.spanGaps,s=t.length;if(!s)return[];let o=!!e._loop,{start:a,end:r}=Ll(t,s,o,n);if(n===true)return lo(e,[{start:a,end:r,loop:o}],t,i);let l=r<a?r+s:r,c=!!e._fullLoop&&a===0&&r===s-1;return lo(e,Ol(t,a,l,c),t,i);}function lo(e,i,t,n){return!n||!n.setContext||!t?i:Dl(e,i,t,n);}function Dl(e,i,t,n){let s=e._chart.getContext(),o=co(e.options),{_datasetIndex:a,options:{spanGaps:r}}=e,l=t.length,c=[],h=o,d=i[0].start,u=d;function f(p,g,m,b){let _=r?-1:1;if(p!==g){for(p+=l;t[p%l].skip;)p-=_;for(;t[g%l].skip;)g+=_;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),h=b,d=g%l);}}for(let p of i){d=r?d:p.start;let g=t[d%l],m;for(u=d+1;u<=p.end;u++){let b=t[u%l];m=co(n.setContext(Ct(s,{type:"segment",p0:g,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Al(m,h)&&f(d,u-1,p.loop,h),g=b,h=m;}d<u-1&&f(d,u-1,p.loop,h);}return c;}function co(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor};}function Al(e,i){if(!i)return false;let t=[],n=function(s,o){return rn(o)?(t.includes(o)||t.push(o),t.indexOf(o)):o;};return JSON.stringify(e,n)!==JSON.stringify(i,n);}function ei(e,i,t){return e.options.clip?e[t]:i[t];}function Tl(e,i){let{xScale:t,yScale:n}=e;return t&&n?{left:ei(t,i,"left"),right:ei(t,i,"right"),top:ei(n,i,"top"),bottom:ei(n,i,"bottom")}:i;}function Mn(e,i){let t=i._clip;if(t.disabled)return false;let n=Tl(i,e.chartArea);return{left:t.left===false?0:n.left-(t.left===true?0:t.left),right:t.right===false?e.width:n.right+(t.right===true?0:t.right),top:t.top===false?0:n.top-(t.top===true?0:t.top),bottom:t.bottom===false?e.height:n.bottom+(t.bottom===true?0:t.bottom)};}var Rn=class{constructor(){this._request=null,this._charts=new Map(),this._running=false,this._lastDate=void 0;}_notify(i,t,n,s){let o=t.listeners[s],a=t.duration;o.forEach(r=>r({chart:i,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}));}_refresh(){this._request||(this._running=true,this._request=nn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh();}));}_update(i=Date.now()){let t=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;let o=n.items,a=o.length-1,r=false,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(i),r=true):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,i,"progress")),o.length||(n.running=false,this._notify(s,n,i,"complete"),n.initial=false),t+=o.length;}),this._lastDate=i,t===0&&(this._running=false);}_getAnims(i){let t=this._charts,n=t.get(i);return n||(n={running:false,initial:true,items:[],listeners:{complete:[],progress:[]}},t.set(i,n)),n;}listen(i,t,n){this._getAnims(i).listeners[t].push(n);}add(i,t){!t||!t.length||this._getAnims(i).items.push(...t);}has(i){return this._getAnims(i).items.length>0;}start(i){let t=this._charts.get(i);t&&(t.running=true,t.start=Date.now(),t.duration=t.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh());}running(i){if(!this._running)return false;let t=this._charts.get(i);return!(!t||!t.running||!t.items.length);}stop(i){let t=this._charts.get(i);if(!t||!t.items.length)return;let n=t.items,s=n.length-1;for(;s>=0;--s)n[s].cancel();t.items=[],this._notify(i,t,Date.now(),"complete");}remove(i){return this._charts.delete(i);}},St=new Rn(),No="transparent",El={boolean(e,i,t){return t>.5?i:e;},color(e,i,t){let n=ln(e||No),s=n.valid&&ln(i||No);return s&&s.valid?s.mix(n,t).hexString():i;},number(e,i,t){return e+(i-e)*t;}},In=class{constructor(i,t,n,s){let o=t[n];s=le([i.to,s,o,i.from]);let a=le([i.from,o,s]);this._active=true,this._fn=i.fn||El[i.type||typeof a],this._easing=Qt[i.easing]||Qt.linear,this._start=Math.floor(Date.now()+(i.delay||0)),this._duration=this._total=Math.floor(i.duration),this._loop=!!i.loop,this._target=t,this._prop=n,this._from=a,this._to=s,this._promises=void 0;}active(){return this._active;}update(i,t,n){if(this._active){this._notify(false);let s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,i.duration)),this._total+=o,this._loop=!!i.loop,this._to=le([i.to,t,s,i.from]),this._from=le([i.from,s,t]);}}cancel(){this._active&&(this.tick(Date.now()),this._active=false,this._notify(false));}tick(i){let t=i-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to,l;if(this._active=o!==r&&(a||t<n),!this._active){this._target[s]=r,this._notify(true);return;}if(t<0){this._target[s]=o;return;}l=t/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l);}wait(){let i=this._promises||(this._promises=[]);return new Promise((t,n)=>{i.push({res:t,rej:n});});}_notify(i){let t=i?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][t]();}},wi=class{constructor(i,t){this._chart=i,this._properties=new Map(),this.configure(t);}configure(i){if(!D(i))return;let t=Object.keys(B.animation),n=this._properties;Object.getOwnPropertyNames(i).forEach(s=>{let o=i[s];if(!D(o))return;let a={};for(let r of t)a[r]=o[r];(F(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a);});});}_animateOptions(i,t){let n=t.options,s=Il(i,n);if(!s)return[];let o=this._createAnimations(s,n);return n.$shared&&Rl(i.options.$animations,n).then(()=>{i.options=n;},()=>{}),o;}_createAnimations(i,t){let n=this._properties,s=[],o=i.$animations||(i.$animations={}),a=Object.keys(t),r=Date.now(),l;for(l=a.length-1;l>=0;--l){let c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(i,t));continue;}let h=t[c],d=o[c],u=n.get(c);if(d)if(u&&d.active()){d.update(u,h,r);continue;}else d.cancel();if(!u||!u.duration){i[c]=h;continue;}o[c]=d=new In(u,i,c,h),s.push(d);}return s;}update(i,t){if(this._properties.size===0){Object.assign(i,t);return;}let n=this._createAnimations(i,t);if(n.length)return St.add(this._chart,n),true;}};function Rl(e,i){let t=[],n=Object.keys(i);for(let s=0;s<n.length;s++){let o=e[n[s]];o&&o.active()&&t.push(o.wait());}return Promise.all(t);}function Il(e,i){if(!i)return;let t=e.options;if(!t){e.options=i;return;}return t.$shared&&(e.options=t=Object.assign({},t,{$shared:false,$animations:{}})),t;}function Ho(e,i){let t=e&&e.options||{},n=t.reverse,s=t.min===void 0?i:0,o=t.max===void 0?i:0;return{start:n?o:s,end:n?s:o};}function Fl(e,i,t){if(t===false)return false;let n=Ho(e,t),s=Ho(i,t);return{top:s.end,right:n.end,bottom:s.start,left:n.start};}function zl(e){let i,t,n,s;return D(e)?(i=e.top,t=e.right,n=e.bottom,s=e.left):i=t=n=s=e,{top:i,right:t,bottom:n,left:s,disabled:e===false};}function Na(e,i){let t=[],n=e._getSortedDatasetMetas(i),s,o;for(s=0,o=n.length;s<o;++s)t.push(n[s].index);return t;}function Wo(e,i,t,n={}){let s=e.keys,o=n.mode==="single",a,r,l,c;if(i===null)return;let h=false;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===t){if(h=true,n.all)continue;break;}c=e.values[l],N(c)&&(o||i===0||ct(i)===ct(c))&&(i+=c);}return!h&&!n.all?0:i;}function Bl(e,i){let{iScale:t,vScale:n}=i,s=t.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",a=Object.keys(e),r=new Array(a.length),l,c,h;for(l=0,c=a.length;l<c;++l)h=a[l],r[l]={[s]:h,[o]:e[h]};return r;}function Cn(e,i){let t=e&&e.options.stacked;return t||t===void 0&&i.stack!==void 0;}function Vl(e,i,t){return`${e.id}.${i.id}.${t.stack||t.type}`;}function Nl(e){let{min:i,max:t,minDefined:n,maxDefined:s}=e.getUserBounds();return{min:n?i:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY};}function Hl(e,i,t){let n=e[i]||(e[i]={});return n[t]||(n[t]={});}function jo(e,i,t,n){for(let s of i.getMatchingVisibleMetas(n).reverse()){let o=e[s.index];if(t&&o>0||!t&&o<0)return s.index;}return null;}function $o(e,i){let{chart:t,_cachedMeta:n}=e,s=t._stacks||(t._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,c=a.axis,h=Vl(o,a,n),d=i.length,u;for(let f=0;f<d;++f){let p=i[f],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});u=b[c]=Hl(s,h,g),u[r]=m,u._top=jo(u,a,true,n.type),u._bottom=jo(u,a,false,n.type);let _=u._visualValues||(u._visualValues={});_[r]=m;}}function Sn(e,i){let t=e.scales;return Object.keys(t).filter(n=>t[n].axis===i).shift();}function Wl(e,i){return Ct(e,{active:false,dataset:void 0,datasetIndex:i,index:i,mode:"default",type:"dataset"});}function jl(e,i,t){return Ct(e,{active:false,dataIndex:i,parsed:void 0,raw:void 0,element:t,index:i,mode:"default",type:"data"});}function ke(e,i){let t=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){i=i||e._parsed;for(let s of i){let o=s._stacks;if(!o||o[n]===void 0||o[n][t]===void 0)return;delete o[n][t],o[n]._visualValues!==void 0&&o[n]._visualValues[t]!==void 0&&delete o[n]._visualValues[t];}}}var wn=e=>e==="reset"||e==="none",Yo=(e,i)=>i?e:Object.assign({},e),$l=(e,i,t)=>e&&!i.hidden&&i._stacked&&{keys:Na(t,true),values:null},zt=(()=>{class e{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=false,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=false,this.supportsDecimation=false,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize();}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Cn(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options");}updateIndex(t){this.index!==t&&ke(this._cachedMeta),this.index=t;}linkScales(){let t=this.chart,n=this._cachedMeta,s=this.getDataset(),o=(u,f,p,g)=>u==="x"?f:u==="r"?g:p,a=n.xAxisID=k(s.xAxisID,Sn(t,"x")),r=n.yAxisID=k(s.yAxisID,Sn(t,"y")),l=n.rAxisID=k(s.rAxisID,Sn(t,"r")),c=n.indexAxis,h=n.iAxisID=o(c,a,r,l),d=n.vAxisID=o(c,r,a,l);n.xScale=this.getScaleForId(a),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(h),n.vScale=this.getScaleForId(d);}getDataset(){return this.chart.data.datasets[this.index];}getMeta(){return this.chart.getDatasetMeta(this.index);}getScaleForId(t){return this.chart.scales[t];}_getOtherScale(t){let n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale;}reset(){this._update("reset");}_destroy(){let t=this._cachedMeta;this._data&&tn(this._data,this),t._stacked&&ke(t);}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),s=this._data;if(D(n)){let o=this._cachedMeta;this._data=Bl(n,o);}else if(s!==n){if(s){tn(s,this);let o=this._cachedMeta;ke(o),o._parsed=[];}n&&Object.isExtensible(n)&&vo(n,this),this._syncList=[],this._data=n;}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType());}buildOrUpdateElements(t){let n=this._cachedMeta,s=this.getDataset(),o=false;this._dataCheck();let a=n._stacked;n._stacked=Cn(n.vScale,n),n.stack!==s.stack&&(o=true,ke(n),n.stack=s.stack),this._resyncElements(t),(o||a!==n._stacked)&&($o(this,n._parsed),n._stacked=Cn(n.vScale,n));}configure(){let t=this.chart.config,n=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),n,true);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={};}parse(t,n){let{_cachedMeta:s,_data:o}=this,{iScale:a,_stacked:r}=s,l=a.axis,c=t===0&&n===o.length?true:s._sorted,h=t>0&&s._parsed[t-1],d,u,f;if(this._parsing===false)s._parsed=o,s._sorted=true,f=o;else{F(o[t])?f=this.parseArrayData(s,o,t,n):D(o[t])?f=this.parseObjectData(s,o,t,n):f=this.parsePrimitiveData(s,o,t,n);let p=()=>u[l]===null||h&&u[l]<h[l];for(d=0;d<n;++d)s._parsed[d+t]=u=f[d],c&&(p()&&(c=false),h=u);s._sorted=c;}r&&$o(this,f);}parsePrimitiveData(t,n,s,o){let{iScale:a,vScale:r}=t,l=a.axis,c=r.axis,h=a.getLabels(),d=a===r,u=new Array(o),f,p,g;for(f=0,p=o;f<p;++f)g=f+s,u[f]={[l]:d||a.parse(h[g],g),[c]:r.parse(n[g],g)};return u;}parseArrayData(t,n,s,o){let{xScale:a,yScale:r}=t,l=new Array(o),c,h,d,u;for(c=0,h=o;c<h;++c)d=c+s,u=n[d],l[c]={x:a.parse(u[0],d),y:r.parse(u[1],d)};return l;}parseObjectData(t,n,s,o){let{xScale:a,yScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=new Array(o),d,u,f,p;for(d=0,u=o;d<u;++d)f=d+s,p=n[f],h[d]={x:a.parse(Mt(p,l),f),y:r.parse(Mt(p,c),f)};return h;}getParsed(t){return this._cachedMeta._parsed[t];}getDataElement(t){return this._cachedMeta.data[t];}applyStack(t,n,s){let o=this.chart,a=this._cachedMeta,r=n[t.axis],l={keys:Na(o,true),values:n._stacks[t.axis]._visualValues};return Wo(l,r,a.index,{mode:s});}updateRangeFromParsed(t,n,s,o){let a=s[n.axis],r=a===null?NaN:a,l=o&&s._stacks[n.axis];o&&l&&(o.values=l,r=Wo(o,a,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r);}getMinMax(t,n){let s=this._cachedMeta,o=s._parsed,a=s._sorted&&t===s.iScale,r=o.length,l=this._getOtherScale(t),c=$l(n,s,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=Nl(l),f,p;function g(){p=o[f];let m=p[l.axis];return!N(p[t.axis])||d>m||u<m;}for(f=0;f<r&&!(!g()&&(this.updateRangeFromParsed(h,t,p,c),a));++f);if(a){for(f=r-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(h,t,p,c);break;}}return h;}getAllParsedValues(t){let n=this._cachedMeta._parsed,s=[],o,a,r;for(o=0,a=n.length;o<a;++o)r=n[o][t.axis],N(r)&&s.push(r);return s;}getMaxOverflow(){return false;}getLabelAndValue(t){let n=this._cachedMeta,s=n.iScale,o=n.vScale,a=this.getParsed(t);return{label:s?""+s.getLabelForValue(a[s.axis]):"",value:o?""+o.getLabelForValue(a[o.axis]):""};}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=zl(k(this.options.clip,Fl(n.xScale,n.yScale,this.getMaxOverflow())));}update(t){}draw(){let t=this._ctx,n=this.chart,s=this._cachedMeta,o=s.data||[],a=n.chartArea,r=[],l=this._drawStart||0,c=this._drawCount||o.length-l,h=this.options.drawActiveElementsOnTop,d;for(s.dataset&&s.dataset.draw(t,a,l,c),d=l;d<l+c;++d){let u=o[d];u.hidden||(u.active&&h?r.push(u):u.draw(t,a));}for(d=0;d<r.length;++d)r[d].draw(t,a);}getStyle(t,n){let s=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s);}getContext(t,n,s){let o=this.getDataset(),a;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];a=r.$context||(r.$context=jl(this.getContext(),t,r)),a.parsed=this.getParsed(t),a.raw=o.data[t],a.index=a.dataIndex=t;}else a=this.$context||(this.$context=Wl(this.chart.getContext(),this.index)),a.dataset=o,a.index=a.datasetIndex=this.index;return a.active=!!n,a.mode=s,a;}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t);}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t);}_resolveElementOptions(t,n="default",s){let o=n==="active",a=this._cachedDataOpts,r=t+"-"+n,l=a[r],c=this.enableOptionSharing&&ne(s);if(l)return Yo(l,c);let h=this.chart.config,d=h.datasetElementScopeKeys(this._type,t),u=o?[`${t}Hover`,"hover",t,""]:[t,""],f=h.getOptionScopes(this.getDataset(),d),p=Object.keys(B.elements[t]),g=()=>this.getContext(s,o,n),m=h.resolveNamedOptions(f,p,g,u);return m.$shared&&(m.$shared=c,a[r]=Object.freeze(Yo(m,c))),m;}_resolveAnimations(t,n,s){let o=this.chart,a=this._cachedDataOpts,r=`animation-${n}`,l=a[r];if(l)return l;let c;if(o.options.animation!==false){let d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),u);c=d.createResolver(f,this.getContext(t,s,n));}let h=new wi(o,c&&c.animations);return c&&c._cacheable&&(a[r]=Object.freeze(h)),h;}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t));}includeOptions(t,n){return!n||wn(t)||this.chart._animationsDisabled;}_getSharedOptions(t,n){let s=this.resolveDataElementOptions(t,n),o=this._sharedOptions,a=this.getSharedOptions(s),r=this.includeOptions(n,a)||a!==o;return this.updateSharedOptions(a,n,s),{sharedOptions:a,includeOptions:r};}updateElement(t,n,s,o){wn(o)?Object.assign(t,s):this._resolveAnimations(n,o).update(t,s);}updateSharedOptions(t,n,s){t&&!wn(n)&&this._resolveAnimations(void 0,n).update(t,s);}_setStyle(t,n,s,o){t.active=o;let a=this.getStyle(n,o);this._resolveAnimations(n,s,o).update(t,{options:!o&&this.getSharedOptions(a)||a});}removeHoverStyle(t,n,s){this._setStyle(t,s,"active",false);}setHoverStyle(t,n,s){this._setStyle(t,s,"active",true);}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",false);}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",true);}_resyncElements(t){let n=this._data,s=this._cachedMeta.data;for(let[l,c,h]of this._syncList)this[l](c,h);this._syncList=[];let o=s.length,a=n.length,r=Math.min(a,o);r&&this.parse(0,r),a>o?this._insertElements(o,a-o,t):a<o&&this._removeElements(a,o-a);}_insertElements(t,n,s=true){let o=this._cachedMeta,a=o.data,r=t+n,l,c=h=>{for(h.length+=n,l=h.length-1;l>=r;l--)h[l]=h[l-n];};for(c(a),l=t;l<r;++l)a[l]=new this.dataElementType();this._parsing&&c(o._parsed),this.parse(t,n),s&&this.updateElements(a,t,n,"reset");}updateElements(t,n,s,o){}_removeElements(t,n){let s=this._cachedMeta;if(this._parsing){let o=s._parsed.splice(t,n);s._stacked&&ke(s,o);}s.data.splice(t,n);}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,s,o]=t;this[n](s,o);}this.chart._dataChanges.push([this.index,...t]);}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t]);}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1]);}_onDataShift(){this._sync(["_removeElements",0,1]);}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);let s=arguments.length-2;s&&this._sync(["_insertElements",t,s]);}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length]);}}return e;})();function Yl(e,i){if(!e._cache.$bar){let t=e.getMatchingVisibleMetas(i),n=[];for(let s=0,o=t.length;s<o;s++)n=n.concat(t[s].controller.getAllParsedValues(e));e._cache.$bar=en(n.sort((s,o)=>s-o));}return e._cache.$bar;}function Ul(e){let i=e.iScale,t=Yl(i,e.type),n=i._length,s,o,a,r,l=()=>{a===32767||a===-32768||(ne(r)&&(n=Math.min(n,Math.abs(a-r)||n)),r=a);};for(s=0,o=t.length;s<o;++s)a=i.getPixelForValue(t[s]),l();for(r=void 0,s=0,o=i.ticks.length;s<o;++s)a=i.getPixelForTick(s),l();return n;}function Xl(e,i,t,n){let s=t.barThickness,o,a;return O(s)?(o=i.min*t.categoryPercentage,a=t.barPercentage):(o=s*n,a=1),{chunk:o/n,ratio:a,start:i.pixels[e]-o/2};}function Zl(e,i,t,n){let s=i.pixels,o=s[e],a=e>0?s[e-1]:null,r=e<s.length-1?s[e+1]:null,l=t.categoryPercentage;a===null&&(a=o-(r===null?i.end-i.start:r-o)),r===null&&(r=o+o-a);let c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/n,ratio:t.barPercentage,start:c};}function Kl(e,i,t,n){let s=t.parse(e[0],n),o=t.parse(e[1],n),a=Math.min(s,o),r=Math.max(s,o),l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),i[t.axis]=c,i._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r};}function Ha(e,i,t,n){return F(e)?Kl(e,i,t,n):i[t.axis]=t.parse(e,n),i;}function Uo(e,i,t,n){let s=e.iScale,o=e.vScale,a=s.getLabels(),r=s===o,l=[],c,h,d,u;for(c=t,h=t+n;c<h;++c)u=i[c],d={},d[s.axis]=r||s.parse(a[c],c),l.push(Ha(u,d,o,c));return l;}function kn(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0;}function ql(e,i,t){return e!==0?ct(e):(i.isHorizontal()?1:-1)*(i.min>=t?1:-1);}function Gl(e){let i,t,n,s,o;return e.horizontal?(i=e.base>e.x,t="left",n="right"):(i=e.base<e.y,t="bottom",n="top"),i?(s="end",o="start"):(s="start",o="end"),{start:t,end:n,reverse:i,top:s,bottom:o};}function Jl(e,i,t,n){let s=i.borderSkipped,o={};if(!s){e.borderSkipped=o;return;}if(s===true){e.borderSkipped={top:true,right:true,bottom:true,left:true};return;}let{start:a,end:r,reverse:l,top:c,bottom:h}=Gl(e);s==="middle"&&t&&(e.enableBorderRadius=true,(t._top||0)===n?s=c:(t._bottom||0)===n?s=h:(o[Xo(h,a,r,l)]=true,s=c)),o[Xo(s,a,r,l)]=true,e.borderSkipped=o;}function Xo(e,i,t,n){return n?(e=Ql(e,i,t),e=Zo(e,t,i)):e=Zo(e,i,t),e;}function Ql(e,i,t){return e===i?t:e===t?i:e;}function Zo(e,i,t){return e==="start"?i:e==="end"?t:e;}function tc(e,{inflateAmount:i},t){e.inflateAmount=i==="auto"?t===1?.33:0:i;}var ec=(()=>{class e extends zt{static id="bar";static defaults={datasetElementType:false,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:true,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:true,grid:{offset:true}},_value_:{type:"linear",beginAtZero:true}}};parsePrimitiveData(t,n,s,o){return Uo(t,n,s,o);}parseArrayData(t,n,s,o){return Uo(t,n,s,o);}parseObjectData(t,n,s,o){let{iScale:a,vScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=a.axis==="x"?l:c,d=r.axis==="x"?l:c,u=[],f,p,g,m;for(f=s,p=s+o;f<p;++f)m=n[f],g={},g[a.axis]=a.parse(Mt(m,h),f),u.push(Ha(Mt(m,d),g,r,f));return u;}updateRangeFromParsed(t,n,s,o){super.updateRangeFromParsed(t,n,s,o);let a=s._custom;a&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max));}getMaxOverflow(){return 0;}getLabelAndValue(t){let n=this._cachedMeta,{iScale:s,vScale:o}=n,a=this.getParsed(t),r=a._custom,l=kn(r)?"["+r.start+", "+r.end+"]":""+o.getLabelForValue(a[o.axis]);return{label:""+s.getLabelForValue(a[s.axis]),value:l};}initialize(){this.enableOptionSharing=true,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack;}update(t){let n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t);}updateElements(t,n,s,o){let a=o==="reset",{index:r,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),h=l.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,o);for(let p=n;p<n+s;p++){let g=this.getParsed(p),m=a||O(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,d),_=(g._stacks||{})[l.axis],y={horizontal:h,base:m.base,enableBorderRadius:!_||kn(g._custom)||r===_._top||r===_._bottom,x:h?m.head:b.center,y:h?b.center:m.head,height:h?b.size:Math.abs(m.size),width:h?Math.abs(m.size):b.size};f&&(y.options=u||this.resolveDataElementOptions(p,t[p].active?"active":o));let M=y.options||t[p].options;Jl(y,M,_,r),tc(y,M,d.ratio),this.updateElement(t[p],p,y,o);}}_getStacks(t,n){let{iScale:s}=this._cachedMeta,o=s.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),a=s.options.stacked,r=[],l=this._cachedMeta.controller.getParsed(n),c=l&&l[s.axis],h=d=>{let u=d._parsed.find(p=>p[s.axis]===c),f=u&&u[d.vScale.axis];if(O(f)||isNaN(f))return true;};for(let d of o)if(!(n!==void 0&&h(d))&&((a===false||r.indexOf(d.stack)===-1||a===void 0&&d.stack===void 0)&&r.push(d.stack),d.index===t))break;return r.length||r.push(void 0),r;}_getStackCount(t){return this._getStacks(void 0,t).length;}_getAxisCount(){return this._getAxis().length;}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(s=>t[s].axis===n).shift();}_getAxis(){let t={},n=this.getFirstScaleIdForIndexAxis();for(let s of this.chart.data.datasets)t[k(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,n)]=true;return Object.keys(t);}_getStackIndex(t,n,s){let o=this._getStacks(t,s),a=n!==void 0?o.indexOf(n):-1;return a===-1?o.length-1:a;}_getRuler(){let t=this.options,n=this._cachedMeta,s=n.iScale,o=[],a,r;for(a=0,r=n.data.length;a<r;++a)o.push(s.getPixelForValue(this.getParsed(a)[s.axis],a));let l=t.barThickness;return{min:l||Ul(n),pixels:o,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage};}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:n,_stacked:s,index:o},options:{base:a,minBarLength:r}}=this,l=a||0,c=this.getParsed(t),h=c._custom,d=kn(h),u=c[n.axis],f=0,p=s?this.applyStack(n,c,s):u,g,m;p!==u&&(f=p-u,p=u),d&&(u=h.barStart,p=h.barEnd-h.barStart,u!==0&&ct(u)!==ct(h.barEnd)&&(f=0),f+=u);let b=!O(a)&&!d?a:f,_=n.getPixelForValue(b);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(f+p):g=_,m=g-_,Math.abs(m)<r){m=ql(m,n,l)*r,u===l&&(_-=m/2);let y=n.getPixelForDecimal(0),M=n.getPixelForDecimal(1),x=Math.min(y,M),v=Math.max(y,M);_=Math.max(Math.min(_,v),x),g=_+m,s&&!d&&(c._stacks[n.axis]._visualValues[o]=n.getValueForPixel(g)-n.getValueForPixel(_));}if(_===n.getPixelForValue(l)){let y=ct(m)*n.getLineWidthForValue(l)/2;_+=y,m-=y;}return{size:m,base:_,head:g,center:g+m/2};}_calculateBarIndexPixels(t,n){let s=n.scale,o=this.options,a=o.skipNull,r=k(o.maxBarThickness,1/0),l,c,h=this._getAxisCount();if(n.grouped){let d=a?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?Zl(t,n,o,d*h):Xl(t,n,o,d*h),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(k(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0)+p;l=u.start+u.chunk*g+u.chunk/2,c=Math.min(r,u.chunk*u.ratio);}else l=s.getPixelForValue(this.getParsed(t)[s.axis],t),c=Math.min(r,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c};}draw(){let t=this._cachedMeta,n=t.vScale,s=t.data,o=s.length,a=0;for(;a<o;++a)this.getParsed(a)[n.axis]!==null&&!s[a].hidden&&s[a].draw(this._ctx);}}return e;})(),ic=(()=>{class e extends zt{static id="bubble";static defaults={datasetElementType:false,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=true,super.initialize();}parsePrimitiveData(t,n,s,o){let a=super.parsePrimitiveData(t,n,s,o);for(let r=0;r<a.length;r++)a[r]._custom=this.resolveDataElementOptions(r+s).radius;return a;}parseArrayData(t,n,s,o){let a=super.parseArrayData(t,n,s,o);for(let r=0;r<a.length;r++){let l=n[s+r];a[r]._custom=k(l[2],this.resolveDataElementOptions(r+s).radius);}return a;}parseObjectData(t,n,s,o){let a=super.parseObjectData(t,n,s,o);for(let r=0;r<a.length;r++){let l=n[s+r];a[r]._custom=k(l&&l.r&&+l.r,this.resolveDataElementOptions(r+s).radius);}return a;}getMaxOverflow(){let t=this._cachedMeta.data,n=0;for(let s=t.length-1;s>=0;--s)n=Math.max(n,t[s].size(this.resolveDataElementOptions(s))/2);return n>0&&n;}getLabelAndValue(t){let n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:a}=n,r=this.getParsed(t),l=o.getLabelForValue(r.x),c=a.getLabelForValue(r.y),h=r._custom;return{label:s[t]||"",value:"("+l+", "+c+(h?", "+h:"")+")"};}update(t){let n=this._cachedMeta.data;this.updateElements(n,0,n.length,t);}updateElements(t,n,s,o){let a=o==="reset",{iScale:r,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(n,o),d=r.axis,u=l.axis;for(let f=n;f<n+s;f++){let p=t[f],g=!a&&this.getParsed(f),m={},b=m[d]=a?r.getPixelForDecimal(.5):r.getPixelForValue(g[d]),_=m[u]=a?l.getBasePixel():l.getPixelForValue(g[u]);m.skip=isNaN(b)||isNaN(_),h&&(m.options=c||this.resolveDataElementOptions(f,p.active?"active":o),a&&(m.options.radius=0)),this.updateElement(p,f,m,o);}}resolveDataElementOptions(t,n){let s=this.getParsed(t),o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:false}));let a=o.radius;return n!=="active"&&(o.radius=0),o.radius+=k(s&&s._custom,a),o;}}return e;})();function nc(e,i,t){let n=1,s=1,o=0,a=0;if(i<z){let r=e,l=r+i,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(y,M,x)=>oe(y,r,l,true)?1:Math.max(M,M*t,x,x*t),p=(y,M,x)=>oe(y,r,l,true)?-1:Math.min(M,M*t,x,x*t),g=f(0,c,d),m=f(H,h,u),b=p(T,c,d),_=p(T+H,h,u);n=(g-b)/2,s=(m-_)/2,o=-(g+b)/2,a=-(m+_)/2;}return{ratioX:n,ratioY:s,offsetX:o,offsetY:a};}var es=(()=>{class e extends zt{static id="doughnut";static defaults={datasetElementType:false,dataElementType:"arc",animation:{animateRotate:true,animateScale:false},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data,{labels:{pointStyle:s,textAlign:o,color:a,useBorderRadius:r,borderRadius:l}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,h)=>{let u=t.getDatasetMeta(0).controller.getStyle(h);return{text:c,fillStyle:u.backgroundColor,fontColor:a,hidden:!t.getDataVisibility(h),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:o,pointStyle:s,borderRadius:r&&(l||u.borderRadius),index:h};}):[];}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update();}}}};constructor(t,n){super(t,n),this.enableOptionSharing=true,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0;}linkScales(){}parse(t,n){let s=this.getDataset().data,o=this._cachedMeta;if(this._parsing===false)o._parsed=s;else{let a=c=>+s[c];if(D(s[t])){let{key:c="value"}=this._parsing;a=h=>+Mt(s[h],c);}let r,l;for(r=t,l=t+n;r<l;++r)o._parsed[r]=a(r);}}_getRotation(){return rt(this.options.rotation-90);}_getCircumference(){return rt(this.options.circumference);}_getRotationExtents(){let t=z,n=-z;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){let o=this.chart.getDatasetMeta(s).controller,a=o._getRotation(),r=o._getCircumference();t=Math.min(t,a),n=Math.max(n,a+r);}return{rotation:t,circumference:n-t};}update(t){let n=this.chart,{chartArea:s}=n,o=this._cachedMeta,a=o.data,r=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,l=Math.max((Math.min(s.width,s.height)-r)/2,0),c=Math.min(uo(this.options.cutout,l),1),h=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=nc(u,d,c),b=(s.width-r)/f,_=(s.height-r)/p,y=Math.max(Math.min(b,_)/2,0),M=Zi(this.options.radius,y),x=Math.max(M*c,0),v=(M-x)/this._getVisibleDatasetWeightTotal();this.offsetX=g*M,this.offsetY=m*M,o.total=this.calculateTotal(),this.outerRadius=M-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*h,0),this.updateElements(a,0,a.length,t);}_circumference(t,n){let s=this.options,o=this._cachedMeta,a=this._getCircumference();return n&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*a/z);}updateElements(t,n,s,o){let a=o==="reset",r=this.chart,l=r.chartArea,h=r.options.animation,d=(l.left+l.right)/2,u=(l.top+l.bottom)/2,f=a&&h.animateScale,p=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(n,o),_=this._getRotation(),y;for(y=0;y<n;++y)_+=this._circumference(y,a);for(y=n;y<n+s;++y){let M=this._circumference(y,a),x=t[y],v={x:d+this.offsetX,y:u+this.offsetY,startAngle:_,endAngle:_+M,circumference:M,outerRadius:g,innerRadius:p};b&&(v.options=m||this.resolveDataElementOptions(y,x.active?"active":o)),_+=M,this.updateElement(x,y,v,o);}}calculateTotal(){let t=this._cachedMeta,n=t.data,s=0,o;for(o=0;o<n.length;o++){let a=t._parsed[o];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(s+=Math.abs(a));}return s;}calculateCircumference(t){let n=this._cachedMeta.total;return n>0&&!isNaN(t)?z*(Math.abs(t)/n):0;}getLabelAndValue(t){let n=this._cachedMeta,s=this.chart,o=s.data.labels||[],a=ae(n._parsed[t],s.options.locale);return{label:o[t]||"",value:a};}getMaxBorderWidth(t){let n=0,s=this.chart,o,a,r,l,c;if(!t){for(o=0,a=s.data.datasets.length;o<a;++o)if(s.isDatasetVisible(o)){r=s.getDatasetMeta(o),t=r.data,l=r.controller;break;}}if(!t)return 0;for(o=0,a=t.length;o<a;++o)c=l.resolveDataElementOptions(o),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n;}getMaxOffset(t){let n=0;for(let s=0,o=t.length;s<o;++s){let a=this.resolveDataElementOptions(s);n=Math.max(n,a.offset||0,a.hoverOffset||0);}return n;}_getRingWeightOffset(t){let n=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(n+=this._getRingWeight(s));return n;}_getRingWeight(t){return Math.max(k(this.chart.data.datasets[t].weight,1),0);}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1;}}return e;})(),sc=(()=>{class e extends zt{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:true,spanGaps:false};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=true,this.supportsDecimation=true,super.initialize();}update(t){let n=this._cachedMeta,{dataset:s,data:o=[],_dataset:a}=n,r=this.chart._animationsDisabled,{start:l,count:c}=on(n,o,r);this._drawStart=l,this._drawCount=c,an(n)&&(l=0,c=o.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!a._decimated,s.points=o;let h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:h},t),this.updateElements(o,l,c,t);}updateElements(t,n,s,o){let a=o==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(n,o),f=r.axis,p=l.axis,{spanGaps:g,segment:m}=this.options,b=$t(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||a||o==="none",y=n+s,M=t.length,x=n>0&&this.getParsed(n-1);for(let v=0;v<M;++v){let S=t[v],C=_?S:{};if(v<n||v>=y){C.skip=true;continue;}let w=this.getParsed(v),L=O(w[p]),P=C[f]=r.getPixelForValue(w[f],v),A=C[p]=a||L?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,w,c):w[p],v);C.skip=isNaN(P)||isNaN(A)||L,C.stop=v>0&&Math.abs(w[f]-x[f])>b,m&&(C.parsed=w,C.raw=h.data[v]),u&&(C.options=d||this.resolveDataElementOptions(v,S.active?"active":o)),_||this.updateElement(S,v,C,o),x=w;}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,s=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return s;let a=o[0].size(this.resolveDataElementOptions(0)),r=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(s,a,r)/2;}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw();}}return e;})(),Wa=(()=>{class e extends zt{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:true,animateScale:true},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data;if(n.labels.length&&n.datasets.length){let{labels:{pointStyle:s,color:o}}=t.legend.options;return n.labels.map((a,r)=>{let c=t.getDatasetMeta(0).controller.getStyle(r);return{text:a,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r};});}return[];}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update();}}},scales:{r:{type:"radialLinear",angleLines:{display:false},beginAtZero:true,grid:{circular:true},pointLabels:{display:false},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0;}getLabelAndValue(t){let n=this._cachedMeta,s=this.chart,o=s.data.labels||[],a=ae(n._parsed[t].r,s.options.locale);return{label:o[t]||"",value:a};}parseObjectData(t,n,s,o){return pn.bind(this)(t,n,s,o);}update(t){let n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t);}getMinMax(){let t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,o)=>{let a=this.getParsed(o).r;!isNaN(a)&&this.chart.getDataVisibility(o)&&(a<n.min&&(n.min=a),a>n.max&&(n.max=a));}),n;}_updateRadius(){let t=this.chart,n=t.chartArea,s=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),a=Math.max(o/2,0),r=Math.max(s.cutoutPercentage?a/100*s.cutoutPercentage:1,0),l=(a-r)/t.getVisibleDatasetCount();this.outerRadius=a-l*this.index,this.innerRadius=this.outerRadius-l;}updateElements(t,n,s,o){let a=o==="reset",r=this.chart,c=r.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,u=h.yCenter,f=h.getIndexAngle(0)-.5*T,p=f,g,m=360/this.countVisibleElements();for(g=0;g<n;++g)p+=this._computeAngle(g,o,m);for(g=n;g<n+s;g++){let b=t[g],_=p,y=p+this._computeAngle(g,o,m),M=r.getDataVisibility(g)?h.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=y,a&&(c.animateScale&&(M=0),c.animateRotate&&(_=y=f));let x={x:d,y:u,innerRadius:0,outerRadius:M,startAngle:_,endAngle:y,options:this.resolveDataElementOptions(g,b.active?"active":o)};this.updateElement(b,g,x,o);}}countVisibleElements(){let t=this._cachedMeta,n=0;return t.data.forEach((s,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++;}),n;}_computeAngle(t,n,s){return this.chart.getDataVisibility(t)?rt(this.resolveDataElementOptions(t,n).angle||s):0;}}return e;})(),oc=(()=>{class e extends es{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};}return e;})(),ac=(()=>{class e extends zt{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:true,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let n=this._cachedMeta.vScale,s=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(s[n.axis])};}parseObjectData(t,n,s,o){return pn.bind(this)(t,n,s,o);}update(t){let n=this._cachedMeta,s=n.dataset,o=n.data||[],a=n.iScale.getLabels();if(s.points=o,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let l={_loop:true,_fullLoop:a.length===o.length,options:r};this.updateElement(s,void 0,l,t);}this.updateElements(o,0,o.length,t);}updateElements(t,n,s,o){let a=this._cachedMeta.rScale,r=o==="reset";for(let l=n;l<n+s;l++){let c=t[l],h=this.resolveDataElementOptions(l,c.active?"active":o),d=a.getPointPositionForValue(l,this.getParsed(l).r),u=r?a.xCenter:d.x,f=r?a.yCenter:d.y,p={x:u,y:f,angle:d.angle,skip:isNaN(u)||isNaN(f),options:h};this.updateElement(c,l,p,o);}}}return e;})(),rc=(()=>{class e extends zt{static id="scatter";static defaults={datasetElementType:false,dataElementType:"point",showLine:false,fill:false};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:a}=n,r=this.getParsed(t),l=o.getLabelForValue(r.x),c=a.getLabelForValue(r.y);return{label:s[t]||"",value:"("+l+", "+c+")"};}update(t){let n=this._cachedMeta,{data:s=[]}=n,o=this.chart._animationsDisabled,{start:a,count:r}=on(n,s,o);if(this._drawStart=a,this._drawCount=r,an(n)&&(a=0,r=s.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:l,_dataset:c}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=s;let h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(l,void 0,{animated:!o,options:h},t);}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=false);this.updateElements(s,a,r,t);}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements();}updateElements(t,n,s,o){let a=o==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,d=this.resolveDataElementOptions(n,o),u=this.getSharedOptions(d),f=this.includeOptions(o,u),p=r.axis,g=l.axis,{spanGaps:m,segment:b}=this.options,_=$t(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||o==="none",M=n>0&&this.getParsed(n-1);for(let x=n;x<n+s;++x){let v=t[x],S=this.getParsed(x),C=y?v:{},w=O(S[g]),L=C[p]=r.getPixelForValue(S[p],x),P=C[g]=a||w?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,S,c):S[g],x);C.skip=isNaN(L)||isNaN(P)||w,C.stop=x>0&&Math.abs(S[p]-M[p])>_,b&&(C.parsed=S,C.raw=h.data[x]),f&&(C.options=u||this.resolveDataElementOptions(x,v.active?"active":o)),y||this.updateElement(v,x,C,o),M=S;}this.updateSharedOptions(u,o,d);}getMaxOverflow(){let t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l;}let s=t.dataset,o=s.options&&s.options.borderWidth||0;if(!n.length)return o;let a=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,a,r)/2;}}return e;})(),lc=Object.freeze({__proto__:null,BarController:ec,BubbleController:ic,DoughnutController:es,LineController:sc,PieController:oc,PolarAreaController:Wa,RadarController:ac,ScatterController:rc});function Ut(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.");}var Fn=class e{static override(i){Object.assign(e.prototype,i);}options;constructor(i){this.options=i||{};}init(){}formats(){return Ut();}parse(){return Ut();}format(){return Ut();}add(){return Ut();}diff(){return Ut();}startOf(){return Ut();}endOf(){return Ut();}},cc={_date:Fn};function hc(e,i,t,n){let{controller:s,data:o,_sorted:a}=e,r=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(r&&i===r.axis&&i!=="r"&&a&&o.length){let c=r._reversePixels?_o:dt;if(n){if(s._sharedOptions){let h=o[0],d=typeof h.getRange=="function"&&h.getRange(i);if(d){let u=c(o,i,t-d),f=c(o,i,t+d);return{lo:u.lo,hi:f.hi};}}}else{let h=c(o,i,t);if(l){let{vScale:d}=s._cachedMeta,{_parsed:u}=e,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!O(g[d.axis]));h.lo-=Math.max(0,f);let p=u.slice(h.hi).findIndex(g=>!O(g[d.axis]));h.hi+=Math.max(0,p);}return h;}}return{lo:0,hi:o.length-1};}function Fe(e,i,t,n,s){let o=e.getSortedVisibleDatasetMetas(),a=t[i];for(let r=0,l=o.length;r<l;++r){let{index:c,data:h}=o[r],{lo:d,hi:u}=hc(o[r],i,a,s);for(let f=d;f<=u;++f){let p=h[f];p.skip||n(p,c,f);}}}function dc(e){let i=e.indexOf("x")!==-1,t=e.indexOf("y")!==-1;return function(n,s){let o=i?Math.abs(n.x-s.x):0,a=t?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2));};}function Pn(e,i,t,n,s){let o=[];return!s&&!e.isPointInArea(i)||Fe(e,t,i,function(r,l,c){!s&&!ut(r,e.chartArea,0)||r.inRange(i.x,i.y,n)&&o.push({element:r,datasetIndex:l,index:c});},true),o;}function uc(e,i,t,n){let s=[];function o(a,r,l){let{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],n),{angle:d}=Qi(a,{x:i.x,y:i.y});oe(d,c,h)&&s.push({element:a,datasetIndex:r,index:l});}return Fe(e,t,i,o),s;}function fc(e,i,t,n,s,o){let a=[],r=dc(t),l=Number.POSITIVE_INFINITY;function c(h,d,u){let f=h.inRange(i.x,i.y,s);if(n&&!f)return;let p=h.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!f)return;let m=r(i,p);m<l?(a=[{element:h,datasetIndex:d,index:u}],l=m):m===l&&a.push({element:h,datasetIndex:d,index:u});}return Fe(e,t,i,c),a;}function Ln(e,i,t,n,s,o){return!o&&!e.isPointInArea(i)?[]:t==="r"&&!n?uc(e,i,t,s):fc(e,i,t,n,s,o);}function Ko(e,i,t,n,s){let o=[],a=t==="x"?"inXRange":"inYRange",r=false;return Fe(e,t,i,(l,c,h)=>{l[a]&&l[a](i[t],s)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(i.x,i.y,s));}),n&&!r?[]:o;}var gc={modes:{index(e,i,t,n){let s=It(i,e),o=t.axis||"x",a=t.includeInvisible||false,r=t.intersect?Pn(e,s,o,n,a):Ln(e,s,o,false,n,a),l=[];return r.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h});}),l):[];},dataset(e,i,t,n){let s=It(i,e),o=t.axis||"xy",a=t.includeInvisible||false,r=t.intersect?Pn(e,s,o,n,a):Ln(e,s,o,false,n,a);if(r.length>0){let l=r[0].datasetIndex,c=e.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h});}return r;},point(e,i,t,n){let s=It(i,e),o=t.axis||"xy",a=t.includeInvisible||false;return Pn(e,s,o,n,a);},nearest(e,i,t,n){let s=It(i,e),o=t.axis||"xy",a=t.includeInvisible||false;return Ln(e,s,o,t.intersect,n,a);},x(e,i,t,n){let s=It(i,e);return Ko(e,s,"x",t.intersect,n);},y(e,i,t,n){let s=It(i,e);return Ko(e,s,"y",t.intersect,n);}}},ja=["left","top","right","bottom"];function Pe(e,i){return e.filter(t=>t.pos===i);}function qo(e,i){return e.filter(t=>ja.indexOf(t.pos)===-1&&t.box.axis===i);}function Le(e,i){return e.sort((t,n)=>{let s=i?n:t,o=i?t:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight;});}function pc(e){let i=[],t,n,s,o,a,r;for(t=0,n=(e||[]).length;t<n;++t)s=e[t],{position:o,options:{stack:a,stackWeight:r=1}}=s,i.push({index:t,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return i;}function mc(e){let i={};for(let t of e){let{stack:n,pos:s,stackWeight:o}=t;if(!n||!ja.includes(s))continue;let a=i[n]||(i[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o;}return i;}function bc(e,i){let t=mc(e),{vBoxMaxWidth:n,hBoxMaxHeight:s}=i,o,a,r;for(o=0,a=e.length;o<a;++o){r=e[o];let{fullSize:l}=r.box,c=t[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*n:l&&i.availableWidth,r.height=s):(r.width=n,r.height=h?h*s:l&&i.availableHeight);}return t;}function _c(e){let i=pc(e),t=Le(i.filter(c=>c.box.fullSize),true),n=Le(Pe(i,"left"),true),s=Le(Pe(i,"right")),o=Le(Pe(i,"top"),true),a=Le(Pe(i,"bottom")),r=qo(i,"x"),l=qo(i,"y");return{fullSize:t,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Pe(i,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)};}function Go(e,i,t,n){return Math.max(e[t],i[t])+Math.max(e[n],i[n]);}function $a(e,i){e.top=Math.max(e.top,i.top),e.left=Math.max(e.left,i.left),e.bottom=Math.max(e.bottom,i.bottom),e.right=Math.max(e.right,i.right);}function xc(e,i,t,n){let{pos:s,box:o}=t,a=e.maxPadding;if(!D(s)){t.size&&(e[s]-=t.size);let d=n[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?o.height:o.width),t.size=d.size/d.count,e[s]+=t.size;}o.getPadding&&$a(a,o.getPadding());let r=Math.max(0,i.outerWidth-Go(a,e,"left","right")),l=Math.max(0,i.outerHeight-Go(a,e,"top","bottom")),c=r!==e.w,h=l!==e.h;return e.w=r,e.h=l,t.horizontal?{same:c,other:h}:{same:h,other:c};}function yc(e){let i=e.maxPadding;function t(n){let s=Math.max(i[n]-e[n],0);return e[n]+=s,s;}e.y+=t("top"),e.x+=t("left"),t("right"),t("bottom");}function vc(e,i){let t=i.maxPadding;function n(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(i[a],t[a]);}),o;}return n(e?["left","right"]:["top","bottom"]);}function Ae(e,i,t,n){let s=[],o,a,r,l,c,h;for(o=0,a=e.length,c=0;o<a;++o){r=e[o],l=r.box,l.update(r.width||i.w,r.height||i.h,vc(r.horizontal,i));let{same:d,other:u}=xc(i,t,r,n);c|=d&&s.length,h=h||u,l.fullSize||s.push(r);}return c&&Ae(s,i,t,n)||h;}function bi(e,i,t,n,s){e.top=t,e.left=i,e.right=i+n,e.bottom=t+s,e.width=n,e.height=s;}function Jo(e,i,t,n){let s=t.padding,{x:o,y:a}=i;for(let r of e){let l=r.box,c=n[r.stack]||{placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){let d=i.w*h,u=c.size||l.height;ne(c.start)&&(a=c.start),l.fullSize?bi(l,s.left,a,t.outerWidth-s.right-s.left,u):bi(l,i.left+c.placed,a,d,u),c.start=a,c.placed+=d,a=l.bottom;}else{let d=i.h*h,u=c.size||l.width;ne(c.start)&&(o=c.start),l.fullSize?bi(l,o,s.top,u,t.outerHeight-s.bottom-s.top):bi(l,o,i.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right;}}i.x=o,i.y=a;}var J={addBox(e,i){e.boxes||(e.boxes=[]),i.fullSize=i.fullSize||false,i.position=i.position||"top",i.weight=i.weight||0,i._layers=i._layers||function(){return[{z:0,draw(t){i.draw(t);}}];},e.boxes.push(i);},removeBox(e,i){let t=e.boxes?e.boxes.indexOf(i):-1;t!==-1&&e.boxes.splice(t,1);},configure(e,i,t){i.fullSize=t.fullSize,i.position=t.position,i.weight=t.weight;},update(e,i,t,n){if(!e)return;let s=K(e.options.layout.padding),o=Math.max(i-s.width,0),a=Math.max(t-s.height,0),r=_c(e.boxes),l=r.vertical,c=r.horizontal;E(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout();});let h=l.reduce((g,m)=>m.box.options&&m.box.options.display===false?g:g+1,0)||1,d=Object.freeze({outerWidth:i,outerHeight:t,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},s);$a(u,K(n));let f=Object.assign({maxPadding:u,w:o,h:a,x:s.left,y:s.top},s),p=bc(l.concat(c),d);Ae(r.fullSize,f,d,p),Ae(l,f,d,p),Ae(c,f,d,p)&&Ae(l,f,d,p),yc(f),Jo(r.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Jo(r.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},E(r.chartArea,g=>{let m=g.box;Object.assign(m,e.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0});});}},ki=class{acquireContext(i,t){}releaseContext(i){return false;}addEventListener(i,t,n){}removeEventListener(i,t,n){}getDevicePixelRatio(){return 1;}getMaximumSize(i,t,n,s){return t=Math.max(0,t||i.width),n=n||i.height,{width:t,height:Math.max(0,s?Math.floor(t/s):n)};}isAttached(i){return true;}updateConfig(i){}},zn=class extends ki{acquireContext(i){return i&&i.getContext&&i.getContext("2d")||null;}updateConfig(i){i.options.animation=false;}},Ci="$chartjs",Mc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Qo=e=>e===null||e==="";function Cc(e,i){let t=e.style,n=e.getAttribute("height"),s=e.getAttribute("width");if(e[Ci]={initial:{height:n,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Qo(s)){let o=bn(e,"width");o!==void 0&&(e.width=o);}if(Qo(n))if(e.style.height==="")e.height=e.width/(i||2);else{let o=bn(e,"height");o!==void 0&&(e.height=o);}return e;}var Ya=Io?{passive:true}:false;function Sc(e,i,t){e&&e.addEventListener(i,t,Ya);}function wc(e,i,t){e&&e.canvas&&e.canvas.removeEventListener(i,t,Ya);}function kc(e,i){let t=Mc[e.type]||e.type,{x:n,y:s}=It(e,i);return{type:t,chart:i,native:e,x:n!==void 0?n:null,y:s!==void 0?s:null};}function Pi(e,i){for(let t of e)if(t===i||t.contains(i))return true;}function Pc(e,i,t){let n=e.canvas,s=new MutationObserver(o=>{let a=false;for(let r of o)a=a||Pi(r.addedNodes,n),a=a&&!Pi(r.removedNodes,n);a&&t();});return s.observe(document,{childList:true,subtree:true}),s;}function Lc(e,i,t){let n=e.canvas,s=new MutationObserver(o=>{let a=false;for(let r of o)a=a||Pi(r.removedNodes,n),a=a&&!Pi(r.addedNodes,n);a&&t();});return s.observe(document,{childList:true,subtree:true}),s;}var Ee=new Map(),ta=0;function Ua(){let e=window.devicePixelRatio;e!==ta&&(ta=e,Ee.forEach((i,t)=>{t.currentDevicePixelRatio!==e&&i();}));}function Oc(e,i){Ee.size||window.addEventListener("resize",Ua),Ee.set(e,i);}function Dc(e){Ee.delete(e),Ee.size||window.removeEventListener("resize",Ua);}function Ac(e,i,t){let n=e.canvas,s=n&&pi(n);if(!s)return;let o=sn((r,l)=>{let c=s.clientWidth;t(r,l),c<s.clientWidth&&t();},window),a=new ResizeObserver(r=>{let l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h);});return a.observe(s),Oc(e,o),a;}function On(e,i,t){t&&t.disconnect(),i==="resize"&&Dc(e);}function Tc(e,i,t){let n=e.canvas,s=sn(o=>{e.ctx!==null&&t(kc(o,e));},e);return Sc(n,i,s),s;}var Bn=class extends ki{acquireContext(i,t){let n=i&&i.getContext&&i.getContext("2d");return n&&n.canvas===i?(Cc(i,t),n):null;}releaseContext(i){let t=i.canvas;if(!t[Ci])return false;let n=t[Ci].initial;["height","width"].forEach(o=>{let a=n[o];O(a)?t.removeAttribute(o):t.setAttribute(o,a);});let s=n.style||{};return Object.keys(s).forEach(o=>{t.style[o]=s[o];}),t.width=t.width,delete t[Ci],true;}addEventListener(i,t,n){this.removeEventListener(i,t);let s=i.$proxies||(i.$proxies={}),a={attach:Pc,detach:Lc,resize:Ac}[t]||Tc;s[t]=a(i,t,n);}removeEventListener(i,t){let n=i.$proxies||(i.$proxies={}),s=n[t];if(!s)return;({attach:On,detach:On,resize:On}[t]||wc)(i,t,s),n[t]=void 0;}getDevicePixelRatio(){return window.devicePixelRatio;}getMaximumSize(i,t,n,s){return Ro(i,t,n,s);}isAttached(i){let t=i&&pi(i);return!!(t&&t.isConnected);}};function Ec(e){return!gi()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?zn:Bn;}var ht=class{static defaults={};static defaultRoutes=void 0;x;y;active=false;options;$animations;tooltipPosition(i){let{x:t,y:n}=this.getProps(["x","y"],i);return{x:t,y:n};}hasValue(){return $t(this.x)&&$t(this.y);}getProps(i,t){let n=this.$animations;if(!t||!n)return this;let s={};return i.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o];}),s;}};function Rc(e,i){let t=e.options.ticks,n=Ic(e),s=Math.min(t.maxTicksLimit||n,n),o=t.major.enabled?zc(i):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return Bc(i,c,o,a/s),c;let h=Fc(o,i,s);if(a>0){let d,u,f=a>1?Math.round((l-r)/(a-1)):null;for(_i(i,c,h,O(f)?0:r-f,r),d=0,u=a-1;d<u;d++)_i(i,c,h,o[d],o[d+1]);return _i(i,c,h,l,O(f)?i.length:l+f),c;}return _i(i,c,h),c;}function Ic(e){let i=e.options.offset,t=e._tickSize(),n=e._length/t+(i?0:1),s=e._maxLength/t;return Math.floor(Math.min(n,s));}function Fc(e,i,t){let n=Vc(e),s=i.length/t;if(!n)return Math.max(s,1);let o=po(n);for(let a=0,r=o.length-1;a<r;a++){let l=o[a];if(l>s)return l;}return Math.max(s,1);}function zc(e){let i=[],t,n;for(t=0,n=e.length;t<n;t++)e[t].major&&i.push(t);return i;}function Bc(e,i,t,n){let s=0,o=t[0],a;for(n=Math.ceil(n),a=0;a<e.length;a++)a===o&&(i.push(e[a]),s++,o=t[s*n]);}function _i(e,i,t,n,s){let o=k(n,0),a=Math.min(k(s,e.length),e.length),r=0,l,c,h;for(t=Math.ceil(t),s&&(l=s-n,t=l/Math.floor(l/t)),h=o;h<0;)r++,h=Math.round(o+r*t);for(c=Math.max(o,0);c<a;c++)c===h&&(i.push(e[c]),r++,h=Math.round(o+r*t));}function Vc(e){let i=e.length,t,n;if(i<2)return false;for(n=e[0],t=1;t<i;++t)if(e[t]-e[t-1]!==n)return false;return n;}var Nc=e=>e==="left"?"right":e==="right"?"left":e,ea=(e,i,t)=>i==="top"||i==="left"?e[i]+t:e[i]-t,ia=(e,i)=>Math.min(i||e,e);function na(e,i){let t=[],n=e.length/i,s=e.length,o=0;for(;o<s;o+=n)t.push(e[Math.floor(o)]);return t;}function Hc(e,i,t){let n=e.ticks.length,s=Math.min(i,n-1),o=e._startPixel,a=e._endPixel,r=1e-6,l=e.getPixelForTick(s),c;if(!(t&&(n===1?c=Math.max(l-o,a-l):i===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<i?c:-c,l<o-r||l>a+r)))return l;}function Wc(e,i){E(e,t=>{let n=t.gc,s=n.length/2,o;if(s>i){for(o=0;o<s;++o)delete t.data[n[o]];n.splice(0,s);}});}function Oe(e){return e.drawTicks?e.tickLength:0;}function sa(e,i){if(!e.display)return 0;let t=j(e.font,i),n=K(e.padding);return(F(e.text)?e.text.length:1)*t.lineHeight+n.height;}function jc(e,i){return Ct(e,{scale:i,type:"scale"});}function $c(e,i,t){return Ct(e,{tick:t,index:i,type:"tick"});}function Yc(e,i,t){let n=ci(e);return(t&&i!=="right"||!t&&i==="right")&&(n=Nc(n)),n;}function Uc(e,i,t,n){let{top:s,left:o,bottom:a,right:r,chart:l}=e,{chartArea:c,scales:h}=l,d=0,u,f,p,g=a-s,m=r-o;if(e.isHorizontal()){if(f=Z(n,o,r),D(t)){let b=Object.keys(t)[0],_=t[b];p=h[b].getPixelForValue(_)+g-i;}else t==="center"?p=(c.bottom+c.top)/2+g-i:p=ea(e,t,i);u=r-o;}else{if(D(t)){let b=Object.keys(t)[0],_=t[b];f=h[b].getPixelForValue(_)-m+i;}else t==="center"?f=(c.left+c.right)/2-m+i:f=ea(e,t,i);p=Z(n,a,s),d=t==="left"?-H:H;}return{titleX:f,titleY:p,maxWidth:u,rotation:d};}var Zt=class e extends ht{constructor(i){super(),this.id=i.id,this.type=i.type,this.options=void 0,this.ctx=i.ctx,this.chart=i.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=false,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=false,this.$context=void 0;}init(i){this.options=i.setContext(this.getContext()),this.axis=i.axis,this._userMin=this.parse(i.min),this._userMax=this.parse(i.max),this._suggestedMin=this.parse(i.suggestedMin),this._suggestedMax=this.parse(i.suggestedMax);}parse(i,t){return i;}getUserBounds(){let{_userMin:i,_userMax:t,_suggestedMin:n,_suggestedMax:s}=this;return i=Q(i,Number.POSITIVE_INFINITY),t=Q(t,Number.NEGATIVE_INFINITY),n=Q(n,Number.POSITIVE_INFINITY),s=Q(s,Number.NEGATIVE_INFINITY),{min:Q(i,n),max:Q(t,s),minDefined:N(i),maxDefined:N(t)};}getMinMax(i){let{min:t,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:t,max:n};let r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,i),s||(t=Math.min(t,a.min)),o||(n=Math.max(n,a.max));return t=o&&t>n?n:t,n=s&&t>n?t:n,{min:Q(t,Q(n,t)),max:Q(n,Q(t,n))};}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0};}getTicks(){return this.ticks;}getLabels(){let i=this.chart.data;return this.options.labels||(this.isHorizontal()?i.xLabels:i.yLabels)||i.labels||[];}getLabelItems(i=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(i));}beforeLayout(){this._cache={},this._dataLimitsCached=false;}beforeUpdate(){I(this.options.beforeUpdate,[this]);}update(i,t,n){let{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=i,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Lo(this,o,s),this._dataLimitsCached=true),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=r<this.ticks.length;this._convertTicksToLabels(l?na(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Rc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate();}configure(){let i=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,i=!i),this._startPixel=t,this._endPixel=n,this._reversePixels=i,this._length=n-t,this._alignToPixels=this.options.alignToPixels;}afterUpdate(){I(this.options.afterUpdate,[this]);}beforeSetDimensions(){I(this.options.beforeSetDimensions,[this]);}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0;}afterSetDimensions(){I(this.options.afterSetDimensions,[this]);}_callHooks(i){this.chart.notifyPlugins(i,this.getContext()),I(this.options[i],[this]);}beforeDataLimits(){this._callHooks("beforeDataLimits");}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits");}beforeBuildTicks(){this._callHooks("beforeBuildTicks");}buildTicks(){return[];}afterBuildTicks(){this._callHooks("afterBuildTicks");}beforeTickToLabelConversion(){I(this.options.beforeTickToLabelConversion,[this]);}generateTickLabels(i){let t=this.options.ticks,n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n],o.label=I(t.callback,[o.value,n,i],this);}afterTickToLabelConversion(){I(this.options.afterTickToLabelConversion,[this]);}beforeCalculateLabelRotation(){I(this.options.beforeCalculateLabelRotation,[this]);}calculateLabelRotation(){let i=this.options,t=i.ticks,n=ia(this.ticks.length,i.ticks.maxTicksLimit),s=t.minRotation||0,o=t.maxRotation,a=s,r,l,c;if(!this._isVisible()||!t.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return;}let h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=$(this.chart.width-d,0,this.maxWidth);r=i.offset?this.maxWidth/n:f/(n-1),d+6>r&&(r=f/(n-(i.offset?.5:1)),l=this.maxHeight-Oe(i.grid)-t.padding-sa(i.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=ri(Math.min(Math.asin($((h.highest.height+6)/r,-1,1)),Math.asin($(l/c,-1,1))-Math.asin($(u/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a;}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this]);}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this]);}fit(){let i={width:0,height:0},{chart:t,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){let l=sa(s,t.options.font);if(r?(i.width=this.maxWidth,i.height=Oe(o)+l):(i.height=this.maxHeight,i.width=Oe(o)+l),n.display&&this.ticks.length){let{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=n.padding*2,p=rt(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(r){let b=n.mirror?0:m*d.width+g*u.height;i.height=Math.min(this.maxHeight,i.height+b+f);}else{let b=n.mirror?0:g*d.width+m*u.height;i.width=Math.min(this.maxWidth,i.width+b+f);}this._calculatePadding(c,h,m,g);}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=i.height):(this.width=i.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom);}_calculatePadding(i,t,n,s){let{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?c?(u=s*i.width,f=n*t.height):(u=n*i.height,f=s*t.width):o==="start"?f=t.width:o==="end"?u=i.width:o!=="inner"&&(u=i.width/2,f=t.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+a)*this.width/(this.width-d),0);}else{let h=t.height/2,d=i.height/2;o==="start"?(h=0,d=i.height):o==="end"&&(h=t.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+a;}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom));}afterFit(){I(this.options.afterFit,[this]);}isHorizontal(){let{axis:i,position:t}=this.options;return t==="top"||t==="bottom"||i==="x";}isFullSize(){return this.options.fullSize;}_convertTicksToLabels(i){this.beforeTickToLabelConversion(),this.generateTickLabels(i);let t,n;for(t=0,n=i.length;t<n;t++)O(i[t].label)&&(i.splice(t,1),n--,t--);this.afterTickToLabelConversion();}_getLabelSizes(){let i=this._labelSizes;if(!i){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=na(n,t)),this._labelSizes=i=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit);}return i;}_computeLabelSizes(i,t,n){let{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(t/ia(t,n)),c=0,h=0,d,u,f,p,g,m,b,_,y,M,x;for(d=0;d<t;d+=l){if(p=i[d].label,g=this._resolveTickFontOptions(d),s.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},_=g.lineHeight,y=M=0,!O(p)&&!F(p))y=ve(s,b.data,b.gc,y,p),M=_;else if(F(p))for(u=0,f=p.length;u<f;++u)x=p[u],!O(x)&&!F(x)&&(y=ve(s,b.data,b.gc,y,x),M+=_);a.push(y),r.push(M),c=Math.max(y,c),h=Math.max(M,h);}Wc(o,t);let v=a.indexOf(c),S=r.indexOf(h),C=w=>({width:a[w]||0,height:r[w]||0});return{first:C(0),last:C(t-1),widest:C(v),highest:C(S),widths:a,heights:r};}getLabelForValue(i){return i;}getPixelForValue(i,t){return NaN;}getValueForPixel(i){}getPixelForTick(i){let t=this.ticks;return i<0||i>t.length-1?null:this.getPixelForValue(t[i].value);}getPixelForDecimal(i){this._reversePixels&&(i=1-i);let t=this._startPixel+i*this._length;return bo(this._alignToPixels?Tt(this.chart,t,0):t);}getDecimalForPixel(i){let t=(i-this._startPixel)/this._length;return this._reversePixels?1-t:t;}getBasePixel(){return this.getPixelForValue(this.getBaseValue());}getBaseValue(){let{min:i,max:t}=this;return i<0&&t<0?t:i>0&&t>0?i:0;}getContext(i){let t=this.ticks||[];if(i>=0&&i<t.length){let n=t[i];return n.$context||(n.$context=$c(this.getContext(),i,n));}return this.$context||(this.$context=jc(this.chart.getContext(),this));}_tickSize(){let i=this.options.ticks,t=rt(this.labelRotation),n=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),o=this._getLabelSizes(),a=i.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*n>r*s?r/n:l/s:l*s<r*n?l/n:r/s;}_isVisible(){let i=this.options.display;return i!=="auto"?!!i:this.getMatchingVisibleMetas().length>0;}_computeGridLineItems(i){let t=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Oe(o),f=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(V){return Tt(n,V,g);},_,y,M,x,v,S,C,w,L,P,A,U;if(a==="top")_=b(this.bottom),S=this.bottom-u,w=_-m,P=b(i.top)+m,U=i.bottom;else if(a==="bottom")_=b(this.top),P=i.top,U=b(i.bottom)-m,S=_+m,w=this.top+u;else if(a==="left")_=b(this.right),v=this.right-u,C=_-m,L=b(i.left)+m,A=i.right;else if(a==="right")_=b(this.left),L=i.left,A=b(i.right)-m,v=_+m,C=this.left+u;else if(t==="x"){if(a==="center")_=b((i.top+i.bottom)/2+.5);else if(D(a)){let V=Object.keys(a)[0],W=a[V];_=b(this.chart.scales[V].getPixelForValue(W));}P=i.top,U=i.bottom,S=_+m,w=S+u;}else if(t==="y"){if(a==="center")_=b((i.left+i.right)/2);else if(D(a)){let V=Object.keys(a)[0],W=a[V];_=b(this.chart.scales[V].getPixelForValue(W));}v=_-m,C=v-u,L=i.left,A=i.right;}let it=k(s.ticks.maxTicksLimit,d),R=Math.max(1,Math.ceil(d/it));for(y=0;y<d;y+=R){let V=this.getContext(y),W=o.setContext(V),lt=r.setContext(V),q=W.lineWidth,Kt=W.color,ze=lt.dash||[],qt=lt.dashOffset,ue=W.tickWidth,Bt=W.tickColor,fe=W.tickBorderDash||[],Vt=W.tickBorderDashOffset;M=Hc(this,y,l),M!==void 0&&(x=Tt(n,M,q),c?v=C=L=A=x:S=w=P=U=x,f.push({tx1:v,ty1:S,tx2:C,ty2:w,x1:L,y1:P,x2:A,y2:U,width:q,color:Kt,borderDash:ze,borderDashOffset:qt,tickWidth:ue,tickColor:Bt,tickBorderDash:fe,tickBorderDashOffset:Vt}));}return this._ticksLength=d,this._borderValue=_,f;}_computeLabelItems(i){let t=this.axis,n=this.options,{position:s,ticks:o}=n,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=Oe(n.grid),f=u+h,p=d?-h:f,g=-rt(this.labelRotation),m=[],b,_,y,M,x,v,S,C,w,L,P,A,U="middle";if(s==="top")v=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")v=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){let R=this._getYAxisLabelAlignment(u);S=R.textAlign,x=R.x;}else if(s==="right"){let R=this._getYAxisLabelAlignment(u);S=R.textAlign,x=R.x;}else if(t==="x"){if(s==="center")v=(i.top+i.bottom)/2+f;else if(D(s)){let R=Object.keys(s)[0],V=s[R];v=this.chart.scales[R].getPixelForValue(V)+f;}S=this._getXAxisLabelAlignment();}else if(t==="y"){if(s==="center")x=(i.left+i.right)/2-f;else if(D(s)){let R=Object.keys(s)[0],V=s[R];x=this.chart.scales[R].getPixelForValue(V);}S=this._getYAxisLabelAlignment(u).textAlign;}t==="y"&&(l==="start"?U="top":l==="end"&&(U="bottom"));let it=this._getLabelSizes();for(b=0,_=r.length;b<_;++b){y=r[b],M=y.label;let R=o.setContext(this.getContext(b));C=this.getPixelForTick(b)+o.labelOffset,w=this._resolveTickFontOptions(b),L=w.lineHeight,P=F(M)?M.length:1;let V=P/2,W=R.color,lt=R.textStrokeColor,q=R.textStrokeWidth,Kt=S;a?(x=C,S==="inner"&&(b===_-1?Kt=this.options.reverse?"left":"right":b===0?Kt=this.options.reverse?"right":"left":Kt="center"),s==="top"?c==="near"||g!==0?A=-P*L+L/2:c==="center"?A=-it.highest.height/2-V*L+L:A=-it.highest.height+L/2:c==="near"||g!==0?A=L/2:c==="center"?A=it.highest.height/2-V*L:A=it.highest.height-P*L,d&&(A*=-1),g!==0&&!R.showLabelBackdrop&&(x+=L/2*Math.sin(g))):(v=C,A=(1-P)*L/2);let ze;if(R.showLabelBackdrop){let qt=K(R.backdropPadding),ue=it.heights[b],Bt=it.widths[b],fe=A-qt.top,Vt=0-qt.left;switch(U){case"middle":fe-=ue/2;break;case"bottom":fe-=ue;break;}switch(S){case"center":Vt-=Bt/2;break;case"right":Vt-=Bt;break;case"inner":b===_-1?Vt-=Bt:b>0&&(Vt-=Bt/2);break;}ze={left:Vt,top:fe,width:Bt+qt.width,height:ue+qt.height,color:R.backdropColor};}m.push({label:M,font:w,textOffset:A,options:{rotation:g,color:W,strokeColor:lt,strokeWidth:q,textAlign:Kt,textBaseline:U,translation:[x,v],backdrop:ze}});}return m;}_getXAxisLabelAlignment(){let{position:i,ticks:t}=this.options;if(-rt(this.labelRotation))return i==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s;}_getYAxisLabelAlignment(i){let{position:t,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=i+o,l=a.widest.width,c,h;return t==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):t==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h};}_computeLabelArea(){if(this.options.ticks.mirror)return;let i=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:i.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:i.width};}drawBackground(){let{ctx:i,options:{backgroundColor:t},left:n,top:s,width:o,height:a}=this;t&&(i.save(),i.fillStyle=t,i.fillRect(n,s,o,a),i.restore());}getLineWidthForValue(i){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let s=this.ticks.findIndex(o=>o.value===i);return s>=0?t.setContext(this.getContext(s)).lineWidth:0;}drawGrid(i){let t=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(i)),o,a,r=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore());};if(t.display)for(o=0,a=s.length;o<a;++o){let l=s[o];t.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset});}}drawBorder(){let{chart:i,ctx:t,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),a=n.display?o.width:0;if(!a)return;let r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,h,d,u;this.isHorizontal()?(c=Tt(i,this.left,a)-a/2,h=Tt(i,this.right,r)+r/2,d=u=l):(d=Tt(i,this.top,a)-a/2,u=Tt(i,this.bottom,r)+r/2,c=h=l),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(c,d),t.lineTo(h,u),t.stroke(),t.restore();}drawLabels(i){if(!this.options.ticks.display)return;let n=this.ctx,s=this._computeLabelArea();s&&Se(n,s);let o=this.getLabelItems(i);for(let a of o){let r=a.options,l=a.font,c=a.label,h=a.textOffset;Et(n,c,0,h,l,r);}s&&we(n);}drawTitle(){let{ctx:i,options:{position:t,title:n,reverse:s}}=this;if(!n.display)return;let o=j(n.font),a=K(n.padding),r=n.align,l=o.lineHeight/2;t==="bottom"||t==="center"||D(t)?(l+=a.bottom,F(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=a.top;let{titleX:c,titleY:h,maxWidth:d,rotation:u}=Uc(this,l,t,r);Et(i,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:u,textAlign:Yc(r,t,s),textBaseline:"middle",translation:[c,h]});}draw(i){this._isVisible()&&(this.drawBackground(),this.drawGrid(i),this.drawBorder(),this.drawTitle(),this.drawLabels(i));}_layers(){let i=this.options,t=i.ticks&&i.ticks.z||0,n=k(i.grid&&i.grid.z,-1),s=k(i.border&&i.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:t,draw:o=>{this.draw(o);}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle();}},{z:s,draw:()=>{this.drawBorder();}},{z:t,draw:o=>{this.drawLabels(o);}}];}getMatchingVisibleMetas(i){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[],o,a;for(o=0,a=t.length;o<a;++o){let r=t[o];r[n]===this.id&&(!i||r.type===i)&&s.push(r);}return s;}_resolveTickFontOptions(i){let t=this.options.ticks.setContext(this.getContext(i));return j(t.font);}_maxDigits(){let i=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/i;}},he=class{constructor(i,t,n){this.type=i,this.scope=t,this.override=n,this.items=Object.create(null);}isForType(i){return Object.prototype.isPrototypeOf.call(this.type.prototype,i.prototype);}register(i){let t=Object.getPrototypeOf(i),n;Kc(t)&&(n=this.register(t));let s=this.items,o=i.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+i);return o in s||(s[o]=i,Xc(i,a,n),this.override&&B.override(i.id,i.overrides)),a;}get(i){return this.items[i];}unregister(i){let t=this.items,n=i.id,s=this.scope;n in t&&delete t[n],s&&n in B[s]&&(delete B[s][n],this.override&&delete At[n]);}};function Xc(e,i,t){let n=te(Object.create(null),[t?B.get(t):{},B.get(i),e.defaults]);B.set(i,n),e.defaultRoutes&&Zc(i,e.defaultRoutes),e.descriptors&&B.describe(i,e.descriptors);}function Zc(e,i){Object.keys(i).forEach(t=>{let n=t.split("."),s=n.pop(),o=[e].concat(n).join("."),a=i[t].split("."),r=a.pop(),l=a.join(".");B.route(o,s,l,r);});}function Kc(e){return"id"in e&&"defaults"in e;}var Vn=class{constructor(){this.controllers=new he(zt,"datasets",true),this.elements=new he(ht,"elements"),this.plugins=new he(Object,"plugins"),this.scales=new he(Zt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements];}add(...i){this._each("register",i);}remove(...i){this._each("unregister",i);}addControllers(...i){this._each("register",i,this.controllers);}addElements(...i){this._each("register",i,this.elements);}addPlugins(...i){this._each("register",i,this.plugins);}addScales(...i){this._each("register",i,this.scales);}getController(i){return this._get(i,this.controllers,"controller");}getElement(i){return this._get(i,this.elements,"element");}getPlugin(i){return this._get(i,this.plugins,"plugin");}getScale(i){return this._get(i,this.scales,"scale");}removeControllers(...i){this._each("unregister",i,this.controllers);}removeElements(...i){this._each("unregister",i,this.elements);}removePlugins(...i){this._each("unregister",i,this.plugins);}removeScales(...i){this._each("unregister",i,this.scales);}_each(i,t,n){[...t].forEach(s=>{let o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(i,o,s):E(s,a=>{let r=n||this._getRegistryForType(a);this._exec(i,r,a);});});}_exec(i,t,n){let s=ai(i);I(n["before"+s],[],n),t[i](n),I(n["after"+s],[],n);}_getRegistryForType(i){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(i))return n;}return this.plugins;}_get(i,t,n){let s=t.get(i);if(s===void 0)throw new Error('"'+i+'" is not a registered '+n+".");return s;}},mt=new Vn(),Nn=class{constructor(){this._init=void 0;}notify(i,t,n,s){if(t==="beforeInit"&&(this._init=this._createDescriptors(i,true),this._notify(this._init,i,"install")),this._init===void 0)return;let o=s?this._descriptors(i).filter(s):this._descriptors(i),a=this._notify(o,i,t,n);return t==="afterDestroy"&&(this._notify(o,i,"stop"),this._notify(this._init,i,"uninstall"),this._init=void 0),a;}_notify(i,t,n,s){s=s||{};for(let o of i){let a=o.plugin,r=a[n],l=[t,s,o.options];if(I(r,l,a)===false&&s.cancelable)return false;}return true;}invalidate(){O(this._cache)||(this._oldCache=this._cache,this._cache=void 0);}_descriptors(i){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(i);return this._notifyStateChanges(i),t;}_createDescriptors(i,t){let n=i&&i.config,s=k(n.options&&n.options.plugins,{}),o=qc(n);return s===false&&!t?[]:Jc(i,o,s,t);}_notifyStateChanges(i){let t=this._oldCache||[],n=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(t,n),i,"stop"),this._notify(s(n,t),i,"start");}};function qc(e){let i={},t=[],n=Object.keys(mt.plugins.items);for(let o=0;o<n.length;o++)t.push(mt.getPlugin(n[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let a=s[o];t.indexOf(a)===-1&&(t.push(a),i[a.id]=true);}return{plugins:t,localIds:i};}function Gc(e,i){return!i&&e===false?null:e===true?{}:e;}function Jc(e,{plugins:i,localIds:t},n,s){let o=[],a=e.getContext();for(let r of i){let l=r.id,c=Gc(n[l],s);c!==null&&o.push({plugin:r,options:Qc(e.config,{plugin:r,local:t[l]},c,a)});}return o;}function Qc(e,{plugin:i,local:t},n,s){let o=e.pluginScopeKeys(i),a=e.getOptionScopes(n,o);return t&&i.defaults&&a.push(i.defaults),e.createResolver(a,s,[""],{scriptable:false,indexable:false,allKeys:true});}function Hn(e,i){let t=B.datasets[e]||{};return((i.datasets||{})[e]||{}).indexAxis||i.indexAxis||t.indexAxis||"x";}function th(e,i){let t=e;return e==="_index_"?t=i:e==="_value_"&&(t=i==="x"?"y":"x"),t;}function eh(e,i){return e===i?"_index_":"_value_";}function oa(e){if(e==="x"||e==="y"||e==="r")return e;}function ih(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y";}function Wn(e,...i){if(oa(e))return e;for(let t of i){let n=t.axis||ih(t.position)||e.length>1&&oa(e[0].toLowerCase());if(n)return n;}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`);}function aa(e,i,t){if(t[i+"AxisID"]===e)return{axis:i};}function nh(e,i){if(i.data&&i.data.datasets){let t=i.data.datasets.filter(n=>n.xAxisID===e||n.yAxisID===e);if(t.length)return aa(e,"x",t[0])||aa(e,"y",t[0]);}return{};}function sh(e,i){let t=At[e.type]||{scales:{}},n=i.scales||{},s=Hn(e.type,i),o=Object.create(null);return Object.keys(n).forEach(a=>{let r=n[a];if(!D(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let l=Wn(a,r,nh(a,e),B.scales[r.type]),c=eh(l,s),h=t.scales||{};o[a]=ie(Object.create(null),[{axis:l},r,h[l],h[c]]);}),e.data.datasets.forEach(a=>{let r=a.type||e.type,l=a.indexAxis||Hn(r,i),h=(At[r]||{}).scales||{};Object.keys(h).forEach(d=>{let u=th(d,l),f=a[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),ie(o[f],[{axis:u},n[f],h[d]]);});}),Object.keys(o).forEach(a=>{let r=o[a];ie(r,[B.scales[r.type],B.scale]);}),o;}function Xa(e){let i=e.options||(e.options={});i.plugins=k(i.plugins,{}),i.scales=sh(e,i);}function Za(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e;}function oh(e){return e=e||{},e.data=Za(e.data),Xa(e),e;}var ra=new Map(),Ka=new Set();function xi(e,i){let t=ra.get(e);return t||(t=i(),ra.set(e,t),Ka.add(t)),t;}var De=(e,i,t)=>{let n=Mt(i,t);n!==void 0&&e.add(n);},jn=class{constructor(i){this._config=oh(i),this._scopeCache=new Map(),this._resolverCache=new Map();}get platform(){return this._config.platform;}get type(){return this._config.type;}set type(i){this._config.type=i;}get data(){return this._config.data;}set data(i){this._config.data=Za(i);}get options(){return this._config.options;}set options(i){this._config.options=i;}get plugins(){return this._config.plugins;}update(){let i=this._config;this.clearCache(),Xa(i);}clearCache(){this._scopeCache.clear(),this._resolverCache.clear();}datasetScopeKeys(i){return xi(i,()=>[[`datasets.${i}`,""]]);}datasetAnimationScopeKeys(i,t){return xi(`${i}.transition.${t}`,()=>[[`datasets.${i}.transitions.${t}`,`transitions.${t}`],[`datasets.${i}`,""]]);}datasetElementScopeKeys(i,t){return xi(`${i}-${t}`,()=>[[`datasets.${i}.elements.${t}`,`datasets.${i}`,`elements.${t}`,""]]);}pluginScopeKeys(i){let t=i.id,n=this.type;return xi(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...(i.additionalOptionScopes||[])]]);}_cachedScopes(i,t){let n=this._scopeCache,s=n.get(i);return(!s||t)&&(s=new Map(),n.set(i,s)),s;}getOptionScopes(i,t,n){let{options:s,type:o}=this,a=this._cachedScopes(i,n),r=a.get(t);if(r)return r;let l=new Set();t.forEach(h=>{i&&(l.add(i),h.forEach(d=>De(l,i,d))),h.forEach(d=>De(l,s,d)),h.forEach(d=>De(l,At[o]||{},d)),h.forEach(d=>De(l,B,d)),h.forEach(d=>De(l,hi,d));});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ka.has(t)&&a.set(t,c),c;}chartOptionScopes(){let{options:i,type:t}=this;return[i,At[t]||{},B.datasets[t]||{},{type:t},B,hi];}resolveNamedOptions(i,t,n,s=[""]){let o={$shared:true},{resolver:a,subPrefixes:r}=la(this._resolverCache,i,s),l=a;if(rh(a,t)){o.$shared=false,n=yt(n)?n():n;let c=this.createResolver(i,n,r);l=jt(a,n,c);}for(let c of t)o[c]=l[c];return o;}createResolver(i,t,n=[""],s){let{resolver:o}=la(this._resolverCache,i,n);return D(t)?jt(o,t,void 0,s):o;}};function la(e,i,t){let n=e.get(i);n||(n=new Map(),e.set(i,n));let s=t.join(),o=n.get(s);return o||(o={resolver:fi(i,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o;}var ah=e=>D(e)&&Object.getOwnPropertyNames(e).some(i=>yt(e[i]));function rh(e,i){let{isScriptable:t,isIndexable:n}=un(e);for(let s of i){let o=t(s),a=n(s),r=(a||o)&&e[s];if(o&&(yt(r)||ah(r))||a&&F(r))return true;}return false;}var lh="4.5.1",ch=["top","bottom","left","right","chartArea"];function ca(e,i){return e==="top"||e==="bottom"||ch.indexOf(e)===-1&&i==="x";}function ha(e,i){return function(t,n){return t[e]===n[e]?t[i]-n[i]:t[e]-n[e];};}function da(e){let i=e.chart,t=i.options.animation;i.notifyPlugins("afterRender"),I(t&&t.onComplete,[e],i);}function hh(e){let i=e.chart,t=i.options.animation;I(t&&t.onProgress,[e],i);}function qa(e){return gi()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e;}var Si={},ua=e=>{let i=qa(e);return Object.values(Si).filter(t=>t.canvas===i).pop();};function dh(e,i,t){let n=Object.keys(e);for(let s of n){let o=+s;if(o>=i){let a=e[s];delete e[s],(t>0||o>i)&&(e[o+t]=a);}}}function uh(e,i,t,n){return!t||e.type==="mouseout"?null:n?i:e;}var Ai=(()=>{class e{static defaults=B;static instances=Si;static overrides=At;static registry=mt;static version=lh;static getChart=ua;static register(...t){mt.add(...t),fa();}static unregister(...t){mt.remove(...t),fa();}constructor(t,n){let s=this.config=new jn(n),o=qa(t),a=ua(o);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");let r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Ec(o))(),this.platform.updateConfig(s);let l=this.platform.acquireContext(o,r.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;if(this.id=ho(),this.ctx=l,this.canvas=c,this.width=d,this.height=h,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 Nn(),this.$proxies={},this._hiddenIndices={},this.attached=false,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Mo(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],Si[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return;}St.listen(this,"complete",da),St.listen(this,"progress",hh),this._initialize(),this.attached&&this.update();}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:s,height:o,_aspectRatio:a}=this;return O(t)?n&&a?a:o?s/o:null:t;}get data(){return this.config.data;}set data(t){this.config.data=t;}get options(){return this._options;}set options(t){this.config.options=t;}get registry(){return mt;}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():mn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this;}clear(){return cn(this.canvas,this.ctx),this;}stop(){return St.stop(this),this;}resize(t,n){St.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n);}_resize(t,n){let s=this.options,o=this.canvas,a=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(o,t,n,a),l=s.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,mn(this,l,true)&&(this.notifyPlugins("resize",{size:r}),I(s.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render());}ensureScalesHaveIDs(){let n=this.options.scales||{};E(n,(s,o)=>{s.id=o;});}buildOrUpdateScales(){let t=this.options,n=t.scales,s=this.scales,o=Object.keys(s).reduce((r,l)=>(r[l]=false,r),{}),a=[];n&&(a=a.concat(Object.keys(n).map(r=>{let l=n[r],c=Wn(r,l),h=c==="r",d=c==="x";return{options:l,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"};}))),E(a,r=>{let l=r.options,c=l.id,h=Wn(c,l),d=k(l.type,r.dtype);(l.position===void 0||ca(l.position,h)!==ca(r.dposition))&&(l.position=r.dposition),o[c]=true;let u=null;if(c in s&&s[c].type===d)u=s[c];else{let f=mt.getScale(d);u=new f({id:c,type:d,ctx:this.ctx,chart:this}),s[u.id]=u;}u.init(l,t);}),E(o,(r,l)=>{r||delete s[l];}),E(s,r=>{J.configure(this,r,r.options),J.addBox(this,r);});}_updateMetasets(){let t=this._metasets,n=this.data.datasets.length,s=t.length;if(t.sort((o,a)=>o.index-a.index),s>n){for(let o=n;o<s;++o)this._destroyDatasetMeta(o);t.splice(n,s-n);}this._sortedMetasets=t.slice(0).sort(ha("order","index"));}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((s,o)=>{n.filter(a=>a===s._dataset).length===0&&this._destroyDatasetMeta(o);});}buildOrUpdateControllers(){let t=[],n=this.data.datasets,s,o;for(this._removeUnreferencedMetasets(),s=0,o=n.length;s<o;s++){let a=n[s],r=this.getDatasetMeta(s),l=a.type||this.config.type;if(r.type&&r.type!==l&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=l,r.indexAxis=a.indexAxis||Hn(l,this.options),r.order=a.order||0,r.index=s,r.label=""+a.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{let c=mt.getController(l),{datasetElementType:h,dataElementType:d}=B.datasets[l];Object.assign(c,{dataElementType:mt.getElement(d),datasetElementType:h&&mt.getElement(h)}),r.controller=new c(this,s),t.push(r.controller);}}return this._updateMetasets(),t;}_resetElements(){E(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset();},this);}reset(){this._resetElements(),this.notifyPlugins("reset");}update(t){let n=this.config;n.update();let s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:true})===false)return;let a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let h=0,d=this.data.datasets.length;h<d;h++){let{controller:u}=this.getDatasetMeta(h),f=!o&&a.indexOf(u)===-1;u.buildOrUpdateElements(f),r=Math.max(+u.getMaxOverflow(),r);}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),o||E(a,h=>{h.reset();}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ha("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,true):l.length&&this._updateHoverStyles(l,l,true),this.render();}_updateScales(){E(this.scales,t=>{J.removeBox(this,t);}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales();}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Ki(n,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents());}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:s,start:o,count:a}of n){let r=s==="_removeElements"?-a:a;dh(t,o,r);}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let n=this.data.datasets.length,s=a=>new Set(t.filter(r=>r[0]===a).map((r,l)=>l+","+r.splice(1).join(","))),o=s(0);for(let a=1;a<n;a++)if(!Ki(o,s(a)))return;return Array.from(o).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}));}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:true})===false)return;J.update(this,this.width,this.height,t);let n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],E(this.boxes,o=>{s&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()));},this),this._layers.forEach((o,a)=>{o._idx=a;}),this.notifyPlugins("afterLayout");}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:true})!==false){for(let n=0,s=this.data.datasets.length;n<s;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,s=this.data.datasets.length;n<s;++n)this._updateDataset(n,yt(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t});}}_updateDataset(t,n){let s=this.getDatasetMeta(t),o={meta:s,index:t,mode:n,cancelable:true};this.notifyPlugins("beforeDatasetUpdate",o)!==false&&(s.controller._update(n),o.cancelable=false,this.notifyPlugins("afterDatasetUpdate",o));}render(){this.notifyPlugins("beforeRender",{cancelable:true})!==false&&(St.has(this)?this.attached&&!St.running(this)&&St.start(this):(this.draw(),da({chart:this})));}draw(){let t;if(this._resizeBeforeDraw){let{width:s,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,o);}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:true})===false)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw");}_getSortedDatasetMetas(t){let n=this._sortedMetasets,s=[],o,a;for(o=0,a=n.length;o<a;++o){let r=n[o];(!t||r.visible)&&s.push(r);}return s;}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(true);}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:true})===false)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw");}_drawDataset(t){let n=this.ctx,s={meta:t,index:t.index,cancelable:true},o=Mn(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==false&&(o&&Se(n,o),t.controller.draw(),o&&we(n),s.cancelable=false,this.notifyPlugins("afterDatasetDraw",s));}isPointInArea(t){return ut(t,this.chartArea,this._minPadding);}getElementsAtEventForMode(t,n,s,o){let a=gc.modes[n];return typeof a=="function"?a(this,t,s,o):[];}getDatasetMeta(t){let n=this.data.datasets[t],s=this._metasets,o=s.filter(a=>a&&a._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:false},s.push(o)),o;}getContext(){return this.$context||(this.$context=Ct(null,{chart:this,type:"chart"}));}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length;}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return false;let s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden;}setDatasetVisibility(t,n){let s=this.getDatasetMeta(t);s.hidden=!n;}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t];}getDataVisibility(t){return!this._hiddenIndices[t];}_updateVisibility(t,n,s){let o=s?"show":"hide",a=this.getDatasetMeta(t),r=a.controller._resolveAnimations(void 0,o);ne(n)?(a.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(a,{visible:s}),this.update(l=>l.datasetIndex===t?o:void 0));}hide(t,n){this._updateVisibility(t,n,false);}show(t,n){this._updateVisibility(t,n,true);}_destroyDatasetMeta(t){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t];}_stop(){let t,n;for(this.stop(),St.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t);}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),cn(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Si[this.id],this.notifyPlugins("afterDestroy");}toBase64Image(...t){return this.canvas.toDataURL(...t);}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=true;}bindUserEvents(){let t=this._listeners,n=this.platform,s=(a,r)=>{n.addEventListener(this,a,r),t[a]=r;},o=(a,r,l)=>{a.offsetX=r,a.offsetY=l,this._eventHandler(a);};E(this.options.events,a=>s(a,o));}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,n=this.platform,s=(c,h)=>{n.addEventListener(this,c,h),t[c]=h;},o=(c,h)=>{t[c]&&(n.removeEventListener(this,c,h),delete t[c]);},a=(c,h)=>{this.canvas&&this.resize(c,h);},r,l=()=>{o("attach",l),this.attached=true,this.resize(),s("resize",a),s("detach",r);};r=()=>{this.attached=false,o("resize",a),this._stop(),this._resize(0,0),s("attach",l);},n.isAttached(this.canvas)?l():r();}unbindEvents(){E(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t);}),this._listeners={},E(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t);}),this._responsiveListeners=void 0;}updateHoverStyle(t,n,s){let o=s?"set":"remove",a,r,l,c;for(n==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+o+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){r=t[l];let h=r&&this.getDatasetMeta(r.datasetIndex).controller;h&&h[o+"HoverStyle"](r.element,r.datasetIndex,r.index);}}getActiveElements(){return this._active||[];}setActiveElements(t){let n=this._active||[],s=t.map(({datasetIndex:a,index:r})=>{let l=this.getDatasetMeta(a);if(!l)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:l.data[r],index:r};});!Me(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n));}notifyPlugins(t,n,s){return this._plugins.notify(this,t,n,s);}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1;}_updateHoverStyles(t,n,s){let o=this.options.hover,a=(c,h)=>c.filter(d=>!h.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),r=a(n,t),l=s?t:a(t,n);r.length&&this.updateHoverStyle(r,o.mode,false),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,true);}_eventHandler(t,n){let s={event:t,replay:n,cancelable:true,inChartArea:this.isPointInArea(t)},o=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,o)===false)return;let a=this._handleEvent(t,n,s.inChartArea);return s.cancelable=false,this.notifyPlugins("afterEvent",s,o),(a||s.changed)&&this.render(),this;}_handleEvent(t,n,s){let{_active:o=[],options:a}=this,r=n,l=this._getActiveElements(t,o,s,r),c=go(t),h=uh(t,this._lastEvent,s,c);s&&(this._lastEvent=null,I(a.onHover,[t,l,this],this),c&&I(a.onClick,[t,l,this],this));let d=!Me(l,o);return(d||n)&&(this._active=l,this._updateHoverStyles(l,o,n)),this._lastEvent=h,d;}_getActiveElements(t,n,s,o){if(t.type==="mouseout")return[];if(!s)return n;let a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,o);}}return e;})();function fa(){return E(Ai.instances,e=>e._plugins.invalidate());}function fh(e,i,t){let{startAngle:n,x:s,y:o,outerRadius:a,innerRadius:r,options:l}=i,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/a,X(n-t));if(e.beginPath(),e.arc(s,o,a-c/2,n+d/2,t-d/2),r>0){let u=Math.min(c/r,X(n-t));e.arc(s,o,r+c/2,t-u/2,n+u/2,true);}else{let u=Math.min(c/2,a*X(n-t));if(h==="round")e.arc(s,o,u,t-T/2,n+T/2,true);else if(h==="bevel"){let f=2*u*u,p=-f*Math.cos(t+T/2)+s,g=-f*Math.sin(t+T/2)+o,m=f*Math.cos(n+T/2)+s,b=f*Math.sin(n+T/2)+o;e.lineTo(p,g),e.lineTo(m,b);}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd");}function gh(e,i,t){let{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=i,c=s/r;e.beginPath(),e.arc(o,a,r,n-c,t+c),l>s?(c=s/l,e.arc(o,a,l,t+c,n-c,true)):e.arc(o,a,s,t+H,n-H),e.closePath(),e.clip();}function ph(e){return ui(e,["outerStart","outerEnd","innerStart","innerEnd"]);}function mh(e,i,t,n){let s=ph(e.options.borderRadius),o=(t-i)/2,a=Math.min(o,n*i/2),r=l=>{let c=(t-Math.min(o,l))*n/2;return $(l,0,Math.min(o,c));};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:$(s.innerStart,0,a),innerEnd:$(s.innerEnd,0,a)};}function ce(e,i,t,n){return{x:t+e*Math.cos(i),y:n+e*Math.sin(i)};}function Li(e,i,t,n,s,o){let{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=i,d=Math.max(i.outerRadius+n+t-c,0),u=h>0?h+n+t+c:0,f=0,p=s-l;if(n){let R=h>0?h-n:0,V=d>0?d-n:0,W=(R+V)/2,lt=W!==0?p*W/(W+n):p;f=(p-lt)/2;}let g=Math.max(.001,p*d-t/T)/d,m=(p-g)/2,b=l+m+f,_=s-m-f,{outerStart:y,outerEnd:M,innerStart:x,innerEnd:v}=mh(i,u,d,_-b),S=d-y,C=d-M,w=b+y/S,L=_-M/C,P=u+x,A=u+v,U=b+x/P,it=_-v/A;if(e.beginPath(),o){let R=(w+L)/2;if(e.arc(a,r,d,w,R),e.arc(a,r,d,R,L),M>0){let q=ce(C,L,a,r);e.arc(q.x,q.y,M,L,_+H);}let V=ce(A,_,a,r);if(e.lineTo(V.x,V.y),v>0){let q=ce(A,it,a,r);e.arc(q.x,q.y,v,_+H,it+Math.PI);}let W=(_-v/u+(b+x/u))/2;if(e.arc(a,r,u,_-v/u,W,true),e.arc(a,r,u,W,b+x/u,true),x>0){let q=ce(P,U,a,r);e.arc(q.x,q.y,x,U+Math.PI,b-H);}let lt=ce(S,b,a,r);if(e.lineTo(lt.x,lt.y),y>0){let q=ce(S,w,a,r);e.arc(q.x,q.y,y,b-H,w);}}else{e.moveTo(a,r);let R=Math.cos(w)*d+a,V=Math.sin(w)*d+r;e.lineTo(R,V);let W=Math.cos(L)*d+a,lt=Math.sin(L)*d+r;e.lineTo(W,lt);}e.closePath();}function bh(e,i,t,n,s){let{fullCircles:o,startAngle:a,circumference:r}=i,l=i.endAngle;if(o){Li(e,i,t,n,l,s);for(let c=0;c<o;++c)e.fill();isNaN(r)||(l=a+(r%z||z));}return Li(e,i,t,n,l,s),e.fill(),l;}function _h(e,i,t,n,s){let{fullCircles:o,startAngle:a,circumference:r,options:l}=i,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=u,p?(e.lineWidth=c*2,e.lineJoin=h||"round"):(e.lineWidth=c,e.lineJoin=h||"bevel");let g=i.endAngle;if(o){Li(e,i,t,n,g,s);for(let m=0;m<o;++m)e.stroke();isNaN(r)||(g=a+(r%z||z));}p&&gh(e,i,g),l.selfJoin&&g-a>=T&&f===0&&h!=="miter"&&fh(e,i,g),o||(Li(e,i,t,n,g,s),e.stroke());}var $n=class extends ht{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:true,selfJoin:false};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:true,_indexable:i=>i!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(i){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,i&&Object.assign(this,i);}inRange(i,t,n){let s=this.getProps(["x","y"],n),{angle:o,distance:a}=Qi(s,{x:i,y:t}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=(this.options.spacing+this.options.borderWidth)/2,f=k(d,l-r),p=oe(o,r,l)&&r!==l,g=f>=z||p,m=gt(a,c+u,h+u);return g&&m;}getCenterPoint(i){let{x:t,y:n,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:l,spacing:c}=this.options,h=(s+o)/2,d=(a+r+c+l)/2;return{x:t+Math.cos(h)*d,y:n+Math.sin(h)*d};}tooltipPosition(i){return this.getCenterPoint(i);}draw(i){let{options:t,circumference:n}=this,s=(t.offset||0)/4,o=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=n>z?Math.floor(n/z):0,n===0||this.innerRadius<0||this.outerRadius<0)return;i.save();let r=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(r)*s,Math.sin(r)*s);let l=1-Math.sin(Math.min(T,n||0)),c=s*l;i.fillStyle=t.backgroundColor,i.strokeStyle=t.borderColor,bh(i,this,c,o,a),_h(i,this,c,o,a),i.restore();}};function Ga(e,i,t=i){e.lineCap=k(t.borderCapStyle,i.borderCapStyle),e.setLineDash(k(t.borderDash,i.borderDash)),e.lineDashOffset=k(t.borderDashOffset,i.borderDashOffset),e.lineJoin=k(t.borderJoinStyle,i.borderJoinStyle),e.lineWidth=k(t.borderWidth,i.borderWidth),e.strokeStyle=k(t.borderColor,i.borderColor);}function xh(e,i,t){e.lineTo(t.x,t.y);}function yh(e){return e.stepped?ko:e.tension||e.cubicInterpolationMode==="monotone"?Po:xh;}function Ja(e,i,t={}){let n=e.length,{start:s=0,end:o=n-1}=t,{start:a,end:r}=i,l=Math.max(s,a),c=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:n,start:l,loop:i.loop,ilen:c<l&&!h?n+c-l:c-l};}function vh(e,i,t,n){let{points:s,options:o}=i,{count:a,start:r,loop:l,ilen:c}=Ja(s,t,n),h=yh(o),{move:d=true,reverse:u}=n||{},f,p,g;for(f=0;f<=c;++f)p=s[(r+(u?c-f:f))%a],!p.skip&&(d?(e.moveTo(p.x,p.y),d=false):h(e,g,p,u,o.stepped),g=p);return l&&(p=s[(r+(u?c:0))%a],h(e,g,p,u,o.stepped)),!!l;}function Mh(e,i,t,n){let s=i.points,{count:o,start:a,ilen:r}=Ja(s,t,n),{move:l=true,reverse:c}=n||{},h=0,d=0,u,f,p,g,m,b,_=M=>(a+(c?r-M:M))%o,y=()=>{g!==m&&(e.lineTo(h,m),e.lineTo(h,g),e.lineTo(h,b));};for(l&&(f=s[_(0)],e.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=s[_(u)],f.skip)continue;let M=f.x,x=f.y,v=M|0;v===p?(x<g?g=x:x>m&&(m=x),h=(d*h+M)/++d):(y(),e.lineTo(M,x),p=v,d=0,g=m=x),b=x;}y();}function Yn(e){let i=e.options,t=i.borderDash&&i.borderDash.length;return!e._decimated&&!e._loop&&!i.tension&&i.cubicInterpolationMode!=="monotone"&&!i.stepped&&!t?Mh:vh;}function Ch(e){return e.stepped?Fo:e.tension||e.cubicInterpolationMode==="monotone"?zo:Ot;}function Sh(e,i,t,n){let s=i._path;s||(s=i._path=new Path2D(),i.path(s,t,n)&&s.closePath()),Ga(e,i.options),e.stroke(s);}function wh(e,i,t,n){let{segments:s,options:o}=i,a=Yn(i);for(let r of s)Ga(e,o,r.style),e.beginPath(),a(e,i,r,{start:t,end:t+n-1})&&e.closePath(),e.stroke();}var kh=typeof Path2D=="function";function Ph(e,i,t,n){kh&&!i.options.segment?Sh(e,i,t,n):wh(e,i,t,n);}var Ti=(()=>{class e extends ht{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:true,cubicInterpolationMode:"default",fill:false,spanGaps:false,stepped:false,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:true,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=true,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=false,this._pointsUpdated=false,this._datasetIndex=void 0,t&&Object.assign(this,t);}updateControlPoints(t,n){let s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){let o=s.spanGaps?this._loop:this._fullLoop;Eo(this._points,s,t,o,n),this._pointsUpdated=true;}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=false;}get points(){return this._points;}get segments(){return this._segments||(this._segments=Vo(this,this.options.segment));}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start];}last(){let t=this.segments,n=this.points,s=t.length;return s&&n[t[s-1].end];}interpolate(t,n){let s=this.options,o=t[n],a=this.points,r=vn(this,{property:n,start:o,end:o});if(!r.length)return;let l=[],c=Ch(s),h,d;for(h=0,d=r.length;h<d;++h){let{start:u,end:f}=r[h],p=a[u],g=a[f];if(p===g){l.push(p);continue;}let m=Math.abs((o-p[n])/(g[n]-p[n])),b=c(p,g,m,s.stepped);b[n]=t[n],l.push(b);}return l.length===1?l[0]:l;}pathSegment(t,n,s){return Yn(this)(t,this,n,s);}path(t,n,s){let o=this.segments,a=Yn(this),r=this._loop;n=n||0,s=s||this.points.length-n;for(let l of o)r&=a(t,this,l,{start:n,end:n+s-1});return!!r;}draw(t,n,s,o){let a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),Ph(t,this,s,o),t.restore()),this.animated&&(this._pointsUpdated=false,this._path=void 0);}}return e;})();function ga(e,i,t,n){let s=e.options,{[t]:o}=e.getProps([t],n);return Math.abs(i-o)<s.radius+s.hitRadius;}var Lh=(()=>{class e extends ht{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t);}inRange(t,n,s){let o=this.options,{x:a,y:r}=this.getProps(["x","y"],s);return Math.pow(t-a,2)+Math.pow(n-r,2)<Math.pow(o.hitRadius+o.radius,2);}inXRange(t,n){return ga(this,t,"x",n);}inYRange(t,n){return ga(this,t,"y",n);}getCenterPoint(t){let{x:n,y:s}=this.getProps(["x","y"],t);return{x:n,y:s};}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);let s=n&&t.borderWidth||0;return(n+s)*2;}draw(t,n){let s=this.options;this.skip||s.radius<.1||!ut(this,n,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,di(t,s,this.x,this.y));}getRange(){let t=this.options||{};return t.radius+t.hitRadius;}}return e;})();function Qa(e,i){let{x:t,y:n,base:s,width:o,height:a}=e.getProps(["x","y","base","width","height"],i),r,l,c,h,d;return e.horizontal?(d=a/2,r=Math.min(t,s),l=Math.max(t,s),c=n-d,h=n+d):(d=o/2,r=t-d,l=t+d,c=Math.min(n,s),h=Math.max(n,s)),{left:r,top:c,right:l,bottom:h};}function Ft(e,i,t,n){return e?0:$(i,t,n);}function Oh(e,i,t){let n=e.options.borderWidth,s=e.borderSkipped,o=dn(n);return{t:Ft(s.top,o.top,0,t),r:Ft(s.right,o.right,0,i),b:Ft(s.bottom,o.bottom,0,t),l:Ft(s.left,o.left,0,i)};}function Dh(e,i,t){let{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Rt(s),a=Math.min(i,t),r=e.borderSkipped,l=n||D(s);return{topLeft:Ft(!l||r.top||r.left,o.topLeft,0,a),topRight:Ft(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Ft(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Ft(!l||r.bottom||r.right,o.bottomRight,0,a)};}function Ah(e){let i=Qa(e),t=i.right-i.left,n=i.bottom-i.top,s=Oh(e,t/2,n/2),o=Dh(e,t/2,n/2);return{outer:{x:i.left,y:i.top,w:t,h:n,radius:o},inner:{x:i.left+s.l,y:i.top+s.t,w:t-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}};}function Dn(e,i,t,n){let s=i===null,o=t===null,r=e&&!(s&&o)&&Qa(e,n);return r&&(s||gt(i,r.left,r.right))&&(o||gt(t,r.top,r.bottom));}function Th(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight;}function Eh(e,i){e.rect(i.x,i.y,i.w,i.h);}function An(e,i,t={}){let n=e.x!==t.x?-i:0,s=e.y!==t.y?-i:0,o=(e.x+e.w!==t.x+t.w?i:0)-n,a=(e.y+e.h!==t.y+t.h?i:0)-s;return{x:e.x+n,y:e.y+s,w:e.w+o,h:e.h+a,radius:e.radius};}var Un=class extends ht{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(i){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,i&&Object.assign(this,i);}draw(i){let{inflateAmount:t,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:a}=Ah(this),r=Th(a.radius)?re:Eh;i.save(),(a.w!==o.w||a.h!==o.h)&&(i.beginPath(),r(i,An(a,t,o)),i.clip(),r(i,An(o,-t,a)),i.fillStyle=n,i.fill("evenodd")),i.beginPath(),r(i,An(o,t)),i.fillStyle=s,i.fill(),i.restore();}inRange(i,t,n){return Dn(this,i,t,n);}inXRange(i,t){return Dn(this,i,null,t);}inYRange(i,t){return Dn(this,null,i,t);}getCenterPoint(i){let{x:t,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],i);return{x:o?(t+s)/2:t,y:o?n:(n+s)/2};}getRange(i){return i==="x"?this.width/2:this.height/2;}},Rh=Object.freeze({__proto__:null,ArcElement:$n,BarElement:Un,LineElement:Ti,PointElement:Lh}),Xn=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],pa=Xn.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function tr(e){return Xn[e%Xn.length];}function er(e){return pa[e%pa.length];}function Ih(e,i){return e.borderColor=tr(i),e.backgroundColor=er(i),++i;}function Fh(e,i){return e.backgroundColor=e.data.map(()=>tr(i++)),i;}function zh(e,i){return e.backgroundColor=e.data.map(()=>er(i++)),i;}function Bh(e){let i=0;return(t,n)=>{let s=e.getDatasetMeta(n).controller;s instanceof es?i=Fh(t,i):s instanceof Wa?i=zh(t,i):s&&(i=Ih(t,i));};}function ma(e){let i;for(i in e)if(e[i].borderColor||e[i].backgroundColor)return true;return false;}function Vh(e){return e&&(e.borderColor||e.backgroundColor);}function Nh(){return B.borderColor!=="rgba(0,0,0,0.1)"||B.backgroundColor!=="rgba(0,0,0,0.1)";}var Hh={id:"colors",defaults:{enabled:true,forceOverride:false},beforeLayout(e,i,t){if(!t.enabled)return;let{data:{datasets:n},options:s}=e.config,{elements:o}=s,a=ma(n)||Vh(s)||o&&ma(o)||Nh();if(!t.forceOverride&&a)return;let r=Bh(e);n.forEach(r);}};function Wh(e,i,t,n,s){let o=s.samples||n;if(o>=t)return e.slice(i,i+t);let a=[],r=(t-2)/(o-2),l=0,c=i+t-1,h=i,d,u,f,p,g;for(a[l++]=e[h],d=0;d<o-2;d++){let m=0,b=0,_,y=Math.floor((d+1)*r)+1+i,M=Math.min(Math.floor((d+2)*r)+1,t)+i,x=M-y;for(_=y;_<M;_++)m+=e[_].x,b+=e[_].y;m/=x,b/=x;let v=Math.floor(d*r)+1+i,S=Math.min(Math.floor((d+1)*r)+1,t)+i,{x:C,y:w}=e[h];for(f=p=-1,_=v;_<S;_++)p=.5*Math.abs((C-m)*(e[_].y-w)-(C-e[_].x)*(b-w)),p>f&&(f=p,u=e[_],g=_);a[l++]=u,h=g;}return a[l++]=e[c],a;}function jh(e,i,t,n){let s=0,o=0,a,r,l,c,h,d,u,f,p,g,m=[],b=i+t-1,_=e[i].x,M=e[b].x-_;for(a=i;a<i+t;++a){r=e[a],l=(r.x-_)/M*n,c=r.y;let x=l|0;if(x===h)c<p?(p=c,d=a):c>g&&(g=c,u=a),s=(o*s+r.x)/++o;else{let v=a-1;if(!O(d)&&!O(u)){let S=Math.min(d,u),C=Math.max(d,u);S!==f&&S!==v&&m.push(E$1(D$2({},e[S]),{x:s})),C!==f&&C!==v&&m.push(E$1(D$2({},e[C]),{x:s}));}a>0&&v!==f&&m.push(e[v]),m.push(r),h=x,o=0,p=g=c,d=u=f=a;}}return m;}function ir(e){if(e._decimated){let i=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:true,enumerable:true,writable:true,value:i});}}function ba(e){e.data.datasets.forEach(i=>{ir(i);});}function $h(e,i){let t=i.length,n=0,s,{iScale:o}=e,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=$(dt(i,o.axis,a).lo,0,t-1)),c?s=$(dt(i,o.axis,r).hi+1,n,t)-n:s=t-n,{start:n,count:s};}var Yh={id:"decimation",defaults:{algorithm:"min-max",enabled:false},beforeElementsUpdate:(e,i,t)=>{if(!t.enabled){ba(e);return;}let n=e.width;e.data.datasets.forEach((s,o)=>{let{_data:a,indexAxis:r}=s,l=e.getDatasetMeta(o),c=a||s.data;if(le([r,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=e.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||e.options.parsing)return;let{start:d,count:u}=$h(l,c),f=t.threshold||4*n;if(u<=f){ir(s);return;}O(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:true,enumerable:true,get:function(){return this._decimated;},set:function(g){this._data=g;}}));let p;switch(t.algorithm){case"lttb":p=Wh(c,d,u,n,t);break;case"min-max":p=jh(c,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`);}s._decimated=p;});},destroy(e){ba(e);}};function Uh(e,i,t){let n=e.segments,s=e.points,o=i.points,a=[];for(let r of n){let{start:l,end:c}=r;c=Ei(l,c,s);let h=Zn(t,s[l],s[c],r.loop);if(!i.segments){a.push({source:r,target:h,start:s[l],end:s[c]});continue;}let d=vn(i,h);for(let u of d){let f=Zn(t,o[u.start],o[u.end],u.loop),p=yn(r,s,f);for(let g of p)a.push({source:g,target:u,start:{[t]:_a(h,f,"start",Math.max)},end:{[t]:_a(h,f,"end",Math.min)}});}}return a;}function Zn(e,i,t,n){if(n)return;let s=i[e],o=t[e];return e==="angle"&&(s=X(s),o=X(o)),{property:e,start:s,end:o};}function Xh(e,i){let{x:t=null,y:n=null}=e||{},s=i.points,o=[];return i.segments.forEach(({start:a,end:r})=>{r=Ei(a,r,s);let l=s[a],c=s[r];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):t!==null&&(o.push({x:t,y:l.y}),o.push({x:t,y:c.y}));}),o;}function Ei(e,i,t){for(;i>e;i--){let n=t[i];if(!isNaN(n.x)&&!isNaN(n.y))break;}return i;}function _a(e,i,t,n){return e&&i?n(e[t],i[t]):e?e[t]:i?i[t]:0;}function nr(e,i){let t=[],n=false;return F(e)?(n=true,t=e):t=Xh(e,i),t.length?new Ti({points:t,options:{tension:0},_loop:n,_fullLoop:n}):null;}function xa(e){return e&&e.fill!==false;}function Zh(e,i,t){let s=e[i].fill,o=[i],a;if(!t)return s;for(;s!==false&&o.indexOf(s)===-1;){if(!N(s))return s;if(a=e[s],!a)return false;if(a.visible)return s;o.push(s),s=a.fill;}return false;}function Kh(e,i,t){let n=Qh(e);if(D(n))return isNaN(n.value)?false:n;let s=parseFloat(n);return N(s)&&Math.floor(s)===s?qh(n[0],i,s,t):["origin","start","end","stack","shape"].indexOf(n)>=0&&n;}function qh(e,i,t,n){return(e==="-"||e==="+")&&(t=i+t),t===i||t<0||t>=n?false:t;}function Gh(e,i){let t=null;return e==="start"?t=i.bottom:e==="end"?t=i.top:D(e)?t=i.getPixelForValue(e.value):i.getBasePixel&&(t=i.getBasePixel()),t;}function Jh(e,i,t){let n;return e==="start"?n=t:e==="end"?n=i.options.reverse?i.min:i.max:D(e)?n=e.value:n=i.getBaseValue(),n;}function Qh(e){let i=e.options,t=i.fill,n=k(t&&t.target,t);return n===void 0&&(n=!!i.backgroundColor),n===false||n===null?false:n===true?"origin":n;}function td(e){let{scale:i,index:t,line:n}=e,s=[],o=n.segments,a=n.points,r=ed(i,t);r.push(nr({x:null,y:i.bottom},n));for(let l=0;l<o.length;l++){let c=o[l];for(let h=c.start;h<=c.end;h++)id(s,a[h],r);}return new Ti({points:s,options:{}});}function ed(e,i){let t=[],n=e.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){let o=n[s];if(o.index===i)break;o.hidden||t.unshift(o.dataset);}return t;}function id(e,i,t){let n=[];for(let s=0;s<t.length;s++){let o=t[s],{first:a,last:r,point:l}=nd(o,i,"x");if(!(!l||a&&r)){if(a)n.unshift(l);else if(e.push(l),!r)break;}}e.push(...n);}function nd(e,i,t){let n=e.interpolate(i,t);if(!n)return{};let s=n[t],o=e.segments,a=e.points,r=false,l=false;for(let c=0;c<o.length;c++){let h=o[c],d=a[h.start][t],u=a[h.end][t];if(gt(s,d,u)){r=s===d,l=s===u;break;}}return{first:r,last:l,point:n};}var Oi=class{constructor(i){this.x=i.x,this.y=i.y,this.radius=i.radius;}pathSegment(i,t,n){let{x:s,y:o,radius:a}=this;return t=t||{start:0,end:z},i.arc(s,o,a,t.end,t.start,true),!n.bounds;}interpolate(i){let{x:t,y:n,radius:s}=this,o=i.angle;return{x:t+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o};}};function sd(e){let{chart:i,fill:t,line:n}=e;if(N(t))return od(i,t);if(t==="stack")return td(e);if(t==="shape")return true;let s=ad(e);return s instanceof Oi?s:nr(s,n);}function od(e,i){let t=e.getDatasetMeta(i);return t&&e.isDatasetVisible(i)?t.dataset:null;}function ad(e){return(e.scale||{}).getPointPositionForValue?ld(e):rd(e);}function rd(e){let{scale:i={},fill:t}=e,n=Gh(t,i);if(N(n)){let s=i.isHorizontal();return{x:s?n:null,y:s?null:n};}return null;}function ld(e){let{scale:i,fill:t}=e,n=i.options,s=i.getLabels().length,o=n.reverse?i.max:i.min,a=Jh(t,i,o),r=[];if(n.grid.circular){let l=i.getPointPositionForValue(0,o);return new Oi({x:l.x,y:l.y,radius:i.getDistanceFromCenterForValue(a)});}for(let l=0;l<s;++l)r.push(i.getPointPositionForValue(l,a));return r;}function Tn(e,i,t){let n=sd(i),{chart:s,index:o,line:a,scale:r,axis:l}=i,c=a.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},p=s.getDatasetMeta(o),g=Mn(s,p);n&&a.points.length&&(Se(e,t),cd(e,{line:a,target:n,above:u,below:f,area:t,scale:r,axis:l,clip:g}),we(e));}function cd(e,i){let{line:t,target:n,above:s,below:o,area:a,scale:r,clip:l}=i,c=t._loop?"angle":i.axis;e.save();let h=o;o!==s&&(c==="x"?(ya(e,n,a.top),En(e,{line:t,target:n,color:s,scale:r,property:c,clip:l}),e.restore(),e.save(),ya(e,n,a.bottom)):c==="y"&&(va(e,n,a.left),En(e,{line:t,target:n,color:o,scale:r,property:c,clip:l}),e.restore(),e.save(),va(e,n,a.right),h=s)),En(e,{line:t,target:n,color:h,scale:r,property:c,clip:l}),e.restore();}function ya(e,i,t){let{segments:n,points:s}=i,o=true,a=false;e.beginPath();for(let r of n){let{start:l,end:c}=r,h=s[l],d=s[Ei(l,c,s)];o?(e.moveTo(h.x,h.y),o=false):(e.lineTo(h.x,t),e.lineTo(h.x,h.y)),a=!!i.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(d.x,t);}e.lineTo(i.first().x,t),e.closePath(),e.clip();}function va(e,i,t){let{segments:n,points:s}=i,o=true,a=false;e.beginPath();for(let r of n){let{start:l,end:c}=r,h=s[l],d=s[Ei(l,c,s)];o?(e.moveTo(h.x,h.y),o=false):(e.lineTo(t,h.y),e.lineTo(h.x,h.y)),a=!!i.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(t,d.y);}e.lineTo(t,i.first().y),e.closePath(),e.clip();}function En(e,i){let{line:t,target:n,property:s,color:o,scale:a,clip:r}=i,l=Uh(t,n,s);for(let{source:c,target:h,start:d,end:u}of l){let{style:{backgroundColor:f=o}={}}=c,p=n!==true;e.save(),e.fillStyle=f,hd(e,a,r,p&&Zn(s,d,u)),e.beginPath();let g=!!t.pathSegment(e,c),m;if(p){g?e.closePath():Ma(e,n,u,s);let b=!!n.pathSegment(e,h,{move:g,reverse:true});m=g&&b,m||Ma(e,n,d,s);}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore();}}function hd(e,i,t,n){let s=i.chart.chartArea,{property:o,start:a,end:r}=n||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=a,c=s.top,h=r,d=s.bottom):(l=s.left,c=a,h=s.right,d=r),e.beginPath(),t&&(l=Math.max(l,t.left),h=Math.min(h,t.right),c=Math.max(c,t.top),d=Math.min(d,t.bottom)),e.rect(l,c,h-l,d-c),e.clip();}}function Ma(e,i,t,n){let s=i.interpolate(t,n);s&&e.lineTo(s.x,s.y);}var dd={id:"filler",afterDatasetsUpdate(e,i,t){let n=(e.data.datasets||[]).length,s=[],o,a,r,l;for(a=0;a<n;++a)o=e.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Ti&&(l={visible:e.isDatasetVisible(a),index:a,fill:Kh(r,a,n),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<n;++a)l=s[a],!(!l||l.fill===false)&&(l.fill=Zh(s,a,t.propagate));},beforeDraw(e,i,t){let n=t.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let a=s.length-1;a>=0;--a){let r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),n&&r.fill&&Tn(e.ctx,r,o));}},beforeDatasetsDraw(e,i,t){if(t.drawTime!=="beforeDatasetsDraw")return;let n=e.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){let o=n[s].$filler;xa(o)&&Tn(e.ctx,o,e.chartArea);}},beforeDatasetDraw(e,i,t){let n=i.meta.$filler;!xa(n)||t.drawTime!=="beforeDatasetDraw"||Tn(e.ctx,n,e.chartArea);},defaults:{propagate:true,drawTime:"beforeDatasetDraw"}},Ca=(e,i)=>{let{boxHeight:t=i,boxWidth:n=i}=e;return e.usePointStyle&&(t=Math.min(t,i),n=e.pointStyleWidth||Math.min(n,i)),{boxWidth:n,boxHeight:t,itemHeight:Math.max(i,t)};},ud=(e,i)=>e!==null&&i!==null&&e.datasetIndex===i.datasetIndex&&e.index===i.index,Di=class extends ht{constructor(i){super(),this._added=false,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=false,this.chart=i.chart,this.options=i.options,this.ctx=i.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(i,t,n){this.maxWidth=i,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit();}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height);}buildLabels(){let i=this.options.labels||{},t=I(i.generateLabels,[this.chart],this)||[];i.filter&&(t=t.filter(n=>i.filter(n,this.chart.data))),i.sort&&(t=t.sort((n,s)=>i.sort(n,s,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t;}fit(){let{options:i,ctx:t}=this;if(!i.display){this.width=this.height=0;return;}let n=i.labels,s=j(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Ca(n,o),c,h;t.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,i.maxWidth||this.maxWidth),this.height=Math.min(h,i.maxHeight||this.maxHeight);}_fitRows(i,t,n,s){let{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+r,d=i;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,g)=>{let m=n+t/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*r>a)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:s},c[c.length-1]+=m+r;}),d;}_fitCols(i,t,n,s){let{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-i,d=r,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:_,itemHeight:y}=fd(n,t,o,m,s);b>0&&f+y+2*r>h&&(d+=u+r,c.push({width:u,height:f}),p+=u+r,g++,u=f=0),l[b]={left:p,top:f,col:g,width:_,height:y},u=Math.max(u,_),f+=y+r;}),d+=u,c.push({width:u,height:f}),d;}adjustHitBoxes(){if(!this.options.display)return;let i=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:s},rtl:o}}=this,a=Yt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=Z(n,this.left+s,this.right-this.lineWidths[r]);for(let c of t)r!==c.row&&(r=c.row,l=Z(n,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+i+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s;}else{let r=0,l=Z(n,this.top+i+s,this.bottom-this.columnSizes[r].height);for(let c of t)c.col!==r&&(r=c.col,l=Z(n,this.top+i+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s;}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom";}draw(){if(this.options.display){let i=this.ctx;Se(i,this),this._draw(),we(i);}}_draw(){let{options:i,columnSizes:t,lineWidths:n,ctx:s}=this,{align:o,labels:a}=i,r=B.color,l=Yt(i.rtl,this.left,this.width),c=j(a.font),{padding:h}=a,d=c.size,u=d/2,f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:p,boxHeight:g,itemHeight:m}=Ca(a,d),b=function(v,S,C){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();let w=k(C.lineWidth,1);if(s.fillStyle=k(C.fillStyle,r),s.lineCap=k(C.lineCap,"butt"),s.lineDashOffset=k(C.lineDashOffset,0),s.lineJoin=k(C.lineJoin,"miter"),s.lineWidth=w,s.strokeStyle=k(C.strokeStyle,r),s.setLineDash(k(C.lineDash,[])),a.usePointStyle){let L={radius:g*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:w},P=l.xPlus(v,p/2),A=S+u;hn(s,L,P,A,a.pointStyleWidth&&p);}else{let L=S+Math.max((d-g)/2,0),P=l.leftForLtr(v,p),A=Rt(C.borderRadius);s.beginPath(),Object.values(A).some(U=>U!==0)?re(s,{x:P,y:L,w:p,h:g,radius:A}):s.rect(P,L,p,g),s.fill(),w!==0&&s.stroke();}s.restore();},_=function(v,S,C){Et(s,C.text,v,S+m/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)});},y=this.isHorizontal(),M=this._computeTitleHeight();y?f={x:Z(o,this.left+h,this.right-n[0]),y:this.top+h+M,line:0}:f={x:this.left+h,y:Z(o,this.top+M+h,this.bottom-t[0].height),line:0},_n(this.ctx,i.textDirection);let x=m+h;this.legendItems.forEach((v,S)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;let C=s.measureText(v.text).width,w=l.textAlign(v.textAlign||(v.textAlign=a.textAlign)),L=p+u+C,P=f.x,A=f.y;l.setWidth(this.width),y?S>0&&P+L+h>this.right&&(A=f.y+=x,f.line++,P=f.x=Z(o,this.left+h,this.right-n[f.line])):S>0&&A+x>this.bottom&&(P=f.x=P+t[f.line].width+h,f.line++,A=f.y=Z(o,this.top+M+h,this.bottom-t[f.line].height));let U=l.x(P);if(b(U,A,v),P=Co(w,P+p+u,y?P+L:this.right,i.rtl),_(l.x(P),A,v),y)f.x+=L+h;else if(typeof v.text!="string"){let it=c.lineHeight;f.y+=sr(v,it)+h;}else f.y+=x;}),xn(this.ctx,i.textDirection);}drawTitle(){let i=this.options,t=i.title,n=j(t.font),s=K(t.padding);if(!t.display)return;let o=Yt(i.rtl,this.left,this.width),a=this.ctx,r=t.position,l=n.size/2,c=s.top+l,h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=Z(i.align,d,this.right-u);else{let p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+Z(i.align,this.top,this.bottom-p-i.labels.padding-this._computeTitleHeight());}let f=Z(r,d,d+u);a.textAlign=o.textAlign(ci(r)),a.textBaseline="middle",a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,Et(a,t.text,f,h,n);}_computeTitleHeight(){let i=this.options.title,t=j(i.font),n=K(i.padding);return i.display?t.lineHeight+n.height:0;}_getLegendItemAt(i,t){let n,s,o;if(gt(i,this.left,this.right)&&gt(t,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],gt(i,s.left,s.left+s.width)&&gt(t,s.top,s.top+s.height))return this.legendItems[n];}return null;}handleEvent(i){let t=this.options;if(!md(i.type,t))return;let n=this._getLegendItemAt(i.x,i.y);if(i.type==="mousemove"||i.type==="mouseout"){let s=this._hoveredItem,o=ud(s,n);s&&!o&&I(t.onLeave,[i,s,this],this),this._hoveredItem=n,n&&!o&&I(t.onHover,[i,n,this],this);}else n&&I(t.onClick,[i,n,this],this);}};function fd(e,i,t,n,s){let o=gd(n,e,i,t),a=pd(s,n,i.lineHeight);return{itemWidth:o,itemHeight:a};}function gd(e,i,t,n){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),i+t.size/2+n.measureText(s).width;}function pd(e,i,t){let n=e;return typeof i.text!="string"&&(n=sr(i,t)),n;}function sr(e,i){let t=e.text?e.text.length:0;return i*t;}function md(e,i){return!!((e==="mousemove"||e==="mouseout")&&(i.onHover||i.onLeave)||i.onClick&&(e==="click"||e==="mouseup"));}var bd={id:"legend",_element:Di,start(e,i,t){let n=e.legend=new Di({ctx:e.ctx,options:t,chart:e});J.configure(e,n,t),J.addBox(e,n);},stop(e){J.removeBox(e,e.legend),delete e.legend;},beforeUpdate(e,i,t){let n=e.legend;J.configure(e,n,t),n.options=t;},afterUpdate(e){let i=e.legend;i.buildLabels(),i.adjustHitBoxes();},afterEvent(e,i){i.replay||e.legend.handleEvent(i.event);},defaults:{display:true,position:"top",align:"center",fullSize:true,reverse:false,weight:1e3,onClick(e,i,t){let n=i.datasetIndex,s=t.chart;s.isDatasetVisible(n)?(s.hide(n),i.hidden=true):(s.show(n),i.hidden=false);},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let i=e.data.datasets,{labels:{usePointStyle:t,pointStyle:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(t?0:void 0),h=K(c.borderWidth);return{text:i[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index};},this);}},title:{color:e=>e.chart.options.color,display:false,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Re=class extends ht{constructor(i){super(),this.chart=i.chart,this.options=i.options,this.ctx=i.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(i,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return;}this.width=this.right=i,this.height=this.bottom=t;let s=F(n.text)?n.text.length:1;this._padding=K(n.padding);let o=s*j(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o;}isHorizontal(){let i=this.options.position;return i==="top"||i==="bottom";}_drawArgs(i){let{top:t,left:n,bottom:s,right:o,options:a}=this,r=a.align,l=0,c,h,d;return this.isHorizontal()?(h=Z(r,n,o),d=t+i,c=o-n):(a.position==="left"?(h=n+i,d=Z(r,s,t),l=T*-0.5):(h=o-i,d=Z(r,t,s),l=T*.5),c=s-t),{titleX:h,titleY:d,maxWidth:c,rotation:l};}draw(){let i=this.ctx,t=this.options;if(!t.display)return;let n=j(t.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Et(i,t.text,0,0,n,{color:t.color,maxWidth:l,rotation:c,textAlign:ci(t.align),textBaseline:"middle",translation:[a,r]});}};function _d(e,i){let t=new Re({ctx:e.ctx,options:i,chart:e});J.configure(e,t,i),J.addBox(e,t),e.titleBlock=t;}var xd={id:"title",_element:Re,start(e,i,t){_d(e,t);},stop(e){let i=e.titleBlock;J.removeBox(e,i),delete e.titleBlock;},beforeUpdate(e,i,t){let n=e.titleBlock;J.configure(e,n,t),n.options=t;},defaults:{align:"center",display:false,font:{weight:"bold"},fullSize:true,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:true,_indexable:false}},yi=new WeakMap(),yd={id:"subtitle",start(e,i,t){let n=new Re({ctx:e.ctx,options:t,chart:e});J.configure(e,n,t),J.addBox(e,n),yi.set(e,n);},stop(e){J.removeBox(e,yi.get(e)),yi.delete(e);},beforeUpdate(e,i,t){let n=yi.get(e);J.configure(e,n,t),n.options=t;},defaults:{align:"center",display:false,font:{weight:"normal"},fullSize:true,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:true,_indexable:false}},Te={average(e){if(!e.length)return false;let i,t,n=new Set(),s=0,o=0;for(i=0,t=e.length;i<t;++i){let r=e[i].element;if(r&&r.hasValue()){let l=r.tooltipPosition();n.add(l.x),s+=l.y,++o;}}return o===0||n.size===0?false:{x:[...n].reduce((r,l)=>r+l)/n.size,y:s/o};},nearest(e,i){if(!e.length)return false;let t=i.x,n=i.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=e.length;o<a;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=si(i,c);h<s&&(s=h,r=l);}}if(r){let l=r.tooltipPosition();t=l.x,n=l.y;}return{x:t,y:n};}};function pt(e,i){return i&&(F(i)?Array.prototype.push.apply(e,i):e.push(i)),e;}function wt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
`)>-1?e.split(`
`):e;}function vd(e,i){let{element:t,datasetIndex:n,index:s}=i,o=e.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:e,label:a,parsed:o.getParsed(s),raw:e.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:t};}function Sa(e,i){let t=e.chart.ctx,{body:n,footer:s,title:o}=e,{boxWidth:a,boxHeight:r}=i,l=j(i.bodyFont),c=j(i.titleFont),h=j(i.footerFont),d=o.length,u=s.length,f=n.length,p=K(i.padding),g=p.height,m=0,b=n.reduce((M,x)=>M+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*i.titleSpacing+i.titleMarginBottom),b){let M=i.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=f*M+(b-f)*l.lineHeight+(b-1)*i.bodySpacing;}u&&(g+=i.footerMarginTop+u*h.lineHeight+(u-1)*i.footerSpacing);let _=0,y=function(M){m=Math.max(m,t.measureText(M).width+_);};return t.save(),t.font=c.string,E(e.title,y),t.font=l.string,E(e.beforeBody.concat(e.afterBody),y),_=i.displayColors?a+2+i.boxPadding:0,E(n,M=>{E(M.before,y),E(M.lines,y),E(M.after,y);}),_=0,t.font=h.string,E(e.footer,y),t.restore(),m+=p.width,{width:m,height:g};}function Md(e,i){let{y:t,height:n}=i;return t<n/2?"top":t>e.height-n/2?"bottom":"center";}function Cd(e,i,t,n){let{x:s,width:o}=n,a=t.caretSize+t.caretPadding;if(e==="left"&&s+o+a>i.width||e==="right"&&s-o-a<0)return true;}function Sd(e,i,t,n){let{x:s,width:o}=t,{width:a,chartArea:{left:r,right:l}}=e,c="center";return n==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),Cd(c,e,i,t)&&(c="center"),c;}function wa(e,i,t){let n=t.yAlign||i.yAlign||Md(e,t);return{xAlign:t.xAlign||i.xAlign||Sd(e,i,t,n),yAlign:n};}function wd(e,i){let{x:t,width:n}=e;return i==="right"?t-=n:i==="center"&&(t-=n/2),t;}function kd(e,i,t){let{y:n,height:s}=e;return i==="top"?n+=t:i==="bottom"?n-=s+t:n-=s/2,n;}function ka(e,i,t,n){let{caretSize:s,caretPadding:o,cornerRadius:a}=e,{xAlign:r,yAlign:l}=t,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Rt(a),p=wd(i,r),g=kd(i,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(h,u)+s:r==="right"&&(p+=Math.max(d,f)+s),{x:$(p,0,n.width-i.width),y:$(g,0,n.height-i.height)};}function vi(e,i,t){let n=K(t.padding);return i==="center"?e.x+e.width/2:i==="right"?e.x+e.width-n.right:e.x+n.left;}function Pa(e){return pt([],wt(e));}function Pd(e,i,t){return Ct(e,{tooltip:i,tooltipItems:t,type:"tooltip"});}function La(e,i){let t=i&&i.dataset&&i.dataset.tooltip&&i.dataset.tooltip.callbacks;return t?e.override(t):e;}var or={beforeTitle:ft,title(e){if(e.length>0){let i=e[0],t=i.chart.data.labels,n=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return i.dataset.label||"";if(i.label)return i.label;if(n>0&&i.dataIndex<n)return t[i.dataIndex];}return"";},afterTitle:ft,beforeBody:ft,beforeLabel:ft,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let i=e.dataset.label||"";i&&(i+=": ");let t=e.formattedValue;return O(t)||(i+=t),i;},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0};},labelTextColor(){return this.options.bodyColor;},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation};},afterLabel:ft,afterBody:ft,beforeFooter:ft,footer:ft,afterFooter:ft};function tt(e,i,t,n){let s=e[i].call(t,n);return typeof s>"u"?or[i].call(t,n):s;}var Oa=(()=>{class e extends ht{static positioners=Te;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,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0;}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0;}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let n=this.chart,s=this.options.setContext(this.getContext()),o=s.enabled&&n.options.animation&&s.animations,a=new wi(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(a)),a;}getContext(){return this.$context||(this.$context=Pd(this.chart.getContext(),this,this._tooltipItems));}getTitle(t,n){let{callbacks:s}=n,o=tt(s,"beforeTitle",this,t),a=tt(s,"title",this,t),r=tt(s,"afterTitle",this,t),l=[];return l=pt(l,wt(o)),l=pt(l,wt(a)),l=pt(l,wt(r)),l;}getBeforeBody(t,n){return Pa(tt(n.callbacks,"beforeBody",this,t));}getBody(t,n){let{callbacks:s}=n,o=[];return E(t,a=>{let r={before:[],lines:[],after:[]},l=La(s,a);pt(r.before,wt(tt(l,"beforeLabel",this,a))),pt(r.lines,tt(l,"label",this,a)),pt(r.after,wt(tt(l,"afterLabel",this,a))),o.push(r);}),o;}getAfterBody(t,n){return Pa(tt(n.callbacks,"afterBody",this,t));}getFooter(t,n){let{callbacks:s}=n,o=tt(s,"beforeFooter",this,t),a=tt(s,"footer",this,t),r=tt(s,"afterFooter",this,t),l=[];return l=pt(l,wt(o)),l=pt(l,wt(a)),l=pt(l,wt(r)),l;}_createItems(t){let n=this._active,s=this.chart.data,o=[],a=[],r=[],l=[],c,h;for(c=0,h=n.length;c<h;++c)l.push(vd(this.chart,n[c]));return t.filter&&(l=l.filter((d,u,f)=>t.filter(d,u,f,s))),t.itemSort&&(l=l.sort((d,u)=>t.itemSort(d,u,s))),E(l,d=>{let u=La(t.callbacks,d);o.push(tt(u,"labelColor",this,d)),a.push(tt(u,"labelPointStyle",this,d)),r.push(tt(u,"labelTextColor",this,d));}),this.labelColors=o,this.labelPointStyles=a,this.labelTextColors=r,this.dataPoints=l,l;}update(t,n){let s=this.options.setContext(this.getContext()),o=this._active,a,r=[];if(!o.length)this.opacity!==0&&(a={opacity:0});else{let l=Te[s.position].call(this,o,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);let c=this._size=Sa(this,s),h=Object.assign({},l,c),d=wa(this.chart,s,h),u=ka(s,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,a={opacity:1,x:u.x,y:u.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y};}this._tooltipItems=r,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n});}drawCaret(t,n,s,o){let a=this.getCaretPosition(t,s,o);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3);}getCaretPosition(t,n,s){let{xAlign:o,yAlign:a}=this,{caretSize:r,cornerRadius:l}=s,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:u}=Rt(l),{x:f,y:p}=t,{width:g,height:m}=n,b,_,y,M,x,v;return a==="center"?(x=p+m/2,o==="left"?(b=f,_=b-r,M=x+r,v=x-r):(b=f+g,_=b+r,M=x-r,v=x+r),y=b):(o==="left"?_=f+Math.max(c,d)+r:o==="right"?_=f+g-Math.max(h,u)-r:_=this.caretX,a==="top"?(M=p,x=M-r,b=_-r,y=_+r):(M=p+m,x=M+r,b=_+r,y=_-r),v=M),{x1:b,x2:_,x3:y,y1:M,y2:x,y3:v};}drawTitle(t,n,s){let o=this.title,a=o.length,r,l,c;if(a){let h=Yt(s.rtl,this.x,this.width);for(t.x=vi(this,s.titleAlign,s),n.textAlign=h.textAlign(s.titleAlign),n.textBaseline="middle",r=j(s.titleFont),l=s.titleSpacing,n.fillStyle=s.titleColor,n.font=r.string,c=0;c<a;++c)n.fillText(o[c],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+l,c+1===a&&(t.y+=s.titleMarginBottom-l);}}_drawColorBox(t,n,s,o,a){let r=this.labelColors[s],l=this.labelPointStyles[s],{boxHeight:c,boxWidth:h}=a,d=j(a.bodyFont),u=vi(this,"left",a),f=o.x(u),p=c<d.lineHeight?(d.lineHeight-c)/2:0,g=n.y+p;if(a.usePointStyle){let m={radius:Math.min(h,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=o.leftForLtr(f,h)+h/2,_=g+c/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,di(t,m,b,_),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,di(t,m,b,_);}else{t.lineWidth=D(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let m=o.leftForLtr(f,h),b=o.leftForLtr(o.xPlus(f,1),h-2),_=Rt(r.borderRadius);Object.values(_).some(y=>y!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,re(t,{x:m,y:g,w:h,h:c,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),re(t,{x:b,y:g+1,w:h-2,h:c-2,radius:_}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(m,g,h,c),t.strokeRect(m,g,h,c),t.fillStyle=r.backgroundColor,t.fillRect(b,g+1,h-2,c-2));}t.fillStyle=this.labelTextColors[s];}drawBody(t,n,s){let{body:o}=this,{bodySpacing:a,bodyAlign:r,displayColors:l,boxHeight:c,boxWidth:h,boxPadding:d}=s,u=j(s.bodyFont),f=u.lineHeight,p=0,g=Yt(s.rtl,this.x,this.width),m=function(w){n.fillText(w,g.x(t.x+p),t.y+f/2),t.y+=f+a;},b=g.textAlign(r),_,y,M,x,v,S,C;for(n.textAlign=r,n.textBaseline="middle",n.font=u.string,t.x=vi(this,b,s),n.fillStyle=s.bodyColor,E(this.beforeBody,m),p=l&&b!=="right"?r==="center"?h/2+d:h+2+d:0,x=0,S=o.length;x<S;++x){for(_=o[x],y=this.labelTextColors[x],n.fillStyle=y,E(_.before,m),M=_.lines,l&&M.length&&(this._drawColorBox(n,t,x,g,s),f=Math.max(u.lineHeight,c)),v=0,C=M.length;v<C;++v)m(M[v]),f=u.lineHeight;E(_.after,m);}p=0,f=u.lineHeight,E(this.afterBody,m),t.y-=a;}drawFooter(t,n,s){let o=this.footer,a=o.length,r,l;if(a){let c=Yt(s.rtl,this.x,this.width);for(t.x=vi(this,s.footerAlign,s),t.y+=s.footerMarginTop,n.textAlign=c.textAlign(s.footerAlign),n.textBaseline="middle",r=j(s.footerFont),n.fillStyle=s.footerColor,n.font=r.string,l=0;l<a;++l)n.fillText(o[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing;}}drawBackground(t,n,s,o){let{xAlign:a,yAlign:r}=this,{x:l,y:c}=t,{width:h,height:d}=s,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:g}=Rt(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(l+u,c),r==="top"&&this.drawCaret(t,n,s,o),n.lineTo(l+h-f,c),n.quadraticCurveTo(l+h,c,l+h,c+f),r==="center"&&a==="right"&&this.drawCaret(t,n,s,o),n.lineTo(l+h,c+d-g),n.quadraticCurveTo(l+h,c+d,l+h-g,c+d),r==="bottom"&&this.drawCaret(t,n,s,o),n.lineTo(l+p,c+d),n.quadraticCurveTo(l,c+d,l,c+d-p),r==="center"&&a==="left"&&this.drawCaret(t,n,s,o),n.lineTo(l,c+u),n.quadraticCurveTo(l,c,l+u,c),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke();}_updateAnimationTarget(t){let n=this.chart,s=this.$animations,o=s&&s.x,a=s&&s.y;if(o||a){let r=Te[t.position].call(this,this._active,this._eventPosition);if(!r)return;let l=this._size=Sa(this,t),c=Object.assign({},r,this._size),h=wa(n,t,c),d=ka(t,c,h,n);(o._to!==d.x||a._to!==d.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=l.width,this.height=l.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,d));}}_willRender(){return!!this.opacity;}draw(t){let n=this.options.setContext(this.getContext()),s=this.opacity;if(!s)return;this._updateAnimationTarget(n);let o={width:this.width,height:this.height},a={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;let r=K(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=s,this.drawBackground(a,t,o,n),_n(t,n.textDirection),a.y+=r.top,this.drawTitle(a,t,n),this.drawBody(a,t,n),this.drawFooter(a,t,n),xn(t,n.textDirection),t.restore());}getActiveElements(){return this._active||[];}setActiveElements(t,n){let s=this._active,o=t.map(({datasetIndex:l,index:c})=>{let h=this.chart.getDatasetMeta(l);if(!h)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:h.data[c],index:c};}),a=!Me(s,o),r=this._positionChanged(o,n);(a||r)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=true,this.update(true));}handleEvent(t,n,s=true){if(n&&this._ignoreReplayEvents)return false;this._ignoreReplayEvents=false;let o=this.options,a=this._active||[],r=this._getActiveElements(t,a,n,s),l=this._positionChanged(r,t),c=n||!Me(r,a)||l;return c&&(this._active=r,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(true,n))),c;}_getActiveElements(t,n,s,o){let a=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,a.mode,a,s);return a.reverse&&r.reverse(),r;}_positionChanged(t,n){let{caretX:s,caretY:o,options:a}=this,r=Te[a.position].call(this,t,n);return r!==false&&(s!==r.x||o!==r.y);}}return e;})(),Ld={id:"tooltip",_element:Oa,positioners:Te,afterInit(e,i,t){t&&(e.tooltip=new Oa({chart:e,options:t}));},beforeUpdate(e,i,t){e.tooltip&&e.tooltip.initialize(t);},reset(e,i,t){e.tooltip&&e.tooltip.initialize(t);},afterDraw(e){let i=e.tooltip;if(i&&i._willRender()){let t={tooltip:i};if(e.notifyPlugins("beforeTooltipDraw",E$1(D$2({},t),{cancelable:true}))===false)return;i.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",t);}},afterEvent(e,i){if(e.tooltip){let t=i.replay;e.tooltip.handleEvent(i.event,t,i.inChartArea)&&(i.changed=true);}},defaults:{enabled:true,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:(e,i)=>i.bodyFont.size,boxWidth:(e,i)=>i.bodyFont.size,multiKeyBackground:"#fff",displayColors:true,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:or},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:false,callbacks:{_scriptable:false,_indexable:false},animation:{_fallback:false},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Od=Object.freeze({__proto__:null,Colors:Hh,Decimation:Yh,Filler:dd,Legend:bd,SubTitle:yd,Title:xd,Tooltip:Ld}),Dd=(e,i,t,n)=>(typeof i=="string"?(t=e.push(i)-1,n.unshift({index:t,label:i})):isNaN(i)&&(t=null),t);function Ad(e,i,t,n){let s=e.indexOf(i);if(s===-1)return Dd(e,i,t,n);let o=e.lastIndexOf(i);return s!==o?t:s;}var Td=(e,i)=>e===null?null:$(Math.round(e),0,i);function Da(e){let i=this.getLabels();return e>=0&&e<i.length?i[e]:e;}var Ed=(()=>{class e extends Zt{static id="category";static defaults={ticks:{callback:Da}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[];}init(t){let n=this._addedLabels;if(n.length){let s=this.getLabels();for(let{index:o,label:a}of n)s[o]===a&&s.splice(o,1);this._addedLabels=[];}super.init(t);}parse(t,n){if(O(t))return null;let s=this.getLabels();return n=isFinite(n)&&s[n]===t?n:Ad(s,t,k(n,t),this._addedLabels),Td(n,s.length-1);}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:s,max:o}=this.getMinMax(true);this.options.bounds==="ticks"&&(t||(s=0),n||(o=this.getLabels().length-1)),this.min=s,this.max=o;}buildTicks(){let t=this.min,n=this.max,s=this.options.offset,o=[],a=this.getLabels();a=t===0&&n===a.length-1?a:a.slice(t,n+1),this._valueRange=Math.max(a.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=n;r++)o.push({value:r});return o;}getLabelForValue(t){return Da.call(this,t);}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels);}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange);}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value);}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);}getBasePixel(){return this.bottom;}}return e;})();function Rd(e,i){let t=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=e,f=o||1,p=h-1,{min:g,max:m}=i,b=!O(a),_=!O(r),y=!O(c),M=(m-g)/(d+1),x=qi((m-g)/p/f)*f,v,S,C,w;if(x<1e-14&&!b&&!_)return[{value:g},{value:m}];w=Math.ceil(m/x)-Math.floor(g/x),w>p&&(x=qi(w*x/p/f)*f),O(l)||(v=Math.pow(10,l),x=Math.ceil(x*v)/v),s==="ticks"?(S=Math.floor(g/x)*x,C=Math.ceil(m/x)*x):(S=g,C=m),b&&_&&o&&mo((r-a)/o,x/1e3)?(w=Math.round(Math.min((r-a)/x,h)),x=(r-a)/w,S=a,C=r):y?(S=b?a:S,C=_?r:C,w=c-1,x=(C-S)/w):(w=(C-S)/x,se(w,Math.round(w),x/1e3)?w=Math.round(w):w=Math.ceil(w));let L=Math.max(Ji(x),Ji(S));v=Math.pow(10,O(l)?L:l),S=Math.round(S*v)/v,C=Math.round(C*v)/v;let P=0;for(b&&(u&&S!==a?(t.push({value:a}),S<a&&P++,se(Math.round((S+P*x)*v)/v,a,Aa(a,M,e))&&P++):S<a&&P++);P<w;++P){let A=Math.round((S+P*x)*v)/v;if(_&&A>r)break;t.push({value:A});}return _&&u&&C!==r?t.length&&se(t[t.length-1].value,r,Aa(r,M,e))?t[t.length-1].value=r:t.push({value:r}):(!_||C===r)&&t.push({value:C}),t;}function Aa(e,i,{horizontal:t,minRotation:n}){let s=rt(n),o=(t?Math.sin(s):Math.cos(s))||.001,a=.75*i*(""+e).length;return Math.min(i/o,a);}var de=class extends Zt{constructor(i){super(i),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0;}parse(i,t){return O(i)||(typeof i=="number"||i instanceof Number)&&!isFinite(+i)?null:+i;}handleTickRangeOptions(){let{beginAtZero:i}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:s,max:o}=this,a=l=>s=t?s:l,r=l=>o=n?o:l;if(i){let l=ct(s),c=ct(o);l<0&&c<0?r(0):l>0&&c>0&&a(0);}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),i||a(s-l);}this.min=s,this.max=o;}getTickLimit(){let i=this.options.ticks,{maxTicksLimit:t,stepSize:n}=i,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s;}computeTickLimit(){return Number.POSITIVE_INFINITY;}buildTicks(){let i=this.options,t=i.ticks,n=this.getTickLimit();n=Math.max(2,n);let s={maxTicks:n,bounds:i.bounds,min:i.min,max:i.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==false},o=this._range||this,a=Rd(s,o);return i.bounds==="ticks"&&Gi(a,this,"value"),i.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a;}configure(){let i=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&i.length){let s=(n-t)/Math.max(i.length-1,1)/2;t-=s,n+=s;}this._startValue=t,this._endValue=n,this._valueRange=n-t;}getLabelForValue(i){return ae(i,this.chart.options.locale,this.options.ticks.format);}},Kn=class extends de{static id="linear";static defaults={ticks:{callback:Ce.formatters.numeric}};determineDataLimits(){let{min:i,max:t}=this.getMinMax(true);this.min=N(i)?i:0,this.max=N(t)?t:1,this.handleTickRangeOptions();}computeTickLimit(){let i=this.isHorizontal(),t=i?this.width:this.height,n=rt(this.options.ticks.minRotation),s=(i?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/s));}getPixelForValue(i){return i===null?NaN:this.getPixelForDecimal((i-this._startValue)/this._valueRange);}getValueForPixel(i){return this._startValue+this.getDecimalForPixel(i)*this._valueRange;}},Ie=e=>Math.floor(vt(e)),Xt=(e,i)=>Math.pow(10,Ie(e)+i);function Ta(e){return e/Math.pow(10,Ie(e))===1;}function Ea(e,i,t){let n=Math.pow(10,t),s=Math.floor(e/n);return Math.ceil(i/n)-s;}function Id(e,i){let t=i-e,n=Ie(t);for(;Ea(e,i,n)>10;)n++;for(;Ea(e,i,n)<10;)n--;return Math.min(n,Ie(e));}function Fd(e,{min:i,max:t}){i=Q(e.min,i);let n=[],s=Ie(i),o=Id(i,t),a=o<0?Math.pow(10,Math.abs(o)):1,r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((i-l)*a)/a,h=Math.floor((i-l)/r/10)*r*10,d=Math.floor((c-h)/Math.pow(10,o)),u=Q(e.min,Math.round((l+h+d*Math.pow(10,o))*a)/a);for(;u<t;)n.push({value:u,major:Ta(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),u=Math.round((l+h+d*Math.pow(10,o))*a)/a;let f=Q(e.max,u);return n.push({value:f,major:Ta(f),significand:d}),n;}var qn=class extends Zt{static id="logarithmic";static defaults={ticks:{callback:Ce.formatters.logarithmic,major:{enabled:true}}};constructor(i){super(i),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0;}parse(i,t){let n=de.prototype.parse.apply(this,[i,t]);if(n===0){this._zero=true;return;}return N(n)&&n>0?n:null;}determineDataLimits(){let{min:i,max:t}=this.getMinMax(true);this.min=N(i)?Math.max(0,i):null,this.max=N(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=true),this._zero&&this.min!==this._suggestedMin&&!N(this._userMin)&&(this.min=i===Xt(this.min,0)?Xt(this.min,-1):Xt(this.min,0)),this.handleTickRangeOptions();}handleTickRangeOptions(){let{minDefined:i,maxDefined:t}=this.getUserBounds(),n=this.min,s=this.max,o=r=>n=i?n:r,a=r=>s=t?s:r;n===s&&(n<=0?(o(1),a(10)):(o(Xt(n,-1)),a(Xt(s,1)))),n<=0&&o(Xt(s,-1)),s<=0&&a(Xt(n,1)),this.min=n,this.max=s;}buildTicks(){let i=this.options,t={min:this._userMin,max:this._userMax},n=Fd(t,this);return i.bounds==="ticks"&&Gi(n,this,"value"),i.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n;}getLabelForValue(i){return i===void 0?"0":ae(i,this.chart.options.locale,this.options.ticks.format);}configure(){let i=this.min;super.configure(),this._startValue=vt(i),this._valueRange=vt(this.max)-vt(i);}getPixelForValue(i){return(i===void 0||i===0)&&(i=this.min),i===null||isNaN(i)?NaN:this.getPixelForDecimal(i===this.min?0:(vt(i)-this._startValue)/this._valueRange);}getValueForPixel(i){let t=this.getDecimalForPixel(i);return Math.pow(10,this._startValue+t*this._valueRange);}};function Gn(e){let i=e.ticks;if(i.display&&e.display){let t=K(i.backdropPadding);return k(i.font&&i.font.size,B.font.size)+t.height;}return 0;}function zd(e,i,t){return t=F(t)?t:[t],{w:wo(e,i.string,t),h:t.length*i.lineHeight};}function Ra(e,i,t,n,s){return e===n||e===s?{start:i-t/2,end:i+t/2}:e<n||e>s?{start:i-t,end:i}:{start:i,end:i+t};}function Bd(e){let i={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},t=Object.assign({},i),n=[],s=[],o=e._pointLabels.length,a=e.options.pointLabels,r=a.centerPointLabels?T/o:0;for(let l=0;l<o;l++){let c=a.setContext(e.getPointLabelContext(l));s[l]=c.padding;let h=e.getPointPosition(l,e.drawingArea+s[l],r),d=j(c.font),u=zd(e.ctx,d,e._pointLabels[l]);n[l]=u;let f=X(e.getIndexAngle(l)+r),p=Math.round(ri(f)),g=Ra(p,h.x,u.w,0,180),m=Ra(p,h.y,u.h,90,270);Vd(t,i,f,g,m);}e.setCenterPoint(i.l-t.l,t.r-i.r,i.t-t.t,t.b-i.b),e._pointLabelItems=Wd(e,n,s);}function Vd(e,i,t,n,s){let o=Math.abs(Math.sin(t)),a=Math.abs(Math.cos(t)),r=0,l=0;n.start<i.l?(r=(i.l-n.start)/o,e.l=Math.min(e.l,i.l-r)):n.end>i.r&&(r=(n.end-i.r)/o,e.r=Math.max(e.r,i.r+r)),s.start<i.t?(l=(i.t-s.start)/a,e.t=Math.min(e.t,i.t-l)):s.end>i.b&&(l=(s.end-i.b)/a,e.b=Math.max(e.b,i.b+l));}function Nd(e,i,t){let n=e.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=t,l=e.getPointPosition(i,n+s+a,o),c=Math.round(ri(X(l.angle+H))),h=Yd(l.y,r.h,c),d=jd(c),u=$d(l.x,r.w,d);return{visible:true,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+r.w,bottom:h+r.h};}function Hd(e,i){if(!i)return true;let{left:t,top:n,right:s,bottom:o}=e;return!(ut({x:t,y:n},i)||ut({x:t,y:o},i)||ut({x:s,y:n},i)||ut({x:s,y:o},i));}function Wd(e,i,t){let n=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Gn(o)/2,additionalAngle:a?T/s:0},c;for(let h=0;h<s;h++){l.padding=t[h],l.size=i[h];let d=Nd(e,h,l);n.push(d),r==="auto"&&(d.visible=Hd(d,c),d.visible&&(c=d));}return n;}function jd(e){return e===0||e===180?"center":e<180?"left":"right";}function $d(e,i,t){return t==="right"?e-=i:t==="center"&&(e-=i/2),e;}function Yd(e,i,t){return t===90||t===270?e-=i/2:(t>270||t<90)&&(e-=i),e;}function Ud(e,i,t){let{left:n,top:s,right:o,bottom:a}=t,{backdropColor:r}=i;if(!O(r)){let l=Rt(i.borderRadius),c=K(i.backdropPadding);e.fillStyle=r;let h=n-c.left,d=s-c.top,u=o-n+c.width,f=a-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),re(e,{x:h,y:d,w:u,h:f,radius:l}),e.fill()):e.fillRect(h,d,u,f);}}function Xd(e,i){let{ctx:t,options:{pointLabels:n}}=e;for(let s=i-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let a=n.setContext(e.getPointLabelContext(s));Ud(t,a,o);let r=j(a.font),{x:l,y:c,textAlign:h}=o;Et(t,e._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"});}}function ar(e,i,t,n){let{ctx:s}=e;if(t)s.arc(e.xCenter,e.yCenter,i,0,z);else{let o=e.getPointPosition(0,i);s.moveTo(o.x,o.y);for(let a=1;a<n;a++)o=e.getPointPosition(a,i),s.lineTo(o.x,o.y);}}function Zd(e,i,t,n,s){let o=e.ctx,a=i.circular,{color:r,lineWidth:l}=i;!a&&!n||!r||!l||t<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ar(e,t,a,n),o.closePath(),o.stroke(),o.restore());}function Kd(e,i,t){return Ct(e,{label:t,index:i,type:"pointLabel"});}var Jn=class extends de{static id="radialLinear";static defaults={display:true,animate:true,position:"chartArea",angleLines:{display:true,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:false},startAngle:0,ticks:{showLabelBackdrop:true,callback:Ce.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:true,font:{size:10},callback(i){return i;},padding:5,centerPointLabels:false}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(i){super(i),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[];}setDimensions(){let i=this._padding=K(Gn(this.options)/2),t=this.width=this.maxWidth-i.width,n=this.height=this.maxHeight-i.height;this.xCenter=Math.floor(this.left+t/2+i.left),this.yCenter=Math.floor(this.top+n/2+i.top),this.drawingArea=Math.floor(Math.min(t,n)/2);}determineDataLimits(){let{min:i,max:t}=this.getMinMax(false);this.min=N(i)&&!isNaN(i)?i:0,this.max=N(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions();}computeTickLimit(){return Math.ceil(this.drawingArea/Gn(this.options));}generateTickLabels(i){de.prototype.generateTickLabels.call(this,i),this._pointLabels=this.getLabels().map((t,n)=>{let s=I(this.options.pointLabels.callback,[t,n],this);return s||s===0?s:"";}).filter((t,n)=>this.chart.getDataVisibility(n));}fit(){let i=this.options;i.display&&i.pointLabels.display?Bd(this):this.setCenterPoint(0,0,0,0);}setCenterPoint(i,t,n,s){this.xCenter+=Math.floor((i-t)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(i,t,n,s));}getIndexAngle(i){let t=z/(this._pointLabels.length||1),n=this.options.startAngle||0;return X(i*t+rt(n));}getDistanceFromCenterForValue(i){if(O(i))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-i)*t:(i-this.min)*t;}getValueForDistanceFromCenter(i){if(O(i))return NaN;let t=i/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t;}getPointLabelContext(i){let t=this._pointLabels||[];if(i>=0&&i<t.length){let n=t[i];return Kd(this.getContext(),i,n);}}getPointPosition(i,t,n=0){let s=this.getIndexAngle(i)-H+n;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s};}getPointPositionForValue(i,t){return this.getPointPosition(i,this.getDistanceFromCenterForValue(t));}getBasePosition(i){return this.getPointPositionForValue(i||0,this.getBaseValue());}getPointLabelPosition(i){let{left:t,top:n,right:s,bottom:o}=this._pointLabelItems[i];return{left:t,top:n,right:s,bottom:o};}drawBackground(){let{backgroundColor:i,grid:{circular:t}}=this.options;if(i){let n=this.ctx;n.save(),n.beginPath(),ar(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=i,n.fill(),n.restore();}}drawGrid(){let i=this.ctx,t=this.options,{angleLines:n,grid:s,border:o}=t,a=this._pointLabels.length,r,l,c;if(t.pointLabels.display&&Xd(this,a),s.display&&this.ticks.forEach((h,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);let u=this.getContext(d),f=s.setContext(u),p=o.setContext(u);Zd(this,f,l,a,p);}}),n.display){for(i.save(),r=a-1;r>=0;r--){let h=n.setContext(this.getPointLabelContext(r)),{color:d,lineWidth:u}=h;!u||!d||(i.lineWidth=u,i.strokeStyle=d,i.setLineDash(h.borderDash),i.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(r,l),i.beginPath(),i.moveTo(this.xCenter,this.yCenter),i.lineTo(c.x,c.y),i.stroke());}i.restore();}}drawBorder(){}drawLabels(){let i=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let s=this.getIndexAngle(0),o,a;i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(s),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;let c=n.setContext(this.getContext(l)),h=j(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){i.font=h.string,a=i.measureText(r.label).width,i.fillStyle=c.backdropColor;let d=K(c.backdropPadding);i.fillRect(-a/2-d.left,-o-h.size/2-d.top,a+d.width,h.size+d.height);}Et(i,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth});}),i.restore();}drawTitle(){}},Ri={millisecond:{common:true,size:1,steps:1e3},second:{common:true,size:1e3,steps:60},minute:{common:true,size:6e4,steps:60},hour:{common:true,size:36e5,steps:24},day:{common:true,size:864e5,steps:30},week:{common:false,size:6048e5,steps:4},month:{common:true,size:2628e6,steps:12},quarter:{common:false,size:7884e6,steps:4},year:{common:true,size:3154e7}},et=Object.keys(Ri);function Ia(e,i){return e-i;}function Fa(e,i){if(O(i))return null;let t=e._adapter,{parser:n,round:s,isoWeekday:o}=e._parseOpts,a=i;return typeof n=="function"&&(a=n(a)),N(a)||(a=typeof n=="string"?t.parse(a,n):t.parse(a)),a===null?null:(s&&(a=s==="week"&&($t(o)||o===true)?t.startOf(a,"isoWeek",o):t.startOf(a,s)),+a);}function za(e,i,t,n){let s=et.length;for(let o=et.indexOf(e);o<s-1;++o){let a=Ri[et[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((t-i)/(r*a.size))<=n)return et[o];}return et[s-1];}function qd(e,i,t,n,s){for(let o=et.length-1;o>=et.indexOf(t);o--){let a=et[o];if(Ri[a].common&&e._adapter.diff(s,n,a)>=i-1)return a;}return et[t?et.indexOf(t):0];}function Gd(e){for(let i=et.indexOf(e)+1,t=et.length;i<t;++i)if(Ri[et[i]].common)return et[i];}function Ba(e,i,t){if(!t)e[i]=true;else if(t.length){let{lo:n,hi:s}=li(t,i),o=t[n]>=i?t[n]:t[s];e[o]=true;}}function Jd(e,i,t,n){let s=e._adapter,o=+s.startOf(i[0].value,n),a=i[i.length-1].value,r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=t[r],l>=0&&(i[l].major=true);return i;}function Va(e,i,t){let n=[],s={},o=i.length,a,r;for(a=0;a<o;++a)r=i[a],s[r]=a,n.push({value:r,major:false});return o===0||!t?n:Jd(e,n,s,t);}var Qn=(()=>{class e extends Zt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:false,unit:false,round:false,isoWeekday:false,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:false,major:{enabled:false}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=false,this._parseOpts=void 0;}init(t,n={}){let s=t.time||(t.time={}),o=this._adapter=new cc._date(t.adapters.date);o.init(n),ie(s.displayFormats,o.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=n.normalized;}parse(t,n){return t===void 0?null:Fa(this,t);}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]};}determineDataLimits(){let t=this.options,n=this._adapter,s=t.time.unit||"day",{min:o,max:a,minDefined:r,maxDefined:l}=this.getUserBounds();function c(h){!r&&!isNaN(h.min)&&(o=Math.min(o,h.min)),!l&&!isNaN(h.max)&&(a=Math.max(a,h.max));}(!r||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(false))),o=N(o)&&!isNaN(o)?o:+n.startOf(Date.now(),s),a=N(a)&&!isNaN(a)?a:+n.endOf(Date.now(),s)+1,this.min=Math.min(o,a-1),this.max=Math.max(o+1,a);}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],s=t[t.length-1]),{min:n,max:s};}buildTicks(){let t=this.options,n=t.time,s=t.ticks,o=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);let a=this.min,r=this.max,l=xo(o,a,r);return this._unit=n.unit||(s.autoSkip?za(n.minUnit,this.min,this.max,this._getLabelCapacity(a)):qd(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Gd(this._unit),this.initOffsets(o),t.reverse&&l.reverse(),Va(this,l,this._majorUnit);}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value));}initOffsets(t=[]){let n=0,s=0,o,a;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?s=a:s=(a-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;n=$(n,0,r),s=$(s,0,r),this._offsets={start:n,end:s,factor:1/(n+1+s)};}_generate(){let t=this._adapter,n=this.min,s=this.max,o=this.options,a=o.time,r=a.unit||za(a.minUnit,n,s,this._getLabelCapacity(n)),l=k(o.ticks.stepSize,1),c=r==="week"?a.isoWeekday:false,h=$t(c)||c===true,d={},u=n,f,p;if(h&&(u=+t.startOf(u,"isoWeek",c)),u=+t.startOf(u,h?"day":r),t.diff(s,n,r)>1e5*l)throw new Error(n+" and "+s+" are too far apart with stepSize of "+l+" "+r);let g=o.ticks.source==="data"&&this.getDataTimestamps();for(f=u,p=0;f<s;f=+t.add(f,l,r),p++)Ba(d,f,g);return(f===s||o.bounds==="ticks"||p===1)&&Ba(d,f,g),Object.keys(d).sort(Ia).map(m=>+m);}getLabelForValue(t){let n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(t,s.tooltipFormat):n.format(t,s.displayFormats.datetime);}format(t,n){let o=this.options.time.displayFormats,a=this._unit,r=n||o[a];return this._adapter.format(t,r);}_tickFormatFunction(t,n,s,o){let a=this.options,r=a.ticks.callback;if(r)return I(r,[t,n,s],this);let l=a.time.displayFormats,c=this._unit,h=this._majorUnit,d=c&&l[c],u=h&&l[h],f=s[n],p=h&&u&&f&&f.major;return this._adapter.format(t,o||(p?u:d));}generateTickLabels(t){let n,s,o;for(n=0,s=t.length;n<s;++n)o=t[n],o.label=this._tickFormatFunction(o.value,n,t);}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min);}getPixelForValue(t){let n=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+s)*n.factor);}getValueForPixel(t){let n=this._offsets,s=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+s*(this.max-this.min);}_getLabelSize(t){let n=this.options.ticks,s=this.ctx.measureText(t).width,o=rt(this.isHorizontal()?n.maxRotation:n.minRotation),a=Math.cos(o),r=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:s*a+l*r,h:s*r+l*a};}_getLabelCapacity(t){let n=this.options.time,s=n.displayFormats,o=s[n.unit]||s.millisecond,a=this._tickFormatFunction(t,0,Va(this,[t],this._majorUnit),o),r=this._getLabelSize(a),l=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return l>0?l:1;}getDataTimestamps(){let t=this._cache.data||[],n,s;if(t.length)return t;let o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,s=o.length;n<s;++n)t=t.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t);}getLabelTimestamps(){let t=this._cache.labels||[],n,s;if(t.length)return t;let o=this.getLabels();for(n=0,s=o.length;n<s;++n)t.push(Fa(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t);}normalize(t){return en(t.sort(Ia));}}return e;})();function Mi(e,i,t){let n=0,s=e.length-1,o,a,r,l;t?(i>=e[n].pos&&i<=e[s].pos&&({lo:n,hi:s}=dt(e,"pos",i)),{pos:o,time:r}=e[n],{pos:a,time:l}=e[s]):(i>=e[n].time&&i<=e[s].time&&({lo:n,hi:s}=dt(e,"time",i)),{time:o,pos:r}=e[n],{time:a,pos:l}=e[s]);let c=a-o;return c?r+(l-r)*(i-o)/c:r;}var ts=class extends Qn{static id="timeseries";static defaults=Qn.defaults;constructor(i){super(i),this._table=[],this._minPos=void 0,this._tableRange=void 0;}initOffsets(){let i=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(i);this._minPos=Mi(t,this.min),this._tableRange=Mi(t,this.max)-this._minPos,super.initOffsets(i);}buildLookupTable(i){let{min:t,max:n}=this,s=[],o=[],a,r,l,c,h;for(a=0,r=i.length;a<r;++a)c=i[a],c>=t&&c<=n&&s.push(c);if(s.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,r=s.length;a<r;++a)h=s[a+1],l=s[a-1],c=s[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o;}_generate(){let i=this.min,t=this.max,n=super.getDataTimestamps();return(!n.includes(i)||!n.length)&&n.splice(0,0,i),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((s,o)=>s-o);}_getTimestampsForTable(){let i=this._cache.all||[];if(i.length)return i;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return t.length&&n.length?i=this.normalize(t.concat(n)):i=t.length?t:n,i=this._cache.all=i,i;}getDecimalForValue(i){return(Mi(this._table,i)-this._minPos)/this._tableRange;}getValueForPixel(i){let t=this._offsets,n=this.getDecimalForPixel(i)/t.factor-t.end;return Mi(this._table,n*this._tableRange+this._minPos,true);}},Qd=Object.freeze({__proto__:null,CategoryScale:Ed,LinearScale:Kn,LogarithmicScale:qn,RadialLinearScale:Jn,TimeScale:Qn,TimeSeriesScale:ts}),rr=[lc,Rh,Od,Qd];Ai.register(...rr);var lr=Ai;var tu={root:({instance:e})=>({display:"block",position:"relative",width:e.width,height:e.height})},eu={root:"p-chart"},cr=(()=>{class e extends I$1{name="chart";classes=eu;inlineStyles=tu;static ɵfac=(()=>{let t;return function(s){return(t||(t=Uu(e)))(s||e);};})();static ɵprov=S({token:e,factory:e.ɵfac});}return e;})();var hr=new A("CHART_INSTANCE"),iu=(()=>{class e extends Y{el;zone;componentName="Chart";$pcChart=g(hr,{optional:true,skipSelf:true})??void 0;bindDirectiveInstance=g(Z$1,{self:true});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]));}type;plugins=[];width;height;responsive=true;ariaLabel;ariaLabelledBy;get data(){return this._data;}set data(t){this._data=t,this.reinit();}get options(){return this._options;}set options(t){this._options=t,this.reinit();}onDataSelect=new kt();isBrowser=false;initialized;_data;_options={};chart;_componentStyle=g(cr);constructor(t,n){super(),this.el=t,this.zone=n;}onAfterViewInit(){this.initChart(),this.initialized=true;}onCanvasClick(t){if(this.chart){let n=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:true},false),s=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:true},false);n&&n[0]&&s&&this.onDataSelect.emit({originalEvent:t,element:n[0],dataset:s});}}initChart(){if(Yhe(this.platformId)){let t=this.options||{};t.responsive=this.responsive,t.responsive&&(this.height||this.width)&&(t.maintainAspectRatio=false),this.zone.runOutsideAngular(()=>{this.chart=new lr(this.el.nativeElement.children[0],{type:this.type,data:this.data,options:this.options,plugins:this.plugins});});}}getCanvas(){return this.el.nativeElement.children[0];}getBase64Image(){return this.chart.toBase64Image();}generateLegend(){if(this.chart)return this.chart.generateLegend();}refresh(){this.chart&&this.chart.update();}reinit(){this.chart&&(this.chart.destroy(),this.initChart());}onDestroy(){this.chart&&(this.chart.destroy(),this.initialized=false,this.chart=null);}static ɵfac=function(n){return new(n||e)(ce$1(Mn$1),ce$1(ie$1));};static ɵcmp=Pa$1({type:e,selectors:[["p-chart"]],hostVars:4,hostBindings:function(n,s){n&2&&(FV(s.sx("root")),BV(s.cx("root")));},inputs:{type:"type",plugins:"plugins",width:"width",height:"height",responsive:[2,"responsive","responsive",tl$1],ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",data:"data",options:"options"},outputs:{onDataSelect:"onDataSelect"},features:[c$([cr,{provide:hr,useExisting:e}]),Pj([Z$1]),I0],decls:1,vars:5,consts:[["role","img",3,"click","pBind"]],template:function(n,s){n&1&&(sp(0,"canvas",0),Fp("click",function(a){return s.onCanvasClick(a);}),ub()),n&2&&(B0("pBind",s.ptm("canvas")),Lp("aria-label",s.ariaLabel)("aria-labelledby",s.ariaLabelledBy)("width",s.responsive&&!s.width?null:s.width)("height",s.responsive&&!s.height?null:s.height));},dependencies:[cl$1,j0e,qo$1,Z$1],encapsulation:2});}return e;})(),ju=(()=>{class e{static ɵfac=function(n){return new(n||e)();};static ɵmod=Ln$1({type:e});static ɵinj=mn$1({imports:[iu,j0e,j0e]});}return e;})();var nu=[[["",8,"icon"]],[["",8,"label"]]],su=[".icon",".label"],dr=(()=>{class e{help=qp.required();static ɵfac=function(n){return new(n||e)();};static ɵcmp=Pa$1({type:e,selectors:[["my-unavailable-menu-entry"]],inputs:{help:[1,"help"]},ngContentSelectors:su,decls:10,vars:1,consts:()=>{let t;t="\u529F\u80FD\u7121\u6CD5\u4F7F\u7528";let n;return n="\u7121\u6CD5\u4F7F\u7528",[n,[1,"unavailable"],[1,"badge-help"],[1,"pt-badge","badge-secondary-on-secondary"],["helpTitle",t,"container","body"]];},template:function(n,s){n&1&&(Up(nu),sp(0,"div",1),Bp(1),sp(2,"div")(3,"div"),Bp(4,1),ub(),sp(5,"div",2)(6,"div",3),yV(7,0),ub(),sp(8,"my-help",4),KV(9),ub()()()()),n&2&&(zB(9),vb(" ",s.help()," "));},dependencies:[vz,Jn$1,Qn$1,ef,U],styles:[".unavailable[_ngcontent-%COMP%]{display:flex;align-items:center}.unavailable[_ngcontent-%COMP%]   my-help[_ngcontent-%COMP%]{color:var(--fg-200)}@media only screen and (max-width:1000px){.unavailable[_ngcontent-%COMP%]{flex-direction:column;text-align:center;align-items:center}.badge-help[_ngcontent-%COMP%]{display:flex;margin-top:.25rem}}"],changeDetection:1});}return e;})();var au=()=>({exact:true});function ru(e,i){e&1&&(sp(0,"div",6),Pp(1,"div"),ub());}function lu(e,i){if(e&1&&(sp(0,"div",9),Pp(1,"my-global-icon",10),ub()),e&2){let t=bV(3).$implicit;zB(),B0("iconName",t.icon);}}function cu(e,i){if(e&1&&_2(0,lu,2,1,"div",9),e&2){let t=bV(2).$implicit;w2(t.icon?0:-1);}}function hu(e,i){if(e&1&&(sp(0,"span"),KV(1),ub()),e&2){let t=bV(2).$implicit;zB(),wx(t.label);}}function du(e,i){e&1&&Pp(0,"span",13);}function uu(e,i){e&1&&Pp(0,"span",14);}function fu(e,i){if(e&1&&(sp(0,"my-unavailable-menu-entry",7),_0(1,du,1,0,"span",11)(2,uu,1,0,"span",12),ub()),e&2){bV();let t=IV(1),n=IV(3),s=bV().$implicit;B0("help",s.unavailableText()),zB(),B0("ngTemplateOutlet",t),zB(),B0("ngTemplateOutlet",n);}}function gu(e,i){e&1&&V0(0);}function pu(e,i){e&1&&V0(0);}function mu(e,i){if(e&1&&(sp(0,"a",8),_0(1,gu,1,0,"ng-container",15)(2,pu,1,0,"ng-container",15),ub()),e&2){bV();let t=IV(1),n=IV(3),s=bV().$implicit,o=bV();B0("routerLink",s.routerLink)("queryParams",o.globalQueryParams())("routerLinkActiveOptions",u$(5,au)),zB(),B0("ngTemplateOutlet",t),zB(),B0("ngTemplateOutlet",n);}}function bu(e,i){if(e&1&&(_0(0,cu,1,1,"ng-template",null,0,D$)(2,hu,2,1,"ng-template",null,1,D$),_2(4,fu,3,3,"my-unavailable-menu-entry",7)(5,mu,3,6,"a",8)),e&2){let t=bV().$implicit,n=bV();zB(4),w2(n.isUnavailable(t)?4:5);}}function _u(e,i){if(e&1&&_2(0,ru,2,0,"div",6)(1,bu,6,1),e&2){let t=i.$implicit,n=bV();w2(t.type==="separator"?0:t.type==="link"&&n.isDisplayed(t)?1:-1);}}var ff=(()=>{class e{domSanitizer=g(k5);config=qp.required();globalQueryParams=qp();lateralMenuBackground=this.domSanitizer.bypassSecurityTrustHtml(ur());isDisplayed(t){return t.isDisplayed?t.isDisplayed():true;}isUnavailable(t){return t.unavailableText?!!t.unavailableText():false;}static ɵfac=function(n){return new(n||e)();};static ɵcmp=Pa$1({type:e,selectors:[["my-lateral-menu"]],inputs:{config:[1,"config"],globalQueryParams:[1,"globalQueryParams"]},decls:8,vars:2,consts:[["icon",""],["label",""],[1,"menu"],["aria-hidden","true",1,"svg-container",3,"innerHTML"],[1,"ul-unstyle"],[1,"menu-placeholder"],[1,"separator"],[3,"help"],["queryParamsHandling","merge","routerLinkActive","active",3,"routerLink","queryParams","routerLinkActiveOptions"],[1,"global-icon-wrapper"],[3,"iconName"],["class","icon",4,"ngTemplateOutlet"],["class","label",4,"ngTemplateOutlet"],[1,"icon"],[1,"label"],[4,"ngTemplateOutlet"]],template:function(n,s){n&1&&(sp(0,"div",2),Pp(1,"div",3),sp(2,"h1"),KV(3),ub(),sp(4,"ul",4),R2(5,_u,2,1,null,null,A2),ub()(),Pp(7,"div",5)),n&2&&(zB(),B0("innerHTML",s.lateralMenuBackground,ow),zB(2),wx(s.config().title),zB(2),N2(s.config().entries));},dependencies:[cl$1,R3,vz,Xh$1,hz,Jn$1,Qn$1,ef,Tr$1,dr],styles:["menu[_ngcontent-%COMP%], .menu-placeholder[_ngcontent-%COMP%], h1[_ngcontent-%COMP%], ul[_ngcontent-%COMP%]{position:relative;z-index:1}.svg-container[_ngcontent-%COMP%]{position:absolute;top:0;opacity:.3;z-index:0;overflow:hidden;width:100%;height:100%}.svg-container[_ngcontent-%COMP%]     svg{color:var(--bg-secondary-450);-webkit-mask-image:linear-gradient(to bottom,#000 25%,transparent 100%);mask-image:linear-gradient(to bottom,#000 25%,transparent 100%)}h1[_ngcontent-%COMP%]{color:var(--fg-200);font-weight:700;margin-bottom:1rem;text-align:center;font-size:.875rem}.menu[_ngcontent-%COMP%], .menu-placeholder[_ngcontent-%COMP%]{position:sticky;top:var(--header-height);width:calc(248px - 2rem);max-height:calc(100vh - var(--header-height));z-index:12600;margin-inline-end:var(--x-margin-content)}.menu[_ngcontent-%COMP%]{padding-top:1.5rem;padding-bottom:1.5rem;background-color:var(--bg-secondary-400);border-radius:14px;overflow:auto}.global-icon-wrapper[_ngcontent-%COMP%]{display:inline-block;border-radius:100%;padding:5px;background-color:var(--bg);line-height:1;width:fit-content;height:fit-content;margin-inline-end:.75rem}.global-icon-wrapper[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{color:var(--primary);display:inline-block;width:22px;height:22px;line-height:22px}li[_ngcontent-%COMP%]{list-style:none}a[_ngcontent-%COMP%], my-unavailable-menu-entry[_ngcontent-%COMP%], .separator[_ngcontent-%COMP%]{padding-inline-start:calc(1.275rem + .3vw)}@media(min-width:1200px){a[_ngcontent-%COMP%], my-unavailable-menu-entry[_ngcontent-%COMP%], .separator[_ngcontent-%COMP%]{padding-inline-start:1.5rem}}my-unavailable-menu-entry[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}my-unavailable-menu-entry[_ngcontent-%COMP%]   .global-icon-wrapper[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)!important}a[_ngcontent-%COMP%], my-unavailable-menu-entry[_ngcontent-%COMP%]{display:block;padding-top:.5rem;padding-bottom:.5rem}a[_ngcontent-%COMP%]{color:var(--fg-350)}a[_ngcontent-%COMP%], a[_ngcontent-%COMP%]:hover, a[_ngcontent-%COMP%]:focus, a[_ngcontent-%COMP%]:active{text-decoration:none}a[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}a[_ngcontent-%COMP%]:hover{opacity:1;color:var(--fg-400)}a.active[_ngcontent-%COMP%]{color:var(--fg-400);font-weight:700;background-color:var(--bg-secondary-350)}a.active[_ngcontent-%COMP%]   .global-icon-wrapper[_ngcontent-%COMP%]{background-color:var(--primary)}a.active[_ngcontent-%COMP%]   .global-icon-wrapper[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{color:var(--bg)}.separator[_ngcontent-%COMP%]{padding-top:1rem;padding-bottom:1rem;padding-inline-end:calc(1.275rem + .3vw)}@media(min-width:1200px){.separator[_ngcontent-%COMP%]{padding-inline-end:1.5rem}}.separator[_ngcontent-%COMP%]:last-child{display:none}.separator[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:2px;width:100%;background-color:var(--bg-secondary-500);border-radius:14px}@media screen and (max-width:1000px){h1[_ngcontent-%COMP%]{width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}h1[_ngcontent-%COMP%]:not(caption){position:absolute!important}h1[_ngcontent-%COMP%]   *[_ngcontent-%COMP%]{overflow:hidden!important}ul[_ngcontent-%COMP%]{display:flex;margin:0 auto;width:fit-content}.menu-placeholder[_ngcontent-%COMP%]{display:none}.menu[_ngcontent-%COMP%]{position:fixed;bottom:0;top:unset;width:calc(100vw - var(--menu-width) - var(--x-margin-content) * 2);padding:.75rem .5rem;border:1px solid var(--bg-secondary-450);border-bottom:0;border-end-end-radius:0;border-end-start-radius:0}a[_ngcontent-%COMP%]{display:flex;flex-direction:column;text-align:center;align-items:center}a.active[_ngcontent-%COMP%]{background-color:inherit}a[_ngcontent-%COMP%], .separator[_ngcontent-%COMP%], my-unavailable-menu-entry[_ngcontent-%COMP%]{font-size:12px;line-height:1.2;padding:0 .5rem}.separator[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{width:2px;height:100%}.global-icon-wrapper[_ngcontent-%COMP%]{margin:0 0 .25rem}}@media screen and (max-width:500px){.menu[_ngcontent-%COMP%]{border-radius:0;border-width:1px 0 0;width:100vw;left:0}}"],changeDetection:1});}return e;})();var Cf=(()=>{class e{serverService=g($t$1);playerSettingsService=g(l);inputId=qp.required();mode=qp.required();channel=qp();themes;selectedId;ngOnInit(){if(this.mode()==="video"&&!this.channel())throw new Error("Channel must be specified in video mode");this.buildOptions();}propagateChange=t=>{};writeValue(t){this.selectedId=t;}registerOnChange(t){this.propagateChange=t;}registerOnTouched(){}onModelChange(){this.propagateChange(this.selectedId);}buildOptions(){let t=this.serverService.getHTMLConfig(),n=t.instance.name,s=this.getLabelOf(t.defaults.player.theme);this.themes=[],(this.mode()==="channel"||this.mode()==="video")&&this.themes.push({id:"instance-default",label:""+n+" \u8A2D\u5B9A ("+s+")"}),this.mode()==="video"&&(this.themes.push({id:"channel-default",label:""+this.channel().displayName+" \u8A2D\u5B9A"}),this.scheduleChannelUpdate()),this.themes=this.themes.concat(this.getPlayerThemes());}scheduleChannelUpdate(){this.playerSettingsService.getChannelSettings({channelHandle:this.channel().name,raw:true}).subscribe({next:t=>{this.themes.find(n=>n.id==="channel-default").label=this.buildChannelLabel(t);}});}buildChannelLabel(t){let n=this.serverService.getHTMLConfig(),s=n.instance.name,o=this.getLabelOf(n.defaults.player.theme),a=t.theme,r=a==="instance-default"?"\u4F86\u81EA "+s+" \u7684\u8A2D\u5B9A\uFF1A"+o+"":this.getLabelOf(a);return""+this.channel().displayName+" \u983B\u9053\u8A2D\u5B9A ("+r+")";}getLabelOf(t){return this.getPlayerThemes().find(n=>n.id===t)?.label;}getPlayerThemes(){return[{id:"galaxy",label:"\u9280\u6CB3",description:"\u539F\u59CB\u4F48\u666F\u4E3B\u984C"},{id:"lucide",label:"Lucide",description:"\u7C21\u6F54\u73FE\u4EE3\u7684\u4F48\u666F\u4E3B\u984C"}];}static ɵfac=function(n){return new(n||e)();};static ɵcmp=Pa$1({type:e,selectors:[["my-select-player-theme"]],inputs:{inputId:[1,"inputId"],mode:[1,"mode"],channel:[1,"channel"]},features:[c$([{provide:D$1,useExisting:af(()=>e),multi:true}])],decls:1,vars:3,consts:[["filter","false",3,"ngModelChange","inputId","items","ngModel"]],template:function(n,s){n&1&&(sp(0,"my-select-options",0),Mx("ngModelChange",function(a){return e$(s.selectedId,a)||(s.selectedId=a),a;}),Fp("ngModelChange",function(){return s.onModelChange();}),ub(),GH()),n&2&&(B0("inputId",s.inputId())("items",s.themes),Nx("ngModel",s.selectedId),WH());},dependencies:[Jn$1,qn$1,ln$1,Yl$1],encapsulation:2,changeDetection:1});}return e;})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{B,Cf as C,E,I,It as a,ct as c,ff as f,iu as i,ju as j,k,se as s,ut as u};//# sourceMappingURL=chunk-z1LC5-Xv.js.map