Your IP : 18.224.213.16
import{a as zo}from"./chunk-O6FCMJDP.js";import{a as Uo,b as Qs,c as Yo,d as Go}from"./chunk-SKX3CALC.js";import{a as $o,b as Xo}from"./chunk-XCB6Q7V4.js";import{a as Wo,e as Ho}from"./chunk-CPXWTLES.js";import{c as Vo,e as No}from"./chunk-BATIAXZ4.js";import{a as Fo,c as Ki}from"./chunk-M6DH5DPB.js";import{$a as ot,$b as q,Bb as Ae,C as ko,Ca as So,Cb as qt,Da as Oo,Ea as Po,Ia as Ui,Ka as Ct,L,La as Yi,M as Xt,Ma as be,Na as Do,Sa as To,Ta as Ao,Wa as Io,Z as pt,_a as nt,ba as E,bb as Lo,c as oi,ca as Zs,d as Wt,da as Js,e as vo,f as ri,fa as li,g as Co,k as Ht,l as $t,m as wo,ma as $,mc as Eo,na as U,oa as mt,oc as Bo,p as Wi,pa as Hi,q as Ut,qa as $i,qc as jo,r as Yt,sa as Gt,tb as Ro,ub as Xi,va as Kt,vb as Gi,xa as K,y as ai,z as Mo}from"./chunk-SXUPRFOU.js";import{G as At,H as Vi,S as _o,a as Vt,b as Nt,ba as Ni,ca as yo,g as M,t as at}from"./chunk-ERDNNTNA.js";var Zt=class{constructor({diagram:i,data:t,messages:s}){this.diagram=i,this.data=t,this.messages=s}};var wt=class wt{static getCssVarColor(i){return getComputedStyle(document.body).getPropertyValue(i).trim()}static getDatasetColor(i){let t=this.datasetColorList.length;return this.datasetColorList[i%t]}static getFontColor(){return this.getCssVarColor("--isp-dc-highway-star")}static getBackgroundColor(){return this.getCssVarColor("--isp-dc-monochrome")}static getGridColor(){return this.getCssVarColor("--isp-dc-charlie-chaplin")}static getBorderColor(){return this.getCssVarColor("--isp-dc-charlie-chaplin")}static getFont(i=14){return{family:"'Ubuntu', system-ui, sans-serif",size:i}}};wt.datasetColorList=[wt.getCssVarColor("--isp-c-c-3po"),wt.getCssVarColor("--isp-c-blue-velvet"),wt.getCssVarColor("--isp-c-grasshopper"),wt.getCssVarColor("--isp-c-mister-pink"),wt.getCssVarColor("--isp-c-happy-bob"),wt.getCssVarColor("--isp-c-odysseus"),wt.getCssVarColor("--isp-c-blue-frost")];var J=wt;var qi=class extends Zt{getDatasets(){return this.diagram.line.map(({$data:i},t)=>{let s=J.getDatasetColor(t);return{data:this.data.map(n=>parseInt(q.getElementOrigValue(i,n))),label:this.messages[i],backgroundColor:s,hoverBackgroundColor:s}})}getLabels(){return this.data.map(i=>q.getElementOrigValue(this.diagram.$label,i))}getOptions(){return{responsive:!0,maintainAspectRatio:!1,scales:{x:{type:"category",bounds:"ticks",ticks:{autoSkip:!0,autoSkipPadding:60,maxRotation:0,minRotation:0}},y:{bounds:"ticks",ticks:{autoSkip:!0,autoSkipPadding:30,maxRotation:0,minRotation:0}}}}}};function di(e){return e+.5|0}var Jt=(e,i,t)=>Math.max(Math.min(e,t),i);function ci(e){return Jt(di(e*2.55),0,255)}function Qt(e){return Jt(di(e*255),0,255)}function It(e){return Jt(di(e/2.55)/100,0,1)}function Ko(e){return Jt(di(e*100),0,100)}var xt={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},en=[..."0123456789ABCDEF"],Yc=e=>en[e&15],Xc=e=>en[(e&240)>>4]+en[e&15],Zi=e=>(e&240)>>4===(e&15),Gc=e=>Zi(e.r)&&Zi(e.g)&&Zi(e.b)&&Zi(e.a);function Kc(e){var i=e.length,t;return e[0]==="#"&&(i===4||i===5?t={r:255&xt[e[1]]*17,g:255&xt[e[2]]*17,b:255&xt[e[3]]*17,a:i===5?xt[e[4]]*17:255}:(i===7||i===9)&&(t={r:xt[e[1]]<<4|xt[e[2]],g:xt[e[3]]<<4|xt[e[4]],b:xt[e[5]]<<4|xt[e[6]],a:i===9?xt[e[7]]<<4|xt[e[8]]:255})),t}var qc=(e,i)=>e<255?i(e):"";function Zc(e){var i=Gc(e)?Yc:Xc;return e?"#"+i(e.r)+i(e.g)+i(e.b)+qc(e.a,i):void 0}var Jc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Qo(e,i,t){let s=i*Math.min(t,1-t),n=(o,r=(o+e/30)%12)=>t-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Qc(e,i,t){let s=(n,o=(n+e/60)%6)=>t-t*i*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function th(e,i,t){let s=Qo(e,1,.5),n;for(i+t>1&&(n=1/(i+t),i*=n,t*=n),n=0;n<3;n++)s[n]*=1-i-t,s[n]+=i;return s}function eh(e,i,t,s,n){return e===n?(i-t)/s+(i<t?6:0):i===n?(t-e)/s+2:(e-i)/s+4}function sn(e){let t=e.r/255,s=e.g/255,n=e.b/255,o=Math.max(t,s,n),r=Math.min(t,s,n),a=(o+r)/2,l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=eh(t,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function nn(e,i,t,s){return(Array.isArray(i)?e(i[0],i[1],i[2]):e(i,t,s)).map(Qt)}function on(e,i,t){return nn(Qo,e,i,t)}function ih(e,i,t){return nn(th,e,i,t)}function sh(e,i,t){return nn(Qc,e,i,t)}function tr(e){return(e%360+360)%360}function nh(e){let i=Jc.exec(e),t=255,s;if(!i)return;i[5]!==s&&(t=i[6]?ci(+i[5]):Qt(+i[5]));let n=tr(+i[2]),o=+i[3]/100,r=+i[4]/100;return i[1]==="hwb"?s=ih(n,o,r):i[1]==="hsv"?s=sh(n,o,r):s=on(n,o,r),{r:s[0],g:s[1],b:s[2],a:t}}function oh(e,i){var t=sn(e);t[0]=tr(t[0]+i),t=on(t),e.r=t[0],e.g=t[1],e.b=t[2]}function rh(e){if(!e)return;let i=sn(e),t=i[0],s=Ko(i[1]),n=Ko(i[2]);return e.a<255?`hsla(${t}, ${s}%, ${n}%, ${It(e.a)})`:`hsl(${t}, ${s}%, ${n}%)`}var qo={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"},Zo={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 ah(){let e={},i=Object.keys(Zo),t=Object.keys(qo),s,n,o,r,a;for(s=0;s<i.length;s++){for(r=a=i[s],n=0;n<t.length;n++)o=t[n],a=a.replace(o,qo[o]);o=parseInt(Zo[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}var Ji;function lh(e){Ji||(Ji=ah(),Ji.transparent=[0,0,0,0]);let i=Ji[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:i.length===4?i[3]:255}}var ch=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function hh(e){let i=ch.exec(e),t=255,s,n,o;if(i){if(i[7]!==s){let r=+i[7];t=i[8]?ci(r):Jt(r*255,0,255)}return s=+i[1],n=+i[3],o=+i[5],s=255&(i[2]?ci(s):Jt(s,0,255)),n=255&(i[4]?ci(n):Jt(n,0,255)),o=255&(i[6]?ci(o):Jt(o,0,255)),{r:s,g:n,b:o,a:t}}}function dh(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${It(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var tn=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ie=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function fh(e,i,t){let s=Ie(It(e.r)),n=Ie(It(e.g)),o=Ie(It(e.b));return{r:Qt(tn(s+t*(Ie(It(i.r))-s))),g:Qt(tn(n+t*(Ie(It(i.g))-n))),b:Qt(tn(o+t*(Ie(It(i.b))-o))),a:e.a+t*(i.a-e.a)}}function Qi(e,i,t){if(e){let s=sn(e);s[i]=Math.max(0,Math.min(s[i]+s[i]*t,i===0?360:1)),s=on(s),e.r=s[0],e.g=s[1],e.b=s[2]}}function er(e,i){return e&&Object.assign(i||{},e)}function Jo(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=Qt(e[3]))):(i=er(e,{r:0,g:0,b:0,a:1}),i.a=Qt(i.a)),i}function uh(e){return e.charAt(0)==="r"?hh(e):nh(e)}var hi=class e{constructor(i){if(i instanceof e)return i;let t=typeof i,s;t==="object"?s=Jo(i):t==="string"&&(s=Kc(i)||lh(i)||uh(i)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var i=er(this._rgb);return i&&(i.a=It(i.a)),i}set rgb(i){this._rgb=Jo(i)}rgbString(){return this._valid?dh(this._rgb):void 0}hexString(){return this._valid?Zc(this._rgb):void 0}hslString(){return this._valid?rh(this._rgb):void 0}mix(i,t){if(i){let s=this.rgb,n=i.rgb,o,r=t===o?.5:t,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(i,t){return i&&(this._rgb=fh(this._rgb,i._rgb,t)),this}clone(){return new e(this.rgb)}alpha(i){return this._rgb.a=Qt(i),this}clearer(i){let t=this._rgb;return t.a*=1-i,this}greyscale(){let i=this._rgb,t=di(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 Qi(this._rgb,2,i),this}darken(i){return Qi(this._rgb,2,-i),this}saturate(i){return Qi(this._rgb,1,i),this}desaturate(i){return Qi(this._rgb,1,-i),this}rotate(i){return oh(this._rgb,i),this}};function St(){}var fr=(()=>{let e=0;return()=>e++})();function I(e){return e===null||typeof e>"u"}function j(e){if(Array.isArray&&Array.isArray(e))return!0;let i=Object.prototype.toString.call(e);return i.slice(0,7)==="[object"&&i.slice(-6)==="Array]"}function T(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Y(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ct(e,i){return Y(e)?e:i}function O(e,i){return typeof e>"u"?i:e}var ur=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/i,cn=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*i:+e;function B(e,i,t){if(e&&typeof e.call=="function")return e.apply(t,i)}function R(e,i,t,s){let n,o,r;if(j(e))if(o=e.length,s)for(n=o-1;n>=0;n--)i.call(t,e[n],n);else for(n=0;n<o;n++)i.call(t,e[n],n);else if(T(e))for(r=Object.keys(e),o=r.length,n=0;n<o;n++)i.call(t,e[r[n]],r[n])}function pi(e,i){let t,s,n,o;if(!e||!i||e.length!==i.length)return!1;for(t=0,s=e.length;t<s;++t)if(n=e[t],o=i[t],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ss(e){if(j(e))return e.map(ss);if(T(e)){let i=Object.create(null),t=Object.keys(e),s=t.length,n=0;for(;n<s;++n)i[t[n]]=ss(e[t[n]]);return i}return e}function pr(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function ph(e,i,t,s){if(!pr(e))return;let n=i[e],o=t[e];T(n)&&T(o)?Re(n,o,s):i[e]=ss(o)}function Re(e,i,t){let s=j(i)?i:[i],n=s.length;if(!T(e))return e;t=t||{};let o=t.merger||ph,r;for(let a=0;a<n;++a){if(r=s[a],!T(r))continue;let l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],e,r,t)}return e}function Ee(e,i){return Re(e,i,{merger:gh})}function gh(e,i,t){if(!pr(e))return;let s=i[e],n=t[e];T(s)&&T(n)?Ee(s,n):Object.prototype.hasOwnProperty.call(i,e)||(i[e]=ss(n))}var ir={"":e=>e,x:e=>e.x,y:e=>e.y};function mh(e){let i=e.split("."),t=[],s="";for(let n of i)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(t.push(s),s="");return t}function xh(e){let i=mh(e);return t=>{for(let s of i){if(s==="")break;t=t&&t[s]}return t}}function Ft(e,i){return(ir[i]||(ir[i]=xh(i)))(e)}function as(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Be=e=>typeof e<"u",Lt=e=>typeof e=="function",hn=(e,i)=>{if(e.size!==i.size)return!1;for(let t of e)if(!i.has(t))return!1;return!0};function gr(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var V=Math.PI,N=2*V,bh=N+V,ns=Number.POSITIVE_INFINITY,_h=V/180,X=V/2,_e=V/4,sr=V*2/3,Rt=Math.log10,vt=Math.sign;function ze(e,i,t){return Math.abs(e-i)<t}function dn(e){let i=Math.round(e);e=ze(e,i,e/1e3)?i:e;let t=Math.pow(10,Math.floor(Rt(e))),s=e/t;return(s<=1?1:s<=2?2:s<=5?5:10)*t}function mr(e){let i=[],t=Math.sqrt(e),s;for(s=1;s<t;s++)e%s===0&&(i.push(s),i.push(e/s));return t===(t|0)&&i.push(t),i.sort((n,o)=>n-o).pop(),i}function Ce(e){return!isNaN(parseFloat(e))&&isFinite(e)}function xr(e,i){let t=Math.round(e);return t-i<=e&&t+i>=e}function fn(e,i,t){let s,n,o;for(s=0,n=e.length;s<n;s++)o=e[s][t],isNaN(o)||(i.min=Math.min(i.min,o),i.max=Math.max(i.max,o))}function bt(e){return e*(V/180)}function ls(e){return e*(180/V)}function un(e){if(!Y(e))return;let i=1,t=0;for(;Math.round(e*i)/i!==e;)i*=10,t++;return t}function pn(e,i){let t=i.x-e.x,s=i.y-e.y,n=Math.sqrt(t*t+s*s),o=Math.atan2(s,t);return o<-.5*V&&(o+=N),{angle:o,distance:n}}function os(e,i){return Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2))}function yh(e,i){return(e-i+bh)%N-V}function lt(e){return(e%N+N)%N}function je(e,i,t,s){let n=lt(e),o=lt(i),r=lt(t),a=lt(o-n),l=lt(r-n),c=lt(n-o),h=lt(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function Q(e,i,t){return Math.max(i,Math.min(t,e))}function br(e){return Q(e,-32768,32767)}function Ot(e,i,t,s=1e-6){return e>=Math.min(i,t)-s&&e<=Math.max(i,t)+s}function cs(e,i,t){t=t||(r=>e[r]<i);let s=e.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,t(o)?n=o:s=o;return{lo:n,hi:s}}var Mt=(e,i,t,s)=>cs(e,t,s?n=>{let o=e[n][i];return o<t||o===t&&e[n+1][i]===t}:n=>e[n][i]<t),_r=(e,i,t)=>cs(e,t,s=>e[s][i]>=t);function yr(e,i,t){let s=0,n=e.length;for(;s<n&&e[s]<i;)s++;for(;n>s&&e[n-1]>t;)n--;return s>0||n<e.length?e.slice(s,n):e}var vr=["push","pop","shift","splice","unshift"];function Cr(e,i){if(e._chartjs){e._chartjs.listeners.push(i);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[i]}}),vr.forEach(t=>{let s="_onData"+as(t),n=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...o){let r=n.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function gn(e,i){let t=e._chartjs;if(!t)return;let s=t.listeners,n=s.indexOf(i);n!==-1&&s.splice(n,1),!(s.length>0)&&(vr.forEach(o=>{delete e[o]}),delete e._chartjs)}function mn(e){let i=new Set(e);return i.size===e.length?e:Array.from(i)}var xn=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function bn(e,i){let t=[],s=!1;return function(...n){t=n,s||(s=!0,xn.call(window,()=>{s=!1,e.apply(i,t)}))}}function wr(e,i){let t;return function(...s){return i?(clearTimeout(t),t=setTimeout(e,i,s)):e.apply(this,s),i}}var hs=e=>e==="start"?"left":e==="end"?"right":"center",et=(e,i,t)=>e==="start"?i:e==="end"?t:(i+t)/2,Mr=(e,i,t,s)=>e===(s?"left":"right")?t:e==="center"?(i+t)/2:i;function _n(e,i,t){let s=i.length,n=0,o=s;if(e._sorted){let{iScale:r,_parsed:a}=e,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:f}=r.getUserBounds();d&&(n=Q(Math.min(Mt(a,l,c).lo,t?s:Mt(i,l,r.getPixelForValue(c)).lo),0,s-1)),f?o=Q(Math.max(Mt(a,r.axis,h,!0).hi+1,t?0:Mt(i,l,r.getPixelForValue(h),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function yn(e){let{xScale:i,yScale:t,_scaleRanges:s}=e,n={xmin:i.min,xmax:i.max,ymin:t.min,ymax:t.max};if(!s)return e._scaleRanges=n,!0;let o=s.xmin!==i.min||s.xmax!==i.max||s.ymin!==t.min||s.ymax!==t.max;return Object.assign(s,n),o}var ts=e=>e===0||e===1,nr=(e,i,t)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-i)*N/t)),or=(e,i,t)=>Math.pow(2,-10*e)*Math.sin((e-i)*N/t)+1,Le={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.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:-.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*X)+1,easeOutSine:e=>Math.sin(e*X),easeInOutSine:e=>-.5*(Math.cos(V*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=>ts(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?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ts(e)?e:nr(e,.075,.3),easeOutElastic:e=>ts(e)?e:or(e,.075,.3),easeInOutElastic(e){return ts(e)?e:e<.5?.5*nr(e*2,.1125,.45):.5+.5*or(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-Le.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?Le.easeInBounce(e*2)*.5:Le.easeOutBounce(e*2-1)*.5+.5};function vn(e){if(e&&typeof e=="object"){let i=e.toString();return i==="[object CanvasPattern]"||i==="[object CanvasGradient]"}return!1}function Cn(e){return vn(e)?e:new hi(e)}function rn(e){return vn(e)?e:new hi(e).saturate(.5).darken(.1).hexString()}var vh=["x","y","borderWidth","radius","tension"],Ch=["color","borderColor","backgroundColor"];function wh(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:!1,_indexable:!1,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"}),e.set("animations",{colors:{type:"color",properties:Ch},numbers:{type:"number",properties:vh}}),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 Mh(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var rr=new Map;function kh(e,i){i=i||{};let t=e+JSON.stringify(i),s=rr.get(t);return s||(s=new Intl.NumberFormat(e,i),rr.set(t,s)),s}function Ve(e,i,t){return kh(i,t).format(e)}var kr={values(e){return j(e)?e:""+e},numeric(e,i,t){if(e===0)return"0";let s=this.chart.options.locale,n,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)&&(n="scientific"),o=Sh(e,t)}let r=Rt(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ve(e,s,l)},logarithmic(e,i,t){if(e===0)return"0";let s=t[i].significand||e/Math.pow(10,Math.floor(Rt(e)));return[1,2,3,5,10,15].includes(s)||i>.8*t.length?kr.numeric.call(this,e,i,t):""}};function Sh(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 gi={formatters:kr};function Oh(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:gi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,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:!1,_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 ee=Object.create(null),ds=Object.create(null);function fi(e,i){if(!i)return e;let t=i.split(".");for(let s=0,n=t.length;s<n;++s){let o=t[s];e=e[o]||(e[o]=Object.create(null))}return e}function an(e,i,t){return typeof i=="string"?Re(fi(e,i),t):Re(fi(e,""),i)}var ln=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=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>rn(n.backgroundColor),this.hoverBorderColor=(s,n)=>rn(n.borderColor),this.hoverColor=(s,n)=>rn(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(i),this.apply(t)}set(i,t){return an(this,i,t)}get(i){return fi(this,i)}describe(i,t){return an(ds,i,t)}override(i,t){return an(ee,i,t)}route(i,t,s,n){let o=fi(this,i),r=fi(this,s),a="_"+t;Object.defineProperties(o,{[a]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){let l=this[a],c=r[n];return T(l)?Object.assign({},c,l):O(l,c)},set(l){this[a]=l}}})}apply(i){i.forEach(t=>t(this))}},z=new ln({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[wh,Mh,Oh]);function Ph(e){return!e||I(e.size)||I(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ui(e,i,t,s,n){let o=i[n];return o||(o=i[n]=e.measureText(n).width,t.push(n)),o>s&&(s=o),s}function Sr(e,i,t,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==i&&(n=s.data={},o=s.garbageCollect=[],s.font=i),e.save(),e.font=i;let r=0,a=t.length,l,c,h,d,f;for(l=0;l<a;l++)if(d=t[l],d!=null&&!j(d))r=ui(e,n,o,r,d);else if(j(d))for(c=0,h=d.length;c<h;c++)f=d[c],f!=null&&!j(f)&&(r=ui(e,n,o,r,f));e.restore();let u=o.length/2;if(u>t.length){for(l=0;l<u;l++)delete n[o[l]];o.splice(0,u)}return r}function ie(e,i,t){let s=e.currentDevicePixelRatio,n=t!==0?Math.max(t/2,.5):0;return Math.round((i-n)*s)/s+n}function wn(e,i){!i&&!e||(i=i||e.getContext("2d"),i.save(),i.resetTransform(),i.clearRect(0,0,e.width,e.height),i.restore())}function fs(e,i,t,s){Mn(e,i,t,s,null)}function Mn(e,i,t,s,n){let o,r,a,l,c,h,d,f,u=i.pointStyle,p=i.rotation,g=i.radius,m=(p||0)*_h;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(t,s),e.rotate(m),e.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),u){default:n?e.ellipse(t,s,n/2,g,0,0,N):e.arc(t,s,g,0,N),e.closePath();break;case"triangle":h=n?n/2:g,e.moveTo(t+Math.sin(m)*h,s-Math.cos(m)*g),m+=sr,e.lineTo(t+Math.sin(m)*h,s-Math.cos(m)*g),m+=sr,e.lineTo(t+Math.sin(m)*h,s-Math.cos(m)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+_e)*l,d=Math.cos(m+_e)*(n?n/2-c:l),a=Math.sin(m+_e)*l,f=Math.sin(m+_e)*(n?n/2-c:l),e.arc(t-d,s-a,c,m-V,m-X),e.arc(t+f,s-r,c,m-X,m),e.arc(t+d,s+a,c,m,m+X),e.arc(t-f,s+r,c,m+X,m+V),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,e.rect(t-h,s-l,2*h,2*l);break}m+=_e;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),e.moveTo(t-d,s-a),e.lineTo(t+f,s-r),e.lineTo(t+d,s+a),e.lineTo(t-f,s+r),e.closePath();break;case"crossRot":m+=_e;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),e.moveTo(t-d,s-a),e.lineTo(t+d,s+a),e.moveTo(t+f,s-r),e.lineTo(t-f,s+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),e.moveTo(t-d,s-a),e.lineTo(t+d,s+a),e.moveTo(t+f,s-r),e.lineTo(t-f,s+r),m+=_e,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),e.moveTo(t-d,s-a),e.lineTo(t+d,s+a),e.moveTo(t+f,s-r),e.lineTo(t-f,s+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,e.moveTo(t-r,s-a),e.lineTo(t+r,s+a);break;case"dash":e.moveTo(t,s),e.lineTo(t+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:e.closePath();break}e.fill(),i.borderWidth>0&&e.stroke()}}function kt(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 mi(e,i){e.save(),e.beginPath(),e.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),e.clip()}function xi(e){e.restore()}function Or(e,i,t,s,n){if(!i)return e.lineTo(t.x,t.y);if(n==="middle"){let o=(i.x+t.x)/2;e.lineTo(o,i.y),e.lineTo(o,t.y)}else n==="after"!=!!s?e.lineTo(i.x,t.y):e.lineTo(t.x,i.y);e.lineTo(t.x,t.y)}function Pr(e,i,t,s){if(!i)return e.lineTo(t.x,t.y);e.bezierCurveTo(s?i.cp1x:i.cp2x,s?i.cp1y:i.cp2y,s?t.cp2x:t.cp1x,s?t.cp2y:t.cp1y,t.x,t.y)}function Dh(e,i){i.translation&&e.translate(i.translation[0],i.translation[1]),I(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 Th(e,i,t,s,n){if(n.strikethrough||n.underline){let o=e.measureText(s),r=i-o.actualBoundingBoxLeft,a=i+o.actualBoundingBoxRight,l=t-o.actualBoundingBoxAscent,c=t+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=n.decorationWidth||2,e.moveTo(r,h),e.lineTo(a,h),e.stroke()}}function Ah(e,i){let t=e.fillStyle;e.fillStyle=i.color,e.fillRect(i.left,i.top,i.width,i.height),e.fillStyle=t}function se(e,i,t,s,n,o={}){let r=j(i)?i:[i],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=n.string,Dh(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Ah(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),I(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,t,s,o.maxWidth)),e.fillText(c,t,s,o.maxWidth),Th(e,t,s,c,o),s+=Number(n.lineHeight);e.restore()}function Ne(e,i){let{x:t,y:s,w:n,h:o,radius:r}=i;e.arc(t+r.topLeft,s+r.topLeft,r.topLeft,1.5*V,V,!0),e.lineTo(t,s+o-r.bottomLeft),e.arc(t+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,V,X,!0),e.lineTo(t+n-r.bottomRight,s+o),e.arc(t+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,X,0,!0),e.lineTo(t+n,s+r.topRight),e.arc(t+n-r.topRight,s+r.topRight,r.topRight,0,-X,!0),e.lineTo(t+r.topLeft,s)}var Ih=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Lh=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Rh(e,i){let t=(""+e).match(Ih);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 Fh=e=>+e||0;function us(e,i){let t={},s=T(i),n=s?Object.keys(i):i,o=T(e)?s?r=>O(e[r],e[i[r]]):r=>e[r]:()=>e;for(let r of n)t[r]=Fh(o(r));return t}function kn(e){return us(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ne(e){return us(e,["topLeft","topRight","bottomLeft","bottomRight"])}function it(e){let i=kn(e);return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function Z(e,i){e=e||{},i=i||z.font;let t=O(e.size,i.size);typeof t=="string"&&(t=parseInt(t,10));let s=O(e.style,i.style);s&&!(""+s).match(Lh)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let n={family:O(e.family,i.family),lineHeight:Rh(O(e.lineHeight,i.lineHeight),t),size:t,style:s,weight:O(e.weight,i.weight),string:""};return n.string=Ph(n),n}function We(e,i,t,s){let n=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(i!==void 0&&typeof a=="function"&&(a=a(i),n=!1),t!==void 0&&j(a)&&(a=a[t%a.length],n=!1),a!==void 0))return s&&!n&&(s.cacheable=!1),a}function Dr(e,i,t){let{min:s,max:n}=e,o=cn(i,(n-s)/2),r=(a,l)=>t&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function Et(e,i){return Object.assign(Object.create(e),i)}function ps(e,i=[""],t,s,n=()=>e[0]){let o=t||e;typeof s>"u"&&(s=Ir("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>ps([a,...e],i,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return Tr(a,l,()=>Hh(l,i,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return lr(a).includes(l)},ownKeys(a){return lr(a)},set(a,l,c){let h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function ve(e,i,t,s){let n={_cacheable:!1,_proxy:e,_context:i,_subProxy:t,_stack:new Set,_descriptors:Sn(e,s),setContext:o=>ve(e,o,t,s),override:o=>ve(e.override(o),i,t,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return Tr(o,r,()=>Bh(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function Sn(e,i={scriptable:!0,indexable:!0}){let{_scriptable:t=i.scriptable,_indexable:s=i.indexable,_allKeys:n=i.allKeys}=e;return{allKeys:n,scriptable:t,indexable:s,isScriptable:Lt(t)?t:()=>t,isIndexable:Lt(s)?s:()=>s}}var Eh=(e,i)=>e?e+as(i):i,On=(e,i)=>T(i)&&e!=="adapters"&&(Object.getPrototypeOf(i)===null||i.constructor===Object);function Tr(e,i,t){if(Object.prototype.hasOwnProperty.call(e,i)||i==="constructor")return e[i];let s=t();return e[i]=s,s}function Bh(e,i,t){let{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=e,a=s[i];return Lt(a)&&r.isScriptable(i)&&(a=zh(i,a,e,t)),j(a)&&a.length&&(a=jh(i,a,e,r.isIndexable)),On(i,a)&&(a=ve(a,n,o&&o[i],r)),a}function zh(e,i,t,s){let{_proxy:n,_context:o,_subProxy:r,_stack:a}=t;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=i(o,r||s);return a.delete(e),On(e,l)&&(l=Pn(n._scopes,n,e,l)),l}function jh(e,i,t,s){let{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=t;if(typeof o.index<"u"&&s(e))return i[o.index%i.length];if(T(i[0])){let l=i,c=n._scopes.filter(h=>h!==l);i=[];for(let h of l){let d=Pn(c,n,e,h);i.push(ve(d,o,r&&r[e],a))}}return i}function Ar(e,i,t){return Lt(e)?e(i,t):e}var Vh=(e,i)=>e===!0?i:typeof e=="string"?Ft(i,e):void 0;function Nh(e,i,t,s,n){for(let o of i){let r=Vh(t,o);if(r){e.add(r);let a=Ar(r._fallback,t,n);if(typeof a<"u"&&a!==t&&a!==s)return a}else if(r===!1&&typeof s<"u"&&t!==s)return null}return!1}function Pn(e,i,t,s){let n=i._rootScopes,o=Ar(i._fallback,t,s),r=[...e,...n],a=new Set;a.add(s);let l=ar(a,r,t,o||t,s);return l===null||typeof o<"u"&&o!==t&&(l=ar(a,r,o,l,s),l===null)?!1:ps(Array.from(a),[""],n,o,()=>Wh(i,t,s))}function ar(e,i,t,s,n){for(;t;)t=Nh(e,i,t,s,n);return t}function Wh(e,i,t){let s=e._getTarget();i in s||(s[i]={});let n=s[i];return j(n)&&T(t)?t:n||{}}function Hh(e,i,t,s){let n;for(let o of i)if(n=Ir(Eh(o,e),t),typeof n<"u")return On(e,n)?Pn(t,s,e,n):n}function Ir(e,i){for(let t of i){if(!t)continue;let s=t[e];if(typeof s<"u")return s}}function lr(e){let i=e._keys;return i||(i=e._keys=$h(e._scopes)),i}function $h(e){let i=new Set;for(let t of e)for(let s of Object.keys(t).filter(n=>!n.startsWith("_")))i.add(s);return Array.from(i)}function Dn(e,i,t,s){let{iScale:n}=e,{key:o="r"}=this._parsing,r=new Array(s),a,l,c,h;for(a=0,l=s;a<l;++a)c=a+t,h=i[c],r[a]={r:n.parse(Ft(h,o),c)};return r}var Uh=Number.EPSILON||1e-14,Fe=(e,i)=>i<e.length&&!e[i].skip&&e[i],Lr=e=>e==="x"?"y":"x";function Yh(e,i,t,s){let n=e.skip?i:e,o=i,r=t.skip?i:t,a=os(o,n),l=os(r,o),c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let d=s*c,f=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+f*(r.x-n.x),y:o.y+f*(r.y-n.y)}}}function Xh(e,i,t){let s=e.length,n,o,r,a,l,c=Fe(e,0);for(let h=0;h<s-1;++h)if(l=c,c=Fe(e,h+1),!(!l||!c)){if(ze(i[h],0,Uh)){t[h]=t[h+1]=0;continue}n=t[h]/i[h],o=t[h+1]/i[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),t[h]=n*r*i[h],t[h+1]=o*r*i[h])}}function Gh(e,i,t="x"){let s=Lr(t),n=e.length,o,r,a,l=Fe(e,0);for(let c=0;c<n;++c){if(r=a,a=l,l=Fe(e,c+1),!a)continue;let h=a[t],d=a[s];r&&(o=(h-r[t])/3,a[`cp1${t}`]=h-o,a[`cp1${s}`]=d-o*i[c]),l&&(o=(l[t]-h)/3,a[`cp2${t}`]=h+o,a[`cp2${s}`]=d+o*i[c])}}function Kh(e,i="x"){let t=Lr(i),s=e.length,n=Array(s).fill(0),o=Array(s),r,a,l,c=Fe(e,0);for(r=0;r<s;++r)if(a=l,l=c,c=Fe(e,r+1),!!l){if(c){let h=c[i]-l[i];n[r]=h!==0?(c[t]-l[t])/h:0}o[r]=a?c?vt(n[r-1])!==vt(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}Xh(e,n,o),Gh(e,o,i)}function es(e,i,t){return Math.max(Math.min(e,t),i)}function qh(e,i){let t,s,n,o,r,a=kt(e[0],i);for(t=0,s=e.length;t<s;++t)r=o,o=a,a=t<s-1&&kt(e[t+1],i),o&&(n=e[t],r&&(n.cp1x=es(n.cp1x,i.left,i.right),n.cp1y=es(n.cp1y,i.top,i.bottom)),a&&(n.cp2x=es(n.cp2x,i.left,i.right),n.cp2y=es(n.cp2y,i.top,i.bottom)))}function Rr(e,i,t,s,n){let o,r,a,l;if(i.spanGaps&&(e=e.filter(c=>!c.skip)),i.cubicInterpolationMode==="monotone")Kh(e,n);else{let c=s?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=Yh(c,a,e[Math.min(o+1,r-(s?0:1))%r],i.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}i.capBezierPoints&&qh(e,t)}function gs(){return typeof window<"u"&&typeof document<"u"}function ms(e){let i=e.parentNode;return i&&i.toString()==="[object ShadowRoot]"&&(i=i.host),i}function rs(e,i,t){let s;return typeof e=="string"?(s=parseInt(e,10),e.indexOf("%")!==-1&&(s=s/100*i.parentNode[t])):s=e,s}var xs=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Zh(e,i){return xs(e).getPropertyValue(i)}var Jh=["top","right","bottom","left"];function ye(e,i,t){let s={};t=t?"-"+t:"";for(let n=0;n<4;n++){let o=Jh[n];s[o]=parseFloat(e[i+"-"+o+t])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}var Qh=(e,i,t)=>(e>0||i>0)&&(!t||!t.shadowRoot);function td(e,i){let t=e.touches,s=t&&t.length?t[0]:e,{offsetX:n,offsetY:o}=s,r=!1,a,l;if(Qh(n,o,e.target))a=n,l=o;else{let c=i.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function oe(e,i){if("native"in e)return e;let{canvas:t,currentDevicePixelRatio:s}=i,n=xs(t),o=n.boxSizing==="border-box",r=ye(n,"padding"),a=ye(n,"border","width"),{x:l,y:c,box:h}=td(e,t),d=r.left+(h&&a.left),f=r.top+(h&&a.top),{width:u,height:p}=i;return o&&(u-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/u*t.width/s),y:Math.round((c-f)/p*t.height/s)}}function ed(e,i,t){let s,n;if(i===void 0||t===void 0){let o=e&&ms(e);if(!o)i=e.clientWidth,t=e.clientHeight;else{let r=o.getBoundingClientRect(),a=xs(o),l=ye(a,"border","width"),c=ye(a,"padding");i=r.width-c.width-l.width,t=r.height-c.height-l.height,s=rs(a.maxWidth,o,"clientWidth"),n=rs(a.maxHeight,o,"clientHeight")}}return{width:i,height:t,maxWidth:s||ns,maxHeight:n||ns}}var is=e=>Math.round(e*10)/10;function Fr(e,i,t,s){let n=xs(e),o=ye(n,"margin"),r=rs(n.maxWidth,e,"clientWidth")||ns,a=rs(n.maxHeight,e,"clientHeight")||ns,l=ed(e,i,t),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let f=ye(n,"border","width"),u=ye(n,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=is(Math.min(c,r,l.maxWidth)),h=is(Math.min(h,a,l.maxHeight)),c&&!h&&(h=is(c/2)),(i!==void 0||t!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=is(Math.floor(h*s))),{width:c,height:h}}function Tn(e,i,t){let s=i||1,n=Math.floor(e.height*s),o=Math.floor(e.width*s);e.height=Math.floor(e.height),e.width=Math.floor(e.width);let r=e.canvas;return r.style&&(t||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(e.currentDevicePixelRatio=s,r.height=n,r.width=o,e.ctx.setTransform(s,0,0,s,0,0),!0):!1}var Er=function(){let e=!1;try{let i={get passive(){return e=!0,!1}};gs()&&(window.addEventListener("test",null,i),window.removeEventListener("test",null,i))}catch{}return e}();function An(e,i){let t=Zh(e,i),s=t&&t.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function te(e,i,t,s){return{x:e.x+t*(i.x-e.x),y:e.y+t*(i.y-e.y)}}function Br(e,i,t,s){return{x:e.x+t*(i.x-e.x),y:s==="middle"?t<.5?e.y:i.y:s==="after"?t<1?e.y:i.y:t>0?i.y:e.y}}function zr(e,i,t,s){let n={x:e.cp2x,y:e.cp2y},o={x:i.cp1x,y:i.cp1y},r=te(e,n,t),a=te(n,o,t),l=te(o,i,t),c=te(r,a,t),h=te(a,l,t);return te(c,h,t)}var id=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,s){return t-s},leftForLtr(t,s){return t-s}}},sd=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,i){return e+i},leftForLtr(e,i){return e}}};function we(e,i,t){return e?id(i,t):sd()}function In(e,i){let t,s;(i==="ltr"||i==="rtl")&&(t=e.canvas.style,s=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",i,"important"),e.prevTextDirection=s)}function Ln(e,i){i!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",i[0],i[1]))}function jr(e){return e==="angle"?{between:je,compare:yh,normalize:lt}:{between:Ot,compare:(i,t)=>i-t,normalize:i=>i}}function cr({start:e,end:i,count:t,loop:s,style:n}){return{start:e%t,end:i%t,loop:s&&(i-e+1)%t===0,style:n}}function nd(e,i,t){let{property:s,start:n,end:o}=t,{between:r,normalize:a}=jr(s),l=i.length,{start:c,end:h,loop:d}=e,f,u;if(d){for(c+=l,h+=l,f=0,u=l;f<u&&r(a(i[c%l][s]),n,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:e.style}}function Rn(e,i,t){if(!t)return[e];let{property:s,start:n,end:o}=t,r=i.length,{compare:a,between:l,normalize:c}=jr(s),{start:h,end:d,loop:f,style:u}=nd(e,i,t),p=[],g=!1,m=null,b,x,y,C=()=>l(n,y,b)&&a(n,y)!==0,_=()=>a(o,b)===0||l(o,y,b),v=()=>g||C(),k=()=>!g||_();for(let w=h,S=h;w<=d;++w)x=i[w%r],!x.skip&&(b=c(x[s]),b!==y&&(g=l(b,n,o),m===null&&v()&&(m=a(b,n)===0?w:S),m!==null&&k()&&(p.push(cr({start:m,end:w,loop:f,count:r,style:u})),m=null),S=w,y=b));return m!==null&&p.push(cr({start:m,end:d,loop:f,count:r,style:u})),p}function Fn(e,i){let t=[],s=e.segments;for(let n=0;n<s.length;n++){let o=Rn(s[n],e.points,i);o.length&&t.push(...o)}return t}function od(e,i,t,s){let n=0,o=i-1;if(t&&!s)for(;n<i&&!e[n].skip;)n++;for(;n<i&&e[n].skip;)n++;for(n%=i,t&&(o+=n);o>n&&e[o%i].skip;)o--;return o%=i,{start:n,end:o}}function rd(e,i,t,s){let n=e.length,o=[],r=i,a=e[i],l;for(l=i+1;l<=t;++l){let c=e[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:i%n,end:(l-1)%n,loop:s}),i=r=c.stop?l:null):(r=l,a.skip&&(i=l)),a=c}return r!==null&&o.push({start:i%n,end:r%n,loop:s}),o}function Vr(e,i){let t=e.points,s=e.options.spanGaps,n=t.length;if(!n)return[];let o=!!e._loop,{start:r,end:a}=od(t,n,o,s);if(s===!0)return hr(e,[{start:r,end:a,loop:o}],t,i);let l=a<r?a+n:a,c=!!e._fullLoop&&r===0&&a===n-1;return hr(e,rd(t,r,l,c),t,i)}function hr(e,i,t,s){return!s||!s.setContext||!t?i:ad(e,i,t,s)}function ad(e,i,t,s){let n=e._chart.getContext(),o=dr(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=t.length,c=[],h=o,d=i[0].start,f=d;function u(p,g,m,b){let x=a?-1:1;if(p!==g){for(p+=l;t[p%l].skip;)p-=x;for(;t[g%l].skip;)g+=x;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=a?d:p.start;let g=t[d%l],m;for(f=d+1;f<=p.end;f++){let b=t[f%l];m=dr(s.setContext(Et(n,{type:"segment",p0:g,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),ld(m,h)&&u(d,f-1,p.loop,h),g=b,h=m}d<f-1&&u(d,f-1,p.loop,h)}return c}function dr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function ld(e,i){if(!i)return!1;let t=[],s=function(n,o){return vn(o)?(t.includes(o)||t.push(o),t.indexOf(o)):o};return JSON.stringify(e,s)!==JSON.stringify(i,s)}var Yn=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(i,t,s,n){let o=t.listeners[n],r=t.duration;o.forEach(a=>a({chart:i,initial:t.initial,numSteps:r,currentStep:Math.min(s-t.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=xn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(i=Date.now()){let t=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;let o=s.items,r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(i),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,i,"progress")),o.length||(s.running=!1,this._notify(n,s,i,"complete"),s.initial=!1),t+=o.length}),this._lastDate=i,t===0&&(this._running=!1)}_getAnims(i){let t=this._charts,s=t.get(i);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(i,s)),s}listen(i,t,s){this._getAnims(i).listeners[t].push(s)}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=!0,t.start=Date.now(),t.duration=t.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(i){if(!this._running)return!1;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 s=t.items,n=s.length-1;for(;n>=0;--n)s[n].cancel();t.items=[],this._notify(i,t,Date.now(),"complete")}remove(i){return this._charts.delete(i)}},Bt=new Yn,Nr="transparent",cd={boolean(e,i,t){return t>.5?i:e},color(e,i,t){let s=Cn(e||Nr),n=s.valid&&Cn(i||Nr);return n&&n.valid?n.mix(s,t).hexString():i},number(e,i,t){return e+(i-e)*t}},Xn=class{constructor(i,t,s,n){let o=t[s];n=We([i.to,n,o,i.from]);let r=We([i.from,o,n]);this._active=!0,this._fn=i.fn||cd[i.type||typeof r],this._easing=Le[i.easing]||Le.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=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(i,t,s){if(this._active){this._notify(!1);let n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,i.duration)),this._total+=o,this._loop=!!i.loop,this._to=We([i.to,t,n,i.from]),this._from=We([i.from,n,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(i){let t=i-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||t<s),!this._active){this._target[n]=a,this._notify(!0);return}if(t<0){this._target[n]=o;return}l=t/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){let i=this._promises||(this._promises=[]);return new Promise((t,s)=>{i.push({res:t,rej:s})})}_notify(i){let t=i?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][t]()}},Os=class{constructor(i,t){this._chart=i,this._properties=new Map,this.configure(t)}configure(i){if(!T(i))return;let t=Object.keys(z.animation),s=this._properties;Object.getOwnPropertyNames(i).forEach(n=>{let o=i[n];if(!T(o))return;let r={};for(let a of t)r[a]=o[a];(j(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(i,t){let s=t.options,n=dd(i,s);if(!n)return[];let o=this._createAnimations(n,s);return s.$shared&&hd(i.options.$animations,s).then(()=>{i.options=s},()=>{}),o}_createAnimations(i,t){let s=this._properties,n=[],o=i.$animations||(i.$animations={}),r=Object.keys(t),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(i,t));continue}let h=t[c],d=o[c],f=s.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){i[c]=h;continue}o[c]=d=new Xn(f,i,c,h),n.push(d)}return n}update(i,t){if(this._properties.size===0){Object.assign(i,t);return}let s=this._createAnimations(i,t);if(s.length)return Bt.add(this._chart,s),!0}};function hd(e,i){let t=[],s=Object.keys(i);for(let n=0;n<s.length;n++){let o=e[s[n]];o&&o.active()&&t.push(o.wait())}return Promise.all(t)}function dd(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:!1,$animations:{}})),t}function Wr(e,i){let t=e&&e.options||{},s=t.reverse,n=t.min===void 0?i:0,o=t.max===void 0?i:0;return{start:s?o:n,end:s?n:o}}function fd(e,i,t){if(t===!1)return!1;let s=Wr(e,t),n=Wr(i,t);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function ud(e){let i,t,s,n;return T(e)?(i=e.top,t=e.right,s=e.bottom,n=e.left):i=t=s=n=e,{top:i,right:t,bottom:s,left:n,disabled:e===!1}}function Na(e,i){let t=[],s=e._getSortedDatasetMetas(i),n,o;for(n=0,o=s.length;n<o;++n)t.push(s[n].index);return t}function Hr(e,i,t,s={}){let n=e.keys,o=s.mode==="single",r,a,l,c;if(i===null)return;let h=!1;for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===t){if(h=!0,s.all)continue;break}c=e.values[l],Y(c)&&(o||i===0||vt(i)===vt(c))&&(i+=c)}return!h&&!s.all?0:i}function pd(e,i){let{iScale:t,vScale:s}=i,n=t.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[n]:h,[o]:e[h]};return a}function En(e,i){let t=e&&e.options.stacked;return t||t===void 0&&i.stack!==void 0}function gd(e,i,t){return`${e.id}.${i.id}.${t.stack||t.type}`}function md(e){let{min:i,max:t,minDefined:s,maxDefined:n}=e.getUserBounds();return{min:s?i:Number.NEGATIVE_INFINITY,max:n?t:Number.POSITIVE_INFINITY}}function xd(e,i,t){let s=e[i]||(e[i]={});return s[t]||(s[t]={})}function $r(e,i,t,s){for(let n of i.getMatchingVisibleMetas(s).reverse()){let o=e[n.index];if(t&&o>0||!t&&o<0)return n.index}return null}function Ur(e,i){let{chart:t,_cachedMeta:s}=e,n=t._stacks||(t._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=gd(o,r,s),d=i.length,f;for(let u=0;u<d;++u){let p=i[u],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});f=b[c]=xd(n,h,g),f[a]=m,f._top=$r(f,r,!0,s.type),f._bottom=$r(f,r,!1,s.type);let x=f._visualValues||(f._visualValues={});x[a]=m}}function Bn(e,i){let t=e.scales;return Object.keys(t).filter(s=>t[s].axis===i).shift()}function bd(e,i){return Et(e,{active:!1,dataset:void 0,datasetIndex:i,index:i,mode:"default",type:"dataset"})}function _d(e,i,t){return Et(e,{active:!1,dataIndex:i,parsed:void 0,raw:void 0,element:t,index:i,mode:"default",type:"data"})}function bi(e,i){let t=e.controller.index,s=e.vScale&&e.vScale.axis;if(s){i=i||e._parsed;for(let n of i){let o=n._stacks;if(!o||o[s]===void 0||o[s][t]===void 0)return;delete o[s][t],o[s]._visualValues!==void 0&&o[s]._visualValues[t]!==void 0&&delete o[s]._visualValues[t]}}}var zn=e=>e==="reset"||e==="none",Yr=(e,i)=>i?e:Object.assign({},e),yd=(e,i,t)=>e&&!i.hidden&&i._stacked&&{keys:Na(t,!0),values:null},ae=(()=>{class e{constructor(t,s){this.chart=t,this._ctx=t.ctx,this.index=s,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=En(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&&bi(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,s=this._cachedMeta,n=this.getDataset(),o=(f,u,p,g)=>f==="x"?u:f==="r"?g:p,r=s.xAxisID=O(n.xAxisID,Bn(t,"x")),a=s.yAxisID=O(n.yAxisID,Bn(t,"y")),l=s.rAxisID=O(n.rAxisID,Bn(t,"r")),c=s.indexAxis,h=s.iAxisID=o(c,r,a,l),d=s.vAxisID=o(c,a,r,l);s.xScale=this.getScaleForId(r),s.yScale=this.getScaleForId(a),s.rScale=this.getScaleForId(l),s.iScale=this.getScaleForId(h),s.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 s=this._cachedMeta;return t===s.iScale?s.vScale:s.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&gn(this._data,this),t._stacked&&bi(t)}_dataCheck(){let t=this.getDataset(),s=t.data||(t.data=[]),n=this._data;if(T(s)){let o=this._cachedMeta;this._data=pd(s,o)}else if(n!==s){if(n){gn(n,this);let o=this._cachedMeta;bi(o),o._parsed=[]}s&&Object.isExtensible(s)&&Cr(s,this),this._syncList=[],this._data=s}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let s=this._cachedMeta,n=this.getDataset(),o=!1;this._dataCheck();let r=s._stacked;s._stacked=En(s.vScale,s),s.stack!==n.stack&&(o=!0,bi(s),s.stack=n.stack),this._resyncElements(t),(o||r!==s._stacked)&&(Ur(this,s._parsed),s._stacked=En(s.vScale,s))}configure(){let t=this.chart.config,s=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),s,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,s){let{_cachedMeta:n,_data:o}=this,{iScale:r,_stacked:a}=n,l=r.axis,c=t===0&&s===o.length?!0:n._sorted,h=t>0&&n._parsed[t-1],d,f,u;if(this._parsing===!1)n._parsed=o,n._sorted=!0,u=o;else{j(o[t])?u=this.parseArrayData(n,o,t,s):T(o[t])?u=this.parseObjectData(n,o,t,s):u=this.parsePrimitiveData(n,o,t,s);let p=()=>f[l]===null||h&&f[l]<h[l];for(d=0;d<s;++d)n._parsed[d+t]=f=u[d],c&&(p()&&(c=!1),h=f);n._sorted=c}a&&Ur(this,u)}parsePrimitiveData(t,s,n,o){let{iScale:r,vScale:a}=t,l=r.axis,c=a.axis,h=r.getLabels(),d=r===a,f=new Array(o),u,p,g;for(u=0,p=o;u<p;++u)g=u+n,f[u]={[l]:d||r.parse(h[g],g),[c]:a.parse(s[g],g)};return f}parseArrayData(t,s,n,o){let{xScale:r,yScale:a}=t,l=new Array(o),c,h,d,f;for(c=0,h=o;c<h;++c)d=c+n,f=s[d],l[c]={x:r.parse(f[0],d),y:a.parse(f[1],d)};return l}parseObjectData(t,s,n,o){let{xScale:r,yScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=new Array(o),d,f,u,p;for(d=0,f=o;d<f;++d)u=d+n,p=s[u],h[d]={x:r.parse(Ft(p,l),u),y:a.parse(Ft(p,c),u)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,s,n){let o=this.chart,r=this._cachedMeta,a=s[t.axis],l={keys:Na(o,!0),values:s._stacks[t.axis]._visualValues};return Hr(l,a,r.index,{mode:n})}updateRangeFromParsed(t,s,n,o){let r=n[s.axis],a=r===null?NaN:r,l=o&&n._stacks[s.axis];o&&l&&(o.values=l,a=Hr(o,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,s){let n=this._cachedMeta,o=n._parsed,r=n._sorted&&t===n.iScale,a=o.length,l=this._getOtherScale(t),c=yd(s,n,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=md(l),u,p;function g(){p=o[u];let m=p[l.axis];return!Y(p[t.axis])||d>m||f<m}for(u=0;u<a&&!(!g()&&(this.updateRangeFromParsed(h,t,p,c),r));++u);if(r){for(u=a-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(h,t,p,c);break}}return h}getAllParsedValues(t){let s=this._cachedMeta._parsed,n=[],o,r,a;for(o=0,r=s.length;o<r;++o)a=s[o][t.axis],Y(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let s=this._cachedMeta,n=s.iScale,o=s.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:o?""+o.getLabelForValue(r[o.axis]):""}}_update(t){let s=this._cachedMeta;this.update(t||"default"),s._clip=ud(O(this.options.clip,fd(s.xScale,s.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,s=this.chart,n=this._cachedMeta,o=n.data||[],r=s.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||o.length-l,h=this.options.drawActiveElementsOnTop,d;for(n.dataset&&n.dataset.draw(t,r,l,c),d=l;d<l+c;++d){let f=o[d];f.hidden||(f.active&&h?a.push(f):f.draw(t,r))}for(d=0;d<a.length;++d)a[d].draw(t,r)}getStyle(t,s){let n=s?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,s,n){let o=this.getDataset(),r;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];r=a.$context||(a.$context=_d(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=o.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=bd(this.chart.getContext(),this.index)),r.dataset=o,r.index=r.datasetIndex=this.index;return r.active=!!s,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,s){return this._resolveElementOptions(this.dataElementType.id,s,t)}_resolveElementOptions(t,s="default",n){let o=s==="active",r=this._cachedDataOpts,a=t+"-"+s,l=r[a],c=this.enableOptionSharing&&Be(n);if(l)return Yr(l,c);let h=this.chart.config,d=h.datasetElementScopeKeys(this._type,t),f=o?[`${t}Hover`,"hover",t,""]:[t,""],u=h.getOptionScopes(this.getDataset(),d),p=Object.keys(z.elements[t]),g=()=>this.getContext(n,o,s),m=h.resolveNamedOptions(u,p,g,f);return m.$shared&&(m.$shared=c,r[a]=Object.freeze(Yr(m,c))),m}_resolveAnimations(t,s,n){let o=this.chart,r=this._cachedDataOpts,a=`animation-${s}`,l=r[a];if(l)return l;let c;if(o.options.animation!==!1){let d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,s),u=d.getOptionScopes(this.getDataset(),f);c=d.createResolver(u,this.getContext(t,n,s))}let h=new Os(o,c&&c.animations);return c&&c._cacheable&&(r[a]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,s){return!s||zn(t)||this.chart._animationsDisabled}_getSharedOptions(t,s){let n=this.resolveDataElementOptions(t,s),o=this._sharedOptions,r=this.getSharedOptions(n),a=this.includeOptions(s,r)||r!==o;return this.updateSharedOptions(r,s,n),{sharedOptions:r,includeOptions:a}}updateElement(t,s,n,o){zn(o)?Object.assign(t,n):this._resolveAnimations(s,o).update(t,n)}updateSharedOptions(t,s,n){t&&!zn(s)&&this._resolveAnimations(void 0,s).update(t,n)}_setStyle(t,s,n,o){t.active=o;let r=this.getStyle(s,o);this._resolveAnimations(s,n,o).update(t,{options:!o&&this.getSharedOptions(r)||r})}removeHoverStyle(t,s,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,s,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let s=this._data,n=this._cachedMeta.data;for(let[l,c,h]of this._syncList)this[l](c,h);this._syncList=[];let o=n.length,r=s.length,a=Math.min(r,o);a&&this.parse(0,a),r>o?this._insertElements(o,r-o,t):r<o&&this._removeElements(r,o-r)}_insertElements(t,s,n=!0){let o=this._cachedMeta,r=o.data,a=t+s,l,c=h=>{for(h.length+=s,l=h.length-1;l>=a;l--)h[l]=h[l-s]};for(c(r),l=t;l<a;++l)r[l]=new this.dataElementType;this._parsing&&c(o._parsed),this.parse(t,s),n&&this.updateElements(r,t,s,"reset")}updateElements(t,s,n,o){}_removeElements(t,s){let n=this._cachedMeta;if(this._parsing){let o=n._parsed.splice(t,s);n._stacked&&bi(n,o)}n.data.splice(t,s)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[s,n,o]=t;this[s](n,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,s){s&&this._sync(["_removeElements",t,s]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}return M(e,"defaults",{}),M(e,"datasetElementType",null),M(e,"dataElementType",null),e})();function vd(e,i){if(!e._cache.$bar){let t=e.getMatchingVisibleMetas(i),s=[];for(let n=0,o=t.length;n<o;n++)s=s.concat(t[n].controller.getAllParsedValues(e));e._cache.$bar=mn(s.sort((n,o)=>n-o))}return e._cache.$bar}function Cd(e){let i=e.iScale,t=vd(i,e.type),s=i._length,n,o,r,a,l=()=>{r===32767||r===-32768||(Be(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(n=0,o=t.length;n<o;++n)r=i.getPixelForValue(t[n]),l();for(a=void 0,n=0,o=i.ticks.length;n<o;++n)r=i.getPixelForTick(n),l();return s}function wd(e,i,t,s){let n=t.barThickness,o,r;return I(n)?(o=i.min*t.categoryPercentage,r=t.barPercentage):(o=n*s,r=1),{chunk:o/s,ratio:r,start:i.pixels[e]-o/2}}function Md(e,i,t,s){let n=i.pixels,o=n[e],r=e>0?n[e-1]:null,a=e<n.length-1?n[e+1]:null,l=t.categoryPercentage;r===null&&(r=o-(a===null?i.end-i.start:a-o)),a===null&&(a=o+o-r);let c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/s,ratio:t.barPercentage,start:c}}function kd(e,i,t,s){let n=t.parse(e[0],s),o=t.parse(e[1],s),r=Math.min(n,o),a=Math.max(n,o),l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),i[t.axis]=c,i._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function Wa(e,i,t,s){return j(e)?kd(e,i,t,s):i[t.axis]=t.parse(e,s),i}function Xr(e,i,t,s){let n=e.iScale,o=e.vScale,r=n.getLabels(),a=n===o,l=[],c,h,d,f;for(c=t,h=t+s;c<h;++c)f=i[c],d={},d[n.axis]=a||n.parse(r[c],c),l.push(Wa(f,d,o,c));return l}function jn(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Sd(e,i,t){return e!==0?vt(e):(i.isHorizontal()?1:-1)*(i.min>=t?1:-1)}function Od(e){let i,t,s,n,o;return e.horizontal?(i=e.base>e.x,t="left",s="right"):(i=e.base<e.y,t="bottom",s="top"),i?(n="end",o="start"):(n="start",o="end"),{start:t,end:s,reverse:i,top:n,bottom:o}}function Pd(e,i,t,s){let n=i.borderSkipped,o={};if(!n){e.borderSkipped=o;return}if(n===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:r,end:a,reverse:l,top:c,bottom:h}=Od(e);n==="middle"&&t&&(e.enableBorderRadius=!0,(t._top||0)===s?n=c:(t._bottom||0)===s?n=h:(o[Gr(h,r,a,l)]=!0,n=c)),o[Gr(n,r,a,l)]=!0,e.borderSkipped=o}function Gr(e,i,t,s){return s?(e=Dd(e,i,t),e=Kr(e,t,i)):e=Kr(e,i,t),e}function Dd(e,i,t){return e===i?t:e===t?i:e}function Kr(e,i,t){return e==="start"?i:e==="end"?t:e}function Td(e,{inflateAmount:i},t){e.inflateAmount=i==="auto"?t===1?.33:0:i}var Ad=(()=>{class e extends ae{parsePrimitiveData(t,s,n,o){return Xr(t,s,n,o)}parseArrayData(t,s,n,o){return Xr(t,s,n,o)}parseObjectData(t,s,n,o){let{iScale:r,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=r.axis==="x"?l:c,d=a.axis==="x"?l:c,f=[],u,p,g,m;for(u=n,p=n+o;u<p;++u)m=s[u],g={},g[r.axis]=r.parse(Ft(m,h),u),f.push(Wa(Ft(m,d),g,a,u));return f}updateRangeFromParsed(t,s,n,o){super.updateRangeFromParsed(t,s,n,o);let r=n._custom;r&&s===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let s=this._cachedMeta,{iScale:n,vScale:o}=s,r=this.getParsed(t),a=r._custom,l=jn(a)?"["+a.start+", "+a.end+"]":""+o.getLabelForValue(r[o.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let s=this._cachedMeta;this.updateElements(s.data,0,s.data.length,t)}updateElements(t,s,n,o){let r=o==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),h=l.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:u}=this._getSharedOptions(s,o);for(let p=s;p<s+n;p++){let g=this.getParsed(p),m=r||I(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,d),x=(g._stacks||{})[l.axis],y={horizontal:h,base:m.base,enableBorderRadius:!x||jn(g._custom)||a===x._top||a===x._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};u&&(y.options=f||this.resolveDataElementOptions(p,t[p].active?"active":o));let C=y.options||t[p].options;Pd(y,C,x,a),Td(y,C,d.ratio),this.updateElement(t[p],p,y,o)}}_getStacks(t,s){let{iScale:n}=this._cachedMeta,o=n.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),r=n.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(s),c=l&&l[n.axis],h=d=>{let f=d._parsed.find(p=>p[n.axis]===c),u=f&&f[d.vScale.axis];if(I(u)||isNaN(u))return!0};for(let d of o)if(!(s!==void 0&&h(d))&&((r===!1||a.indexOf(d.stack)===-1||r===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,s,n){let o=this._getStacks(t,n),r=s!==void 0?o.indexOf(s):-1;return r===-1?o.length-1:r}_getRuler(){let t=this.options,s=this._cachedMeta,n=s.iScale,o=[],r,a;for(r=0,a=s.data.length;r<a;++r)o.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));let l=t.barThickness;return{min:l||Cd(s),pixels:o,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:s,_stacked:n,index:o},options:{base:r,minBarLength:a}}=this,l=r||0,c=this.getParsed(t),h=c._custom,d=jn(h),f=c[s.axis],u=0,p=n?this.applyStack(s,c,n):f,g,m;p!==f&&(u=p-f,p=f),d&&(f=h.barStart,p=h.barEnd-h.barStart,f!==0&&vt(f)!==vt(h.barEnd)&&(u=0),u+=f);let b=!I(r)&&!d?r:u,x=s.getPixelForValue(b);if(this.chart.getDataVisibility(t)?g=s.getPixelForValue(u+p):g=x,m=g-x,Math.abs(m)<a){m=Sd(m,s,l)*a,f===l&&(x-=m/2);let y=s.getPixelForDecimal(0),C=s.getPixelForDecimal(1),_=Math.min(y,C),v=Math.max(y,C);x=Math.max(Math.min(x,v),_),g=x+m,n&&!d&&(c._stacks[s.axis]._visualValues[o]=s.getValueForPixel(g)-s.getValueForPixel(x))}if(x===s.getPixelForValue(l)){let y=vt(m)*s.getLineWidthForValue(l)/2;x+=y,m-=y}return{size:m,base:x,head:g,center:g+m/2}}_calculateBarIndexPixels(t,s){let n=s.scale,o=this.options,r=o.skipNull,a=O(o.maxBarThickness,1/0),l,c;if(s.grouped){let h=r?this._getStackCount(t):s.stackCount,d=o.barThickness==="flex"?Md(t,s,o,h):wd(t,s,o,h),f=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);l=d.start+d.chunk*f+d.chunk/2,c=Math.min(a,d.chunk*d.ratio)}else l=n.getPixelForValue(this.getParsed(t)[n.axis],t),c=Math.min(a,s.min*s.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){let t=this._cachedMeta,s=t.vScale,n=t.data,o=n.length,r=0;for(;r<o;++r)this.getParsed(r)[s.axis]!==null&&!n[r].hidden&&n[r].draw(this._ctx)}}return M(e,"id","bar"),M(e,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),M(e,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}}),e})(),Id=(()=>{class e extends ae{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,s,n,o){let r=super.parsePrimitiveData(t,s,n,o);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+n).radius;return r}parseArrayData(t,s,n,o){let r=super.parseArrayData(t,s,n,o);for(let a=0;a<r.length;a++){let l=s[n+a];r[a]._custom=O(l[2],this.resolveDataElementOptions(a+n).radius)}return r}parseObjectData(t,s,n,o){let r=super.parseObjectData(t,s,n,o);for(let a=0;a<r.length;a++){let l=s[n+a];r[a]._custom=O(l&&l.r&&+l.r,this.resolveDataElementOptions(a+n).radius)}return r}getMaxOverflow(){let t=this._cachedMeta.data,s=0;for(let n=t.length-1;n>=0;--n)s=Math.max(s,t[n].size(this.resolveDataElementOptions(n))/2);return s>0&&s}getLabelAndValue(t){let s=this._cachedMeta,n=this.chart.data.labels||[],{xScale:o,yScale:r}=s,a=this.getParsed(t),l=o.getLabelForValue(a.x),c=r.getLabelForValue(a.y),h=a._custom;return{label:n[t]||"",value:"("+l+", "+c+(h?", "+h:"")+")"}}update(t){let s=this._cachedMeta.data;this.updateElements(s,0,s.length,t)}updateElements(t,s,n,o){let r=o==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(s,o),d=a.axis,f=l.axis;for(let u=s;u<s+n;u++){let p=t[u],g=!r&&this.getParsed(u),m={},b=m[d]=r?a.getPixelForDecimal(.5):a.getPixelForValue(g[d]),x=m[f]=r?l.getBasePixel():l.getPixelForValue(g[f]);m.skip=isNaN(b)||isNaN(x),h&&(m.options=c||this.resolveDataElementOptions(u,p.active?"active":o),r&&(m.options.radius=0)),this.updateElement(p,u,m,o)}}resolveDataElementOptions(t,s){let n=this.getParsed(t),o=super.resolveDataElementOptions(t,s);o.$shared&&(o=Object.assign({},o,{$shared:!1}));let r=o.radius;return s!=="active"&&(o.radius=0),o.radius+=O(n&&n._custom,r),o}}return M(e,"id","bubble"),M(e,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),M(e,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}}),e})();function Ld(e,i,t){let s=1,n=1,o=0,r=0;if(i<N){let a=e,l=a+i,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),f=Math.sin(l),u=(y,C,_)=>je(y,a,l,!0)?1:Math.max(C,C*t,_,_*t),p=(y,C,_)=>je(y,a,l,!0)?-1:Math.min(C,C*t,_,_*t),g=u(0,c,d),m=u(X,h,f),b=p(V,c,d),x=p(V+X,h,f);s=(g-b)/2,n=(m-x)/2,o=-(g+b)/2,r=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}var ao=(()=>{class e extends ae{constructor(t,s){super(t,s),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,s){let n=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=n;else{let r=c=>+n[c];if(T(n[t])){let{key:c="value"}=this._parsing;r=h=>+Ft(n[h],c)}let a,l;for(a=t,l=t+s;a<l;++a)o._parsed[a]=r(a)}}_getRotation(){return bt(this.options.rotation-90)}_getCircumference(){return bt(this.options.circumference)}_getRotationExtents(){let t=N,s=-N;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let o=this.chart.getDatasetMeta(n).controller,r=o._getRotation(),a=o._getCircumference();t=Math.min(t,r),s=Math.max(s,r+a)}return{rotation:t,circumference:s-t}}update(t){let s=this.chart,{chartArea:n}=s,o=this._cachedMeta,r=o.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,l=Math.max((Math.min(n.width,n.height)-a)/2,0),c=Math.min(ur(this.options.cutout,l),1),h=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:p,offsetX:g,offsetY:m}=Ld(f,d,c),b=(n.width-a)/u,x=(n.height-a)/p,y=Math.max(Math.min(b,x)/2,0),C=cn(this.options.radius,y),_=Math.max(C*c,0),v=(C-_)/this._getVisibleDatasetWeightTotal();this.offsetX=g*C,this.offsetY=m*C,o.total=this.calculateTotal(),this.outerRadius=C-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*h,0),this.updateElements(r,0,r.length,t)}_circumference(t,s){let n=this.options,o=this._cachedMeta,r=this._getCircumference();return s&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*r/N)}updateElements(t,s,n,o){let r=o==="reset",a=this.chart,l=a.chartArea,h=a.options.animation,d=(l.left+l.right)/2,f=(l.top+l.bottom)/2,u=r&&h.animateScale,p=u?0:this.innerRadius,g=u?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(s,o),x=this._getRotation(),y;for(y=0;y<s;++y)x+=this._circumference(y,r);for(y=s;y<s+n;++y){let C=this._circumference(y,r),_=t[y],v={x:d+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+C,circumference:C,outerRadius:g,innerRadius:p};b&&(v.options=m||this.resolveDataElementOptions(y,_.active?"active":o)),x+=C,this.updateElement(_,y,v,o)}}calculateTotal(){let t=this._cachedMeta,s=t.data,n=0,o;for(o=0;o<s.length;o++){let r=t._parsed[o];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(o)&&!s[o].hidden&&(n+=Math.abs(r))}return n}calculateCircumference(t){let s=this._cachedMeta.total;return s>0&&!isNaN(t)?N*(Math.abs(t)/s):0}getLabelAndValue(t){let s=this._cachedMeta,n=this.chart,o=n.data.labels||[],r=Ve(s._parsed[t],n.options.locale);return{label:o[t]||"",value:r}}getMaxBorderWidth(t){let s=0,n=this.chart,o,r,a,l,c;if(!t){for(o=0,r=n.data.datasets.length;o<r;++o)if(n.isDatasetVisible(o)){a=n.getDatasetMeta(o),t=a.data,l=a.controller;break}}if(!t)return 0;for(o=0,r=t.length;o<r;++o)c=l.resolveDataElementOptions(o),c.borderAlign!=="inner"&&(s=Math.max(s,c.borderWidth||0,c.hoverBorderWidth||0));return s}getMaxOffset(t){let s=0;for(let n=0,o=t.length;n<o;++n){let r=this.resolveDataElementOptions(n);s=Math.max(s,r.offset||0,r.hoverOffset||0)}return s}_getRingWeightOffset(t){let s=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(s+=this._getRingWeight(n));return s}_getRingWeight(t){return Math.max(O(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}return M(e,"id","doughnut"),M(e,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},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"}),M(e,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),M(e,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let s=t.data;if(s.labels.length&&s.datasets.length){let{labels:{pointStyle:n,color:o}}=t.legend.options;return s.labels.map((r,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,s,n){n.chart.toggleDataVisibility(s.index),n.chart.update()}}}}),e})(),Rd=(()=>{class e extends ae{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let s=this._cachedMeta,{dataset:n,data:o=[],_dataset:r}=s,a=this.chart._animationsDisabled,{start:l,count:c}=_n(s,o,a);this._drawStart=l,this._drawCount=c,yn(s)&&(l=0,c=o.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=o;let h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:h},t),this.updateElements(o,l,c,t)}updateElements(t,s,n,o){let r=o==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(s,o),u=a.axis,p=l.axis,{spanGaps:g,segment:m}=this.options,b=Ce(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||o==="none",y=s+n,C=t.length,_=s>0&&this.getParsed(s-1);for(let v=0;v<C;++v){let k=t[v],w=x?k:{};if(v<s||v>=y){w.skip=!0;continue}let S=this.getParsed(v),D=I(S[p]),P=w[u]=a.getPixelForValue(S[u],v),A=w[p]=r||D?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,S,c):S[p],v);w.skip=isNaN(P)||isNaN(A)||D,w.stop=v>0&&Math.abs(S[u]-_[u])>b,m&&(w.parsed=S,w.raw=h.data[v]),f&&(w.options=d||this.resolveDataElementOptions(v,k.active?"active":o)),x||this.updateElement(k,v,w,o),_=S}}getMaxOverflow(){let t=this._cachedMeta,s=t.dataset,n=s.options&&s.options.borderWidth||0,o=t.data||[];if(!o.length)return n;let r=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(n,r,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}return M(e,"id","line"),M(e,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),M(e,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),e})(),Ha=(()=>{class e extends ae{constructor(t,s){super(t,s),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let s=this._cachedMeta,n=this.chart,o=n.data.labels||[],r=Ve(s._parsed[t].r,n.options.locale);return{label:o[t]||"",value:r}}parseObjectData(t,s,n,o){return Dn.bind(this)(t,s,n,o)}update(t){let s=this._cachedMeta.data;this._updateRadius(),this.updateElements(s,0,s.length,t)}getMinMax(){let t=this._cachedMeta,s={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,o)=>{let r=this.getParsed(o).r;!isNaN(r)&&this.chart.getDataVisibility(o)&&(r<s.min&&(s.min=r),r>s.max&&(s.max=r))}),s}_updateRadius(){let t=this.chart,s=t.chartArea,n=t.options,o=Math.min(s.right-s.left,s.bottom-s.top),r=Math.max(o/2,0),a=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),l=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,s,n,o){let r=o==="reset",a=this.chart,c=a.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,f=h.yCenter,u=h.getIndexAngle(0)-.5*V,p=u,g,m=360/this.countVisibleElements();for(g=0;g<s;++g)p+=this._computeAngle(g,o,m);for(g=s;g<s+n;g++){let b=t[g],x=p,y=p+this._computeAngle(g,o,m),C=a.getDataVisibility(g)?h.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=y,r&&(c.animateScale&&(C=0),c.animateRotate&&(x=y=u));let _={x:d,y:f,innerRadius:0,outerRadius:C,startAngle:x,endAngle:y,options:this.resolveDataElementOptions(g,b.active?"active":o)};this.updateElement(b,g,_,o)}}countVisibleElements(){let t=this._cachedMeta,s=0;return t.data.forEach((n,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&s++}),s}_computeAngle(t,s,n){return this.chart.getDataVisibility(t)?bt(this.resolveDataElementOptions(t,s).angle||n):0}}return M(e,"id","polarArea"),M(e,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),M(e,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let s=t.data;if(s.labels.length&&s.datasets.length){let{labels:{pointStyle:n,color:o}}=t.legend.options;return s.labels.map((r,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,s,n){n.chart.toggleDataVisibility(s.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),e})(),Fd=(()=>{class e extends ao{}return M(e,"id","pie"),M(e,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),e})(),Ed=(()=>{class e extends ae{getLabelAndValue(t){let s=this._cachedMeta.vScale,n=this.getParsed(t);return{label:s.getLabels()[t],value:""+s.getLabelForValue(n[s.axis])}}parseObjectData(t,s,n,o){return Dn.bind(this)(t,s,n,o)}update(t){let s=this._cachedMeta,n=s.dataset,o=s.data||[],r=s.iScale.getLabels();if(n.points=o,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let l={_loop:!0,_fullLoop:r.length===o.length,options:a};this.updateElement(n,void 0,l,t)}this.updateElements(o,0,o.length,t)}updateElements(t,s,n,o){let r=this._cachedMeta.rScale,a=o==="reset";for(let l=s;l<s+n;l++){let c=t[l],h=this.resolveDataElementOptions(l,c.active?"active":o),d=r.getPointPositionForValue(l,this.getParsed(l).r),f=a?r.xCenter:d.x,u=a?r.yCenter:d.y,p={x:f,y:u,angle:d.angle,skip:isNaN(f)||isNaN(u),options:h};this.updateElement(c,l,p,o)}}}return M(e,"id","radar"),M(e,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),M(e,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}}),e})(),Bd=(()=>{class e extends ae{getLabelAndValue(t){let s=this._cachedMeta,n=this.chart.data.labels||[],{xScale:o,yScale:r}=s,a=this.getParsed(t),l=o.getLabelForValue(a.x),c=r.getLabelForValue(a.y);return{label:n[t]||"",value:"("+l+", "+c+")"}}update(t){let s=this._cachedMeta,{data:n=[]}=s,o=this.chart._animationsDisabled,{start:r,count:a}=_n(s,n,o);if(this._drawStart=r,this._drawCount=a,yn(s)&&(r=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:l,_dataset:c}=s;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=n;let h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(l,void 0,{animated:!o,options:h},t)}else this.datasetElementType&&(delete s.dataset,this.datasetElementType=!1);this.updateElements(n,r,a,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,s,n,o){let r=o==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,d=this.resolveDataElementOptions(s,o),f=this.getSharedOptions(d),u=this.includeOptions(o,f),p=a.axis,g=l.axis,{spanGaps:m,segment:b}=this.options,x=Ce(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||o==="none",C=s>0&&this.getParsed(s-1);for(let _=s;_<s+n;++_){let v=t[_],k=this.getParsed(_),w=y?v:{},S=I(k[g]),D=w[p]=a.getPixelForValue(k[p],_),P=w[g]=r||S?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,k,c):k[g],_);w.skip=isNaN(D)||isNaN(P)||S,w.stop=_>0&&Math.abs(k[p]-C[p])>x,b&&(w.parsed=k,w.raw=h.data[_]),u&&(w.options=f||this.resolveDataElementOptions(_,v.active?"active":o)),y||this.updateElement(v,_,w,o),C=k}this.updateSharedOptions(f,o,d)}getMaxOverflow(){let t=this._cachedMeta,s=t.data||[];if(!this.options.showLine){let l=0;for(let c=s.length-1;c>=0;--c)l=Math.max(l,s[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}let n=t.dataset,o=n.options&&n.options.borderWidth||0;if(!s.length)return o;let r=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(o,r,a)/2}}return M(e,"id","scatter"),M(e,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),M(e,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),e})(),zd=Object.freeze({__proto__:null,BarController:Ad,BubbleController:Id,DoughnutController:ao,LineController:Rd,PieController:Fd,PolarAreaController:Ha,RadarController:Ed,ScatterController:Bd});function Me(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Gn=class e{constructor(i){M(this,"options");this.options=i||{}}static override(i){Object.assign(e.prototype,i)}init(){}formats(){return Me()}parse(){return Me()}format(){return Me()}add(){return Me()}diff(){return Me()}startOf(){return Me()}endOf(){return Me()}},jd={_date:Gn};function Vd(e,i,t,s){let{controller:n,data:o,_sorted:r}=e,a=n._cachedMeta.iScale;if(a&&i===a.axis&&i!=="r"&&r&&o.length){let l=a._reversePixels?_r:Mt;if(s){if(n._sharedOptions){let c=o[0],h=typeof c.getRange=="function"&&c.getRange(i);if(h){let d=l(o,i,t-h),f=l(o,i,t+h);return{lo:d.lo,hi:f.hi}}}}else return l(o,i,t)}return{lo:0,hi:o.length-1}}function Ai(e,i,t,s,n){let o=e.getSortedVisibleDatasetMetas(),r=t[i];for(let a=0,l=o.length;a<l;++a){let{index:c,data:h}=o[a],{lo:d,hi:f}=Vd(o[a],i,r,n);for(let u=d;u<=f;++u){let p=h[u];p.skip||s(p,c,u)}}}function Nd(e){let i=e.indexOf("x")!==-1,t=e.indexOf("y")!==-1;return function(s,n){let o=i?Math.abs(s.x-n.x):0,r=t?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Vn(e,i,t,s,n){let o=[];return!n&&!e.isPointInArea(i)||Ai(e,t,i,function(a,l,c){!n&&!kt(a,e.chartArea,0)||a.inRange(i.x,i.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Wd(e,i,t,s){let n=[];function o(r,a,l){let{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=pn(r,{x:i.x,y:i.y});je(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return Ai(e,t,i,o),n}function Hd(e,i,t,s,n,o){let r=[],a=Nd(t),l=Number.POSITIVE_INFINITY;function c(h,d,f){let u=h.inRange(i.x,i.y,n);if(s&&!u)return;let p=h.getCenterPoint(n);if(!(!!o||e.isPointInArea(p))&&!u)return;let m=a(i,p);m<l?(r=[{element:h,datasetIndex:d,index:f}],l=m):m===l&&r.push({element:h,datasetIndex:d,index:f})}return Ai(e,t,i,c),r}function Nn(e,i,t,s,n,o){return!o&&!e.isPointInArea(i)?[]:t==="r"&&!s?Wd(e,i,t,n):Hd(e,i,t,s,n,o)}function qr(e,i,t,s,n){let o=[],r=t==="x"?"inXRange":"inYRange",a=!1;return Ai(e,t,i,(l,c,h)=>{l[r]&&l[r](i[t],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(i.x,i.y,n))}),s&&!a?[]:o}var $d={evaluateInteractionItems:Ai,modes:{index(e,i,t,s){let n=oe(i,e),o=t.axis||"x",r=t.includeInvisible||!1,a=t.intersect?Vn(e,n,o,s,r):Nn(e,n,o,!1,s,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(e,i,t,s){let n=oe(i,e),o=t.axis||"xy",r=t.includeInvisible||!1,a=t.intersect?Vn(e,n,o,s,r):Nn(e,n,o,!1,s,r);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(e,i,t,s){let n=oe(i,e),o=t.axis||"xy",r=t.includeInvisible||!1;return Vn(e,n,o,s,r)},nearest(e,i,t,s){let n=oe(i,e),o=t.axis||"xy",r=t.includeInvisible||!1;return Nn(e,n,o,t.intersect,s,r)},x(e,i,t,s){let n=oe(i,e);return qr(e,n,"x",t.intersect,s)},y(e,i,t,s){let n=oe(i,e);return qr(e,n,"y",t.intersect,s)}}},$a=["left","top","right","bottom"];function _i(e,i){return e.filter(t=>t.pos===i)}function Zr(e,i){return e.filter(t=>$a.indexOf(t.pos)===-1&&t.box.axis===i)}function yi(e,i){return e.sort((t,s)=>{let n=i?s:t,o=i?t:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Ud(e){let i=[],t,s,n,o,r,a;for(t=0,s=(e||[]).length;t<s;++t)n=e[t],{position:o,options:{stack:r,stackWeight:a=1}}=n,i.push({index:t,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return i}function Yd(e){let i={};for(let t of e){let{stack:s,pos:n,stackWeight:o}=t;if(!s||!$a.includes(n))continue;let r=i[s]||(i[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return i}function Xd(e,i){let t=Yd(e),{vBoxMaxWidth:s,hBoxMaxHeight:n}=i,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=t[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&i.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&i.availableHeight)}return t}function Gd(e){let i=Ud(e),t=yi(i.filter(c=>c.box.fullSize),!0),s=yi(_i(i,"left"),!0),n=yi(_i(i,"right")),o=yi(_i(i,"top"),!0),r=yi(_i(i,"bottom")),a=Zr(i,"x"),l=Zr(i,"y");return{fullSize:t,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:_i(i,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function Jr(e,i,t,s){return Math.max(e[t],i[t])+Math.max(e[s],i[s])}function Ua(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 Kd(e,i,t,s){let{pos:n,box:o}=t,r=e.maxPadding;if(!T(n)){t.size&&(e[n]-=t.size);let d=s[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[n]+=t.size}o.getPadding&&Ua(r,o.getPadding());let a=Math.max(0,i.outerWidth-Jr(r,e,"left","right")),l=Math.max(0,i.outerHeight-Jr(r,e,"top","bottom")),c=a!==e.w,h=l!==e.h;return e.w=a,e.h=l,t.horizontal?{same:c,other:h}:{same:h,other:c}}function qd(e){let i=e.maxPadding;function t(s){let n=Math.max(i[s]-e[s],0);return e[s]+=n,n}e.y+=t("top"),e.x+=t("left"),t("right"),t("bottom")}function Zd(e,i){let t=i.maxPadding;function s(n){let o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(i[r],t[r])}),o}return s(e?["left","right"]:["top","bottom"])}function wi(e,i,t,s){let n=[],o,r,a,l,c,h;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||i.w,a.height||i.h,Zd(a.horizontal,i));let{same:d,other:f}=Kd(i,t,a,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(a)}return c&&wi(n,i,t,s)||h}function bs(e,i,t,s,n){e.top=t,e.left=i,e.right=i+s,e.bottom=t+n,e.width=s,e.height=n}function Qr(e,i,t,s){let n=t.padding,{x:o,y:r}=i;for(let a of e){let l=a.box,c=s[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){let d=i.w*h,f=c.size||l.height;Be(c.start)&&(r=c.start),l.fullSize?bs(l,n.left,r,t.outerWidth-n.right-n.left,f):bs(l,i.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{let d=i.h*h,f=c.size||l.width;Be(c.start)&&(o=c.start),l.fullSize?bs(l,o,n.top,f,t.outerHeight-n.bottom-n.top):bs(l,o,i.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}i.x=o,i.y=r}var rt={addBox(e,i){e.boxes||(e.boxes=[]),i.fullSize=i.fullSize||!1,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,s){if(!e)return;let n=it(e.options.layout.padding),o=Math.max(i-n.width,0),r=Math.max(t-n.height,0),a=Gd(e.boxes),l=a.vertical,c=a.horizontal;R(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});let h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:i,outerHeight:t,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},n);Ua(f,it(s));let u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),p=Xd(l.concat(c),d);wi(a.fullSize,u,d,p),wi(l,u,d,p),wi(c,u,d,p)&&wi(l,u,d,p),qd(u),Qr(a.leftAndTop,u,d,p),u.x+=u.w,u.y+=u.h,Qr(a.rightAndBottom,u,d,p),e.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},R(a.chartArea,g=>{let m=g.box;Object.assign(m,e.chartArea),m.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}},Ps=class{acquireContext(i,t){}releaseContext(i){return!1}addEventListener(i,t,s){}removeEventListener(i,t,s){}getDevicePixelRatio(){return 1}getMaximumSize(i,t,s,n){return t=Math.max(0,t||i.width),s=s||i.height,{width:t,height:Math.max(0,n?Math.floor(t/n):s)}}isAttached(i){return!0}updateConfig(i){}},Kn=class extends Ps{acquireContext(i){return i&&i.getContext&&i.getContext("2d")||null}updateConfig(i){i.options.animation=!1}},ks="$chartjs",Jd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ta=e=>e===null||e==="";function Qd(e,i){let t=e.style,s=e.getAttribute("height"),n=e.getAttribute("width");if(e[ks]={initial:{height:s,width:n,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",ta(n)){let o=An(e,"width");o!==void 0&&(e.width=o)}if(ta(s))if(e.style.height==="")e.height=e.width/(i||2);else{let o=An(e,"height");o!==void 0&&(e.height=o)}return e}var Ya=Er?{passive:!0}:!1;function tf(e,i,t){e&&e.addEventListener(i,t,Ya)}function ef(e,i,t){e&&e.canvas&&e.canvas.removeEventListener(i,t,Ya)}function sf(e,i){let t=Jd[e.type]||e.type,{x:s,y:n}=oe(e,i);return{type:t,chart:i,native:e,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Ds(e,i){for(let t of e)if(t===i||t.contains(i))return!0}function nf(e,i,t){let s=e.canvas,n=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||Ds(a.addedNodes,s),r=r&&!Ds(a.removedNodes,s);r&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}function of(e,i,t){let s=e.canvas,n=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||Ds(a.removedNodes,s),r=r&&!Ds(a.addedNodes,s);r&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}var Pi=new Map,ea=0;function Xa(){let e=window.devicePixelRatio;e!==ea&&(ea=e,Pi.forEach((i,t)=>{t.currentDevicePixelRatio!==e&&i()}))}function rf(e,i){Pi.size||window.addEventListener("resize",Xa),Pi.set(e,i)}function af(e){Pi.delete(e),Pi.size||window.removeEventListener("resize",Xa)}function lf(e,i,t){let s=e.canvas,n=s&&ms(s);if(!n)return;let o=bn((a,l)=>{let c=n.clientWidth;t(a,l),c<n.clientWidth&&t()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),rf(e,o),r}function Wn(e,i,t){t&&t.disconnect(),i==="resize"&&af(e)}function cf(e,i,t){let s=e.canvas,n=bn(o=>{e.ctx!==null&&t(sf(o,e))},e);return tf(s,i,n),n}var qn=class extends Ps{acquireContext(i,t){let s=i&&i.getContext&&i.getContext("2d");return s&&s.canvas===i?(Qd(i,t),s):null}releaseContext(i){let t=i.canvas;if(!t[ks])return!1;let s=t[ks].initial;["height","width"].forEach(o=>{let r=s[o];I(r)?t.removeAttribute(o):t.setAttribute(o,r)});let n=s.style||{};return Object.keys(n).forEach(o=>{t.style[o]=n[o]}),t.width=t.width,delete t[ks],!0}addEventListener(i,t,s){this.removeEventListener(i,t);let n=i.$proxies||(i.$proxies={}),r={attach:nf,detach:of,resize:lf}[t]||cf;n[t]=r(i,t,s)}removeEventListener(i,t){let s=i.$proxies||(i.$proxies={}),n=s[t];if(!n)return;({attach:Wn,detach:Wn,resize:Wn}[t]||ef)(i,t,n),s[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(i,t,s,n){return Fr(i,t,s,n)}isAttached(i){let t=i&&ms(i);return!!(t&&t.isConnected)}};function hf(e){return!gs()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Kn:qn}var gt=class{constructor(){M(this,"x");M(this,"y");M(this,"active",!1);M(this,"options");M(this,"$animations")}tooltipPosition(i){let{x:t,y:s}=this.getProps(["x","y"],i);return{x:t,y:s}}hasValue(){return Ce(this.x)&&Ce(this.y)}getProps(i,t){let s=this.$animations;if(!t||!s)return this;let n={};return i.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}};M(gt,"defaults",{}),M(gt,"defaultRoutes");function df(e,i){let t=e.options.ticks,s=ff(e),n=Math.min(t.maxTicksLimit||s,s),o=t.major.enabled?pf(i):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return gf(i,c,o,r/n),c;let h=uf(o,i,n);if(r>0){let d,f,u=r>1?Math.round((l-a)/(r-1)):null;for(_s(i,c,h,I(u)?0:a-u,a),d=0,f=r-1;d<f;d++)_s(i,c,h,o[d],o[d+1]);return _s(i,c,h,l,I(u)?i.length:l+u),c}return _s(i,c,h),c}function ff(e){let i=e.options.offset,t=e._tickSize(),s=e._length/t+(i?0:1),n=e._maxLength/t;return Math.floor(Math.min(s,n))}function uf(e,i,t){let s=mf(e),n=i.length/t;if(!s)return Math.max(n,1);let o=mr(s);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>n)return l}return Math.max(n,1)}function pf(e){let i=[],t,s;for(t=0,s=e.length;t<s;t++)e[t].major&&i.push(t);return i}function gf(e,i,t,s){let n=0,o=t[0],r;for(s=Math.ceil(s),r=0;r<e.length;r++)r===o&&(i.push(e[r]),n++,o=t[n*s])}function _s(e,i,t,s,n){let o=O(s,0),r=Math.min(O(n,e.length),e.length),a=0,l,c,h;for(t=Math.ceil(t),n&&(l=n-s,t=l/Math.floor(l/t)),h=o;h<0;)a++,h=Math.round(o+a*t);for(c=Math.max(o,0);c<r;c++)c===h&&(i.push(e[c]),a++,h=Math.round(o+a*t))}function mf(e){let i=e.length,t,s;if(i<2)return!1;for(s=e[0],t=1;t<i;++t)if(e[t]-e[t-1]!==s)return!1;return s}var xf=e=>e==="left"?"right":e==="right"?"left":e,ia=(e,i,t)=>i==="top"||i==="left"?e[i]+t:e[i]-t,sa=(e,i)=>Math.min(i||e,e);function na(e,i){let t=[],s=e.length/i,n=e.length,o=0;for(;o<n;o+=s)t.push(e[Math.floor(o)]);return t}function bf(e,i,t){let s=e.ticks.length,n=Math.min(i,s-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(n),c;if(!(t&&(s===1?c=Math.max(l-o,r-l):i===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(n-1))/2,l+=n<i?c:-c,l<o-a||l>r+a)))return l}function _f(e,i){R(e,t=>{let s=t.gc,n=s.length/2,o;if(n>i){for(o=0;o<n;++o)delete t.data[s[o]];s.splice(0,n)}})}function vi(e){return e.drawTicks?e.tickLength:0}function oa(e,i){if(!e.display)return 0;let t=Z(e.font,i),s=it(e.padding);return(j(e.text)?e.text.length:1)*t.lineHeight+s.height}function yf(e,i){return Et(e,{scale:i,type:"scale"})}function vf(e,i,t){return Et(e,{tick:t,index:i,type:"tick"})}function Cf(e,i,t){let s=hs(e);return(t&&i!=="right"||!t&&i==="right")&&(s=xf(s)),s}function wf(e,i,t,s){let{top:n,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:h}=l,d=0,f,u,p,g=r-n,m=a-o;if(e.isHorizontal()){if(u=et(s,o,a),T(t)){let b=Object.keys(t)[0],x=t[b];p=h[b].getPixelForValue(x)+g-i}else t==="center"?p=(c.bottom+c.top)/2+g-i:p=ia(e,t,i);f=a-o}else{if(T(t)){let b=Object.keys(t)[0],x=t[b];u=h[b].getPixelForValue(x)-m+i}else t==="center"?u=(c.left+c.right)/2-m+i:u=ia(e,t,i);p=et(s,r,n),d=t==="left"?-X:X}return{titleX:u,titleY:p,maxWidth:f,rotation:d}}var Pe=class e extends gt{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=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(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:s,_suggestedMax:n}=this;return i=ct(i,Number.POSITIVE_INFINITY),t=ct(t,Number.NEGATIVE_INFINITY),s=ct(s,Number.POSITIVE_INFINITY),n=ct(n,Number.NEGATIVE_INFINITY),{min:ct(i,s),max:ct(t,n),minDefined:Y(i),maxDefined:Y(t)}}getMinMax(i){let{min:t,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:t,max:s};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,i),n||(t=Math.min(t,r.min)),o||(s=Math.max(s,r.max));return t=o&&t>s?s:t,s=n&&t>s?t:s,{min:ct(t,ct(s,t)),max:ct(s,ct(t,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let 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=!1}beforeUpdate(){B(this.options.beforeUpdate,[this])}update(i,t,s){let{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=i,this.maxHeight=t,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Dr(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?na(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=df(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,s;this.isHorizontal()?(t=this.left,s=this.right):(t=this.top,s=this.bottom,i=!i),this._startPixel=t,this._endPixel=s,this._reversePixels=i,this._length=s-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){B(this.options.afterUpdate,[this])}beforeSetDimensions(){B(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(){B(this.options.afterSetDimensions,[this])}_callHooks(i){this.chart.notifyPlugins(i,this.getContext()),B(this.options[i],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){B(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(i){let t=this.options.ticks,s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s],o.label=B(t.callback,[o.value,s,i],this)}afterTickToLabelConversion(){B(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){B(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let i=this.options,t=i.ticks,s=sa(this.ticks.length,i.ticks.maxTicksLimit),n=t.minRotation||0,o=t.maxRotation,r=n,a,l,c;if(!this._isVisible()||!t.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=Q(this.chart.width-d,0,this.maxWidth);a=i.offset?this.maxWidth/s:u/(s-1),d+6>a&&(a=u/(s-(i.offset?.5:1)),l=this.maxHeight-vi(i.grid)-t.padding-oa(i.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=ls(Math.min(Math.asin(Q((h.highest.height+6)/a,-1,1)),Math.asin(Q(l/c,-1,1))-Math.asin(Q(f/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){B(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){B(this.options.beforeFit,[this])}fit(){let i={width:0,height:0},{chart:t,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=oa(n,t.options.font);if(a?(i.width=this.maxWidth,i.height=vi(o)+l):(i.height=this.maxHeight,i.width=vi(o)+l),s.display&&this.ticks.length){let{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,p=bt(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){let b=s.mirror?0:m*d.width+g*f.height;i.height=Math.min(this.maxHeight,i.height+b+u)}else{let b=s.mirror?0:g*d.width+m*f.height;i.width=Math.min(this.maxWidth,i.width+b+u)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),a?(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,s,n){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),f=0,u=0;l?c?(f=n*i.width,u=s*t.height):(f=s*i.height,u=n*t.width):o==="start"?u=t.width:o==="end"?f=i.width:o!=="inner"&&(f=i.width/2,u=t.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+r)*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+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){B(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,s;for(t=0,s=i.length;t<s;t++)I(i[t].label)&&(i.splice(t,1),s--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let i=this._labelSizes;if(!i){let t=this.options.ticks.sampleSize,s=this.ticks;t<s.length&&(s=na(s,t)),this._labelSizes=i=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return i}_computeLabelSizes(i,t,s){let{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(t/sa(t,s)),c=0,h=0,d,f,u,p,g,m,b,x,y,C,_;for(d=0;d<t;d+=l){if(p=i[d].label,g=this._resolveTickFontOptions(d),n.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},x=g.lineHeight,y=C=0,!I(p)&&!j(p))y=ui(n,b.data,b.gc,y,p),C=x;else if(j(p))for(f=0,u=p.length;f<u;++f)_=p[f],!I(_)&&!j(_)&&(y=ui(n,b.data,b.gc,y,_),C+=x);r.push(y),a.push(C),c=Math.max(y,c),h=Math.max(C,h)}_f(o,t);let v=r.indexOf(c),k=a.indexOf(h),w=S=>({width:r[S]||0,height:a[S]||0});return{first:w(0),last:w(t-1),widest:w(v),highest:w(k),widths:r,heights:a}}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 br(this._alignToPixels?ie(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 s=t[i];return s.$context||(s.$context=vf(this.getContext(),i,s))}return this.$context||(this.$context=yf(this.chart.getContext(),this))}_tickSize(){let i=this.options.ticks,t=bt(this.labelRotation),s=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),o=this._getLabelSizes(),r=i.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){let i=this.options.display;return i!=="auto"?!!i:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(i){let t=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=vi(o),u=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(H){return ie(s,H,g)},x,y,C,_,v,k,w,S,D,P,A,tt;if(r==="top")x=b(this.bottom),k=this.bottom-f,S=x-m,P=b(i.top)+m,tt=i.bottom;else if(r==="bottom")x=b(this.top),P=i.top,tt=b(i.bottom)-m,k=x+m,S=this.top+f;else if(r==="left")x=b(this.right),v=this.right-f,w=x-m,D=b(i.left)+m,A=i.right;else if(r==="right")x=b(this.left),D=i.left,A=b(i.right)-m,v=x+m,w=this.left+f;else if(t==="x"){if(r==="center")x=b((i.top+i.bottom)/2+.5);else if(T(r)){let H=Object.keys(r)[0],G=r[H];x=b(this.chart.scales[H].getPixelForValue(G))}P=i.top,tt=i.bottom,k=x+m,S=k+f}else if(t==="y"){if(r==="center")x=b((i.left+i.right)/2);else if(T(r)){let H=Object.keys(r)[0],G=r[H];x=b(this.chart.scales[H].getPixelForValue(G))}v=x-m,w=v-f,D=i.left,A=i.right}let ut=O(n.ticks.maxTicksLimit,d),F=Math.max(1,Math.ceil(d/ut));for(y=0;y<d;y+=F){let H=this.getContext(y),G=o.setContext(H),yt=a.setContext(H),st=G.lineWidth,De=G.color,ji=yt.dash||[],Te=yt.dashOffset,si=G.tickWidth,me=G.tickColor,ni=G.tickBorderDash||[],xe=G.tickBorderDashOffset;C=bf(this,y,l),C!==void 0&&(_=ie(s,C,st),c?v=w=D=A=_:k=S=P=tt=_,u.push({tx1:v,ty1:k,tx2:w,ty2:S,x1:D,y1:P,x2:A,y2:tt,width:st,color:De,borderDash:ji,borderDashOffset:Te,tickWidth:si,tickColor:me,tickBorderDash:ni,tickBorderDashOffset:xe}))}return this._ticksLength=d,this._borderValue=x,u}_computeLabelItems(i){let t=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=vi(s.grid),u=f+h,p=d?-h:u,g=-bt(this.labelRotation),m=[],b,x,y,C,_,v,k,w,S,D,P,A,tt="middle";if(n==="top")v=this.bottom-p,k=this._getXAxisLabelAlignment();else if(n==="bottom")v=this.top+p,k=this._getXAxisLabelAlignment();else if(n==="left"){let F=this._getYAxisLabelAlignment(f);k=F.textAlign,_=F.x}else if(n==="right"){let F=this._getYAxisLabelAlignment(f);k=F.textAlign,_=F.x}else if(t==="x"){if(n==="center")v=(i.top+i.bottom)/2+u;else if(T(n)){let F=Object.keys(n)[0],H=n[F];v=this.chart.scales[F].getPixelForValue(H)+u}k=this._getXAxisLabelAlignment()}else if(t==="y"){if(n==="center")_=(i.left+i.right)/2-u;else if(T(n)){let F=Object.keys(n)[0],H=n[F];_=this.chart.scales[F].getPixelForValue(H)}k=this._getYAxisLabelAlignment(f).textAlign}t==="y"&&(l==="start"?tt="top":l==="end"&&(tt="bottom"));let ut=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){y=a[b],C=y.label;let F=o.setContext(this.getContext(b));w=this.getPixelForTick(b)+o.labelOffset,S=this._resolveTickFontOptions(b),D=S.lineHeight,P=j(C)?C.length:1;let H=P/2,G=F.color,yt=F.textStrokeColor,st=F.textStrokeWidth,De=k;r?(_=w,k==="inner"&&(b===x-1?De=this.options.reverse?"left":"right":b===0?De=this.options.reverse?"right":"left":De="center"),n==="top"?c==="near"||g!==0?A=-P*D+D/2:c==="center"?A=-ut.highest.height/2-H*D+D:A=-ut.highest.height+D/2:c==="near"||g!==0?A=D/2:c==="center"?A=ut.highest.height/2-H*D:A=ut.highest.height-P*D,d&&(A*=-1),g!==0&&!F.showLabelBackdrop&&(_+=D/2*Math.sin(g))):(v=w,A=(1-P)*D/2);let ji;if(F.showLabelBackdrop){let Te=it(F.backdropPadding),si=ut.heights[b],me=ut.widths[b],ni=A-Te.top,xe=0-Te.left;switch(tt){case"middle":ni-=si/2;break;case"bottom":ni-=si;break}switch(k){case"center":xe-=me/2;break;case"right":xe-=me;break;case"inner":b===x-1?xe-=me:b>0&&(xe-=me/2);break}ji={left:xe,top:ni,width:me+Te.width,height:si+Te.height,color:F.backdropColor}}m.push({label:C,font:S,textOffset:A,options:{rotation:g,color:G,strokeColor:yt,strokeWidth:st,textAlign:De,textBaseline:tt,translation:[_,v],backdrop:ji}})}return m}_getXAxisLabelAlignment(){let{position:i,ticks:t}=this.options;if(-bt(this.labelRotation))return i==="top"?"left":"right";let n="center";return t.align==="start"?n="left":t.align==="end"?n="right":t.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(i){let{position:t,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=i+o,l=r.widest.width,c,h;return t==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):t==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let 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:s,top:n,width:o,height:r}=this;t&&(i.save(),i.fillStyle=t,i.fillRect(s,n,o,r),i.restore())}getLineWidthForValue(i){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(o=>o.value===i);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(i){let t=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(i)),o,r,a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(t.display)for(o=0,r=n.length;o<r;++o){let l=n[o];t.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.drawTicks&&a({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:s,grid:n}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;let a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,h,d,f;this.isHorizontal()?(c=ie(i,this.left,r)-r/2,h=ie(i,this.right,a)+a/2,d=f=l):(d=ie(i,this.top,r)-r/2,f=ie(i,this.bottom,a)+a/2,c=h=l),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(c,d),t.lineTo(h,f),t.stroke(),t.restore()}drawLabels(i){if(!this.options.ticks.display)return;let s=this.ctx,n=this._computeLabelArea();n&&mi(s,n);let o=this.getLabelItems(i);for(let r of o){let a=r.options,l=r.font,c=r.label,h=r.textOffset;se(s,c,0,h,l,a)}n&&xi(s)}drawTitle(){let{ctx:i,options:{position:t,title:s,reverse:n}}=this;if(!s.display)return;let o=Z(s.font),r=it(s.padding),a=s.align,l=o.lineHeight/2;t==="bottom"||t==="center"||T(t)?(l+=r.bottom,j(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;let{titleX:c,titleY:h,maxWidth:d,rotation:f}=wf(this,l,t,a);se(i,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:Cf(a,t,n),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,s=O(i.grid&&i.grid.z,-1),n=O(i.border&&i.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:t,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(i){let t=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[],o,r;for(o=0,r=t.length;o<r;++o){let a=t[o];a[s]===this.id&&(!i||a.type===i)&&n.push(a)}return n}_resolveTickFontOptions(i){let t=this.options.ticks.setContext(this.getContext(i));return Z(t.font)}_maxDigits(){let i=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/i}},Ue=class{constructor(i,t,s){this.type=i,this.scope=t,this.override=s,this.items=Object.create(null)}isForType(i){return Object.prototype.isPrototypeOf.call(this.type.prototype,i.prototype)}register(i){let t=Object.getPrototypeOf(i),s;Sf(t)&&(s=this.register(t));let n=this.items,o=i.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+i);return o in n||(n[o]=i,Mf(i,r,s),this.override&&z.override(i.id,i.overrides)),r}get(i){return this.items[i]}unregister(i){let t=this.items,s=i.id,n=this.scope;s in t&&delete t[s],n&&s in z[n]&&(delete z[n][s],this.override&&delete ee[s])}};function Mf(e,i,t){let s=Re(Object.create(null),[t?z.get(t):{},z.get(i),e.defaults]);z.set(i,s),e.defaultRoutes&&kf(i,e.defaultRoutes),e.descriptors&&z.describe(i,e.descriptors)}function kf(e,i){Object.keys(i).forEach(t=>{let s=t.split("."),n=s.pop(),o=[e].concat(s).join("."),r=i[t].split("."),a=r.pop(),l=r.join(".");z.route(o,n,l,a)})}function Sf(e){return"id"in e&&"defaults"in e}var Zn=class{constructor(){this.controllers=new Ue(ae,"datasets",!0),this.elements=new Ue(gt,"elements"),this.plugins=new Ue(Object,"plugins"),this.scales=new Ue(Pe,"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,s){[...t].forEach(n=>{let o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(i,o,n):R(n,r=>{let a=s||this._getRegistryForType(r);this._exec(i,a,r)})})}_exec(i,t,s){let n=as(i);B(s["before"+n],[],s),t[i](s),B(s["after"+n],[],s)}_getRegistryForType(i){for(let t=0;t<this._typedRegistries.length;t++){let s=this._typedRegistries[t];if(s.isForType(i))return s}return this.plugins}_get(i,t,s){let n=t.get(i);if(n===void 0)throw new Error('"'+i+'" is not a registered '+s+".");return n}},Dt=new Zn,Jn=class{constructor(){this._init=[]}notify(i,t,s,n){t==="beforeInit"&&(this._init=this._createDescriptors(i,!0),this._notify(this._init,i,"install"));let o=n?this._descriptors(i).filter(n):this._descriptors(i),r=this._notify(o,i,t,s);return t==="afterDestroy"&&(this._notify(o,i,"stop"),this._notify(this._init,i,"uninstall")),r}_notify(i,t,s,n){n=n||{};for(let o of i){let r=o.plugin,a=r[s],l=[t,n,o.options];if(B(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){I(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 s=i&&i.config,n=O(s.options&&s.options.plugins,{}),o=Of(s);return n===!1&&!t?[]:Df(i,o,n,t)}_notifyStateChanges(i){let t=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(t,s),i,"stop"),this._notify(n(s,t),i,"start")}};function Of(e){let i={},t=[],s=Object.keys(Dt.plugins.items);for(let o=0;o<s.length;o++)t.push(Dt.getPlugin(s[o]));let n=e.plugins||[];for(let o=0;o<n.length;o++){let r=n[o];t.indexOf(r)===-1&&(t.push(r),i[r.id]=!0)}return{plugins:t,localIds:i}}function Pf(e,i){return!i&&e===!1?null:e===!0?{}:e}function Df(e,{plugins:i,localIds:t},s,n){let o=[],r=e.getContext();for(let a of i){let l=a.id,c=Pf(s[l],n);c!==null&&o.push({plugin:a,options:Tf(e.config,{plugin:a,local:t[l]},c,r)})}return o}function Tf(e,{plugin:i,local:t},s,n){let o=e.pluginScopeKeys(i),r=e.getOptionScopes(s,o);return t&&i.defaults&&r.push(i.defaults),e.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Qn(e,i){let t=z.datasets[e]||{};return((i.datasets||{})[e]||{}).indexAxis||i.indexAxis||t.indexAxis||"x"}function Af(e,i){let t=e;return e==="_index_"?t=i:e==="_value_"&&(t=i==="x"?"y":"x"),t}function If(e,i){return e===i?"_index_":"_value_"}function ra(e){if(e==="x"||e==="y"||e==="r")return e}function Lf(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function to(e,...i){if(ra(e))return e;for(let t of i){let s=t.axis||Lf(t.position)||e.length>1&&ra(e[0].toLowerCase());if(s)return s}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 Rf(e,i){if(i.data&&i.data.datasets){let t=i.data.datasets.filter(s=>s.xAxisID===e||s.yAxisID===e);if(t.length)return aa(e,"x",t[0])||aa(e,"y",t[0])}return{}}function Ff(e,i){let t=ee[e.type]||{scales:{}},s=i.scales||{},n=Qn(e.type,i),o=Object.create(null);return Object.keys(s).forEach(r=>{let a=s[r];if(!T(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let l=to(r,a,Rf(r,e),z.scales[a.type]),c=If(l,n),h=t.scales||{};o[r]=Ee(Object.create(null),[{axis:l},a,h[l],h[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||Qn(a,i),h=(ee[a]||{}).scales||{};Object.keys(h).forEach(d=>{let f=Af(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Ee(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(r=>{let a=o[r];Ee(a,[z.scales[a.type],z.scale])}),o}function Ga(e){let i=e.options||(e.options={});i.plugins=O(i.plugins,{}),i.scales=Ff(e,i)}function Ka(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Ef(e){return e=e||{},e.data=Ka(e.data),Ga(e),e}var la=new Map,qa=new Set;function ys(e,i){let t=la.get(e);return t||(t=i(),la.set(e,t),qa.add(t)),t}var Ci=(e,i,t)=>{let s=Ft(i,t);s!==void 0&&e.add(s)},eo=class{constructor(i){this._config=Ef(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=Ka(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(),Ga(i)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(i){return ys(i,()=>[[`datasets.${i}`,""]])}datasetAnimationScopeKeys(i,t){return ys(`${i}.transition.${t}`,()=>[[`datasets.${i}.transitions.${t}`,`transitions.${t}`],[`datasets.${i}`,""]])}datasetElementScopeKeys(i,t){return ys(`${i}-${t}`,()=>[[`datasets.${i}.elements.${t}`,`datasets.${i}`,`elements.${t}`,""]])}pluginScopeKeys(i){let t=i.id,s=this.type;return ys(`${s}-plugin-${t}`,()=>[[`plugins.${t}`,...i.additionalOptionScopes||[]]])}_cachedScopes(i,t){let s=this._scopeCache,n=s.get(i);return(!n||t)&&(n=new Map,s.set(i,n)),n}getOptionScopes(i,t,s){let{options:n,type:o}=this,r=this._cachedScopes(i,s),a=r.get(t);if(a)return a;let l=new Set;t.forEach(h=>{i&&(l.add(i),h.forEach(d=>Ci(l,i,d))),h.forEach(d=>Ci(l,n,d)),h.forEach(d=>Ci(l,ee[o]||{},d)),h.forEach(d=>Ci(l,z,d)),h.forEach(d=>Ci(l,ds,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qa.has(t)&&r.set(t,c),c}chartOptionScopes(){let{options:i,type:t}=this;return[i,ee[t]||{},z.datasets[t]||{},{type:t},z,ds]}resolveNamedOptions(i,t,s,n=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=ca(this._resolverCache,i,n),l=r;if(zf(r,t)){o.$shared=!1,s=Lt(s)?s():s;let c=this.createResolver(i,s,a);l=ve(r,s,c)}for(let c of t)o[c]=l[c];return o}createResolver(i,t,s=[""],n){let{resolver:o}=ca(this._resolverCache,i,s);return T(t)?ve(o,t,void 0,n):o}};function ca(e,i,t){let s=e.get(i);s||(s=new Map,e.set(i,s));let n=t.join(),o=s.get(n);return o||(o={resolver:ps(i,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}var Bf=e=>T(e)&&Object.getOwnPropertyNames(e).some(i=>Lt(e[i]));function zf(e,i){let{isScriptable:t,isIndexable:s}=Sn(e);for(let n of i){let o=t(n),r=s(n),a=(r||o)&&e[n];if(o&&(Lt(a)||Bf(a))||r&&j(a))return!0}return!1}var jf="4.4.6",Vf=["top","bottom","left","right","chartArea"];function ha(e,i){return e==="top"||e==="bottom"||Vf.indexOf(e)===-1&&i==="x"}function da(e,i){return function(t,s){return t[e]===s[e]?t[i]-s[i]:t[e]-s[e]}}function fa(e){let i=e.chart,t=i.options.animation;i.notifyPlugins("afterRender"),B(t&&t.onComplete,[e],i)}function Nf(e){let i=e.chart,t=i.options.animation;B(t&&t.onProgress,[e],i)}function Za(e){return gs()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Ss={},ua=e=>{let i=Za(e);return Object.values(Ss).filter(t=>t.canvas===i).pop()};function Wf(e,i,t){let s=Object.keys(e);for(let n of s){let o=+n;if(o>=i){let r=e[n];delete e[n],(t>0||o>i)&&(e[o+t]=r)}}}function Hf(e,i,t,s){return!t||e.type==="mouseout"?null:s?i:e}function vs(e,i,t){return e.options.clip?e[t]:i[t]}function $f(e,i){let{xScale:t,yScale:s}=e;return t&&s?{left:vs(t,i,"left"),right:vs(t,i,"right"),top:vs(s,i,"top"),bottom:vs(s,i,"bottom")}:i}var Ii=(()=>{class e{static register(...t){Dt.add(...t),pa()}static unregister(...t){Dt.remove(...t),pa()}constructor(t,s){let n=this.config=new eo(s),o=Za(t),r=ua(o);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||hf(o)),this.platform.updateConfig(n);let l=this.platform.acquireContext(o,a.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;if(this.id=fr(),this.ctx=l,this.canvas=c,this.width=d,this.height=h,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Jn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=wr(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],Ss[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Bt.listen(this,"complete",fa),Bt.listen(this,"progress",Nf),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:s},width:n,height:o,_aspectRatio:r}=this;return I(t)?s&&r?r:o?n/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 Dt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Tn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wn(this.canvas,this.ctx),this}stop(){return Bt.stop(this),this}resize(t,s){Bt.running(this)?this._resizeBeforeDraw={width:t,height:s}:this._resize(t,s)}_resize(t,s){let n=this.options,o=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(o,t,s,r),l=n.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Tn(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),B(n.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let s=this.options.scales||{};R(s,(n,o)=>{n.id=o})}buildOrUpdateScales(){let t=this.options,s=t.scales,n=this.scales,o=Object.keys(n).reduce((a,l)=>(a[l]=!1,a),{}),r=[];s&&(r=r.concat(Object.keys(s).map(a=>{let l=s[a],c=to(a,l),h=c==="r",d=c==="x";return{options:l,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"}}))),R(r,a=>{let l=a.options,c=l.id,h=to(c,l),d=O(l.type,a.dtype);(l.position===void 0||ha(l.position,h)!==ha(a.dposition))&&(l.position=a.dposition),o[c]=!0;let f=null;if(c in n&&n[c].type===d)f=n[c];else{let u=Dt.getScale(d);f=new u({id:c,type:d,ctx:this.ctx,chart:this}),n[f.id]=f}f.init(l,t)}),R(o,(a,l)=>{a||delete n[l]}),R(n,a=>{rt.configure(this,a,a.options),rt.addBox(this,a)})}_updateMetasets(){let t=this._metasets,s=this.data.datasets.length,n=t.length;if(t.sort((o,r)=>o.index-r.index),n>s){for(let o=s;o<n;++o)this._destroyDatasetMeta(o);t.splice(s,n-s)}this._sortedMetasets=t.slice(0).sort(da("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:s}}=this;t.length>s.length&&delete this._stacks,t.forEach((n,o)=>{s.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){let t=[],s=this.data.datasets,n,o;for(this._removeUnreferencedMetasets(),n=0,o=s.length;n<o;n++){let r=s[n],a=this.getDatasetMeta(n),l=r.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=l,a.indexAxis=r.indexAxis||Qn(l,this.options),a.order=r.order||0,a.index=n,a.label=""+r.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{let c=Dt.getController(l),{datasetElementType:h,dataElementType:d}=z.datasets[l];Object.assign(c,{dataElementType:Dt.getElement(d),datasetElementType:h&&Dt.getElement(h)}),a.controller=new c(this,n),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){R(this.data.datasets,(t,s)=>{this.getDatasetMeta(s).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let s=this.config;s.update();let n=this._options=s.createResolver(s.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let h=0,d=this.data.datasets.length;h<d;h++){let{controller:f}=this.getDatasetMeta(h),u=!o&&r.indexOf(f)===-1;f.buildOrUpdateElements(u),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),o||R(r,h=>{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(da("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){R(this.scales,t=>{rt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,s=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!hn(s,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,s=this._getUniformDataChanges()||[];for(let{method:n,start:o,count:r}of s){let a=n==="_removeElements"?-r:r;Wf(t,o,a)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let s=this.data.datasets.length,n=r=>new Set(t.filter(a=>a[0]===r).map((a,l)=>l+","+a.splice(1).join(","))),o=n(0);for(let r=1;r<s;r++)if(!hn(o,n(r)))return;return Array.from(o).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;rt.update(this,this.width,this.height,t);let s=this.chartArea,n=s.width<=0||s.height<=0;this._layers=[],R(this.boxes,o=>{n&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,r)=>{o._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let s=0,n=this.data.datasets.length;s<n;++s)this.getDatasetMeta(s).controller.configure();for(let s=0,n=this.data.datasets.length;s<n;++s)this._updateDataset(s,Lt(t)?t({datasetIndex:s}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,s){let n=this.getDatasetMeta(t),o={meta:n,index:t,mode:s,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(n.controller._update(s),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Bt.has(this)?this.attached&&!Bt.running(this)&&Bt.start(this):(this.draw(),fa({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,o)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let s=this._layers;for(t=0;t<s.length&&s[t].z<=0;++t)s[t].draw(this.chartArea);for(this._drawDatasets();t<s.length;++t)s[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let s=this._sortedMetasets,n=[],o,r;for(o=0,r=s.length;o<r;++o){let a=s[o];(!t||a.visible)&&n.push(a)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let s=t.length-1;s>=0;--s)this._drawDataset(t[s]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let s=this.ctx,n=t._clip,o=!n.disabled,r=$f(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(o&&mi(s,{left:n.left===!1?0:r.left-n.left,right:n.right===!1?this.width:r.right+n.right,top:n.top===!1?0:r.top-n.top,bottom:n.bottom===!1?this.height:r.bottom+n.bottom}),t.controller.draw(),o&&xi(s),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return kt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,s,n,o){let r=$d.modes[s];return typeof r=="function"?r(this,t,n,o):[]}getDatasetMeta(t){let s=this.data.datasets[t],n=this._metasets,o=n.filter(r=>r&&r._dataset===s).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:s&&s.order||0,index:t,_dataset:s,_parsed:[],_sorted:!1},n.push(o)),o}getContext(){return this.$context||(this.$context=Et(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let s=this.data.datasets[t];if(!s)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!s.hidden}setDatasetVisibility(t,s){let n=this.getDatasetMeta(t);n.hidden=!s}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,s,n){let o=n?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,o);Be(s)?(r.data[s].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(r,{visible:n}),this.update(l=>l.datasetIndex===t?o:void 0))}hide(t,s){this._updateVisibility(t,s,!1)}show(t,s){this._updateVisibility(t,s,!0)}_destroyDatasetMeta(t){let s=this._metasets[t];s&&s.controller&&s.controller._destroy(),delete this._metasets[t]}_stop(){let t,s;for(this.stop(),Bt.remove(this),t=0,s=this.data.datasets.length;t<s;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:s}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),wn(t,s),this.platform.releaseContext(s),this.canvas=null,this.ctx=null),delete Ss[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,s=this.platform,n=(r,a)=>{s.addEventListener(this,r,a),t[r]=a},o=(r,a,l)=>{r.offsetX=a,r.offsetY=l,this._eventHandler(r)};R(this.options.events,r=>n(r,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,s=this.platform,n=(c,h)=>{s.addEventListener(this,c,h),t[c]=h},o=(c,h)=>{t[c]&&(s.removeEventListener(this,c,h),delete t[c])},r=(c,h)=>{this.canvas&&this.resize(c,h)},a,l=()=>{o("attach",l),this.attached=!0,this.resize(),n("resize",r),n("detach",a)};a=()=>{this.attached=!1,o("resize",r),this._stop(),this._resize(0,0),n("attach",l)},s.isAttached(this.canvas)?l():a()}unbindEvents(){R(this._listeners,(t,s)=>{this.platform.removeEventListener(this,s,t)}),this._listeners={},R(this._responsiveListeners,(t,s)=>{this.platform.removeEventListener(this,s,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,s,n){let o=n?"set":"remove",r,a,l,c;for(s==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+o+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){a=t[l];let h=a&&this.getDatasetMeta(a.datasetIndex).controller;h&&h[o+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let s=this._active||[],n=t.map(({datasetIndex:r,index:a})=>{let l=this.getDatasetMeta(r);if(!l)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:l.data[a],index:a}});!pi(n,s)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,s))}notifyPlugins(t,s,n){return this._plugins.notify(this,t,s,n)}isPluginEnabled(t){return this._plugins._cache.filter(s=>s.plugin.id===t).length===1}_updateHoverStyles(t,s,n){let o=this.options.hover,r=(c,h)=>c.filter(d=>!h.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),a=r(s,t),l=n?t:r(t,s);a.length&&this.updateHoverStyle(a,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0)}_eventHandler(t,s){let n={event:t,replay:s,cancelable:!0,inChartArea:this.isPointInArea(t)},o=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,o)===!1)return;let r=this._handleEvent(t,s,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,o),(r||n.changed)&&this.render(),this}_handleEvent(t,s,n){let{_active:o=[],options:r}=this,a=s,l=this._getActiveElements(t,o,n,a),c=gr(t),h=Hf(t,this._lastEvent,n,c);n&&(this._lastEvent=null,B(r.onHover,[t,l,this],this),c&&B(r.onClick,[t,l,this],this));let d=!pi(l,o);return(d||s)&&(this._active=l,this._updateHoverStyles(l,o,s)),this._lastEvent=h,d}_getActiveElements(t,s,n,o){if(t.type==="mouseout")return[];if(!n)return s;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,o)}}return M(e,"defaults",z),M(e,"instances",Ss),M(e,"overrides",ee),M(e,"registry",Dt),M(e,"version",jf),M(e,"getChart",ua),e})();function pa(){return R(Ii.instances,e=>e._plugins.invalidate())}function Uf(e,i,t){let{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=i,c=n/a;e.beginPath(),e.arc(o,r,a,s-c,t+c),l>n?(c=n/l,e.arc(o,r,l,t+c,s-c,!0)):e.arc(o,r,n,t+X,s-X),e.closePath(),e.clip()}function Yf(e){return us(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Xf(e,i,t,s){let n=Yf(e.options.borderRadius),o=(t-i)/2,r=Math.min(o,s*i/2),a=l=>{let c=(t-Math.min(o,l))*s/2;return Q(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:Q(n.innerStart,0,r),innerEnd:Q(n.innerEnd,0,r)}}function He(e,i,t,s){return{x:t+e*Math.cos(i),y:s+e*Math.sin(i)}}function Ts(e,i,t,s,n,o){let{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=i,d=Math.max(i.outerRadius+s+t-c,0),f=h>0?h+s+t+c:0,u=0,p=n-l;if(s){let F=h>0?h-s:0,H=d>0?d-s:0,G=(F+H)/2,yt=G!==0?p*G/(G+s):p;u=(p-yt)/2}let g=Math.max(.001,p*d-t/V)/d,m=(p-g)/2,b=l+m+u,x=n-m-u,{outerStart:y,outerEnd:C,innerStart:_,innerEnd:v}=Xf(i,f,d,x-b),k=d-y,w=d-C,S=b+y/k,D=x-C/w,P=f+_,A=f+v,tt=b+_/P,ut=x-v/A;if(e.beginPath(),o){let F=(S+D)/2;if(e.arc(r,a,d,S,F),e.arc(r,a,d,F,D),C>0){let st=He(w,D,r,a);e.arc(st.x,st.y,C,D,x+X)}let H=He(A,x,r,a);if(e.lineTo(H.x,H.y),v>0){let st=He(A,ut,r,a);e.arc(st.x,st.y,v,x+X,ut+Math.PI)}let G=(x-v/f+(b+_/f))/2;if(e.arc(r,a,f,x-v/f,G,!0),e.arc(r,a,f,G,b+_/f,!0),_>0){let st=He(P,tt,r,a);e.arc(st.x,st.y,_,tt+Math.PI,b-X)}let yt=He(k,b,r,a);if(e.lineTo(yt.x,yt.y),y>0){let st=He(k,S,r,a);e.arc(st.x,st.y,y,b-X,S)}}else{e.moveTo(r,a);let F=Math.cos(S)*d+r,H=Math.sin(S)*d+a;e.lineTo(F,H);let G=Math.cos(D)*d+r,yt=Math.sin(D)*d+a;e.lineTo(G,yt)}e.closePath()}function Gf(e,i,t,s,n){let{fullCircles:o,startAngle:r,circumference:a}=i,l=i.endAngle;if(o){Ts(e,i,t,s,l,n);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=r+(a%N||N))}return Ts(e,i,t,s,l,n),e.fill(),l}function Kf(e,i,t,s,n){let{fullCircles:o,startAngle:r,circumference:a,options:l}=i,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:f}=l,u=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,u?(e.lineWidth=c*2,e.lineJoin=h||"round"):(e.lineWidth=c,e.lineJoin=h||"bevel");let p=i.endAngle;if(o){Ts(e,i,t,s,p,n);for(let g=0;g<o;++g)e.stroke();isNaN(a)||(p=r+(a%N||N))}u&&Uf(e,i,p),o||(Ts(e,i,t,s,p,n),e.stroke())}var Se=class extends gt{constructor(t){super();M(this,"circumference");M(this,"endAngle");M(this,"fullCircles");M(this,"innerRadius");M(this,"outerRadius");M(this,"pixelMargin");M(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,s,n){let o=this.getProps(["x","y"],n),{angle:r,distance:a}=pn(o,{x:t,y:s}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=(this.options.spacing+this.options.borderWidth)/2,p=O(f,c-l),g=je(r,l,c)&&l!==c,m=p>=N||g,b=Ot(a,h+u,d+u);return m&&b}getCenterPoint(t){let{x:s,y:n,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:c,spacing:h}=this.options,d=(o+r)/2,f=(a+l+h+c)/2;return{x:s+Math.cos(d)*f,y:n+Math.sin(d)*f}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:s,circumference:n}=this,o=(s.offset||0)/4,r=(s.spacing||0)/2,a=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>N?Math.floor(n/N):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*o,Math.sin(l)*o);let c=1-Math.sin(Math.min(V,n||0)),h=o*c;t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,Gf(t,this,h,r,a),Kf(t,this,h,r,a),t.restore()}};M(Se,"id","arc"),M(Se,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),M(Se,"defaultRoutes",{backgroundColor:"backgroundColor"}),M(Se,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"});function Ja(e,i,t=i){e.lineCap=O(t.borderCapStyle,i.borderCapStyle),e.setLineDash(O(t.borderDash,i.borderDash)),e.lineDashOffset=O(t.borderDashOffset,i.borderDashOffset),e.lineJoin=O(t.borderJoinStyle,i.borderJoinStyle),e.lineWidth=O(t.borderWidth,i.borderWidth),e.strokeStyle=O(t.borderColor,i.borderColor)}function qf(e,i,t){e.lineTo(t.x,t.y)}function Zf(e){return e.stepped?Or:e.tension||e.cubicInterpolationMode==="monotone"?Pr:qf}function Qa(e,i,t={}){let s=e.length,{start:n=0,end:o=s-1}=t,{start:r,end:a}=i,l=Math.max(n,r),c=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:s,start:l,loop:i.loop,ilen:c<l&&!h?s+c-l:c-l}}function Jf(e,i,t,s){let{points:n,options:o}=i,{count:r,start:a,loop:l,ilen:c}=Qa(n,t,s),h=Zf(o),{move:d=!0,reverse:f}=s||{},u,p,g;for(u=0;u<=c;++u)p=n[(a+(f?c-u:u))%r],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):h(e,g,p,f,o.stepped),g=p);return l&&(p=n[(a+(f?c:0))%r],h(e,g,p,f,o.stepped)),!!l}function Qf(e,i,t,s){let n=i.points,{count:o,start:r,ilen:a}=Qa(n,t,s),{move:l=!0,reverse:c}=s||{},h=0,d=0,f,u,p,g,m,b,x=C=>(r+(c?a-C:C))%o,y=()=>{g!==m&&(e.lineTo(h,m),e.lineTo(h,g),e.lineTo(h,b))};for(l&&(u=n[x(0)],e.moveTo(u.x,u.y)),f=0;f<=a;++f){if(u=n[x(f)],u.skip)continue;let C=u.x,_=u.y,v=C|0;v===p?(_<g?g=_:_>m&&(m=_),h=(d*h+C)/++d):(y(),e.lineTo(C,_),p=v,d=0,g=m=_),b=_}y()}function io(e){let i=e.options,t=i.borderDash&&i.borderDash.length;return!e._decimated&&!e._loop&&!i.tension&&i.cubicInterpolationMode!=="monotone"&&!i.stepped&&!t?Qf:Jf}function tu(e){return e.stepped?Br:e.tension||e.cubicInterpolationMode==="monotone"?zr:te}function eu(e,i,t,s){let n=i._path;n||(n=i._path=new Path2D,i.path(n,t,s)&&n.closePath()),Ja(e,i.options),e.stroke(n)}function iu(e,i,t,s){let{segments:n,options:o}=i,r=io(i);for(let a of n)Ja(e,o,a.style),e.beginPath(),r(e,i,a,{start:t,end:t+s-1})&&e.closePath(),e.stroke()}var su=typeof Path2D=="function";function nu(e,i,t,s){su&&!i.options.segment?eu(e,i,t,s):iu(e,i,t,s)}var Ls=(()=>{class e extends gt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,s){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let o=n.spanGaps?this._loop:this._fullLoop;Rr(this._points,n,t,o,s),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Vr(this,this.options.segment))}first(){let t=this.segments,s=this.points;return t.length&&s[t[0].start]}last(){let t=this.segments,s=this.points,n=t.length;return n&&s[t[n-1].end]}interpolate(t,s){let n=this.options,o=t[s],r=this.points,a=Fn(this,{property:s,start:o,end:o});if(!a.length)return;let l=[],c=tu(n),h,d;for(h=0,d=a.length;h<d;++h){let{start:f,end:u}=a[h],p=r[f],g=r[u];if(p===g){l.push(p);continue}let m=Math.abs((o-p[s])/(g[s]-p[s])),b=c(p,g,m,n.stepped);b[s]=t[s],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,s,n){return io(this)(t,this,s,n)}path(t,s,n){let o=this.segments,r=io(this),a=this._loop;s=s||0,n=n||this.points.length-s;for(let l of o)a&=r(t,this,l,{start:s,end:s+n-1});return!!a}draw(t,s,n,o){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),nu(t,this,n,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}return M(e,"id","line"),M(e,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),M(e,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),M(e,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"}),e})();function ga(e,i,t,s){let n=e.options,{[t]:o}=e.getProps([t],s);return Math.abs(i-o)<n.radius+n.hitRadius}var ou=(()=>{class e extends gt{constructor(s){super();M(this,"parsed");M(this,"skip");M(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,s&&Object.assign(this,s)}inRange(s,n,o){let r=this.options,{x:a,y:l}=this.getProps(["x","y"],o);return Math.pow(s-a,2)+Math.pow(n-l,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(s,n){return ga(this,s,"x",n)}inYRange(s,n){return ga(this,s,"y",n)}getCenterPoint(s){let{x:n,y:o}=this.getProps(["x","y"],s);return{x:n,y:o}}size(s){s=s||this.options||{};let n=s.radius||0;n=Math.max(n,n&&s.hoverRadius||0);let o=n&&s.borderWidth||0;return(n+o)*2}draw(s,n){let o=this.options;this.skip||o.radius<.1||!kt(this,n,this.size(o)/2)||(s.strokeStyle=o.borderColor,s.lineWidth=o.borderWidth,s.fillStyle=o.backgroundColor,fs(s,o,this.x,this.y))}getRange(){let s=this.options||{};return s.radius+s.hitRadius}}return M(e,"id","point"),M(e,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),M(e,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),e})();function tl(e,i){let{x:t,y:s,base:n,width:o,height:r}=e.getProps(["x","y","base","width","height"],i),a,l,c,h,d;return e.horizontal?(d=r/2,a=Math.min(t,n),l=Math.max(t,n),c=s-d,h=s+d):(d=o/2,a=t-d,l=t+d,c=Math.min(s,n),h=Math.max(s,n)),{left:a,top:c,right:l,bottom:h}}function re(e,i,t,s){return e?0:Q(i,t,s)}function ru(e,i,t){let s=e.options.borderWidth,n=e.borderSkipped,o=kn(s);return{t:re(n.top,o.top,0,t),r:re(n.right,o.right,0,i),b:re(n.bottom,o.bottom,0,t),l:re(n.left,o.left,0,i)}}function au(e,i,t){let{enableBorderRadius:s}=e.getProps(["enableBorderRadius"]),n=e.options.borderRadius,o=ne(n),r=Math.min(i,t),a=e.borderSkipped,l=s||T(n);return{topLeft:re(!l||a.top||a.left,o.topLeft,0,r),topRight:re(!l||a.top||a.right,o.topRight,0,r),bottomLeft:re(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:re(!l||a.bottom||a.right,o.bottomRight,0,r)}}function lu(e){let i=tl(e),t=i.right-i.left,s=i.bottom-i.top,n=ru(e,t/2,s/2),o=au(e,t/2,s/2);return{outer:{x:i.left,y:i.top,w:t,h:s,radius:o},inner:{x:i.left+n.l,y:i.top+n.t,w:t-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function Hn(e,i,t,s){let n=i===null,o=t===null,a=e&&!(n&&o)&&tl(e,s);return a&&(n||Ot(i,a.left,a.right))&&(o||Ot(t,a.top,a.bottom))}function cu(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function hu(e,i){e.rect(i.x,i.y,i.w,i.h)}function $n(e,i,t={}){let s=e.x!==t.x?-i:0,n=e.y!==t.y?-i:0,o=(e.x+e.w!==t.x+t.w?i:0)-s,r=(e.y+e.h!==t.y+t.h?i:0)-n;return{x:e.x+s,y:e.y+n,w:e.w+o,h:e.h+r,radius:e.radius}}var $e=class extends gt{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:s,backgroundColor:n}}=this,{inner:o,outer:r}=lu(this),a=cu(r.radius)?Ne:hu;i.save(),(r.w!==o.w||r.h!==o.h)&&(i.beginPath(),a(i,$n(r,t,o)),i.clip(),a(i,$n(o,-t,r)),i.fillStyle=s,i.fill("evenodd")),i.beginPath(),a(i,$n(o,t)),i.fillStyle=n,i.fill(),i.restore()}inRange(i,t,s){return Hn(this,i,t,s)}inXRange(i,t){return Hn(this,i,null,t)}inYRange(i,t){return Hn(this,null,i,t)}getCenterPoint(i){let{x:t,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],i);return{x:o?(t+n)/2:t,y:o?s:(s+n)/2}}getRange(i){return i==="x"?this.width/2:this.height/2}};M($e,"id","bar"),M($e,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),M($e,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var du=Object.freeze({__proto__:null,ArcElement:Se,BarElement:$e,LineElement:Ls,PointElement:ou}),so=["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)"],ma=so.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function el(e){return so[e%so.length]}function il(e){return ma[e%ma.length]}function fu(e,i){return e.borderColor=el(i),e.backgroundColor=il(i),++i}function uu(e,i){return e.backgroundColor=e.data.map(()=>el(i++)),i}function pu(e,i){return e.backgroundColor=e.data.map(()=>il(i++)),i}function gu(e){let i=0;return(t,s)=>{let n=e.getDatasetMeta(s).controller;n instanceof ao?i=uu(t,i):n instanceof Ha?i=pu(t,i):n&&(i=fu(t,i))}}function xa(e){let i;for(i in e)if(e[i].borderColor||e[i].backgroundColor)return!0;return!1}function mu(e){return e&&(e.borderColor||e.backgroundColor)}function xu(){return z.borderColor!=="rgba(0,0,0,0.1)"||z.backgroundColor!=="rgba(0,0,0,0.1)"}var bu={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,i,t){if(!t.enabled)return;let{data:{datasets:s},options:n}=e.config,{elements:o}=n,r=xa(s)||mu(n)||o&&xa(o)||xu();if(!t.forceOverride&&r)return;let a=gu(e);s.forEach(a)}};function _u(e,i,t,s,n){let o=n.samples||s;if(o>=t)return e.slice(i,i+t);let r=[],a=(t-2)/(o-2),l=0,c=i+t-1,h=i,d,f,u,p,g;for(r[l++]=e[h],d=0;d<o-2;d++){let m=0,b=0,x,y=Math.floor((d+1)*a)+1+i,C=Math.min(Math.floor((d+2)*a)+1,t)+i,_=C-y;for(x=y;x<C;x++)m+=e[x].x,b+=e[x].y;m/=_,b/=_;let v=Math.floor(d*a)+1+i,k=Math.min(Math.floor((d+1)*a)+1,t)+i,{x:w,y:S}=e[h];for(u=p=-1,x=v;x<k;x++)p=.5*Math.abs((w-m)*(e[x].y-S)-(w-e[x].x)*(b-S)),p>u&&(u=p,f=e[x],g=x);r[l++]=f,h=g}return r[l++]=e[c],r}function yu(e,i,t,s){let n=0,o=0,r,a,l,c,h,d,f,u,p,g,m=[],b=i+t-1,x=e[i].x,C=e[b].x-x;for(r=i;r<i+t;++r){a=e[r],l=(a.x-x)/C*s,c=a.y;let _=l|0;if(_===h)c<p?(p=c,d=r):c>g&&(g=c,f=r),n=(o*n+a.x)/++o;else{let v=r-1;if(!I(d)&&!I(f)){let k=Math.min(d,f),w=Math.max(d,f);k!==u&&k!==v&&m.push(Nt(Vt({},e[k]),{x:n})),w!==u&&w!==v&&m.push(Nt(Vt({},e[w]),{x:n}))}r>0&&v!==u&&m.push(e[v]),m.push(a),h=_,o=0,p=g=c,d=f=u=r}}return m}function sl(e){if(e._decimated){let i=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:i})}}function ba(e){e.data.datasets.forEach(i=>{sl(i)})}function vu(e,i){let t=i.length,s=0,n,{iScale:o}=e,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=Q(Mt(i,o.axis,r).lo,0,t-1)),c?n=Q(Mt(i,o.axis,a).hi+1,s,t)-s:n=t-s,{start:s,count:n}}var Cu={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,i,t)=>{if(!t.enabled){ba(e);return}let s=e.width;e.data.datasets.forEach((n,o)=>{let{_data:r,indexAxis:a}=n,l=e.getDatasetMeta(o),c=r||n.data;if(We([a,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:f}=vu(l,c),u=t.threshold||4*s;if(f<=u){sl(n);return}I(r)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(t.algorithm){case"lttb":p=_u(c,d,f,s,t);break;case"min-max":p=yu(c,d,f,s);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}n._decimated=p})},destroy(e){ba(e)}};function wu(e,i,t){let s=e.segments,n=e.points,o=i.points,r=[];for(let a of s){let{start:l,end:c}=a;c=lo(l,c,n);let h=no(t,n[l],n[c],a.loop);if(!i.segments){r.push({source:a,target:h,start:n[l],end:n[c]});continue}let d=Fn(i,h);for(let f of d){let u=no(t,o[f.start],o[f.end],f.loop),p=Rn(a,n,u);for(let g of p)r.push({source:g,target:f,start:{[t]:_a(h,u,"start",Math.max)},end:{[t]:_a(h,u,"end",Math.min)}})}}return r}function no(e,i,t,s){if(s)return;let n=i[e],o=t[e];return e==="angle"&&(n=lt(n),o=lt(o)),{property:e,start:n,end:o}}function Mu(e,i){let{x:t=null,y:s=null}=e||{},n=i.points,o=[];return i.segments.forEach(({start:r,end:a})=>{a=lo(r,a,n);let l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):t!==null&&(o.push({x:t,y:l.y}),o.push({x:t,y:c.y}))}),o}function lo(e,i,t){for(;i>e;i--){let s=t[i];if(!isNaN(s.x)&&!isNaN(s.y))break}return i}function _a(e,i,t,s){return e&&i?s(e[t],i[t]):e?e[t]:i?i[t]:0}function nl(e,i){let t=[],s=!1;return j(e)?(s=!0,t=e):t=Mu(e,i),t.length?new Ls({points:t,options:{tension:0},_loop:s,_fullLoop:s}):null}function ya(e){return e&&e.fill!==!1}function ku(e,i,t){let n=e[i].fill,o=[i],r;if(!t)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!Y(n))return n;if(r=e[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function Su(e,i,t){let s=Tu(e);if(T(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return Y(n)&&Math.floor(n)===n?Ou(s[0],i,n,t):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Ou(e,i,t,s){return(e==="-"||e==="+")&&(t=i+t),t===i||t<0||t>=s?!1:t}function Pu(e,i){let t=null;return e==="start"?t=i.bottom:e==="end"?t=i.top:T(e)?t=i.getPixelForValue(e.value):i.getBasePixel&&(t=i.getBasePixel()),t}function Du(e,i,t){let s;return e==="start"?s=t:e==="end"?s=i.options.reverse?i.min:i.max:T(e)?s=e.value:s=i.getBaseValue(),s}function Tu(e){let i=e.options,t=i.fill,s=O(t&&t.target,t);return s===void 0&&(s=!!i.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Au(e){let{scale:i,index:t,line:s}=e,n=[],o=s.segments,r=s.points,a=Iu(i,t);a.push(nl({x:null,y:i.bottom},s));for(let l=0;l<o.length;l++){let c=o[l];for(let h=c.start;h<=c.end;h++)Lu(n,r[h],a)}return new Ls({points:n,options:{}})}function Iu(e,i){let t=[],s=e.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){let o=s[n];if(o.index===i)break;o.hidden||t.unshift(o.dataset)}return t}function Lu(e,i,t){let s=[];for(let n=0;n<t.length;n++){let o=t[n],{first:r,last:a,point:l}=Ru(o,i,"x");if(!(!l||r&&a)){if(r)s.unshift(l);else if(e.push(l),!a)break}}e.push(...s)}function Ru(e,i,t){let s=e.interpolate(i,t);if(!s)return{};let n=s[t],o=e.segments,r=e.points,a=!1,l=!1;for(let c=0;c<o.length;c++){let h=o[c],d=r[h.start][t],f=r[h.end][t];if(Ot(n,d,f)){a=n===d,l=n===f;break}}return{first:a,last:l,point:s}}var As=class{constructor(i){this.x=i.x,this.y=i.y,this.radius=i.radius}pathSegment(i,t,s){let{x:n,y:o,radius:r}=this;return t=t||{start:0,end:N},i.arc(n,o,r,t.end,t.start,!0),!s.bounds}interpolate(i){let{x:t,y:s,radius:n}=this,o=i.angle;return{x:t+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}};function Fu(e){let{chart:i,fill:t,line:s}=e;if(Y(t))return Eu(i,t);if(t==="stack")return Au(e);if(t==="shape")return!0;let n=Bu(e);return n instanceof As?n:nl(n,s)}function Eu(e,i){let t=e.getDatasetMeta(i);return t&&e.isDatasetVisible(i)?t.dataset:null}function Bu(e){return(e.scale||{}).getPointPositionForValue?ju(e):zu(e)}function zu(e){let{scale:i={},fill:t}=e,s=Pu(t,i);if(Y(s)){let n=i.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function ju(e){let{scale:i,fill:t}=e,s=i.options,n=i.getLabels().length,o=s.reverse?i.max:i.min,r=Du(t,i,o),a=[];if(s.grid.circular){let l=i.getPointPositionForValue(0,o);return new As({x:l.x,y:l.y,radius:i.getDistanceFromCenterForValue(r)})}for(let l=0;l<n;++l)a.push(i.getPointPositionForValue(l,r));return a}function Un(e,i,t){let s=Fu(i),{line:n,scale:o,axis:r}=i,a=n.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};s&&n.points.length&&(mi(e,t),Vu(e,{line:n,target:s,above:h,below:d,area:t,scale:o,axis:r}),xi(e))}function Vu(e,i){let{line:t,target:s,above:n,below:o,area:r,scale:a}=i,l=t._loop?"angle":i.axis;e.save(),l==="x"&&o!==n&&(va(e,s,r.top),Ca(e,{line:t,target:s,color:n,scale:a,property:l}),e.restore(),e.save(),va(e,s,r.bottom)),Ca(e,{line:t,target:s,color:o,scale:a,property:l}),e.restore()}function va(e,i,t){let{segments:s,points:n}=i,o=!0,r=!1;e.beginPath();for(let a of s){let{start:l,end:c}=a,h=n[l],d=n[lo(l,c,n)];o?(e.moveTo(h.x,h.y),o=!1):(e.lineTo(h.x,t),e.lineTo(h.x,h.y)),r=!!i.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(d.x,t)}e.lineTo(i.first().x,t),e.closePath(),e.clip()}function Ca(e,i){let{line:t,target:s,property:n,color:o,scale:r}=i,a=wu(t,s,n);for(let{source:l,target:c,start:h,end:d}of a){let{style:{backgroundColor:f=o}={}}=l,u=s!==!0;e.save(),e.fillStyle=f,Nu(e,r,u&&no(n,h,d)),e.beginPath();let p=!!t.pathSegment(e,l),g;if(u){p?e.closePath():wa(e,s,d,n);let m=!!s.pathSegment(e,c,{move:p,reverse:!0});g=p&&m,g||wa(e,s,h,n)}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore()}}function Nu(e,i,t){let{top:s,bottom:n}=i.chart.chartArea,{property:o,start:r,end:a}=t||{};o==="x"&&(e.beginPath(),e.rect(r,s,a-r,n-s),e.clip())}function wa(e,i,t,s){let n=i.interpolate(t,s);n&&e.lineTo(n.x,n.y)}var Wu={id:"filler",afterDatasetsUpdate(e,i,t){let s=(e.data.datasets||[]).length,n=[],o,r,a,l;for(r=0;r<s;++r)o=e.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Ls&&(l={visible:e.isDatasetVisible(r),index:r,fill:Su(a,r,s),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<s;++r)l=n[r],!(!l||l.fill===!1)&&(l.fill=ku(n,r,t.propagate))},beforeDraw(e,i,t){let s=t.drawTime==="beforeDraw",n=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let r=n.length-1;r>=0;--r){let a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),s&&a.fill&&Un(e.ctx,a,o))}},beforeDatasetsDraw(e,i,t){if(t.drawTime!=="beforeDatasetsDraw")return;let s=e.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){let o=s[n].$filler;ya(o)&&Un(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,i,t){let s=i.meta.$filler;!ya(s)||t.drawTime!=="beforeDatasetDraw"||Un(e.ctx,s,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Ma=(e,i)=>{let{boxHeight:t=i,boxWidth:s=i}=e;return e.usePointStyle&&(t=Math.min(t,i),s=e.pointStyleWidth||Math.min(s,i)),{boxWidth:s,boxHeight:t,itemHeight:Math.max(i,t)}},Hu=(e,i)=>e!==null&&i!==null&&e.datasetIndex===i.datasetIndex&&e.index===i.index,Is=class extends gt{constructor(i){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,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,s){this.maxWidth=i,this.maxHeight=t,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let i=this.options.labels||{},t=B(i.generateLabels,[this.chart],this)||[];i.filter&&(t=t.filter(s=>i.filter(s,this.chart.data))),i.sort&&(t=t.sort((s,n)=>i.sort(s,n,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 s=i.labels,n=Z(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Ma(s,o),c,h;t.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,i.maxWidth||this.maxWidth),this.height=Math.min(h,i.maxHeight||this.maxHeight)}_fitRows(i,t,s,n){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a,d=i;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((p,g)=>{let m=s+t/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,u+=h,f++),l[g]={left:0,top:u,row:f,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(i,t,s,n){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-i,d=a,f=0,u=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:x,itemHeight:y}=$u(s,t,o,m,n);b>0&&u+y+2*a>h&&(d+=f+a,c.push({width:f,height:u}),p+=f+a,g++,f=u=0),l[b]={left:p,top:u,col:g,width:x,height:y},f=Math.max(f,x),u+=y+a}),d+=f,c.push({width:f,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;let i=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:s,labels:{padding:n},rtl:o}}=this,r=we(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=et(s,this.left+n,this.right-this.lineWidths[a]);for(let c of t)a!==c.row&&(a=c.row,l=et(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+i+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=et(s,this.top+i+n,this.bottom-this.columnSizes[a].height);for(let c of t)c.col!==a&&(a=c.col,l=et(s,this.top+i+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let i=this.ctx;mi(i,this),this._draw(),xi(i)}}_draw(){let{options:i,columnSizes:t,lineWidths:s,ctx:n}=this,{align:o,labels:r}=i,a=z.color,l=we(i.rtl,this.left,this.width),c=Z(r.font),{padding:h}=r,d=c.size,f=d/2,u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:p,boxHeight:g,itemHeight:m}=Ma(r,d),b=function(v,k,w){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();let S=O(w.lineWidth,1);if(n.fillStyle=O(w.fillStyle,a),n.lineCap=O(w.lineCap,"butt"),n.lineDashOffset=O(w.lineDashOffset,0),n.lineJoin=O(w.lineJoin,"miter"),n.lineWidth=S,n.strokeStyle=O(w.strokeStyle,a),n.setLineDash(O(w.lineDash,[])),r.usePointStyle){let D={radius:g*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:S},P=l.xPlus(v,p/2),A=k+f;Mn(n,D,P,A,r.pointStyleWidth&&p)}else{let D=k+Math.max((d-g)/2,0),P=l.leftForLtr(v,p),A=ne(w.borderRadius);n.beginPath(),Object.values(A).some(tt=>tt!==0)?Ne(n,{x:P,y:D,w:p,h:g,radius:A}):n.rect(P,D,p,g),n.fill(),S!==0&&n.stroke()}n.restore()},x=function(v,k,w){se(n,w.text,v,k+m/2,c,{strikethrough:w.hidden,textAlign:l.textAlign(w.textAlign)})},y=this.isHorizontal(),C=this._computeTitleHeight();y?u={x:et(o,this.left+h,this.right-s[0]),y:this.top+h+C,line:0}:u={x:this.left+h,y:et(o,this.top+C+h,this.bottom-t[0].height),line:0},In(this.ctx,i.textDirection);let _=m+h;this.legendItems.forEach((v,k)=>{n.strokeStyle=v.fontColor,n.fillStyle=v.fontColor;let w=n.measureText(v.text).width,S=l.textAlign(v.textAlign||(v.textAlign=r.textAlign)),D=p+f+w,P=u.x,A=u.y;l.setWidth(this.width),y?k>0&&P+D+h>this.right&&(A=u.y+=_,u.line++,P=u.x=et(o,this.left+h,this.right-s[u.line])):k>0&&A+_>this.bottom&&(P=u.x=P+t[u.line].width+h,u.line++,A=u.y=et(o,this.top+C+h,this.bottom-t[u.line].height));let tt=l.x(P);if(b(tt,A,v),P=Mr(S,P+p+f,y?P+D:this.right,i.rtl),x(l.x(P),A,v),y)u.x+=D+h;else if(typeof v.text!="string"){let ut=c.lineHeight;u.y+=ol(v,ut)+h}else u.y+=_}),Ln(this.ctx,i.textDirection)}drawTitle(){let i=this.options,t=i.title,s=Z(t.font),n=it(t.padding);if(!t.display)return;let o=we(i.rtl,this.left,this.width),r=this.ctx,a=t.position,l=s.size/2,c=n.top+l,h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=et(i.align,d,this.right-f);else{let p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+et(i.align,this.top,this.bottom-p-i.labels.padding-this._computeTitleHeight())}let u=et(a,d,d+f);r.textAlign=o.textAlign(hs(a)),r.textBaseline="middle",r.strokeStyle=t.color,r.fillStyle=t.color,r.font=s.string,se(r,t.text,u,h,s)}_computeTitleHeight(){let i=this.options.title,t=Z(i.font),s=it(i.padding);return i.display?t.lineHeight+s.height:0}_getLegendItemAt(i,t){let s,n,o;if(Ot(i,this.left,this.right)&&Ot(t,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Ot(i,n.left,n.left+n.width)&&Ot(t,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(i){let t=this.options;if(!Xu(i.type,t))return;let s=this._getLegendItemAt(i.x,i.y);if(i.type==="mousemove"||i.type==="mouseout"){let n=this._hoveredItem,o=Hu(n,s);n&&!o&&B(t.onLeave,[i,n,this],this),this._hoveredItem=s,s&&!o&&B(t.onHover,[i,s,this],this)}else s&&B(t.onClick,[i,s,this],this)}};function $u(e,i,t,s,n){let o=Uu(s,e,i,t),r=Yu(n,s,i.lineHeight);return{itemWidth:o,itemHeight:r}}function Uu(e,i,t,s){let n=e.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),i+t.size/2+s.measureText(n).width}function Yu(e,i,t){let s=e;return typeof i.text!="string"&&(s=ol(i,t)),s}function ol(e,i){let t=e.text?e.text.length:0;return i*t}function Xu(e,i){return!!((e==="mousemove"||e==="mouseout")&&(i.onHover||i.onLeave)||i.onClick&&(e==="click"||e==="mouseup"))}var Gu={id:"legend",_element:Is,start(e,i,t){let s=e.legend=new Is({ctx:e.ctx,options:t,chart:e});rt.configure(e,s,t),rt.addBox(e,s)},stop(e){rt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,i,t){let s=e.legend;rt.configure(e,s,t),s.options=t},afterUpdate(e){let i=e.legend;i.buildLabels(),i.adjustHitBoxes()},afterEvent(e,i){i.replay||e.legend.handleEvent(i.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,i,t){let s=i.datasetIndex,n=t.chart;n.isDatasetVisible(s)?(n.hide(s),i.hidden=!0):(n.show(s),i.hidden=!1)},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:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(t?0:void 0),h=it(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:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Di=class extends gt{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 s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=i,this.height=this.bottom=t;let n=j(s.text)?s.text.length:1;this._padding=it(s.padding);let o=n*Z(s.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:s,bottom:n,right:o,options:r}=this,a=r.align,l=0,c,h,d;return this.isHorizontal()?(h=et(a,s,o),d=t+i,c=o-s):(r.position==="left"?(h=s+i,d=et(a,n,t),l=V*-.5):(h=o-i,d=et(a,t,n),l=V*.5),c=n-t),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){let i=this.ctx,t=this.options;if(!t.display)return;let s=Z(t.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);se(i,t.text,0,0,s,{color:t.color,maxWidth:l,rotation:c,textAlign:hs(t.align),textBaseline:"middle",translation:[r,a]})}};function Ku(e,i){let t=new Di({ctx:e.ctx,options:i,chart:e});rt.configure(e,t,i),rt.addBox(e,t),e.titleBlock=t}var qu={id:"title",_element:Di,start(e,i,t){Ku(e,t)},stop(e){let i=e.titleBlock;rt.removeBox(e,i),delete e.titleBlock},beforeUpdate(e,i,t){let s=e.titleBlock;rt.configure(e,s,t),s.options=t},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Cs=new WeakMap,Zu={id:"subtitle",start(e,i,t){let s=new Di({ctx:e.ctx,options:t,chart:e});rt.configure(e,s,t),rt.addBox(e,s),Cs.set(e,s)},stop(e){rt.removeBox(e,Cs.get(e)),Cs.delete(e)},beforeUpdate(e,i,t){let s=Cs.get(e);rt.configure(e,s,t),s.options=t},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Mi={average(e){if(!e.length)return!1;let i,t,s=new Set,n=0,o=0;for(i=0,t=e.length;i<t;++i){let a=e[i].element;if(a&&a.hasValue()){let l=a.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:n/o}},nearest(e,i){if(!e.length)return!1;let t=i.x,s=i.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=os(i,c);h<n&&(n=h,a=l)}}if(a){let l=a.tooltipPosition();t=l.x,s=l.y}return{x:t,y:s}}};function Pt(e,i){return i&&(j(i)?Array.prototype.push.apply(e,i):e.push(i)),e}function zt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
`)>-1?e.split(`
`):e}function Ju(e,i){let{element:t,datasetIndex:s,index:n}=i,o=e.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:e,label:r,parsed:o.getParsed(n),raw:e.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:t}}function ka(e,i){let t=e.chart.ctx,{body:s,footer:n,title:o}=e,{boxWidth:r,boxHeight:a}=i,l=Z(i.bodyFont),c=Z(i.titleFont),h=Z(i.footerFont),d=o.length,f=n.length,u=s.length,p=it(i.padding),g=p.height,m=0,b=s.reduce((C,_)=>C+_.before.length+_.lines.length+_.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*i.titleSpacing+i.titleMarginBottom),b){let C=i.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=u*C+(b-u)*l.lineHeight+(b-1)*i.bodySpacing}f&&(g+=i.footerMarginTop+f*h.lineHeight+(f-1)*i.footerSpacing);let x=0,y=function(C){m=Math.max(m,t.measureText(C).width+x)};return t.save(),t.font=c.string,R(e.title,y),t.font=l.string,R(e.beforeBody.concat(e.afterBody),y),x=i.displayColors?r+2+i.boxPadding:0,R(s,C=>{R(C.before,y),R(C.lines,y),R(C.after,y)}),x=0,t.font=h.string,R(e.footer,y),t.restore(),m+=p.width,{width:m,height:g}}function Qu(e,i){let{y:t,height:s}=i;return t<s/2?"top":t>e.height-s/2?"bottom":"center"}function tp(e,i,t,s){let{x:n,width:o}=s,r=t.caretSize+t.caretPadding;if(e==="left"&&n+o+r>i.width||e==="right"&&n-o-r<0)return!0}function ep(e,i,t,s){let{x:n,width:o}=t,{width:r,chartArea:{left:a,right:l}}=e,c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),tp(c,e,i,t)&&(c="center"),c}function Sa(e,i,t){let s=t.yAlign||i.yAlign||Qu(e,t);return{xAlign:t.xAlign||i.xAlign||ep(e,i,t,s),yAlign:s}}function ip(e,i){let{x:t,width:s}=e;return i==="right"?t-=s:i==="center"&&(t-=s/2),t}function sp(e,i,t){let{y:s,height:n}=e;return i==="top"?s+=t:i==="bottom"?s-=n+t:s-=n/2,s}function Oa(e,i,t,s){let{caretSize:n,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=t,c=n+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=ne(r),p=ip(i,a),g=sp(i,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,f)+n:a==="right"&&(p+=Math.max(d,u)+n),{x:Q(p,0,s.width-i.width),y:Q(g,0,s.height-i.height)}}function ws(e,i,t){let s=it(t.padding);return i==="center"?e.x+e.width/2:i==="right"?e.x+e.width-s.right:e.x+s.left}function Pa(e){return Pt([],zt(e))}function np(e,i,t){return Et(e,{tooltip:i,tooltipItems:t,type:"tooltip"})}function Da(e,i){let t=i&&i.dataset&&i.dataset.tooltip&&i.dataset.tooltip.callbacks;return t?e.override(t):e}var rl={beforeTitle:St,title(e){if(e.length>0){let i=e[0],t=i.chart.data.labels,s=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return i.dataset.label||"";if(i.label)return i.label;if(s>0&&i.dataIndex<s)return t[i.dataIndex]}return""},afterTitle:St,beforeBody:St,beforeLabel:St,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 I(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:St,afterBody:St,beforeFooter:St,footer:St,afterFooter:St};function ht(e,i,t,s){let n=e[i].call(t,s);return typeof n>"u"?rl[i].call(t,s):n}var Ta=(()=>{class e extends gt{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 s=this.chart,n=this.options.setContext(this.getContext()),o=n.enabled&&s.options.animation&&n.animations,r=new Os(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=np(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,s){let{callbacks:n}=s,o=ht(n,"beforeTitle",this,t),r=ht(n,"title",this,t),a=ht(n,"afterTitle",this,t),l=[];return l=Pt(l,zt(o)),l=Pt(l,zt(r)),l=Pt(l,zt(a)),l}getBeforeBody(t,s){return Pa(ht(s.callbacks,"beforeBody",this,t))}getBody(t,s){let{callbacks:n}=s,o=[];return R(t,r=>{let a={before:[],lines:[],after:[]},l=Da(n,r);Pt(a.before,zt(ht(l,"beforeLabel",this,r))),Pt(a.lines,ht(l,"label",this,r)),Pt(a.after,zt(ht(l,"afterLabel",this,r))),o.push(a)}),o}getAfterBody(t,s){return Pa(ht(s.callbacks,"afterBody",this,t))}getFooter(t,s){let{callbacks:n}=s,o=ht(n,"beforeFooter",this,t),r=ht(n,"footer",this,t),a=ht(n,"afterFooter",this,t),l=[];return l=Pt(l,zt(o)),l=Pt(l,zt(r)),l=Pt(l,zt(a)),l}_createItems(t){let s=this._active,n=this.chart.data,o=[],r=[],a=[],l=[],c,h;for(c=0,h=s.length;c<h;++c)l.push(Ju(this.chart,s[c]));return t.filter&&(l=l.filter((d,f,u)=>t.filter(d,f,u,n))),t.itemSort&&(l=l.sort((d,f)=>t.itemSort(d,f,n))),R(l,d=>{let f=Da(t.callbacks,d);o.push(ht(f,"labelColor",this,d)),r.push(ht(f,"labelPointStyle",this,d)),a.push(ht(f,"labelTextColor",this,d))}),this.labelColors=o,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=l,l}update(t,s){let n=this.options.setContext(this.getContext()),o=this._active,r,a=[];if(!o.length)this.opacity!==0&&(r={opacity:0});else{let l=Mi[n.position].call(this,o,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let c=this._size=ka(this,n),h=Object.assign({},l,c),d=Sa(this.chart,n,h),f=Oa(n,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,r={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:s})}drawCaret(t,s,n,o){let r=this.getCaretPosition(t,n,o);s.lineTo(r.x1,r.y1),s.lineTo(r.x2,r.y2),s.lineTo(r.x3,r.y3)}getCaretPosition(t,s,n){let{xAlign:o,yAlign:r}=this,{caretSize:a,cornerRadius:l}=n,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:f}=ne(l),{x:u,y:p}=t,{width:g,height:m}=s,b,x,y,C,_,v;return r==="center"?(_=p+m/2,o==="left"?(b=u,x=b-a,C=_+a,v=_-a):(b=u+g,x=b+a,C=_-a,v=_+a),y=b):(o==="left"?x=u+Math.max(c,d)+a:o==="right"?x=u+g-Math.max(h,f)-a:x=this.caretX,r==="top"?(C=p,_=C-a,b=x-a,y=x+a):(C=p+m,_=C+a,b=x+a,y=x-a),v=C),{x1:b,x2:x,x3:y,y1:C,y2:_,y3:v}}drawTitle(t,s,n){let o=this.title,r=o.length,a,l,c;if(r){let h=we(n.rtl,this.x,this.width);for(t.x=ws(this,n.titleAlign,n),s.textAlign=h.textAlign(n.titleAlign),s.textBaseline="middle",a=Z(n.titleFont),l=n.titleSpacing,s.fillStyle=n.titleColor,s.font=a.string,c=0;c<r;++c)s.fillText(o[c],h.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,c+1===r&&(t.y+=n.titleMarginBottom-l)}}_drawColorBox(t,s,n,o,r){let a=this.labelColors[n],l=this.labelPointStyles[n],{boxHeight:c,boxWidth:h}=r,d=Z(r.bodyFont),f=ws(this,"left",r),u=o.x(f),p=c<d.lineHeight?(d.lineHeight-c)/2:0,g=s.y+p;if(r.usePointStyle){let m={radius:Math.min(h,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=o.leftForLtr(u,h)+h/2,x=g+c/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,fs(t,m,b,x),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,fs(t,m,b,x)}else{t.lineWidth=T(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let m=o.leftForLtr(u,h),b=o.leftForLtr(o.xPlus(u,1),h-2),x=ne(a.borderRadius);Object.values(x).some(y=>y!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ne(t,{x:m,y:g,w:h,h:c,radius:x}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Ne(t,{x:b,y:g+1,w:h-2,h:c-2,radius:x}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,g,h,c),t.strokeRect(m,g,h,c),t.fillStyle=a.backgroundColor,t.fillRect(b,g+1,h-2,c-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,s,n){let{body:o}=this,{bodySpacing:r,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:h,boxPadding:d}=n,f=Z(n.bodyFont),u=f.lineHeight,p=0,g=we(n.rtl,this.x,this.width),m=function(S){s.fillText(S,g.x(t.x+p),t.y+u/2),t.y+=u+r},b=g.textAlign(a),x,y,C,_,v,k,w;for(s.textAlign=a,s.textBaseline="middle",s.font=f.string,t.x=ws(this,b,n),s.fillStyle=n.bodyColor,R(this.beforeBody,m),p=l&&b!=="right"?a==="center"?h/2+d:h+2+d:0,_=0,k=o.length;_<k;++_){for(x=o[_],y=this.labelTextColors[_],s.fillStyle=y,R(x.before,m),C=x.lines,l&&C.length&&(this._drawColorBox(s,t,_,g,n),u=Math.max(f.lineHeight,c)),v=0,w=C.length;v<w;++v)m(C[v]),u=f.lineHeight;R(x.after,m)}p=0,u=f.lineHeight,R(this.afterBody,m),t.y-=r}drawFooter(t,s,n){let o=this.footer,r=o.length,a,l;if(r){let c=we(n.rtl,this.x,this.width);for(t.x=ws(this,n.footerAlign,n),t.y+=n.footerMarginTop,s.textAlign=c.textAlign(n.footerAlign),s.textBaseline="middle",a=Z(n.footerFont),s.fillStyle=n.footerColor,s.font=a.string,l=0;l<r;++l)s.fillText(o[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,s,n,o){let{xAlign:r,yAlign:a}=this,{x:l,y:c}=t,{width:h,height:d}=n,{topLeft:f,topRight:u,bottomLeft:p,bottomRight:g}=ne(o.cornerRadius);s.fillStyle=o.backgroundColor,s.strokeStyle=o.borderColor,s.lineWidth=o.borderWidth,s.beginPath(),s.moveTo(l+f,c),a==="top"&&this.drawCaret(t,s,n,o),s.lineTo(l+h-u,c),s.quadraticCurveTo(l+h,c,l+h,c+u),a==="center"&&r==="right"&&this.drawCaret(t,s,n,o),s.lineTo(l+h,c+d-g),s.quadraticCurveTo(l+h,c+d,l+h-g,c+d),a==="bottom"&&this.drawCaret(t,s,n,o),s.lineTo(l+p,c+d),s.quadraticCurveTo(l,c+d,l,c+d-p),a==="center"&&r==="left"&&this.drawCaret(t,s,n,o),s.lineTo(l,c+f),s.quadraticCurveTo(l,c,l+f,c),s.closePath(),s.fill(),o.borderWidth>0&&s.stroke()}_updateAnimationTarget(t){let s=this.chart,n=this.$animations,o=n&&n.x,r=n&&n.y;if(o||r){let a=Mi[t.position].call(this,this._active,this._eventPosition);if(!a)return;let l=this._size=ka(this,t),c=Object.assign({},a,this._size),h=Sa(s,t,c),d=Oa(t,c,h,s);(o._to!==d.x||r._to!==d.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){let s=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(s);let o={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=it(s.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;s.enabled&&l&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,o,s),In(t,s.textDirection),r.y+=a.top,this.drawTitle(r,t,s),this.drawBody(r,t,s),this.drawFooter(r,t,s),Ln(t,s.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,s){let n=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}}),r=!pi(n,o),a=this._positionChanged(o,s);(r||a)&&(this._active=o,this._eventPosition=s,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,s,n=!0){if(s&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let o=this.options,r=this._active||[],a=this._getActiveElements(t,r,s,n),l=this._positionChanged(a,t),c=s||!pi(a,r)||l;return c&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,s))),c}_getActiveElements(t,s,n,o){let r=this.options;if(t.type==="mouseout")return[];if(!o)return s.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);let a=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&a.reverse(),a}_positionChanged(t,s){let{caretX:n,caretY:o,options:r}=this,a=Mi[r.position].call(this,t,s);return a!==!1&&(n!==a.x||o!==a.y)}}return M(e,"positioners",Mi),e})(),co={id:"tooltip",_element:Ta,positioners:Mi,afterInit(e,i,t){t&&(e.tooltip=new Ta({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",Nt(Vt({},t),{cancelable:!0}))===!1)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=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,i)=>i.bodyFont.size,boxWidth:(e,i)=>i.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:rl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},op=Object.freeze({__proto__:null,Colors:bu,Decimation:Cu,Filler:Wu,Legend:Gu,SubTitle:Zu,Title:qu,Tooltip:co}),rp=(e,i,t,s)=>(typeof i=="string"?(t=e.push(i)-1,s.unshift({index:t,label:i})):isNaN(i)&&(t=null),t);function ap(e,i,t,s){let n=e.indexOf(i);if(n===-1)return rp(e,i,t,s);let o=e.lastIndexOf(i);return n!==o?t:n}var lp=(e,i)=>e===null?null:Q(Math.round(e),0,i);function Aa(e){let i=this.getLabels();return e>=0&&e<i.length?i[e]:e}var cp=(()=>{class e extends Pe{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let s=this._addedLabels;if(s.length){let n=this.getLabels();for(let{index:o,label:r}of s)n[o]===r&&n.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,s){if(I(t))return null;let n=this.getLabels();return s=isFinite(s)&&n[s]===t?s:ap(n,t,O(s,t),this._addedLabels),lp(s,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:s}=this.getUserBounds(),{min:n,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),s||(o=this.getLabels().length-1)),this.min=n,this.max=o}buildTicks(){let t=this.min,s=this.max,n=this.options.offset,o=[],r=this.getLabels();r=t===0&&s===r.length-1?r:r.slice(t,s+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=s;a++)o.push({value:a});return o}getLabelForValue(t){return Aa.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 s=this.ticks;return t<0||t>s.length-1?null:this.getPixelForValue(s[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}return M(e,"id","category"),M(e,"defaults",{ticks:{callback:Aa}}),e})();function hp(e,i){let t=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=e,u=o||1,p=h-1,{min:g,max:m}=i,b=!I(r),x=!I(a),y=!I(c),C=(m-g)/(d+1),_=dn((m-g)/p/u)*u,v,k,w,S;if(_<1e-14&&!b&&!x)return[{value:g},{value:m}];S=Math.ceil(m/_)-Math.floor(g/_),S>p&&(_=dn(S*_/p/u)*u),I(l)||(v=Math.pow(10,l),_=Math.ceil(_*v)/v),n==="ticks"?(k=Math.floor(g/_)*_,w=Math.ceil(m/_)*_):(k=g,w=m),b&&x&&o&&xr((a-r)/o,_/1e3)?(S=Math.round(Math.min((a-r)/_,h)),_=(a-r)/S,k=r,w=a):y?(k=b?r:k,w=x?a:w,S=c-1,_=(w-k)/S):(S=(w-k)/_,ze(S,Math.round(S),_/1e3)?S=Math.round(S):S=Math.ceil(S));let D=Math.max(un(_),un(k));v=Math.pow(10,I(l)?D:l),k=Math.round(k*v)/v,w=Math.round(w*v)/v;let P=0;for(b&&(f&&k!==r?(t.push({value:r}),k<r&&P++,ze(Math.round((k+P*_)*v)/v,r,Ia(r,C,e))&&P++):k<r&&P++);P<S;++P){let A=Math.round((k+P*_)*v)/v;if(x&&A>a)break;t.push({value:A})}return x&&f&&w!==a?t.length&&ze(t[t.length-1].value,a,Ia(a,C,e))?t[t.length-1].value=a:t.push({value:a}):(!x||w===a)&&t.push({value:w}),t}function Ia(e,i,{horizontal:t,minRotation:s}){let n=bt(s),o=(t?Math.sin(n):Math.cos(n))||.001,r=.75*i*(""+e).length;return Math.min(i/o,r)}var Ye=class extends Pe{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 I(i)||(typeof i=="number"||i instanceof Number)&&!isFinite(+i)?null:+i}handleTickRangeOptions(){let{beginAtZero:i}=this.options,{minDefined:t,maxDefined:s}=this.getUserBounds(),{min:n,max:o}=this,r=l=>n=t?n:l,a=l=>o=s?o:l;if(i){let l=vt(n),c=vt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),i||r(n-l)}this.min=n,this.max=o}getTickLimit(){let i=this.options.ticks,{maxTicksLimit:t,stepSize:s}=i,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),t=t||11),t&&(n=Math.min(t,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let i=this.options,t=i.ticks,s=this.getTickLimit();s=Math.max(2,s);let n={maxTicks:s,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!==!1},o=this._range||this,r=hp(n,o);return i.bounds==="ticks"&&fn(r,this,"value"),i.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let i=this.ticks,t=this.min,s=this.max;if(super.configure(),this.options.offset&&i.length){let n=(s-t)/Math.max(i.length-1,1)/2;t-=n,s+=n}this._startValue=t,this._endValue=s,this._valueRange=s-t}getLabelForValue(i){return Ve(i,this.chart.options.locale,this.options.ticks.format)}},ki=class extends Ye{determineDataLimits(){let{min:i,max:t}=this.getMinMax(!0);this.min=Y(i)?i:0,this.max=Y(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let i=this.isHorizontal(),t=i?this.width:this.height,s=bt(this.options.ticks.minRotation),n=(i?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/n))}getPixelForValue(i){return i===null?NaN:this.getPixelForDecimal((i-this._startValue)/this._valueRange)}getValueForPixel(i){return this._startValue+this.getDecimalForPixel(i)*this._valueRange}};M(ki,"id","linear"),M(ki,"defaults",{ticks:{callback:gi.formatters.numeric}});var Ti=e=>Math.floor(Rt(e)),ke=(e,i)=>Math.pow(10,Ti(e)+i);function La(e){return e/Math.pow(10,Ti(e))===1}function Ra(e,i,t){let s=Math.pow(10,t),n=Math.floor(e/s);return Math.ceil(i/s)-n}function dp(e,i){let t=i-e,s=Ti(t);for(;Ra(e,i,s)>10;)s++;for(;Ra(e,i,s)<10;)s--;return Math.min(s,Ti(e))}function fp(e,{min:i,max:t}){i=ct(e.min,i);let s=[],n=Ti(i),o=dp(i,t),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,c=Math.round((i-l)*r)/r,h=Math.floor((i-l)/a/10)*a*10,d=Math.floor((c-h)/Math.pow(10,o)),f=ct(e.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;f<t;)s.push({value:f,major:La(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),f=Math.round((l+h+d*Math.pow(10,o))*r)/r;let u=ct(e.max,f);return s.push({value:u,major:La(u),significand:d}),s}var Si=class extends Pe{constructor(i){super(i),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(i,t){let s=Ye.prototype.parse.apply(this,[i,t]);if(s===0){this._zero=!0;return}return Y(s)&&s>0?s:null}determineDataLimits(){let{min:i,max:t}=this.getMinMax(!0);this.min=Y(i)?Math.max(0,i):null,this.max=Y(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Y(this._userMin)&&(this.min=i===ke(this.min,0)?ke(this.min,-1):ke(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:i,maxDefined:t}=this.getUserBounds(),s=this.min,n=this.max,o=a=>s=i?s:a,r=a=>n=t?n:a;s===n&&(s<=0?(o(1),r(10)):(o(ke(s,-1)),r(ke(n,1)))),s<=0&&o(ke(n,-1)),n<=0&&r(ke(s,1)),this.min=s,this.max=n}buildTicks(){let i=this.options,t={min:this._userMin,max:this._userMax},s=fp(t,this);return i.bounds==="ticks"&&fn(s,this,"value"),i.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(i){return i===void 0?"0":Ve(i,this.chart.options.locale,this.options.ticks.format)}configure(){let i=this.min;super.configure(),this._startValue=Rt(i),this._valueRange=Rt(this.max)-Rt(i)}getPixelForValue(i){return(i===void 0||i===0)&&(i=this.min),i===null||isNaN(i)?NaN:this.getPixelForDecimal(i===this.min?0:(Rt(i)-this._startValue)/this._valueRange)}getValueForPixel(i){let t=this.getDecimalForPixel(i);return Math.pow(10,this._startValue+t*this._valueRange)}};M(Si,"id","logarithmic"),M(Si,"defaults",{ticks:{callback:gi.formatters.logarithmic,major:{enabled:!0}}});function oo(e){let i=e.ticks;if(i.display&&e.display){let t=it(i.backdropPadding);return O(i.font&&i.font.size,z.font.size)+t.height}return 0}function up(e,i,t){return t=j(t)?t:[t],{w:Sr(e,i.string,t),h:t.length*i.lineHeight}}function Fa(e,i,t,s,n){return e===s||e===n?{start:i-t/2,end:i+t/2}:e<s||e>n?{start:i-t,end:i}:{start:i,end:i+t}}function pp(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),s=[],n=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?V/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));n[l]=c.padding;let h=e.getPointPosition(l,e.drawingArea+n[l],a),d=Z(c.font),f=up(e.ctx,d,e._pointLabels[l]);s[l]=f;let u=lt(e.getIndexAngle(l)+a),p=Math.round(ls(u)),g=Fa(p,h.x,f.w,0,180),m=Fa(p,h.y,f.h,90,270);gp(t,i,u,g,m)}e.setCenterPoint(i.l-t.l,t.r-i.r,i.t-t.t,t.b-i.b),e._pointLabelItems=bp(e,s,n)}function gp(e,i,t,s,n){let o=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t)),a=0,l=0;s.start<i.l?(a=(i.l-s.start)/o,e.l=Math.min(e.l,i.l-a)):s.end>i.r&&(a=(s.end-i.r)/o,e.r=Math.max(e.r,i.r+a)),n.start<i.t?(l=(i.t-n.start)/r,e.t=Math.min(e.t,i.t-l)):n.end>i.b&&(l=(n.end-i.b)/r,e.b=Math.max(e.b,i.b+l))}function mp(e,i,t){let s=e.drawingArea,{extra:n,additionalAngle:o,padding:r,size:a}=t,l=e.getPointPosition(i,s+n+r,o),c=Math.round(ls(lt(l.angle+X))),h=vp(l.y,a.h,c),d=_p(c),f=yp(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:f,top:h,right:f+a.w,bottom:h+a.h}}function xp(e,i){if(!i)return!0;let{left:t,top:s,right:n,bottom:o}=e;return!(kt({x:t,y:s},i)||kt({x:t,y:o},i)||kt({x:n,y:s},i)||kt({x:n,y:o},i))}function bp(e,i,t){let s=[],n=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:oo(o)/2,additionalAngle:r?V/n:0},c;for(let h=0;h<n;h++){l.padding=t[h],l.size=i[h];let d=mp(e,h,l);s.push(d),a==="auto"&&(d.visible=xp(d,c),d.visible&&(c=d))}return s}function _p(e){return e===0||e===180?"center":e<180?"left":"right"}function yp(e,i,t){return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function vp(e,i,t){return t===90||t===270?e-=i/2:(t>270||t<90)&&(e-=i),e}function Cp(e,i,t){let{left:s,top:n,right:o,bottom:r}=t,{backdropColor:a}=i;if(!I(a)){let l=ne(i.borderRadius),c=it(i.backdropPadding);e.fillStyle=a;let h=s-c.left,d=n-c.top,f=o-s+c.width,u=r-n+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Ne(e,{x:h,y:d,w:f,h:u,radius:l}),e.fill()):e.fillRect(h,d,f,u)}}function wp(e,i){let{ctx:t,options:{pointLabels:s}}=e;for(let n=i-1;n>=0;n--){let o=e._pointLabelItems[n];if(!o.visible)continue;let r=s.setContext(e.getPointLabelContext(n));Cp(t,r,o);let a=Z(r.font),{x:l,y:c,textAlign:h}=o;se(t,e._pointLabels[n],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function al(e,i,t,s){let{ctx:n}=e;if(t)n.arc(e.xCenter,e.yCenter,i,0,N);else{let o=e.getPointPosition(0,i);n.moveTo(o.x,o.y);for(let r=1;r<s;r++)o=e.getPointPosition(r,i),n.lineTo(o.x,o.y)}}function Mp(e,i,t,s,n){let o=e.ctx,r=i.circular,{color:a,lineWidth:l}=i;!r&&!s||!a||!l||t<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),al(e,t,r,s),o.closePath(),o.stroke(),o.restore())}function kp(e,i,t){return Et(e,{label:t,index:i,type:"pointLabel"})}var Oe=class extends Ye{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=it(oo(this.options)/2),t=this.width=this.maxWidth-i.width,s=this.height=this.maxHeight-i.height;this.xCenter=Math.floor(this.left+t/2+i.left),this.yCenter=Math.floor(this.top+s/2+i.top),this.drawingArea=Math.floor(Math.min(t,s)/2)}determineDataLimits(){let{min:i,max:t}=this.getMinMax(!1);this.min=Y(i)&&!isNaN(i)?i:0,this.max=Y(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/oo(this.options))}generateTickLabels(i){Ye.prototype.generateTickLabels.call(this,i),this._pointLabels=this.getLabels().map((t,s)=>{let n=B(this.options.pointLabels.callback,[t,s],this);return n||n===0?n:""}).filter((t,s)=>this.chart.getDataVisibility(s))}fit(){let i=this.options;i.display&&i.pointLabels.display?pp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(i,t,s,n){this.xCenter+=Math.floor((i-t)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(i,t,s,n))}getIndexAngle(i){let t=N/(this._pointLabels.length||1),s=this.options.startAngle||0;return lt(i*t+bt(s))}getDistanceFromCenterForValue(i){if(I(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(I(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 s=t[i];return kp(this.getContext(),i,s)}}getPointPosition(i,t,s=0){let n=this.getIndexAngle(i)-X+s;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter,angle:n}}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:s,right:n,bottom:o}=this._pointLabelItems[i];return{left:t,top:s,right:n,bottom:o}}drawBackground(){let{backgroundColor:i,grid:{circular:t}}=this.options;if(i){let s=this.ctx;s.save(),s.beginPath(),al(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),s.closePath(),s.fillStyle=i,s.fill(),s.restore()}}drawGrid(){let i=this.ctx,t=this.options,{angleLines:s,grid:n,border:o}=t,r=this._pointLabels.length,a,l,c;if(t.pointLabels.display&&wp(this,r),n.display&&this.ticks.forEach((h,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);let f=this.getContext(d),u=n.setContext(f),p=o.setContext(f);Mp(this,u,l,r,p)}}),s.display){for(i.save(),a=r-1;a>=0;a--){let h=s.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=h;!f||!d||(i.lineWidth=f,i.strokeStyle=d,i.setLineDash(h.borderDash),i.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(a,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,s=t.ticks;if(!s.display)return;let n=this.getIndexAngle(0),o,r;i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(n),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;let c=s.setContext(this.getContext(l)),h=Z(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){i.font=h.string,r=i.measureText(a.label).width,i.fillStyle=c.backdropColor;let d=it(c.backdropPadding);i.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}se(i,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),i.restore()}drawTitle(){}};M(Oe,"id","radialLinear"),M(Oe,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:gi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}}),M(Oe,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),M(Oe,"descriptors",{angleLines:{_fallback:"grid"}});var Rs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},dt=Object.keys(Rs);function Ea(e,i){return e-i}function Ba(e,i){if(I(i))return null;let t=e._adapter,{parser:s,round:n,isoWeekday:o}=e._parseOpts,r=i;return typeof s=="function"&&(r=s(r)),Y(r)||(r=typeof s=="string"?t.parse(r,s):t.parse(r)),r===null?null:(n&&(r=n==="week"&&(Ce(o)||o===!0)?t.startOf(r,"isoWeek",o):t.startOf(r,n)),+r)}function za(e,i,t,s){let n=dt.length;for(let o=dt.indexOf(e);o<n-1;++o){let r=Rs[dt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((t-i)/(a*r.size))<=s)return dt[o]}return dt[n-1]}function Sp(e,i,t,s,n){for(let o=dt.length-1;o>=dt.indexOf(t);o--){let r=dt[o];if(Rs[r].common&&e._adapter.diff(n,s,r)>=i-1)return r}return dt[t?dt.indexOf(t):0]}function Op(e){for(let i=dt.indexOf(e)+1,t=dt.length;i<t;++i)if(Rs[dt[i]].common)return dt[i]}function ja(e,i,t){if(!t)e[i]=!0;else if(t.length){let{lo:s,hi:n}=cs(t,i),o=t[s]>=i?t[s]:t[n];e[o]=!0}}function Pp(e,i,t,s){let n=e._adapter,o=+n.startOf(i[0].value,s),r=i[i.length-1].value,a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=t[a],l>=0&&(i[l].major=!0);return i}function Va(e,i,t){let s=[],n={},o=i.length,r,a;for(r=0;r<o;++r)a=i[r],n[a]=r,s.push({value:a,major:!1});return o===0||!t?s:Pp(e,s,n,t)}var ro=(()=>{class e extends Pe{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,s={}){let n=t.time||(t.time={}),o=this._adapter=new jd._date(t.adapters.date);o.init(s),Ee(n.displayFormats,o.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=s.normalized}parse(t,s){return t===void 0?null:Ba(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,s=this._adapter,n=t.time.unit||"day",{min:o,max:r,minDefined:a,maxDefined:l}=this.getUserBounds();function c(h){!a&&!isNaN(h.min)&&(o=Math.min(o,h.min)),!l&&!isNaN(h.max)&&(r=Math.max(r,h.max))}(!a||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),o=Y(o)&&!isNaN(o)?o:+s.startOf(Date.now(),n),r=Y(r)&&!isNaN(r)?r:+s.endOf(Date.now(),n)+1,this.min=Math.min(o,r-1),this.max=Math.max(o+1,r)}_getLabelBounds(){let t=this.getLabelTimestamps(),s=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(s=t[0],n=t[t.length-1]),{min:s,max:n}}buildTicks(){let t=this.options,s=t.time,n=t.ticks,o=n.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 r=this.min,a=this.max,l=yr(o,r,a);return this._unit=s.unit||(n.autoSkip?za(s.minUnit,this.min,this.max,this._getLabelCapacity(r)):Sp(this,l.length,s.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Op(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 s=0,n=0,o,r;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?s=1-o:s=(this.getDecimalForValue(t[1])-o)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;s=Q(s,0,a),n=Q(n,0,a),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){let t=this._adapter,s=this.min,n=this.max,o=this.options,r=o.time,a=r.unit||za(r.minUnit,s,n,this._getLabelCapacity(s)),l=O(o.ticks.stepSize,1),c=a==="week"?r.isoWeekday:!1,h=Ce(c)||c===!0,d={},f=s,u,p;if(h&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,h?"day":a),t.diff(n,s,a)>1e5*l)throw new Error(s+" and "+n+" are too far apart with stepSize of "+l+" "+a);let g=o.ticks.source==="data"&&this.getDataTimestamps();for(u=f,p=0;u<n;u=+t.add(u,l,a),p++)ja(d,u,g);return(u===n||o.bounds==="ticks"||p===1)&&ja(d,u,g),Object.keys(d).sort(Ea).map(m=>+m)}getLabelForValue(t){let s=this._adapter,n=this.options.time;return n.tooltipFormat?s.format(t,n.tooltipFormat):s.format(t,n.displayFormats.datetime)}format(t,s){let o=this.options.time.displayFormats,r=this._unit,a=s||o[r];return this._adapter.format(t,a)}_tickFormatFunction(t,s,n,o){let r=this.options,a=r.ticks.callback;if(a)return B(a,[t,s,n],this);let l=r.time.displayFormats,c=this._unit,h=this._majorUnit,d=c&&l[c],f=h&&l[h],u=n[s],p=h&&f&&u&&u.major;return this._adapter.format(t,o||(p?f:d))}generateTickLabels(t){let s,n,o;for(s=0,n=t.length;s<n;++s)o=t[s],o.label=this._tickFormatFunction(o.value,s,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let s=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((s.start+n)*s.factor)}getValueForPixel(t){let s=this._offsets,n=this.getDecimalForPixel(t)/s.factor-s.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let s=this.options.ticks,n=this.ctx.measureText(t).width,o=bt(this.isHorizontal()?s.maxRotation:s.minRotation),r=Math.cos(o),a=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:n*r+l*a,h:n*a+l*r}}_getLabelCapacity(t){let s=this.options.time,n=s.displayFormats,o=n[s.unit]||n.millisecond,r=this._tickFormatFunction(t,0,Va(this,[t],this._majorUnit),o),a=this._getLabelSize(r),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],s,n;if(t.length)return t;let o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(s=0,n=o.length;s<n;++s)t=t.concat(o[s].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],s,n;if(t.length)return t;let o=this.getLabels();for(s=0,n=o.length;s<n;++s)t.push(Ba(this,o[s]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return mn(t.sort(Ea))}}return M(e,"id","time"),M(e,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}}),e})();function Ms(e,i,t){let s=0,n=e.length-1,o,r,a,l;t?(i>=e[s].pos&&i<=e[n].pos&&({lo:s,hi:n}=Mt(e,"pos",i)),{pos:o,time:a}=e[s],{pos:r,time:l}=e[n]):(i>=e[s].time&&i<=e[n].time&&({lo:s,hi:n}=Mt(e,"time",i)),{time:o,pos:a}=e[s],{time:r,pos:l}=e[n]);let c=r-o;return c?a+(l-a)*(i-o)/c:a}var Oi=class extends ro{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=Ms(t,this.min),this._tableRange=Ms(t,this.max)-this._minPos,super.initOffsets(i)}buildLookupTable(i){let{min:t,max:s}=this,n=[],o=[],r,a,l,c,h;for(r=0,a=i.length;r<a;++r)c=i[r],c>=t&&c<=s&&n.push(c);if(n.length<2)return[{time:t,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let i=this.min,t=this.max,s=super.getDataTimestamps();return(!s.includes(i)||!s.length)&&s.splice(0,0,i),(!s.includes(t)||s.length===1)&&s.push(t),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let i=this._cache.all||[];if(i.length)return i;let t=this.getDataTimestamps(),s=this.getLabelTimestamps();return t.length&&s.length?i=this.normalize(t.concat(s)):i=t.length?t:s,i=this._cache.all=i,i}getDecimalForValue(i){return(Ms(this._table,i)-this._minPos)/this._tableRange}getValueForPixel(i){let t=this._offsets,s=this.getDecimalForPixel(i)/t.factor-t.end;return Ms(this._table,s*this._tableRange+this._minPos,!0)}};M(Oi,"id","timeseries"),M(Oi,"defaults",ro.defaults);var Dp=Object.freeze({__proto__:null,CategoryScale:cp,LinearScale:ki,LogarithmicScale:Si,RadialLinearScale:Oe,TimeScale:ro,TimeSeriesScale:Oi}),ll=[zd,du,op,Dp];var Fs=class extends Zt{getDatasets(){return this.diagram.line.map((i,t)=>{let s=this.data.map(o=>parseInt(q.getElementOrigValue(i.$data,o))),n=J.getDatasetColor(t);return{data:s,label:this.messages[i.$data],borderColor:n,backgroundColor:n,pointBackgroundColor:n}})}getLabels(){return this.data.map(i=>q.getElementOrigValue(this.diagram.$label,i))}getOptions(){return co.positioners.customLinePositioner=function(t,s){let{x:n,y:o}=s;return{x:n,y:o,yAlign:o>this.chart.chartArea.height/2?"bottom":"top"}},{responsive:!0,maintainAspectRatio:!1,scales:{x:{type:"category",bounds:"ticks",ticks:{align:"inner",padding:7,maxRotation:0,minRotation:0,font:J.getFont()},grid:{lineWidth:t=>t.index===0?1:0},afterBuildTicks:t=>{t.ticks=[0,this.data.length-1].map(s=>({value:s,label:t.getLabelForValue(s)}))},afterFit:t=>{t.paddingRight=0}},y:{bounds:"ticks",ticks:{autoSkip:!0,autoSkipPadding:30,maxRotation:0,minRotation:0,font:J.getFont()}}},elements:{point:{hoverBorderWidth:1,hoverRadius:4,hitRadius:4,radius:this.data.length===1?3:0,backgroundColor:"transparent",borderColor:"transparent",borderWidth:0},line:{backgroundColor:"transparent",fill:!1,borderWidth:2}},plugins:{tooltip:{position:"customLinePositioner"}}}}};var Es=class extends Zt{getDatasets(){return this.data.sort((i,t)=>parseFloat(q.getElementOrigValue(this.diagram.$data,i))>parseFloat(q.getElementOrigValue(this.diagram.$data,t))?1:-1),[{data:this.data.map(i=>parseFloat(q.getElementOrigValue(this.diagram.$data,i))),backgroundColor:J.datasetColorList,hoverBackgroundColor:J.datasetColorList}]}getLabels(){return this.data.map(i=>{let t=q.getElementOrigValue(this.diagram.$label,i),s=parseFloat(q.getElementOrigValue(this.diagram.$data,i));return[t,s]}).map(([i,t])=>`${i}: ${t}`)}getOptions(){return{responsive:!0,maintainAspectRatio:!1,cutout:15,scales:{x:{display:!1},y:{display:!1}},elements:{arc:{borderWidth:1,hoverBorderWidth:0}},plugins:{tooltip:{callbacks:{title:i=>i[0].label.split(": ")[0]}}}}}};var Tp=typeof global=="object"&&global&&global.Object===Object&&global,Bs=Tp;var Ap=typeof self=="object"&&self&&self.Object===Object&&self,Ip=Bs||Ap||Function("return this")(),_t=Ip;var Lp=_t.Symbol,Xe=Lp;var cl=Object.prototype,Rp=cl.hasOwnProperty,Fp=cl.toString,Li=Xe?Xe.toStringTag:void 0;function Ep(e){var i=Rp.call(e,Li),t=e[Li];try{e[Li]=void 0;var s=!0}catch{}var n=Fp.call(e);return s&&(i?e[Li]=t:delete e[Li]),n}var hl=Ep;var Bp=Object.prototype,zp=Bp.toString;function jp(e){return zp.call(e)}var dl=jp;var Vp="[object Null]",Np="[object Undefined]",fl=Xe?Xe.toStringTag:void 0;function Wp(e){return e==null?e===void 0?Np:Vp:fl&&fl in Object(e)?hl(e):dl(e)}var le=Wp;function Hp(e){return e!=null&&typeof e=="object"}var Tt=Hp;var $p=Array.isArray,Ri=$p;function Up(e){var i=typeof e;return e!=null&&(i=="object"||i=="function")}var ft=Up;function Yp(e){return e}var zs=Yp;var Xp="[object AsyncFunction]",Gp="[object Function]",Kp="[object GeneratorFunction]",qp="[object Proxy]";function Zp(e){if(!ft(e))return!1;var i=le(e);return i==Gp||i==Kp||i==Xp||i==qp}var Ge=Zp;var Jp=_t["__core-js_shared__"],js=Jp;var ul=function(){var e=/[^.]+$/.exec(js&&js.keys&&js.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Qp(e){return!!ul&&ul in e}var pl=Qp;var tg=Function.prototype,eg=tg.toString;function ig(e){if(e!=null){try{return eg.call(e)}catch{}try{return e+""}catch{}}return""}var gl=ig;var sg=/[\\^$.*+?()[\]{}|]/g,ng=/^\[object .+?Constructor\]$/,og=Function.prototype,rg=Object.prototype,ag=og.toString,lg=rg.hasOwnProperty,cg=RegExp("^"+ag.call(lg).replace(sg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hg(e){if(!ft(e)||pl(e))return!1;var i=Ge(e)?cg:ng;return i.test(gl(e))}var ml=hg;function dg(e,i){return e?.[i]}var xl=dg;function fg(e,i){var t=xl(e,i);return ml(t)?t:void 0}var Ke=fg;var bl=Object.create,ug=function(){function e(){}return function(i){if(!ft(i))return{};if(bl)return bl(i);e.prototype=i;var t=new e;return e.prototype=void 0,t}}(),_l=ug;function pg(e,i,t){switch(t.length){case 0:return e.call(i);case 1:return e.call(i,t[0]);case 2:return e.call(i,t[0],t[1]);case 3:return e.call(i,t[0],t[1],t[2])}return e.apply(i,t)}var yl=pg;function gg(e,i){var t=-1,s=e.length;for(i||(i=Array(s));++t<s;)i[t]=e[t];return i}var vl=gg;var mg=800,xg=16,bg=Date.now;function _g(e){var i=0,t=0;return function(){var s=bg(),n=xg-(s-t);if(t=s,n>0){if(++i>=mg)return arguments[0]}else i=0;return e.apply(void 0,arguments)}}var Cl=_g;function yg(e){return function(){return e}}var wl=yg;var vg=function(){try{var e=Ke(Object,"defineProperty");return e({},"",{}),e}catch{}}(),qe=vg;var Cg=qe?function(e,i){return qe(e,"toString",{configurable:!0,enumerable:!1,value:wl(i),writable:!0})}:zs,Ml=Cg;var wg=Cl(Ml),kl=wg;var Mg=9007199254740991,kg=/^(?:0|[1-9]\d*)$/;function Sg(e,i){var t=typeof e;return i=i??Mg,!!i&&(t=="number"||t!="symbol"&&kg.test(e))&&e>-1&&e%1==0&&e<i}var Vs=Sg;function Og(e,i,t){i=="__proto__"&&qe?qe(e,i,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[i]=t}var Ze=Og;function Pg(e,i){return e===i||e!==e&&i!==i}var ce=Pg;var Dg=Object.prototype,Tg=Dg.hasOwnProperty;function Ag(e,i,t){var s=e[i];(!(Tg.call(e,i)&&ce(s,t))||t===void 0&&!(i in e))&&Ze(e,i,t)}var Sl=Ag;function Ig(e,i,t,s){var n=!t;t||(t={});for(var o=-1,r=i.length;++o<r;){var a=i[o],l=s?s(t[a],e[a],a,t,e):void 0;l===void 0&&(l=e[a]),n?Ze(t,a,l):Sl(t,a,l)}return t}var Ol=Ig;var Pl=Math.max;function Lg(e,i,t){return i=Pl(i===void 0?e.length-1:i,0),function(){for(var s=arguments,n=-1,o=Pl(s.length-i,0),r=Array(o);++n<o;)r[n]=s[i+n];n=-1;for(var a=Array(i+1);++n<i;)a[n]=s[n];return a[i]=t(r),yl(e,this,a)}}var Dl=Lg;function Rg(e,i){return kl(Dl(e,i,zs),e+"")}var Tl=Rg;var Fg=9007199254740991;function Eg(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Fg}var Ns=Eg;function Bg(e){return e!=null&&Ns(e.length)&&!Ge(e)}var Je=Bg;function zg(e,i,t){if(!ft(t))return!1;var s=typeof i;return(s=="number"?Je(t)&&Vs(i,t.length):s=="string"&&i in t)?ce(t[i],e):!1}var Al=zg;function jg(e){return Tl(function(i,t){var s=-1,n=t.length,o=n>1?t[n-1]:void 0,r=n>2?t[2]:void 0;for(o=e.length>3&&typeof o=="function"?(n--,o):void 0,r&&Al(t[0],t[1],r)&&(o=n<3?void 0:o,n=1),i=Object(i);++s<n;){var a=t[s];a&&e(i,a,s,o)}return i})}var Il=jg;var Vg=Object.prototype;function Ng(e){var i=e&&e.constructor,t=typeof i=="function"&&i.prototype||Vg;return e===t}var Ws=Ng;function Wg(e,i){for(var t=-1,s=Array(e);++t<e;)s[t]=i(t);return s}var Ll=Wg;var Hg="[object Arguments]";function $g(e){return Tt(e)&&le(e)==Hg}var ho=$g;var Rl=Object.prototype,Ug=Rl.hasOwnProperty,Yg=Rl.propertyIsEnumerable,Xg=ho(function(){return arguments}())?ho:function(e){return Tt(e)&&Ug.call(e,"callee")&&!Yg.call(e,"callee")},Fi=Xg;function Gg(){return!1}var Fl=Gg;var zl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,El=zl&&typeof module=="object"&&module&&!module.nodeType&&module,Kg=El&&El.exports===zl,Bl=Kg?_t.Buffer:void 0,qg=Bl?Bl.isBuffer:void 0,Zg=qg||Fl,Hs=Zg;var Jg="[object Arguments]",Qg="[object Array]",tm="[object Boolean]",em="[object Date]",im="[object Error]",sm="[object Function]",nm="[object Map]",om="[object Number]",rm="[object Object]",am="[object RegExp]",lm="[object Set]",cm="[object String]",hm="[object WeakMap]",dm="[object ArrayBuffer]",fm="[object DataView]",um="[object Float32Array]",pm="[object Float64Array]",gm="[object Int8Array]",mm="[object Int16Array]",xm="[object Int32Array]",bm="[object Uint8Array]",_m="[object Uint8ClampedArray]",ym="[object Uint16Array]",vm="[object Uint32Array]",W={};W[um]=W[pm]=W[gm]=W[mm]=W[xm]=W[bm]=W[_m]=W[ym]=W[vm]=!0;W[Jg]=W[Qg]=W[dm]=W[tm]=W[fm]=W[em]=W[im]=W[sm]=W[nm]=W[om]=W[rm]=W[am]=W[lm]=W[cm]=W[hm]=!1;function Cm(e){return Tt(e)&&Ns(e.length)&&!!W[le(e)]}var jl=Cm;function wm(e){return function(i){return e(i)}}var Vl=wm;var Nl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ei=Nl&&typeof module=="object"&&module&&!module.nodeType&&module,Mm=Ei&&Ei.exports===Nl,fo=Mm&&Bs.process,km=function(){try{var e=Ei&&Ei.require&&Ei.require("util").types;return e||fo&&fo.binding&&fo.binding("util")}catch{}}(),uo=km;var Wl=uo&&uo.isTypedArray,Sm=Wl?Vl(Wl):jl,$s=Sm;var Om=Object.prototype,Pm=Om.hasOwnProperty;function Dm(e,i){var t=Ri(e),s=!t&&Fi(e),n=!t&&!s&&Hs(e),o=!t&&!s&&!n&&$s(e),r=t||s||n||o,a=r?Ll(e.length,String):[],l=a.length;for(var c in e)(i||Pm.call(e,c))&&!(r&&(c=="length"||n&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Vs(c,l)))&&a.push(c);return a}var Hl=Dm;function Tm(e,i){return function(t){return e(i(t))}}var $l=Tm;function Am(e){var i=[];if(e!=null)for(var t in Object(e))i.push(t);return i}var Ul=Am;var Im=Object.prototype,Lm=Im.hasOwnProperty;function Rm(e){if(!ft(e))return Ul(e);var i=Ws(e),t=[];for(var s in e)s=="constructor"&&(i||!Lm.call(e,s))||t.push(s);return t}var Yl=Rm;function Fm(e){return Je(e)?Hl(e,!0):Yl(e)}var Us=Fm;var Em=Ke(Object,"create"),jt=Em;function Bm(){this.__data__=jt?jt(null):{},this.size=0}var Xl=Bm;function zm(e){var i=this.has(e)&&delete this.__data__[e];return this.size-=i?1:0,i}var Gl=zm;var jm="__lodash_hash_undefined__",Vm=Object.prototype,Nm=Vm.hasOwnProperty;function Wm(e){var i=this.__data__;if(jt){var t=i[e];return t===jm?void 0:t}return Nm.call(i,e)?i[e]:void 0}var Kl=Wm;var Hm=Object.prototype,$m=Hm.hasOwnProperty;function Um(e){var i=this.__data__;return jt?i[e]!==void 0:$m.call(i,e)}var ql=Um;var Ym="__lodash_hash_undefined__";function Xm(e,i){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=jt&&i===void 0?Ym:i,this}var Zl=Xm;function Qe(e){var i=-1,t=e==null?0:e.length;for(this.clear();++i<t;){var s=e[i];this.set(s[0],s[1])}}Qe.prototype.clear=Xl;Qe.prototype.delete=Gl;Qe.prototype.get=Kl;Qe.prototype.has=ql;Qe.prototype.set=Zl;var po=Qe;function Gm(){this.__data__=[],this.size=0}var Jl=Gm;function Km(e,i){for(var t=e.length;t--;)if(ce(e[t][0],i))return t;return-1}var he=Km;var qm=Array.prototype,Zm=qm.splice;function Jm(e){var i=this.__data__,t=he(i,e);if(t<0)return!1;var s=i.length-1;return t==s?i.pop():Zm.call(i,t,1),--this.size,!0}var Ql=Jm;function Qm(e){var i=this.__data__,t=he(i,e);return t<0?void 0:i[t][1]}var tc=Qm;function tx(e){return he(this.__data__,e)>-1}var ec=tx;function ex(e,i){var t=this.__data__,s=he(t,e);return s<0?(++this.size,t.push([e,i])):t[s][1]=i,this}var ic=ex;function ti(e){var i=-1,t=e==null?0:e.length;for(this.clear();++i<t;){var s=e[i];this.set(s[0],s[1])}}ti.prototype.clear=Jl;ti.prototype.delete=Ql;ti.prototype.get=tc;ti.prototype.has=ec;ti.prototype.set=ic;var de=ti;var ix=Ke(_t,"Map"),Ys=ix;function sx(){this.size=0,this.__data__={hash:new po,map:new(Ys||de),string:new po}}var sc=sx;function nx(e){var i=typeof e;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?e!=="__proto__":e===null}var nc=nx;function ox(e,i){var t=e.__data__;return nc(i)?t[typeof i=="string"?"string":"hash"]:t.map}var fe=ox;function rx(e){var i=fe(this,e).delete(e);return this.size-=i?1:0,i}var oc=rx;function ax(e){return fe(this,e).get(e)}var rc=ax;function lx(e){return fe(this,e).has(e)}var ac=lx;function cx(e,i){var t=fe(this,e),s=t.size;return t.set(e,i),this.size+=t.size==s?0:1,this}var lc=cx;function ei(e){var i=-1,t=e==null?0:e.length;for(this.clear();++i<t;){var s=e[i];this.set(s[0],s[1])}}ei.prototype.clear=sc;ei.prototype.delete=oc;ei.prototype.get=rc;ei.prototype.has=ac;ei.prototype.set=lc;var cc=ei;var hx=$l(Object.getPrototypeOf,Object),Xs=hx;var dx="[object Object]",fx=Function.prototype,ux=Object.prototype,hc=fx.toString,px=ux.hasOwnProperty,gx=hc.call(Object);function mx(e){if(!Tt(e)||le(e)!=dx)return!1;var i=Xs(e);if(i===null)return!0;var t=px.call(i,"constructor")&&i.constructor;return typeof t=="function"&&t instanceof t&&hc.call(t)==gx}var dc=mx;function xx(){this.__data__=new de,this.size=0}var fc=xx;function bx(e){var i=this.__data__,t=i.delete(e);return this.size=i.size,t}var uc=bx;function _x(e){return this.__data__.get(e)}var pc=_x;function yx(e){return this.__data__.has(e)}var gc=yx;var vx=200;function Cx(e,i){var t=this.__data__;if(t instanceof de){var s=t.__data__;if(!Ys||s.length<vx-1)return s.push([e,i]),this.size=++t.size,this;t=this.__data__=new cc(s)}return t.set(e,i),this.size=t.size,this}var mc=Cx;function ii(e){var i=this.__data__=new de(e);this.size=i.size}ii.prototype.clear=fc;ii.prototype.delete=uc;ii.prototype.get=pc;ii.prototype.has=gc;ii.prototype.set=mc;var xc=ii;var vc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bc=vc&&typeof module=="object"&&module&&!module.nodeType&&module,wx=bc&&bc.exports===vc,_c=wx?_t.Buffer:void 0,yc=_c?_c.allocUnsafe:void 0;function Mx(e,i){if(i)return e.slice();var t=e.length,s=yc?yc(t):new e.constructor(t);return e.copy(s),s}var Cc=Mx;var kx=_t.Uint8Array,go=kx;function Sx(e){var i=new e.constructor(e.byteLength);return new go(i).set(new go(e)),i}var wc=Sx;function Ox(e,i){var t=i?wc(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Mc=Ox;function Px(e){return typeof e.constructor=="function"&&!Ws(e)?_l(Xs(e)):{}}var kc=Px;function Dx(e){return function(i,t,s){for(var n=-1,o=Object(i),r=s(i),a=r.length;a--;){var l=r[e?a:++n];if(t(o[l],l,o)===!1)break}return i}}var Sc=Dx;var Tx=Sc(),Oc=Tx;function Ax(e,i,t){(t!==void 0&&!ce(e[i],t)||t===void 0&&!(i in e))&&Ze(e,i,t)}var Bi=Ax;function Ix(e){return Tt(e)&&Je(e)}var Pc=Ix;function Lx(e,i){if(!(i==="constructor"&&typeof e[i]=="function")&&i!="__proto__")return e[i]}var zi=Lx;function Rx(e){return Ol(e,Us(e))}var Dc=Rx;function Fx(e,i,t,s,n,o,r){var a=zi(e,t),l=zi(i,t),c=r.get(l);if(c){Bi(e,t,c);return}var h=o?o(a,l,t+"",e,i,r):void 0,d=h===void 0;if(d){var f=Ri(l),u=!f&&Hs(l),p=!f&&!u&&$s(l);h=l,f||u||p?Ri(a)?h=a:Pc(a)?h=vl(a):u?(d=!1,h=Cc(l,!0)):p?(d=!1,h=Mc(l,!0)):h=[]:dc(l)||Fi(l)?(h=a,Fi(a)?h=Dc(a):(!ft(a)||Ge(a))&&(h=kc(l))):d=!1}d&&(r.set(l,h),n(h,l,s,o,r),r.delete(l)),Bi(e,t,h)}var Tc=Fx;function Ac(e,i,t,s,n){e!==i&&Oc(i,function(o,r){if(n||(n=new xc),ft(o))Tc(e,i,r,t,Ac,s,n);else{var a=s?s(zi(e,r),o,r+"",e,i,n):void 0;a===void 0&&(a=o),Bi(e,r,a)}},Us)}var Ic=Ac;var Ex=Il(function(e,i,t){Ic(e,i,t)}),Gs=Ex;var xo=(()=>{let i=class i{constructor(){this.colorschemesOptions=new at(void 0)}setColorschemesOptions(s){this.pColorschemesOptions=s,this.colorschemesOptions.next(s)}getColorschemesOptions(){return this.pColorschemesOptions}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=oi({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),Rc=(()=>{let i=class i{constructor(s,n,o){this.zone=n,this.themeService=o,this.type="bar",this.plugins=[],this.chartClick=new ai,this.chartHover=new ai,this.subs=[],this.themeOverrides={},this.ctx=s.nativeElement.getContext("2d"),this.subs.push(this.themeService.colorschemesOptions.pipe(yo()).subscribe(r=>this.themeChanged(r)))}ngOnChanges(s){let n=["type"],o=Object.getOwnPropertyNames(s);if(o.some(r=>n.includes(r))||o.every(r=>s[r].isFirstChange()))this.render();else{let r=this.getChartConfiguration();this.chart&&(Object.assign(this.chart.config.data,r.data),this.chart.config.plugins&&Object.assign(this.chart.config.plugins,r.plugins),this.chart.config.options&&Object.assign(this.chart.config.options,r.options)),this.update()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(s=>s.unsubscribe())}render(){return this.chart&&this.chart.destroy(),this.zone.runOutsideAngular(()=>this.chart=new Ii(this.ctx,this.getChartConfiguration()))}update(s){this.chart&&this.zone.runOutsideAngular(()=>this.chart?.update(s))}hideDataset(s,n){this.chart&&(this.chart.getDatasetMeta(s).hidden=n,this.update())}isDatasetHidden(s){return this.chart?.getDatasetMeta(s)?.hidden}toBase64Image(){return this.chart?.toBase64Image()}themeChanged(s){this.themeOverrides=s,this.chart&&(this.chart.config.options&&Object.assign(this.chart.config.options,this.getChartOptions()),this.update())}getChartOptions(){return Gs({onHover:(s,n)=>{!this.chartHover.observed&&!this.chartHover.observers?.length||this.zone.run(()=>this.chartHover.emit({event:s,active:n}))},onClick:(s,n)=>{!this.chartClick.observed&&!this.chartClick.observers?.length||this.zone.run(()=>this.chartClick.emit({event:s,active:n}))}},this.themeOverrides,this.options,{plugins:{legend:{display:this.legend}}})}getChartConfiguration(){return{type:this.type,data:this.getChartData(),options:this.getChartOptions(),plugins:this.plugins}}getChartData(){return this.data?this.data:{labels:this.labels||[],datasets:this.datasets||[]}}};i.\u0275fac=function(n){return new(n||i)(Xt(ko),Xt(Mo),Xt(xo))},i.\u0275dir=wo({type:i,selectors:[["canvas","baseChart",""]],inputs:{type:"type",legend:"legend",data:"data",options:"options",plugins:"plugins",labels:"labels",datasets:"datasets"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[Wi]});let e=i;return e})(),Bx=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]],zx={plugins:{colors:{enabled:!1}},datasets:{line:{backgroundColor:e=>ue(pe(e.datasetIndex),.4),borderColor:e=>ue(pe(e.datasetIndex),1),pointBackgroundColor:e=>ue(pe(e.datasetIndex),1),pointBorderColor:"#fff"},bar:{backgroundColor:e=>ue(pe(e.datasetIndex),.6),borderColor:e=>ue(pe(e.datasetIndex),1)},get radar(){return this.line},doughnut:{backgroundColor:e=>ue(pe(e.dataIndex),.6),borderColor:"#fff"},get pie(){return this.doughnut},polarArea:{backgroundColor:e=>ue(pe(e.dataIndex),.6),borderColor:e=>ue(pe(e.dataIndex),1)},get bubble(){return this.doughnut},get scatter(){return this.doughnut},get area(){return this.polarArea}}};function ue(e,i){return"rgba("+e.concat(i).join(",")+")"}function mo(e,i){return Math.floor(Math.random()*(i-e+1))+e}function jx(){return[mo(0,255),mo(0,255),mo(0,255)]}function pe(e=0){return Bx[e]||jx()}var Lc=(()=>{let i=class i{constructor(){this.generateColors=!0}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=oi({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();Ii.register(...ll);var Fc=(()=>{let i=class i{constructor(s){s?.plugins&&Ii.register(...s.plugins);let n=Gs(s?.generateColors?zx:{},s?.defaults||{});z.set(n)}static forRoot(s){return{ngModule:i,providers:[{provide:Lc,useValue:s}]}}};i.\u0275fac=function(n){return new(n||i)(ri(Lc,8))},i.\u0275mod=$t({type:i}),i.\u0275inj=Wt({});let e=i;return e})();var Ks=(()=>{let i=class i{constructor(s,n){this.themeService=s,this.colorSchemeService=n,this.typeSubject=new at(null),this.type$=this.typeSubject.asObservable(),this.labelSubject=new at([]),this.label$=this.labelSubject.asObservable(),this.optionsSubject=new at(null),this.options$=this.optionsSubject.asObservable(),this.datasetsSubject=new at(null),this.datasets$=this.datasetsSubject.asObservable(),this.colorSchemeService.actualColorScheme$.pipe(Ni(this.colorSchemeService.colorSchemeChangeDelay),jo()).subscribe(()=>{this.themeService.setColorschemesOptions(this.getColorOverrides())})}init(s,n,o){let r=!!this.diagram;this.messages=o,this.diagram=s,!(!s||!n||!o)&&(this.data=Array.isArray(n)?n:[n],this.diagram.$type==="line"&&this.data.length===1&&(this.data=[]),this.updateChartType(),this.updateChartConfig(r))}updateChartType(){let s=this.diagram.$type;s==="histogram"&&(s="bar"),this.typeSubject.next(s)}updateChartConfig(s=!1){let n=this.getChartConfig();if(!n)return;let o=Eo(n.getOptions(),{plugins:{tooltip:this.getTooltipConfig()}});s&&(o.animation=!1),this.datasetsSubject.next(n.getDatasets()),this.labelSubject.next(n.getLabels()),this.optionsSubject.next(o)}getChartConfig(){let{diagram:s,data:n,messages:o}=this,r={diagram:s,data:n,messages:o};switch(this.typeSubject.value){case"line":return new Fs(r);case"bar":return new qi(r);case"doughnut":case"pie":return new Es(r);default:return null}}getTooltipConfig(){return{usePointStyle:!0,padding:{x:10,y:7},titleFont:J.getFont(),bodyFont:J.getFont(),borderWidth:1,boxPadding:5,callbacks:{labelColor:s=>{let n=s.dataset.backgroundColor,o=s.dataIndex,r=Array.isArray(n)?n[o%n.length]:n;return{borderColor:r,borderWidth:2,backgroundColor:r}},labelTextColor:s=>J.getCssVarColor("--isp-dc-highway-star")}}}getColorOverrides(){let s=J.getFontColor(),n=J.getBackgroundColor(),o=J.getGridColor(),r=J.getBorderColor();return{scales:{x:{grid:{color:o},ticks:{color:s}},y:{grid:{color:o},ticks:{color:s}}},elements:{arc:{borderColor:n},bar:{borderColor:r}},plugins:{legend:{labels:{color:s}},tooltip:{titleColor:s,bodyColor:s,footerColor:s,backgroundColor:n,borderColor:r}}}}};i.\u0275fac=function(n){return new(n||i)(ri(xo),ri(zo))},i.\u0275prov=oi({token:i,factory:i.\u0275fac});let e=i;return e})();var Nx={bar:{rows:2,columns:4},line:{rows:2,columns:4},pie:{rows:10,columns:2},doughnut:{rows:10,columns:2}},Bc=new vo("isp.chart-legend.grid-config",{factory:()=>Nx});function Wx(e,i){if(e&1){let t=Gt();Hi(0),$(1,"button",4),Kt("click",function(){let n=Ut(t).index,o=K();return Yt(o.toggleDataVisibility(n))}),mt(2,"isp-visual-checkbox",5),$(3,"span",6),Ct(4),U()(),$i()}if(e&2){let t=i.$implicit;L(),Zs("--isp-visual-checkbox-checked-bc",t.color)("--isp-visual-checkbox-checked-hover-bc",t.color),L(),E("checked",t.enabled),L(2),Yi(t.label)}}function Hx(e,i){if(e&1){let t=Gt();$(0,"button",7),Kt("click",function(){Ut(t);let n=K();return Yt(n.toggleCollapse())}),Ct(1),nt(2,"async"),mt(3,"isp-svg-icon",8),U()}if(e&2){let t=K();L(),Do(" ",t.messages.msg_show_more," ",ot(2,2,t.collapsedCount$)," ")}}function $x(e,i){if(e&1){let t=Gt();$(0,"button",7),Kt("click",function(){Ut(t);let n=K();return Yt(n.toggleCollapse())}),Ct(1),mt(2,"isp-svg-icon",9),U()}if(e&2){let t=K();L(),be(" ",t.messages.msg_collapse," ")}}var qs=(()=>{let i=class i{get chart(){return this._chart}set chart(s){this._chart=s,this.updateLegend()}get chartType(){return this.chart.config.type}get legendLimit(){let{rows:s,columns:n}=this.defaultGridConfig[this.chartType];return s*n}get legendItems(){return this.legendItems$.value}constructor(s){this.appService=s,this.defaultGridConfig=Co(Bc),this.legendItems$=new at([]),this.gridConfig$=new at(null),this.showCollapse$=new at(!1),this.collapsed$=new at(!0),this.canCollapse$=Vi([this.showCollapse$,this.collapsed$]).pipe(At(([n,o])=>n&&!o)),this.canExpand$=Vi([this.showCollapse$,this.collapsed$]).pipe(At(([n,o])=>n&&o)),this.items$=Vi([this.legendItems$,this.collapsed$]).pipe(At(([n,o])=>o&&n.length>this.legendLimit?n.slice(0,this.legendLimit-1):n)),this.collapsedCount$=this.legendItems$.pipe(At(n=>n.length-this.legendLimit+1)),this.showMoreMsg=this.appService.getDesktopMessage("msg_show_more")}updateLegend(){let s=this.chart.legend.legendItems.map(n=>({color:n.fillStyle,label:n.text,enabled:!0}));this.legendItems$.next(s),this.showCollapse$.next(s.length>this.legendLimit),this.setDefaultGridConfig()}setDefaultGridConfig(){this.gridConfig$.next(this.defaultGridConfig[this.chartType])}toggleCollapse(){let s=!this.collapsed$.value;if(this.collapsed$.next(s),s){this.setDefaultGridConfig();return}this.setFullGridConfig()}setFullGridConfig(){let s=this.gridConfig$.value,n=this.legendItems$.value.length,o=Math.ceil(n/s.columns);this.gridConfig$.next(Nt(Vt({},s),{rows:o}))}toggleDataVisibility(s){this.toggleChartData(s),this.toggleLegendItem(s)}toggleChartData(s){["pie","doughnut"].includes(this.chartType)?this.chart.toggleDataVisibility(s):this.chart.setDatasetVisibility(s,!this.chart.isDatasetVisible(s)),this.chart.update()}toggleLegendItem(s){let n=this.legendItems$.value;n[s].enabled=!n[s].enabled,this.legendItems$.next(n)}trackByLegendItem(s,n){return n.label}};i.\u0275fac=function(n){return new(n||i)(Xt(Bo))},i.\u0275cmp=Ht({type:i,selectors:[["isp-chart-legend"]],inputs:{chart:"chart",messages:"messages"},standalone:!0,features:[Ao],decls:10,vars:18,consts:[[1,"legend"],[1,"legend__grid"],[4,"ngFor","ngForOf","ngForTrackBy"],["class","button","type","button",3,"click",4,"ngIf"],["type","button",1,"item",3,"click"],[1,"item__checkbox",3,"checked"],[1,"item__label"],["type","button",1,"button",3,"click"],["name","arrow_down_s",1,"button__icon"],["name","arrow_up_s",1,"button__icon"]],template:function(n,o){n&1&&($(0,"div",0)(1,"div",1),nt(2,"async"),nt(3,"async"),pt(4,Wx,5,6,"ng-container",2),nt(5,"async"),pt(6,Hx,4,4,"button",3),nt(7,"async"),U(),pt(8,$x,3,1,"button",3),nt(9,"async"),U()),n&2&&(L(),Zs("--isp-chart-legend_rows",ot(2,8,o.gridConfig$).rows)("--isp-chart-legend_columns",ot(3,10,o.gridConfig$).columns),L(3),E("ngForOf",ot(5,12,o.items$))("ngForTrackBy",o.trackByLegendItem),L(2),E("ngIf",ot(7,14,o.canExpand$)),L(2),E("ngIf",ot(9,16,o.canCollapse$)))},dependencies:[qt,Xi,Gi,Ae,No,Vo,Ki,Fo],styles:[".legend[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;align-items:flex-start}.legend__grid[_ngcontent-%COMP%]{display:inline-grid;grid-template-rows:repeat(var(--isp-chart-legend_rows, 2),auto);grid-template-columns:repeat(var(--isp-chart-legend_columns, 2),auto);grid-auto-rows:auto;grid-auto-columns:auto;grid-auto-flow:column;gap:10px 20px;align-items:start}.item[_ngcontent-%COMP%]{display:flex;gap:10px;padding:0;font-family:inherit;font-size:14px;color:var(--isp-dc-highway-star);background:none;border:none;cursor:pointer}.item__checkbox[_ngcontent-%COMP%]{flex-shrink:0}.item__label[_ngcontent-%COMP%]{text-align:left}.button[_ngcontent-%COMP%]{display:flex;align-items:flex-end;height:15px;padding:0;font-family:inherit;font-size:14px;background:none;border:none;cursor:pointer}.button[_ngcontent-%COMP%]:hover{--isp-icons-main-color: var(--isp-c-blue-velvet);color:var(--isp-c-blue-velvet)}.button__icon[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let e=i;return e})();var Yx=["legend"],jc=(()=>{let i=class i{constructor(s){this.chartService=s,this.type$=this.chartService.type$,this.dataset$=this.chartService.datasets$,this.label$=this.chartService.label$,this.options$=this.chartService.options$,this.classType$=this.type$.pipe(At(n=>`chart_type_${n}`))}ngOnInit(){this.chartService.init(this.meta,this.data,this.messages)}ngOnChanges(s){s.meta&&s.meta.previousValue&&(this.chartService.init(this.meta,this.data,this.messages),this.meta.$type==="line"&&setTimeout(()=>{this.legendElement.legendItems?.forEach((n,o)=>{n.enabled||this.legendElement.toggleChartData(o)})}))}};i.\u0275fac=function(n){return new(n||i)(Xt(Ks))},i.\u0275cmp=Ht({type:i,selectors:[["isp-chart"]],viewQuery:function(n,o){if(n&1&&So(Yx,7),n&2){let r;Oo(r=Po())&&(o.legendElement=r.first)}},inputs:{meta:"meta",data:"data",messages:"messages"},features:[To([Ks]),Wi],decls:12,vars:19,consts:[["baseChart","base-chart"],["legend",""],[1,"chart"],[1,"chart__container"],["baseChart","",3,"type","datasets","labels","options","legend"],[1,"chart__legend"],[3,"chart","messages"]],template:function(n,o){if(n&1&&($(0,"div",2),nt(1,"async"),$(2,"div",3),mt(3,"canvas",4,0),nt(5,"async"),nt(6,"async"),nt(7,"async"),nt(8,"async"),U(),$(9,"div",5),mt(10,"isp-chart-legend",6,1),U()()),n&2){let r=Ui(4);li(ot(1,9,o.classType$)),L(3),E("type",ot(5,11,o.type$))("datasets",ot(6,13,o.dataset$))("labels",ot(7,15,o.label$))("options",ot(8,17,o.options$))("legend",!1),L(7),E("chart",r.chart)("messages",o.messages)}},dependencies:[Rc,qs,Ae],styles:['.chart[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.chart__container[_ngcontent-%COMP%]{width:var(--isp-chart__width, calc(100% - 1px) );height:var(--isp-chart__height, 165px)}[_ngcontent-%COMP%]:is(.chart_type_pie, .chart_type_doughnut)[_ngcontent-%COMP%]{--isp-chart__width: var(--isp-chart__width_type_pie, 250px);--isp-chart__height: var(--isp-chart__height_type_pie, 250px);flex-direction:row}[_ngcontent-%COMP%]:is(.chart_type_pie, .chart_type_doughnut)[_ngcontent-%COMP%] .chart__legend[_ngcontent-%COMP%]{position:relative;margin-left:50px}[_ngcontent-%COMP%]:is(.chart_type_pie, .chart_type_doughnut)[_ngcontent-%COMP%] .chart__legend[_ngcontent-%COMP%]:before{position:absolute;top:0;bottom:0;left:-30px;content:"";width:1px;background-color:var(--isp-dc-charlie-chaplin)}'],changeDetection:0});let e=i;return e})();var Vc=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=$t({type:i}),i.\u0275inj=Wt({imports:[qt,Fc,qs]});let e=i;return e})();var Nc=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=Ht({type:i,selectors:[["isp-report-placeholder"]],inputs:{title:"title"},decls:3,vars:1,consts:[["role","heading","aria-level","3",1,"report-placeholder__title"],["type","graph-placeholder",1,"report-placeholder__image"]],template:function(n,o){n&1&&($(0,"p",0),Ct(1),U(),mt(2,"isp-illustration",1)),n&2&&(L(),be(" ",o.title,`
`))},dependencies:[$o],styles:["[_nghost-%COMP%]{position:relative;display:block;max-width:860px}.report-placeholder__title[_ngcontent-%COMP%]{position:absolute;top:50%;z-index:3;width:100%;padding-left:32px;text-align:center}.report-placeholder__image[_ngcontent-%COMP%]{display:block;width:100%}"],changeDetection:0});let e=i;return e})();var Wc=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=$t({type:i}),i.\u0275inj=Wt({imports:[qt,Xo]});let e=i;return e})();var Kx=e=>({"isp-table_no-footer":e});function qx(e,i){if(e&1&&($(0,"div"),Ct(1),U()),e&2){let t=K().ngIf;li("report-item__title report-item__title_depth_"+t.depth+" isp-h"+(t.depth+1)),L(),be(" ",t.title," ")}}function Zx(e,i){if(e&1&&mt(0,"isp-chart",8),e&2){let t=K().$implicit;E("data",t.data)("meta",t.meta)("messages",t.msg)}}function Jx(e,i){if(e&1&&(Hi(0),pt(1,Zx,1,3,"isp-chart",7),$i()),e&2){let t=i.$implicit;K();let s=Ui(4);L(),E("ngIf",t.data.length>0)("ngIfElse",s)}}function Qx(e,i){if(e&1&&mt(0,"isp-report-placeholder",9),e&2){let t=K(2);E("title",t.getMessage("msg_nodata"))}}function tb(e,i){if(e&1){let t=Gt();$(0,"th",17)(1,"isp-sort-indicator",18),Kt("sortChange",function(){let n=Ut(t).$implicit,o=K(3);return Yt(o.sort(n))}),U()()}if(e&2){let t=i.$implicit,s=K(3);L(),E("sortable",t.sorting)("sortType",t.sorting==null?null:t.sorting.sorted)("columnTitle",s.getMessage(t.name))("shrinkIcon",!1)}}function eb(e,i){if(e&1){let t=Gt();$(0,"td",21)(1,"span",22),Kt("click",function(){let n=Ut(t).$implicit,o=K(4);return Yt(o.handleCellClick(n))}),Ct(2),U()()}if(e&2){let t=i.$implicit;L(),Js("report-item__td_link",t.anchor||t.linkData),L(),Yi(t.text)}}function ib(e,i){if(e&1&&($(0,"tr",19),pt(1,eb,3,3,"td",20),U()),e&2){let t=i.$implicit;L(),E("ngForOf",t)}}function sb(e,i){if(e&1&&($(0,"span",25),Ct(1),U()),e&2){let t=K().$implicit;E("ispTooltip",t.hint),L(),be(" ",t.text," ")}}function nb(e,i){if(e&1&&($(0,"td",21),pt(1,sb,2,2,"span",24),U()),e&2){let t=i.$implicit;L(),E("ngIf",t)}}function ob(e,i){if(e&1&&($(0,"tr",23),pt(1,nb,2,1,"td",20),U()),e&2){let t=K(2).ngIf;L(),E("ngForOf",t.list.footer)}}function rb(e,i){if(e&1&&($(0,"div",10)(1,"table",11)(2,"thead",12)(3,"tr",13),pt(4,tb,2,4,"th",14),U()(),$(5,"tbody"),pt(6,ib,2,1,"tr",15)(7,ob,2,1,"tr",16),U()()()),e&2){let t=K().ngIf;L(),E("ngClass",Io(4,Kx,!t.list.footer)),L(3),E("ngForOf",t.list.cols),L(2),E("ngForOf",t.list.rows),L(),E("ngIf",t.list.footer)}}function ab(e,i){if(e&1){let t=Gt();$(0,"isp-report-item",26),Kt("linkClick",function(n){Ut(t);let o=K(2);return Yt(o.linkClick.emit(n))}),U()}if(e&2){let t=i.$implicit,s=K().ngIf,n=K();li("report-item__child report-item__child_depth_"+(s.depth+1)),E("report",t)("doc",n.doc)}}function lb(e,i){if(e&1&&($(0,"div",2),pt(1,qx,2,3,"div",3)(2,Jx,2,2,"ng-container",4)(3,Qx,1,1,"ng-template",null,0,Lo)(5,rb,8,6,"div",5)(6,ab,1,4,"isp-report-item",6),nt(7,"async"),U()),e&2){let t=i.ngIf,s=K();Js("report-item_full-width",t.isFullwidth),E("id",t.anchor||""),L(),E("ngIf",t.title),L(),E("ngForOf",t.charts)("ngForTrackBy",s.trackByStateChart),L(3),E("ngIf",t.list&&s.showLists),L(),E("ngForOf",ot(7,8,s.children$))}}var bw=(()=>{let i=class i{constructor(){this.state$=new at(null),this.children$=this.state$.pipe(_o(s=>!!s),At(s=>s.children),Ni(500)),this.showLists=!0,this.linkClick=new ai}set report(s){if(!s)return;let n=this.state$.value,o=s;n?.list&&o.list&&(o.list.show=n.list.show),this.state$.next(o)}trackByStateChart(s,n){return`${n.meta.$name}_${n.meta.$type}`}getMessage(s){return q.getMessage(s,this.doc)}handleCellClick(s){s.anchor&&document.getElementById(s.anchor).scrollIntoView({behavior:"smooth"}),s.linkData&&this.linkClick.emit(s.linkData)}sort(s){let n=this.state$.value;n.list.cols.filter(l=>l.name!==s.name&&l.sorting).forEach(l=>l.sorting.sorted="none");let o=n.list.cols.findIndex(l=>l.name===s.name),r={none:"asc",asc:"desc",desc:"asc"}[s.sorting.sorted],a=n.list.rows;s.sorting.type==="alpha"?a.sort((l,c)=>{let h=l[o].text,d=c[o].text;return h.localeCompare(d)}):a.sort((l,c)=>parseFloat(l[o].text)-parseFloat(c[o].text)),r==="desc"&&a.reverse(),s.sorting.sorted=r,this.state$.next(this.state$.value)}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=Ht({type:i,selectors:[["isp-report-item"]],inputs:{report:"report",doc:"doc",showLists:"showLists"},outputs:{linkClick:"linkClick"},decls:2,vars:3,consts:[["chartPlaceholder",""],["class","report-item",3,"id","report-item_full-width",4,"ngIf"],[1,"report-item",3,"id"],[3,"class",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],["class","report-item__table-container ispui-scrollbar_gray",4,"ngIf"],[3,"class","report","doc","linkClick",4,"ngFor","ngForOf"],["class","report-item__chart",3,"data","meta","messages",4,"ngIf","ngIfElse"],[1,"report-item__chart",3,"data","meta","messages"],[3,"title"],[1,"report-item__table-container","ispui-scrollbar_gray"],[1,"isp-table","isp-table_layout-auto","report-item__table",3,"ngClass"],[1,"isp-table__head"],[1,"isp-table__head-row"],["class","isp-table__th",4,"ngFor","ngForOf"],["class","isp-table__row",4,"ngFor","ngForOf"],["class","isp-table__row report-item__table-footer",4,"ngIf"],[1,"isp-table__th"],[3,"sortChange","sortable","sortType","columnTitle","shrinkIcon"],[1,"isp-table__row"],["class","isp-table__td",4,"ngFor","ngForOf"],[1,"isp-table__td"],["ispTooltip","","ispTooltipEllipsis","","ispTooltipViewportSelector","#layout-main-page",3,"click"],[1,"isp-table__row","report-item__table-footer"],["ispTooltipViewportSelector","#layout-main-page",3,"ispTooltip",4,"ngIf"],["ispTooltipViewportSelector","#layout-main-page",3,"ispTooltip"],[3,"linkClick","report","doc"]],template:function(n,o){n&1&&(pt(0,lb,8,10,"div",1),nt(1,"async")),n&2&&E("ngIf",ot(1,1,o.state$))},dependencies:[Ro,Xi,Gi,jc,Nc,Wo,Yo,i,Ae],styles:["[_nghost-%COMP%]{display:block}.report-item[_ngcontent-%COMP%]{max-width:860px}.report-item_full-width[_ngcontent-%COMP%]{max-width:none}.report-item__title[_ngcontent-%COMP%]{margin-bottom:25px}.report-item__title_depth_1[_ngcontent-%COMP%]{margin-bottom:20px}.report-item__title_depth_2[_ngcontent-%COMP%]{margin-bottom:15px}.report-item__title_depth_3[_ngcontent-%COMP%]{margin-bottom:10px}.report-item__child[_ngcontent-%COMP%]{margin-top:30px}.report-item__child_depth_1[_ngcontent-%COMP%]{margin-top:25px}.report-item__child_depth_2[_ngcontent-%COMP%]{margin-top:20px}.report-item__child_depth_3[_ngcontent-%COMP%]{margin-top:15px}.report-item__table-container[_ngcontent-%COMP%]{overflow-x:auto}.report-item__table[_ngcontent-%COMP%]{margin-top:20px;overflow:hidden;border-bottom:1px solid var(--isp-dc-charlie-chaplin);border-radius:5px}.report-item__collapse-button[_ngcontent-%COMP%]{margin-top:10px}.report-item__icon[_ngcontent-%COMP%]{--isp-icons-main-color: currentColor;vertical-align:middle}.report-item__chart[_ngcontent-%COMP%]{margin-top:20px}.report-item__table-footer[_ngcontent-%COMP%], .report-item__table-footer[_ngcontent-%COMP%]:hover{background:var(--isp-dc-monochrome)}.report-item__table-footer[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-weight:500;border-top:1px solid var(--isp-dc-charlie-chaplin)}.report-item__td_link[_ngcontent-%COMP%]{color:var(--isp-dc-highway-star);text-decoration:underline;cursor:pointer}.isp-table__row[_ngcontent-%COMP%]:not(:hover) .report-item__td_link[_ngcontent-%COMP%]{color:var(--isp-dc-fremen)}"],changeDetection:0});let e=i;return e})();var Pw=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=$t({type:i}),i.\u0275inj=Wt({imports:[qt,Vc,Wc,Ki,Ho,Go]});let e=i;return e})();function Hc(e){return e?Array.isArray(e)?e:[e]:[]}function $c(e,i){return{name:e.$name,cols:e.col,diagrams:e.diagram||[],isFullWidth:e.$fullwidth==="yes",showTable:e.$hidden!=="yes",elems:i.map(t=>Nt(Vt({},t),{_reports:e.band?.map(s=>$c(s,Hc(t[s.$name]?.elem)))})),childrenBands:e.band}}function Uc(e){let i=[];return e.reportdata&&e.metadata?.band.forEach(t=>{e.reportdata[t.$name]?.elem&&i.push($c(t,Hc(e.reportdata[t.$name].elem)))}),i}function cb(e,i,t){let s;switch(e){case"avg":t==="bytes"?s=i.reduce((n,o)=>n+Qs(o),0)/i.length:s=i.reduce((n,o)=>n+parseFloat(o),0)/i.length;break;case"count":s=i.length;break;case"sum":case"sumsuffix":t==="bytes"?s=i.reduce((n,o)=>n+Qs(o),0):s=i.reduce((n,o)=>n+parseFloat(o),0);break}return t==="bytes"&&["avg","sum","sumsuffix"].includes(e)?Uo(s):t==="money"?s.toLocaleString()+s.toString().slice(s.toString().indexOf(".")):s.toString()}function hb(e,i){let t=(r,a)=>{let l=a[r.$name]?.$;if(l===null)return null;let c={text:l};return r.$link&&(c.anchor=l),r.$nestedreport&&(c.linkData={func:r.$nestedreport,colname:r.$name,elid:a.$id||a[r.$name].$}),c},s=e.cols.map(r=>({name:r.$name,text:q.getMessage(r.$name,i),sorting:r.$sort?{type:r.$sort,sorted:"none"}:void 0})),n=e.elems.map(r=>e.cols.map(a=>t(a,r))),o={show:e.showTable,cols:s,rows:n};return e.cols.find(r=>r.$total)&&(o.footer=e.cols.map((r,a)=>r.$total?{text:cb(r.$total,n.map(l=>l[a].text),r.$convert),hint:q.getMessage(`hint_total_${r.$total}`,i)}:null)),o}function bo(e,i,t=0){let s={depth:t,isFullwidth:i.isFullWidth,title:q.getMessage(`table_${i.name}`,e)||void 0};if(i.diagrams?.length&&(s.charts=i.diagrams.map(n=>({data:i.elems,meta:n,msg:q.getMessageSet(e)}))),s.list=hb(i,e),i.cols.length>0&&i.elems.length){let n;i.diagrams.length?n=i.cols.find(o=>!!o.$link):n=i.cols.find(o=>o.$name in i.elems[0]),n&&i.childrenBands?s.children=i.elems.map(o=>{let r=o[n.$name].$,a={depth:t+1,isFullwidth:i.isFullWidth,title:r,children:o._reports?.map(l=>bo(e,l,t+2))};return n.$link&&(a.anchor=r),a}):s.children=i.elems[0]._reports?.map((o,r)=>({depth:t+1,isFullwidth:i.isFullWidth,title:q.getMessage(`table_${o.name}`,e)||void 0,children:i.elems.map(a=>bo(e,a._reports[r],t+2))}))}return s}function Fw(e){return Uc(e).map(i=>bo(e,i))}export{Fw as a,bw as b,Pw as c};