function Ot(){}var Hr=(function(){let s=0;return function(){return s++}})();function L(s){return s===null||typeof s>"u"}function W(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 P(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}var Y=s=>(typeof s=="number"||s instanceof Number)&&isFinite(+s);function lt(s,t){return Y(s)?s:t}function C(s,t){return typeof s>"u"?t:s}var $r=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100:s/t,Yi=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function B(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function z(s,t,e,i){let n,r,o;if(W(s))if(r=s.length,i)for(n=r-1;n>=0;n--)t.call(e,s[n],n);else for(n=0;ns,x:s=>s.x,y:s=>s.y};function Ft(s,t){return(Dr[t]||(Dr[t]=hc(t)))(s)}function hc(s){let t=uc(s);return e=>{for(let i of t){if(i==="")break;e=e&&e[i]}return e}}function uc(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 Us(s){return s.charAt(0).toUpperCase()+s.slice(1)}var at=s=>typeof s<"u",Lt=s=>typeof s=="function",Zi=(s,t)=>{if(s.size!==t.size)return!1;for(let e of s)if(!t.has(e))return!1;return!0};function Ur(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}var $=Math.PI,V=2*$,dc=V+$,Hs=Number.POSITIVE_INFINITY,fc=$/180,U=$/2,ss=$/4,Cr=$*2/3,ct=Math.log10,wt=Math.sign;function qi(s){let t=Math.round(s);s=Me(s,t,s/1e3)?t:s;let e=Math.pow(10,Math.floor(ct(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Yr(s){let t=[],e=Math.sqrt(s),i;for(i=1;in-r).pop(),t}function oe(s){return!isNaN(parseFloat(s))&&isFinite(s)}function Me(s,t,e){return Math.abs(s-t)=s}function Xi(s,t,e){let i,n,r;for(i=0,n=s.length;il&&c=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function Zs(s,t,e){e=e||(o=>s[o]1;)r=n+i>>1,e(r)?n=r:i=r;return{lo:n,hi:i}}var Mt=(s,t,e,i)=>Zs(s,e,i?n=>s[n][t]<=e:n=>s[n][t]Zs(s,e,i=>s[i][t]>=e);function Gr(s,t,e){let i=0,n=s.length;for(;ii&&s[n-1]>e;)n--;return i>0||n{let i="_onData"+Us(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 Ji(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)&&(Kr.forEach(r=>{delete s[r]}),delete s._chartjs)}function Qi(s){let t=new Set,e,i;for(e=0,i=s.length;e"u"?function(s){return s()}:window.requestAnimationFrame})();function en(s,t,e){let i=e||(o=>Array.prototype.slice.call(o)),n=!1,r=[];return function(...o){r=i(o),n||(n=!0,tn.call(window,()=>{n=!1,s.apply(t,r)}))}}function Qr(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}var qs=s=>s==="start"?"left":s==="end"?"right":"center",et=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,to=(s,t,e,i)=>s===(i?"left":"right")?e:s==="center"?(t+e)/2:t;function sn(s,t,e){let i=t.length,n=0,r=i;if(s._sorted){let{iScale:o,_parsed:a}=s,l=o.axis,{min:c,max:h,minDefined:u,maxDefined:d}=o.getUserBounds();u&&(n=J(Math.min(Mt(a,o.axis,c).lo,e?i:Mt(t,l,o.getPixelForValue(c)).lo),0,i-1)),d?r=J(Math.max(Mt(a,o.axis,h,!0).hi+1,e?0:Mt(t,l,o.getPixelForValue(h),!0).hi+1),n,i)-n:r=i-n}return{start:n,count:r}}function nn(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 Rs=s=>s===0||s===1,Er=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*V/e)),Pr=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*V/e)+1,_e={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*U)+1,easeOutSine:s=>Math.sin(s*U),easeInOutSine:s=>-.5*(Math.cos($*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=>Rs(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=>Rs(s)?s:Er(s,.075,.3),easeOutElastic:s=>Rs(s)?s:Pr(s,.075,.3),easeInOutElastic(s){return Rs(s)?s:s<.5?.5*Er(s*2,.1125,.45):.5+.5*Pr(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-_e.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?_e.easeInBounce(s*2)*.5:_e.easeOutBounce(s*2-1)*.5+.5};function as(s){return s+.5|0}var Ht=(s,t,e)=>Math.max(Math.min(s,e),t);function is(s){return Ht(as(s*2.55),0,255)}function $t(s){return Ht(as(s*255),0,255)}function At(s){return Ht(as(s/2.55)/100,0,1)}function Ir(s){return Ht(as(s*100),0,100)}var mt={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},$i=[..."0123456789ABCDEF"],mc=s=>$i[s&15],pc=s=>$i[(s&240)>>4]+$i[s&15],Ns=s=>(s&240)>>4===(s&15),bc=s=>Ns(s.r)&&Ns(s.g)&&Ns(s.b)&&Ns(s.a);function yc(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&mt[s[1]]*17,g:255&mt[s[2]]*17,b:255&mt[s[3]]*17,a:t===5?mt[s[4]]*17:255}:(t===7||t===9)&&(e={r:mt[s[1]]<<4|mt[s[2]],g:mt[s[3]]<<4|mt[s[4]],b:mt[s[5]]<<4|mt[s[6]],a:t===9?mt[s[7]]<<4|mt[s[8]]:255})),e}var xc=(s,t)=>s<255?t(s):"";function _c(s){var t=bc(s)?mc:pc;return s?"#"+t(s.r)+t(s.g)+t(s.b)+xc(s.a,t):void 0}var wc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function eo(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 kc(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 vc(s,t,e){let i=eo(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 Sc(s,t,e,i,n){return s===n?(t-e)/i+(t.5?h/(2-r-o):h/(r+o),l=Sc(e,i,n,h,r),l=l*60+.5),[l|0,c||0,a]}function on(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map($t)}function an(s,t,e){return on(eo,s,t,e)}function Mc(s,t,e){return on(vc,s,t,e)}function Oc(s,t,e){return on(kc,s,t,e)}function so(s){return(s%360+360)%360}function Tc(s){let t=wc.exec(s),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?is(+t[5]):$t(+t[5]));let n=so(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Mc(n,r,o):t[1]==="hsv"?i=Oc(n,r,o):i=an(n,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Dc(s,t){var e=rn(s);e[0]=so(e[0]+t),e=an(e),s.r=e[0],s.g=e[1],s.b=e[2]}function Cc(s){if(!s)return;let t=rn(s),e=t[0],i=Ir(t[1]),n=Ir(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${At(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}var Ar={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"},Lr={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 Ec(){let s={},t=Object.keys(Lr),e=Object.keys(Ar),i,n,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return s}var zs;function Pc(s){zs||(zs=Ec(),zs.transparent=[0,0,0,0]);let t=zs[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Ic=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ac(s){let t=Ic.exec(s),e=255,i,n,r;if(t){if(t[7]!==i){let o=+t[7];e=t[8]?is(o):Ht(o*255,0,255)}return i=+t[1],n=+t[3],r=+t[5],i=255&(t[2]?is(i):Ht(i,0,255)),n=255&(t[4]?is(n):Ht(n,0,255)),r=255&(t[6]?is(r):Ht(r,0,255)),{r:i,g:n,b:r,a:e}}}function Lc(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${At(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}var Vi=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,xe=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function Fc(s,t,e){let i=xe(At(s.r)),n=xe(At(s.g)),r=xe(At(s.b));return{r:$t(Vi(i+e*(xe(At(t.r))-i))),g:$t(Vi(n+e*(xe(At(t.g))-n))),b:$t(Vi(r+e*(xe(At(t.b))-r))),a:s.a+e*(t.a-s.a)}}function Vs(s,t,e){if(s){let i=rn(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=an(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function io(s,t){return s&&Object.assign(t||{},s)}function Fr(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=$t(s[3]))):(t=io(s,{r:0,g:0,b:0,a:1}),t.a=$t(t.a)),t}function Rc(s){return s.charAt(0)==="r"?Ac(s):Tc(s)}var ji=class s{constructor(t){if(t instanceof s)return t;let e=typeof t,i;e==="object"?i=Fr(t):e==="string"&&(i=yc(t)||Pc(t)||Rc(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=io(this._rgb);return t&&(t.a=At(t.a)),t}set rgb(t){this._rgb=Fr(t)}rgbString(){return this._valid?Lc(this._rgb):void 0}hexString(){return this._valid?_c(this._rgb):void 0}hslString(){return this._valid?Cc(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=Fc(this._rgb,t._rgb,e)),this}clone(){return new s(this.rgb)}alpha(t){return this._rgb.a=$t(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=as(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 Vs(this._rgb,2,t),this}darken(t){return Vs(this._rgb,2,-t),this}saturate(t){return Vs(this._rgb,1,t),this}desaturate(t){return Vs(this._rgb,1,-t),this}rotate(t){return Dc(this._rgb,t),this}};function no(s){return new ji(s)}function ro(s){if(s&&typeof s=="object"){let t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ln(s){return ro(s)?s:no(s)}function Wi(s){return ro(s)?s:no(s).saturate(.5).darken(.1).hexString()}var jt=Object.create(null),Xs=Object.create(null);function ns(s,t){if(!t)return s;let e=t.split(".");for(let i=0,n=e.length;ie.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,i)=>Wi(i.backgroundColor),this.hoverBorderColor=(e,i)=>Wi(i.borderColor),this.hoverColor=(e,i)=>Wi(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Bi(this,t,e)}get(t){return ns(this,t)}describe(t,e){return Bi(Xs,t,e)}override(t,e){return Bi(jt,t,e)}route(t,e,i,n){let r=ns(this,t),o=ns(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 P(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}},I=new Ui({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Nc(s){return!s||L(s.size)||L(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function rs(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 oo(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;le.length){for(l=0;l0&&s.stroke()}}function ke(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.xt.top-e&&s.y0&&r.strokeColor!=="",l,c;for(s.save(),s.font=n.string,zc(s,r),l=0;l+s||0;function Ks(s,t){let e={},i=P(t),n=i?Object.keys(t):t,r=P(s)?i?o=>C(s[o],s[t[o]]):o=>s[o]:()=>s;for(let o of n)e[o]=$c(r(o));return e}function un(s){return Ks(s,{top:"y",right:"x",bottom:"y",left:"x"})}function Zt(s){return Ks(s,["topLeft","topRight","bottomLeft","bottomRight"])}function st(s){let t=un(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function G(s,t){s=s||{},t=t||I.font;let e=C(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=C(s.style,t.style);i&&!(""+i).match(Bc)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");let n={family:C(s.family,t.family),lineHeight:Hc(C(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:C(s.weight,t.weight),string:""};return n.string=Nc(n),n}function De(s,t,e,i){let n=!0,r,o,a;for(r=0,o=s.length;re&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(n,r)}}function Rt(s,t){return Object.assign(Object.create(s),t)}function Js(s,t=[""],e=s,i,n=()=>s[0]){at(i)||(i=fo("_fallback",s));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:e,_fallback:i,_getTarget:n,override:o=>Js([o,...s],t,e,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete s[0][a],!0},get(o,a){return ho(o,a,()=>Kc(a,t,s,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(o,a){return Nr(o).includes(a)},ownKeys(o){return Nr(o)},set(o,a,l){let c=o._storage||(o._storage=n());return o[a]=c[a]=l,delete o._keys,!0}})}function re(s,t,e,i){let n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:dn(s,i),setContext:r=>re(s,r,e,i),override:r=>re(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 ho(r,o,()=>Uc(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 dn(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:Lt(e)?e:()=>e,isIndexable:Lt(i)?i:()=>i}}var jc=(s,t)=>s?s+Us(t):t,fn=(s,t)=>P(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ho(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t))return s[t];let i=e();return s[t]=i,i}function Uc(s,t,e){let{_proxy:i,_context:n,_subProxy:r,_descriptors:o}=s,a=i[t];return Lt(a)&&o.isScriptable(t)&&(a=Yc(t,a,s,e)),W(a)&&a.length&&(a=Zc(t,a,s,o.isIndexable)),fn(t,a)&&(a=re(a,n,r&&r[t],o)),a}function Yc(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);return a.add(s),t=t(r,o||i),a.delete(s),fn(s,t)&&(t=gn(n._scopes,n,s,t)),t}function Zc(s,t,e,i){let{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=e;if(at(r.index)&&i(s))t=t[r.index%t.length];else if(P(t[0])){let l=t,c=n._scopes.filter(h=>h!==l);t=[];for(let h of l){let u=gn(c,n,s,h);t.push(re(u,r,o&&o[s],a))}}return t}function uo(s,t,e){return Lt(s)?s(t,e):s}var qc=(s,t)=>s===!0?t:typeof s=="string"?Ft(t,s):void 0;function Xc(s,t,e,i,n){for(let r of t){let o=qc(e,r);if(o){s.add(o);let a=uo(o._fallback,e,n);if(at(a)&&a!==e&&a!==i)return a}else if(o===!1&&at(i)&&e!==i)return null}return!1}function gn(s,t,e,i){let n=t._rootScopes,r=uo(t._fallback,e,i),o=[...s,...n],a=new Set;a.add(i);let l=Rr(a,o,e,r||e,i);return l===null||at(r)&&r!==e&&(l=Rr(a,o,r,l,i),l===null)?!1:Js(Array.from(a),[""],n,r,()=>Gc(t,e,i))}function Rr(s,t,e,i,n){for(;e;)e=Xc(s,t,e,i,n);return e}function Gc(s,t,e){let i=s._getTarget();t in i||(i[t]={});let n=i[t];return W(n)&&P(e)?e:n}function Kc(s,t,e,i){let n;for(let r of t)if(n=fo(jc(r,s),e),at(n))return fn(s,n)?gn(e,i,s,n):n}function fo(s,t){for(let e of t){if(!e)continue;let i=e[s];if(at(i))return i}}function Nr(s){let t=s._keys;return t||(t=s._keys=Jc(s._scopes)),t}function Jc(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 mn(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;ats==="x"?"y":"x";function th(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 eh(s,t,e){let i=s.length,n,r,o,a,l,c=ve(s,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")ih(s,n);else{let c=i?s[s.length-1]:s[0];for(r=0,o=s.length;rwindow.getComputedStyle(s,null);function rh(s,t){return ti(s).getPropertyValue(t)}var oh=["top","right","bottom","left"];function ne(s,t,e){let i={};e=e?"-"+e:"";for(let n=0;n<4;n++){let r=oh[n];i[r]=parseFloat(s[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var ah=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function lh(s,t){let e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:r}=i,o=!1,a,l;if(ah(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 qt(s,t){if("native"in s)return s;let{canvas:e,currentDevicePixelRatio:i}=t,n=ti(e),r=n.boxSizing==="border-box",o=ne(n,"padding"),a=ne(n,"border","width"),{x:l,y:c,box:h}=lh(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 ch(s,t,e){let i,n;if(t===void 0||e===void 0){let r=Qs(s);if(!r)t=s.clientWidth,e=s.clientHeight;else{let o=r.getBoundingClientRect(),a=ti(r),l=ne(a,"border","width"),c=ne(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=js(a.maxWidth,r,"clientWidth"),n=js(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Hs,maxHeight:n||Hs}}var Hi=s=>Math.round(s*10)/10;function po(s,t,e,i){let n=ti(s),r=ne(n,"margin"),o=js(n.maxWidth,s,"clientWidth")||Hs,a=js(n.maxHeight,s,"clientHeight")||Hs,l=ch(s,t,e),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let u=ne(n,"border","width"),d=ne(n,"padding");c-=d.width+u.width,h-=d.height+u.height}return c=Math.max(0,c-r.width),h=Math.max(0,i?Math.floor(c/i):h-r.height),c=Hi(Math.min(c,o,l.maxWidth)),h=Hi(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Hi(c/2)),{width:c,height:h}}function bn(s,t,e){let i=t||1,n=Math.floor(s.height*i),r=Math.floor(s.width*i);s.height=n/i,s.width=r/i;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 bo=(function(){let s=!1;try{let t={get passive(){return s=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return s})();function yn(s,t){let e=rh(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 yo(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 xo(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 zr=new Map;function hh(s,t){t=t||{};let e=s+JSON.stringify(t),i=zr.get(e);return i||(i=new Intl.NumberFormat(s,t),zr.set(e,i)),i}function Ce(s,t,e){return hh(t,e).format(s)}var uh=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}}},dh=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function ae(s,t,e){return s?uh(t,e):dh()}function xn(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 _n(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function _o(s){return s==="angle"?{between:Oe,compare:gc,normalize:rt}:{between:Tt,compare:(t,e)=>t-e,normalize:t=>t}}function Vr({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 fh(s,t,e){let{property:i,start:n,end:r}=e,{between:o,normalize:a}=_o(i),l=t.length,{start:c,end:h,loop:u}=s,d,f;if(u){for(c+=l,h+=l,d=0,f=l;dl(n,_,b)&&a(n,_)!==0,x=()=>a(r,b)===0||l(r,_,b),k=()=>m||w(),v=()=>!m||x();for(let O=h,M=h;O<=u;++O)y=t[O%o],!y.skip&&(b=c(y[i]),b!==_&&(m=l(b,n,r),p===null&&k()&&(p=a(b,n)===0?O:M),p!==null&&v()&&(g.push(Vr({start:p,end:O,loop:d,count:o,style:f})),p=null),M=O,_=b));return p!==null&&g.push(Vr({start:p,end:u,loop:d,count:o,style:f})),g}function kn(s,t){let e=[],i=s.segments;for(let n=0;nn&&s[r%t].skip;)r--;return r%=t,{start:n,end:r}}function mh(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 wo(s,t){let e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];let r=!!s._loop,{start:o,end:a}=gh(e,n,r,i);if(i===!0)return Wr(s,[{start:o,end:a,loop:r}],e,t);let l=aa({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=tn.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)}},Nt=new In,ko="transparent",yh={boolean(s,t,e){return e>.5?t:s},color(s,t,e){let i=ln(s||ko),n=i.valid&&ln(t||ko);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}},An=class{constructor(t,e,i,n){let r=e[i];n=De([t.to,n,r,t.from]);let o=De([t.from,r,n]);this._active=!0,this._fn=t.fn||yh[t.type||typeof o],this._easing=_e[t.easing]||_e.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=De([t.to,e,n,t.from]),this._from=De([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||e1?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;ns!=="onProgress"&&s!=="onComplete"&&s!=="fn"});I.set("animations",{colors:{type:"color",properties:_h},numbers:{type:"number",properties:xh}});I.describe("animations",{_fallback:"animation"});I.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:s=>s|0}}}});var li=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{let n=t[i];if(!P(n))return;let r={};for(let o of wh)r[o]=n[o];(W(n.properties)&&n.properties||[i]).forEach(o=>{(o===i||!e.has(o))&&e.set(o,r)})})}_animateOptions(t,e){let i=e.options,n=vh(t,i);if(!n)return[];let r=this._createAnimations(n,i);return i.$shared&&kh(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 An(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 Nt.add(this._chart,i),!0}};function kh(s,t){let e=[],i=Object.keys(t);for(let n=0;n0||!e&&r<0)return n.index}return null}function To(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=Th(r,o,i),u=t.length,d;for(let f=0;fe[i].axis===t).shift()}function Eh(s,t){return Rt(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ph(s,t,e){return Rt(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function hs(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]}}}var Sn=s=>s==="reset"||s==="none",Do=(s,t)=>t?s:Object.assign({},s),Ih=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:fa(e,!0),values:null},ht=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.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Mo(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&hs(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=C(i.xAxisID,vn(t,"x")),o=e.yAxisID=C(i.yAxisID,vn(t,"y")),a=e.rAxisID=C(i.rAxisID,vn(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&&Ji(this._data,this),t._stacked&&hs(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(P(e))this._data=Oh(e);else if(i!==e){if(i){Ji(i,this);let n=this._cachedMeta;hs(n),n._parsed=[]}e&&Object.isExtensible(e)&&Jr(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=Mo(e.vScale,e),e.stack!==i.stack&&(n=!0,hs(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&To(this,e._parsed)}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{W(n[t])?d=this.parseArrayData(i,n,t,e):P(n[t])?d=this.parseObjectData(i,n,t,e):d=this.parsePrimitiveData(i,n,t,e);let f=()=>u[a]===null||c&&u[a]m||u=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=0&&tthis.getContext(i,n),m=c.resolveNamedOptions(d,f,g,u);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(Do(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 li(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||Sn(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){Sn(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Sn(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{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;an-r))}return s._cache.$bar}function Lh(s){let t=s.iScale,e=Ah(t,s.type),i=t._length,n,r,o,a,l=()=>{o===32767||o===-32768||(at(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(n=0,r=e.length;n0?n[s-1]:null,a=sMath.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 ga(s,t,e,i){return W(s)?Nh(s,t,e,i):t[e.axis]=e.parse(s,i),t}function Co(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=e?1:-1)}function Vh(s){let t,e,i,n,r;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{let c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(L(h)||isNaN(h))return!0};for(let l of n)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_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=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,{xScale:i,yScale:n}=e,r=this.getParsed(t),o=i.getLabelForValue(r.x),a=n.getLabelForValue(r.y),l=r._custom;return{label:e.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}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;dOe(_,a,l,!0)?1:Math.max(w,w*e,x,x*e),g=(_,w,x)=>Oe(_,a,l,!0)?-1:Math.min(w,w*e,x,x*e),m=f(0,c,u),p=f(U,h,d),b=g($,c,u),y=g($+U,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 Kt=class extends ht{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(P(i[t])){let{key:l="value"}=this._parsing;r=c=>+Ft(i[c],l)}let o,a;for(o=t,a=t+e;o0&&!isNaN(t)?V*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=Ce(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;ns!=="spacing",_indexable:s=>s!=="spacing"};Kt.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(s){let t=s.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=s.legend.options;return t.labels.map((i,n)=>{let o=s.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!s.getDataVisibility(n),index:n}})}return[]}},onClick(s,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(s){let t=s.label,e=": "+s.formattedValue;return W(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};var Le=class extends ht{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}=sn(e,n,o);this._drawStart=a,this._drawCount=l,nn(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=oe(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||n==="none",y=e>0&&this.getParsed(e-1);for(let _=e;_0&&Math.abs(x[d]-y[d])>p,m&&(k.parsed=x,k.raw=c.data[_]),u&&(k.options=h||this.resolveDataElementOptions(_,w.active?"active":n)),b||this.updateElement(w,_,k,n),y=x}}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()}};Le.id="line";Le.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Le.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var Fe=class extends ht{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=Ce(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return mn.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)&&(re.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=d,g,m=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?pt(this.resolveDataElementOptions(t,e).angle||i):0}};Fe.id="polarArea";Fe.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Fe.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(s){let t=s.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=s.legend.options;return t.labels.map((i,n)=>{let o=s.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!s.getDataVisibility(n),index:n}})}return[]}},onClick(s,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(s){return s.chart.data.labels[s.dataIndex]+": "+s.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var bs=class extends Kt{};bs.id="pie";bs.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Re=class extends ht{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 mn.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{n[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),n}};ut.defaults={};ut.defaultRoutes=void 0;var ma={values(s){return W(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=jh(s,e)}let o=ct(Math.abs(r)),a=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),Ce(s,i,l)},logarithmic(s,t,e){if(s===0)return"0";let i=s/Math.pow(10,Math.floor(ct(s)));return i===1||i===2||i===5?ma.numeric.call(this,s,t,e):""}};function jh(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 gi={formatters:ma};I.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(s,t)=>t.lineWidth,tickColor:(s,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:gi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});I.route("scale.ticks","color","","color");I.route("scale.grid","color","","borderColor");I.route("scale.grid","borderColor","","borderColor");I.route("scale.title","color","","color");I.describe("scale",{_fallback:!1,_scriptable:s=>!s.startsWith("before")&&!s.startsWith("after")&&s!=="callback"&&s!=="parser",_indexable:s=>s!=="borderDash"&&s!=="tickBorderDash"});I.describe("scales",{_fallback:"scale"});I.describe("scale.ticks",{_scriptable:s=>s!=="backdropPadding"&&s!=="callback",_indexable:s=>s!=="backdropPadding"});function Uh(s,t){let e=s.options.ticks,i=e.maxTicksLimit||Yh(s),n=e.major.enabled?qh(t):[],r=n.length,o=n[0],a=n[r-1],l=[];if(r>i)return Xh(t,l,n,r/i),l;let c=Zh(n,t,i);if(r>0){let h,u,d=r>1?Math.round((a-o)/(r-1)):null;for(ei(t,l,c,L(d)?0:o-d,o),h=0,u=r-1;hn)return l}return Math.max(n,1)}function qh(s){let t=[],e,i;for(e=0,i=s.length;es==="left"?"right":s==="right"?"left":s,Io=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e;function Ao(s,t){let e=[],i=s.length/t,n=s.length,r=0;for(;ro+a)))return l}function Qh(s,t){z(s,e=>{let i=e.gc,n=i.length/2,r;if(n>t){for(r=0;ri?i:e,i=n&&e>i?e:i,{min:lt(e,lt(i,e)),max:lt(i,lt(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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){B(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=co(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=J(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-us(t.grid)-e.padding-Lo(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=Ys(Math.min(Math.asin(J((h.highest.height+6)/a,-1,1)),Math.asin(J(l/c,-1,1))-Math.asin(J(d/c,-1,1)))),o=Math.max(n,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){B(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){B(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=Lo(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=us(r)+l):(t.height=this.maxHeight,t.width=us(r)+l),i.display&&this.ticks.length){let{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=i.padding*2,g=pt(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(){B(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({width:r[v]||0,height:o[v]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(x),widths:r,heights:o}}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 qr(this._alignToPixels?Ut(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&&ta*n?a/i:l/n:l*n0}_computeGridLineItems(t){let e=this.axis,i=this.chart,n=this.options,{grid:r,position:o}=n,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),u=us(r),d=[],f=r.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,m=g/2,p=function(D){return Ut(i,D,g)},b,y,_,w,x,k,v,O,M,E,F,A;if(o==="top")b=p(this.bottom),k=this.bottom-u,O=b-m,E=p(t.top)+m,A=t.bottom;else if(o==="bottom")b=p(this.top),E=t.top,A=p(t.bottom)-m,k=b+m,O=this.top+u;else if(o==="left")b=p(this.right),x=this.right-u,v=b-m,M=p(t.left)+m,F=t.right;else if(o==="right")b=p(this.left),M=t.left,F=p(t.right)-m,x=b+m,v=this.left+u;else if(e==="x"){if(o==="center")b=p((t.top+t.bottom)/2+.5);else if(P(o)){let D=Object.keys(o)[0],X=o[D];b=p(this.chart.scales[D].getPixelForValue(X))}E=t.top,A=t.bottom,k=b+m,O=k+u}else if(e==="y"){if(o==="center")b=p((t.left+t.right)/2);else if(P(o)){let D=Object.keys(o)[0],X=o[D];b=p(this.chart.scales[D].getPixelForValue(X))}x=b-m,v=x-u,M=t.left,F=t.right}let q=C(n.ticks.maxTicksLimit,h),nt=Math.max(1,Math.ceil(h/q));for(y=0;yr.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{this.draw(n)}}]:[{z:i,draw:n=>{this.drawBackground(),this.drawGrid(n),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:n=>{this.drawLabels(n)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[],r,o;for(r=0,o=e.length;r{let i=e.split("."),n=i.pop(),r=[s].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");I.route(r,n,l,a)})}function ou(s){return"id"in s&&"defaults"in s}var Ln=class{constructor(){this.controllers=new Pe(ht,"datasets",!0),this.elements=new Pe(ut,"elements"),this.plugins=new Pe(Object,"plugins"),this.scales=new Pe(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):z(n,o=>{let a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){let n=Us(t);B(i["before"+n],[],i),e[t](i),B(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let w=e;w0&&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}};Ne.id="scatter";Ne.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ne.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(s){return"("+s.label+", "+s.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var au=Object.freeze({__proto__:null,BarController:Ie,BubbleController:Ae,DoughnutController:Kt,LineController:Le,PolarAreaController:Fe,PieController:bs,RadarController:Re,ScatterController:Ne});function le(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var ys=class{constructor(t){this.options=t||{}}init(t){}formats(){return le()}parse(t,e){return le()}format(t,e){return le()}add(t,e,i){return le()}diff(t,e,i){return le()}startOf(t,e,i){return le()}endOf(t,e){return le()}};ys.override=function(s){Object.assign(ys.prototype,s)};var Un={_date:ys};function lu(s,t,e,i){let{controller:n,data:r,_sorted:o}=s,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){let l=a._reversePixels?Xr:Mt;if(i){if(n._sharedOptions){let c=r[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){let u=l(r,t,e-h),d=l(r,t,e+h);return{lo:u.lo,hi:d.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function Ms(s,t,e,i,n){let r=s.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a{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 du={evaluateInteractionItems:Ms,modes:{index(s,t,e,i){let n=qt(t,s),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?On(s,n,r,i,o):Tn(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=qt(t,s),r=e.axis||"xy",o=e.includeInvisible||!1,a=e.intersect?On(s,n,r,i,o):Tn(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;he.pos===t)}function Ro(s,t){return s.filter(e=>pa.indexOf(e.pos)===-1&&e.box.axis===t)}function fs(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 fu(s){let t=[],e,i,n,r,o,a;for(e=0,i=(s||[]).length;ec.box.fullSize),!0),i=fs(ds(t,"left"),!0),n=fs(ds(t,"right")),r=fs(ds(t,"top"),!0),o=fs(ds(t,"bottom")),a=Ro(t,"x"),l=Ro(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:ds(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:r.concat(o).concat(a)}}function No(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function ba(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 bu(s,t,e,i){let{pos:n,box:r}=e,o=s.maxPadding;if(!P(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&&ba(o,r.getPadding());let a=Math.max(0,t.outerWidth-No(o,s,"left","right")),l=Math.max(0,t.outerHeight-No(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 yu(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 xu(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 ms(s,t,e,i){let n=[],r,o,a,l,c,h;for(r=0,o=s.length,c=0;r{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);ba(d,st(i));let f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),g=mu(l.concat(c),u);ms(a.fullSize,f,u,g),ms(l,f,u,g),ms(c,f,u,g)&&ms(l,f,u,g),yu(f),zo(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,zo(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},z(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})})}},ci=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){}},Fn=class extends ci{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},ai="$chartjs",_u={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vo=s=>s===null||s==="";function wu(s,t){let e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[ai]={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",Vo(n)){let r=yn(s,"width");r!==void 0&&(s.width=r)}if(Vo(i))if(s.style.height==="")s.height=s.width/(t||2);else{let r=yn(s,"height");r!==void 0&&(s.height=r)}return s}var ya=bo?{passive:!0}:!1;function ku(s,t,e){s.addEventListener(t,e,ya)}function vu(s,t,e){s.canvas.removeEventListener(t,e,ya)}function Su(s,t){let e=_u[s.type]||s.type,{x:i,y:n}=qt(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function hi(s,t){for(let e of s)if(e===t||e.contains(t))return!0}function Mu(s,t,e){let i=s.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||hi(a.addedNodes,i),o=o&&!hi(a.removedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Ou(s,t,e){let i=s.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||hi(a.removedNodes,i),o=o&&!hi(a.addedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}var xs=new Map,Wo=0;function xa(){let s=window.devicePixelRatio;s!==Wo&&(Wo=s,xs.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Tu(s,t){xs.size||window.addEventListener("resize",xa),xs.set(s,t)}function Du(s){xs.delete(s),xs.size||window.removeEventListener("resize",xa)}function Cu(s,t,e){let i=s.canvas,n=i&&Qs(i);if(!n)return;let r=en((a,l)=>{let c=n.clientWidth;e(a,l),c{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(n),Tu(s,r),o}function Dn(s,t,e){e&&e.disconnect(),t==="resize"&&Du(s)}function Eu(s,t,e){let i=s.canvas,n=en(r=>{s.ctx!==null&&e(Su(r,s))},s,r=>{let o=r[0];return[o,o.offsetX,o.offsetY]});return ku(i,t,n),n}var Rn=class extends ci{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(wu(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[ai])return!1;let i=e[ai].initial;["height","width"].forEach(r=>{let o=i[r];L(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[ai],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),o={attach:Mu,detach:Ou,resize:Cu}[e]||Eu;n[e]=o(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Dn,detach:Dn,resize:Dn}[e]||vu)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return po(t,e,i,n)}isAttached(t){let e=Qs(t);return!!(e&&e.isConnected)}};function Pu(s){return!pn()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?Fn:Rn}var Nn=class{constructor(){this._init=[]}notify(t,e,i,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));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")),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(B(a,l,o)===!1&&n.cancelable)return!1}return!0}invalidate(){L(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=C(i.options&&i.options.plugins,{}),r=Iu(i);return n===!1&&!e?[]:Lu(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 Iu(s){let t={},e=[],i=Object.keys(Ct.plugins.items);for(let r=0;r{let l=i[a];if(!P(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let c=Vn(a,l),h=Nu(c,n),u=e.scales||{};r[c]=r[c]||a,o[a]=Se(Object.create(null),[{axis:c},l,u[c],u[h]])}),s.data.datasets.forEach(a=>{let l=a.type||s.type,c=a.indexAxis||zn(l,t),u=(jt[l]||{}).scales||{};Object.keys(u).forEach(d=>{let f=Ru(d,c),g=a[f+"AxisID"]||r[f]||f;o[g]=o[g]||Object.create(null),Se(o[g],[{axis:f},i[g],u[d]])})}),Object.keys(o).forEach(a=>{let l=o[a];Se(l,[I.scales[l.type],I.scale])}),o}function _a(s){let t=s.options||(s.options={});t.plugins=C(t.plugins,{}),t.scales=Vu(s,t)}function wa(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function Wu(s){return s=s||{},s.data=wa(s.data),_a(s),s}var Bo=new Map,ka=new Set;function ii(s,t){let e=Bo.get(s);return e||(e=t(),Bo.set(s,e),ka.add(e)),e}var gs=(s,t,e)=>{let i=Ft(t,e);i!==void 0&&s.add(i)},Wn=class{constructor(t){this._config=Wu(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=wa(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(),_a(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ii(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ii(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ii(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return ii(`${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=>gs(l,t,u))),h.forEach(u=>gs(l,n,u)),h.forEach(u=>gs(l,jt[r]||{},u)),h.forEach(u=>gs(l,I,u)),h.forEach(u=>gs(l,Xs,u))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ka.has(e)&&o.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,jt[e]||{},I.datasets[e]||{},{type:e},I,Xs]}resolveNamedOptions(t,e,i,n=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=Ho(this._resolverCache,t,n),l=o;if(Hu(o,e)){r.$shared=!1,i=Lt(i)?i():i;let c=this.createResolver(t,i,a);l=re(o,i,c)}for(let c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],n){let{resolver:r}=Ho(this._resolverCache,t,i);return P(e)?re(r,e,void 0,n):r}};function Ho(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:Js(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,r)),r}var Bu=s=>P(s)&&Object.getOwnPropertyNames(s).reduce((t,e)=>t||Lt(s[e]),!1);function Hu(s,t){let{isScriptable:e,isIndexable:i}=dn(s);for(let n of t){let r=e(n),o=i(n),a=(o||r)&&s[n];if(r&&(Lt(a)||Bu(a))||o&&W(a))return!0}return!1}var $u="3.9.1",ju=["top","bottom","left","right","chartArea"];function $o(s,t){return s==="top"||s==="bottom"||ju.indexOf(s)===-1&&t==="x"}function jo(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function Uo(s){let t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),B(e&&e.onComplete,[s],t)}function Uu(s){let t=s.chart,e=t.options.animation;B(e&&e.onProgress,[s],t)}function va(s){return pn()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}var ui={},Sa=s=>{let t=va(s);return Object.values(ui).filter(e=>e.canvas===t).pop()};function Yu(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 Zu(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}var he=class{constructor(t,e){let i=this.config=new Wn(e),n=va(t),r=Sa(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||Pu(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=Hr(),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 Nn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Qr(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],ui[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Nt.listen(this,"complete",Uo),Nt.listen(this,"progress",Uu),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return L(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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():bn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return cn(this.canvas,this.ctx),this}stop(){return Nt.stop(this),this}resize(t,e){Nt.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,bn(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),B(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};z(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=Vn(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),z(r,o=>{let a=o.options,l=a.id,c=Vn(l,a),h=C(a.type,o.dtype);(a.position===void 0||$o(a.position,c)!==$o(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=Ct.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(a,t)}),z(n,(o,a)=>{o||delete i[a]}),z(i,o=>{it.configure(this,o,o.options),it.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;ne.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{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{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(jo("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){z(this.scales,t=>{it.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Zi(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;Yu(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;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;it.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],z(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=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,n=!i.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(n&&ls(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&cs(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ke(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){let r=du.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=Rt(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);at(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(),Nt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,r,o),t[r]=o},n=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};z(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(){z(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},z(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{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}});!os(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_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=Ur(t),c=Zu(t,this._lastEvent,i,l);i&&(this._lastEvent=null,B(r.onHover,[t,a,this],this),l&&B(r.onClick,[t,a,this],this));let h=!os(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)}},Yo=()=>z(he.instances,s=>s._plugins.invalidate()),Xt=!0;Object.defineProperties(he,{defaults:{enumerable:Xt,value:I},instances:{enumerable:Xt,value:ui},overrides:{enumerable:Xt,value:jt},registry:{enumerable:Xt,value:Ct},version:{enumerable:Xt,value:$u},getChart:{enumerable:Xt,value:Sa},register:{enumerable:Xt,value:(...s)=>{Ct.add(...s),Yo()}},unregister:{enumerable:Xt,value:(...s)=>{Ct.remove(...s),Yo()}}});function Ma(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+U,i-U),s.closePath(),s.clip()}function qu(s){return Ks(s,["outerStart","outerEnd","innerStart","innerEnd"])}function Xu(s,t,e,i){let n=qu(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 J(l,0,Math.min(r,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:J(n.innerStart,0,o),innerEnd:J(n.innerEnd,0,o)}}function Ee(s,t,e,i){return{x:e+s*Math.cos(t),y:i+s*Math.sin(t)}}function Bn(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 D=h>0?h-i:0,X=u>0?u-i:0,Z=(D+X)/2,ie=Z!==0?g*Z/(Z+i):g;f=(g-ie)/2}let m=Math.max(.001,g*u-e/$)/u,p=(g-m)/2,b=l+p+f,y=n-p-f,{outerStart:_,outerEnd:w,innerStart:x,innerEnd:k}=Xu(t,d,u,y-b),v=u-_,O=u-w,M=b+_/v,E=y-w/O,F=d+x,A=d+k,q=b+x/F,nt=y-k/A;if(s.beginPath(),r){if(s.arc(o,a,u,M,E),w>0){let Z=Ee(O,E,o,a);s.arc(Z.x,Z.y,w,E,y+U)}let D=Ee(A,y,o,a);if(s.lineTo(D.x,D.y),k>0){let Z=Ee(A,nt,o,a);s.arc(Z.x,Z.y,k,y+U,nt+Math.PI)}if(s.arc(o,a,d,y-k/d,b+x/d,!0),x>0){let Z=Ee(F,q,o,a);s.arc(Z.x,Z.y,x,q+Math.PI,b-U)}let X=Ee(v,b,o,a);if(s.lineTo(X.x,X.y),_>0){let Z=Ee(v,M,o,a);s.arc(Z.x,Z.y,_,b-U,M)}}else{s.moveTo(o,a);let D=Math.cos(M)*u+o,X=Math.sin(M)*u+a;s.lineTo(D,X);let Z=Math.cos(E)*u+o,ie=Math.sin(E)*u+a;s.lineTo(Z,ie)}s.closePath()}function Gu(s,t,e,i,n){let{fullCircles:r,startAngle:o,circumference:a}=t,l=t.endAngle;if(r){Bn(s,t,e,i,o+V,n);for(let c=0;c=V||Oe(r,a,l),m=Tt(o,c+d,h+d);return g&&m}getCenterPoint(t){let{x:e,y:i,startAngle:n,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(n+r)/2,u=(o+a+c+l)/2;return{x:e+Math.cos(h)*u,y:i+Math.sin(h)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,n=(e.offset||0)/2,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>V?Math.floor(i/V):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=$&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;let l=Gu(t,this,a,r,o);Ju(t,this,a,r,l,o),t.restore()}};ze.id="arc";ze.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};ze.defaultRoutes={backgroundColor:"backgroundColor"};function Oa(s,t,e=t){s.lineCap=C(e.borderCapStyle,t.borderCapStyle),s.setLineDash(C(e.borderDash,t.borderDash)),s.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),s.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=C(e.borderWidth,t.borderWidth),s.strokeStyle=C(e.borderColor,t.borderColor)}function Qu(s,t,e){s.lineTo(e.x,e.y)}function td(s){return s.stepped?ao:s.tension||s.cubicInterpolationMode==="monotone"?lo:Qu}function Ta(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=na&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(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?(xp&&(p=x),h=(u*h+w)/++u):(_(),s.lineTo(w,x),g=k,u=0,m=p=x),b=x}_()}function Hn(s){let t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?sd:ed}function id(s){return s.stepped?yo:s.tension||s.cubicInterpolationMode==="monotone"?xo:Bt}function nd(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),Oa(s,t.options),s.stroke(n)}function rd(s,t,e,i){let{segments:n,options:r}=t,o=Hn(t);for(let a of n)Oa(s,r,a.style),s.beginPath(),o(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}var od=typeof Path2D=="function";function ad(s,t,e,i){od&&!t.options.segment?nd(s,t,e,i):rd(s,t,e,i)}var Et=class extends ut{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;mo(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=wo(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=kn(this,{property:e,start:n,end:n});if(!o.length)return;let a=[],l=id(i),c,h;for(c=0,h=o.length;cs!=="borderDash"&&s!=="fill"};function Zo(s,t,e,i){let n=s.options,{[e]:r}=s.getProps([e],i);return Math.abs(t-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;uf&&(f=g,d=s[y],m=y);o[l++]=d,h=m}return o[l++]=s[c],o}function md(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;om&&(m=c,d=o),n=(r*n+a.x)/++r;else{let k=o-1;if(!L(u)&&!L(d)){let v=Math.min(u,d),O=Math.max(u,d);v!==f&&v!==k&&p.push({...s[v],x:n}),O!==f&&O!==k&&p.push({...s[O],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 Ca(s){if(s._decimated){let t=s._data;delete s._decimated,delete s._data,Object.defineProperty(s,"data",{value:t})}}function qo(s){s.data.datasets.forEach(t=>{Ca(t)})}function pd(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=J(Mt(t,r.axis,o).lo,0,e-1)),c?n=J(Mt(t,r.axis,a).hi+1,i,e)-i:n=e-i,{start:i,count:n}}var bd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(s,t,e)=>{if(!e.enabled){qo(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(De([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}=pd(l,c),f=e.threshold||4*i;if(d<=f){Ca(n);return}L(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=gd(c,u,d,i,e);break;case"min-max":g=md(c,u,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=g})},destroy(s){qo(s)}};function yd(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=Yn(l,c,n);let h=$n(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=kn(t,h);for(let d of u){let f=$n(e,r[d.start],r[d.end],d.loop),g=wn(a,n,f);for(let m of g)o.push({source:m,target:d,start:{[e]:Xo(h,f,"start",Math.max)},end:{[e]:Xo(h,f,"end",Math.min)}})}}return o}function $n(s,t,e,i){if(i)return;let n=t[s],r=e[s];return s==="angle"&&(n=rt(n),r=rt(r)),{property:s,start:n,end:r}}function xd(s,t){let{x:e=null,y:i=null}=s||{},n=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Yn(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 Yn(s,t,e){for(;t>s;t--){let i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Xo(s,t,e,i){return s&&t?i(s[e],t[e]):s?s[e]:t?t[e]:0}function Ea(s,t){let e=[],i=!1;return W(s)?(i=!0,e=s):e=xd(s,t),e.length?new Et({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Go(s){return s&&s.fill!==!1}function _d(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 wd(s,t,e){let i=Md(s);if(P(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return Y(n)&&Math.floor(n)===n?kd(i[0],t,n,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function kd(s,t,e,i){return(s==="-"||s==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function vd(s,t){let e=null;return s==="start"?e=t.bottom:s==="end"?e=t.top:P(s)?e=t.getPixelForValue(s.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Sd(s,t,e){let i;return s==="start"?i=e:s==="end"?i=t.options.reverse?t.min:t.max:P(s)?i=s.value:i=t.getBaseValue(),i}function Md(s){let t=s.options,e=t.fill,i=C(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Od(s){let{scale:t,index:e,line:i}=s,n=[],r=i.segments,o=i.points,a=Td(t,e);a.push(Ea({x:null,y:t.bottom},i));for(let l=0;l=0;--o){let a=n[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Pn(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;Go(r)&&Pn(s.ctx,r,s.chartArea)}},beforeDatasetDraw(s,t,e){let i=t.meta.$filler;!Go(i)||e.drawTime!=="beforeDatasetDraw"||Pn(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},ta=(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)}},zd=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index,fi=class extends ut{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=B(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=G(i.font),r=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ta(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,r,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 y=i+e/2+r.measureText(p.text).width;b>0&&f+n+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:n},d=Math.max(d,y),f+=n+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=ae(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;ls(t,this),this._draw(),cs(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:o}=t,a=I.color,l=ae(t.rtl,this.left,this.width),c=G(o.font),{color:h,padding:u}=o,d=c.size,f=d/2,g;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:m,boxHeight:p,itemHeight:b}=ta(o,d),y=function(v,O,M){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;n.save();let E=C(M.lineWidth,1);if(n.fillStyle=C(M.fillStyle,a),n.lineCap=C(M.lineCap,"butt"),n.lineDashOffset=C(M.lineDashOffset,0),n.lineJoin=C(M.lineJoin,"miter"),n.lineWidth=E,n.strokeStyle=C(M.strokeStyle,a),n.setLineDash(C(M.lineDash,[])),o.usePointStyle){let F={radius:p*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:E},A=l.xPlus(v,m/2),q=O+f;hn(n,F,A,q,o.pointStyleWidth&&m)}else{let F=O+Math.max((d-p)/2,0),A=l.leftForLtr(v,m),q=Zt(M.borderRadius);n.beginPath(),Object.values(q).some(nt=>nt!==0)?Te(n,{x:A,y:F,w:m,h:p,radius:q}):n.rect(A,F,m,p),n.fill(),E!==0&&n.stroke()}n.restore()},_=function(v,O,M){Yt(n,M.text,v,O+b/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},w=this.isHorizontal(),x=this._computeTitleHeight();w?g={x:et(r,this.left+u,this.right-i[0]),y:this.top+u+x,line:0}:g={x:this.left+u,y:et(r,this.top+x+u,this.bottom-e[0].height),line:0},xn(this.ctx,t.textDirection);let k=b+u;this.legendItems.forEach((v,O)=>{n.strokeStyle=v.fontColor||h,n.fillStyle=v.fontColor||h;let M=n.measureText(v.text).width,E=l.textAlign(v.textAlign||(v.textAlign=o.textAlign)),F=m+f+M,A=g.x,q=g.y;l.setWidth(this.width),w?O>0&&A+F+u>this.right&&(q=g.y+=k,g.line++,A=g.x=et(r,this.left+u,this.right-i[g.line])):O>0&&q+k>this.bottom&&(A=g.x=A+e[g.line].width+u,g.line++,q=g.y=et(r,this.top+x+u,this.bottom-e[g.line].height));let nt=l.x(A);y(nt,q,v),A=to(E,A+m+f,w?A+F:this.right,t.rtl),_(l.x(A),q,v),w?g.x+=F+u:g.y+=k}),_n(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,i=G(e.font),n=st(e.padding);if(!e.display)return;let r=ae(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(qs(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Yt(o,e.text,f,h,i)}_computeTitleHeight(){let t=this.options.title,e=G(t.font),i=st(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(Tt(t,this.left,this.right)&&Tt(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;is.chart.options.color,boxWidth:40,padding:10,generateLabels(s){let t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:r}}=s.legend.options;return s._getSortedDatasetMetas().map(o=>{let a=o.controller.getStyle(e?0:void 0),l=st(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:o.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)}}},_s=class extends ut{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=W(i.text)?i.text.length:1;this._padding=st(i.padding);let r=n*G(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=$*-.5):(h=r-t,u=et(a,e,n),l=$*.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=G(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Yt(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:qs(e.align),textBaseline:"middle",translation:[o,a]})}};function Bd(s,t){let e=new _s({ctx:s.ctx,options:t,chart:s});it.configure(s,e,t),it.addBox(s,e),s.titleBlock=e}var Hd={id:"title",_element:_s,start(s,t,e){Bd(s,e)},stop(s){let t=s.titleBlock;it.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){let i=s.titleBlock;it.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}},ni=new WeakMap,$d={id:"subtitle",start(s,t,e){let i=new _s({ctx:s.ctx,options:e,chart:s});it.configure(s,i,e),it.addBox(s,i),ni.set(s,i)},stop(s){it.removeBox(s,ni.get(s)),ni.delete(s)},beforeUpdate(s,t,e){let i=ni.get(s);it.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}},ps={average(s){if(!s.length)return!1;let t,e,i=0,n=0,r=0;for(t=0,e=s.length;t-1?s.split(` `):s}function jd(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 ea(s,t){let e=s.chart.ctx,{body:i,footer:n,title:r}=s,{boxWidth:o,boxHeight:a}=t,l=G(t.bodyFont),c=G(t.titleFont),h=G(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,z(s.title,_),e.font=l.string,z(s.beforeBody.concat(s.afterBody),_),y=t.displayColors?o+2+t.boxPadding:0,z(i,w=>{z(w.before,_),z(w.lines,_),z(w.after,_)}),y=0,e.font=h.string,z(s.footer,_),e.restore(),p+=g.width,{width:p,height:m}}function Ud(s,t){let{y:e,height:i}=t;return es.height-i/2?"bottom":"center"}function Yd(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 Zd(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"),Yd(c,s,t,e)&&(c="center"),c}function sa(s,t,e){let i=e.yAlign||t.yAlign||Ud(s,e);return{xAlign:e.xAlign||t.xAlign||Zd(s,t,e,i),yAlign:i}}function qd(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Xd(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function ia(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}=Zt(o),g=qd(t,a),m=Xd(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:J(g,0,i.width-t.width),y:J(m,0,i.height-t.height)}}function ri(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 na(s){return Dt([],zt(s))}function Gd(s,t,e){return Rt(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ra(s,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}var ws=class extends ut{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){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 li(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Gd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]),a=[];return a=Dt(a,zt(n)),a=Dt(a,zt(r)),a=Dt(a,zt(o)),a}getBeforeBody(t,e){return na(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){let{callbacks:i}=e,n=[];return z(t,r=>{let o={before:[],lines:[],after:[]},a=ra(i,r);Dt(o.before,zt(a.beforeLabel.call(this,r))),Dt(o.lines,a.label.call(this,r)),Dt(o.after,zt(a.afterLabel.call(this,r))),n.push(o)}),n}getAfterBody(t,e){return na(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){let{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]),a=[];return a=Dt(a,zt(n)),a=Dt(a,zt(r)),a=Dt(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;lt.filter(h,u,d,i))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,i))),z(a,h=>{let u=ra(t.callbacks,h);n.push(u.labelColor.call(this,h)),r.push(u.labelPointStyle.call(this,h)),o.push(u.labelTextColor.call(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=ps[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=ea(this,i),c=Object.assign({},a,l),h=sa(this.chart,i,c),u=ia(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}=Zt(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=ae(i.rtl,this.x,this.width);for(t.x=ri(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=G(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l_!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Te(t,{x:p,y:m,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Te(t,{x:b,y:m+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(p,m,c,l),t.strokeRect(p,m,c,l),t.fillStyle=o.backgroundColor,t.fillRect(b,m+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=G(i.bodyFont),d=u.lineHeight,f=0,g=ae(i.rtl,this.x,this.width),m=function(O){e.fillText(O,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=ri(this,p,i),e.fillStyle=i.bodyColor,z(this.beforeBody,m),f=a&&p!=="right"?o==="center"?c/2+h:c+2+h:0,w=0,k=n.length;w0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){let o=ps[t.position].call(this,this._active,this._eventPosition);if(!o)return;let a=this._size=ea(this,t),l=Object.assign({},o,this._size),c=sa(e,t,l),h=ia(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),xn(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),_n(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=!os(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||!os(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;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=ps[r.position].call(this,t,e);return o!==!1&&(i!==o.x||n!==o.y)}};ws.positioners=ps;var Kd={id:"tooltip",_element:ws,positioners:ps,afterInit(s,t,e){e&&(s.tooltip=new ws({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)===!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:{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.dataIndexs!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Jd=Object.freeze({__proto__:null,Decimation:bd,Filler:Nd,Legend:Wd,SubTitle:$d,Title:Hd,Tooltip:Kd}),Qd=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function tf(s,t,e,i){let n=s.indexOf(t);if(n===-1)return Qd(s,t,e,i);let r=s.lastIndexOf(t);return n!==r?e:n}var ef=(s,t)=>s===null?null:J(Math.round(s),0,t),Be=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(L(t))return null;let i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:tf(i,t,C(e,t),this._addedLabels),ef(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){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};Be.id="category";Be.defaults={ticks:{callback:Be.prototype.getLabelForValue}};function sf(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=!L(o),y=!L(a),_=!L(c),w=(p-m)/(u+1),x=qi((p-m)/g/f)*f,k,v,O,M;if(x<1e-14&&!b&&!y)return[{value:m},{value:p}];M=Math.ceil(p/x)-Math.floor(m/x),M>g&&(x=qi(M*x/g/f)*f),L(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),n==="ticks"?(v=Math.floor(m/x)*x,O=Math.ceil(p/x)*x):(v=m,O=p),b&&y&&r&&Zr((a-o)/r,x/1e3)?(M=Math.round(Math.min((a-o)/x,h)),x=(a-o)/M,v=o,O=a):_?(v=b?o:v,O=y?a:O,M=c-1,x=(O-v)/M):(M=(O-v)/x,Me(M,Math.round(M),x/1e3)?M=Math.round(M):M=Math.ceil(M));let E=Math.max(Gi(x),Gi(v));k=Math.pow(10,L(l)?E:l),v=Math.round(v*k)/k,O=Math.round(O*k)/k;let F=0;for(b&&(d&&v!==o?(e.push({value:o}),vn=e?n:l,a=l=>r=i?r:l;if(t){let l=wt(n),c=wt(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(n===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(l=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=sf(n,r);return t.bounds==="ticks"&&Xi(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 Ce(t,this.chart.options.locale,this.options.ticks.format)}},ks=class extends He{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=pt(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}};ks.id="linear";ks.defaults={ticks:{callback:gi.formatters.numeric}};function aa(s){return s/Math.pow(10,Math.floor(ct(s)))===1}function nf(s,t){let e=Math.floor(ct(t.max)),i=Math.ceil(t.max/Math.pow(10,e)),n=[],r=lt(s.min,Math.pow(10,Math.floor(ct(t.min)))),o=Math.floor(ct(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do n.push({value:r,major:aa(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o0?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.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,n=this.max,r=l=>i=t?i:l,o=l=>n=e?n:l,a=(l,c)=>Math.pow(10,Math.floor(ct(l))+c);i===n&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(n,1)))),i<=0&&r(a(n,-1)),n<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=n}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=nf(e,this);return t.bounds==="ticks"&&Xi(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":Ce(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=ct(t),this._valueRange=ct(this.max)-ct(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ct(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};vs.id="logarithmic";vs.defaults={ticks:{callback:gi.formatters.logarithmic,major:{enabled:!0}}};function jn(s){let t=s.ticks;if(t.display&&s.display){let e=st(t.backdropPadding);return C(t.font&&t.font.size,I.font.size)+e.height}return 0}function rf(s,t,e){return e=W(e)?e:[e],{w:oo(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}:sn?{start:t-e,end:t}:{start:t,end:t+e}}function of(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?$/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,s.r=Math.max(s.r,t.r+a)),n.startt.b&&(l=(n.end-t.b)/o,s.b=Math.max(s.b,t.b+l))}function lf(s,t,e){let i=[],n=s._pointLabels.length,r=s.options,o=jn(r)/2,a=s.drawingArea,l=r.pointLabels.centerPointLabels?$/n:0;for(let c=0;c270||e<90)&&(s-=t),s}function df(s,t){let{ctx:e,options:{pointLabels:i}}=s;for(let n=t-1;n>=0;n--){let r=i.setContext(s.getPointLabelContext(n)),o=G(r.font),{x:a,y:l,textAlign:c,left:h,top:u,right:d,bottom:f}=s._pointLabelItems[n],{backdropColor:g}=r;if(!L(g)){let m=Zt(r.borderRadius),p=st(r.backdropPadding);e.fillStyle=g;let b=h-p.left,y=u-p.top,_=d-h+p.width,w=f-u+p.height;Object.values(m).some(x=>x!==0)?(e.beginPath(),Te(e,{x:b,y,w:_,h:w,radius:m}),e.fill()):e.fillRect(b,y,_,w)}Yt(e,s._pointLabels[n],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function Pa(s,t,e,i){let{ctx:n}=s;if(e)n.arc(s.xCenter,s.yCenter,t,0,V);else{let r=s.getPointPosition(0,t);n.moveTo(r.x,r.y);for(let o=1;o{let n=B(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?of(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=V/(this._pointLabels.length||1),i=this.options.startAngle||0;return rt(t*e+pt(i))}getDistanceFromCenterForValue(t){if(L(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(L(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);let u=n.setContext(this.getContext(h-1));ff(this,u,a,r)}}),i.display){for(t.save(),o=r-1;o>=0;o--){let c=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:u}=c;!u||!h||(t.lineWidth=u,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.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&&!e.reverse)return;let c=i.setContext(this.getContext(l)),h=G(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)}Yt(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}};ue.id="radialLinear";ue.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:gi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(s){return s},padding:5,centerPointLabels:!1}};ue.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};ue.descriptors={angleLines:{_fallback:"grid"}};var mi={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}},ot=Object.keys(mi);function mf(s,t){return s-t}function ca(s,t){if(L(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"&&(oe(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,n)),+o)}function ha(s,t,e,i){let n=ot.length;for(let r=ot.indexOf(s);r=ot.indexOf(e);r--){let o=ot[r];if(mi[o].common&&s._adapter.diff(n,i,o)>=t-1)return o}return ot[e?ot.indexOf(e):0]}function bf(s){for(let t=ot.indexOf(s)+1,e=ot.length;t=t?e[i]:e[n];s[r]=!0}}function yf(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 da(s,t,e){let i=[],n={},r=t.length,o,a;for(o=0;o+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=J(e,0,o),i=J(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||ha(r.minUnit,e,i,this._getLabelCapacity(e)),a=C(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=oe(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;dm-p).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)}_tickFormatFunction(t,e,i,n){let r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],u=i[e],d=l&&h&&u&&u.major,f=this._adapter.format(t,n||(d?h:c)),g=r.ticks.callback;return g?B(g,[f,e,i],this):f}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?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=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 Ss=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=oi(e,this.min),this._tableRange=oi(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=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=0?g:1e3+g,(d-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},Aa={};function Of(s,t={}){let e=JSON.stringify([s,t]),i=Aa[e];return i||(i=new Intl.ListFormat(s,t),Aa[e]=i),i}var or=new Map;function ar(s,t={}){let e=JSON.stringify([s,t]),i=or.get(e);return i===void 0&&(i=new Intl.DateTimeFormat(s,t),or.set(e,i)),i}var lr=new Map;function Tf(s,t={}){let e=JSON.stringify([s,t]),i=lr.get(e);return i===void 0&&(i=new Intl.NumberFormat(s,t),lr.set(e,i)),i}var cr=new Map;function Df(s,t={}){let{base:e,...i}=t,n=JSON.stringify([s,i]),r=cr.get(n);return r===void 0&&(r=new Intl.RelativeTimeFormat(s,t),cr.set(n,r)),r}var Ts=null;function Cf(){return Ts||(Ts=new Intl.DateTimeFormat().resolvedOptions().locale,Ts)}var hr=new Map;function Dl(s){let t=hr.get(s);return t===void 0&&(t=new Intl.DateTimeFormat(s).resolvedOptions(),hr.set(s,t)),t}var ur=new Map;function Ef(s){let t=ur.get(s);if(!t){let e=new Intl.Locale(s);t="getWeekInfo"in e?e.getWeekInfo():e.weekInfo,"minimalDays"in t||(t={...Cl,...t}),ur.set(s,t)}return t}function Pf(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=ar(s).resolvedOptions(),n=s}catch{let l=s.substring(0,e);i=ar(l).resolvedOptions(),n=l}let{numberingSystem:r,calendar:o}=i;return[n,r,o]}}function If(s,t,e){return(e||t)&&(s.includes("-u-")||(s+="-u"),e&&(s+=`-ca-${e}`),t&&(s+=`-nu-${t}`)),s}function Af(s){let t=[];for(let e=1;e<=12;e++){let i=R.utc(2009,e,1);t.push(s(i))}return t}function Lf(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 pi(s,t,e,i){let n=s.listingMode();return n==="error"?null:n==="en"?e(t):i(t)}function Ff(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||Dl(s.locale).numberingSystem==="latn"}var dr=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=Tf(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):Sr(t,3);return K(e,this.padTo)}}},fr=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&&se.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=ar(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()}},gr=class{constructor(t,e,i){this.opts={style:"long",...i},!e&&Rl()&&(this.rtf=Df(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):sg(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}},Cl={firstDay:1,minimalDays:4,weekend:[6,7]},H=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||j.defaultLocale,a=o||(r?"en-US":Cf()),l=e||j.defaultNumberingSystem,c=i||j.defaultOutputCalendar,h=br(n)||j.defaultWeekSettings;return new s(a,l,c,h,o)}static resetCache(){Ts=null,or.clear(),lr.clear(),cr.clear(),hr.clear(),ur.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]=Pf(t);this.locale=o,this.numberingSystem=e||a||null,this.outputCalendar=i||l||null,this.weekSettings=n,this.intl=If(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=Ff(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,br(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 pi(this,t,Bl,()=>{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]=Af(o)}return this.monthsCache[r][t]})}weekdays(t,e=!1){return pi(this,t,jl,()=>{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]=Lf(r=>this.extract(r,i,"weekday"))),this.weekdaysCache[n][t]})}meridiems(){return pi(this,void 0,()=>Ul,()=>{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 pi(this,t,Yl,()=>{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 dr(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new fr(t,this.intl,e)}relFormatter(t={}){return new gr(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Of(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Dl(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Nl()?Ef(this.locale):Cl}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})`}},Xn=null,_t=class s extends pe{static get utcInstance(){return Xn===null&&(Xn=new s(0)),Xn}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(Ii(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Es(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Es(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return Es(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}},mr=class extends pe{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 Qt(s,t){if(T(s)||s===null)return t;if(s instanceof pe)return s;if(Bf(s)){let e=s.toLowerCase();return e==="default"?t:e==="local"||e==="system"?Mi.instance:e==="utc"||e==="gmt"?_t.utcInstance:_t.parseSpecifier(e)||se.create(s)}else return ee(s)?_t.instance(s):typeof s=="object"&&"offset"in s&&typeof s.offset=="function"?s:new mr(s)}var _r={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"},La={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]},Rf=_r.hanidec.replace(/[\[|\]]/g,"").split("");function Nf(s){let t=parseInt(s,10);if(isNaN(t)){t="";for(let e=0;e=r&&i<=o&&(t+=i-r)}}return parseInt(t,10)}else return t}var pr=new Map;function zf(){pr.clear()}function kt({numberingSystem:s},t=""){let e=s||"latn",i=pr.get(e);i===void 0&&(i=new Map,pr.set(e,i));let n=i.get(t);return n===void 0&&(n=new RegExp(`${_r[e]}${t}`),i.set(t,n)),n}var Fa=()=>Date.now(),Ra="system",Na=null,za=null,Va=null,Wa=60,Ba,Ha=null,j=class{static get now(){return Fa}static set now(t){Fa=t}static set defaultZone(t){Ra=t}static get defaultZone(){return Qt(Ra,Mi.instance)}static get defaultLocale(){return Na}static set defaultLocale(t){Na=t}static get defaultNumberingSystem(){return za}static set defaultNumberingSystem(t){za=t}static get defaultOutputCalendar(){return Va}static set defaultOutputCalendar(t){Va=t}static get defaultWeekSettings(){return Ha}static set defaultWeekSettings(t){Ha=br(t)}static get twoDigitCutoffYear(){return Wa}static set twoDigitCutoffYear(t){Wa=t%100}static get throwOnInvalid(){return Ba}static set throwOnInvalid(t){Ba=t}static resetCaches(){H.resetCache(),se.resetCache(),R.resetCache(),zf()}},ft=class{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},El=[0,31,59,90,120,151,181,212,243,273,304,334],Pl=[0,31,60,91,121,152,182,213,244,274,305,335];function yt(s,t){return new ft("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${s}, which is invalid`)}function wr(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 Il(s,t,e){return e+(Is(s)?Pl:El)[t-1]}function Al(s,t){let e=Is(s)?Pl:El,i=e.findIndex(r=>rPs(i,t,e)?(c=i+1,l=1):c=i,{weekYear:c,weekNumber:l,weekday:a,...Ai(s)}}function $a(s,t=4,e=1){let{weekYear:i,weekNumber:n,weekday:r}=s,o=kr(wr(i,1,t),e),a=Ze(i),l=n*7+r-o-7+t,c;l<1?(c=i-1,l+=Ze(c)):l>a?(c=i+1,l-=Ze(i)):c=i;let{month:h,day:u}=Al(c,l);return{year:c,month:h,day:u,...Ai(s)}}function Gn(s){let{year:t,month:e,day:i}=s,n=Il(t,e,i);return{year:t,ordinal:n,...Ai(s)}}function ja(s){let{year:t,ordinal:e}=s,{month:i,day:n}=Al(t,e);return{year:t,month:i,day:n,...Ai(s)}}function Ua(s,t){if(!T(s.localWeekday)||!T(s.localWeekNumber)||!T(s.localWeekYear)){if(!T(s.weekday)||!T(s.weekNumber)||!T(s.weekYear))throw new te("Cannot mix locale-based week fields with ISO-based week fields");return T(s.localWeekday)||(s.weekday=s.localWeekday),T(s.localWeekNumber)||(s.weekNumber=s.localWeekNumber),T(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 Vf(s,t=4,e=1){let i=Ei(s.weekYear),n=xt(s.weekNumber,1,Ps(s.weekYear,t,e)),r=xt(s.weekday,1,7);return i?n?r?!1:yt("weekday",s.weekday):yt("week",s.weekNumber):yt("weekYear",s.weekYear)}function Wf(s){let t=Ei(s.year),e=xt(s.ordinal,1,Ze(s.year));return t?e?!1:yt("ordinal",s.ordinal):yt("year",s.year)}function Ll(s){let t=Ei(s.year),e=xt(s.month,1,12),i=xt(s.day,1,Ti(s.year,s.month));return t?e?i?!1:yt("day",s.day):yt("month",s.month):yt("year",s.year)}function Fl(s){let{hour:t,minute:e,second:i,millisecond:n}=s,r=xt(t,0,23)||t===24&&e===0&&i===0&&n===0,o=xt(e,0,59),a=xt(i,0,59),l=xt(n,0,999);return r?o?a?l?!1:yt("millisecond",n):yt("second",i):yt("minute",e):yt("hour",t)}function T(s){return typeof s>"u"}function ee(s){return typeof s=="number"}function Ei(s){return typeof s=="number"&&s%1===0}function Bf(s){return typeof s=="string"}function Hf(s){return Object.prototype.toString.call(s)==="[object Date]"}function Rl(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Nl(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function $f(s){return Array.isArray(s)?s:[s]}function Ya(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 jf(s,t){return t.reduce((e,i)=>(e[i]=s[i],e),{})}function Ge(s,t){return Object.prototype.hasOwnProperty.call(s,t)}function br(s){if(s==null)return null;if(typeof s!="object")throw new Q("Week settings must be an object");if(!xt(s.firstDay,1,7)||!xt(s.minimalDays,1,7)||!Array.isArray(s.weekend)||s.weekend.some(t=>!xt(t,1,7)))throw new Q("Invalid week settings");return{firstDay:s.firstDay,minimalDays:s.minimalDays,weekend:Array.from(s.weekend)}}function xt(s,t,e){return Ei(s)&&s>=t&&s<=e}function Uf(s,t){return s-t*Math.floor(s/t)}function K(s,t=2){let e=s<0,i;return e?i="-"+(""+-s).padStart(t,"0"):i=(""+s).padStart(t,"0"),i}function Jt(s){if(!(T(s)||s===null||s===""))return parseInt(s,10)}function fe(s){if(!(T(s)||s===null||s===""))return parseFloat(s)}function vr(s){if(!(T(s)||s===null||s==="")){let t=parseFloat("0."+s)*1e3;return Math.floor(t)}}function Sr(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 Is(s){return s%4===0&&(s%100!==0||s%400===0)}function Ze(s){return Is(s)?366:365}function Ti(s,t){let e=Uf(t-1,12)+1,i=s+(t-e)/12;return e===2?Is(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function Pi(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 Za(s,t,e){return-kr(wr(s,1,t),e)+t-1}function Ps(s,t=4,e=1){let i=Za(s,t,e),n=Za(s+1,t,e);return(Ze(s)-i+n)/7}function yr(s){return s>99?s:s>j.twoDigitCutoffYear?1900+s:2e3+s}function zl(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 Ii(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 Vl(s){let t=Number(s);if(typeof s=="boolean"||s===""||!Number.isFinite(t))throw new Q(`Invalid unit value ${s}`);return t}function Di(s,t){let e={};for(let i in s)if(Ge(s,i)){let n=s[i];if(n==null)continue;e[t(i)]=Vl(n)}return e}function Es(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}${K(e,2)}:${K(i,2)}`;case"narrow":return`${n}${e}${i>0?`:${i}`:""}`;case"techie":return`${n}${K(e,2)}${K(i,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ai(s){return jf(s,["hour","minute","second","millisecond"])}var Yf=["January","February","March","April","May","June","July","August","September","October","November","December"],Wl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Zf=["J","F","M","A","M","J","J","A","S","O","N","D"];function Bl(s){switch(s){case"narrow":return[...Zf];case"short":return[...Wl];case"long":return[...Yf];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 Hl=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$l=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],qf=["M","T","W","T","F","S","S"];function jl(s){switch(s){case"narrow":return[...qf];case"short":return[...$l];case"long":return[...Hl];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Ul=["AM","PM"],Xf=["Before Christ","Anno Domini"],Gf=["BC","AD"],Kf=["B","A"];function Yl(s){switch(s){case"narrow":return[...Kf];case"short":return[...Gf];case"long":return[...Xf];default:return null}}function Jf(s){return Ul[s.hour<12?0:1]}function Qf(s,t){return jl(t)[s.weekday-1]}function tg(s,t){return Bl(t)[s.month-1]}function eg(s,t){return Yl(t)[s.year<0?0:1]}function sg(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 qa(s,t){let e="";for(let i of s)i.literal?e+=i.val:e+=t(i.val);return e}var ig={D:Si,DD:cl,DDD:hl,DDDD:ul,t:dl,tt:fl,ttt:gl,tttt:ml,T:pl,TT:bl,TTT:yl,TTTT:xl,f:_l,ff:kl,fff:Sl,ffff:Ol,F:wl,FF:vl,FFF:Ml,FFFF:Tl},dt=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;o0||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 ig[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 K(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?Jf(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,g)=>i?tg(t,f):r(g?{month:f}:{month:f,day:"numeric"},"month"),c=(f,g)=>i?Qf(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?eg(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 qa(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 qa(o,r(l,c))}},Zl=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ke(...s){let t=s.reduce((e,i)=>e+i.source,"");return RegExp(`^${t}$`)}function Je(...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 Qe(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 ql(...s){return(t,e)=>{let i={},n;for(n=0;nf!==void 0&&(g||f&&h)?-f:f;return[{years:d(fe(e)),months:d(fe(i)),weeks:d(fe(n)),days:d(fe(r)),hours:d(fe(o)),minutes:d(fe(a)),seconds:d(fe(l),l==="-0"),milliseconds:d(vr(c),u)}]}var pg={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tr(s,t,e,i,n,r,o){let a={year:t.length===2?yr(Jt(t)):Jt(t),month:Wl.indexOf(e)+1,day:Jt(i),hour:Jt(n),minute:Jt(r)};return o&&(a.second=Jt(o)),s&&(a.weekday=s.length>3?Hl.indexOf(s)+1:$l.indexOf(s)+1),a}var bg=/^(?:(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 yg(s){let[,t,e,i,n,r,o,a,l,c,h,u]=s,d=Tr(t,n,i,e,r,o,a),f;return l?f=pg[l]:c?f=0:f=Ii(h,u),[d,new _t(f)]}function xg(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var _g=/^(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$/,wg=/^(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$/,kg=/^(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 Xa(s){let[,t,e,i,n,r,o,a]=s;return[Tr(t,n,i,e,r,o,a),_t.utcInstance]}function vg(s){let[,t,e,i,n,r,o,a]=s;return[Tr(t,a,e,i,n,r,o),_t.utcInstance]}var Sg=Ke(rg,Or),Mg=Ke(og,Or),Og=Ke(ag,Or),Tg=Ke(Gl),Jl=Je(dg,ts,As,Ls),Dg=Je(lg,ts,As,Ls),Cg=Je(cg,ts,As,Ls),Eg=Je(ts,As,Ls);function Pg(s){return Qe(s,[Sg,Jl],[Mg,Dg],[Og,Cg],[Tg,Eg])}function Ig(s){return Qe(xg(s),[bg,yg])}function Ag(s){return Qe(s,[_g,Xa],[wg,Xa],[kg,vg])}function Lg(s){return Qe(s,[gg,mg])}var Fg=Je(ts);function Rg(s){return Qe(s,[fg,Fg])}var Ng=Ke(hg,ug),zg=Ke(Kl),Vg=Je(ts,As,Ls);function Wg(s){return Qe(s,[Ng,Jl],[zg,Vg])}var Ga="Invalid Duration",Ql={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}},Bg={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},...Ql},bt=146097/400,$e=146097/4800,Hg={years:{quarters:4,months:12,weeks:bt/7,days:bt,hours:bt*24,minutes:bt*24*60,seconds:bt*24*60*60,milliseconds:bt*24*60*60*1e3},quarters:{months:3,weeks:bt/28,days:bt/4,hours:bt*24/4,minutes:bt*24*60/4,seconds:bt*24*60*60/4,milliseconds:bt*24*60*60*1e3/4},months:{weeks:$e/7,days:$e,hours:$e*24,minutes:$e*24*60,seconds:$e*24*60*60,milliseconds:$e*24*60*60*1e3},...Ql},me=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],$g=me.slice(0).reverse();function Vt(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 tt(i)}function tc(s,t){let e=t.milliseconds??0;for(let i of $g.slice(1))t[i]&&(e+=t[i]*s[i].milliseconds);return e}function Ka(s,t){let e=tc(s,t)<0?-1:1;me.reduceRight((i,n)=>{if(T(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),me.reduce((i,n)=>{if(T(t[n]))return i;if(i){let r=t[i]%1;t[i]-=r,t[n]+=r*s[i][n]}return n},null)}function Ja(s){let t={};for(let[e,i]of Object.entries(s))i!==0&&(t[e]=i);return t}var tt=class s{constructor(t){let e=t.conversionAccuracy==="longterm"||!1,i=e?Hg:Bg;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||H.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 Q(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new s({values:Di(t,s.normalizeUnit),loc:H.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(ee(t))return s.fromMillis(t);if(s.isDuration(t))return t;if(typeof t=="object")return s.fromObject(t);throw new Q(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){let[i]=Lg(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]=Rg(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 Q("need to specify a reason the Duration is invalid");let i=t instanceof ft?t:new ft(t,e);if(j.throwOnInvalid)throw new nr(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 vi(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?dt.create(this.loc,i).formatDurationFromString(this,t):Ga}toHuman(t={}){if(!this.isValid)return Ga;let e=t.showZeros!==!1,i=me.map(n=>{let r=this.values[n];return T(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+=Sr(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?tc(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 me)(Ge(e.values,n)||Ge(this.values,n))&&(i[n]=e.get(n)+this.get(n));return Vt(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]=Vl(t(this.values[i],i));return Vt(this,{values:e},!0)}get(t){return this[s.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let e={...this.values,...Di(t,s.normalizeUnit)};return Vt(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 Vt(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return Ka(this.matrix,t),Vt(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=Ja(this.normalize().shiftToAll().toObject());return Vt(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 me)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;ee(n[o])&&(a+=n[o]);let l=Math.trunc(a);e[o]=l,i[o]=(a*1e3-l*1e3)/1e3}else ee(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 Ka(this.matrix,e),Vt(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 Vt(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;let t=Ja(this.values);return Vt(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 me)if(!e(this.values[i],t.values[i]))return!1;return!0}},je="Invalid Interval";function jg(s,t){return!s||!s.isValid?Xe.invalid("missing or invalid start"):!t||!t.isValid?Xe.invalid("missing or invalid end"):tt:!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(Os).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),i=[],{s:n}=this,r=0;for(;n+this.e?this.e:o;i.push(s.fromDateTimes(n,a)),n=a,r+=1}return i}splitBy(t){let e=tt.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s:i}=this,n=1,r,o=[];for(;il*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:!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=i?null:s.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;let e=this.st.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()})`:je}[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=Si,e={}){return this.isValid?dt.create(this.s.loc.clone(e),t).formatInterval(this):je}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:je}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:je}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:je}toFormat(t,{separator:e=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:je}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):tt.invalid(this.invalidReason)}mapEndpoints(t){return s.fromDateTimes(t(this.s),t(this.e))}},Ye=class{static hasDST(t=j.defaultZone){let e=R.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return se.isValidZone(t)}static normalizeZone(t){return Qt(t,j.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||H.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||H.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||H.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||H.create(e,i,r)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||H.create(e,i,r)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||H.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||H.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return H.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return H.create(e,null,"gregory").eras(t)}static features(){return{relative:Rl(),localeWeek:Nl()}}};function Qa(s,t){let e=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=e(t)-e(s);return Math.floor(tt.fromMillis(i).as("days"))}function Ug(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=Qa(l,c);return(h-h%7)/7}],["days",Qa]],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 Yg(s,t,e,i){let[n,r,o,a]=Ug(s,t,e),l=t-n,c=e.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);c.length===0&&(o0?tt.fromMillis(l,i).shiftTo(...c).plus(h):h}var Zg="missing Intl.DateTimeFormat.formatToParts support";function N(s,t=e=>e){return{regex:s,deser:([e])=>t(Nf(e))}}var qg="\xA0",ec=`[ ${qg}]`,sc=new RegExp(ec,"g");function Xg(s){return s.replace(/\./g,"\\.?").replace(sc,ec)}function tl(s){return s.replace(/\./g,"").replace(sc," ").toLowerCase()}function vt(s,t){return s===null?null:{regex:RegExp(s.map(Xg).join("|")),deser:([e])=>s.findIndex(i=>tl(e)===tl(i))+t}}function el(s,t){return{regex:s,deser:([,e,i])=>Ii(e,i),groups:t}}function bi(s){return{regex:s,deser:([t])=>t}}function Gg(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Kg(s,t){let e=kt(t),i=kt(t,"{2}"),n=kt(t,"{3}"),r=kt(t,"{4}"),o=kt(t,"{6}"),a=kt(t,"{1,2}"),l=kt(t,"{1,3}"),c=kt(t,"{1,6}"),h=kt(t,"{1,9}"),u=kt(t,"{2,4}"),d=kt(t,"{4,6}"),f=p=>({regex:RegExp(Gg(p.val)),deser:([b])=>b,literal:!0}),m=(p=>{if(s.literal)return f(p);switch(p.val){case"G":return vt(t.eras("short"),0);case"GG":return vt(t.eras("long"),0);case"y":return N(c);case"yy":return N(u,yr);case"yyyy":return N(r);case"yyyyy":return N(d);case"yyyyyy":return N(o);case"M":return N(a);case"MM":return N(i);case"MMM":return vt(t.months("short",!0),1);case"MMMM":return vt(t.months("long",!0),1);case"L":return N(a);case"LL":return N(i);case"LLL":return vt(t.months("short",!1),1);case"LLLL":return vt(t.months("long",!1),1);case"d":return N(a);case"dd":return N(i);case"o":return N(l);case"ooo":return N(n);case"HH":return N(i);case"H":return N(a);case"hh":return N(i);case"h":return N(a);case"mm":return N(i);case"m":return N(a);case"q":return N(a);case"qq":return N(i);case"s":return N(a);case"ss":return N(i);case"S":return N(l);case"SSS":return N(n);case"u":return bi(h);case"uu":return bi(a);case"uuu":return N(e);case"a":return vt(t.meridiems(),0);case"kkkk":return N(r);case"kk":return N(u,yr);case"W":return N(a);case"WW":return N(i);case"E":case"c":return N(e);case"EEE":return vt(t.weekdays("short",!1),1);case"EEEE":return vt(t.weekdays("long",!1),1);case"ccc":return vt(t.weekdays("short",!0),1);case"cccc":return vt(t.weekdays("long",!0),1);case"Z":case"ZZ":return el(new RegExp(`([+-]${a.source})(?::(${i.source}))?`),2);case"ZZZ":return el(new RegExp(`([+-]${a.source})(${i.source})?`),2);case"z":return bi(/[a-z_+-/]{1,256}?/i);case" ":return bi(/[^\S\n\r]/);default:return f(p)}})(s)||{invalidReason:Zg};return m.token=s,m}var Jg={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 Qg(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=Jg[o];if(typeof a=="object"&&(a=a[r]),a)return{literal:!1,val:a}}function tm(s){return[`^${s.map(e=>e.regex).reduce((e,i)=>`${e}(${i.source})`,"")}$`,s]}function em(s,t,e){let i=s.match(t);if(i){let n={},r=1;for(let o in e)if(Ge(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 sm(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 T(s.z)||(e=se.create(s.z)),T(s.Z)||(e||(e=new _t(s.Z)),i=s.Z),T(s.q)||(s.M=(s.q-1)*3+1),T(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),T(s.u)||(s.S=vr(s.u)),[Object.keys(s).reduce((r,o)=>{let a=t(o);return a&&(r[a]=s[o]),r},{}),e,i]}var Kn=null;function im(){return Kn||(Kn=R.fromMillis(1555555555555)),Kn}function nm(s,t){if(s.literal)return s;let e=dt.macroTokenToFormatOpts(s.val),i=rc(e,t);return i==null||i.includes(void 0)?s:i}function ic(s,t){return Array.prototype.concat(...s.map(e=>nm(e,t)))}var Ci=class{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=ic(dt.parseFormat(e),t),this.units=this.tokens.map(i=>Kg(i,t)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){let[i,n]=tm(this.units);this.regex=RegExp(i,"i"),this.handlers=n}}explainFromTokens(t){if(this.isValid){let[e,i]=em(t,this.regex,this.handlers),[n,r,o]=i?sm(i):[null,null,void 0];if(Ge(i,"a")&&Ge(i,"H"))throw new te("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 nc(s,t,e){return new Ci(s,e).explainFromTokens(t)}function rm(s,t,e){let{result:i,zone:n,specificOffset:r,invalidReason:o}=nc(s,t,e);return[i,n,r,o]}function rc(s,t){if(!s)return null;let i=dt.create(t,s).dtFormatter(im()),n=i.formatToParts(),r=i.resolvedOptions();return n.map(o=>Qg(o,s,r))}var Jn="Invalid DateTime",sl=864e13;function Ds(s){return new ft("unsupported zone",`the zone "${s.name}" is not supported`)}function Qn(s){return s.weekData===null&&(s.weekData=Oi(s.c)),s.weekData}function tr(s){return s.localWeekData===null&&(s.localWeekData=Oi(s.c,s.loc.getMinDaysInFirstWeek(),s.loc.getStartOfWeek())),s.localWeekData}function ge(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 oc(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 yi(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 _i(s,t,e){return oc(Pi(s),t,e)}function il(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,Ti(i,n))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=tt.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=Pi(r),[l,c]=oc(a,e,s.zone);return o!==0&&(l+=o,c=s.zone.offset(l)),{ts:l,o:c}}function Ue(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 ft("unparsable",`the input "${n}" can't be parsed as ${i}`))}function xi(s,t,e=!0){return s.isValid?dt.create(H.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(s,t):null}function er(s,t,e){let i=s.c.year>9999||s.c.year<0,n="";if(i&&s.c.year>=0&&(n+="+"),n+=K(s.c.year,i?6:4),e==="year")return n;if(t){if(n+="-",n+=K(s.c.month),e==="month")return n;n+="-"}else if(n+=K(s.c.month),e==="month")return n;return n+=K(s.c.day),n}function nl(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+=K(s.c.hour),o==="hour")break;if(t){if(l+=":",l+=K(s.c.minute),o==="minute")break;a&&(l+=":",l+=K(s.c.second))}else{if(l+=K(s.c.minute),o==="minute")break;a&&(l+=K(s.c.second))}if(o==="second")break;a&&(!i||s.c.millisecond!==0)&&(l+=".",l+=K(s.c.millisecond,3))}return n&&(s.isOffsetFixed&&s.offset===0&&!r?l+="Z":s.o<0?(l+="-",l+=K(Math.trunc(-s.o/60)),l+=":",l+=K(Math.trunc(-s.o%60))):(l+="+",l+=K(Math.trunc(s.o/60)),l+=":",l+=K(Math.trunc(s.o%60)))),r&&(l+="["+s.zone.ianaName+"]"),l}var ac={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},om={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},am={ordinal:1,hour:0,minute:0,second:0,millisecond:0},wi=["year","month","day","hour","minute","second","millisecond"],lm=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],cm=["year","ordinal","hour","minute","second","millisecond"];function ki(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 vi(s);return t}function rl(s){switch(s.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ki(s)}}function hm(s){if(Cs===void 0&&(Cs=j.now()),s.type!=="iana")return s.offset(Cs);let t=s.name,e=xr.get(t);return e===void 0&&(e=s.offset(Cs),xr.set(t,e)),e}function ol(s,t){let e=Qt(t.zone,j.defaultZone);if(!e.isValid)return R.invalid(Ds(e));let i=H.fromObject(t),n,r;if(T(s.year))n=j.now();else{for(let l of wi)T(s[l])&&(s[l]=ac[l]);let o=Ll(s)||Fl(s);if(o)return R.invalid(o);let a=hm(e);[n,r]=_i(s,a,e)}return new R({ts:n,zone:e,loc:i,o:r})}function al(s,t,e){let i=T(e.round)?!0:e.round,n=T(e.rounding)?"trunc":e.rounding,r=(a,l)=>(a=Sr(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 ll(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 Cs,xr=new Map,R=class s{constructor(t){let e=t.zone||j.defaultZone,i=t.invalid||(Number.isNaN(t.ts)?new ft("invalid input"):null)||(e.isValid?null:Ds(e));this.ts=T(t.ts)?j.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=ee(t.o)&&!t.old?t.o:e.offset(this.ts);n=yi(this.ts,a),i=Number.isNaN(n.year)?new ft("invalid input"):null,n=i?null:n,r=i?null:a}this._zone=e,this.loc=t.loc||H.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]=ll(arguments),[i,n,r,o,a,l,c]=e;return ol({year:i,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static utc(){let[t,e]=ll(arguments),[i,n,r,o,a,l,c]=e;return t.zone=_t.utcInstance,ol({year:i,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,e={}){let i=Hf(t)?t.valueOf():NaN;if(Number.isNaN(i))return s.invalid("invalid input");let n=Qt(e.zone,j.defaultZone);return n.isValid?new s({ts:i,zone:n,loc:H.fromObject(e)}):s.invalid(Ds(n))}static fromMillis(t,e={}){if(ee(t))return t<-sl||t>sl?s.invalid("Timestamp out of range"):new s({ts:t,zone:Qt(e.zone,j.defaultZone),loc:H.fromObject(e)});throw new Q(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(ee(t))return new s({ts:t*1e3,zone:Qt(e.zone,j.defaultZone),loc:H.fromObject(e)});throw new Q("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};let i=Qt(e.zone,j.defaultZone);if(!i.isValid)return s.invalid(Ds(i));let n=H.fromObject(e),r=Di(t,rl),{minDaysInFirstWeek:o,startOfWeek:a}=Ua(r,n),l=j.now(),c=T(e.specificOffset)?i.offset(l):e.specificOffset,h=!T(r.ordinal),u=!T(r.year),d=!T(r.month)||!T(r.day),f=u||d,g=r.weekYear||r.weekNumber;if((f||h)&&g)throw new te("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&h)throw new te("Can't mix ordinal dates with month/day");let m=g||r.weekday&&!f,p,b,y=yi(l,c);m?(p=lm,b=om,y=Oi(y,o,a)):h?(p=cm,b=am,y=Gn(y)):(p=wi,b=ac);let _=!1;for(let E of p){let F=r[E];T(F)?_?r[E]=b[E]:r[E]=y[E]:_=!0}let w=m?Vf(r,o,a):h?Wf(r):Ll(r),x=w||Fl(r);if(x)return s.invalid(x);let k=m?$a(r,o,a):h?ja(r):r,[v,O]=_i(k,c,i),M=new s({ts:v,zone:i,o:O,loc:n});return r.weekday&&f&&t.weekday!==M.weekday?s.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${M.toISO()}`):M.isValid?M:s.invalid(M.invalid)}static fromISO(t,e={}){let[i,n]=Pg(t);return Ue(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){let[i,n]=Ig(t);return Ue(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){let[i,n]=Ag(t);return Ue(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(T(t)||T(e))throw new Q("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:r=null}=i,o=H.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[a,l,c,h]=rm(o,t,e);return h?s.invalid(h):Ue(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]=Wg(t);return Ue(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new Q("need to specify a reason the DateTime is invalid");let i=t instanceof ft?t:new ft(t,e);if(j.throwOnInvalid)throw new sr(i);return new s({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){let i=rc(t,H.fromObject(e));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(t,e={}){return ic(dt.parseFormat(t),H.fromObject(e)).map(n=>n.val).join("")}static resetCache(){Cs=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?Qn(this).weekYear:NaN}get weekNumber(){return this.isValid?Qn(this).weekNumber:NaN}get weekday(){return this.isValid?Qn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?tr(this).weekday:NaN}get localWeekNumber(){return this.isValid?tr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?tr(this).weekYear:NaN}get ordinal(){return this.isValid?Gn(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ye.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ye.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ye.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ye.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=Pi(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=yi(l,o),u=yi(c,a);return h.hour===u.hour&&h.minute===u.minute&&h.second===u.second&&h.millisecond===u.millisecond?[ge(this,{ts:l}),ge(this,{ts:c})]:[this]}get isInLeapYear(){return Is(this.year)}get daysInMonth(){return Ti(this.year,this.month)}get daysInYear(){return this.isValid?Ze(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ps(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ps(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:e,numberingSystem:i,calendar:n}=dt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(_t.instance(t),e)}toLocal(){return this.setZone(j.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if(t=Qt(t,j.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]=_i(o,r,t)}return ge(this,{ts:n,zone:t})}else return s.invalid(Ds(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){let n=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i});return ge(this,{loc:n})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let e=Di(t,rl),{minDaysInFirstWeek:i,startOfWeek:n}=Ua(e,this.loc),r=!T(e.weekYear)||!T(e.weekNumber)||!T(e.weekday),o=!T(e.ordinal),a=!T(e.year),l=!T(e.month)||!T(e.day),c=a||l,h=e.weekYear||e.weekNumber;if((c||o)&&h)throw new te("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new te("Can't mix ordinal dates with month/day");let u;r?u=$a({...Oi(this.c,i,n),...e},i,n):T(e.ordinal)?(u={...this.toObject(),...e},T(e.day)&&(u.day=Math.min(Ti(u.year,u.month),u.day))):u=ja({...Gn(this.c),...e});let[d,f]=_i(u,this.o,this.zone);return ge(this,{ts:d,o:f})}plus(t){if(!this.isValid)return this;let e=tt.fromDurationLike(t);return ge(this,il(this,e))}minus(t){if(!this.isValid)return this;let e=tt.fromDurationLike(t).negate();return ge(this,il(this,e))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;let i={},n=tt.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=3&&(l+="T"),l+=nl(this,a,e,i,n,r,o),l}toISODate({format:t="extended",precision:e="day"}={}){return this.isValid?er(this,t==="extended",ki(e)):null}toISOWeekDate(){return xi(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=ki(a),(n&&wi.indexOf(a)>=3?"T":"")+nl(this,o==="extended",e,t,i,r,a)):null}toRFC2822(){return xi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return xi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?er(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")),xi(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Jn}[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 tt.invalid("created by diffing an invalid DateTime");let n={locale:this.locale,numberingSystem:this.numberingSystem,...i},r=$f(e).map(tt.normalizeUnit),o=t.valueOf()>this.valueOf(),a=o?this:t,l=o?t:this,c=Yg(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?Xe.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?thise.valueOf(),Math.min)}static max(...t){if(!t.every(s.isDateTime))throw new Q("max requires all arguments be DateTimes");return Ya(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,i={}){let{locale:n=null,numberingSystem:r=null}=i,o=H.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return nc(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=H.fromOpts({locale:i,numberingSystem:n,defaultToEN:!0});return new Ci(r,t)}static fromFormatParser(t,e,i={}){if(T(t)||T(e))throw new Q("fromFormatParser requires an input string and a format parser");let{locale:n=null,numberingSystem:r=null}=i,o=H.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});if(!o.equals(e.locale))throw new Q(`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):Ue(a,l,i,`format ${e.format}`,t,c)}static get DATE_SHORT(){return Si}static get DATE_MED(){return cl}static get DATE_MED_WITH_WEEKDAY(){return _f}static get DATE_FULL(){return hl}static get DATE_HUGE(){return ul}static get TIME_SIMPLE(){return dl}static get TIME_WITH_SECONDS(){return fl}static get TIME_WITH_SHORT_OFFSET(){return gl}static get TIME_WITH_LONG_OFFSET(){return ml}static get TIME_24_SIMPLE(){return pl}static get TIME_24_WITH_SECONDS(){return bl}static get TIME_24_WITH_SHORT_OFFSET(){return yl}static get TIME_24_WITH_LONG_OFFSET(){return xl}static get DATETIME_SHORT(){return _l}static get DATETIME_SHORT_WITH_SECONDS(){return wl}static get DATETIME_MED(){return kl}static get DATETIME_MED_WITH_SECONDS(){return vl}static get DATETIME_MED_WITH_WEEKDAY(){return wf}static get DATETIME_FULL(){return Sl}static get DATETIME_FULL_WITH_SECONDS(){return Ml}static get DATETIME_HUGE(){return Ol}static get DATETIME_HUGE_WITH_SECONDS(){return Tl}};function Os(s){if(R.isDateTime(s))return s;if(s&&s.valueOf&&ee(s.valueOf()))return R.fromJSDate(s);if(s&&typeof s=="object")return R.fromObject(s);throw new Q(`Unknown datetime argument: ${s}, of type ${typeof s}`)}var um={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"}};Un._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 um},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()}});function Li({cachedData:s,options:t,type:e}){return{init:function(){this.initChart(),this.$wire.$on("updateChartData",({data:i})=>{Li=this.getChart(),Li.data=i,Li.update("resize")}),Alpine.effect(()=>{Alpine.store("theme"),this.$nextTick(()=>{this.getChart()&&(this.getChart().destroy(),this.initChart())})}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Alpine.store("theme")==="system"&&this.$nextTick(()=>{this.getChart().destroy(),this.initChart()})})},initChart:function(i=null){var o,a,l,c,h,u,d,f,g;if(!this.$refs.canvas||!this.$refs.backgroundColorElement||!this.$refs.borderColorElement||!this.$refs.textColorElement||!this.$refs.gridColorElement)return;Pt.defaults.animation.duration=0,Pt.defaults.backgroundColor=getComputedStyle(this.$refs.backgroundColorElement).color;let n=getComputedStyle(this.$refs.borderColorElement).color;Pt.defaults.borderColor=n,Pt.defaults.color=getComputedStyle(this.$refs.textColorElement).color,Pt.defaults.font.family=getComputedStyle(this.$el).fontFamily,Pt.defaults.plugins.legend.labels.boxWidth=12,Pt.defaults.plugins.legend.position="bottom";let r=getComputedStyle(this.$refs.gridColorElement).color;return t??(t={}),t.borderWidth??(t.borderWidth=2),t.pointBackgroundColor??(t.pointBackgroundColor=n),t.pointHitRadius??(t.pointHitRadius=4),t.pointRadius??(t.pointRadius=2),t.scales??(t.scales={}),(o=t.scales).x??(o.x={}),(a=t.scales.x).grid??(a.grid={}),(l=t.scales.x.grid).color??(l.color=r),(c=t.scales.x.grid).display??(c.display=!1),(h=t.scales.x.grid).drawBorder??(h.drawBorder=!1),(u=t.scales).y??(u.y={}),(d=t.scales.y).grid??(d.grid={}),(f=t.scales.y.grid).color??(f.color=r),(g=t.scales.y.grid).drawBorder??(g.drawBorder=!1),new Pt(this.$refs.canvas,{type:e,data:i??s,options:t,plugins:window.filamentChartJsPlugins??[]})},getChart:function(){return this.$refs.canvas?Pt.getChart(this.$refs.canvas):null}}}export{Li as default}; /*! Bundled license information: chart.js/dist/chunks/helpers.segment.mjs: chart.js/dist/chart.mjs: (*! * Chart.js v3.9.1 * https://www.chartjs.org * (c) 2022 Chart.js Contributors * Released under the MIT License *) chart.js/dist/chunks/helpers.segment.mjs: (*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * 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 *) */