Files

32 lines
277 KiB
JavaScript

var Rc=Object.defineProperty;var Nc=(s,t,e)=>t in s?Rc(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var S=(s,t,e)=>Nc(s,typeof t!="symbol"?t+"":t,e);function ps(s){return s+.5|0}var Jt=(s,t,e)=>Math.max(Math.min(s,e),t);function gs(s){return Jt(ps(s*2.55),0,255)}function Kt(s){return Jt(ps(s*255),0,255)}function Wt(s){return Jt(ps(s/2.55)/100,0,1)}function ro(s){return Jt(ps(s*100),0,100)}var bt={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},kn=[..."0123456789ABCDEF"],zc=s=>kn[s&15],Vc=s=>kn[(s&240)>>4]+kn[s&15],ni=s=>(s&240)>>4===(s&15),Wc=s=>ni(s.r)&&ni(s.g)&&ni(s.b)&&ni(s.a);function Bc(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&bt[s[1]]*17,g:255&bt[s[2]]*17,b:255&bt[s[3]]*17,a:t===5?bt[s[4]]*17:255}:(t===7||t===9)&&(e={r:bt[s[1]]<<4|bt[s[2]],g:bt[s[3]]<<4|bt[s[4]],b:bt[s[5]]<<4|bt[s[6]],a:t===9?bt[s[7]]<<4|bt[s[8]]:255})),e}var Hc=(s,t)=>s<255?t(s):"";function $c(s){var t=Wc(s)?zc:Vc;return s?"#"+t(s.r)+t(s.g)+t(s.b)+Hc(s.a,t):void 0}var jc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function co(s,t,e){let i=t*Math.min(e,1-e),n=(r,o=(r+s/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function Uc(s,t,e){let i=(n,r=(n+s/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Yc(s,t,e){let i=co(s,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function Zc(s,t,e,i,n){return s===n?(t-e)/i+(t<e?6:0):t===n?(e-s)/i+2:(s-t)/i+4}function vn(s){let e=s.r/255,i=s.g/255,n=s.b/255,r=Math.max(e,i,n),o=Math.min(e,i,n),a=(r+o)/2,l,c,h;return r!==o&&(h=r-o,c=a>.5?h/(2-r-o):h/(r+o),l=Zc(e,i,n,h,r),l=l*60+.5),[l|0,c||0,a]}function Sn(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(Kt)}function Mn(s,t,e){return Sn(co,s,t,e)}function qc(s,t,e){return Sn(Yc,s,t,e)}function Gc(s,t,e){return Sn(Uc,s,t,e)}function ho(s){return(s%360+360)%360}function Xc(s){let t=jc.exec(s),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?gs(+t[5]):Kt(+t[5]));let n=ho(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=qc(n,r,o):t[1]==="hsv"?i=Gc(n,r,o):i=Mn(n,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Jc(s,t){var e=vn(s);e[0]=ho(e[0]+t),e=Mn(e),s.r=e[0],s.g=e[1],s.b=e[2]}function Kc(s){if(!s)return;let t=vn(s),e=t[0],i=ro(t[1]),n=ro(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${Wt(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}var oo={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"},ao={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 Qc(){let s={},t=Object.keys(ao),e=Object.keys(oo),i,n,r,o,a;for(i=0;i<t.length;i++){for(o=a=t[i],n=0;n<e.length;n++)r=e[n],a=a.replace(r,oo[r]);r=parseInt(ao[o],16),s[a]=[r>>16&255,r>>8&255,r&255]}return s}var ri;function th(s){ri||(ri=Qc(),ri.transparent=[0,0,0,0]);let t=ri[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var eh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function sh(s){let t=eh.exec(s),e=255,i,n,r;if(t){if(t[7]!==i){let o=+t[7];e=t[8]?gs(o):Jt(o*255,0,255)}return i=+t[1],n=+t[3],r=+t[5],i=255&(t[2]?gs(i):Jt(i,0,255)),n=255&(t[4]?gs(n):Jt(n,0,255)),r=255&(t[6]?gs(r):Jt(r,0,255)),{r:i,g:n,b:r,a:e}}}function ih(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${Wt(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}var wn=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Ne=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function nh(s,t,e){let i=Ne(Wt(s.r)),n=Ne(Wt(s.g)),r=Ne(Wt(s.b));return{r:Kt(wn(i+e*(Ne(Wt(t.r))-i))),g:Kt(wn(n+e*(Ne(Wt(t.g))-n))),b:Kt(wn(r+e*(Ne(Wt(t.b))-r))),a:s.a+e*(t.a-s.a)}}function oi(s,t,e){if(s){let i=vn(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Mn(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function uo(s,t){return s&&Object.assign(t||{},s)}function lo(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=Kt(s[3]))):(t=uo(s,{r:0,g:0,b:0,a:1}),t.a=Kt(t.a)),t}function rh(s){return s.charAt(0)==="r"?sh(s):Xc(s)}var ms=class s{constructor(t){if(t instanceof s)return t;let e=typeof t,i;e==="object"?i=lo(t):e==="string"&&(i=Bc(t)||th(t)||rh(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=uo(this._rgb);return t&&(t.a=Wt(t.a)),t}set rgb(t){this._rgb=lo(t)}rgbString(){return this._valid?ih(this._rgb):void 0}hexString(){return this._valid?$c(this._rgb):void 0}hslString(){return this._valid?Kc(this._rgb):void 0}mix(t,e){if(t){let i=this.rgb,n=t.rgb,r,o=e===r?.5:e,a=2*o-1,l=i.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*n.r+.5,i.g=255&c*i.g+r*n.g+.5,i.b=255&c*i.b+r*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=nh(this._rgb,t._rgb,e)),this}clone(){return new s(this.rgb)}alpha(t){return this._rgb.a=Kt(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=ps(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return oi(this._rgb,2,t),this}darken(t){return oi(this._rgb,2,-t),this}saturate(t){return oi(this._rgb,1,t),this}desaturate(t){return oi(this._rgb,1,-t),this}rotate(t){return Jc(this._rgb,t),this}};function Ot(){}var Cn=(()=>{let s=0;return()=>s++})();function I(s){return s==null}function B(s){if(Array.isArray&&Array.isArray(s))return!0;let t=Object.prototype.toString.call(s);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function E(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function Y(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function at(s,t){return Y(s)?s:t}function P(s,t){return typeof s>"u"?t:s}var Pn=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100:+s/t,di=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function W(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function N(s,t,e,i){let n,r,o;if(B(s))if(r=s.length,i)for(n=r-1;n>=0;n--)t.call(e,s[n],n);else for(n=0;n<r;n++)t.call(e,s[n],n);else if(E(s))for(o=Object.keys(s),r=o.length,n=0;n<r;n++)t.call(e,s[o[n]],o[n])}function We(s,t){let e,i,n,r;if(!s||!t||s.length!==t.length)return!1;for(e=0,i=s.length;e<i;++e)if(n=s[e],r=t[e],n.datasetIndex!==r.datasetIndex||n.index!==r.index)return!1;return!0}function ys(s){if(B(s))return s.map(ys);if(E(s)){let t=Object.create(null),e=Object.keys(s),i=e.length,n=0;for(;n<i;++n)t[e[n]]=ys(s[e[n]]);return t}return s}function ko(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function vo(s,t,e,i){if(!ko(s))return;let n=t[s],r=e[s];E(n)&&E(r)?me(n,r,i):t[s]=ys(r)}function me(s,t,e){let i=B(t)?t:[t],n=i.length;if(!E(s))return s;e=e||{};let r=e.merger||vo,o;for(let a=0;a<n;++a){if(o=i[a],!E(o))continue;let l=Object.keys(o);for(let c=0,h=l.length;c<h;++c)r(l[c],s,o,e)}return s}function pe(s,t){return me(s,t,{merger:So})}function So(s,t,e){if(!ko(s))return;let i=t[s],n=e[s];E(i)&&E(n)?pe(i,n):Object.prototype.hasOwnProperty.call(t,s)||(t[s]=ys(n))}var fo={"":s=>s,x:s=>s.x,y:s=>s.y};function Mo(s){let t=s.split("."),e=[],i="";for(let n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function oh(s){let t=Mo(s);return e=>{for(let i of t){if(i==="")break;e=e&&e[i]}return e}}function Lt(s,t){return(fo[t]||(fo[t]=oh(t)))(s)}function ws(s){return s.charAt(0).toUpperCase()+s.slice(1)}var be=s=>typeof s<"u",It=s=>typeof s=="function",fi=(s,t)=>{if(s.size!==t.size)return!1;for(let e of s)if(!t.has(e))return!1;return!0};function An(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}var F=Math.PI,H=2*F,To=H+F,xs=Number.POSITIVE_INFINITY,Oo=F/180,q=F/2,Qt=F/4,On=F*2/3,Et=Math.log10,yt=Math.sign;function ye(s,t,e){return Math.abs(s-t)<e}function gi(s){let t=Math.round(s);s=ye(s,t,s/1e3)?t:s;let e=Math.pow(10,Math.floor(Et(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function In(s){let t=[],e=Math.sqrt(s),i;for(i=1;i<e;i++)s%i===0&&(t.push(i),t.push(s/i));return e===(e|0)&&t.push(e),t.sort((n,r)=>n-r).pop(),t}function ah(s){return typeof s=="symbol"||typeof s=="object"&&s!==null&&!(Symbol.toPrimitive in s||"toString"in s||"valueOf"in s)}function se(s){return!ah(s)&&!isNaN(parseFloat(s))&&isFinite(s)}function En(s,t){let e=Math.round(s);return e-t<=s&&e+t>=s}function mi(s,t,e){let i,n,r;for(i=0,n=s.length;i<n;i++)r=s[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function ut(s){return s*(F/180)}function ks(s){return s*(180/F)}function pi(s){if(!Y(s))return;let t=1,e=0;for(;Math.round(s*t)/t!==s;)t*=10,e++;return e}function bi(s,t){let e=t.x-s.x,i=t.y-s.y,n=Math.sqrt(e*e+i*i),r=Math.atan2(i,e);return r<-.5*F&&(r+=H),{angle:r,distance:n}}function _s(s,t){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function Do(s,t){return(s-t+To)%H-F}function tt(s){return(s%H+H)%H}function xe(s,t,e,i){let n=tt(s),r=tt(t),o=tt(e),a=tt(r-n),l=tt(o-n),c=tt(n-r),h=tt(n-o);return n===r||n===o||i&&r===o||a>l&&c<h}function K(s,t,e){return Math.max(t,Math.min(e,s))}function Ln(s){return K(s,-32768,32767)}function Dt(s,t,e,i=1e-6){return s>=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function vs(s,t,e){e=e||(o=>s[o]<t);let i=s.length-1,n=0,r;for(;i-n>1;)r=n+i>>1,e(r)?n=r:i=r;return{lo:n,hi:i}}var Mt=(s,t,e,i)=>vs(s,e,i?n=>{let r=s[n][t];return r<e||r===e&&s[n+1][t]===e}:n=>s[n][t]<e),Fn=(s,t,e)=>vs(s,e,i=>s[i][t]>=e);function Rn(s,t,e){let i=0,n=s.length;for(;i<n&&s[i]<t;)i++;for(;n>i&&s[n-1]>e;)n--;return i>0||n<s.length?s.slice(i,n):s}var Co=["push","pop","shift","splice","unshift"];function Nn(s,t){if(s._chartjs){s._chartjs.listeners.push(t);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Co.forEach(e=>{let i="_onData"+ws(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...r){let o=n.apply(this,r);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function yi(s,t){let e=s._chartjs;if(!e)return;let i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(Co.forEach(r=>{delete s[r]}),delete s._chartjs)}function xi(s){let t=new Set(s);return t.size===s.length?s:Array.from(t)}var _i=(function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame})();function wi(s,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,_i.call(window,()=>{i=!1,s.apply(t,e)}))}}function zn(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}var Ss=s=>s==="start"?"left":s==="end"?"right":"center",et=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,Vn=(s,t,e,i)=>s===(i?"left":"right")?e:s==="center"?(t+e)/2:t;function ki(s,t,e){let i=t.length,n=0,r=i;if(s._sorted){let{iScale:o,vScale:a,_parsed:l}=s,c=s.dataset&&s.dataset.options?s.dataset.options.spanGaps:null,h=o.axis,{min:u,max:d,minDefined:f,maxDefined:g}=o.getUserBounds();if(f){if(n=Math.min(Mt(l,h,u).lo,e?i:Mt(t,h,o.getPixelForValue(u)).lo),c){let m=l.slice(0,n+1).reverse().findIndex(p=>!I(p[a.axis]));n-=Math.max(0,m)}n=K(n,0,i-1)}if(g){let m=Math.max(Mt(l,o.axis,d,!0).hi+1,e?0:Mt(t,h,o.getPixelForValue(d),!0).hi+1);if(c){let p=l.slice(m-1).findIndex(b=>!I(b[a.axis]));m+=Math.max(0,p)}r=K(m,n,i)-n}else r=i-n}return{start:n,count:r}}function vi(s){let{xScale:t,yScale:e,_scaleRanges:i}=s,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return s._scaleRanges=n,!0;let r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),r}var ai=s=>s===0||s===1,go=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*H/e)),mo=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*H/e)+1,fe={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*q)+1,easeOutSine:s=>Math.sin(s*q),easeInOutSine:s=>-.5*(Math.cos(F*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>ai(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>ai(s)?s:go(s,.075,.3),easeOutElastic:s=>ai(s)?s:mo(s,.075,.3),easeInOutElastic(s){return ai(s)?s:s<.5?.5*go(s*2,.1125,.45):.5+.5*mo(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-fe.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?fe.easeInBounce(s*2)*.5:fe.easeOutBounce(s*2-1)*.5+.5};function Si(s){if(s&&typeof s=="object"){let t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Be(s){return Si(s)?s:new ms(s)}function hi(s){return Si(s)?s:new ms(s).saturate(.5).darken(.1).hexString()}var lh=["x","y","borderWidth","radius","tension"],ch=["color","borderColor","backgroundColor"];function hh(s){s.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),s.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),s.set("animations",{colors:{type:"color",properties:ch},numbers:{type:"number",properties:lh}}),s.describe("animations",{_fallback:"animation"}),s.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function uh(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var po=new Map;function dh(s,t){t=t||{};let e=s+JSON.stringify(t),i=po.get(e);return i||(i=new Intl.NumberFormat(s,t),po.set(e,i)),i}function _e(s,t,e){return dh(t,e).format(s)}var Po={values(s){return B(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";let i=this.chart.options.locale,n,r=s;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),r=fh(s,e)}let o=Et(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),_e(s,i,l)},logarithmic(s,t,e){if(s===0)return"0";let i=e[t].significand||s/Math.pow(10,Math.floor(Et(s)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Po.numeric.call(this,s,t,e):""}};function fh(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var Ms={formatters:Po};function gh(s){s.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ms.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.route("scale.ticks","color","","color"),s.route("scale.grid","color","","borderColor"),s.route("scale.border","color","","borderColor"),s.route("scale.title","color","","color"),s.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),s.describe("scales",{_fallback:"scale"}),s.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}var ie=Object.create(null),Mi=Object.create(null);function bs(s,t){if(!t)return s;let e=t.split(".");for(let i=0,n=e.length;i<n;++i){let r=e[i];s=s[r]||(s[r]=Object.create(null))}return s}function Tn(s,t,e){return typeof t=="string"?me(bs(s,t),e):me(bs(s,""),t)}var Dn=class{constructor(t,e){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=i=>i.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=(i,n)=>hi(n.backgroundColor),this.hoverBorderColor=(i,n)=>hi(n.borderColor),this.hoverColor=(i,n)=>hi(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Tn(this,t,e)}get(t){return bs(this,t)}describe(t,e){return Tn(Mi,t,e)}override(t,e){return Tn(ie,t,e)}route(t,e,i,n){let r=bs(this,t),o=bs(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[a],c=o[n];return E(l)?Object.assign({},c,l):P(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}},j=new Dn({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[hh,uh,gh]);function Ao(s){return!s||I(s.size)||I(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function ze(s,t,e,i,n){let r=t[n];return r||(r=t[n]=s.measureText(n).width,e.push(n)),r>i&&(i=r),i}function Wn(s,t,e,i){i=i||{};let n=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(n=i.data={},r=i.garbageCollect=[],i.font=t),s.save(),s.font=t;let o=0,a=e.length,l,c,h,u,d;for(l=0;l<a;l++)if(u=e[l],u!=null&&!B(u))o=ze(s,n,r,o,u);else if(B(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!B(d)&&(o=ze(s,n,r,o,d));s.restore();let f=r.length/2;if(f>e.length){for(l=0;l<f;l++)delete n[r[l]];r.splice(0,f)}return o}function Ht(s,t,e){let i=s.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*i)/i+n}function Ti(s,t){!t&&!s||(t=t||s.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,s.width,s.height),t.restore())}function Ts(s,t,e,i){Oi(s,t,e,i,null)}function Oi(s,t,e,i,n){let r,o,a,l,c,h,u,d,f=t.pointStyle,g=t.rotation,m=t.radius,p=(g||0)*Oo;if(f&&typeof f=="object"&&(r=f.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){s.save(),s.translate(e,i),s.rotate(p),s.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),s.restore();return}if(!(isNaN(m)||m<=0)){switch(s.beginPath(),f){default:n?s.ellipse(e,i,n/2,m,0,0,H):s.arc(e,i,m,0,H),s.closePath();break;case"triangle":h=n?n/2:m,s.moveTo(e+Math.sin(p)*h,i-Math.cos(p)*m),p+=On,s.lineTo(e+Math.sin(p)*h,i-Math.cos(p)*m),p+=On,s.lineTo(e+Math.sin(p)*h,i-Math.cos(p)*m),s.closePath();break;case"rectRounded":c=m*.516,l=m-c,o=Math.cos(p+Qt)*l,u=Math.cos(p+Qt)*(n?n/2-c:l),a=Math.sin(p+Qt)*l,d=Math.sin(p+Qt)*(n?n/2-c:l),s.arc(e-u,i-a,c,p-F,p-q),s.arc(e+d,i-o,c,p-q,p),s.arc(e+u,i+a,c,p,p+q),s.arc(e-d,i+o,c,p+q,p+F),s.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,h=n?n/2:l,s.rect(e-h,i-l,2*h,2*l);break}p+=Qt;case"rectRot":u=Math.cos(p)*(n?n/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),s.moveTo(e-u,i-a),s.lineTo(e+d,i-o),s.lineTo(e+u,i+a),s.lineTo(e-d,i+o),s.closePath();break;case"crossRot":p+=Qt;case"cross":u=Math.cos(p)*(n?n/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),s.moveTo(e-u,i-a),s.lineTo(e+u,i+a),s.moveTo(e+d,i-o),s.lineTo(e-d,i+o);break;case"star":u=Math.cos(p)*(n?n/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),s.moveTo(e-u,i-a),s.lineTo(e+u,i+a),s.moveTo(e+d,i-o),s.lineTo(e-d,i+o),p+=Qt,u=Math.cos(p)*(n?n/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),s.moveTo(e-u,i-a),s.lineTo(e+u,i+a),s.moveTo(e+d,i-o),s.lineTo(e-d,i+o);break;case"line":o=n?n/2:Math.cos(p)*m,a=Math.sin(p)*m,s.moveTo(e-o,i-a),s.lineTo(e+o,i+a);break;case"dash":s.moveTo(e,i),s.lineTo(e+Math.cos(p)*(n?n/2:m),i+Math.sin(p)*m);break;case!1:s.closePath();break}s.fill(),t.borderWidth>0&&s.stroke()}}function Tt(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.x<t.right+e&&s.y>t.top-e&&s.y<t.bottom+e}function He(s,t){s.save(),s.beginPath(),s.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),s.clip()}function $e(s){s.restore()}function Bn(s,t,e,i,n){if(!t)return s.lineTo(e.x,e.y);if(n==="middle"){let r=(t.x+e.x)/2;s.lineTo(r,t.y),s.lineTo(r,e.y)}else n==="after"!=!!i?s.lineTo(t.x,e.y):s.lineTo(e.x,t.y);s.lineTo(e.x,e.y)}function Hn(s,t,e,i){if(!t)return s.lineTo(e.x,e.y);s.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function mh(s,t){t.translation&&s.translate(t.translation[0],t.translation[1]),I(t.rotation)||s.rotate(t.rotation),t.color&&(s.fillStyle=t.color),t.textAlign&&(s.textAlign=t.textAlign),t.textBaseline&&(s.textBaseline=t.textBaseline)}function ph(s,t,e,i,n){if(n.strikethrough||n.underline){let r=s.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;s.strokeStyle=s.fillStyle,s.beginPath(),s.lineWidth=n.decorationWidth||2,s.moveTo(o,h),s.lineTo(a,h),s.stroke()}}function bh(s,t){let e=s.fillStyle;s.fillStyle=t.color,s.fillRect(t.left,t.top,t.width,t.height),s.fillStyle=e}function $t(s,t,e,i,n,r={}){let o=B(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="",l,c;for(s.save(),s.font=n.string,mh(s,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&bh(s,r.backdrop),a&&(r.strokeColor&&(s.strokeStyle=r.strokeColor),I(r.strokeWidth)||(s.lineWidth=r.strokeWidth),s.strokeText(c,e,i,r.maxWidth)),s.fillText(c,e,i,r.maxWidth),ph(s,e,i,c,r),i+=Number(n.lineHeight);s.restore()}function we(s,t){let{x:e,y:i,w:n,h:r,radius:o}=t;s.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*F,F,!0),s.lineTo(e,i+r-o.bottomLeft),s.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,F,q,!0),s.lineTo(e+n-o.bottomRight,i+r),s.arc(e+n-o.bottomRight,i+r-o.bottomRight,o.bottomRight,q,0,!0),s.lineTo(e+n,i+o.topRight),s.arc(e+n-o.topRight,i+o.topRight,o.topRight,0,-q,!0),s.lineTo(e+o.topLeft,i)}var yh=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,xh=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Io(s,t){let e=(""+s).match(yh);if(!e||e[1]==="normal")return t*1.2;switch(s=+e[2],e[3]){case"px":return s;case"%":s/=100;break}return t*s}var _h=s=>+s||0;function Os(s,t){let e={},i=E(t),n=i?Object.keys(t):t,r=E(s)?i?o=>P(s[o],s[t[o]]):o=>s[o]:()=>s;for(let o of n)e[o]=_h(r(o));return e}function Di(s){return Os(s,{top:"y",right:"x",bottom:"y",left:"x"})}function jt(s){return Os(s,["topLeft","topRight","bottomLeft","bottomRight"])}function st(s){let t=Di(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function X(s,t){s=s||{},t=t||j.font;let e=P(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=P(s.style,t.style);i&&!(""+i).match(xh)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let n={family:P(s.family,t.family),lineHeight:Io(P(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:P(s.weight,t.weight),string:""};return n.string=Ao(n),n}function ke(s,t,e,i){let n=!0,r,o,a;for(r=0,o=s.length;r<o;++r)if(a=s[r],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),n=!1),e!==void 0&&B(a)&&(a=a[e%a.length],n=!1),a!==void 0))return i&&!n&&(i.cacheable=!1),a}function $n(s,t,e){let{min:i,max:n}=s,r=di(t,(n-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(n,r)}}function Ft(s,t){return Object.assign(Object.create(s),t)}function Ds(s,t=[""],e,i,n=()=>s[0]){let r=e||s;typeof i>"u"&&(i=Fo("_fallback",s));let o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:r,_fallback:i,_getTarget:n,override:a=>Ds([a,...s],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete s[0][l],!0},get(a,l){return Eo(a,l,()=>Dh(l,t,s,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(a,l){return yo(a).includes(l)},ownKeys(a){return yo(a)},set(a,l,c){let h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function ee(s,t,e,i){let n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ci(s,i),setContext:r=>ee(s,r,e,i),override:r=>ee(s.override(r),t,e,i)};return new Proxy(n,{deleteProperty(r,o){return delete r[o],delete s[o],!0},get(r,o,a){return Eo(r,o,()=>kh(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(s,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,o)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(r,o){return Reflect.has(s,o)},ownKeys(){return Reflect.ownKeys(s)},set(r,o,a){return s[o]=a,delete r[o],!0}})}function Ci(s,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:It(e)?e:()=>e,isIndexable:It(i)?i:()=>i}}var wh=(s,t)=>s?s+ws(t):t,jn=(s,t)=>E(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Eo(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t)||t==="constructor")return s[t];let i=e();return s[t]=i,i}function kh(s,t,e){let{_proxy:i,_context:n,_subProxy:r,_descriptors:o}=s,a=i[t];return It(a)&&o.isScriptable(t)&&(a=vh(t,a,s,e)),B(a)&&a.length&&(a=Sh(t,a,s,o.isIndexable)),jn(t,a)&&(a=ee(a,n,r&&r[t],o)),a}function vh(s,t,e,i){let{_proxy:n,_context:r,_subProxy:o,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);a.add(s);let l=t(r,o||i);return a.delete(s),jn(s,l)&&(l=Un(n._scopes,n,s,l)),l}function Sh(s,t,e,i){let{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(s))return t[r.index%t.length];if(E(t[0])){let l=t,c=n._scopes.filter(h=>h!==l);t=[];for(let h of l){let u=Un(c,n,s,h);t.push(ee(u,r,o&&o[s],a))}}return t}function Lo(s,t,e){return It(s)?s(t,e):s}var Mh=(s,t)=>s===!0?t:typeof s=="string"?Lt(t,s):void 0;function Th(s,t,e,i,n){for(let r of t){let o=Mh(e,r);if(o){s.add(o);let a=Lo(o._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function Un(s,t,e,i){let n=t._rootScopes,r=Lo(t._fallback,e,i),o=[...s,...n],a=new Set;a.add(i);let l=bo(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=bo(a,o,r,l,i),l===null)?!1:Ds(Array.from(a),[""],n,r,()=>Oh(t,e,i))}function bo(s,t,e,i,n){for(;e;)e=Th(s,t,e,i,n);return e}function Oh(s,t,e){let i=s._getTarget();t in i||(i[t]={});let n=i[t];return B(n)&&E(e)?e:n||{}}function Dh(s,t,e,i){let n;for(let r of t)if(n=Fo(wh(r,s),e),typeof n<"u")return jn(s,n)?Un(e,i,s,n):n}function Fo(s,t){for(let e of t){if(!e)continue;let i=e[s];if(typeof i<"u")return i}}function yo(s){let t=s._keys;return t||(t=s._keys=Ch(s._scopes)),t}function Ch(s){let t=new Set;for(let e of s)for(let i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}function Pi(s,t,e,i){let{iScale:n}=s,{key:r="r"}=this._parsing,o=new Array(i),a,l,c,h;for(a=0,l=i;a<l;++a)c=a+e,h=t[c],o[a]={r:n.parse(Lt(h,r),c)};return o}var Ph=Number.EPSILON||1e-14,Ve=(s,t)=>t<s.length&&!s[t].skip&&s[t],Ro=s=>s==="x"?"y":"x";function No(s,t,e,i){let n=s.skip?t:s,r=t,o=e.skip?t:e,a=_s(r,n),l=_s(o,r),c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let u=i*c,d=i*h;return{previous:{x:r.x-u*(o.x-n.x),y:r.y-u*(o.y-n.y)},next:{x:r.x+d*(o.x-n.x),y:r.y+d*(o.y-n.y)}}}function Ah(s,t,e){let i=s.length,n,r,o,a,l,c=Ve(s,0);for(let h=0;h<i-1;++h)if(l=c,c=Ve(s,h+1),!(!l||!c)){if(ye(t[h],0,Ph)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],r=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[h]=n*o*t[h],e[h+1]=r*o*t[h])}}function Ih(s,t,e="x"){let i=Ro(e),n=s.length,r,o,a,l=Ve(s,0);for(let c=0;c<n;++c){if(o=a,a=l,l=Ve(s,c+1),!a)continue;let h=a[e],u=a[i];o&&(r=(h-o[e])/3,a[`cp1${e}`]=h-r,a[`cp1${i}`]=u-r*t[c]),l&&(r=(l[e]-h)/3,a[`cp2${e}`]=h+r,a[`cp2${i}`]=u+r*t[c])}}function zo(s,t="x"){let e=Ro(t),i=s.length,n=Array(i).fill(0),r=Array(i),o,a,l,c=Ve(s,0);for(o=0;o<i;++o)if(a=l,l=c,c=Ve(s,o+1),!!l){if(c){let h=c[t]-l[t];n[o]=h!==0?(c[e]-l[e])/h:0}r[o]=a?c?yt(n[o-1])!==yt(n[o])?0:(n[o-1]+n[o])/2:n[o-1]:n[o]}Ah(s,n,r),Ih(s,r,t)}function li(s,t,e){return Math.max(Math.min(s,e),t)}function Eh(s,t){let e,i,n,r,o,a=Tt(s[0],t);for(e=0,i=s.length;e<i;++e)o=r,r=a,a=e<i-1&&Tt(s[e+1],t),r&&(n=s[e],o&&(n.cp1x=li(n.cp1x,t.left,t.right),n.cp1y=li(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=li(n.cp2x,t.left,t.right),n.cp2y=li(n.cp2y,t.top,t.bottom)))}function Yn(s,t,e,i,n){let r,o,a,l;if(t.spanGaps&&(s=s.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")zo(s,n);else{let c=i?s[s.length-1]:s[0];for(r=0,o=s.length;r<o;++r)a=s[r],l=No(c,a,s[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Eh(s,e)}function Cs(){return typeof window<"u"&&typeof document<"u"}function Ps(s){let t=s.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ui(s,t,e){let i;return typeof s=="string"?(i=parseInt(s,10),s.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=s,i}var Ai=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function Vo(s,t){return Ai(s).getPropertyValue(t)}var Lh=["top","right","bottom","left"];function ge(s,t,e){let i={};e=e?"-"+e:"";for(let n=0;n<4;n++){let r=Lh[n];i[r]=parseFloat(s[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var Fh=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function Rh(s,t){let e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:r}=i,o=!1,a,l;if(Fh(n,r,s.target))a=n,l=r;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function Ut(s,t){if("native"in s)return s;let{canvas:e,currentDevicePixelRatio:i}=t,n=Ai(e),r=n.boxSizing==="border-box",o=ge(n,"padding"),a=ge(n,"border","width"),{x:l,y:c,box:h}=Rh(s,e),u=o.left+(h&&a.left),d=o.top+(h&&a.top),{width:f,height:g}=t;return r&&(f-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-u)/f*e.width/i),y:Math.round((c-d)/g*e.height/i)}}function Nh(s,t,e){let i,n;if(t===void 0||e===void 0){let r=s&&Ps(s);if(!r)t=s.clientWidth,e=s.clientHeight;else{let o=r.getBoundingClientRect(),a=Ai(r),l=ge(a,"border","width"),c=ge(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=ui(a.maxWidth,r,"clientWidth"),n=ui(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||xs,maxHeight:n||xs}}var te=s=>Math.round(s*10)/10;function Zn(s,t,e,i){let n=Ai(s),r=ge(n,"margin"),o=ui(n.maxWidth,s,"clientWidth")||xs,a=ui(n.maxHeight,s,"clientHeight")||xs,l=Nh(s,t,e),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let d=ge(n,"border","width"),f=ge(n,"padding");c-=f.width+d.width,h-=f.height+d.height}return c=Math.max(0,c-r.width),h=Math.max(0,i?c/i:h-r.height),c=te(Math.min(c,o,l.maxWidth)),h=te(Math.min(h,a,l.maxHeight)),c&&!h&&(h=te(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=te(Math.floor(h*i))),{width:c,height:h}}function Ii(s,t,e){let i=t||1,n=te(s.height*i),r=te(s.width*i);s.height=te(s.height),s.width=te(s.width);let o=s.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${s.height}px`,o.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||o.height!==n||o.width!==r?(s.currentDevicePixelRatio=i,o.height=n,o.width=r,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}var qn=(function(){let s=!1;try{let t={get passive(){return s=!0,!1}};Cs()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return s})();function Ei(s,t){let e=Vo(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Bt(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function Gn(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:i==="middle"?e<.5?s.y:t.y:i==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function Xn(s,t,e,i){let n={x:s.cp2x,y:s.cp2y},r={x:t.cp1x,y:t.cp1y},o=Bt(s,n,e),a=Bt(n,r,e),l=Bt(r,t,e),c=Bt(o,a,e),h=Bt(a,l,e);return Bt(c,h,e)}var zh=function(s,t){return{x(e){return s+s+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Vh=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function ne(s,t,e){return s?zh(t,e):Vh()}function Li(s,t){let e,i;(t==="ltr"||t==="rtl")&&(e=s.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),s.prevTextDirection=i)}function Fi(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function Wo(s){return s==="angle"?{between:xe,compare:Do,normalize:tt}:{between:Dt,compare:(t,e)=>t-e,normalize:t=>t}}function xo({start:s,end:t,count:e,loop:i,style:n}){return{start:s%e,end:t%e,loop:i&&(t-s+1)%e===0,style:n}}function Wh(s,t,e){let{property:i,start:n,end:r}=e,{between:o,normalize:a}=Wo(i),l=t.length,{start:c,end:h,loop:u}=s,d,f;if(u){for(c+=l,h+=l,d=0,f=l;d<f&&o(a(t[c%l][i]),n,r);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:s.style}}function Ri(s,t,e){if(!e)return[s];let{property:i,start:n,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=Wo(i),{start:h,end:u,loop:d,style:f}=Wh(s,t,e),g=[],m=!1,p=null,b,y,_,w=()=>l(n,_,b)&&a(n,_)!==0,x=()=>a(r,b)===0||l(r,_,b),k=()=>m||w(),v=()=>!m||x();for(let M=h,O=h;M<=u;++M)y=t[M%o],!y.skip&&(b=c(y[i]),b!==_&&(m=l(b,n,r),p===null&&k()&&(p=a(b,n)===0?M:O),p!==null&&v()&&(g.push(xo({start:p,end:M,loop:d,count:o,style:f})),p=null),O=M,_=b));return p!==null&&g.push(xo({start:p,end:u,loop:d,count:o,style:f})),g}function Ni(s,t){let e=[],i=s.segments;for(let n=0;n<i.length;n++){let r=Ri(i[n],s.points,t);r.length&&e.push(...r)}return e}function Bh(s,t,e,i){let n=0,r=t-1;if(e&&!i)for(;n<t&&!s[n].skip;)n++;for(;n<t&&s[n].skip;)n++;for(n%=t,e&&(r+=n);r>n&&s[r%t].skip;)r--;return r%=t,{start:n,end:r}}function Hh(s,t,e,i){let n=s.length,r=[],o=t,a=s[t],l;for(l=t+1;l<=e;++l){let c=s[l%n];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%n,end:(l-1)%n,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%n,end:o%n,loop:i}),r}function Jn(s,t){let e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];let r=!!s._loop,{start:o,end:a}=Bh(e,n,r,i);if(i===!0)return _o(s,[{start:o,end:a,loop:r}],e,t);let l=a<o?a+n:a,c=!!s._fullLoop&&o===0&&a===n-1;return _o(s,Hh(e,o,l,c),e,t)}function _o(s,t,e,i){return!i||!i.setContext||!e?t:$h(s,t,e,i)}function $h(s,t,e,i){let n=s._chart.getContext(),r=wo(s.options),{_datasetIndex:o,options:{spanGaps:a}}=s,l=e.length,c=[],h=r,u=t[0].start,d=u;function f(g,m,p,b){let y=a?-1:1;if(g!==m){for(g+=l;e[g%l].skip;)g-=y;for(;e[m%l].skip;)m+=y;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:p,style:b}),h=b,u=m%l)}}for(let g of t){u=a?u:g.start;let m=e[u%l],p;for(d=u+1;d<=g.end;d++){let b=e[d%l];p=wo(i.setContext(Ft(n,{type:"segment",p0:m,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),jh(p,h)&&f(u,d-1,g.loop,h),m=b,h=p}u<d-1&&f(u,d-1,g.loop,h)}return c}function wo(s){return{backgroundColor:s.backgroundColor,borderCapStyle:s.borderCapStyle,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderJoinStyle:s.borderJoinStyle,borderWidth:s.borderWidth,borderColor:s.borderColor}}function jh(s,t){if(!t)return!1;let e=[],i=function(n,r){return Si(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(s,i)!==JSON.stringify(t,i)}function ci(s,t,e){return s.options.clip?s[e]:t[e]}function Uh(s,t){let{xScale:e,yScale:i}=s;return e&&i?{left:ci(e,t,"left"),right:ci(e,t,"right"),top:ci(i,t,"top"),bottom:ci(i,t,"bottom")}:t}function zi(s,t){let e=t._clip;if(e.disabled)return!1;let i=Uh(t,s.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?s.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?s.height:i.bottom+(e.bottom===!0?0:e.bottom)}}var cr=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){let r=e.listeners[n],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=_i.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;let r=i.items,o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),r.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Yt=new cr,Bo="transparent",Yh={boolean(s,t,e){return e>.5?t:s},color(s,t,e){let i=Be(s||Bo),n=i.valid&&Be(t||Bo);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}},hr=class{constructor(t,e,i,n){let r=e[i];n=ke([t.to,n,r,t.from]);let o=ke([t.from,r,n]);this._active=!0,this._fn=t.fn||Yh[t.type||typeof o],this._easing=fe[t.easing]||fe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let n=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ke([t.to,e,n,t.from]),this._from=ke([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,i=this._duration,n=this._prop,r=this._from,o=this._loop,a=this._to,l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(r,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}},Zi=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!E(t))return;let e=Object.keys(j.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{let r=t[n];if(!E(r))return;let o={};for(let a of e)o[a]=r[a];(B(r.properties)&&r.properties||[n]).forEach(a=>{(a===n||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){let i=e.options,n=qh(t,i);if(!n)return[];let r=this._createAnimations(n,i);return i.$shared&&Zh(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){let i=this._properties,n=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now(),l;for(l=o.length-1;l>=0;--l){let c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}let h=e[c],u=r[c],d=i.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}r[c]=u=new hr(d,t,c,h),n.push(u)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return Yt.add(this._chart,i),!0}};function Zh(s,t){let e=[],i=Object.keys(t);for(let n=0;n<i.length;n++){let r=s[i[n]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function qh(s,t){if(!t)return;let e=s.options;if(!e){s.options=t;return}return e.$shared&&(s.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Ho(s,t){let e=s&&s.options||{},i=e.reverse,n=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:n,end:i?n:r}}function Gh(s,t,e){if(e===!1)return!1;let i=Ho(s,e),n=Ho(t,e);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function Xh(s){let t,e,i,n;return E(s)?(t=s.top,e=s.right,i=s.bottom,n=s.left):t=e=i=n=s,{top:t,right:e,bottom:i,left:n,disabled:s===!1}}function Wa(s,t){let e=[],i=s._getSortedDatasetMetas(t),n,r;for(n=0,r=i.length;n<r;++n)e.push(i[n].index);return e}function $o(s,t,e,i={}){let n=s.keys,r=i.mode==="single",o,a,l,c;if(t===null)return;let h=!1;for(o=0,a=n.length;o<a;++o){if(l=+n[o],l===e){if(h=!0,i.all)continue;break}c=s.values[l],Y(c)&&(r||t===0||yt(t)===yt(c))&&(t+=c)}return!h&&!i.all?0:t}function Jh(s,t){let{iScale:e,vScale:i}=t,n=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(s),a=new Array(o.length),l,c,h;for(l=0,c=o.length;l<c;++l)h=o[l],a[l]={[n]:h,[r]:s[h]};return a}function Kn(s,t){let e=s&&s.options.stacked;return e||e===void 0&&t.stack!==void 0}function Kh(s,t,e){return`${s.id}.${t.id}.${e.stack||e.type}`}function Qh(s){let{min:t,max:e,minDefined:i,maxDefined:n}=s.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function tu(s,t,e){let i=s[t]||(s[t]={});return i[e]||(i[e]={})}function jo(s,t,e,i){for(let n of t.getMatchingVisibleMetas(i).reverse()){let r=s[n.index];if(e&&r>0||!e&&r<0)return n.index}return null}function Uo(s,t){let{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,h=Kh(r,o,i),u=t.length,d;for(let f=0;f<u;++f){let g=t[f],{[l]:m,[c]:p}=g,b=g._stacks||(g._stacks={});d=b[c]=tu(n,h,m),d[a]=p,d._top=jo(d,o,!0,i.type),d._bottom=jo(d,o,!1,i.type);let y=d._visualValues||(d._visualValues={});y[a]=p}}function Qn(s,t){let e=s.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function eu(s,t){return Ft(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function su(s,t,e){return Ft(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function As(s,t){let e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(let n of t){let r=n._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}var tr=s=>s==="reset"||s==="none",Yo=(s,t)=>t?s:Object.assign({},s),iu=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:Wa(e,!0),values:null},dt=class{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Kn(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&&As(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(u,d,f,g)=>u==="x"?d:u==="r"?g:f,r=e.xAxisID=P(i.xAxisID,Qn(t,"x")),o=e.yAxisID=P(i.yAxisID,Qn(t,"y")),a=e.rAxisID=P(i.rAxisID,Qn(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,r,o,a),h=e.vAxisID=n(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&yi(this._data,this),t._stacked&&As(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(E(e)){let n=this._cachedMeta;this._data=Jh(e,n)}else if(i!==e){if(i){yi(i,this);let n=this._cachedMeta;As(n),n._parsed=[]}e&&Object.isExtensible(e)&&Nn(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),n=!1;this._dataCheck();let r=e._stacked;e._stacked=Kn(e.vScale,e),e.stack!==i.stack&&(n=!0,As(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&(Uo(this,e._parsed),e._stacked=Kn(e.vScale,e))}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:i,_data:n}=this,{iScale:r,_stacked:o}=i,a=r.axis,l=t===0&&e===n.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,u,d;if(this._parsing===!1)i._parsed=n,i._sorted=!0,d=n;else{B(n[t])?d=this.parseArrayData(i,n,t,e):E(n[t])?d=this.parseObjectData(i,n,t,e):d=this.parsePrimitiveData(i,n,t,e);let f=()=>u[a]===null||c&&u[a]<c[a];for(h=0;h<e;++h)i._parsed[h+t]=u=d[h],l&&(f()&&(l=!1),c=u);i._sorted=l}o&&Uo(this,d)}parsePrimitiveData(t,e,i,n){let{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),h=r===o,u=new Array(n),d,f,g;for(d=0,f=n;d<f;++d)g=d+i,u[d]={[a]:h||r.parse(c[g],g),[l]:o.parse(e[g],g)};return u}parseArrayData(t,e,i,n){let{xScale:r,yScale:o}=t,a=new Array(n),l,c,h,u;for(l=0,c=n;l<c;++l)h=l+i,u=e[h],a[l]={x:r.parse(u[0],h),y:o.parse(u[1],h)};return a}parseObjectData(t,e,i,n){let{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n),h,u,d,f;for(h=0,u=n;h<u;++h)d=h+i,f=e[d],c[h]={x:r.parse(Lt(f,a),d),y:o.parse(Lt(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let n=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:Wa(n,!0),values:e._stacks[t.axis]._visualValues};return $o(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,n){let r=i[e.axis],o=r===null?NaN:r,a=n&&i._stacks[e.axis];n&&a&&(n.values=a,o=$o(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){let i=this._cachedMeta,n=i._parsed,r=i._sorted&&t===i.iScale,o=n.length,a=this._getOtherScale(t),l=iu(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=Qh(a),d,f;function g(){f=n[d];let m=f[a.axis];return!Y(f[t.axis])||h>m||u<m}for(d=0;d<o&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),r));++d);if(r){for(d=o-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let e=this._cachedMeta._parsed,i=[],n,r,o;for(n=0,r=e.length;n<r;++n)o=e[n][t.axis],Y(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){let e=this._cachedMeta;this.update(t||"default"),e._clip=Xh(P(this.options.clip,Gh(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop,h;for(i.dataset&&i.dataset.draw(t,r,a,l),h=a;h<a+l;++h){let u=n[h];u.hidden||(u.active&&c?o.push(u):u.draw(t,r))}for(h=0;h<o.length;++h)o[h].draw(t,r)}getStyle(t,e){let i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){let n=this.getDataset(),r;if(t>=0&&t<this._cachedMeta.data.length){let o=this._cachedMeta.data[t];r=o.$context||(o.$context=su(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=n.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=eu(this.chart.getContext(),this.index)),r.dataset=n,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){let n=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&be(i);if(a)return Yo(a,l);let c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=n?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),f=Object.keys(j.elements[t]),g=()=>this.getContext(i,n,e),m=c.resolveNamedOptions(d,f,g,u);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(Yo(m,l))),m}_resolveAnimations(t,e,i){let n=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(n.options.animation!==!1){let h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,i,e))}let c=new Zi(n,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||tr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,n){tr(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!tr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;let r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let n=i.length,r=e.length,o=Math.min(r,n);o&&this.parse(0,o),r>n?this._insertElements(n,r-n,t):r<n&&this._removeElements(r,n-r)}_insertElements(t,e,i=!0){let n=this._cachedMeta,r=n.data,o=t+e,a,l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let n=i._parsed.splice(t,e);i._stacked&&As(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,n]=t;this[e](i,n)}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,e){e&&this._sync(["_removeElements",t,e]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};S(dt,"defaults",{}),S(dt,"datasetElementType",null),S(dt,"dataElementType",null);function nu(s,t){if(!s._cache.$bar){let e=s.getMatchingVisibleMetas(t),i=[];for(let n=0,r=e.length;n<r;n++)i=i.concat(e[n].controller.getAllParsedValues(s));s._cache.$bar=xi(i.sort((n,r)=>n-r))}return s._cache.$bar}function ru(s){let t=s.iScale,e=nu(t,s.type),i=t._length,n,r,o,a,l=()=>{o===32767||o===-32768||(be(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(n=0,r=e.length;n<r;++n)o=t.getPixelForValue(e[n]),l();for(a=void 0,n=0,r=t.ticks.length;n<r;++n)o=t.getPixelForTick(n),l();return i}function ou(s,t,e,i){let n=e.barThickness,r,o;return I(n)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=n*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[s]-r/2}}function au(s,t,e,i){let n=t.pixels,r=n[s],o=s>0?n[s-1]:null,a=s<n.length-1?n[s+1]:null,l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);let c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function lu(s,t,e,i){let n=e.parse(s[0],i),r=e.parse(s[1],i),o=Math.min(n,r),a=Math.max(n,r),l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:r,min:o,max:a}}function Ba(s,t,e,i){return B(s)?lu(s,t,e,i):t[e.axis]=e.parse(s,i),t}function Zo(s,t,e,i){let n=s.iScale,r=s.vScale,o=n.getLabels(),a=n===r,l=[],c,h,u,d;for(c=e,h=e+i;c<h;++c)d=t[c],u={},u[n.axis]=a||n.parse(o[c],c),l.push(Ba(d,u,r,c));return l}function er(s){return s&&s.barStart!==void 0&&s.barEnd!==void 0}function cu(s,t,e){return s!==0?yt(s):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function hu(s){let t,e,i,n,r;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.base<s.y,e="bottom",i="top"),t?(n="end",r="start"):(n="start",r="end"),{start:e,end:i,reverse:t,top:n,bottom:r}}function uu(s,t,e,i){let n=t.borderSkipped,r={};if(!n){s.borderSkipped=r;return}if(n===!0){s.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:a,reverse:l,top:c,bottom:h}=hu(s);n==="middle"&&e&&(s.enableBorderRadius=!0,(e._top||0)===i?n=c:(e._bottom||0)===i?n=h:(r[qo(h,o,a,l)]=!0,n=c)),r[qo(n,o,a,l)]=!0,s.borderSkipped=r}function qo(s,t,e,i){return i?(s=du(s,t,e),s=Go(s,e,t)):s=Go(s,t,e),s}function du(s,t,e){return s===t?e:s===e?t:s}function Go(s,t,e){return s==="start"?t:s==="end"?e:s}function fu(s,{inflateAmount:t},e){s.inflateAmount=t==="auto"?e===1?.33:0:t}var Ue=class extends dt{parsePrimitiveData(t,e,i,n){return Zo(t,e,i,n)}parseArrayData(t,e,i,n){return Zo(t,e,i,n)}parseObjectData(t,e,i,n){let{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,h=o.axis==="x"?a:l,u=[],d,f,g,m;for(d=i,f=i+n;d<f;++d)m=e[d],g={},g[r.axis]=r.parse(Lt(m,c),d),u.push(Ba(Lt(m,h),g,o,d));return u}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);let r=i._custom;r&&e===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 e=this._cachedMeta,{iScale:i,vScale:n}=e,r=this.getParsed(t),o=r._custom,a=er(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){let r=n==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,n);for(let f=e;f<e+i;f++){let g=this.getParsed(f),m=r||I(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,h),b=(g._stacks||{})[a.axis],y={horizontal:c,base:m.base,enableBorderRadius:!b||er(g._custom)||o===b._top||o===b._bottom,x:c?m.head:p.center,y:c?p.center:m.head,height:c?p.size:Math.abs(m.size),width:c?Math.abs(m.size):p.size};d&&(y.options=u||this.resolveDataElementOptions(f,t[f].active?"active":n));let _=y.options||t[f].options;uu(y,_,b,o),fu(y,_,h.ratio),this.updateElement(t[f],f,y,n)}}_getStacks(t,e){let{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=h=>{let u=h._parsed.find(f=>f[i.axis]===l),d=u&&u[h.vScale.axis];if(I(d)||isNaN(d))return!0};for(let h of n)if(!(e!==void 0&&c(h))&&((r===!1||o.indexOf(h.stack)===-1||r===void 0&&h.stack===void 0)&&o.push(h.stack),h.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){let t={},e=this.getFirstScaleIdForIndexAxis();for(let i of this.chart.data.datasets)t[P(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){let n=this._getStacks(t,i),r=e!==void 0?n.indexOf(e):-1;return r===-1?n.length-1:r}_getRuler(){let t=this.options,e=this._cachedMeta,i=e.iScale,n=[],r,o;for(r=0,o=e.data.length;r<o;++r)n.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));let a=t.barThickness;return{min:a||ru(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,h=er(c),u=l[e.axis],d=0,f=i?this.applyStack(e,l,i):u,g,m;f!==u&&(d=f-u,f=u),h&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&yt(u)!==yt(c.barEnd)&&(d=0),d+=u);let p=!I(r)&&!h?r:d,b=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(d+f):g=b,m=g-b,Math.abs(m)<o){m=cu(m,e,a)*o,u===a&&(b-=m/2);let y=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),w=Math.min(y,_),x=Math.max(y,_);b=Math.max(Math.min(b,x),w),g=b+m,i&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(g)-e.getValueForPixel(b))}if(b===e.getPixelForValue(a)){let y=yt(m)*e.getLineWidthForValue(a)/2;b+=y,m-=y}return{size:m,base:b,head:g,center:g+m/2}}_calculateBarIndexPixels(t,e){let i=e.scale,n=this.options,r=n.skipNull,o=P(n.maxBarThickness,1/0),a,l,c=this._getAxisCount();if(e.grouped){let h=r?this._getStackCount(t):e.stackCount,u=n.barThickness==="flex"?au(t,e,n,h*c):ou(t,e,n,h*c),d=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(P(d,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+f;a=u.start+u.chunk*g+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){let t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length,r=0;for(;r<n;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}};S(Ue,"id","bar"),S(Ue,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),S(Ue,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});var Ye=class extends dt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){let r=super.parsePrimitiveData(t,e,i,n);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,n){let r=super.parseArrayData(t,e,i,n);for(let o=0;o<r.length;o++){let a=e[i+o];r[o]._custom=P(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,n){let r=super.parseObjectData(t,e,i,n);for(let o=0;o<r.length;o++){let a=e[i+o];r[o]._custom=P(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){let t=this._cachedMeta.data,e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,o=this.getParsed(t),a=n.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){let r=n==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=o.axis,u=a.axis;for(let d=e;d<e+i;d++){let f=t[d],g=!r&&this.getParsed(d),m={},p=m[h]=r?o.getPixelForDecimal(.5):o.getPixelForValue(g[h]),b=m[u]=r?a.getBasePixel():a.getPixelForValue(g[u]);m.skip=isNaN(p)||isNaN(b),c&&(m.options=l||this.resolveDataElementOptions(d,f.active?"active":n),r&&(m.options.radius=0)),this.updateElement(f,d,m,n)}}resolveDataElementOptions(t,e){let i=this.getParsed(t),n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));let r=n.radius;return e!=="active"&&(n.radius=0),n.radius+=P(i&&i._custom,r),n}};S(Ye,"id","bubble"),S(Ye,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),S(Ye,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function gu(s,t,e){let i=1,n=1,r=0,o=0;if(t<H){let a=s,l=a+t,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),f=(_,w,x)=>xe(_,a,l,!0)?1:Math.max(w,w*e,x,x*e),g=(_,w,x)=>xe(_,a,l,!0)?-1:Math.min(w,w*e,x,x*e),m=f(0,c,u),p=f(q,h,d),b=g(F,c,u),y=g(F+q,h,d);i=(m-b)/2,n=(p-y)/2,r=-(m+b)/2,o=-(p+y)/2}return{ratioX:i,ratioY:n,offsetX:r,offsetY:o}}var qt=class extends dt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let i=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=i;else{let r=l=>+i[l];if(E(i[t])){let{key:l="value"}=this._parsing;r=c=>+Lt(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)n._parsed[o]=r(o)}}_getRotation(){return ut(this.options.rotation-90)}_getCircumference(){return ut(this.options.circumference)}_getRotationExtents(){let t=H,e=-H;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){let n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),o=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){let e=this.chart,{chartArea:i}=e,n=this._cachedMeta,r=n.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(Pn(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:g,offsetY:m}=gu(u,h,l),p=(i.width-o)/d,b=(i.height-o)/f,y=Math.max(Math.min(p,b)/2,0),_=di(this.options.radius,y),w=Math.max(_*l,0),x=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=m*_,n.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){let i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/H)}updateElements(t,e,i,n){let r=n==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=r&&c.animateScale,f=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:m,includeOptions:p}=this._getSharedOptions(e,n),b=this._getRotation(),y;for(y=0;y<e;++y)b+=this._circumference(y,r);for(y=e;y<e+i;++y){let _=this._circumference(y,r),w=t[y],x={x:h+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:g,innerRadius:f};p&&(x.options=m||this.resolveDataElementOptions(y,w.active?"active":n)),b+=_,this.updateElement(w,y,x,n)}}calculateTotal(){let t=this._cachedMeta,e=t.data,i=0,n;for(n=0;n<e.length;n++){let r=t._parsed[n];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?H*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=_e(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0,i=this.chart,n,r,o,a,l;if(!t){for(n=0,r=i.data.datasets.length;n<r;++n)if(i.isDatasetVisible(n)){o=i.getDatasetMeta(n),t=o.data,a=o.controller;break}}if(!t)return 0;for(n=0,r=t.length;n<r;++n)l=a.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){let r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(P(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};S(qt,"id","doughnut"),S(qt,"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"}),S(qt,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),S(qt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data,{labels:{pointStyle:i,textAlign:n,color:r,useBorderRadius:o,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{let u=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:u.backgroundColor,fontColor:r,hidden:!t.getDataVisibility(c),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:n,pointStyle:i,borderRadius:o&&(a||u.borderRadius),index:c}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});var Ze=class extends dt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,o=this.chart._animationsDisabled,{start:a,count:l}=ki(e,n,o);this._drawStart=a,this._drawCount=l,vi(e)&&(a=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,i,n){let r=n==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,n),d=o.axis,f=a.axis,{spanGaps:g,segment:m}=this.options,p=se(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||n==="none",y=e+i,_=t.length,w=e>0&&this.getParsed(e-1);for(let x=0;x<_;++x){let k=t[x],v=b?k:{};if(x<e||x>=y){v.skip=!0;continue}let M=this.getParsed(x),O=I(M[f]),D=v[d]=o.getPixelForValue(M[d],x),A=v[f]=r||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],x);v.skip=isNaN(D)||isNaN(A)||O,v.stop=x>0&&Math.abs(M[d]-w[d])>p,m&&(v.parsed=M,v.raw=c.data[x]),u&&(v.options=h||this.resolveDataElementOptions(x,k.active?"active":n)),b||this.updateElement(k,x,v,n),w=M}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;let r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};S(Ze,"id","line"),S(Ze,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),S(Ze,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});var Oe=class extends dt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=_e(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return Pi.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,n)=>{let r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,n){let r=n==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*F,f=d,g,m=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,n,m);for(g=e;g<e+i;g++){let p=t[g],b=f,y=f+this._computeAngle(g,n,m),_=o.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=y,r&&(l.animateScale&&(_=0),l.animateRotate&&(b=y=d));let w={x:h,y:u,innerRadius:0,outerRadius:_,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(g,p.active?"active":n)};this.updateElement(p,g,w,n)}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((i,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?ut(this.resolveDataElementOptions(t,e).angle||i):0}};S(Oe,"id","polarArea"),S(Oe,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),S(Oe,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map((r,o)=>{let l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});var Rs=class extends qt{};S(Rs,"id","pie"),S(Rs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});var qe=class extends dt{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Pi.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,t!=="resize"){let o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:r.length===n.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){let r=this._cachedMeta.rScale,o=n==="reset";for(let a=e;a<e+i;a++){let l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":n),h=r.getPointPositionForValue(a,this.getParsed(a).r),u=o?r.xCenter:h.x,d=o?r.yCenter:h.y,f={x:u,y:d,angle:h.angle,skip:isNaN(u)||isNaN(d),options:c};this.updateElement(l,a,f,n)}}};S(qe,"id","radar"),S(qe,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),S(qe,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});var Ge=class extends dt{getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,o=this.getParsed(t),a=n.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){let e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled,{start:r,count:o}=ki(e,i,n);if(this._drawStart=r,this._drawCount=o,vi(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!n,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){let r=n==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),u=this.getSharedOptions(h),d=this.includeOptions(n,u),f=o.axis,g=a.axis,{spanGaps:m,segment:p}=this.options,b=se(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||n==="none",_=e>0&&this.getParsed(e-1);for(let w=e;w<e+i;++w){let x=t[w],k=this.getParsed(w),v=y?x:{},M=I(k[g]),O=v[f]=o.getPixelForValue(k[f],w),D=v[g]=r||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[g],w);v.skip=isNaN(O)||isNaN(D)||M,v.stop=w>0&&Math.abs(k[f]-_[f])>b,p&&(v.parsed=k,v.raw=c.data[w]),d&&(v.options=u||this.resolveDataElementOptions(w,x.active?"active":n)),y||this.updateElement(x,w,v,n),_=k}this.updateSharedOptions(u,n,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;let r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,o)/2}};S(Ge,"id","scatter"),S(Ge,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),S(Ge,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var mu=Object.freeze({__proto__:null,BarController:Ue,BubbleController:Ye,DoughnutController:qt,LineController:Ze,PieController:Rs,PolarAreaController:Oe,RadarController:qe,ScatterController:Ge});function ve(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var ur=class s{constructor(t){S(this,"options");this.options=t||{}}static override(t){Object.assign(s.prototype,t)}init(){}formats(){return ve()}parse(){return ve()}format(){return ve()}add(){return ve()}diff(){return ve()}startOf(){return ve()}endOf(){return ve()}},vr={_date:ur};function pu(s,t,e,i){let{controller:n,data:r,_sorted:o}=s,a=n._cachedMeta.iScale,l=s.dataset&&s.dataset.options?s.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&r.length){let c=a._reversePixels?Fn:Mt;if(i){if(n._sharedOptions){let h=r[0],u=typeof h.getRange=="function"&&h.getRange(t);if(u){let d=c(r,t,e-u),f=c(r,t,e+u);return{lo:d.lo,hi:f.hi}}}}else{let h=c(r,t,e);if(l){let{vScale:u}=n._cachedMeta,{_parsed:d}=s,f=d.slice(0,h.lo+1).reverse().findIndex(m=>!I(m[u.axis]));h.lo-=Math.max(0,f);let g=d.slice(h.hi).findIndex(m=>!I(m[u.axis]));h.hi+=Math.max(0,g)}return h}}return{lo:0,hi:r.length-1}}function Zs(s,t,e,i,n){let r=s.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){let{index:c,data:h}=r[a],{lo:u,hi:d}=pu(r[a],t,o,n);for(let f=u;f<=d;++f){let g=h[f];g.skip||i(g,c,f)}}}function bu(s){let t=s.indexOf("x")!==-1,e=s.indexOf("y")!==-1;return function(i,n){let r=t?Math.abs(i.x-n.x):0,o=e?Math.abs(i.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function sr(s,t,e,i,n){let r=[];return!n&&!s.isPointInArea(t)||Zs(s,e,t,function(a,l,c){!n&&!Tt(a,s.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function yu(s,t,e,i){let n=[];function r(o,a,l){let{startAngle:c,endAngle:h}=o.getProps(["startAngle","endAngle"],i),{angle:u}=bi(o,{x:t.x,y:t.y});xe(u,c,h)&&n.push({element:o,datasetIndex:a,index:l})}return Zs(s,e,t,r),n}function xu(s,t,e,i,n,r){let o=[],a=bu(e),l=Number.POSITIVE_INFINITY;function c(h,u,d){let f=h.inRange(t.x,t.y,n);if(i&&!f)return;let g=h.getCenterPoint(n);if(!(!!r||s.isPointInArea(g))&&!f)return;let p=a(t,g);p<l?(o=[{element:h,datasetIndex:u,index:d}],l=p):p===l&&o.push({element:h,datasetIndex:u,index:d})}return Zs(s,e,t,c),o}function ir(s,t,e,i,n,r){return!r&&!s.isPointInArea(t)?[]:e==="r"&&!i?yu(s,t,e,n):xu(s,t,e,i,n,r)}function Xo(s,t,e,i,n){let r=[],o=e==="x"?"inXRange":"inYRange",a=!1;return Zs(s,e,t,(l,c,h)=>{l[o]&&l[o](t[e],n)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),i&&!a?[]:r}var _u={evaluateInteractionItems:Zs,modes:{index(s,t,e,i){let n=Ut(t,s),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?sr(s,n,r,i,o):ir(s,n,r,!1,i,o),l=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(c=>{let h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(s,t,e,i){let n=Ut(t,s),r=e.axis||"xy",o=e.includeInvisible||!1,a=e.intersect?sr(s,n,r,i,o):ir(s,n,r,!1,i,o);if(a.length>0){let l=a[0].datasetIndex,c=s.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(s,t,e,i){let n=Ut(t,s),r=e.axis||"xy",o=e.includeInvisible||!1;return sr(s,n,r,i,o)},nearest(s,t,e,i){let n=Ut(t,s),r=e.axis||"xy",o=e.includeInvisible||!1;return ir(s,n,r,e.intersect,i,o)},x(s,t,e,i){let n=Ut(t,s);return Xo(s,n,"x",e.intersect,i)},y(s,t,e,i){let n=Ut(t,s);return Xo(s,n,"y",e.intersect,i)}}},Ha=["left","top","right","bottom"];function Is(s,t){return s.filter(e=>e.pos===t)}function Jo(s,t){return s.filter(e=>Ha.indexOf(e.pos)===-1&&e.box.axis===t)}function Es(s,t){return s.sort((e,i)=>{let n=t?i:e,r=t?e:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function wu(s){let t=[],e,i,n,r,o,a;for(e=0,i=(s||[]).length;e<i;++e)n=s[e],{position:r,options:{stack:o,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&r+o,stackWeight:a});return t}function ku(s){let t={};for(let e of s){let{stack:i,pos:n,stackWeight:r}=e;if(!i||!Ha.includes(n))continue;let o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function vu(s,t){let e=ku(s),{vBoxMaxWidth:i,hBoxMaxHeight:n}=t,r,o,a;for(r=0,o=s.length;r<o;++r){a=s[r];let{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*i:l&&t.availableWidth,a.height=n):(a.width=i,a.height=h?h*n:l&&t.availableHeight)}return e}function Su(s){let t=wu(s),e=Es(t.filter(c=>c.box.fullSize),!0),i=Es(Is(t,"left"),!0),n=Es(Is(t,"right")),r=Es(Is(t,"top"),!0),o=Es(Is(t,"bottom")),a=Jo(t,"x"),l=Jo(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:Is(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:r.concat(o).concat(a)}}function Ko(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function $a(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function Mu(s,t,e,i){let{pos:n,box:r}=e,o=s.maxPadding;if(!E(n)){e.size&&(s[n]-=e.size);let u=i[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?r.height:r.width),e.size=u.size/u.count,s[n]+=e.size}r.getPadding&&$a(o,r.getPadding());let a=Math.max(0,t.outerWidth-Ko(o,s,"left","right")),l=Math.max(0,t.outerHeight-Ko(o,s,"top","bottom")),c=a!==s.w,h=l!==s.h;return s.w=a,s.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Tu(s){let t=s.maxPadding;function e(i){let n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function Ou(s,t){let e=t.maxPadding;function i(n){let r={left:0,top:0,right:0,bottom:0};return n.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(s?["left","right"]:["top","bottom"])}function Ns(s,t,e,i){let n=[],r,o,a,l,c,h;for(r=0,o=s.length,c=0;r<o;++r){a=s[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Ou(a.horizontal,t));let{same:u,other:d}=Mu(t,e,a,i);c|=u&&n.length,h=h||d,l.fullSize||n.push(a)}return c&&Ns(n,t,e,i)||h}function Vi(s,t,e,i,n){s.top=e,s.left=t,s.right=t+i,s.bottom=e+n,s.width=i,s.height=n}function Qo(s,t,e,i){let n=e.padding,{x:r,y:o}=t;for(let a of s){let l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){let u=t.w*h,d=c.size||l.height;be(c.start)&&(o=c.start),l.fullSize?Vi(l,n.left,o,e.outerWidth-n.right-n.left,d):Vi(l,t.left+c.placed,o,u,d),c.start=o,c.placed+=u,o=l.bottom}else{let u=t.h*h,d=c.size||l.width;be(c.start)&&(r=c.start),l.fullSize?Vi(l,r,n.top,d,e.outerHeight-n.bottom-n.top):Vi(l,r,t.top+c.placed,d,u),c.start=r,c.placed+=u,r=l.right}}t.x=r,t.y=o}var ot={addBox(s,t){s.boxes||(s.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},s.boxes.push(t)},removeBox(s,t){let e=s.boxes?s.boxes.indexOf(t):-1;e!==-1&&s.boxes.splice(e,1)},configure(s,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(s,t,e,i){if(!s)return;let n=st(s.options.layout.padding),r=Math.max(t-n.width,0),o=Math.max(e-n.height,0),a=Su(s.boxes),l=a.vertical,c=a.horizontal;N(s.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});let h=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),d=Object.assign({},n);$a(d,st(i));let f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),g=vu(l.concat(c),u);Ns(a.fullSize,f,u,g),Ns(l,f,u,g),Ns(c,f,u,g)&&Ns(l,f,u,g),Tu(f),Qo(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,Qo(a.rightAndBottom,f,u,g),s.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},N(a.chartArea,m=>{let p=m.box;Object.assign(p,s.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},qi=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}},dr=class extends qi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Ui="$chartjs",Du={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ta=s=>s===null||s==="";function Cu(s,t){let e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[Ui]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",ta(n)){let r=Ei(s,"width");r!==void 0&&(s.width=r)}if(ta(i))if(s.style.height==="")s.height=s.width/(t||2);else{let r=Ei(s,"height");r!==void 0&&(s.height=r)}return s}var ja=qn?{passive:!0}:!1;function Pu(s,t,e){s&&s.addEventListener(t,e,ja)}function Au(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,ja)}function Iu(s,t){let e=Du[s.type]||s.type,{x:i,y:n}=Ut(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function Gi(s,t){for(let e of s)if(e===t||e.contains(t))return!0}function Eu(s,t,e){let i=s.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||Gi(a.addedNodes,i),o=o&&!Gi(a.removedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Lu(s,t,e){let i=s.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||Gi(a.removedNodes,i),o=o&&!Gi(a.addedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}var js=new Map,ea=0;function Ua(){let s=window.devicePixelRatio;s!==ea&&(ea=s,js.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Fu(s,t){js.size||window.addEventListener("resize",Ua),js.set(s,t)}function Ru(s){js.delete(s),js.size||window.removeEventListener("resize",Ua)}function Nu(s,t,e){let i=s.canvas,n=i&&Ps(i);if(!n)return;let r=wi((a,l)=>{let c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),o=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(n),Fu(s,r),o}function nr(s,t,e){e&&e.disconnect(),t==="resize"&&Ru(s)}function zu(s,t,e){let i=s.canvas,n=wi(r=>{s.ctx!==null&&e(Iu(r,s))},s);return Pu(i,t,n),n}var fr=class extends qi{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Cu(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[Ui])return!1;let i=e[Ui].initial;["height","width"].forEach(r=>{let o=i[r];I(o)?e.removeAttribute(r):e.setAttribute(r,o)});let n=i.style||{};return Object.keys(n).forEach(r=>{e.style[r]=n[r]}),e.width=e.width,delete e[Ui],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),o={attach:Eu,detach:Lu,resize:Nu}[e]||zu;n[e]=o(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:nr,detach:nr,resize:nr}[e]||Au)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Zn(t,e,i,n)}isAttached(t){let e=t&&Ps(t);return!!(e&&e.isConnected)}};function Vu(s){return!Cs()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?dr:fr}var ft=class{constructor(){S(this,"x");S(this,"y");S(this,"active",!1);S(this,"options");S(this,"$animations")}tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return se(this.x)&&se(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let n={};return t.forEach(r=>{n[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),n}};S(ft,"defaults",{}),S(ft,"defaultRoutes");function Wu(s,t){let e=s.options.ticks,i=Bu(s),n=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?$u(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>n)return ju(t,c,r,o/n),c;let h=Hu(r,t,n);if(o>0){let u,d,f=o>1?Math.round((l-a)/(o-1)):null;for(Wi(t,c,h,I(f)?0:a-f,a),u=0,d=o-1;u<d;u++)Wi(t,c,h,r[u],r[u+1]);return Wi(t,c,h,l,I(f)?t.length:l+f),c}return Wi(t,c,h),c}function Bu(s){let t=s.options.offset,e=s._tickSize(),i=s._length/e+(t?0:1),n=s._maxLength/e;return Math.floor(Math.min(i,n))}function Hu(s,t,e){let i=Uu(s),n=t.length/e;if(!i)return Math.max(n,1);let r=In(i);for(let o=0,a=r.length-1;o<a;o++){let l=r[o];if(l>n)return l}return Math.max(n,1)}function $u(s){let t=[],e,i;for(e=0,i=s.length;e<i;e++)s[e].major&&t.push(e);return t}function ju(s,t,e,i){let n=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<s.length;o++)o===r&&(t.push(s[o]),n++,r=e[n*i])}function Wi(s,t,e,i,n){let r=P(i,0),o=Math.min(P(n,s.length),s.length),a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-i,e=l/Math.floor(l/e)),h=r;h<0;)a++,h=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===h&&(t.push(s[c]),a++,h=Math.round(r+a*e))}function Uu(s){let t=s.length,e,i;if(t<2)return!1;for(i=s[0],e=1;e<t;++e)if(s[e]-s[e-1]!==i)return!1;return i}var Yu=s=>s==="left"?"right":s==="right"?"left":s,sa=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,ia=(s,t)=>Math.min(t||s,s);function na(s,t){let e=[],i=s.length/t,n=s.length,r=0;for(;r<n;r+=i)e.push(s[Math.floor(r)]);return e}function Zu(s,t,e){let i=s.ticks.length,n=Math.min(t,i-1),r=s._startPixel,o=s._endPixel,a=1e-6,l=s.getPixelForTick(n),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(s.getPixelForTick(1)-l)/2:c=(l-s.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<r-a||l>o+a)))return l}function qu(s,t){N(s,e=>{let i=e.gc,n=i.length/2,r;if(n>t){for(r=0;r<n;++r)delete e.data[i[r]];i.splice(0,n)}})}function Ls(s){return s.drawTicks?s.tickLength:0}function ra(s,t){if(!s.display)return 0;let e=X(s.font,t),i=st(s.padding);return(B(s.text)?s.text.length:1)*e.lineHeight+i.height}function Gu(s,t){return Ft(s,{scale:t,type:"scale"})}function Xu(s,t,e){return Ft(s,{tick:e,index:t,type:"tick"})}function Ju(s,t,e){let i=Ss(s);return(e&&t!=="right"||!e&&t==="right")&&(i=Yu(i)),i}function Ku(s,t,e,i){let{top:n,left:r,bottom:o,right:a,chart:l}=s,{chartArea:c,scales:h}=l,u=0,d,f,g,m=o-n,p=a-r;if(s.isHorizontal()){if(f=et(i,r,a),E(e)){let b=Object.keys(e)[0],y=e[b];g=h[b].getPixelForValue(y)+m-t}else e==="center"?g=(c.bottom+c.top)/2+m-t:g=sa(s,e,t);d=a-r}else{if(E(e)){let b=Object.keys(e)[0],y=e[b];f=h[b].getPixelForValue(y)-p+t}else e==="center"?f=(c.left+c.right)/2-p+t:f=sa(s,e,t);g=et(i,o,n),u=e==="left"?-q:q}return{titleX:f,titleY:g,maxWidth:d,rotation:u}}var Ce=class s extends ft{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.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(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=at(t,Number.POSITIVE_INFINITY),e=at(e,Number.NEGATIVE_INFINITY),i=at(i,Number.POSITIVE_INFINITY),n=at(n,Number.NEGATIVE_INFINITY),{min:at(t,i),max:at(e,n),minDefined:Y(t),maxDefined:Y(e)}}getMinMax(t){let{min:e,max:i,minDefined:n,maxDefined:r}=this.getUserBounds(),o;if(n&&r)return{min:e,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=n&&e>i?e:i,{min:at(e,at(i,e)),max:at(i,at(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){W(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:n,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=$n(this,r,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(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Wu(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){W(this.options.afterUpdate,[this])}beforeSetDimensions(){W(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(){W(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),W(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){W(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e=this.options.ticks,i,n,r;for(i=0,n=t.length;i<n;i++)r=t[i],r.label=W(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){W(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){W(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,e=t.ticks,i=ia(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,r=e.maxRotation,o=n,a,l,c;if(!this._isVisible()||!e.display||n>=r||i<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=K(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),u+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-Ls(t.grid)-e.padding-ra(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=ks(Math.min(Math.asin(K((h.highest.height+6)/a,-1,1)),Math.asin(K(l/c,-1,1))-Math.asin(K(d/c,-1,1)))),o=Math.max(n,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){W(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){W(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let l=ra(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ls(r)+l):(t.height=this.maxHeight,t.width=Ls(r)+l),i.display&&this.ticks.length){let{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=i.padding*2,g=ut(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){let b=i.mirror?0:p*u.width+m*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=i.mirror?0:m*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,p,m)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){let{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),d=0,f=0;l?c?(d=n*t.width,f=i*e.height):(d=i*t.height,f=n*e.width):r==="start"?f=e.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+o)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;r==="start"?(h=0,u=t.height):r==="end"&&(h=e.height,u=0),this.paddingTop=h+o,this.paddingBottom=u+o}}_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(){W(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)I(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=na(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){let{ctx:n,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/ia(e,i)),c=0,h=0,u,d,f,g,m,p,b,y,_,w,x;for(u=0;u<e;u+=l){if(g=t[u].label,m=this._resolveTickFontOptions(u),n.font=p=m.string,b=r[p]=r[p]||{data:{},gc:[]},y=m.lineHeight,_=w=0,!I(g)&&!B(g))_=ze(n,b.data,b.gc,_,g),w=y;else if(B(g))for(d=0,f=g.length;d<f;++d)x=g[d],!I(x)&&!B(x)&&(_=ze(n,b.data,b.gc,_,x),w+=y);o.push(_),a.push(w),c=Math.max(_,c),h=Math.max(w,h)}qu(r,e);let k=o.indexOf(c),v=a.indexOf(h),M=O=>({width:o[O]||0,height:a[O]||0});return{first:M(0),last:M(e-1),widest:M(k),highest:M(v),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return Ln(this._alignToPixels?Ht(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let i=e[t];return i.$context||(i.$context=Xu(this.getContext(),t,i))}return this.$context||(this.$context=Gu(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,e=ut(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*n?a/i:l/n:l*n<a*i?l/i:a/n}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e=this.axis,i=this.chart,n=this.options,{grid:r,position:o,border:a}=n,l=r.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),d=Ls(r),f=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,b=function(U){return Ht(i,U,m)},y,_,w,x,k,v,M,O,D,A,L,J;if(o==="top")y=b(this.bottom),v=this.bottom-d,O=y-p,A=b(t.top)+p,J=t.bottom;else if(o==="bottom")y=b(this.top),A=t.top,J=b(t.bottom)-p,v=y+p,O=this.top+d;else if(o==="left")y=b(this.right),k=this.right-d,M=y-p,D=b(t.left)+p,L=t.right;else if(o==="right")y=b(this.left),D=t.left,L=b(t.right)-p,k=y+p,M=this.left+d;else if(e==="x"){if(o==="center")y=b((t.top+t.bottom)/2+.5);else if(E(o)){let U=Object.keys(o)[0],G=o[U];y=b(this.chart.scales[U].getPixelForValue(G))}A=t.top,J=t.bottom,v=y+p,O=v+d}else if(e==="y"){if(o==="center")y=b((t.left+t.right)/2);else if(E(o)){let U=Object.keys(o)[0],G=o[U];y=b(this.chart.scales[U].getPixelForValue(G))}k=y-p,M=k-d,D=t.left,L=t.right}let ht=P(n.ticks.maxTicksLimit,u),V=Math.max(1,Math.ceil(u/ht));for(_=0;_<u;_+=V){let U=this.getContext(_),G=r.setContext(U),St=a.setContext(U),rt=G.lineWidth,Fe=G.color,ii=St.dash||[],Re=St.dashOffset,ds=G.tickWidth,ue=G.tickColor,fs=G.tickBorderDash||[],de=G.tickBorderDashOffset;w=Zu(this,_,l),w!==void 0&&(x=Ht(i,w,rt),c?k=M=D=L=x:v=O=A=J=x,f.push({tx1:k,ty1:v,tx2:M,ty2:O,x1:D,y1:A,x2:L,y2:J,width:rt,color:Fe,borderDash:ii,borderDashOffset:Re,tickWidth:ds,tickColor:ue,tickBorderDash:fs,tickBorderDashOffset:de}))}return this._ticksLength=u,this._borderValue=y,f}_computeLabelItems(t){let e=this.axis,i=this.options,{position:n,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=r,d=Ls(i.grid),f=d+h,g=u?-h:f,m=-ut(this.labelRotation),p=[],b,y,_,w,x,k,v,M,O,D,A,L,J="middle";if(n==="top")k=this.bottom-g,v=this._getXAxisLabelAlignment();else if(n==="bottom")k=this.top+g,v=this._getXAxisLabelAlignment();else if(n==="left"){let V=this._getYAxisLabelAlignment(d);v=V.textAlign,x=V.x}else if(n==="right"){let V=this._getYAxisLabelAlignment(d);v=V.textAlign,x=V.x}else if(e==="x"){if(n==="center")k=(t.top+t.bottom)/2+f;else if(E(n)){let V=Object.keys(n)[0],U=n[V];k=this.chart.scales[V].getPixelForValue(U)+f}v=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")x=(t.left+t.right)/2-f;else if(E(n)){let V=Object.keys(n)[0],U=n[V];x=this.chart.scales[V].getPixelForValue(U)}v=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?J="top":l==="end"&&(J="bottom"));let ht=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){_=a[b],w=_.label;let V=r.setContext(this.getContext(b));M=this.getPixelForTick(b)+r.labelOffset,O=this._resolveTickFontOptions(b),D=O.lineHeight,A=B(w)?w.length:1;let U=A/2,G=V.color,St=V.textStrokeColor,rt=V.textStrokeWidth,Fe=v;o?(x=M,v==="inner"&&(b===y-1?Fe=this.options.reverse?"left":"right":b===0?Fe=this.options.reverse?"right":"left":Fe="center"),n==="top"?c==="near"||m!==0?L=-A*D+D/2:c==="center"?L=-ht.highest.height/2-U*D+D:L=-ht.highest.height+D/2:c==="near"||m!==0?L=D/2:c==="center"?L=ht.highest.height/2-U*D:L=ht.highest.height-A*D,u&&(L*=-1),m!==0&&!V.showLabelBackdrop&&(x+=D/2*Math.sin(m))):(k=M,L=(1-A)*D/2);let ii;if(V.showLabelBackdrop){let Re=st(V.backdropPadding),ds=ht.heights[b],ue=ht.widths[b],fs=L-Re.top,de=0-Re.left;switch(J){case"middle":fs-=ds/2;break;case"bottom":fs-=ds;break}switch(v){case"center":de-=ue/2;break;case"right":de-=ue;break;case"inner":b===y-1?de-=ue:b>0&&(de-=ue/2);break}ii={left:de,top:fs,width:ue+Re.width,height:ds+Re.height,color:V.backdropColor}}p.push({label:w,font:O,textOffset:L,options:{rotation:m,color:G,strokeColor:St,strokeWidth:rt,textAlign:Fe,textBaseline:J,translation:[x,k],backdrop:ii}})}return p}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-ut(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){let{position:e,ticks:{crossAlign:i,mirror:n,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width,c,h;return e==="left"?n?(h=this.right+r,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+r,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:e},left:i,top:n,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,o),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let n=this.ticks.findIndex(r=>r.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){let e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r,o,a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=n.length;r<o;++r){let l=n[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.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:t,ctx:e,options:{border:i,grid:n}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;let a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,h,u,d;this.isHorizontal()?(c=Ht(t,this.left,o)-o/2,h=Ht(t,this.right,a)+a/2,u=d=l):(u=Ht(t,this.top,o)-o/2,d=Ht(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,u),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,n=this._computeLabelArea();n&&He(i,n);let r=this.getLabelItems(t);for(let o of r){let a=o.options,l=o.font,c=o.label,h=o.textOffset;$t(i,c,0,h,l,a)}n&&$e(i)}drawTitle(){let{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;let r=X(i.font),o=st(i.padding),a=i.align,l=r.lineHeight/2;e==="bottom"||e==="center"||E(e)?(l+=o.bottom,B(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;let{titleX:c,titleY:h,maxWidth:u,rotation:d}=Ku(this,l,e,a);$t(t,i.text,0,0,r,{color:i.color,maxWidth:u,rotation:d,textAlign:Ju(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,e=t.ticks&&t.ticks.z||0,i=P(t.grid&&t.grid.z,-1),n=P(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==s.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[],r,o;for(r=0,o=e.length;r<o;++r){let a=e[r];a[i]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){let e=this.options.ticks.setContext(this.getContext(t));return X(e.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Ke=class{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let e=Object.getPrototypeOf(t),i;ed(e)&&(i=this.register(e));let n=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in n||(n[r]=t,Qu(t,o,i),this.override&&j.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in j[n]&&(delete j[n][i],this.override&&delete ie[i])}};function Qu(s,t,e){let i=me(Object.create(null),[e?j.get(e):{},j.get(t),s.defaults]);j.set(t,i),s.defaultRoutes&&td(t,s.defaultRoutes),s.descriptors&&j.describe(t,s.descriptors)}function td(s,t){Object.keys(t).forEach(e=>{let i=e.split("."),n=i.pop(),r=[s].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");j.route(r,n,l,a)})}function ed(s){return"id"in s&&"defaults"in s}var gr=class{constructor(){this.controllers=new Ke(dt,"datasets",!0),this.elements=new Ke(ft,"elements"),this.plugins=new Ke(Object,"plugins"),this.scales=new Ke(Ce,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{let r=i||this._getRegistryForType(n);i||r.isForType(n)||r===this.plugins&&n.id?this._exec(t,r,n):N(n,o=>{let a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){let n=ws(t);W(i["before"+n],[],i),e[t](i),W(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return n}},Nt=new gr,mr=class{constructor(){this._init=void 0}notify(t,e,i,n){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let r=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,e,i,n){n=n||{};for(let r of t){let o=r.plugin,a=o[i],l=[e,n,r.options];if(W(a,l,o)===!1&&n.cancelable)return!1}return!0}invalidate(){I(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,n=P(i.options&&i.options.plugins,{}),r=sd(i);return n===!1&&!e?[]:nd(t,r,n,e)}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,n=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}};function sd(s){let t={},e=[],i=Object.keys(Nt.plugins.items);for(let r=0;r<i.length;r++)e.push(Nt.getPlugin(i[r]));let n=s.plugins||[];for(let r=0;r<n.length;r++){let o=n[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function id(s,t){return!t&&s===!1?null:s===!0?{}:s}function nd(s,{plugins:t,localIds:e},i,n){let r=[],o=s.getContext();for(let a of t){let l=a.id,c=id(i[l],n);c!==null&&r.push({plugin:a,options:rd(s.config,{plugin:a,local:e[l]},c,o)})}return r}function rd(s,{plugin:t,local:e},i,n){let r=s.pluginScopeKeys(t),o=s.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),s.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function pr(s,t){let e=j.datasets[s]||{};return((t.datasets||{})[s]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function od(s,t){let e=s;return s==="_index_"?e=t:s==="_value_"&&(e=t==="x"?"y":"x"),e}function ad(s,t){return s===t?"_index_":"_value_"}function oa(s){if(s==="x"||s==="y"||s==="r")return s}function ld(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function br(s,...t){if(oa(s))return s;for(let e of t){let i=e.axis||ld(e.position)||s.length>1&&oa(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function aa(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function cd(s,t){if(t.data&&t.data.datasets){let e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return aa(s,"x",e[0])||aa(s,"y",e[0])}return{}}function hd(s,t){let e=ie[s.type]||{scales:{}},i=t.scales||{},n=pr(s.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{let a=i[o];if(!E(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);let l=br(o,a,cd(o,s),j.scales[a.type]),c=ad(l,n),h=e.scales||{};r[o]=pe(Object.create(null),[{axis:l},a,h[l],h[c]])}),s.data.datasets.forEach(o=>{let a=o.type||s.type,l=o.indexAxis||pr(a,t),h=(ie[a]||{}).scales||{};Object.keys(h).forEach(u=>{let d=od(u,l),f=o[d+"AxisID"]||d;r[f]=r[f]||Object.create(null),pe(r[f],[{axis:d},i[f],h[u]])})}),Object.keys(r).forEach(o=>{let a=r[o];pe(a,[j.scales[a.type],j.scale])}),r}function Ya(s){let t=s.options||(s.options={});t.plugins=P(t.plugins,{}),t.scales=hd(s,t)}function Za(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function ud(s){return s=s||{},s.data=Za(s.data),Ya(s),s}var la=new Map,qa=new Set;function Bi(s,t){let e=la.get(s);return e||(e=t(),la.set(s,e),qa.add(e)),e}var Fs=(s,t,e)=>{let i=Lt(t,e);i!==void 0&&s.add(i)},yr=class{constructor(t){this._config=ud(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Za(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Ya(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Bi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Bi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Bi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return Bi(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){let{options:n,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;let l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>Fs(l,t,u))),h.forEach(u=>Fs(l,n,u)),h.forEach(u=>Fs(l,ie[r]||{},u)),h.forEach(u=>Fs(l,j,u)),h.forEach(u=>Fs(l,Mi,u))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qa.has(e)&&o.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,ie[e]||{},j.datasets[e]||{},{type:e},j,Mi]}resolveNamedOptions(t,e,i,n=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=ca(this._resolverCache,t,n),l=o;if(fd(o,e)){r.$shared=!1,i=It(i)?i():i;let c=this.createResolver(t,i,a);l=ee(o,i,c)}for(let c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],n){let{resolver:r}=ca(this._resolverCache,t,i);return E(e)?ee(r,e,void 0,n):r}};function ca(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));let n=e.join(),r=i.get(n);return r||(r={resolver:Ds(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,r)),r}var dd=s=>E(s)&&Object.getOwnPropertyNames(s).some(t=>It(s[t]));function fd(s,t){let{isScriptable:e,isIndexable:i}=Ci(s);for(let n of t){let r=e(n),o=i(n),a=(o||r)&&s[n];if(r&&(It(a)||dd(a))||o&&B(a))return!0}return!1}var gd="4.5.1",md=["top","bottom","left","right","chartArea"];function ha(s,t){return s==="top"||s==="bottom"||md.indexOf(s)===-1&&t==="x"}function ua(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function da(s){let t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),W(e&&e.onComplete,[s],t)}function pd(s){let t=s.chart,e=t.options.animation;W(e&&e.onProgress,[s],t)}function Ga(s){return Cs()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}var Yi={},fa=s=>{let t=Ga(s);return Object.values(Yi).filter(e=>e.canvas===t).pop()};function bd(s,t,e){let i=Object.keys(s);for(let n of i){let r=+n;if(r>=t){let o=s[n];delete s[n],(e>0||r>t)&&(s[r+e]=o)}}}function yd(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}var xt=class{static register(...t){Nt.add(...t),ga()}static unregister(...t){Nt.remove(...t),ga()}constructor(t,e){let i=this.config=new yr(e),n=Ga(t),r=fa(n);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 o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Vu(n)),this.platform.updateConfig(i);let a=this.platform.acquireContext(n,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Cn(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=o,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 mr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=zn(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],Yi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Yt.listen(this,"complete",da),Yt.listen(this,"progress",pd),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return I(t)?e&&r?r:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Nt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ii(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ti(this.canvas,this.ctx),this}stop(){return Yt.stop(this),this}resize(t,e){Yt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ii(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),W(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};N(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{}),r=[];e&&(r=r.concat(Object.keys(e).map(o=>{let a=e[o],l=br(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),N(r,o=>{let a=o.options,l=a.id,c=br(l,a),h=P(a.type,o.dtype);(a.position===void 0||ha(a.position,c)!==ha(o.dposition))&&(a.position=o.dposition),n[l]=!0;let u=null;if(l in i&&i[l].type===h)u=i[l];else{let d=Nt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(a,t)}),N(n,(o,a)=>{o||delete i[a]}),N(i,o=>{ot.configure(this,o,o.options),ot.addBox(this,o)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,r)=>n.index-r.index),i>e){for(let n=e;n<i;++n)this._destroyDatasetMeta(n);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(ua("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){let r=e[i],o=this.getDatasetMeta(i),a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||pr(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{let l=Nt.getController(a),{datasetElementType:c,dataElementType:h}=j.datasets[a];Object.assign(l,{dataElementType:Nt.getElement(h),datasetElementType:c&&Nt.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){N(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.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 o=0;for(let c=0,h=this.data.datasets.length;c<h;c++){let{controller:u}=this.getDatasetMeta(c),d=!n&&r.indexOf(u)===-1;u.buildOrUpdateElements(d),o=Math.max(+u.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),n||N(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ua("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){N(this.scales,t=>{ot.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!fi(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:n,count:r}of e){let o=i==="_removeElements"?-r:r;bd(t,n,o)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),n=i(0);for(let r=1;r<e;r++)if(!fi(n,i(r)))return;return Array.from(n).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;ot.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],N(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,r)=>{n._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,It(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Yt.has(this)?this.attached&&!Yt.running(this)&&Yt.start(this):(this.draw(),da({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let e=this._sortedMetasets,i=[],n,r;for(n=0,r=e.length;n<r;++n){let o=e[n];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=zi(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(n&&He(e,n),t.controller.draw(),n&&$e(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Tt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){let r=_u.modes[e];return typeof r=="function"?r(this,t,i,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,n=i.filter(r=>r&&r._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Ft(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let n=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,n);be(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Yt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ti(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Yi[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,e=this.platform,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},n=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};N(this.options.events,r=>i(r,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)},o,a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){N(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},N(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let n=i?"set":"remove",r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];let c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{let a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!We(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){let n=this.options.hover,r=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;let r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:n=[],options:r}=this,o=e,a=this._getActiveElements(t,n,i,o),l=An(t),c=yd(t,this._lastEvent,i,l);i&&(this._lastEvent=null,W(r.onHover,[t,a,this],this),l&&W(r.onClick,[t,a,this],this));let h=!We(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}};S(xt,"defaults",j),S(xt,"instances",Yi),S(xt,"overrides",ie),S(xt,"registry",Nt),S(xt,"version",gd),S(xt,"getChart",fa);function ga(){return N(xt.instances,s=>s._plugins.invalidate())}function xd(s,t,e){let{startAngle:i,x:n,y:r,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,u=Math.min(c/o,tt(i-e));if(s.beginPath(),s.arc(n,r,o-c/2,i+u/2,e-u/2),a>0){let d=Math.min(c/a,tt(i-e));s.arc(n,r,a+c/2,e-d/2,i+d/2,!0)}else{let d=Math.min(c/2,o*tt(i-e));if(h==="round")s.arc(n,r,d,e-F/2,i+F/2,!0);else if(h==="bevel"){let f=2*d*d,g=-f*Math.cos(e+F/2)+n,m=-f*Math.sin(e+F/2)+r,p=f*Math.cos(i+F/2)+n,b=f*Math.sin(i+F/2)+r;s.lineTo(g,m),s.lineTo(p,b)}}s.closePath(),s.moveTo(0,0),s.rect(0,0,s.canvas.width,s.canvas.height),s.clip("evenodd")}function _d(s,t,e){let{startAngle:i,pixelMargin:n,x:r,y:o,outerRadius:a,innerRadius:l}=t,c=n/a;s.beginPath(),s.arc(r,o,a,i-c,e+c),l>n?(c=n/l,s.arc(r,o,l,e+c,i-c,!0)):s.arc(r,o,n,e+q,i-q),s.closePath(),s.clip()}function wd(s){return Os(s,["outerStart","outerEnd","innerStart","innerEnd"])}function kd(s,t,e,i){let n=wd(s.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{let c=(e-Math.min(r,l))*i/2;return K(l,0,Math.min(r,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:K(n.innerStart,0,o),innerEnd:K(n.innerEnd,0,o)}}function je(s,t,e,i){return{x:e+s*Math.cos(t),y:i+s*Math.sin(t)}}function Xi(s,t,e,i,n,r){let{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+i+e-c,0),d=h>0?h+i+e+c:0,f=0,g=n-l;if(i){let V=h>0?h-i:0,U=u>0?u-i:0,G=(V+U)/2,St=G!==0?g*G/(G+i):g;f=(g-St)/2}let m=Math.max(.001,g*u-e/F)/u,p=(g-m)/2,b=l+p+f,y=n-p-f,{outerStart:_,outerEnd:w,innerStart:x,innerEnd:k}=kd(t,d,u,y-b),v=u-_,M=u-w,O=b+_/v,D=y-w/M,A=d+x,L=d+k,J=b+x/A,ht=y-k/L;if(s.beginPath(),r){let V=(O+D)/2;if(s.arc(o,a,u,O,V),s.arc(o,a,u,V,D),w>0){let rt=je(M,D,o,a);s.arc(rt.x,rt.y,w,D,y+q)}let U=je(L,y,o,a);if(s.lineTo(U.x,U.y),k>0){let rt=je(L,ht,o,a);s.arc(rt.x,rt.y,k,y+q,ht+Math.PI)}let G=(y-k/d+(b+x/d))/2;if(s.arc(o,a,d,y-k/d,G,!0),s.arc(o,a,d,G,b+x/d,!0),x>0){let rt=je(A,J,o,a);s.arc(rt.x,rt.y,x,J+Math.PI,b-q)}let St=je(v,b,o,a);if(s.lineTo(St.x,St.y),_>0){let rt=je(v,O,o,a);s.arc(rt.x,rt.y,_,b-q,O)}}else{s.moveTo(o,a);let V=Math.cos(O)*u+o,U=Math.sin(O)*u+a;s.lineTo(V,U);let G=Math.cos(D)*u+o,St=Math.sin(D)*u+a;s.lineTo(G,St)}s.closePath()}function vd(s,t,e,i,n){let{fullCircles:r,startAngle:o,circumference:a}=t,l=t.endAngle;if(r){Xi(s,t,e,i,l,n);for(let c=0;c<r;++c)s.fill();isNaN(a)||(l=o+(a%H||H))}return Xi(s,t,e,i,l,n),s.fill(),l}function Sd(s,t,e,i,n){let{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:d,borderRadius:f}=l,g=l.borderAlign==="inner";if(!c)return;s.setLineDash(u||[]),s.lineDashOffset=d,g?(s.lineWidth=c*2,s.lineJoin=h||"round"):(s.lineWidth=c,s.lineJoin=h||"bevel");let m=t.endAngle;if(r){Xi(s,t,e,i,m,n);for(let p=0;p<r;++p)s.stroke();isNaN(a)||(m=o+(a%H||H))}g&&_d(s,t,m),l.selfJoin&&m-o>=F&&f===0&&h!=="miter"&&xd(s,t,m),r||(Xi(s,t,e,i,m,n),s.stroke())}var Me=class extends ft{constructor(e){super();S(this,"circumference");S(this,"endAngle");S(this,"fullCircles");S(this,"innerRadius");S(this,"outerRadius");S(this,"pixelMargin");S(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,e&&Object.assign(this,e)}inRange(e,i,n){let r=this.getProps(["x","y"],n),{angle:o,distance:a}=bi(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,g=P(d,c-l),m=xe(o,l,c)&&l!==c,p=g>=H||m,b=Dt(a,h+f,u+f);return p&&b}getCenterPoint(e){let{x:i,y:n,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,u=(r+o)/2,d=(a+l+h+c)/2;return{x:i+Math.cos(u)*d,y:n+Math.sin(u)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:i,circumference:n}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=n>H?Math.floor(n/H):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);let c=1-Math.sin(Math.min(F,n||0)),h=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,vd(e,this,h,o,a),Sd(e,this,h,o,a),e.restore()}};S(Me,"id","arc"),S(Me,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),S(Me,"defaultRoutes",{backgroundColor:"backgroundColor"}),S(Me,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Xa(s,t,e=t){s.lineCap=P(e.borderCapStyle,t.borderCapStyle),s.setLineDash(P(e.borderDash,t.borderDash)),s.lineDashOffset=P(e.borderDashOffset,t.borderDashOffset),s.lineJoin=P(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=P(e.borderWidth,t.borderWidth),s.strokeStyle=P(e.borderColor,t.borderColor)}function Md(s,t,e){s.lineTo(e.x,e.y)}function Td(s){return s.stepped?Bn:s.tension||s.cubicInterpolationMode==="monotone"?Hn:Md}function Ja(s,t,e={}){let i=s.length,{start:n=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(n,o),c=Math.min(r,a),h=n<o&&r<o||n>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function Od(s,t,e,i){let{points:n,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Ja(n,e,i),h=Td(r),{move:u=!0,reverse:d}=i||{},f,g,m;for(f=0;f<=c;++f)g=n[(a+(d?c-f:f))%o],!g.skip&&(u?(s.moveTo(g.x,g.y),u=!1):h(s,m,g,d,r.stepped),m=g);return l&&(g=n[(a+(d?c:0))%o],h(s,m,g,d,r.stepped)),!!l}function Dd(s,t,e,i){let n=t.points,{count:r,start:o,ilen:a}=Ja(n,e,i),{move:l=!0,reverse:c}=i||{},h=0,u=0,d,f,g,m,p,b,y=w=>(o+(c?a-w:w))%r,_=()=>{m!==p&&(s.lineTo(h,p),s.lineTo(h,m),s.lineTo(h,b))};for(l&&(f=n[y(0)],s.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=n[y(d)],f.skip)continue;let w=f.x,x=f.y,k=w|0;k===g?(x<m?m=x:x>p&&(p=x),h=(u*h+w)/++u):(_(),s.lineTo(w,x),g=k,u=0,m=p=x),b=x}_()}function xr(s){let t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Dd:Od}function Cd(s){return s.stepped?Gn:s.tension||s.cubicInterpolationMode==="monotone"?Xn:Bt}function Pd(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),Xa(s,t.options),s.stroke(n)}function Ad(s,t,e,i){let{segments:n,options:r}=t,o=xr(t);for(let a of n)Xa(s,r,a.style),s.beginPath(),o(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}var Id=typeof Path2D=="function";function Ed(s,t,e,i){Id&&!t.options.segment?Pd(s,t,e,i):Ad(s,t,e,i)}var zt=class extends ft{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let n=i.spanGaps?this._loop:this._fullLoop;Yn(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Jn(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,n=t[e],r=this.points,o=Ni(this,{property:e,start:n,end:n});if(!o.length)return;let a=[],l=Cd(i),c,h;for(c=0,h=o.length;c<h;++c){let{start:u,end:d}=o[c],f=r[u],g=r[d];if(f===g){a.push(f);continue}let m=Math.abs((n-f[e])/(g[e]-f[e])),p=l(f,g,m,i.stepped);p[e]=t[e],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,e,i){return xr(this)(t,this,e,i)}path(t,e,i){let n=this.segments,r=xr(this),o=this._loop;e=e||0,i=i||this.points.length-e;for(let a of n)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,n){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Ed(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};S(zt,"id","line"),S(zt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),S(zt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),S(zt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ma(s,t,e,i){let n=s.options,{[e]:r}=s.getProps([e],i);return Math.abs(t-r)<n.radius+n.hitRadius}var Xe=class extends ft{constructor(e){super();S(this,"parsed");S(this,"skip");S(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,n){let r=this.options,{x:o,y:a}=this.getProps(["x","y"],n);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return ma(this,e,"x",i)}inYRange(e,i){return ma(this,e,"y",i)}getCenterPoint(e){let{x:i,y:n}=this.getProps(["x","y"],e);return{x:i,y:n}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);let n=i&&e.borderWidth||0;return(i+n)*2}draw(e,i){let n=this.options;this.skip||n.radius<.1||!Tt(this,i,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Ts(e,n,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};S(Xe,"id","point"),S(Xe,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),S(Xe,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ka(s,t){let{x:e,y:i,base:n,width:r,height:o}=s.getProps(["x","y","base","width","height"],t),a,l,c,h,u;return s.horizontal?(u=o/2,a=Math.min(e,n),l=Math.max(e,n),c=i-u,h=i+u):(u=r/2,a=e-u,l=e+u,c=Math.min(i,n),h=Math.max(i,n)),{left:a,top:c,right:l,bottom:h}}function re(s,t,e,i){return s?0:K(t,e,i)}function Ld(s,t,e){let i=s.options.borderWidth,n=s.borderSkipped,r=Di(i);return{t:re(n.top,r.top,0,e),r:re(n.right,r.right,0,t),b:re(n.bottom,r.bottom,0,e),l:re(n.left,r.left,0,t)}}function Fd(s,t,e){let{enableBorderRadius:i}=s.getProps(["enableBorderRadius"]),n=s.options.borderRadius,r=jt(n),o=Math.min(t,e),a=s.borderSkipped,l=i||E(n);return{topLeft:re(!l||a.top||a.left,r.topLeft,0,o),topRight:re(!l||a.top||a.right,r.topRight,0,o),bottomLeft:re(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:re(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Rd(s){let t=Ka(s),e=t.right-t.left,i=t.bottom-t.top,n=Ld(s,e/2,i/2),r=Fd(s,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:i-n.t-n.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,r.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(n.b,n.r))}}}}function rr(s,t,e,i){let n=t===null,r=e===null,a=s&&!(n&&r)&&Ka(s,i);return a&&(n||Dt(t,a.left,a.right))&&(r||Dt(e,a.top,a.bottom))}function Nd(s){return s.topLeft||s.topRight||s.bottomLeft||s.bottomRight}function zd(s,t){s.rect(t.x,t.y,t.w,t.h)}function or(s,t,e={}){let i=s.x!==e.x?-t:0,n=s.y!==e.y?-t:0,r=(s.x+s.w!==e.x+e.w?t:0)-i,o=(s.y+s.h!==e.y+e.h?t:0)-n;return{x:s.x+i,y:s.y+n,w:s.w+r,h:s.h+o,radius:s.radius}}var Je=class extends ft{constructor(t){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,t&&Object.assign(this,t)}draw(t){let{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:r,outer:o}=Rd(this),a=Nd(o.radius)?we:zd;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,or(o,e,r)),t.clip(),a(t,or(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,or(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return rr(this,t,e,i)}inXRange(t,e){return rr(this,t,null,e)}inYRange(t,e){return rr(this,null,t,e)}getCenterPoint(t){let{x:e,y:i,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+n)/2:e,y:r?i:(i+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};S(Je,"id","bar"),S(Je,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),S(Je,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Vd=Object.freeze({__proto__:null,ArcElement:Me,BarElement:Je,LineElement:zt,PointElement:Xe}),_r=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],pa=_r.map(s=>s.replace("rgb(","rgba(").replace(")",", 0.5)"));function Qa(s){return _r[s%_r.length]}function tl(s){return pa[s%pa.length]}function Wd(s,t){return s.borderColor=Qa(t),s.backgroundColor=tl(t),++t}function Bd(s,t){return s.backgroundColor=s.data.map(()=>Qa(t++)),t}function Hd(s,t){return s.backgroundColor=s.data.map(()=>tl(t++)),t}function $d(s){let t=0;return(e,i)=>{let n=s.getDatasetMeta(i).controller;n instanceof qt?t=Bd(e,t):n instanceof Oe?t=Hd(e,t):n&&(t=Wd(e,t))}}function ba(s){let t;for(t in s)if(s[t].borderColor||s[t].backgroundColor)return!0;return!1}function jd(s){return s&&(s.borderColor||s.backgroundColor)}function Ud(){return j.borderColor!=="rgba(0,0,0,0.1)"||j.backgroundColor!=="rgba(0,0,0,0.1)"}var Yd={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(s,t,e){if(!e.enabled)return;let{data:{datasets:i},options:n}=s.config,{elements:r}=n,o=ba(i)||jd(n)||r&&ba(r)||Ud();if(!e.forceOverride&&o)return;let a=$d(s);i.forEach(a)}};function Zd(s,t,e,i,n){let r=n.samples||i;if(r>=e)return s.slice(t,t+e);let o=[],a=(e-2)/(r-2),l=0,c=t+e-1,h=t,u,d,f,g,m;for(o[l++]=s[h],u=0;u<r-2;u++){let p=0,b=0,y,_=Math.floor((u+1)*a)+1+t,w=Math.min(Math.floor((u+2)*a)+1,e)+t,x=w-_;for(y=_;y<w;y++)p+=s[y].x,b+=s[y].y;p/=x,b/=x;let k=Math.floor(u*a)+1+t,v=Math.min(Math.floor((u+1)*a)+1,e)+t,{x:M,y:O}=s[h];for(f=g=-1,y=k;y<v;y++)g=.5*Math.abs((M-p)*(s[y].y-O)-(M-s[y].x)*(b-O)),g>f&&(f=g,d=s[y],m=y);o[l++]=d,h=m}return o[l++]=s[c],o}function qd(s,t,e,i){let n=0,r=0,o,a,l,c,h,u,d,f,g,m,p=[],b=t+e-1,y=s[t].x,w=s[b].x-y;for(o=t;o<t+e;++o){a=s[o],l=(a.x-y)/w*i,c=a.y;let x=l|0;if(x===h)c<g?(g=c,u=o):c>m&&(m=c,d=o),n=(r*n+a.x)/++r;else{let k=o-1;if(!I(u)&&!I(d)){let v=Math.min(u,d),M=Math.max(u,d);v!==f&&v!==k&&p.push({...s[v],x:n}),M!==f&&M!==k&&p.push({...s[M],x:n})}o>0&&k!==f&&p.push(s[k]),p.push(a),h=x,r=0,g=m=c,u=d=f=o}}return p}function el(s){if(s._decimated){let t=s._data;delete s._decimated,delete s._data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function ya(s){s.data.datasets.forEach(t=>{el(t)})}function Gd(s,t){let e=t.length,i=0,n,{iScale:r}=s,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=K(Mt(t,r.axis,o).lo,0,e-1)),c?n=K(Mt(t,r.axis,a).hi+1,i,e)-i:n=e-i,{start:i,count:n}}var Xd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(s,t,e)=>{if(!e.enabled){ya(s);return}let i=s.width;s.data.datasets.forEach((n,r)=>{let{_data:o,indexAxis:a}=n,l=s.getDatasetMeta(r),c=o||n.data;if(ke([a,s.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=s.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||s.options.parsing)return;let{start:u,count:d}=Gd(l,c),f=e.threshold||4*i;if(d<=f){el(n);return}I(o)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(e.algorithm){case"lttb":g=Zd(c,u,d,i,e);break;case"min-max":g=qd(c,u,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=g})},destroy(s){ya(s)}};function Jd(s,t,e){let i=s.segments,n=s.points,r=t.points,o=[];for(let a of i){let{start:l,end:c}=a;c=Qi(l,c,n);let h=wr(e,n[l],n[c],a.loop);if(!t.segments){o.push({source:a,target:h,start:n[l],end:n[c]});continue}let u=Ni(t,h);for(let d of u){let f=wr(e,r[d.start],r[d.end],d.loop),g=Ri(a,n,f);for(let m of g)o.push({source:m,target:d,start:{[e]:xa(h,f,"start",Math.max)},end:{[e]:xa(h,f,"end",Math.min)}})}}return o}function wr(s,t,e,i){if(i)return;let n=t[s],r=e[s];return s==="angle"&&(n=tt(n),r=tt(r)),{property:s,start:n,end:r}}function Kd(s,t){let{x:e=null,y:i=null}=s||{},n=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Qi(o,a,n);let l=n[o],c=n[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Qi(s,t,e){for(;t>s;t--){let i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function xa(s,t,e,i){return s&&t?i(s[e],t[e]):s?s[e]:t?t[e]:0}function sl(s,t){let e=[],i=!1;return B(s)?(i=!0,e=s):e=Kd(s,t),e.length?new zt({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function _a(s){return s&&s.fill!==!1}function Qd(s,t,e){let n=s[t].fill,r=[t],o;if(!e)return n;for(;n!==!1&&r.indexOf(n)===-1;){if(!Y(n))return n;if(o=s[n],!o)return!1;if(o.visible)return n;r.push(n),n=o.fill}return!1}function tf(s,t,e){let i=rf(s);if(E(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return Y(n)&&Math.floor(n)===n?ef(i[0],t,n,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function ef(s,t,e,i){return(s==="-"||s==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function sf(s,t){let e=null;return s==="start"?e=t.bottom:s==="end"?e=t.top:E(s)?e=t.getPixelForValue(s.value):t.getBasePixel&&(e=t.getBasePixel()),e}function nf(s,t,e){let i;return s==="start"?i=e:s==="end"?i=t.options.reverse?t.min:t.max:E(s)?i=s.value:i=t.getBaseValue(),i}function rf(s){let t=s.options,e=t.fill,i=P(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function of(s){let{scale:t,index:e,line:i}=s,n=[],r=i.segments,o=i.points,a=af(t,e);a.push(sl({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){let c=r[l];for(let h=c.start;h<=c.end;h++)lf(n,o[h],a)}return new zt({points:n,options:{}})}function af(s,t){let e=[],i=s.getMatchingVisibleMetas("line");for(let n=0;n<i.length;n++){let r=i[n];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function lf(s,t,e){let i=[];for(let n=0;n<e.length;n++){let r=e[n],{first:o,last:a,point:l}=cf(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(s.push(l),!a)break}}s.push(...i)}function cf(s,t,e){let i=s.interpolate(t,e);if(!i)return{};let n=i[e],r=s.segments,o=s.points,a=!1,l=!1;for(let c=0;c<r.length;c++){let h=r[c],u=o[h.start][e],d=o[h.end][e];if(Dt(n,u,d)){a=n===u,l=n===d;break}}return{first:a,last:l,point:i}}var Ji=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){let{x:n,y:r,radius:o}=this;return e=e||{start:0,end:H},t.arc(n,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}};function hf(s){let{chart:t,fill:e,line:i}=s;if(Y(e))return uf(t,e);if(e==="stack")return of(s);if(e==="shape")return!0;let n=df(s);return n instanceof Ji?n:sl(n,i)}function uf(s,t){let e=s.getDatasetMeta(t);return e&&s.isDatasetVisible(t)?e.dataset:null}function df(s){return(s.scale||{}).getPointPositionForValue?gf(s):ff(s)}function ff(s){let{scale:t={},fill:e}=s,i=sf(e,t);if(Y(i)){let n=t.isHorizontal();return{x:n?i:null,y:n?null:i}}return null}function gf(s){let{scale:t,fill:e}=s,i=t.options,n=t.getLabels().length,r=i.reverse?t.max:t.min,o=nf(e,t,r),a=[];if(i.grid.circular){let l=t.getPointPositionForValue(0,r);return new Ji({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<n;++l)a.push(t.getPointPositionForValue(l,o));return a}function ar(s,t,e){let i=hf(t),{chart:n,index:r,line:o,scale:a,axis:l}=t,c=o.options,h=c.fill,u=c.backgroundColor,{above:d=u,below:f=u}=h||{},g=n.getDatasetMeta(r),m=zi(n,g);i&&o.points.length&&(He(s,e),mf(s,{line:o,target:i,above:d,below:f,area:e,scale:a,axis:l,clip:m}),$e(s))}function mf(s,t){let{line:e,target:i,above:n,below:r,area:o,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;s.save();let h=r;r!==n&&(c==="x"?(wa(s,i,o.top),lr(s,{line:e,target:i,color:n,scale:a,property:c,clip:l}),s.restore(),s.save(),wa(s,i,o.bottom)):c==="y"&&(ka(s,i,o.left),lr(s,{line:e,target:i,color:r,scale:a,property:c,clip:l}),s.restore(),s.save(),ka(s,i,o.right),h=n)),lr(s,{line:e,target:i,color:h,scale:a,property:c,clip:l}),s.restore()}function wa(s,t,e){let{segments:i,points:n}=t,r=!0,o=!1;s.beginPath();for(let a of i){let{start:l,end:c}=a,h=n[l],u=n[Qi(l,c,n)];r?(s.moveTo(h.x,h.y),r=!1):(s.lineTo(h.x,e),s.lineTo(h.x,h.y)),o=!!t.pathSegment(s,a,{move:o}),o?s.closePath():s.lineTo(u.x,e)}s.lineTo(t.first().x,e),s.closePath(),s.clip()}function ka(s,t,e){let{segments:i,points:n}=t,r=!0,o=!1;s.beginPath();for(let a of i){let{start:l,end:c}=a,h=n[l],u=n[Qi(l,c,n)];r?(s.moveTo(h.x,h.y),r=!1):(s.lineTo(e,h.y),s.lineTo(h.x,h.y)),o=!!t.pathSegment(s,a,{move:o}),o?s.closePath():s.lineTo(e,u.y)}s.lineTo(e,t.first().y),s.closePath(),s.clip()}function lr(s,t){let{line:e,target:i,property:n,color:r,scale:o,clip:a}=t,l=Jd(e,i,n);for(let{source:c,target:h,start:u,end:d}of l){let{style:{backgroundColor:f=r}={}}=c,g=i!==!0;s.save(),s.fillStyle=f,pf(s,o,a,g&&wr(n,u,d)),s.beginPath();let m=!!e.pathSegment(s,c),p;if(g){m?s.closePath():va(s,i,d,n);let b=!!i.pathSegment(s,h,{move:m,reverse:!0});p=m&&b,p||va(s,i,u,n)}s.closePath(),s.fill(p?"evenodd":"nonzero"),s.restore()}}function pf(s,t,e,i){let n=t.chart.chartArea,{property:r,start:o,end:a}=i||{};if(r==="x"||r==="y"){let l,c,h,u;r==="x"?(l=o,c=n.top,h=a,u=n.bottom):(l=n.left,c=o,h=n.right,u=a),s.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),u=Math.min(u,e.bottom)),s.rect(l,c,h-l,u-c),s.clip()}}function va(s,t,e,i){let n=t.interpolate(e,i);n&&s.lineTo(n.x,n.y)}var bf={id:"filler",afterDatasetsUpdate(s,t,e){let i=(s.data.datasets||[]).length,n=[],r,o,a,l;for(o=0;o<i;++o)r=s.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof zt&&(l={visible:s.isDatasetVisible(o),index:o,fill:tf(a,o,i),chart:s,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,n.push(l);for(o=0;o<i;++o)l=n[o],!(!l||l.fill===!1)&&(l.fill=Qd(n,o,e.propagate))},beforeDraw(s,t,e){let i=e.drawTime==="beforeDraw",n=s.getSortedVisibleDatasetMetas(),r=s.chartArea;for(let o=n.length-1;o>=0;--o){let a=n[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&ar(s.ctx,a,r))}},beforeDatasetsDraw(s,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let i=s.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){let r=i[n].$filler;_a(r)&&ar(s.ctx,r,s.chartArea)}},beforeDatasetDraw(s,t,e){let i=t.meta.$filler;!_a(i)||e.drawTime!=="beforeDatasetDraw"||ar(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Sa=(s,t)=>{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},yf=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index,Ki=class extends ft{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,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 t=this.options.labels||{},e=W(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,n=X(i.font),r=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Sa(i,r),c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(o,r,a,l)+10):(h=this.maxHeight,c=this._fitCols(o,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){let{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a,u=t;r.textAlign="left",r.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((g,m)=>{let p=i+e/2+r.measureText(g.text).width;(m===0||c[c.length-1]+p+2*a>o)&&(u+=h,c[c.length-(m>0?0:1)]=0,f+=h,d++),l[m]={left:0,top:f,row:d,width:p,height:n},c[c.length-1]+=p+a}),u}_fitCols(t,e,i,n){let{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=o-t,u=a,d=0,f=0,g=0,m=0;return this.legendItems.forEach((p,b)=>{let{itemWidth:y,itemHeight:_}=xf(i,e,r,p,n);b>0&&f+_+2*a>h&&(u+=d+a,c.push({width:d,height:f}),g+=d+a,m++,d=f=0),l[b]={left:g,top:f,col:m,width:y,height:_},d=Math.max(d,y),f+=_+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,o=ne(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=et(i,this.left+n,this.right-this.lineWidths[a]);for(let c of e)a!==c.row&&(a=c.row,l=et(i,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+n}else{let a=0,l=et(i,this.top+t+n,this.bottom-this.columnSizes[a].height);for(let c of e)c.col!==a&&(a=c.col,l=et(i,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=o.leftForLtr(o.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 t=this.ctx;He(t,this),this._draw(),$e(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:o}=t,a=j.color,l=ne(t.rtl,this.left,this.width),c=X(o.font),{padding:h}=o,u=c.size,d=u/2,f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:g,boxHeight:m,itemHeight:p}=Sa(o,u),b=function(k,v,M){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;n.save();let O=P(M.lineWidth,1);if(n.fillStyle=P(M.fillStyle,a),n.lineCap=P(M.lineCap,"butt"),n.lineDashOffset=P(M.lineDashOffset,0),n.lineJoin=P(M.lineJoin,"miter"),n.lineWidth=O,n.strokeStyle=P(M.strokeStyle,a),n.setLineDash(P(M.lineDash,[])),o.usePointStyle){let D={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:O},A=l.xPlus(k,g/2),L=v+d;Oi(n,D,A,L,o.pointStyleWidth&&g)}else{let D=v+Math.max((u-m)/2,0),A=l.leftForLtr(k,g),L=jt(M.borderRadius);n.beginPath(),Object.values(L).some(J=>J!==0)?we(n,{x:A,y:D,w:g,h:m,radius:L}):n.rect(A,D,g,m),n.fill(),O!==0&&n.stroke()}n.restore()},y=function(k,v,M){$t(n,M.text,k,v+p/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?f={x:et(r,this.left+h,this.right-i[0]),y:this.top+h+w,line:0}:f={x:this.left+h,y:et(r,this.top+w+h,this.bottom-e[0].height),line:0},Li(this.ctx,t.textDirection);let x=p+h;this.legendItems.forEach((k,v)=>{n.strokeStyle=k.fontColor,n.fillStyle=k.fontColor;let M=n.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),D=g+d+M,A=f.x,L=f.y;l.setWidth(this.width),_?v>0&&A+D+h>this.right&&(L=f.y+=x,f.line++,A=f.x=et(r,this.left+h,this.right-i[f.line])):v>0&&L+x>this.bottom&&(A=f.x=A+e[f.line].width+h,f.line++,L=f.y=et(r,this.top+w+h,this.bottom-e[f.line].height));let J=l.x(A);if(b(J,L,k),A=Vn(O,A+g+d,_?A+D:this.right,t.rtl),y(l.x(A),L,k),_)f.x+=D+h;else if(typeof k.text!="string"){let ht=c.lineHeight;f.y+=il(k,ht)+h}else f.y+=x}),Fi(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,i=X(e.font),n=st(e.padding);if(!e.display)return;let r=ne(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=n.top+l,h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=et(t.align,u,this.right-d);else{let g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);h=c+et(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}let f=et(a,u,u+d);o.textAlign=r.textAlign(Ss(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,$t(o,e.text,f,h,i)}_computeTitleHeight(){let t=this.options.title,e=X(t.font),i=st(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(Dt(t,this.left,this.right)&&Dt(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(n=r[i],Dt(t,n.left,n.left+n.width)&&Dt(e,n.top,n.top+n.height))return this.legendItems[i]}return null}handleEvent(t){let e=this.options;if(!kf(t.type,e))return;let i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let n=this._hoveredItem,r=yf(n,i);n&&!r&&W(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!r&&W(e.onHover,[t,i,this],this)}else i&&W(e.onClick,[t,i,this],this)}};function xf(s,t,e,i,n){let r=_f(i,s,t,e),o=wf(n,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function _f(s,t,e,i){let n=s.text;return n&&typeof n!="string"&&(n=n.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(n).width}function wf(s,t,e){let i=s;return typeof t.text!="string"&&(i=il(t,e)),i}function il(s,t){let e=s.text?s.text.length:0;return t*e}function kf(s,t){return!!((s==="mousemove"||s==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(s==="click"||s==="mouseup"))}var vf={id:"legend",_element:Ki,start(s,t,e){let i=s.legend=new Ki({ctx:s.ctx,options:e,chart:s});ot.configure(s,i,e),ot.addBox(s,i)},stop(s){ot.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,t,e){let i=s.legend;ot.configure(s,i,e),i.options=e},afterUpdate(s){let t=s.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(s,t){t.replay||s.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,t,e){let i=t.datasetIndex,n=e.chart;n.isDatasetVisible(i)?(n.hide(i),t.hidden=!0):(n.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){let t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:r,useBorderRadius:o,borderRadius:a}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(e?0:void 0),h=st(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,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:i||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}},Us=class extends ft{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,e){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let n=B(i.text)?i.text.length:1;this._padding=st(i.padding);let r=n*X(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:i,bottom:n,right:r,options:o}=this,a=o.align,l=0,c,h,u;return this.isHorizontal()?(h=et(a,i,r),u=e+t,c=r-i):(o.position==="left"?(h=i+t,u=et(a,n,e),l=F*-.5):(h=r-t,u=et(a,e,n),l=F*.5),c=n-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=X(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);$t(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Ss(e.align),textBaseline:"middle",translation:[o,a]})}};function Sf(s,t){let e=new Us({ctx:s.ctx,options:t,chart:s});ot.configure(s,e,t),ot.addBox(s,e),s.titleBlock=e}var Mf={id:"title",_element:Us,start(s,t,e){Sf(s,e)},stop(s){let t=s.titleBlock;ot.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){let i=s.titleBlock;ot.configure(s,i,e),i.options=e},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}},Hi=new WeakMap,Tf={id:"subtitle",start(s,t,e){let i=new Us({ctx:s.ctx,options:e,chart:s});ot.configure(s,i,e),ot.addBox(s,i),Hi.set(s,i)},stop(s){ot.removeBox(s,Hi.get(s)),Hi.delete(s)},beforeUpdate(s,t,e){let i=Hi.get(s);ot.configure(s,i,e),i.options=e},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}},zs={average(s){if(!s.length)return!1;let t,e,i=new Set,n=0,r=0;for(t=0,e=s.length;t<e;++t){let a=s[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();i.add(l.x),n+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:n/r}},nearest(s,t){if(!s.length)return!1;let e=t.x,i=t.y,n=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=s.length;r<o;++r){let l=s[r].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=_s(t,c);h<n&&(n=h,a=l)}}if(a){let l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Rt(s,t){return t&&(B(t)?Array.prototype.push.apply(s,t):s.push(t)),s}function Zt(s){return(typeof s=="string"||s instanceof String)&&s.indexOf(`
`)>-1?s.split(`
`):s}function Of(s,t){let{element:e,datasetIndex:i,index:n}=t,r=s.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:s,label:o,parsed:r.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function Ma(s,t){let e=s.chart.ctx,{body:i,footer:n,title:r}=s,{boxWidth:o,boxHeight:a}=t,l=X(t.bodyFont),c=X(t.titleFont),h=X(t.footerFont),u=r.length,d=n.length,f=i.length,g=st(t.padding),m=g.height,p=0,b=i.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(b+=s.beforeBody.length+s.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){let w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*w+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(m+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let y=0,_=function(w){p=Math.max(p,e.measureText(w).width+y)};return e.save(),e.font=c.string,N(s.title,_),e.font=l.string,N(s.beforeBody.concat(s.afterBody),_),y=t.displayColors?o+2+t.boxPadding:0,N(i,w=>{N(w.before,_),N(w.lines,_),N(w.after,_)}),y=0,e.font=h.string,N(s.footer,_),e.restore(),p+=g.width,{width:p,height:m}}function Df(s,t){let{y:e,height:i}=t;return e<i/2?"top":e>s.height-i/2?"bottom":"center"}function Cf(s,t,e,i){let{x:n,width:r}=i,o=e.caretSize+e.caretPadding;if(s==="left"&&n+r+o>t.width||s==="right"&&n-r-o<0)return!0}function Pf(s,t,e,i){let{x:n,width:r}=e,{width:o,chartArea:{left:a,right:l}}=s,c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),Cf(c,s,t,e)&&(c="center"),c}function Ta(s,t,e){let i=e.yAlign||t.yAlign||Df(s,e);return{xAlign:e.xAlign||t.xAlign||Pf(s,t,e,i),yAlign:i}}function Af(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function If(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function Oa(s,t,e,i){let{caretSize:n,caretPadding:r,cornerRadius:o}=s,{xAlign:a,yAlign:l}=e,c=n+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=jt(o),g=Af(t,a),m=If(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+n:a==="right"&&(g+=Math.max(u,f)+n),{x:K(g,0,i.width-t.width),y:K(m,0,i.height-t.height)}}function $i(s,t,e){let i=st(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function Da(s){return Rt([],Zt(s))}function Ef(s,t,e){return Ft(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ca(s,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}var nl={beforeTitle:Ot,title(s){if(s.length>0){let t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ot,beforeBody:Ot,beforeLabel:Ot,label(s){if(this&&this.options&&this.options.mode==="dataset")return s.label+": "+s.formattedValue||s.formattedValue;let t=s.dataset.label||"";t&&(t+=": ");let e=s.formattedValue;return I(e)||(t+=e),t},labelColor(s){let e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(s){let e=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ot,afterBody:Ot,beforeFooter:Ot,footer:Ot,afterFooter:Ot};function lt(s,t,e,i){let n=s[t].call(e,i);return typeof n>"u"?nl[t].call(e,i):n}var $s=class extends ft{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 e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Zi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Ef(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,n=lt(i,"beforeTitle",this,t),r=lt(i,"title",this,t),o=lt(i,"afterTitle",this,t),a=[];return a=Rt(a,Zt(n)),a=Rt(a,Zt(r)),a=Rt(a,Zt(o)),a}getBeforeBody(t,e){return Da(lt(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:i}=e,n=[];return N(t,r=>{let o={before:[],lines:[],after:[]},a=Ca(i,r);Rt(o.before,Zt(lt(a,"beforeLabel",this,r))),Rt(o.lines,lt(a,"label",this,r)),Rt(o.after,Zt(lt(a,"afterLabel",this,r))),n.push(o)}),n}getAfterBody(t,e){return Da(lt(e.callbacks,"afterBody",this,t))}getFooter(t,e){let{callbacks:i}=e,n=lt(i,"beforeFooter",this,t),r=lt(i,"footer",this,t),o=lt(i,"afterFooter",this,t),a=[];return a=Rt(a,Zt(n)),a=Rt(a,Zt(r)),a=Rt(a,Zt(o)),a}_createItems(t){let e=this._active,i=this.chart.data,n=[],r=[],o=[],a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Of(this.chart,e[l]));return t.filter&&(a=a.filter((h,u,d)=>t.filter(h,u,d,i))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,i))),N(a,h=>{let u=Ca(t.callbacks,h);n.push(lt(u,"labelColor",this,h)),r.push(lt(u,"labelPointStyle",this,h)),o.push(lt(u,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){let i=this.options.setContext(this.getContext()),n=this._active,r,o=[];if(!n.length)this.opacity!==0&&(r={opacity:0});else{let a=zs[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);let l=this._size=Ma(this,i),c=Object.assign({},a,l),h=Ta(this.chart,i,c),u=Oa(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){let r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){let{xAlign:n,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=jt(a),{x:d,y:f}=t,{width:g,height:m}=e,p,b,y,_,w,x;return r==="center"?(w=f+m/2,n==="left"?(p=d,b=p-o,_=w+o,x=w-o):(p=d+g,b=p+o,_=w-o,x=w+o),y=p):(n==="left"?b=d+Math.max(l,h)+o:n==="right"?b=d+g-Math.max(c,u)-o:b=this.caretX,r==="top"?(_=f,w=_-o,p=b-o,y=b+o):(_=f+m,w=_+o,p=b+o,y=b-o),x=_),{x1:p,x2:b,x3:y,y1:_,y2:w,y3:x}}drawTitle(t,e,i){let n=this.title,r=n.length,o,a,l;if(r){let c=ne(i.rtl,this.x,this.width);for(t.x=$i(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=X(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(n[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,n,r){let o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,h=X(r.bodyFont),u=$i(this,"left",r),d=n.x(u),f=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+f;if(r.usePointStyle){let m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=n.leftForLtr(d,c)+c/2,b=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Ts(t,m,p,b),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Ts(t,m,p,b)}else{t.lineWidth=E(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;let m=n.leftForLtr(d,c),p=n.leftForLtr(n.xPlus(d,1),c-2),b=jt(o.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,we(t,{x:m,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),we(t,{x:p,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let{body:n}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,u=X(i.bodyFont),d=u.lineHeight,f=0,g=ne(i.rtl,this.x,this.width),m=function(M){e.fillText(M,g.x(t.x+f),t.y+d/2),t.y+=d+r},p=g.textAlign(o),b,y,_,w,x,k,v;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=$i(this,p,i),e.fillStyle=i.bodyColor,N(this.beforeBody,m),f=a&&p!=="right"?o==="center"?c/2+h:c+2+h:0,w=0,k=n.length;w<k;++w){for(b=n[w],y=this.labelTextColors[w],e.fillStyle=y,N(b.before,m),_=b.lines,a&&_.length&&(this._drawColorBox(e,t,w,g,i),d=Math.max(u.lineHeight,l)),x=0,v=_.length;x<v;++x)m(_[x]),d=u.lineHeight;N(b.after,m)}f=0,d=u.lineHeight,N(this.afterBody,m),t.y-=r}drawFooter(t,e,i){let n=this.footer,r=n.length,o,a;if(r){let l=ne(i.rtl,this.x,this.width);for(t.x=$i(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=X(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(n[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){let{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:h}=i,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=jt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+u,l),o==="top"&&this.drawCaret(t,e,i,n),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),o==="center"&&r==="right"&&this.drawCaret(t,e,i,n),e.lineTo(a+c,l+h-g),e.quadraticCurveTo(a+c,l+h,a+c-g,l+h),o==="bottom"&&this.drawCaret(t,e,i,n),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),o==="center"&&r==="left"&&this.drawCaret(t,e,i,n),e.lineTo(a,l+u),e.quadraticCurveTo(a,l,a+u,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){let o=zs[t.position].call(this,this._active,this._eventPosition);if(!o)return;let a=this._size=Ma(this,t),l=Object.assign({},o,this._size),c=Ta(e,t,l),h=Oa(t,l,c,e);(n._to!==h.x||r._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let o=st(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),Li(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Fi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,n=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!We(i,n),o=this._positionChanged(n,e);(r||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!We(o,r)||a;return l&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){let r=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:i,caretY:n,options:r}=this,o=zs[r.position].call(this,t,e);return o!==!1&&(i!==o.x||n!==o.y)}};S($s,"positioners",zs);var Lf={id:"tooltip",_element:$s,positioners:zs,afterInit(s,t,e){e&&(s.tooltip=new $s({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){let t=s.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){let e=t.replay;s.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(s,t)=>t.bodyFont.size,boxWidth:(s,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:nl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ff=Object.freeze({__proto__:null,Colors:Yd,Decimation:Xd,Filler:bf,Legend:vf,SubTitle:Tf,Title:Mf,Tooltip:Lf}),Rf=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Nf(s,t,e,i){let n=s.indexOf(t);if(n===-1)return Rf(s,t,e,i);let r=s.lastIndexOf(t);return n!==r?e:n}var zf=(s,t)=>s===null?null:K(Math.round(s),0,t);function Pa(s){let t=this.getLabels();return s>=0&&s<t.length?t[s]:s}var Vs=class extends Ce{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let i=this.getLabels();for(let{index:n,label:r}of e)i[n]===r&&i.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(I(t))return null;let i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Nf(i,t,P(e,t),this._addedLabels),zf(e,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,n=[],r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){return Pa.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 e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};S(Vs,"id","category"),S(Vs,"defaults",{ticks:{callback:Pa}});function Vf(s,t){let e=[],{bounds:n,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=s,f=r||1,g=h-1,{min:m,max:p}=t,b=!I(o),y=!I(a),_=!I(c),w=(p-m)/(u+1),x=gi((p-m)/g/f)*f,k,v,M,O;if(x<1e-14&&!b&&!y)return[{value:m},{value:p}];O=Math.ceil(p/x)-Math.floor(m/x),O>g&&(x=gi(O*x/g/f)*f),I(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),n==="ticks"?(v=Math.floor(m/x)*x,M=Math.ceil(p/x)*x):(v=m,M=p),b&&y&&r&&En((a-o)/r,x/1e3)?(O=Math.round(Math.min((a-o)/x,h)),x=(a-o)/O,v=o,M=a):_?(v=b?o:v,M=y?a:M,O=c-1,x=(M-v)/O):(O=(M-v)/x,ye(O,Math.round(O),x/1e3)?O=Math.round(O):O=Math.ceil(O));let D=Math.max(pi(x),pi(v));k=Math.pow(10,I(l)?D:l),v=Math.round(v*k)/k,M=Math.round(M*k)/k;let A=0;for(b&&(d&&v!==o?(e.push({value:o}),v<o&&A++,ye(Math.round((v+A*x)*k)/k,o,Aa(o,w,s))&&A++):v<o&&A++);A<O;++A){let L=Math.round((v+A*x)*k)/k;if(y&&L>a)break;e.push({value:L})}return y&&d&&M!==a?e.length&&ye(e[e.length-1].value,a,Aa(a,w,s))?e[e.length-1].value=a:e.push({value:a}):(!y||M===a)&&e.push({value:M}),e}function Aa(s,t,{horizontal:e,minRotation:i}){let n=ut(i),r=(e?Math.sin(n):Math.cos(n))||.001,o=.75*t*(""+s).length;return Math.min(t/r,o)}var Qe=class extends Ce{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return I(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:n,max:r}=this,o=l=>n=e?n:l,a=l=>r=i?r:l;if(t){let l=yt(n),c=yt(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(n===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(n-l)}this.min=n,this.max=r}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=Vf(n,r);return t.bounds==="ticks"&&mi(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return _e(t,this.chart.options.locale,this.options.ticks.format)}},Ws=class extends Qe{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=Y(t)?t:0,this.max=Y(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=ut(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};S(Ws,"id","linear"),S(Ws,"defaults",{ticks:{callback:Ms.formatters.numeric}});var Ys=s=>Math.floor(Et(s)),Se=(s,t)=>Math.pow(10,Ys(s)+t);function Ia(s){return s/Math.pow(10,Ys(s))===1}function Ea(s,t,e){let i=Math.pow(10,e),n=Math.floor(s/i);return Math.ceil(t/i)-n}function Wf(s,t){let e=t-s,i=Ys(e);for(;Ea(s,t,i)>10;)i++;for(;Ea(s,t,i)<10;)i--;return Math.min(i,Ys(s))}function Bf(s,{min:t,max:e}){t=at(s.min,t);let i=[],n=Ys(t),r=Wf(t,e),o=r<0?Math.pow(10,Math.abs(r)):1,a=Math.pow(10,r),l=n>r?Math.pow(10,n):0,c=Math.round((t-l)*o)/o,h=Math.floor((t-l)/a/10)*a*10,u=Math.floor((c-h)/Math.pow(10,r)),d=at(s.min,Math.round((l+h+u*Math.pow(10,r))*o)/o);for(;d<e;)i.push({value:d,major:Ia(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(r++,u=2,o=r>=0?1:o),d=Math.round((l+h+u*Math.pow(10,r))*o)/o;let f=at(s.max,d);return i.push({value:f,major:Ia(f),significand:u}),i}var Bs=class extends Ce{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let i=Qe.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Y(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=Y(t)?Math.max(0,t):null,this.max=Y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Y(this._userMin)&&(this.min=t===Se(this.min,0)?Se(this.min,-1):Se(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,n=this.max,r=a=>i=t?i:a,o=a=>n=e?n:a;i===n&&(i<=0?(r(1),o(10)):(r(Se(i,-1)),o(Se(n,1)))),i<=0&&r(Se(n,-1)),n<=0&&o(Se(i,1)),this.min=i,this.max=n}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=Bf(e,this);return t.bounds==="ticks"&&mi(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":_e(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=Et(t),this._valueRange=Et(this.max)-Et(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Et(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};S(Bs,"id","logarithmic"),S(Bs,"defaults",{ticks:{callback:Ms.formatters.logarithmic,major:{enabled:!0}}});function kr(s){let t=s.ticks;if(t.display&&s.display){let e=st(t.backdropPadding);return P(t.font&&t.font.size,j.font.size)+e.height}return 0}function Hf(s,t,e){return e=B(e)?e:[e],{w:Wn(s,t.string,e),h:e.length*t.lineHeight}}function La(s,t,e,i,n){return s===i||s===n?{start:t-e/2,end:t+e/2}:s<i||s>n?{start:t-e,end:t}:{start:t,end:t+e}}function $f(s){let t={l:s.left+s._padding.left,r:s.right-s._padding.right,t:s.top+s._padding.top,b:s.bottom-s._padding.bottom},e=Object.assign({},t),i=[],n=[],r=s._pointLabels.length,o=s.options.pointLabels,a=o.centerPointLabels?F/r:0;for(let l=0;l<r;l++){let c=o.setContext(s.getPointLabelContext(l));n[l]=c.padding;let h=s.getPointPosition(l,s.drawingArea+n[l],a),u=X(c.font),d=Hf(s.ctx,u,s._pointLabels[l]);i[l]=d;let f=tt(s.getIndexAngle(l)+a),g=Math.round(ks(f)),m=La(g,h.x,d.w,0,180),p=La(g,h.y,d.h,90,270);jf(e,t,f,m,p)}s.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),s._pointLabelItems=Zf(s,i,n)}function jf(s,t,e,i,n){let r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e)),a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,s.l=Math.min(s.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,s.r=Math.max(s.r,t.r+a)),n.start<t.t?(l=(t.t-n.start)/o,s.t=Math.min(s.t,t.t-l)):n.end>t.b&&(l=(n.end-t.b)/o,s.b=Math.max(s.b,t.b+l))}function Uf(s,t,e){let i=s.drawingArea,{extra:n,additionalAngle:r,padding:o,size:a}=e,l=s.getPointPosition(t,i+n+o,r),c=Math.round(ks(tt(l.angle+q))),h=Xf(l.y,a.h,c),u=qf(c),d=Gf(l.x,a.w,u);return{visible:!0,x:l.x,y:h,textAlign:u,left:d,top:h,right:d+a.w,bottom:h+a.h}}function Yf(s,t){if(!t)return!0;let{left:e,top:i,right:n,bottom:r}=s;return!(Tt({x:e,y:i},t)||Tt({x:e,y:r},t)||Tt({x:n,y:i},t)||Tt({x:n,y:r},t))}function Zf(s,t,e){let i=[],n=s._pointLabels.length,r=s.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:kr(r)/2,additionalAngle:o?F/n:0},c;for(let h=0;h<n;h++){l.padding=e[h],l.size=t[h];let u=Uf(s,h,l);i.push(u),a==="auto"&&(u.visible=Yf(u,c),u.visible&&(c=u))}return i}function qf(s){return s===0||s===180?"center":s<180?"left":"right"}function Gf(s,t,e){return e==="right"?s-=t:e==="center"&&(s-=t/2),s}function Xf(s,t,e){return e===90||e===270?s-=t/2:(e>270||e<90)&&(s-=t),s}function Jf(s,t,e){let{left:i,top:n,right:r,bottom:o}=e,{backdropColor:a}=t;if(!I(a)){let l=jt(t.borderRadius),c=st(t.backdropPadding);s.fillStyle=a;let h=i-c.left,u=n-c.top,d=r-i+c.width,f=o-n+c.height;Object.values(l).some(g=>g!==0)?(s.beginPath(),we(s,{x:h,y:u,w:d,h:f,radius:l}),s.fill()):s.fillRect(h,u,d,f)}}function Kf(s,t){let{ctx:e,options:{pointLabels:i}}=s;for(let n=t-1;n>=0;n--){let r=s._pointLabelItems[n];if(!r.visible)continue;let o=i.setContext(s.getPointLabelContext(n));Jf(e,o,r);let a=X(o.font),{x:l,y:c,textAlign:h}=r;$t(e,s._pointLabels[n],l,c+a.lineHeight/2,a,{color:o.color,textAlign:h,textBaseline:"middle"})}}function rl(s,t,e,i){let{ctx:n}=s;if(e)n.arc(s.xCenter,s.yCenter,t,0,H);else{let r=s.getPointPosition(0,t);n.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=s.getPointPosition(o,t),n.lineTo(r.x,r.y)}}function Qf(s,t,e,i,n){let r=s.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(n.dash||[]),r.lineDashOffset=n.dashOffset,r.beginPath(),rl(s,e,o,i),r.closePath(),r.stroke(),r.restore())}function tg(s,t,e){return Ft(s,{label:e,index:t,type:"pointLabel"})}var Te=class extends Qe{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=st(kr(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!1);this.min=Y(t)&&!isNaN(t)?t:0,this.max=Y(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/kr(this.options))}generateTickLabels(t){Qe.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{let n=W(this.options.pointLabels.callback,[e,i],this);return n||n===0?n:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?$f(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){let e=H/(this._pointLabels.length||1),i=this.options.startAngle||0;return tt(t*e+ut(i))}getDistanceFromCenterForValue(t){if(I(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(I(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let i=e[t];return tg(this.getContext(),t,i)}}getPointPosition(t,e,i=0){let n=this.getIndexAngle(t)-q+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:e,top:i,right:n,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:r}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),rl(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,e=this.options,{angleLines:i,grid:n,border:r}=e,o=this._pointLabels.length,a,l,c;if(e.pointLabels.display&&Kf(this,o),n.display&&this.ticks.forEach((h,u)=>{if(u!==0||u===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);let d=this.getContext(u),f=n.setContext(d),g=r.setContext(d);Qf(this,f,l,o,g)}}),i.display){for(t.save(),a=o-1;a>=0;a--){let h=i.setContext(this.getPointLabelContext(a)),{color:u,lineWidth:d}=h;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let n=this.getIndexAngle(0),r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;let c=i.setContext(this.getContext(l)),h=X(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let u=st(c.backdropPadding);t.fillRect(-o/2-u.left,-r-h.size/2-u.top,o+u.width,h.size+u.height)}$t(t,a.label,0,-r,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};S(Te,"id","radialLinear"),S(Te,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ms.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),S(Te,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),S(Te,"descriptors",{angleLines:{_fallback:"grid"}});var tn={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}},ct=Object.keys(tn);function Fa(s,t){return s-t}function Ra(s,t){if(I(t))return null;let e=s._adapter,{parser:i,round:n,isoWeekday:r}=s._parseOpts,o=t;return typeof i=="function"&&(o=i(o)),Y(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(n&&(o=n==="week"&&(se(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,n)),+o)}function Na(s,t,e,i){let n=ct.length;for(let r=ct.indexOf(s);r<n-1;++r){let o=tn[ct[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ct[r]}return ct[n-1]}function eg(s,t,e,i,n){for(let r=ct.length-1;r>=ct.indexOf(e);r--){let o=ct[r];if(tn[o].common&&s._adapter.diff(n,i,o)>=t-1)return o}return ct[e?ct.indexOf(e):0]}function sg(s){for(let t=ct.indexOf(s)+1,e=ct.length;t<e;++t)if(tn[ct[t]].common)return ct[t]}function za(s,t,e){if(!e)s[t]=!0;else if(e.length){let{lo:i,hi:n}=vs(e,t),r=e[i]>=t?e[i]:e[n];s[r]=!0}}function ig(s,t,e,i){let n=s._adapter,r=+n.startOf(t[0].value,i),o=t[t.length-1].value,a,l;for(a=r;a<=o;a=+n.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function Va(s,t,e){let i=[],n={},r=t.length,o,a;for(o=0;o<r;++o)a=t[o],n[a]=o,i.push({value:a,major:!1});return r===0||!e?i:ig(s,i,n,e)}var De=class extends Ce{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,e={}){let i=t.time||(t.time={}),n=this._adapter=new vr._date(t.adapters.date);n.init(e),pe(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Ra(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:n,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=Y(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=Y(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,n=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);let r=this.min,o=this.max,a=Rn(n,r,o);return this._unit=e.unit||(i.autoSkip?Na(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):eg(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:sg(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),Va(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,n,r;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;e=K(e,0,o),i=K(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){let t=this._adapter,e=this.min,i=this.max,n=this.options,r=n.time,o=r.unit||Na(r.minUnit,e,i,this._getLabelCapacity(e)),a=P(n.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=se(l)||l===!0,h={},u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);let g=n.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<i;d=+t.add(d,a,o),f++)za(h,d,g);return(d===i||n.bounds==="ticks"||f===1)&&za(h,d,g),Object.keys(h).sort(Fa).map(m=>+m)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let n=this.options.time.displayFormats,r=this._unit,o=e||n[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,n){let r=this.options,o=r.ticks.callback;if(o)return W(o,[t,e,i],this);let a=r.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],u=c&&a[c],d=i[e],f=c&&u&&d&&d.major;return this._adapter.format(t,n||(f?u:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,n=ut(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),o=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){let e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Va(this,[t],this._majorUnit),n),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e<i;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],e,i;if(t.length)return t;let n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(Ra(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return xi(t.sort(Fa))}};S(De,"id","time"),S(De,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ji(s,t,e){let i=0,n=s.length-1,r,o,a,l;e?(t>=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=Mt(s,"pos",t)),{pos:r,time:a}=s[i],{pos:o,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=Mt(s,"time",t)),{time:r,pos:a}=s[i],{time:o,pos:l}=s[n]);let c=o-r;return c?a+(l-a)*(t-r)/c:a}var Hs=class extends De{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ji(e,this.min),this._tableRange=ji(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:i}=this,n=[],r=[],o,a,l,c,h;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=n.length;o<a;++o)h=n[o+1],l=n[o-1],c=n[o],Math.round((h+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){let t=this.min,e=this.max,i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((n,r)=>n-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ji(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ji(this._table,i*this._tableRange+this._minPos,!0)}};S(Hs,"id","timeseries"),S(Hs,"defaults",De.defaults);var ng=Object.freeze({__proto__:null,CategoryScale:Vs,LinearScale:Ws,LogarithmicScale:Bs,RadialLinearScale:Te,TimeScale:De,TimeSeriesScale:Hs}),ol=[mu,Vd,Ff,ng];xt.register(...ol);var Pe=xt;var Xt=class extends Error{},Er=class extends Xt{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},Lr=class extends Xt{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},Fr=class extends Xt{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},le=class extends Xt{},cn=class extends Xt{constructor(t){super(`Invalid unit ${t}`)}},it=class extends Xt{},Vt=class extends Xt{constructor(){super("Zone is an abstract class")}},T="numeric",At="short",pt="long",hn={year:T,month:T,day:T},Nl={year:T,month:At,day:T},rg={year:T,month:At,day:T,weekday:At},zl={year:T,month:pt,day:T},Vl={year:T,month:pt,day:T,weekday:pt},Wl={hour:T,minute:T},Bl={hour:T,minute:T,second:T},Hl={hour:T,minute:T,second:T,timeZoneName:At},$l={hour:T,minute:T,second:T,timeZoneName:pt},jl={hour:T,minute:T,hourCycle:"h23"},Ul={hour:T,minute:T,second:T,hourCycle:"h23"},Yl={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:At},Zl={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:pt},ql={year:T,month:T,day:T,hour:T,minute:T},Gl={year:T,month:T,day:T,hour:T,minute:T,second:T},Xl={year:T,month:At,day:T,hour:T,minute:T},Jl={year:T,month:At,day:T,hour:T,minute:T,second:T},og={year:T,month:At,day:T,weekday:At,hour:T,minute:T},Kl={year:T,month:pt,day:T,hour:T,minute:T,timeZoneName:At},Ql={year:T,month:pt,day:T,hour:T,minute:T,second:T,timeZoneName:At},tc={year:T,month:pt,day:T,weekday:pt,hour:T,minute:T,timeZoneName:pt},ec={year:T,month:pt,day:T,weekday:pt,hour:T,minute:T,second:T,timeZoneName:pt},Le=class{get type(){throw new Vt}get name(){throw new Vt}get ianaName(){return this.name}get isUniversal(){throw new Vt}offsetName(t,e){throw new Vt}formatOffset(t,e){throw new Vt}offset(t){throw new Vt}equals(t){throw new Vt}get isValid(){throw new Vt}},Sr=null,un=class s extends Le{static get instance(){return Sr===null&&(Sr=new s),Sr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return dc(t,e,i)}formatOffset(t,e){return Ks(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}},Rr=new Map;function ag(s){let t=Rr.get(s);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Rr.set(s,t)),t}var lg={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function cg(s,t){let e=s.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e),[,n,r,o,a,l,c,h]=i;return[o,n,r,a,l,c,h]}function hg(s,t){let e=s.formatToParts(t),i=[];for(let n=0;n<e.length;n++){let{type:r,value:o}=e[n],a=lg[r];r==="era"?i[a]=o:C(a)||(i[a]=parseInt(o,10))}return i}var Mr=new Map,he=class s extends Le{static create(t){let e=Mr.get(t);return e===void 0&&Mr.set(t,e=new s(t)),e}static resetCache(){Mr.clear(),Rr.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=s.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return dc(t,e,i,this.name)}formatOffset(t,e){return Ks(this.offset(t),e)}offset(t){if(!this.valid)return NaN;let e=new Date(t);if(isNaN(e))return NaN;let i=ag(this.name),[n,r,o,a,l,c,h]=i.formatToParts?hg(i,e):cg(i,e);a==="BC"&&(n=-Math.abs(n)+1);let d=bn({year:n,month:r,day:o,hour:l===24?0:l,minute:c,second:h,millisecond:0}),f=+e,g=f%1e3;return f-=g>=0?g:1e3+g,(d-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},al={};function ug(s,t={}){let e=JSON.stringify([s,t]),i=al[e];return i||(i=new Intl.ListFormat(s,t),al[e]=i),i}var Nr=new Map;function zr(s,t={}){let e=JSON.stringify([s,t]),i=Nr.get(e);return i===void 0&&(i=new Intl.DateTimeFormat(s,t),Nr.set(e,i)),i}var Vr=new Map;function dg(s,t={}){let e=JSON.stringify([s,t]),i=Vr.get(e);return i===void 0&&(i=new Intl.NumberFormat(s,t),Vr.set(e,i)),i}var Wr=new Map;function fg(s,t={}){let{base:e,...i}=t,n=JSON.stringify([s,i]),r=Wr.get(n);return r===void 0&&(r=new Intl.RelativeTimeFormat(s,t),Wr.set(n,r)),r}var Gs=null;function gg(){return Gs||(Gs=new Intl.DateTimeFormat().resolvedOptions().locale,Gs)}var Br=new Map;function sc(s){let t=Br.get(s);return t===void 0&&(t=new Intl.DateTimeFormat(s).resolvedOptions(),Br.set(s,t)),t}var Hr=new Map;function mg(s){let t=Hr.get(s);if(!t){let e=new Intl.Locale(s);t="getWeekInfo"in e?e.getWeekInfo():e.weekInfo,"minimalDays"in t||(t={...ic,...t}),Hr.set(s,t)}return t}function pg(s){let t=s.indexOf("-x-");t!==-1&&(s=s.substring(0,t));let e=s.indexOf("-u-");if(e===-1)return[s];{let i,n;try{i=zr(s).resolvedOptions(),n=s}catch{let l=s.substring(0,e);i=zr(l).resolvedOptions(),n=l}let{numberingSystem:r,calendar:o}=i;return[n,r,o]}}function bg(s,t,e){return(e||t)&&(s.includes("-u-")||(s+="-u"),e&&(s+=`-ca-${e}`),t&&(s+=`-nu-${t}`)),s}function yg(s){let t=[];for(let e=1;e<=12;e++){let i=R.utc(2009,e,1);t.push(s(i))}return t}function xg(s){let t=[];for(let e=1;e<=7;e++){let i=R.utc(2016,11,13+e);t.push(s(i))}return t}function en(s,t,e,i){let n=s.listingMode();return n==="error"?null:n==="en"?e(t):i(t)}function _g(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||sc(s.locale).numberingSystem==="latn"}var $r=class{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:n,floor:r,...o}=i;if(!e||Object.keys(o).length>0){let a={useGrouping:!1,...i};i.padTo>0&&(a.minimumIntegerDigits=i.padTo),this.inf=dg(t,a)}}format(t){if(this.inf){let e=this.floor?Math.floor(t):t;return this.inf.format(e)}else{let e=this.floor?Math.floor(t):eo(t,3);return Q(e,this.padTo)}}},jr=class{constructor(t,e,i){this.opts=i,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let o=-1*(t.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&he.create(a).valid?(n=a,this.dt=t):(n="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,n=t.zone.name):(n="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let r={...this.opts};r.timeZone=r.timeZone||n,this.dtf=zr(e,r)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(e=>{if(e.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:i}}else return e}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},Ur=class{constructor(t,e,i){this.opts={style:"long",...i},!e&&hc()&&(this.rtf=fg(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):Bg(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}},ic={firstDay:1,minimalDays:4,weekend:[6,7]},$=class s{static fromOpts(t){return s.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,i,n,r=!1){let o=t||Z.defaultLocale,a=o||(r?"en-US":gg()),l=e||Z.defaultNumberingSystem,c=i||Z.defaultOutputCalendar,h=qr(n)||Z.defaultWeekSettings;return new s(a,l,c,h,o)}static resetCache(){Gs=null,Nr.clear(),Vr.clear(),Wr.clear(),Br.clear(),Hr.clear()}static fromObject({locale:t,numberingSystem:e,outputCalendar:i,weekSettings:n}={}){return s.create(t,e,i,n)}constructor(t,e,i,n,r){let[o,a,l]=pg(t);this.locale=o,this.numberingSystem=e||a||null,this.outputCalendar=i||l||null,this.weekSettings=n,this.intl=bg(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=_g(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),e=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&e?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:s.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,qr(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return en(this,t,mc,()=>{let i=this.intl==="ja"||this.intl.startsWith("ja-");e&=!i;let n=e?{month:t,day:"numeric"}:{month:t},r=e?"format":"standalone";if(!this.monthsCache[r][t]){let o=i?a=>this.dtFormatter(a,n).format():a=>this.extract(a,n,"month");this.monthsCache[r][t]=yg(o)}return this.monthsCache[r][t]})}weekdays(t,e=!1){return en(this,t,yc,()=>{let i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=xg(r=>this.extract(r,i,"weekday"))),this.weekdaysCache[n][t]})}meridiems(){return en(this,void 0,()=>xc,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[R.utc(2016,11,13,9),R.utc(2016,11,13,19)].map(e=>this.extract(e,t,"dayperiod"))}return this.meridiemCache})}eras(t){return en(this,t,_c,()=>{let e={era:t};return this.eraCache[t]||(this.eraCache[t]=[R.utc(-40,1,1),R.utc(2017,1,1)].map(i=>this.extract(i,e,"era"))),this.eraCache[t]})}extract(t,e,i){let n=this.dtFormatter(t,e),r=n.formatToParts(),o=r.find(a=>a.type.toLowerCase()===i);return o?o.value:null}numberFormatter(t={}){return new $r(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new jr(t,this.intl,e)}relFormatter(t={}){return new Ur(this.intl,this.isEnglish(),t)}listFormatter(t={}){return ug(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||sc(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:uc()?mg(this.locale):ic}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Tr=null,vt=class s extends Le{static get utcInstance(){return Tr===null&&(Tr=new s(0)),Tr}static instance(t){return t===0?s.utcInstance:new s(t)}static parseSpecifier(t){if(t){let e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new s(yn(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ks(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ks(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return Ks(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}},Yr=class extends Le{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function ae(s,t){if(C(s)||s===null)return t;if(s instanceof Le)return s;if(Tg(s)){let e=s.toLowerCase();return e==="default"?t:e==="local"||e==="system"?un.instance:e==="utc"||e==="gmt"?vt.utcInstance:vt.parseSpecifier(e)||he.create(s)}else return ce(s)?vt.instance(s):typeof s=="object"&&"offset"in s&&typeof s.offset=="function"?s:new Yr(s)}var Jr={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},ll={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},wg=Jr.hanidec.replace(/[\[|\]]/g,"").split("");function kg(s){let t=parseInt(s,10);if(isNaN(t)){t="";for(let e=0;e<s.length;e++){let i=s.charCodeAt(e);if(s[e].search(Jr.hanidec)!==-1)t+=wg.indexOf(s[e]);else for(let n in ll){let[r,o]=ll[n];i>=r&&i<=o&&(t+=i-r)}}return parseInt(t,10)}else return t}var Zr=new Map;function vg(){Zr.clear()}function Ct({numberingSystem:s},t=""){let e=s||"latn",i=Zr.get(e);i===void 0&&(i=new Map,Zr.set(e,i));let n=i.get(t);return n===void 0&&(n=new RegExp(`${Jr[e]}${t}`),i.set(t,n)),n}var cl=()=>Date.now(),hl="system",ul=null,dl=null,fl=null,gl=60,ml,pl=null,Z=class{static get now(){return cl}static set now(t){cl=t}static set defaultZone(t){hl=t}static get defaultZone(){return ae(hl,un.instance)}static get defaultLocale(){return ul}static set defaultLocale(t){ul=t}static get defaultNumberingSystem(){return dl}static set defaultNumberingSystem(t){dl=t}static get defaultOutputCalendar(){return fl}static set defaultOutputCalendar(t){fl=t}static get defaultWeekSettings(){return pl}static set defaultWeekSettings(t){pl=qr(t)}static get twoDigitCutoffYear(){return gl}static set twoDigitCutoffYear(t){gl=t%100}static get throwOnInvalid(){return ml}static set throwOnInvalid(t){ml=t}static resetCaches(){$.resetCache(),he.resetCache(),R.resetCache(),vg()}},mt=class{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},nc=[0,31,59,90,120,151,181,212,243,273,304,334],rc=[0,31,60,91,121,152,182,213,244,274,305,335];function wt(s,t){return new mt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${s}, which is invalid`)}function Kr(s,t,e){let i=new Date(Date.UTC(s,t-1,e));s<100&&s>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let n=i.getUTCDay();return n===0?7:n}function oc(s,t,e){return e+(ti(s)?rc:nc)[t-1]}function ac(s,t){let e=ti(s)?rc:nc,i=e.findIndex(r=>r<t),n=t-e[i];return{month:i+1,day:n}}function Qr(s,t){return(s-t+7)%7+1}function dn(s,t=4,e=1){let{year:i,month:n,day:r}=s,o=oc(i,n,r),a=Qr(Kr(i,n,r),e),l=Math.floor((o-a+14-t)/7),c;return l<1?(c=i-1,l=Qs(c,t,e)):l>Qs(i,t,e)?(c=i+1,l=1):c=i,{weekYear:c,weekNumber:l,weekday:a,...xn(s)}}function bl(s,t=4,e=1){let{weekYear:i,weekNumber:n,weekday:r}=s,o=Qr(Kr(i,1,t),e),a=ns(i),l=n*7+r-o-7+t,c;l<1?(c=i-1,l+=ns(c)):l>a?(c=i+1,l-=ns(i)):c=i;let{month:h,day:u}=ac(c,l);return{year:c,month:h,day:u,...xn(s)}}function Or(s){let{year:t,month:e,day:i}=s,n=oc(t,e,i);return{year:t,ordinal:n,...xn(s)}}function yl(s){let{year:t,ordinal:e}=s,{month:i,day:n}=ac(t,e);return{year:t,month:i,day:n,...xn(s)}}function xl(s,t){if(!C(s.localWeekday)||!C(s.localWeekNumber)||!C(s.localWeekYear)){if(!C(s.weekday)||!C(s.weekNumber)||!C(s.weekYear))throw new le("Cannot mix locale-based week fields with ISO-based week fields");return C(s.localWeekday)||(s.weekday=s.localWeekday),C(s.localWeekNumber)||(s.weekNumber=s.localWeekNumber),C(s.localWeekYear)||(s.weekYear=s.localWeekYear),delete s.localWeekday,delete s.localWeekNumber,delete s.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Sg(s,t=4,e=1){let i=pn(s.weekYear),n=kt(s.weekNumber,1,Qs(s.weekYear,t,e)),r=kt(s.weekday,1,7);return i?n?r?!1:wt("weekday",s.weekday):wt("week",s.weekNumber):wt("weekYear",s.weekYear)}function Mg(s){let t=pn(s.year),e=kt(s.ordinal,1,ns(s.year));return t?e?!1:wt("ordinal",s.ordinal):wt("year",s.year)}function lc(s){let t=pn(s.year),e=kt(s.month,1,12),i=kt(s.day,1,fn(s.year,s.month));return t?e?i?!1:wt("day",s.day):wt("month",s.month):wt("year",s.year)}function cc(s){let{hour:t,minute:e,second:i,millisecond:n}=s,r=kt(t,0,23)||t===24&&e===0&&i===0&&n===0,o=kt(e,0,59),a=kt(i,0,59),l=kt(n,0,999);return r?o?a?l?!1:wt("millisecond",n):wt("second",i):wt("minute",e):wt("hour",t)}function C(s){return typeof s>"u"}function ce(s){return typeof s=="number"}function pn(s){return typeof s=="number"&&s%1===0}function Tg(s){return typeof s=="string"}function Og(s){return Object.prototype.toString.call(s)==="[object Date]"}function hc(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function uc(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Dg(s){return Array.isArray(s)?s:[s]}function _l(s,t,e){if(s.length!==0)return s.reduce((i,n)=>{let r=[t(n),n];return i&&e(i[0],r[0])===i[0]?i:r},null)[1]}function Cg(s,t){return t.reduce((e,i)=>(e[i]=s[i],e),{})}function as(s,t){return Object.prototype.hasOwnProperty.call(s,t)}function qr(s){if(s==null)return null;if(typeof s!="object")throw new it("Week settings must be an object");if(!kt(s.firstDay,1,7)||!kt(s.minimalDays,1,7)||!Array.isArray(s.weekend)||s.weekend.some(t=>!kt(t,1,7)))throw new it("Invalid week settings");return{firstDay:s.firstDay,minimalDays:s.minimalDays,weekend:Array.from(s.weekend)}}function kt(s,t,e){return pn(s)&&s>=t&&s<=e}function Pg(s,t){return s-t*Math.floor(s/t)}function Q(s,t=2){let e=s<0,i;return e?i="-"+(""+-s).padStart(t,"0"):i=(""+s).padStart(t,"0"),i}function oe(s){if(!(C(s)||s===null||s===""))return parseInt(s,10)}function Ae(s){if(!(C(s)||s===null||s===""))return parseFloat(s)}function to(s){if(!(C(s)||s===null||s==="")){let t=parseFloat("0."+s)*1e3;return Math.floor(t)}}function eo(s,t,e="round"){let i=10**t;switch(e){case"expand":return s>0?Math.ceil(s*i)/i:Math.floor(s*i)/i;case"trunc":return Math.trunc(s*i)/i;case"round":return Math.round(s*i)/i;case"floor":return Math.floor(s*i)/i;case"ceil":return Math.ceil(s*i)/i;default:throw new RangeError(`Value rounding ${e} is out of range`)}}function ti(s){return s%4===0&&(s%100!==0||s%400===0)}function ns(s){return ti(s)?366:365}function fn(s,t){let e=Pg(t-1,12)+1,i=s+(t-e)/12;return e===2?ti(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function bn(s){let t=Date.UTC(s.year,s.month-1,s.day,s.hour,s.minute,s.second,s.millisecond);return s.year<100&&s.year>=0&&(t=new Date(t),t.setUTCFullYear(s.year,s.month-1,s.day)),+t}function wl(s,t,e){return-Qr(Kr(s,1,t),e)+t-1}function Qs(s,t=4,e=1){let i=wl(s,t,e),n=wl(s+1,t,e);return(ns(s)-i+n)/7}function Gr(s){return s>99?s:s>Z.twoDigitCutoffYear?1900+s:2e3+s}function dc(s,t,e,i=null){let n=new Date(s),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(r.timeZone=i);let o={timeZoneName:t,...r},a=new Intl.DateTimeFormat(e,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function yn(s,t){let e=parseInt(s,10);Number.isNaN(e)&&(e=0);let i=parseInt(t,10)||0,n=e<0||Object.is(e,-0)?-i:i;return e*60+n}function fc(s){let t=Number(s);if(typeof s=="boolean"||s===""||!Number.isFinite(t))throw new it(`Invalid unit value ${s}`);return t}function gn(s,t){let e={};for(let i in s)if(as(s,i)){let n=s[i];if(n==null)continue;e[t(i)]=fc(n)}return e}function Ks(s,t){let e=Math.trunc(Math.abs(s/60)),i=Math.trunc(Math.abs(s%60)),n=s>=0?"+":"-";switch(t){case"short":return`${n}${Q(e,2)}:${Q(i,2)}`;case"narrow":return`${n}${e}${i>0?`:${i}`:""}`;case"techie":return`${n}${Q(e,2)}${Q(i,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function xn(s){return Cg(s,["hour","minute","second","millisecond"])}var Ag=["January","February","March","April","May","June","July","August","September","October","November","December"],gc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ig=["J","F","M","A","M","J","J","A","S","O","N","D"];function mc(s){switch(s){case"narrow":return[...Ig];case"short":return[...gc];case"long":return[...Ag];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var pc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],bc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Eg=["M","T","W","T","F","S","S"];function yc(s){switch(s){case"narrow":return[...Eg];case"short":return[...bc];case"long":return[...pc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var xc=["AM","PM"],Lg=["Before Christ","Anno Domini"],Fg=["BC","AD"],Rg=["B","A"];function _c(s){switch(s){case"narrow":return[...Rg];case"short":return[...Fg];case"long":return[...Lg];default:return null}}function Ng(s){return xc[s.hour<12?0:1]}function zg(s,t){return yc(t)[s.weekday-1]}function Vg(s,t){return mc(t)[s.month-1]}function Wg(s,t){return _c(t)[s.year<0?0:1]}function Bg(s,t,e="always",i=!1){let n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(s)===-1;if(e==="auto"&&r){let u=s==="days";switch(t){case 1:return u?"tomorrow":`next ${n[s][0]}`;case-1:return u?"yesterday":`last ${n[s][0]}`;case 0:return u?"today":`this ${n[s][0]}`}}let o=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,c=n[s],h=i?l?c[1]:c[2]||c[1]:l?n[s][0]:s;return o?`${a} ${h} ago`:`in ${a} ${h}`}function kl(s,t){let e="";for(let i of s)i.literal?e+=i.val:e+=t(i.val);return e}var Hg={D:hn,DD:Nl,DDD:zl,DDDD:Vl,t:Wl,tt:Bl,ttt:Hl,tttt:$l,T:jl,TT:Ul,TTT:Yl,TTTT:Zl,f:ql,ff:Xl,fff:Kl,ffff:tc,F:Gl,FF:Jl,FFF:Ql,FFFF:ec},gt=class s{static create(t,e={}){return new s(t,e)}static parseFormat(t){let e=null,i="",n=!1,r=[];for(let o=0;o<t.length;o++){let a=t.charAt(o);a==="'"?((i.length>0||n)&&r.push({literal:n||/^\s+$/.test(i),val:i===""?"'":i}),e=null,i="",n=!n):n||a===e?i+=a:(i.length>0&&r.push({literal:/^\s+$/.test(i),val:i}),i=a,e=a)}return i.length>0&&r.push({literal:n||/^\s+$/.test(i),val:i}),r}static macroTokenToFormatOpts(t){return Hg[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0,i=void 0){if(this.opts.forceSimple)return Q(t,e);let n={...this.opts};return e>0&&(n.padTo=e),i&&(n.signDisplay=i),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,e){let i=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(f,g)=>this.loc.extract(t,f,g),o=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>i?Ng(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,g)=>i?Vg(t,f):r(g?{month:f}:{month:f,day:"numeric"},"month"),c=(f,g)=>i?zg(t,f):r(g?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),h=f=>{let g=s.macroTokenToFormatOpts(f);return g?this.formatWithSystemDefault(t,g):f},u=f=>i?Wg(t,f):r({era:f},"era"),d=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return n?r({day:"numeric"},"day"):this.num(t.day);case"dd":return n?r({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return n?r({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?r({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return n?r({month:"numeric"},"month"):this.num(t.month);case"MM":return n?r({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return n?r({year:"numeric"},"year"):this.num(t.year);case"yy":return n?r({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?r({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?r({year:"numeric"},"year"):this.num(t.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(f)}};return kl(s.parseFormat(e),d)}formatDurationFromString(t,e){let i=this.opts.signMode==="negativeLargestOnly"?-1:1,n=h=>{switch(h[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},r=(h,u)=>d=>{let f=n(d);if(f){let g=u.isNegativeDuration&&f!==u.largestUnit?i:1,m;return this.opts.signMode==="negativeLargestOnly"&&f!==u.largestUnit?m="never":this.opts.signMode==="all"?m="always":m="auto",this.num(h.get(f)*g,d.length,m)}else return d},o=s.parseFormat(e),a=o.reduce((h,{literal:u,val:d})=>u?h:h.concat(d),[]),l=t.shiftTo(...a.map(n).filter(h=>h)),c={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return kl(o,r(l,c))}},wc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ls(...s){let t=s.reduce((e,i)=>e+i.source,"");return RegExp(`^${t}$`)}function cs(...s){return t=>s.reduce(([e,i,n],r)=>{let[o,a,l]=r(t,n);return[{...e,...o},a||i,l]},[{},null,1]).slice(0,2)}function hs(s,...t){if(s==null)return[null,null];for(let[e,i]of t){let n=e.exec(s);if(n)return i(n)}return[null,null]}function kc(...s){return(t,e)=>{let i={},n;for(n=0;n<s.length;n++)i[s[n]]=oe(t[e+n]);return[i,null,e+n]}}var vc=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,$g=`(?:${vc.source}?(?:\\[(${wc.source})\\])?)?`,so=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Sc=RegExp(`${so.source}${$g}`),io=RegExp(`(?:[Tt]${Sc.source})?`),jg=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ug=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Yg=/(\d{4})-?(\d{3})/,Zg=kc("weekYear","weekNumber","weekDay"),qg=kc("year","ordinal"),Gg=/(\d{4})-(\d\d)-(\d\d)/,Mc=RegExp(`${so.source} ?(?:${vc.source}|(${wc.source}))?`),Xg=RegExp(`(?: ${Mc.source})?`);function rs(s,t,e){let i=s[t];return C(i)?e:oe(i)}function Jg(s,t){return[{year:rs(s,t),month:rs(s,t+1,1),day:rs(s,t+2,1)},null,t+3]}function us(s,t){return[{hours:rs(s,t,0),minutes:rs(s,t+1,0),seconds:rs(s,t+2,0),milliseconds:to(s[t+3])},null,t+4]}function ei(s,t){let e=!s[t]&&!s[t+1],i=yn(s[t+1],s[t+2]),n=e?null:vt.instance(i);return[{},n,t+3]}function si(s,t){let e=s[t]?he.create(s[t]):null;return[{},e,t+1]}var Kg=RegExp(`^T?${so.source}$`),Qg=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function tm(s){let[t,e,i,n,r,o,a,l,c]=s,h=t[0]==="-",u=l&&l[0]==="-",d=(f,g=!1)=>f!==void 0&&(g||f&&h)?-f:f;return[{years:d(Ae(e)),months:d(Ae(i)),weeks:d(Ae(n)),days:d(Ae(r)),hours:d(Ae(o)),minutes:d(Ae(a)),seconds:d(Ae(l),l==="-0"),milliseconds:d(to(c),u)}]}var em={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function no(s,t,e,i,n,r,o){let a={year:t.length===2?Gr(oe(t)):oe(t),month:gc.indexOf(e)+1,day:oe(i),hour:oe(n),minute:oe(r)};return o&&(a.second=oe(o)),s&&(a.weekday=s.length>3?pc.indexOf(s)+1:bc.indexOf(s)+1),a}var sm=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function im(s){let[,t,e,i,n,r,o,a,l,c,h,u]=s,d=no(t,n,i,e,r,o,a),f;return l?f=em[l]:c?f=0:f=yn(h,u),[d,new vt(f)]}function nm(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var rm=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,om=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,am=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function vl(s){let[,t,e,i,n,r,o,a]=s;return[no(t,n,i,e,r,o,a),vt.utcInstance]}function lm(s){let[,t,e,i,n,r,o,a]=s;return[no(t,a,e,i,n,r,o),vt.utcInstance]}var cm=ls(jg,io),hm=ls(Ug,io),um=ls(Yg,io),dm=ls(Sc),Tc=cs(Jg,us,ei,si),fm=cs(Zg,us,ei,si),gm=cs(qg,us,ei,si),mm=cs(us,ei,si);function pm(s){return hs(s,[cm,Tc],[hm,fm],[um,gm],[dm,mm])}function bm(s){return hs(nm(s),[sm,im])}function ym(s){return hs(s,[rm,vl],[om,vl],[am,lm])}function xm(s){return hs(s,[Qg,tm])}var _m=cs(us);function wm(s){return hs(s,[Kg,_m])}var km=ls(Gg,Xg),vm=ls(Mc),Sm=cs(us,ei,si);function Mm(s){return hs(s,[km,Tc],[vm,Sm])}var Sl="Invalid Duration",Oc={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Tm={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Oc},_t=146097/400,ts=146097/4800,Om={years:{quarters:4,months:12,weeks:_t/7,days:_t,hours:_t*24,minutes:_t*24*60,seconds:_t*24*60*60,milliseconds:_t*24*60*60*1e3},quarters:{months:3,weeks:_t/28,days:_t/4,hours:_t*24/4,minutes:_t*24*60/4,seconds:_t*24*60*60/4,milliseconds:_t*24*60*60*1e3/4},months:{weeks:ts/7,days:ts,hours:ts*24,minutes:ts*24*60,seconds:ts*24*60*60,milliseconds:ts*24*60*60*1e3},...Oc},Ee=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Dm=Ee.slice(0).reverse();function Gt(s,t,e=!1){let i={values:e?t.values:{...s.values,...t.values||{}},loc:s.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||s.conversionAccuracy,matrix:t.matrix||s.matrix};return new nt(i)}function Dc(s,t){let e=t.milliseconds??0;for(let i of Dm.slice(1))t[i]&&(e+=t[i]*s[i].milliseconds);return e}function Ml(s,t){let e=Dc(s,t)<0?-1:1;Ee.reduceRight((i,n)=>{if(C(t[n]))return i;if(i){let r=t[i]*e,o=s[n][i],a=Math.floor(r/o);t[n]+=a*e,t[i]-=a*o*e}return n},null),Ee.reduce((i,n)=>{if(C(t[n]))return i;if(i){let r=t[i]%1;t[i]-=r,t[n]+=r*s[i][n]}return n},null)}function Tl(s){let t={};for(let[e,i]of Object.entries(s))i!==0&&(t[e]=i);return t}var nt=class s{constructor(t){let e=t.conversionAccuracy==="longterm"||!1,i=e?Om:Tm;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||$.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(t,e){return s.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new it(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new s({values:gn(t,s.normalizeUnit),loc:$.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(ce(t))return s.fromMillis(t);if(s.isDuration(t))return t;if(typeof t=="object")return s.fromObject(t);throw new it(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){let[i]=xm(t);return i?s.fromObject(i,e):s.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){let[i]=wm(t);return i?s.fromObject(i,e):s.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new it("need to specify a reason the Duration is invalid");let i=t instanceof mt?t:new mt(t,e);if(Z.throwOnInvalid)throw new Fr(i);return new s({invalid:i})}static normalizeUnit(t){let e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!e)throw new cn(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){let i={...e,floor:e.round!==!1&&e.floor!==!1};return this.isValid?gt.create(this.loc,i).formatDurationFromString(this,t):Sl}toHuman(t={}){if(!this.isValid)return Sl;let e=t.showZeros!==!1,i=Ee.map(n=>{let r=this.values[n];return C(r)||r===0&&!e?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(r)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(i)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=eo(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let e=this.toMillis();return e<0||e>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},R.fromMillis(e,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Dc(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let e=s.fromDurationLike(t),i={};for(let n of Ee)(as(e.values,n)||as(this.values,n))&&(i[n]=e.get(n)+this.get(n));return Gt(this,{values:i},!0)}minus(t){if(!this.isValid)return this;let e=s.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;let e={};for(let i of Object.keys(this.values))e[i]=fc(t(this.values[i],i));return Gt(this,{values:e},!0)}get(t){return this[s.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let e={...this.values,...gn(t,s.normalizeUnit)};return Gt(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i,matrix:n}={}){let o={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:n,conversionAccuracy:i};return Gt(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return Ml(this.matrix,t),Gt(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=Tl(this.normalize().shiftToAll().toObject());return Gt(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>s.normalizeUnit(o));let e={},i={},n=this.toObject(),r;for(let o of Ee)if(t.indexOf(o)>=0){r=o;let a=0;for(let c in i)a+=this.matrix[c][o]*i[c],i[c]=0;ce(n[o])&&(a+=n[o]);let l=Math.trunc(a);e[o]=l,i[o]=(a*1e3-l*1e3)/1e3}else ce(n[o])&&(i[o]=n[o]);for(let o in i)i[o]!==0&&(e[r]+=o===r?i[o]:i[o]/this.matrix[r][o]);return Ml(this.matrix,e),Gt(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let e of Object.keys(this.values))t[e]=this.values[e]===0?0:-this.values[e];return Gt(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;let t=Tl(this.values);return Gt(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function e(i,n){return i===void 0||i===0?n===void 0||n===0:i===n}for(let i of Ee)if(!e(this.values[i],t.values[i]))return!1;return!0}},es="Invalid Interval";function Cm(s,t){return!s||!s.isValid?os.invalid("missing or invalid start"):!t||!t.isValid?os.invalid("missing or invalid end"):t<s?os.invalid("end before start",`The end of an interval must be after its start, but you had start=${s.toISO()} and end=${t.toISO()}`):null}var os=class s{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new it("need to specify a reason the Interval is invalid");let i=t instanceof mt?t:new mt(t,e);if(Z.throwOnInvalid)throw new Lr(i);return new s({invalid:i})}static fromDateTimes(t,e){let i=qs(t),n=qs(e),r=Cm(i,n);return r??new s({start:i,end:n})}static after(t,e){let i=nt.fromDurationLike(e),n=qs(t);return s.fromDateTimes(n,n.plus(i))}static before(t,e){let i=nt.fromDurationLike(e),n=qs(t);return s.fromDateTimes(n.minus(i),n)}static fromISO(t,e){let[i,n]=(t||"").split("/",2);if(i&&n){let r,o;try{r=R.fromISO(i,e),o=r.isValid}catch{o=!1}let a,l;try{a=R.fromISO(n,e),l=a.isValid}catch{l=!1}if(o&&l)return s.fromDateTimes(r,a);if(o){let c=nt.fromISO(n,e);if(c.isValid)return s.after(r,c)}else if(l){let c=nt.fromISO(i,e);if(c.isValid)return s.before(a,c)}}return s.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",e){if(!this.isValid)return NaN;let i=this.start.startOf(t,e),n;return e?.useLocaleWeeks?n=this.end.reconfigure({locale:i.locale}):n=this.end,n=n.startOf(t,e),Math.floor(n.diff(i,t).get(t))+(n.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:e}={}){return this.isValid?s.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];let e=t.map(qs).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),i=[],{s:n}=this,r=0;for(;n<this.e;){let o=e[r]||this.e,a=+o>+this.e?this.e:o;i.push(s.fromDateTimes(n,a)),n=a,r+=1}return i}splitBy(t){let e=nt.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s:i}=this,n=1,r,o=[];for(;i<this.e;){let a=this.start.plus(e.mapUnits(l=>l*n));r=+a>+this.e?this.e:a,o.push(s.fromDateTimes(i,r)),i=r,n+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let e=this.s>t.s?this.s:t.s,i=this.e<t.e?this.e:t.e;return e>=i?null:s.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;let e=this.s<t.s?this.s:t.s,i=this.e>t.e?this.e:t.e;return s.fromDateTimes(e,i)}static merge(t){let[e,i]=t.sort((n,r)=>n.s-r.s).reduce(([n,r],o)=>r?r.overlaps(o)||r.abutsStart(o)?[n,r.union(o)]:[n.concat([r]),o]:[n,o],[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0,n=[],r=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...r),a=o.sort((l,c)=>l.time-c.time);for(let l of a)i+=l.type==="s"?1:-1,i===1?e=l.time:(e&&+e!=+l.time&&n.push(s.fromDateTimes(e,l.time)),e=null);return s.merge(n)}difference(...t){return s.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:es}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=hn,e={}){return this.isValid?gt.create(this.s.loc.clone(e),t).formatInterval(this):es}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:es}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:es}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:es}toFormat(t,{separator:e=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:es}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):nt.invalid(this.invalidReason)}mapEndpoints(t){return s.fromDateTimes(t(this.s),t(this.e))}},is=class{static hasDST(t=Z.defaultZone){let e=R.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return he.isValidZone(t)}static normalizeZone(t){return ae(t,Z.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||$.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||$.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||$.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||$.create(e,i,r)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||$.create(e,i,r)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||$.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||$.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return $.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return $.create(e,null,"gregory").eras(t)}static features(){return{relative:hc(),localeWeek:uc()}}};function Ol(s,t){let e=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=e(t)-e(s);return Math.floor(nt.fromMillis(i).as("days"))}function Pm(s,t,e){let i=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{let h=Ol(l,c);return(h-h%7)/7}],["days",Ol]],n={},r=s,o,a;for(let[l,c]of i)e.indexOf(l)>=0&&(o=l,n[l]=c(s,t),a=r.plus(n),a>t?(n[l]--,s=r.plus(n),s>t&&(a=s,n[l]--,s=r.plus(n))):s=a);return[s,n,a,o]}function Am(s,t,e,i){let[n,r,o,a]=Pm(s,t,e),l=t-n,c=e.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);c.length===0&&(o<t&&(o=n.plus({[a]:1})),o!==n&&(r[a]=(r[a]||0)+l/(o-n)));let h=nt.fromObject(r,i);return c.length>0?nt.fromMillis(l,i).shiftTo(...c).plus(h):h}var Im="missing Intl.DateTimeFormat.formatToParts support";function z(s,t=e=>e){return{regex:s,deser:([e])=>t(kg(e))}}var Em="\xA0",Cc=`[ ${Em}]`,Pc=new RegExp(Cc,"g");function Lm(s){return s.replace(/\./g,"\\.?").replace(Pc,Cc)}function Dl(s){return s.replace(/\./g,"").replace(Pc," ").toLowerCase()}function Pt(s,t){return s===null?null:{regex:RegExp(s.map(Lm).join("|")),deser:([e])=>s.findIndex(i=>Dl(e)===Dl(i))+t}}function Cl(s,t){return{regex:s,deser:([,e,i])=>yn(e,i),groups:t}}function sn(s){return{regex:s,deser:([t])=>t}}function Fm(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Rm(s,t){let e=Ct(t),i=Ct(t,"{2}"),n=Ct(t,"{3}"),r=Ct(t,"{4}"),o=Ct(t,"{6}"),a=Ct(t,"{1,2}"),l=Ct(t,"{1,3}"),c=Ct(t,"{1,6}"),h=Ct(t,"{1,9}"),u=Ct(t,"{2,4}"),d=Ct(t,"{4,6}"),f=p=>({regex:RegExp(Fm(p.val)),deser:([b])=>b,literal:!0}),m=(p=>{if(s.literal)return f(p);switch(p.val){case"G":return Pt(t.eras("short"),0);case"GG":return Pt(t.eras("long"),0);case"y":return z(c);case"yy":return z(u,Gr);case"yyyy":return z(r);case"yyyyy":return z(d);case"yyyyyy":return z(o);case"M":return z(a);case"MM":return z(i);case"MMM":return Pt(t.months("short",!0),1);case"MMMM":return Pt(t.months("long",!0),1);case"L":return z(a);case"LL":return z(i);case"LLL":return Pt(t.months("short",!1),1);case"LLLL":return Pt(t.months("long",!1),1);case"d":return z(a);case"dd":return z(i);case"o":return z(l);case"ooo":return z(n);case"HH":return z(i);case"H":return z(a);case"hh":return z(i);case"h":return z(a);case"mm":return z(i);case"m":return z(a);case"q":return z(a);case"qq":return z(i);case"s":return z(a);case"ss":return z(i);case"S":return z(l);case"SSS":return z(n);case"u":return sn(h);case"uu":return sn(a);case"uuu":return z(e);case"a":return Pt(t.meridiems(),0);case"kkkk":return z(r);case"kk":return z(u,Gr);case"W":return z(a);case"WW":return z(i);case"E":case"c":return z(e);case"EEE":return Pt(t.weekdays("short",!1),1);case"EEEE":return Pt(t.weekdays("long",!1),1);case"ccc":return Pt(t.weekdays("short",!0),1);case"cccc":return Pt(t.weekdays("long",!0),1);case"Z":case"ZZ":return Cl(new RegExp(`([+-]${a.source})(?::(${i.source}))?`),2);case"ZZZ":return Cl(new RegExp(`([+-]${a.source})(${i.source})?`),2);case"z":return sn(/[a-z_+-/]{1,256}?/i);case" ":return sn(/[^\S\n\r]/);default:return f(p)}})(s)||{invalidReason:Im};return m.token=s,m}var Nm={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function zm(s,t,e){let{type:i,value:n}=s;if(i==="literal"){let l=/^\s+$/.test(n);return{literal:!l,val:l?" ":n}}let r=t[i],o=i;i==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=e.hour12?"hour12":"hour24");let a=Nm[o];if(typeof a=="object"&&(a=a[r]),a)return{literal:!1,val:a}}function Vm(s){return[`^${s.map(e=>e.regex).reduce((e,i)=>`${e}(${i.source})`,"")}$`,s]}function Wm(s,t,e){let i=s.match(t);if(i){let n={},r=1;for(let o in e)if(as(e,o)){let a=e[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(n[a.token.val[0]]=a.deser(i.slice(r,r+l))),r+=l}return[i,n]}else return[i,{}]}function Bm(s){let t=r=>{switch(r){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},e=null,i;return C(s.z)||(e=he.create(s.z)),C(s.Z)||(e||(e=new vt(s.Z)),i=s.Z),C(s.q)||(s.M=(s.q-1)*3+1),C(s.h)||(s.h<12&&s.a===1?s.h+=12:s.h===12&&s.a===0&&(s.h=0)),s.G===0&&s.y&&(s.y=-s.y),C(s.u)||(s.S=to(s.u)),[Object.keys(s).reduce((r,o)=>{let a=t(o);return a&&(r[a]=s[o]),r},{}),e,i]}var Dr=null;function Hm(){return Dr||(Dr=R.fromMillis(1555555555555)),Dr}function $m(s,t){if(s.literal)return s;let e=gt.macroTokenToFormatOpts(s.val),i=Ec(e,t);return i==null||i.includes(void 0)?s:i}function Ac(s,t){return Array.prototype.concat(...s.map(e=>$m(e,t)))}var mn=class{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=Ac(gt.parseFormat(e),t),this.units=this.tokens.map(i=>Rm(i,t)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){let[i,n]=Vm(this.units);this.regex=RegExp(i,"i"),this.handlers=n}}explainFromTokens(t){if(this.isValid){let[e,i]=Wm(t,this.regex,this.handlers),[n,r,o]=i?Bm(i):[null,null,void 0];if(as(i,"a")&&as(i,"H"))throw new le("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:i,result:n,zone:r,specificOffset:o}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function Ic(s,t,e){return new mn(s,e).explainFromTokens(t)}function jm(s,t,e){let{result:i,zone:n,specificOffset:r,invalidReason:o}=Ic(s,t,e);return[i,n,r,o]}function Ec(s,t){if(!s)return null;let i=gt.create(t,s).dtFormatter(Hm()),n=i.formatToParts(),r=i.resolvedOptions();return n.map(o=>zm(o,s,r))}var Cr="Invalid DateTime",Pl=864e13;function Xs(s){return new mt("unsupported zone",`the zone "${s.name}" is not supported`)}function Pr(s){return s.weekData===null&&(s.weekData=dn(s.c)),s.weekData}function Ar(s){return s.localWeekData===null&&(s.localWeekData=dn(s.c,s.loc.getMinDaysInFirstWeek(),s.loc.getStartOfWeek())),s.localWeekData}function Ie(s,t){let e={ts:s.ts,zone:s.zone,c:s.c,o:s.o,loc:s.loc,invalid:s.invalid};return new R({...e,...t,old:e})}function Lc(s,t,e){let i=s-t*60*1e3,n=e.offset(i);if(t===n)return[i,t];i-=(n-t)*60*1e3;let r=e.offset(i);return n===r?[i,n]:[s-Math.min(n,r)*60*1e3,Math.max(n,r)]}function nn(s,t){s+=t*60*1e3;let e=new Date(s);return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds()}}function on(s,t,e){return Lc(bn(s),t,e)}function Al(s,t){let e=s.o,i=s.c.year+Math.trunc(t.years),n=s.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,r={...s.c,year:i,month:n,day:Math.min(s.c.day,fn(i,n))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=nt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=bn(r),[l,c]=Lc(a,e,s.zone);return o!==0&&(l+=o,c=s.zone.offset(l)),{ts:l,o:c}}function ss(s,t,e,i,n,r){let{setZone:o,zone:a}=e;if(s&&Object.keys(s).length!==0||t){let l=t||a,c=R.fromObject(s,{...e,zone:l,specificOffset:r});return o?c:c.setZone(a)}else return R.invalid(new mt("unparsable",`the input "${n}" can't be parsed as ${i}`))}function rn(s,t,e=!0){return s.isValid?gt.create($.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(s,t):null}function Ir(s,t,e){let i=s.c.year>9999||s.c.year<0,n="";if(i&&s.c.year>=0&&(n+="+"),n+=Q(s.c.year,i?6:4),e==="year")return n;if(t){if(n+="-",n+=Q(s.c.month),e==="month")return n;n+="-"}else if(n+=Q(s.c.month),e==="month")return n;return n+=Q(s.c.day),n}function Il(s,t,e,i,n,r,o){let a=!e||s.c.millisecond!==0||s.c.second!==0,l="";switch(o){case"day":case"month":case"year":break;default:if(l+=Q(s.c.hour),o==="hour")break;if(t){if(l+=":",l+=Q(s.c.minute),o==="minute")break;a&&(l+=":",l+=Q(s.c.second))}else{if(l+=Q(s.c.minute),o==="minute")break;a&&(l+=Q(s.c.second))}if(o==="second")break;a&&(!i||s.c.millisecond!==0)&&(l+=".",l+=Q(s.c.millisecond,3))}return n&&(s.isOffsetFixed&&s.offset===0&&!r?l+="Z":s.o<0?(l+="-",l+=Q(Math.trunc(-s.o/60)),l+=":",l+=Q(Math.trunc(-s.o%60))):(l+="+",l+=Q(Math.trunc(s.o/60)),l+=":",l+=Q(Math.trunc(s.o%60)))),r&&(l+="["+s.zone.ianaName+"]"),l}var Fc={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Um={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ym={ordinal:1,hour:0,minute:0,second:0,millisecond:0},an=["year","month","day","hour","minute","second","millisecond"],Zm=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],qm=["year","ordinal","hour","minute","second","millisecond"];function ln(s){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[s.toLowerCase()];if(!t)throw new cn(s);return t}function El(s){switch(s.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ln(s)}}function Gm(s){if(Js===void 0&&(Js=Z.now()),s.type!=="iana")return s.offset(Js);let t=s.name,e=Xr.get(t);return e===void 0&&(e=s.offset(Js),Xr.set(t,e)),e}function Ll(s,t){let e=ae(t.zone,Z.defaultZone);if(!e.isValid)return R.invalid(Xs(e));let i=$.fromObject(t),n,r;if(C(s.year))n=Z.now();else{for(let l of an)C(s[l])&&(s[l]=Fc[l]);let o=lc(s)||cc(s);if(o)return R.invalid(o);let a=Gm(e);[n,r]=on(s,a,e)}return new R({ts:n,zone:e,loc:i,o:r})}function Fl(s,t,e){let i=C(e.round)?!0:e.round,n=C(e.rounding)?"trunc":e.rounding,r=(a,l)=>(a=eo(a,i||e.calendary?0:2,e.calendary?"round":n),t.loc.clone(e).relFormatter(e).format(a,l)),o=a=>e.calendary?t.hasSame(s,a)?0:t.startOf(a).diff(s.startOf(a),a).get(a):t.diff(s,a).get(a);if(e.unit)return r(o(e.unit),e.unit);for(let a of e.units){let l=o(a);if(Math.abs(l)>=1)return r(l,a)}return r(s>t?-0:0,e.units[e.units.length-1])}function Rl(s){let t={},e;return s.length>0&&typeof s[s.length-1]=="object"?(t=s[s.length-1],e=Array.from(s).slice(0,s.length-1)):e=Array.from(s),[t,e]}var Js,Xr=new Map,R=class s{constructor(t){let e=t.zone||Z.defaultZone,i=t.invalid||(Number.isNaN(t.ts)?new mt("invalid input"):null)||(e.isValid?null:Xs(e));this.ts=C(t.ts)?Z.now():t.ts;let n=null,r=null;if(!i)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,r]=[t.old.c,t.old.o];else{let a=ce(t.o)&&!t.old?t.o:e.offset(this.ts);n=nn(this.ts,a),i=Number.isNaN(n.year)?new mt("invalid input"):null,n=i?null:n,r=i?null:a}this._zone=e,this.loc=t.loc||$.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=n,this.o=r,this.isLuxonDateTime=!0}static now(){return new s({})}static local(){let[t,e]=Rl(arguments),[i,n,r,o,a,l,c]=e;return Ll({year:i,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static utc(){let[t,e]=Rl(arguments),[i,n,r,o,a,l,c]=e;return t.zone=vt.utcInstance,Ll({year:i,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,e={}){let i=Og(t)?t.valueOf():NaN;if(Number.isNaN(i))return s.invalid("invalid input");let n=ae(e.zone,Z.defaultZone);return n.isValid?new s({ts:i,zone:n,loc:$.fromObject(e)}):s.invalid(Xs(n))}static fromMillis(t,e={}){if(ce(t))return t<-Pl||t>Pl?s.invalid("Timestamp out of range"):new s({ts:t,zone:ae(e.zone,Z.defaultZone),loc:$.fromObject(e)});throw new it(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(ce(t))return new s({ts:t*1e3,zone:ae(e.zone,Z.defaultZone),loc:$.fromObject(e)});throw new it("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};let i=ae(e.zone,Z.defaultZone);if(!i.isValid)return s.invalid(Xs(i));let n=$.fromObject(e),r=gn(t,El),{minDaysInFirstWeek:o,startOfWeek:a}=xl(r,n),l=Z.now(),c=C(e.specificOffset)?i.offset(l):e.specificOffset,h=!C(r.ordinal),u=!C(r.year),d=!C(r.month)||!C(r.day),f=u||d,g=r.weekYear||r.weekNumber;if((f||h)&&g)throw new le("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&h)throw new le("Can't mix ordinal dates with month/day");let m=g||r.weekday&&!f,p,b,y=nn(l,c);m?(p=Zm,b=Um,y=dn(y,o,a)):h?(p=qm,b=Ym,y=Or(y)):(p=an,b=Fc);let _=!1;for(let D of p){let A=r[D];C(A)?_?r[D]=b[D]:r[D]=y[D]:_=!0}let w=m?Sg(r,o,a):h?Mg(r):lc(r),x=w||cc(r);if(x)return s.invalid(x);let k=m?bl(r,o,a):h?yl(r):r,[v,M]=on(k,c,i),O=new s({ts:v,zone:i,o:M,loc:n});return r.weekday&&f&&t.weekday!==O.weekday?s.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${O.toISO()}`):O.isValid?O:s.invalid(O.invalid)}static fromISO(t,e={}){let[i,n]=pm(t);return ss(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){let[i,n]=bm(t);return ss(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){let[i,n]=ym(t);return ss(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(C(t)||C(e))throw new it("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:r=null}=i,o=$.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[a,l,c,h]=jm(o,t,e);return h?s.invalid(h):ss(a,l,i,`format ${e}`,t,c)}static fromString(t,e,i={}){return s.fromFormat(t,e,i)}static fromSQL(t,e={}){let[i,n]=Mm(t);return ss(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new it("need to specify a reason the DateTime is invalid");let i=t instanceof mt?t:new mt(t,e);if(Z.throwOnInvalid)throw new Er(i);return new s({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){let i=Ec(t,$.fromObject(e));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(t,e={}){return Ac(gt.parseFormat(t),$.fromObject(e)).map(n=>n.val).join("")}static resetCache(){Js=void 0,Xr.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Pr(this).weekYear:NaN}get weekNumber(){return this.isValid?Pr(this).weekNumber:NaN}get weekday(){return this.isValid?Pr(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Ar(this).weekday:NaN}get localWeekNumber(){return this.isValid?Ar(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Ar(this).weekYear:NaN}get ordinal(){return this.isValid?Or(this.c).ordinal:NaN}get monthShort(){return this.isValid?is.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?is.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?is.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?is.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,e=6e4,i=bn(this.c),n=this.zone.offset(i-t),r=this.zone.offset(i+t),o=this.zone.offset(i-n*e),a=this.zone.offset(i-r*e);if(o===a)return[this];let l=i-o*e,c=i-a*e,h=nn(l,o),u=nn(c,a);return h.hour===u.hour&&h.minute===u.minute&&h.second===u.second&&h.millisecond===u.millisecond?[Ie(this,{ts:l}),Ie(this,{ts:c})]:[this]}get isInLeapYear(){return ti(this.year)}get daysInMonth(){return fn(this.year,this.month)}get daysInYear(){return this.isValid?ns(this.year):NaN}get weeksInWeekYear(){return this.isValid?Qs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Qs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:e,numberingSystem:i,calendar:n}=gt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(vt.instance(t),e)}toLocal(){return this.setZone(Z.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if(t=ae(t,Z.defaultZone),t.equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){let r=t.offset(this.ts),o=this.toObject();[n]=on(o,r,t)}return Ie(this,{ts:n,zone:t})}else return s.invalid(Xs(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){let n=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i});return Ie(this,{loc:n})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let e=gn(t,El),{minDaysInFirstWeek:i,startOfWeek:n}=xl(e,this.loc),r=!C(e.weekYear)||!C(e.weekNumber)||!C(e.weekday),o=!C(e.ordinal),a=!C(e.year),l=!C(e.month)||!C(e.day),c=a||l,h=e.weekYear||e.weekNumber;if((c||o)&&h)throw new le("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new le("Can't mix ordinal dates with month/day");let u;r?u=bl({...dn(this.c,i,n),...e},i,n):C(e.ordinal)?(u={...this.toObject(),...e},C(e.day)&&(u.day=Math.min(fn(u.year,u.month),u.day))):u=yl({...Or(this.c),...e});let[d,f]=on(u,this.o,this.zone);return Ie(this,{ts:d,o:f})}plus(t){if(!this.isValid)return this;let e=nt.fromDurationLike(t);return Ie(this,Al(this,e))}minus(t){if(!this.isValid)return this;let e=nt.fromDurationLike(t).negate();return Ie(this,Al(this,e))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;let i={},n=nt.normalizeUnit(t);switch(n){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(n==="weeks")if(e){let r=this.loc.getStartOfWeek(),{weekday:o}=this;o<r&&(i.weekNumber=this.weekNumber-1),i.weekday=r}else i.weekday=1;if(n==="quarters"){let r=Math.ceil(this.month/3);i.month=(r-1)*3+1}return this.set(i)}endOf(t,e){return this.isValid?this.plus({[t]:1}).startOf(t,e).minus(1):this}toFormat(t,e={}){return this.isValid?gt.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Cr}toLocaleString(t=hn,e={}){return this.isValid?gt.create(this.loc.clone(e),t).formatDateTime(this):Cr}toLocaleParts(t={}){return this.isValid?gt.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:r=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;o=ln(o);let a=t==="extended",l=Ir(this,a,o);return an.indexOf(o)>=3&&(l+="T"),l+=Il(this,a,e,i,n,r,o),l}toISODate({format:t="extended",precision:e="day"}={}){return this.isValid?Ir(this,t==="extended",ln(e)):null}toISOWeekDate(){return rn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:r=!1,format:o="extended",precision:a="milliseconds"}={}){return this.isValid?(a=ln(a),(n&&an.indexOf(a)>=3?"T":"")+Il(this,o==="extended",e,t,i,r,a)):null}toRFC2822(){return rn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return rn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ir(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(e||t)&&(i&&(n+=" "),e?n+="z":t&&(n+="ZZ")),rn(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Cr}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};let e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",i={}){if(!this.isValid||!t.isValid)return nt.invalid("created by diffing an invalid DateTime");let n={locale:this.locale,numberingSystem:this.numberingSystem,...i},r=Dg(e).map(nt.normalizeUnit),o=t.valueOf()>this.valueOf(),a=o?this:t,l=o?t:this,c=Am(a,l,r,n);return o?c.negate():c}diffNow(t="milliseconds",e={}){return this.diff(s.now(),t,e)}until(t){return this.isValid?os.fromDateTimes(this,t):this}hasSame(t,e,i){if(!this.isValid)return!1;let n=t.valueOf(),r=this.setZone(t.zone,{keepLocalTime:!0});return r.startOf(e,i)<=n&&n<=r.endOf(e,i)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let e=t.base||s.fromObject({},{zone:this.zone}),i=t.padding?this<e?-t.padding:t.padding:0,n=["years","months","days","hours","minutes","seconds"],r=t.unit;return Array.isArray(t.unit)&&(n=t.unit,r=void 0),Fl(e,this.plus(i),{...t,numeric:"always",units:n,unit:r})}toRelativeCalendar(t={}){return this.isValid?Fl(t.base||s.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(s.isDateTime))throw new it("min requires all arguments be DateTimes");return _l(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(s.isDateTime))throw new it("max requires all arguments be DateTimes");return _l(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,i={}){let{locale:n=null,numberingSystem:r=null}=i,o=$.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return Ic(o,t,e)}static fromStringExplain(t,e,i={}){return s.fromFormatExplain(t,e,i)}static buildFormatParser(t,e={}){let{locale:i=null,numberingSystem:n=null}=e,r=$.fromOpts({locale:i,numberingSystem:n,defaultToEN:!0});return new mn(r,t)}static fromFormatParser(t,e,i={}){if(C(t)||C(e))throw new it("fromFormatParser requires an input string and a format parser");let{locale:n=null,numberingSystem:r=null}=i,o=$.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});if(!o.equals(e.locale))throw new it(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${e.locale}`);let{result:a,zone:l,specificOffset:c,invalidReason:h}=e.explainFromTokens(t);return h?s.invalid(h):ss(a,l,i,`format ${e.format}`,t,c)}static get DATE_SHORT(){return hn}static get DATE_MED(){return Nl}static get DATE_MED_WITH_WEEKDAY(){return rg}static get DATE_FULL(){return zl}static get DATE_HUGE(){return Vl}static get TIME_SIMPLE(){return Wl}static get TIME_WITH_SECONDS(){return Bl}static get TIME_WITH_SHORT_OFFSET(){return Hl}static get TIME_WITH_LONG_OFFSET(){return $l}static get TIME_24_SIMPLE(){return jl}static get TIME_24_WITH_SECONDS(){return Ul}static get TIME_24_WITH_SHORT_OFFSET(){return Yl}static get TIME_24_WITH_LONG_OFFSET(){return Zl}static get DATETIME_SHORT(){return ql}static get DATETIME_SHORT_WITH_SECONDS(){return Gl}static get DATETIME_MED(){return Xl}static get DATETIME_MED_WITH_SECONDS(){return Jl}static get DATETIME_MED_WITH_WEEKDAY(){return og}static get DATETIME_FULL(){return Kl}static get DATETIME_FULL_WITH_SECONDS(){return Ql}static get DATETIME_HUGE(){return tc}static get DATETIME_HUGE_WITH_SECONDS(){return ec}};function qs(s){if(R.isDateTime(s))return s;if(s&&s.valueOf&&ce(s.valueOf()))return R.fromJSDate(s);if(s&&typeof s=="object")return R.fromObject(s);throw new it(`Unknown datetime argument: ${s}, of type ${typeof s}`)}var Xm={datetime:R.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:R.TIME_WITH_SECONDS,minute:R.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};vr._date.override({_id:"luxon",_create:function(s){return R.fromMillis(s,this.options)},init(s){this.options.locale||(this.options.locale=s.locale)},formats:function(){return Xm},parse:function(s,t){let e=this.options,i=typeof s;return s===null||i==="undefined"?null:(i==="number"?s=this._create(s):i==="string"?typeof t=="string"?s=R.fromFormat(s,t,e):s=R.fromISO(s,e):s instanceof Date?s=R.fromJSDate(s,e):i==="object"&&!(s instanceof R)&&(s=R.fromObject(s,e)),s.isValid?s.valueOf():null)},format:function(s,t){let e=this._create(s);return typeof t=="string"?e.toFormat(t):e.toLocaleString(t)},add:function(s,t,e){let i={};return i[e]=t,this._create(s).plus(i).valueOf()},diff:function(s,t,e){return this._create(s).diff(this._create(t)).as(e).valueOf()},startOf:function(s,t,e){if(t==="isoWeek"){e=Math.trunc(Math.min(Math.max(0,e),6));let i=this._create(s);return i.minus({days:(i.weekday-e+7)%7}).startOf("day").valueOf()}return t?this._create(s).startOf(t).valueOf():s},endOf:function(s,t){return this._create(s).endOf(t).valueOf()}});var _n=(s,t)=>{if(Array.isArray(s))return s.map(i=>_n(i,t));let e=Be(s);return e.valid?e.darken(t).rgbString():s};window.filamentChartJsGlobalPlugins&&Array.isArray(window.filamentChartJsGlobalPlugins)&&window.filamentChartJsGlobalPlugins.length>0&&Pe.register(...window.filamentChartJsGlobalPlugins);Pe.defaults.plugins.legend.labels.boxWidth=12;Pe.defaults.plugins.legend.position="bottom";function Jm({cachedData:s,options:t,type:e}){return{userBackgroundColor:t?.backgroundColor,userBorderColor:t?.borderColor,userTextColor:t?.color,userPointBackgroundColor:t?.pointBackgroundColor,userXGridColor:t?.scales?.x?.grid?.color,userYGridColor:t?.scales?.y?.grid?.color,userRadialGridColor:t?.scales?.r?.grid?.color,userRadialTicksColor:t?.scales?.r?.ticks?.color,init(){this.$wire.$on("updateChartData",({data:i})=>this.updateChartData(i)),Alpine.effect(()=>{Alpine.store("theme"),this.$nextTick(()=>this.updateChartTheme())}),this.systemThemeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemThemeListener=()=>{Alpine.store("theme")==="system"&&this.$nextTick(()=>this.updateChartTheme())},this.systemThemeMediaQuery.addEventListener("change",this.systemThemeListener),this.$nextTick(()=>{this.initChart(),this.resizeObserver=new ResizeObserver(()=>this.getChart()?.resize()),this.resizeObserver.observe(this.$el),this.dprChangeHandler=Alpine.debounce(()=>this.handleDprChange(),250),window.addEventListener("resize",this.dprChangeHandler)})},initChart(){var r,o,a,l,c,h,u,d,f,g,m,p,b,y,_,w,x,k,v,M,O,D;if(!this.$refs.canvas||!this.$refs.backgroundColorElement||!this.$refs.borderColorElement||!this.$refs.textColorElement||!this.$refs.gridColorElement)return;let i=getComputedStyle(this.$el).fontFamily,n=this.$refs.canvas.style.maxHeight!=="100%";t??(t={}),t.animation??(t.animation={}),(r=t.animation).duration??(r.duration=0),t.font??(t.font={}),(o=t.font).family??(o.family=i),t.borderWidth??(t.borderWidth=2),t.responsive??(t.responsive=!1),t.maintainAspectRatio??(t.maintainAspectRatio=n),t.pointHitRadius??(t.pointHitRadius=4),t.pointRadius??(t.pointRadius=2),t.scales??(t.scales={}),(a=t.scales).x??(a.x={}),(l=t.scales.x).border??(l.border={}),(c=t.scales.x.border).display??(c.display=!1),(h=t.scales.x).grid??(h.grid={}),(u=t.scales.x.grid).display??(u.display=!1),(d=t.scales).y??(d.y={}),(f=t.scales.y).border??(f.border={}),(g=t.scales.y.border).display??(g.display=!1),(m=t.scales.y).grid??(m.grid={}),["doughnut","pie","polarArea"].includes(e)&&((p=t.scales.x).display??(p.display=!1),(b=t.scales.y).display??(b.display=!1),(y=t.scales.y.grid).display??(y.display=!1),t.elements??(t.elements={}),(_=t.elements).arc??(_.arc={}),t.plugins??(t.plugins={}),(w=t.plugins).legend??(w.legend={}),(x=t.plugins.legend).labels??(x.labels={}),(k=t.plugins.legend.labels).generateLabels??(k.generateLabels=A=>{let L=Pe.overrides[e].plugins.legend.labels.generateLabels(A);for(let J of L)J.strokeStyle=_n(J.fillStyle,.2);return L})),e==="polarArea"&&((v=t.scales).r??(v.r={}),(M=t.scales.r).grid??(M.grid={}),(O=t.scales.r).ticks??(O.ticks={}),(D=t.scales.r.ticks).backdropColor??(D.backdropColor="transparent")),this.applyChartColors(t),this.normalizeDatasets(s),new Pe(this.$refs.canvas,{type:e,data:s,options:t,plugins:window.filamentChartJsPlugins??[]})},updateChartData(i){let n=this.getChart();n&&(this.normalizeDatasets(i),n.data=i,n.update("resize"))},normalizeDatasets(i){for(let n of i?.datasets??[])e==="bar"&&n.backgroundColor!==void 0&&(n.borderColor??(n.borderColor=_n(n.backgroundColor,.2)),n.hoverBorderColor??(n.hoverBorderColor=_n(n.backgroundColor,.3))),e==="scatter"&&n.backgroundColor!==void 0&&(n.borderColor??(n.borderColor=n.backgroundColor)),["line","scatter"].includes(e)&&n.borderColor!==void 0&&(n.pointBackgroundColor??(n.pointBackgroundColor=n.borderColor))},updateChartTheme(){let i=this.getChart();i&&(this.applyChartColors(i.options),i.update("none"))},applyChartColors(i){var c,h;let{backgroundColor:n,borderColor:r,textColor:o,gridColor:a}=this.getChartColors(),l=this.userBorderColor??r;i.backgroundColor=this.userBackgroundColor??n,i.borderColor=l,i.color=this.userTextColor??o,i.pointBackgroundColor=this.userPointBackgroundColor??l,i.elements??(i.elements={}),(c=i.elements).bar??(c.bar={}),i.elements.bar.borderColor=l,["doughnut","pie","polarArea"].includes(e)&&((h=i.elements).arc??(h.arc={}),i.elements.arc.borderColor=this.getSurroundingBackgroundColor()),i.scales.x.grid.color=this.userXGridColor??a,i.scales.y.grid.color=this.userYGridColor??a,e==="polarArea"&&(i.scales.r.grid.color=this.userRadialGridColor??a,i.scales.r.ticks.color=this.userRadialTicksColor??o)},handleDprChange(){let i=this.getChart();i&&i.currentDevicePixelRatio!==window.devicePixelRatio&&i.resize()},getChart(){return this.$refs.canvas?Pe.getChart(this.$refs.canvas):null},getSurroundingBackgroundColor(){let i=this.$el.parentElement;for(;i;){let n=getComputedStyle(i).backgroundColor;if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return n;i=i.parentElement}return"#ffffff"},getChartColors(){return{backgroundColor:getComputedStyle(this.$refs.backgroundColorElement).color,borderColor:getComputedStyle(this.$refs.borderColorElement).color,textColor:getComputedStyle(this.$refs.textColorElement).color,gridColor:getComputedStyle(this.$refs.gridColorElement).color}},destroy(){this.resizeObserver?.disconnect(),this.dprChangeHandler&&window.removeEventListener("resize",this.dprChangeHandler),this.systemThemeMediaQuery?.removeEventListener("change",this.systemThemeListener),this.getChart()?.destroy()}}}export{Jm as default};
/*! Bundled license information:
@kurkle/color/dist/color.esm.js:
(*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*)
chart.js/dist/chunks/helpers.dataset.js:
chart.js/dist/chart.js:
chart.js/dist/helpers.js:
(*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*)
chartjs-adapter-luxon/dist/chartjs-adapter-luxon.esm.js:
(*!
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*)
*/