@eox/chart 2.0.0-alpha11 → 2.0.0-alpha13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,119 @@
1
+ (function(wt,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(wt=typeof globalThis<"u"?globalThis:wt||self,et(wt["eox-chart"]={}))})(this,function(wt){"use strict";var Cp=Object.defineProperty;var Ap=(wt,et,ht)=>et in wt?Cp(wt,et,{enumerable:!0,configurable:!0,writable:!0,value:ht}):wt[et]=ht;var _=(wt,et,ht)=>(Ap(wt,typeof et!="symbol"?et+"":et,ht),ht);/*!
2
+ * @kurkle/color v0.3.2
3
+ * https://github.com/kurkle/color#readme
4
+ * (c) 2023 Jukka Kurkela
5
+ * Released under the MIT License
6
+ */function et(i){return i+.5|0}const ht=(i,t,e)=>Math.max(Math.min(i,e),t);function Ke(i){return ht(et(i*2.55),0,255)}function Zt(i){return ht(et(i*255),0,255)}function zt(i){return ht(et(i/2.55)/100,0,1)}function Xn(i){return ht(et(i*100),0,100)}const vt={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},Ls=[..."0123456789ABCDEF"],ic=i=>Ls[i&15],sc=i=>Ls[(i&240)>>4]+Ls[i&15],Ri=i=>(i&240)>>4===(i&15),nc=i=>Ri(i.r)&&Ri(i.g)&&Ri(i.b)&&Ri(i.a);function rc(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&vt[i[1]]*17,g:255&vt[i[2]]*17,b:255&vt[i[3]]*17,a:t===5?vt[i[4]]*17:255}:(t===7||t===9)&&(e={r:vt[i[1]]<<4|vt[i[2]],g:vt[i[3]]<<4|vt[i[4]],b:vt[i[5]]<<4|vt[i[6]],a:t===9?vt[i[7]]<<4|vt[i[8]]:255})),e}const oc=(i,t)=>i<255?t(i):"";function ac(i){var t=nc(i)?ic:sc;return i?"#"+t(i.r)+t(i.g)+t(i.b)+oc(i.a,t):void 0}const lc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Gn(i,t,e){const s=t*Math.min(e,1-e),n=(r,o=(r+i/30)%12)=>e-s*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function cc(i,t,e){const s=(n,r=(n+i/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[s(5),s(3),s(1)]}function hc(i,t,e){const s=Gn(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function uc(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Fs(i){const e=i.r/255,s=i.g/255,n=i.b/255,r=Math.max(e,s,n),o=Math.min(e,s,n),a=(r+o)/2;let l,c,h;return r!==o&&(h=r-o,c=a>.5?h/(2-r-o):h/(r+o),l=uc(e,s,n,h,r),l=l*60+.5),[l|0,c||0,a]}function Rs(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Zt)}function Ns(i,t,e){return Rs(Gn,i,t,e)}function dc(i,t,e){return Rs(hc,i,t,e)}function fc(i,t,e){return Rs(cc,i,t,e)}function Jn(i){return(i%360+360)%360}function gc(i){const t=lc.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Ke(+t[5]):Zt(+t[5]));const n=Jn(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?s=dc(n,r,o):t[1]==="hsv"?s=fc(n,r,o):s=Ns(n,r,o),{r:s[0],g:s[1],b:s[2],a:e}}function mc(i,t){var e=Fs(i);e[0]=Jn(e[0]+t),e=Ns(e),i.r=e[0],i.g=e[1],i.b=e[2]}function pc(i){if(!i)return;const t=Fs(i),e=t[0],s=Xn(t[1]),n=Xn(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${zt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Kn={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"},Qn={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 yc(){const i={},t=Object.keys(Qn),e=Object.keys(Kn);let s,n,r,o,a;for(s=0;s<t.length;s++){for(o=a=t[s],n=0;n<e.length;n++)r=e[n],a=a.replace(r,Kn[r]);r=parseInt(Qn[o],16),i[a]=[r>>16&255,r>>8&255,r&255]}return i}let Ni;function bc(i){Ni||(Ni=yc(),Ni.transparent=[0,0,0,0]);const t=Ni[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const xc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function _c(i){const t=xc.exec(i);let e=255,s,n,r;if(t){if(t[7]!==s){const o=+t[7];e=t[8]?Ke(o):ht(o*255,0,255)}return s=+t[1],n=+t[3],r=+t[5],s=255&(t[2]?Ke(s):ht(s,0,255)),n=255&(t[4]?Ke(n):ht(n,0,255)),r=255&(t[6]?Ke(r):ht(r,0,255)),{r:s,g:n,b:r,a:e}}}function wc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${zt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const zs=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Ee=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function vc(i,t,e){const s=Ee(zt(i.r)),n=Ee(zt(i.g)),r=Ee(zt(i.b));return{r:Zt(zs(s+e*(Ee(zt(t.r))-s))),g:Zt(zs(n+e*(Ee(zt(t.g))-n))),b:Zt(zs(r+e*(Ee(zt(t.b))-r))),a:i.a+e*(t.a-i.a)}}function zi(i,t,e){if(i){let s=Fs(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Ns(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function tr(i,t){return i&&Object.assign(t||{},i)}function er(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Zt(i[3]))):(t=tr(i,{r:0,g:0,b:0,a:1}),t.a=Zt(t.a)),t}function Sc(i){return i.charAt(0)==="r"?_c(i):gc(i)}class Qe{constructor(t){if(t instanceof Qe)return t;const e=typeof t;let s;e==="object"?s=er(t):e==="string"&&(s=rc(t)||bc(t)||Sc(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=tr(this._rgb);return t&&(t.a=zt(t.a)),t}set rgb(t){this._rgb=er(t)}rgbString(){return this._valid?wc(this._rgb):void 0}hexString(){return this._valid?ac(this._rgb):void 0}hslString(){return this._valid?pc(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,s.r=255&c*s.r+r*n.r+.5,s.g=255&c*s.g+r*n.g+.5,s.b=255&c*s.b+r*n.b+.5,s.a=o*s.a+(1-o)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=vc(this._rgb,t._rgb,e)),this}clone(){return new Qe(this.rgb)}alpha(t){return this._rgb.a=Zt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=et(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return zi(this._rgb,2,t),this}darken(t){return zi(this._rgb,2,-t),this}saturate(t){return zi(this._rgb,1,t),this}desaturate(t){return zi(this._rgb,1,-t),this}rotate(t){return mc(this._rgb,t),this}}/*!
7
+ * Chart.js v4.3.0
8
+ * https://www.chartjs.org
9
+ * (c) 2023 Chart.js Contributors
10
+ * Released under the MIT License
11
+ */function Vt(){}const Mc=(()=>{let i=0;return()=>i++})();function F(i){return i===null||typeof i>"u"}function B(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function P(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function Y(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function mt(i,t){return Y(i)?i:t}function E(i,t){return typeof i>"u"?t:i}const kc=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,ir=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function W(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function z(i,t,e,s){let n,r,o;if(B(i))if(r=i.length,s)for(n=r-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;n<r;n++)t.call(e,i[n],n);else if(P(i))for(o=Object.keys(i),r=o.length,n=0;n<r;n++)t.call(e,i[o[n]],o[n])}function Vi(i,t){let e,s,n,r;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],r=t[e],n.datasetIndex!==r.datasetIndex||n.index!==r.index)return!1;return!0}function Wi(i){if(B(i))return i.map(Wi);if(P(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=Wi(i[e[n]]);return t}return i}function sr(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Tc(i,t,e,s){if(!sr(i))return;const n=t[i],r=e[i];P(n)&&P(r)?pt(n,r,s):t[i]=Wi(r)}function pt(i,t,e){const s=B(t)?t:[t],n=s.length;if(!P(i))return i;e=e||{};const r=e.merger||Tc;let o;for(let a=0;a<n;++a){if(o=s[a],!P(o))continue;const l=Object.keys(o);for(let c=0,h=l.length;c<h;++c)r(l[c],i,o,e)}return i}function ti(i,t){return pt(i,t,{merger:Oc})}function Oc(i,t,e){if(!sr(i))return;const s=t[i],n=e[i];P(s)&&P(n)?ti(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Wi(n))}const nr={"":i=>i,x:i=>i.x,y:i=>i.y};function Dc(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Ec(i){const t=Dc(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Xt(i,t){return(nr[t]||(nr[t]=Ec(t)))(i)}function Vs(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ei=i=>typeof i<"u",Gt=i=>typeof i=="function",rr=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Cc(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const j=Math.PI,H=2*j,Ac=H+j,Bi=Number.POSITIVE_INFINITY,Pc=j/180,q=j/2,ae=j/4,or=j*2/3,Jt=Math.log10,Ft=Math.sign;function ii(i,t,e){return Math.abs(i-t)<e}function ar(i){const t=Math.round(i);i=ii(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Jt(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Ic(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,r)=>n-r).pop(),t}function Ce(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Lc(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function lr(i,t,e){let s,n,r;for(s=0,n=i.length;s<n;s++)r=i[s][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Ot(i){return i*(j/180)}function Ws(i){return i*(180/j)}function cr(i){if(!Y(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function hr(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let r=Math.atan2(s,e);return r<-.5*j&&(r+=H),{angle:r,distance:n}}function Bs(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Fc(i,t){return(i-t+Ac)%H-j}function yt(i){return(i%H+H)%H}function si(i,t,e,s){const n=yt(i),r=yt(t),o=yt(e),a=yt(r-n),l=yt(o-n),c=yt(n-r),h=yt(n-o);return n===r||n===o||s&&r===o||a>l&&c<h}function tt(i,t,e){return Math.max(t,Math.min(e,i))}function Rc(i){return tt(i,-32768,32767)}function Wt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Hs(i,t,e){e=e||(o=>i[o]<t);let s=i.length-1,n=0,r;for(;s-n>1;)r=n+s>>1,e(r)?n=r:s=r;return{lo:n,hi:s}}const Bt=(i,t,e,s)=>Hs(i,e,s?n=>{const r=i[n][t];return r<e||r===e&&i[n+1][t]===e}:n=>i[n][t]<e),Nc=(i,t,e)=>Hs(i,e,s=>i[s][t]>=e);function zc(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const ur=["push","pop","shift","splice","unshift"];function Vc(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ur.forEach(e=>{const s="_onData"+Vs(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...r){const o=n.apply(this,r);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...r)}),o}})})}function dr(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(ur.forEach(r=>{delete i[r]}),delete i._chartjs)}function fr(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const gr=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function mr(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,gr.call(window,()=>{s=!1,i.apply(t,e)}))}}function Wc(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const $s=i=>i==="start"?"left":i==="end"?"right":"center",st=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Bc=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function pr(i,t,e){const s=t.length;let n=0,r=s;if(i._sorted){const{iScale:o,_parsed:a}=i,l=o.axis,{min:c,max:h,minDefined:u,maxDefined:d}=o.getUserBounds();u&&(n=tt(Math.min(Bt(a,o.axis,c).lo,e?s:Bt(t,l,o.getPixelForValue(c)).lo),0,s-1)),d?r=tt(Math.max(Bt(a,o.axis,h,!0).hi+1,e?0:Bt(t,l,o.getPixelForValue(h),!0).hi+1),n,s)-n:r=s-n}return{start:n,count:r}}function yr(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const r=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),r}const Hi=i=>i===0||i===1,br=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*H/e)),xr=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*H/e)+1,ni={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*q)+1,easeOutSine:i=>Math.sin(i*q),easeInOutSine:i=>-.5*(Math.cos(j*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Hi(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Hi(i)?i:br(i,.075,.3),easeOutElastic:i=>Hi(i)?i:xr(i,.075,.3),easeInOutElastic(i){return Hi(i)?i:i<.5?.5*br(i*2,.1125,.45):.5+.5*xr(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-ni.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?ni.easeInBounce(i*2)*.5:ni.easeOutBounce(i*2-1)*.5+.5};function js(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function $i(i){return js(i)?i:new Qe(i)}function Us(i){return js(i)?i:new Qe(i).saturate(.5).darken(.1).hexString()}const Hc=["x","y","borderWidth","radius","tension"],$c=["color","borderColor","backgroundColor"];function jc(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:$c},numbers:{type:"number",properties:Hc}}),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:t=>t|0}}}})}function Uc(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const _r=new Map;function Yc(i,t){t=t||{};const e=i+JSON.stringify(t);let s=_r.get(e);return s||(s=new Intl.NumberFormat(i,t),_r.set(e,s)),s}function ri(i,t,e){return Yc(t,e).format(i)}const wr={values(i){return B(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,r=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),r=qc(i,e)}const o=Jt(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ri(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(Jt(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?wr.numeric.call(this,i,t,e):""}};function qc(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var ji={formatters:wr};function Zc(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ji.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.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const le=Object.create(null),Ys=Object.create(null);function oi(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const r=e[s];i=i[r]||(i[r]=Object.create(null))}return i}function qs(i,t,e){return typeof t=="string"?pt(oi(i,t),e):pt(oi(i,""),t)}class Xc{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>Us(n.backgroundColor),this.hoverBorderColor=(s,n)=>Us(n.borderColor),this.hoverColor=(s,n)=>Us(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return qs(this,t,e)}get(t){return oi(this,t)}describe(t,e){return qs(Ys,t,e)}override(t,e){return qs(le,t,e)}route(t,e,s,n){const r=oi(this,t),o=oi(this,s),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[n];return P(l)?Object.assign({},c,l):E(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new Xc({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[jc,Uc,Zc]);function Gc(i){return!i||F(i.size)||F(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Ui(i,t,e,s,n){let r=t[n];return r||(r=t[n]=i.measureText(n).width,e.push(n)),r>s&&(s=r),s}function Jc(i,t,e,s){s=s||{};let n=s.data=s.data||{},r=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},r=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let o=0;const a=e.length;let l,c,h,u,d;for(l=0;l<a;l++)if(u=e[l],u!=null&&!B(u))o=Ui(i,n,r,o,u);else if(B(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!B(d)&&(o=Ui(i,n,r,o,d));i.restore();const f=r.length/2;if(f>e.length){for(l=0;l<f;l++)delete n[r[l]];r.splice(0,f)}return o}function ce(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function vr(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function Zs(i,t,e,s){Sr(i,t,e,s,null)}function Sr(i,t,e,s,n){let r,o,a,l,c,h,u,d;const f=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*Pc;if(f&&typeof f=="object"&&(r=f.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(p),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(m)||m<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,m,0,0,H):i.arc(e,s,m,0,H),i.closePath();break;case"triangle":h=n?n/2:m,i.moveTo(e+Math.sin(p)*h,s-Math.cos(p)*m),p+=or,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*m),p+=or,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,o=Math.cos(p+ae)*l,u=Math.cos(p+ae)*(n?n/2-c:l),a=Math.sin(p+ae)*l,d=Math.sin(p+ae)*(n?n/2-c:l),i.arc(e-u,s-a,c,p-j,p-q),i.arc(e+d,s-o,c,p-q,p),i.arc(e+u,s+a,c,p,p+q),i.arc(e-d,s+o,c,p+q,p+j),i.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}p+=ae;case"rectRot":u=Math.cos(p)*(n?n/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),i.moveTo(e-u,s-a),i.lineTo(e+d,s-o),i.lineTo(e+u,s+a),i.lineTo(e-d,s+o),i.closePath();break;case"crossRot":p+=ae;case"cross":u=Math.cos(p)*(n?n/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),i.moveTo(e-u,s-a),i.lineTo(e+u,s+a),i.moveTo(e+d,s-o),i.lineTo(e-d,s+o);break;case"star":u=Math.cos(p)*(n?n/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),i.moveTo(e-u,s-a),i.lineTo(e+u,s+a),i.moveTo(e+d,s-o),i.lineTo(e-d,s+o),p+=ae,u=Math.cos(p)*(n?n/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),i.moveTo(e-u,s-a),i.lineTo(e+u,s+a),i.moveTo(e+d,s-o),i.lineTo(e-d,s+o);break;case"line":o=n?n/2:Math.cos(p)*m,a=Math.sin(p)*m,i.moveTo(e-o,s-a),i.lineTo(e+o,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(p)*(n?n/2:m),s+Math.sin(p)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Ht(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function Yi(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function qi(i){i.restore()}function Kc(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const r=(t.x+e.x)/2;i.lineTo(r,t.y),i.lineTo(r,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Qc(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function th(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),F(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function eh(i,t,e,s,n){if(n.strikethrough||n.underline){const r=i.measureText(s),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(o,h),i.lineTo(a,h),i.stroke()}}function ih(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function he(i,t,e,s,n,r={}){const o=B(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,th(i,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&ih(i,r.backdrop),a&&(r.strokeColor&&(i.strokeStyle=r.strokeColor),F(r.strokeWidth)||(i.lineWidth=r.strokeWidth),i.strokeText(c,e,s,r.maxWidth)),i.fillText(c,e,s,r.maxWidth),eh(i,e,s,c,r),s+=Number(n.lineHeight);i.restore()}function ai(i,t){const{x:e,y:s,w:n,h:r,radius:o}=t;i.arc(e+o.topLeft,s+o.topLeft,o.topLeft,-q,j,!0),i.lineTo(e,s+r-o.bottomLeft),i.arc(e+o.bottomLeft,s+r-o.bottomLeft,o.bottomLeft,j,q,!0),i.lineTo(e+n-o.bottomRight,s+r),i.arc(e+n-o.bottomRight,s+r-o.bottomRight,o.bottomRight,q,0,!0),i.lineTo(e+n,s+o.topRight),i.arc(e+n-o.topRight,s+o.topRight,o.topRight,0,-q,!0),i.lineTo(e+o.topLeft,s)}const sh=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,nh=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function rh(i,t){const e=(""+i).match(sh);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const oh=i=>+i||0;function Xs(i,t){const e={},s=P(t),n=s?Object.keys(t):t,r=P(i)?s?o=>E(i[o],i[t[o]]):o=>i[o]:()=>i;for(const o of n)e[o]=oh(r(o));return e}function Mr(i){return Xs(i,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(i){return Xs(i,["topLeft","topRight","bottomLeft","bottomRight"])}function nt(i){const t=Mr(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Q(i,t){i=i||{},t=t||Z.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=E(i.style,t.style);s&&!(""+s).match(nh)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:E(i.family,t.family),lineHeight:rh(E(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:E(i.weight,t.weight),string:""};return n.string=Gc(n),n}function li(i,t,e,s){let n=!0,r,o,a;for(r=0,o=i.length;r<o;++r)if(a=i[r],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),n=!1),e!==void 0&&B(a)&&(a=a[e%a.length],n=!1),a!==void 0))return s&&!n&&(s.cacheable=!1),a}function ah(i,t,e){const{min:s,max:n}=i,r=ir(t,(n-s)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(s,-Math.abs(r)),max:o(n,r)}}function Kt(i,t){return Object.assign(Object.create(i),t)}function Gs(i,t=[""],e,s,n=()=>i[0]){const r=e||i;typeof s>"u"&&(s=Er("_fallback",i));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:r,_fallback:s,_getTarget:n,override:a=>Gs([a,...i],t,r,s)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return Tr(a,l,()=>mh(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Cr(a).includes(l)},ownKeys(a){return Cr(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function Ae(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:kr(i,s),setContext:r=>Ae(i,r,e,s),override:r=>Ae(i.override(r),t,e,s)};return new Proxy(n,{deleteProperty(r,o){return delete r[o],delete i[o],!0},get(r,o,a){return Tr(r,o,()=>ch(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(i,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,o)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(r,o){return Reflect.has(i,o)},ownKeys(){return Reflect.ownKeys(i)},set(r,o,a){return i[o]=a,delete r[o],!0}})}function kr(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Gt(e)?e:()=>e,isIndexable:Gt(s)?s:()=>s}}const lh=(i,t)=>i?i+Vs(t):t,Js=(i,t)=>P(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Tr(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function ch(i,t,e){const{_proxy:s,_context:n,_subProxy:r,_descriptors:o}=i;let a=s[t];return Gt(a)&&o.isScriptable(t)&&(a=hh(t,a,i,e)),B(a)&&a.length&&(a=uh(t,a,i,o.isIndexable)),Js(t,a)&&(a=Ae(a,n,r&&r[t],o)),a}function hh(i,t,e,s){const{_proxy:n,_context:r,_subProxy:o,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(r,o||s);return a.delete(i),Js(i,l)&&(l=Ks(n._scopes,n,i,l)),l}function uh(i,t,e,s){const{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&s(i))return t[r.index%t.length];if(P(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=Ks(c,n,i,h);t.push(Ae(u,r,o&&o[i],a))}}return t}function Or(i,t,e){return Gt(i)?i(t,e):i}const dh=(i,t)=>i===!0?t:typeof i=="string"?Xt(t,i):void 0;function fh(i,t,e,s,n){for(const r of t){const o=dh(e,r);if(o){i.add(o);const a=Or(o._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(o===!1&&typeof s<"u"&&e!==s)return null}return!1}function Ks(i,t,e,s){const n=t._rootScopes,r=Or(t._fallback,e,s),o=[...i,...n],a=new Set;a.add(s);let l=Dr(a,o,e,r||e,s);return l===null||typeof r<"u"&&r!==e&&(l=Dr(a,o,r,l,s),l===null)?!1:Gs(Array.from(a),[""],n,r,()=>gh(t,e,s))}function Dr(i,t,e,s,n){for(;e;)e=fh(i,t,e,s,n);return e}function gh(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return B(n)&&P(e)?e:n||{}}function mh(i,t,e,s){let n;for(const r of t)if(n=Er(lh(r,i),e),typeof n<"u")return Js(i,n)?Ks(e,s,i,n):n}function Er(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Cr(i){let t=i._keys;return t||(t=i._keys=ph(i._scopes)),t}function ph(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function Ar(i,t,e,s){const{iScale:n}=i,{key:r="r"}=this._parsing,o=new Array(s);let a,l,c,h;for(a=0,l=s;a<l;++a)c=a+e,h=t[c],o[a]={r:n.parse(Xt(h,r),c)};return o}const yh=Number.EPSILON||1e-14,Pe=(i,t)=>t<i.length&&!i[t].skip&&i[t],Pr=i=>i==="x"?"y":"x";function bh(i,t,e,s){const n=i.skip?t:i,r=t,o=e.skip?t:e,a=Bs(r,n),l=Bs(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const u=s*c,d=s*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 xh(i,t,e){const s=i.length;let n,r,o,a,l,c=Pe(i,0);for(let h=0;h<s-1;++h)if(l=c,c=Pe(i,h+1),!(!l||!c)){if(ii(t[h],0,yh)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],r=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[h]=n*o*t[h],e[h+1]=r*o*t[h])}}function _h(i,t,e="x"){const s=Pr(e),n=i.length;let r,o,a,l=Pe(i,0);for(let c=0;c<n;++c){if(o=a,a=l,l=Pe(i,c+1),!a)continue;const h=a[e],u=a[s];o&&(r=(h-o[e])/3,a[`cp1${e}`]=h-r,a[`cp1${s}`]=u-r*t[c]),l&&(r=(l[e]-h)/3,a[`cp2${e}`]=h+r,a[`cp2${s}`]=u+r*t[c])}}function wh(i,t="x"){const e=Pr(t),s=i.length,n=Array(s).fill(0),r=Array(s);let o,a,l,c=Pe(i,0);for(o=0;o<s;++o)if(a=l,l=c,c=Pe(i,o+1),!!l){if(c){const h=c[t]-l[t];n[o]=h!==0?(c[e]-l[e])/h:0}r[o]=a?c?Ft(n[o-1])!==Ft(n[o])?0:(n[o-1]+n[o])/2:n[o-1]:n[o]}xh(i,n,r),_h(i,r,t)}function Zi(i,t,e){return Math.max(Math.min(i,e),t)}function vh(i,t){let e,s,n,r,o,a=Ht(i[0],t);for(e=0,s=i.length;e<s;++e)o=r,r=a,a=e<s-1&&Ht(i[e+1],t),r&&(n=i[e],o&&(n.cp1x=Zi(n.cp1x,t.left,t.right),n.cp1y=Zi(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=Zi(n.cp2x,t.left,t.right),n.cp2y=Zi(n.cp2y,t.top,t.bottom)))}function Sh(i,t,e,s,n){let r,o,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")wh(i,n);else{let c=s?i[i.length-1]:i[0];for(r=0,o=i.length;r<o;++r)a=i[r],l=bh(c,a,i[Math.min(r+1,o-(s?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&vh(i,e)}function Ir(){return typeof window<"u"&&typeof document<"u"}function Qs(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Xi(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const Gi=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Mh(i,t){return Gi(i).getPropertyValue(t)}const kh=["top","right","bottom","left"];function de(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const r=kh[n];s[r]=parseFloat(i[t+"-"+r+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Th=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Oh(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:r}=s;let o=!1,a,l;if(Th(n,r,i.target))a=n,l=r;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function fe(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Gi(e),r=n.boxSizing==="border-box",o=de(n,"padding"),a=de(n,"border","width"),{x:l,y:c,box:h}=Oh(i,e),u=o.left+(h&&a.left),d=o.top+(h&&a.top);let{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/s),y:Math.round((c-d)/g*e.height/s)}}function Dh(i,t,e){let s,n;if(t===void 0||e===void 0){const r=Qs(i);if(!r)t=i.clientWidth,e=i.clientHeight;else{const o=r.getBoundingClientRect(),a=Gi(r),l=de(a,"border","width"),c=de(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,s=Xi(a.maxWidth,r,"clientWidth"),n=Xi(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:s||Bi,maxHeight:n||Bi}}const Ji=i=>Math.round(i*10)/10;function Eh(i,t,e,s){const n=Gi(i),r=de(n,"margin"),o=Xi(n.maxWidth,i,"clientWidth")||Bi,a=Xi(n.maxHeight,i,"clientHeight")||Bi,l=Dh(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const d=de(n,"border","width"),f=de(n,"padding");c-=f.width+d.width,h-=f.height+d.height}return c=Math.max(0,c-r.width),h=Math.max(0,s?c/s:h-r.height),c=Ji(Math.min(c,o,l.maxWidth)),h=Ji(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ji(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=Ji(Math.floor(h*s))),{width:c,height:h}}function Lr(i,t,e){const s=t||1,n=Math.floor(i.height*s),r=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const o=i.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${i.height}px`,o.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||o.height!==n||o.width!==r?(i.currentDevicePixelRatio=s,o.height=n,o.width=r,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Ch=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function Fr(i,t){const e=Mh(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function ge(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Ah(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Ph(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},r={x:t.cp1x,y:t.cp1y},o=ge(i,n,e),a=ge(n,r,e),l=ge(r,t,e),c=ge(o,a,e),h=ge(a,l,e);return ge(c,h,e)}const Ih=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Lh=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Ie(i,t,e){return i?Ih(t,e):Lh()}function Rr(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Nr(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function zr(i){return i==="angle"?{between:si,compare:Fc,normalize:yt}:{between:Wt,compare:(t,e)=>t-e,normalize:t=>t}}function Vr({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Fh(i,t,e){const{property:s,start:n,end:r}=e,{between:o,normalize:a}=zr(s),l=t.length;let{start:c,end:h,loop:u}=i,d,f;if(u){for(c+=l,h+=l,d=0,f=l;d<f&&o(a(t[c%l][s]),n,r);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:i.style}}function Wr(i,t,e){if(!e)return[i];const{property:s,start:n,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=zr(s),{start:h,end:u,loop:d,style:f}=Fh(i,t,e),g=[];let m=!1,p=null,y,b,v;const w=()=>l(n,v,y)&&a(n,v)!==0,x=()=>a(r,y)===0||l(r,v,y),k=()=>m||w(),S=()=>!m||x();for(let M=h,D=h;M<=u;++M)b=t[M%o],!b.skip&&(y=c(b[s]),y!==v&&(m=l(y,n,r),p===null&&k()&&(p=a(y,n)===0?M:D),p!==null&&S()&&(g.push(Vr({start:p,end:M,loop:d,count:o,style:f})),p=null),D=M,v=y));return p!==null&&g.push(Vr({start:p,end:u,loop:d,count:o,style:f})),g}function Br(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const r=Wr(s[n],i.points,t);r.length&&e.push(...r)}return e}function Rh(i,t,e,s){let n=0,r=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(r+=n);r>n&&i[r%t].skip;)r--;return r%=t,{start:n,end:r}}function Nh(i,t,e,s){const n=i.length,r=[];let o=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,r.push({start:t%n,end:(l-1)%n,loop:s}),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:s}),r}function zh(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const r=!!i._loop,{start:o,end:a}=Rh(e,n,r,s);if(s===!0)return Hr(i,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+n:a,c=!!i._fullLoop&&o===0&&a===n-1;return Hr(i,Nh(e,o,l,c),e,t)}function Hr(i,t,e,s){return!s||!s.setContext||!e?t:Vh(i,t,e,s)}function Vh(i,t,e,s){const n=i._chart.getContext(),r=$r(i.options),{_datasetIndex:o,options:{spanGaps:a}}=i,l=e.length,c=[];let h=r,u=t[0].start,d=u;function f(g,m,p,y){const b=a?-1:1;if(g!==m){for(g+=l;e[g%l].skip;)g-=b;for(;e[m%l].skip;)m+=b;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:p,style:y}),h=y,u=m%l)}}for(const g of t){u=a?u:g.start;let m=e[u%l],p;for(d=u+1;d<=g.end;d++){const y=e[d%l];p=$r(s.setContext(Kt(n,{type:"segment",p0:m,p1:y,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),Wh(p,h)&&f(u,d-1,g.loop,h),m=y,h=p}u<d-1&&f(u,d-1,g.loop,h)}return c}function $r(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Wh(i,t){if(!t)return!1;const e=[],s=function(n,r){return js(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(i,s)!==JSON.stringify(t,s)}/*!
12
+ * Chart.js v4.3.0
13
+ * https://www.chartjs.org
14
+ * (c) 2023 Chart.js Contributors
15
+ * Released under the MIT License
16
+ */class Bh{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const r=e.listeners[n],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(s-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=gr.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const r=s.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),r.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $t=new Bh;const jr="transparent",Hh={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=$i(i||jr),n=s.valid&&$i(t||jr);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class $h{constructor(t,e,s,n){const r=e[s];n=li([t.to,n,r,t.from]);const o=li([t.from,r,n]);this._active=!0,this._fn=t.fn||Hh[t.type||typeof o],this._easing=ni[t.easing]||ni.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],r=s-this._start,o=this._duration-r;this._start=s,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=li([t.to,e,n,t.from]),this._from=li([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=r;return}l=e/s%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class Ur{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;const e=Object.keys(Z.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const r=t[n];if(!P(r))return;const o={};for(const a of e)o[a]=r[a];(B(r.properties)&&r.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,o)})})}_animateOptions(t,e){const s=e.options,n=Uh(t,s);if(!n)return[];const r=this._createAnimations(n,s);return s.$shared&&jh(t.options.$animations,s).then(()=>{t.options=s},()=>{}),r}_createAnimations(t,e){const s=this._properties,n=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let u=r[c];const d=s.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 $h(d,t,c,h),n.push(u)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return $t.add(this._chart,s),!0}}function jh(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const r=i[s[n]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Uh(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Yr(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:s?r:n,end:s?n:r}}function Yh(i,t,e){if(e===!1)return!1;const s=Yr(i,e),n=Yr(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function qh(i){let t,e,s,n;return P(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function qr(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,r;for(n=0,r=s.length;n<r;++n)e.push(s[n].index);return e}function Zr(i,t,e,s={}){const n=i.keys,r=s.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=n.length;o<a;++o){if(l=+n[o],l===e){if(s.all)continue;break}c=i.values[l],Y(c)&&(r||t===0||Ft(t)===Ft(c))&&(t+=c)}return t}}function Zh(i){const t=Object.keys(i),e=new Array(t.length);let s,n,r;for(s=0,n=t.length;s<n;++s)r=t[s],e[s]={x:r,y:i[r]};return e}function Xr(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Xh(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Gh(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function Jh(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function Gr(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const r=i[n.index];if(e&&r>0||!e&&r<0)return n.index}return null}function Jr(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=s,l=r.axis,c=o.axis,h=Xh(r,o,s),u=t.length;let d;for(let f=0;f<u;++f){const g=t[f],{[l]:m,[c]:p}=g,y=g._stacks||(g._stacks={});d=y[c]=Jh(n,h,m),d[a]=p,d._top=Gr(d,o,!0,s.type),d._bottom=Gr(d,o,!1,s.type);const b=d._visualValues||(d._visualValues={});b[a]=p}}function tn(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Kh(i,t){return Kt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Qh(i,t,e){return Kt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ci(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const r=n._stacks;if(!r||r[s]===void 0||r[s][e]===void 0)return;delete r[s][e],r[s]._visualValues!==void 0&&r[s]._visualValues[e]!==void 0&&delete r[s]._visualValues[e]}}}const en=i=>i==="reset"||i==="none",Kr=(i,t)=>t?i:Object.assign({},i),tu=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:qr(e,!0),values:null};class Dt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Xr(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ci(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(u,d,f,g)=>u==="x"?d:u==="r"?g:f,r=e.xAxisID=E(s.xAxisID,tn(t,"x")),o=e.yAxisID=E(s.yAxisID,tn(t,"y")),a=e.rAxisID=E(s.rAxisID,tn(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){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&dr(this._data,this),t._stacked&&ci(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(P(e))this._data=Zh(e);else if(s!==e){if(s){dr(s,this);const n=this._cachedMeta;ci(n),n._parsed=[]}e&&Object.isExtensible(e)&&Vc(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const r=e._stacked;e._stacked=Xr(e.vScale,e),e.stack!==s.stack&&(n=!0,ci(e),e.stack=s.stack),this._resyncElements(t),(n||r!==e._stacked)&&Jr(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:r,_stacked:o}=s,a=r.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,u,d;if(this._parsing===!1)s._parsed=n,s._sorted=!0,d=n;else{B(n[t])?d=this.parseArrayData(s,n,t,e):P(n[t])?d=this.parseObjectData(s,n,t,e):d=this.parsePrimitiveData(s,n,t,e);const f=()=>u[a]===null||c&&u[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=u=d[h],l&&(f()&&(l=!1),c=u);s._sorted=l}o&&Jr(this,d)}parsePrimitiveData(t,e,s,n){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),h=r===o,u=new Array(n);let d,f,g;for(d=0,f=n;d<f;++d)g=d+s,u[d]={[a]:h||r.parse(c[g],g),[l]:o.parse(e[g],g)};return u}parseArrayData(t,e,s,n){const{xScale:r,yScale:o}=t,a=new Array(n);let l,c,h,u;for(l=0,c=n;l<c;++l)h=l+s,u=e[h],a[l]={x:r.parse(u[0],h),y:o.parse(u[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,u,d,f;for(h=0,u=n;h<u;++h)d=h+s,f=e[d],c[h]={x:r.parse(Xt(f,a),d),y:o.parse(Xt(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:qr(n,!0),values:e._stacks[t.axis]._visualValues};return Zr(a,o,r.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const r=s[e.axis];let o=r===null?NaN:r;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,o=Zr(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,r=s._sorted&&t===s.iScale,o=n.length,a=this._getOtherScale(t),l=tu(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=Gh(a);let d,f;function g(){f=n[d];const m=f[a.axis];return!Y(f[t.axis])||h>m||u<m}for(d=0;d<o&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),r));++d);if(r){for(d=o-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,r,o;for(n=0,r=e.length;n<r;++n)o=e[n][t.axis],Y(o)&&s.push(o);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:s?""+s.getLabelForValue(r[s.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=qh(E(this.options.clip,Yh(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,r,a,l),h=a;h<a+l;++h){const u=n[h];u.hidden||(u.active&&c?o.push(u):u.draw(t,r))}for(h=0;h<o.length;++h)o[h].draw(t,r)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=Qh(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=n.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Kh(this.chart.getContext(),this.index)),r.dataset=n,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=s,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&ei(s);if(a)return Kr(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=n?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),f=Object.keys(Z.elements[t]),g=()=>this.getContext(s,n,e),m=c.resolveNamedOptions(d,f,g,u);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(Kr(m,l))),m}_resolveAnimations(t,e,s){const n=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,s,e))}const c=new Ur(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||en(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(s),o=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,s),{sharedOptions:r,includeOptions:o}}updateElement(t,e,s,n){en(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!en(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const r=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,r=e.length,o=Math.min(r,n);o&&this.parse(0,o),r>n?this._insertElements(n,r-n,t):r<n&&this._removeElements(r,n-r)}_insertElements(t,e,s=!0){const n=this._cachedMeta,r=n.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(r,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&ci(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}_(Dt,"defaults",{}),_(Dt,"datasetElementType",null),_(Dt,"dataElementType",null);function eu(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let s=[];for(let n=0,r=e.length;n<r;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=fr(s.sort((n,r)=>n-r))}return i._cache.$bar}function iu(i){const t=i.iScale,e=eu(t,i.type);let s=t._length,n,r,o,a;const l=()=>{o===32767||o===-32768||(ei(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(n=0,r=e.length;n<r;++n)o=t.getPixelForValue(e[n]),l();for(a=void 0,n=0,r=t.ticks.length;n<r;++n)o=t.getPixelForTick(n),l();return s}function su(i,t,e,s){const n=e.barThickness;let r,o;return F(n)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=n*s,o=1),{chunk:r/s,ratio:o,start:t.pixels[i]-r/2}}function nu(i,t,e,s){const n=t.pixels,r=n[i];let o=i>0?n[i-1]:null,a=i<n.length-1?n[i+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/s,ratio:e.barPercentage,start:c}}function ru(i,t,e,s){const n=e.parse(i[0],s),r=e.parse(i[1],s),o=Math.min(n,r),a=Math.max(n,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:r,min:o,max:a}}function Qr(i,t,e,s){return B(i)?ru(i,t,e,s):t[e.axis]=e.parse(i,s),t}function to(i,t,e,s){const n=i.iScale,r=i.vScale,o=n.getLabels(),a=n===r,l=[];let c,h,u,d;for(c=e,h=e+s;c<h;++c)d=t[c],u={},u[n.axis]=a||n.parse(o[c],c),l.push(Qr(d,u,r,c));return l}function sn(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function ou(i,t,e){return i!==0?Ft(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function au(i){let t,e,s,n,r;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",r="start"):(n="start",r="end"),{start:e,end:s,reverse:t,top:n,bottom:r}}function lu(i,t,e,s){let n=t.borderSkipped;const r={};if(!n){i.borderSkipped=r;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:h}=au(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=h:(r[eo(h,o,a,l)]=!0,n=c)),r[eo(n,o,a,l)]=!0,i.borderSkipped=r}function eo(i,t,e,s){return s?(i=cu(i,t,e),i=io(i,e,t)):i=io(i,t,e),i}function cu(i,t,e){return i===t?e:i===e?t:i}function io(i,t,e){return i==="start"?t:i==="end"?e:i}function hu(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class Qt extends Dt{parsePrimitiveData(t,e,s,n){return to(t,e,s,n)}parseArrayData(t,e,s,n){return to(t,e,s,n)}parseObjectData(t,e,s,n){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,h=o.axis==="x"?a:l,u=[];let d,f,g,m;for(d=s,f=s+n;d<f;++d)m=e[d],g={},g[r.axis]=r.parse(Xt(m,c),d),u.push(Qr(Xt(m,h),g,o,d));return u}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);const r=s._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:n}=e,r=this.getParsed(t),o=r._custom,a=sn(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+s.getLabelForValue(r[s.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,n){const r=n==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,n);for(let f=e;f<e+s;f++){const g=this.getParsed(f),m=r||F(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,h),y=(g._stacks||{})[a.axis],b={horizontal:c,base:m.base,enableBorderRadius:!y||sn(g._custom)||o===y._top||o===y._bottom,x:c?m.head:p.center,y:c?p.center:m.head,height:c?p.size:Math.abs(m.size),width:c?Math.abs(m.size):p.size};d&&(b.options=u||this.resolveDataElementOptions(f,t[f].active?"active":n));const v=b.options||t[f].options;lu(b,v,y,o),hu(b,v,h.ratio),this.updateElement(t[f],f,b,n)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),r=s.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(F(h)||isNaN(h))return!0};for(const 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,s){const n=this._getStacks(t,s),r=e!==void 0?n.indexOf(e):-1;return r===-1?n.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let r,o;for(r=0,o=e.data.length;r<o;++r)n.push(s.getPixelForValue(this.getParsed(r)[s.axis],r));const a=t.barThickness;return{min:a||iu(e),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:n},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,h=sn(c);let u=l[e.axis],d=0,f=s?this.applyStack(e,l,s):u,g,m;f!==u&&(d=f-u,f=u),h&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Ft(u)!==Ft(c.barEnd)&&(d=0),d+=u);const p=!F(r)&&!h?r:d;let y=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(d+f):g=y,m=g-y,Math.abs(m)<o){m=ou(m,e,a)*o,u===a&&(y-=m/2);const b=e.getPixelForDecimal(0),v=e.getPixelForDecimal(1),w=Math.min(b,v),x=Math.max(b,v);y=Math.max(Math.min(y,x),w),g=y+m,s&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(g)-e.getValueForPixel(y))}if(y===e.getPixelForValue(a)){const b=Ft(m)*e.getLineWidthForValue(a)/2;y+=b,m-=b}return{size:m,base:y,head:g,center:g+m/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,r=n.skipNull,o=E(n.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,h=n.barThickness==="flex"?nu(t,e,n,c):su(t,e,n,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=h.start+h.chunk*u+h.chunk/2,l=Math.min(o,h.chunk*h.ratio)}else a=s.getPixelForValue(this.getParsed(t)[s.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,n=s.length;let r=0;for(;r<n;++r)this.getParsed(r)[e.axis]!==null&&s[r].draw(this._ctx)}}_(Qt,"id","bar"),_(Qt,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),_(Qt,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ki extends Dt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,s,n){const r=super.parsePrimitiveData(t,e,s,n);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+s).radius;return r}parseArrayData(t,e,s,n){const r=super.parseArrayData(t,e,s,n);for(let o=0;o<r.length;o++){const a=e[s+o];r[o]._custom=E(a[2],this.resolveDataElementOptions(o+s).radius)}return r}parseObjectData(t,e,s,n){const r=super.parseObjectData(t,e,s,n);for(let o=0;o<r.length;o++){const a=e[s+o];r[o]._custom=E(a&&a.r&&+a.r,this.resolveDataElementOptions(o+s).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let s=t.length-1;s>=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:r}=e,o=this.getParsed(t),a=n.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:s[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){const r=n==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=o.axis,u=a.axis;for(let d=e;d<e+s;d++){const f=t[d],g=!r&&this.getParsed(d),m={},p=m[h]=r?o.getPixelForDecimal(.5):o.getPixelForValue(g[h]),y=m[u]=r?a.getBasePixel():a.getPixelForValue(g[u]);m.skip=isNaN(p)||isNaN(y),c&&(m.options=l||this.resolveDataElementOptions(d,f.active?"active":n),r&&(m.options.radius=0)),this.updateElement(f,d,m,n)}}resolveDataElementOptions(t,e){const s=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const r=n.radius;return e!=="active"&&(n.radius=0),n.radius+=E(s&&s._custom,r),n}}_(Ki,"id","bubble"),_(Ki,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),_(Ki,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function uu(i,t,e){let s=1,n=1,r=0,o=0;if(t<H){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),f=(v,w,x)=>si(v,a,l,!0)?1:Math.max(w,w*e,x,x*e),g=(v,w,x)=>si(v,a,l,!0)?-1:Math.min(w,w*e,x,x*e),m=f(0,c,u),p=f(q,h,d),y=g(j,c,u),b=g(j+q,h,d);s=(m-y)/2,n=(p-b)/2,r=-(m+y)/2,o=-(p+b)/2}return{ratioX:s,ratioY:n,offsetX:r,offsetY:o}}class me extends Dt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let r=l=>+s[l];if(P(s[t])){const{key:l="value"}=this._parsing;r=c=>+Xt(s[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)n._parsed[o]=r(o)}}_getRotation(){return Ot(this.options.rotation-90)}_getCircumference(){return Ot(this.options.circumference)}_getRotationExtents(){let t=H,e=-H;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const n=this.chart.getDatasetMeta(s).controller,r=n._getRotation(),o=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,n=this._cachedMeta,r=n.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(s.width,s.height)-o)/2,0),l=Math.min(kc(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:g,offsetY:m}=uu(u,h,l),p=(s.width-o)/d,y=(s.height-o)/f,b=Math.max(Math.min(p,y)/2,0),v=ir(this.options.radius,b),w=Math.max(v*l,0),x=(v-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const s=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/H)}updateElements(t,e,s,n){const r=n==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=r&&c.animateScale,f=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:m,includeOptions:p}=this._getSharedOptions(e,n);let y=this._getRotation(),b;for(b=0;b<e;++b)y+=this._circumference(b,r);for(b=e;b<e+s;++b){const v=this._circumference(b,r),w=t[b],x={x:h+this.offsetX,y:u+this.offsetY,startAngle:y,endAngle:y+v,circumference:v,outerRadius:g,innerRadius:f};p&&(x.options=m||this.resolveDataElementOptions(b,w.active?"active":n)),y+=v,this.updateElement(w,b,x,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,n;for(n=0;n<e.length;n++){const r=t._parsed[n];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(r))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?H*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],r=ri(e._parsed[t],s.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,r,o,a,l;if(!t){for(n=0,r=s.data.datasets.length;n<r;++n)if(s.isDatasetVisible(n)){o=s.getDatasetMeta(n),t=o.data,a=o.controller;break}}if(!t)return 0;for(n=0,r=t.length;n<r;++n)l=a.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){const r=this.resolveDataElementOptions(s);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}_(me,"id","doughnut"),_(me,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),_(me,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),_(me,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class jt extends Dt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=pr(e,n,o);this._drawStart=a,this._drawCount=l,yr(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!r._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!o,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const 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=Ce(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||n==="none",b=e+s,v=t.length;let w=e>0&&this.getParsed(e-1);for(let x=0;x<v;++x){const k=t[x],S=y?k:{};if(x<e||x>=b){S.skip=!0;continue}const M=this.getParsed(x),D=F(M[f]),C=S[d]=o.getPixelForValue(M[d],x),A=S[f]=r||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],x);S.skip=isNaN(C)||isNaN(A)||D,S.stop=x>0&&Math.abs(M[d]-w[d])>p,m&&(S.parsed=M,S.raw=c.data[x]),u&&(S.options=h||this.resolveDataElementOptions(x,k.active?"active":n)),y||this.updateElement(k,x,S,n),w=M}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}_(jt,"id","line"),_(jt,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),_(jt,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Rt extends Dt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],r=ri(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,s,n){return Ar.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{const r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),o=Math.max(s.cutoutPercentage?r/100*s.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){const 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*j;let f=d,g;const m=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,n,m);for(g=e;g<e+s;g++){const p=t[g];let y=f,b=f+this._computeAngle(g,n,m),v=o.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=b,r&&(l.animateScale&&(v=0),l.animateRotate&&(y=b=d));const w={x:h,y:u,innerRadius:0,outerRadius:v,startAngle:y,endAngle:b,options:this.resolveDataElementOptions(g,p.active?"active":n)};this.updateElement(p,g,w,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((s,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?Ot(this.resolveDataElementOptions(t,e).angle||s):0}}_(Rt,"id","polarArea"),_(Rt,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),_(Rt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class nn extends me{}_(nn,"id","pie"),_(nn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Qi extends Dt{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return Ar.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta,s=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(s.points=n,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===n.length,options:o};this.updateElement(s,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){const r=this._cachedMeta.rScale,o=n==="reset";for(let a=e;a<e+s;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":n),h=r.getPointPositionForValue(a,this.getParsed(a).r),u=o?r.xCenter:h.x,d=o?r.yCenter:h.y,f={x:u,y:d,angle:h.angle,skip:isNaN(u)||isNaN(d),options:c};this.updateElement(l,a,f,n)}}}_(Qi,"id","radar"),_(Qi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),_(Qi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class pe extends Dt{getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:r}=e,o=this.getParsed(t),a=n.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:s[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:s=[]}=e,n=this.chart._animationsDisabled;let{start:r,count:o}=pr(e,s,n);if(this._drawStart=r,this._drawCount=o,yr(e)&&(r=0,o=s.length),this.options.showLine){const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=s;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!n,options:c},t)}this.updateElements(s,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,s,n){const r=n==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),u=this.getSharedOptions(h),d=this.includeOptions(n,u),f=o.axis,g=a.axis,{spanGaps:m,segment:p}=this.options,y=Ce(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||n==="none";let v=e>0&&this.getParsed(e-1);for(let w=e;w<e+s;++w){const x=t[w],k=this.getParsed(w),S=b?x:{},M=F(k[g]),D=S[f]=o.getPixelForValue(k[f],w),C=S[g]=r||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[g],w);S.skip=isNaN(D)||isNaN(C)||M,S.stop=w>0&&Math.abs(k[f]-v[f])>y,p&&(S.parsed=k,S.raw=c.data[w]),d&&(S.options=u||this.resolveDataElementOptions(w,x.active?"active":n)),b||this.updateElement(x,w,S,n),v=k}this.updateSharedOptions(u,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;const 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}}_(pe,"id","scatter"),_(pe,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),_(pe,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var du=Object.freeze({__proto__:null,BarController:Qt,BubbleController:Ki,DoughnutController:me,LineController:jt,PieController:nn,PolarAreaController:Rt,RadarController:Qi,ScatterController:pe});function ye(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class rn{constructor(t){_(this,"options");this.options=t||{}}static override(t){Object.assign(rn.prototype,t)}init(){}formats(){return ye()}parse(){return ye()}format(){return ye()}add(){return ye()}diff(){return ye()}startOf(){return ye()}endOf(){return ye()}}var so={_date:rn};function fu(i,t,e,s){const{controller:n,data:r,_sorted:o}=i,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?Nc:Bt;if(s){if(n._sharedOptions){const c=r[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const 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 hi(i,t,e,s,n){const r=i.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:h}=r[a],{lo:u,hi:d}=fu(r[a],t,o,n);for(let f=u;f<=d;++f){const g=h[f];g.skip||s(g,c,f)}}}function gu(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const r=t?Math.abs(s.x-n.x):0,o=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function on(i,t,e,s,n){const r=[];return!n&&!i.isPointInArea(t)||hi(i,e,t,function(a,l,c){!n&&!Ht(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function mu(i,t,e,s){let n=[];function r(o,a,l){const{startAngle:c,endAngle:h}=o.getProps(["startAngle","endAngle"],s),{angle:u}=hr(o,{x:t.x,y:t.y});si(u,c,h)&&n.push({element:o,datasetIndex:a,index:l})}return hi(i,e,t,r),n}function pu(i,t,e,s,n,r){let o=[];const a=gu(e);let l=Number.POSITIVE_INFINITY;function c(h,u,d){const f=h.inRange(t.x,t.y,n);if(s&&!f)return;const g=h.getCenterPoint(n);if(!(!!r||i.isPointInArea(g))&&!f)return;const p=a(t,g);p<l?(o=[{element:h,datasetIndex:u,index:d}],l=p):p===l&&o.push({element:h,datasetIndex:u,index:d})}return hi(i,e,t,c),o}function an(i,t,e,s,n,r){return!r&&!i.isPointInArea(t)?[]:e==="r"&&!s?mu(i,t,e,n):pu(i,t,e,s,n,r)}function no(i,t,e,s,n){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return hi(i,e,t,(l,c,h)=>{l[o](t[e],n)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:r}var yu={evaluateInteractionItems:hi,modes:{index(i,t,e,s){const n=fe(t,i),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?on(i,n,r,s,o):an(i,n,r,!1,s,o),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=fe(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?on(i,n,r,s,o):an(i,n,r,!1,s,o);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,s){const n=fe(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return on(i,n,r,s,o)},nearest(i,t,e,s){const n=fe(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return an(i,n,r,e.intersect,s,o)},x(i,t,e,s){const n=fe(t,i);return no(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=fe(t,i);return no(i,n,"y",e.intersect,s)}}};const ro=["left","top","right","bottom"];function ui(i,t){return i.filter(e=>e.pos===t)}function oo(i,t){return i.filter(e=>ro.indexOf(e.pos)===-1&&e.box.axis===t)}function di(i,t){return i.sort((e,s)=>{const n=t?s:e,r=t?e:s;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function bu(i){const t=[];let e,s,n,r,o,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:r,options:{stack:o,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&r+o,stackWeight:a});return t}function xu(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:r}=e;if(!s||!ro.includes(n))continue;const o=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function _u(i,t){const e=xu(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let r,o,a;for(r=0,o=i.length;r<o;++r){a=i[r];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return e}function wu(i){const t=bu(i),e=di(t.filter(c=>c.box.fullSize),!0),s=di(ui(t,"left"),!0),n=di(ui(t,"right")),r=di(ui(t,"top"),!0),o=di(ui(t,"bottom")),a=oo(t,"x"),l=oo(t,"y");return{fullSize:e,leftAndTop:s.concat(r),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:ui(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:r.concat(o).concat(a)}}function ao(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function lo(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function vu(i,t,e,s){const{pos:n,box:r}=e,o=i.maxPadding;if(!P(n)){e.size&&(i[n]-=e.size);const u=s[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?r.height:r.width),e.size=u.size/u.count,i[n]+=e.size}r.getPadding&&lo(o,r.getPadding());const a=Math.max(0,t.outerWidth-ao(o,i,"left","right")),l=Math.max(0,t.outerHeight-ao(o,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Su(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Mu(i,t){const e=t.maxPadding;function s(n){const r={left:0,top:0,right:0,bottom:0};return n.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return s(i?["left","right"]:["top","bottom"])}function fi(i,t,e,s){const n=[];let r,o,a,l,c,h;for(r=0,o=i.length,c=0;r<o;++r){a=i[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Mu(a.horizontal,t));const{same:u,other:d}=vu(t,e,a,s);c|=u&&n.length,h=h||d,l.fullSize||n.push(a)}return c&&fi(n,t,e,s)||h}function ts(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function co(i,t,e,s){const n=e.padding;let{x:r,y:o}=t;for(const a of i){const l=a.box,c=s[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const u=t.w*h,d=c.size||l.height;ei(c.start)&&(o=c.start),l.fullSize?ts(l,n.left,o,e.outerWidth-n.right-n.left,d):ts(l,t.left+c.placed,o,u,d),c.start=o,c.placed+=u,o=l.bottom}else{const u=t.h*h,d=c.size||l.width;ei(c.start)&&(r=c.start),l.fullSize?ts(l,r,n.top,d,e.outerHeight-n.bottom-n.top):ts(l,r,t.top+c.placed,d,u),c.start=r,c.placed+=u,r=l.right}}t.x=r,t.y=o}var rt={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=nt(i.options.layout.padding),r=Math.max(t-n.width,0),o=Math.max(e-n.height,0),a=wu(i.boxes),l=a.vertical,c=a.horizontal;z(i.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const 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);lo(d,nt(s));const f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),g=_u(l.concat(c),u);fi(a.fullSize,f,u,g),fi(l,f,u,g),fi(c,f,u,g)&&fi(l,f,u,g),Su(f),co(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,co(a.rightAndBottom,f,u,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},z(a.chartArea,m=>{const p=m.box;Object.assign(p,i.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ho{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class ku extends ho{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const es="$chartjs",Tu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},uo=i=>i===null||i==="";function Ou(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[es]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",uo(n)){const r=Fr(i,"width");r!==void 0&&(i.width=r)}if(uo(s))if(i.style.height==="")i.height=i.width/(t||2);else{const r=Fr(i,"height");r!==void 0&&(i.height=r)}return i}const fo=Ch?{passive:!0}:!1;function Du(i,t,e){i.addEventListener(t,e,fo)}function Eu(i,t,e){i.canvas.removeEventListener(t,e,fo)}function Cu(i,t){const e=Tu[i.type]||i.type,{x:s,y:n}=fe(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function is(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Au(i,t,e){const s=i.canvas,n=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||is(a.addedNodes,s),o=o&&!is(a.removedNodes,s);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Pu(i,t,e){const s=i.canvas,n=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||is(a.removedNodes,s),o=o&&!is(a.addedNodes,s);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const gi=new Map;let go=0;function mo(){const i=window.devicePixelRatio;i!==go&&(go=i,gi.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Iu(i,t){gi.size||window.addEventListener("resize",mo),gi.set(i,t)}function Lu(i){gi.delete(i),gi.size||window.removeEventListener("resize",mo)}function Fu(i,t,e){const s=i.canvas,n=s&&Qs(s);if(!n)return;const r=mr((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(n),Iu(i,r),o}function ln(i,t,e){e&&e.disconnect(),t==="resize"&&Lu(i)}function Ru(i,t,e){const s=i.canvas,n=mr(r=>{i.ctx!==null&&e(Cu(r,i))},i);return Du(s,t,n),n}class Nu extends ho{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Ou(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[es])return!1;const s=e[es].initial;["height","width"].forEach(r=>{const o=s[r];F(o)?e.removeAttribute(r):e.setAttribute(r,o)});const n=s.style||{};return Object.keys(n).forEach(r=>{e.style[r]=n[r]}),e.width=e.width,delete e[es],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),o={attach:Au,detach:Pu,resize:Fu}[e]||Ru;n[e]=o(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ln,detach:ln,resize:ln}[e]||Eu)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Eh(t,e,s,n)}isAttached(t){const e=Qs(t);return!!(e&&e.isConnected)}}function zu(i){return!Ir()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?ku:Nu}class Et{constructor(){_(this,"x");_(this,"y");_(this,"active",!1);_(this,"options");_(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Ce(this.x)&&Ce(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(r=>{n[r]=s[r]&&s[r].active()?s[r]._to:this[r]}),n}}_(Et,"defaults",{}),_(Et,"defaultRoutes");function Vu(i,t){const e=i.options.ticks,s=Wu(i),n=Math.min(e.maxTicksLimit||s,s),r=e.major.enabled?Hu(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>n)return $u(t,c,r,o/n),c;const h=Bu(r,t,n);if(o>0){let u,d;const f=o>1?Math.round((l-a)/(o-1)):null;for(ss(t,c,h,F(f)?0:a-f,a),u=0,d=o-1;u<d;u++)ss(t,c,h,r[u],r[u+1]);return ss(t,c,h,l,F(f)?t.length:l+f),c}return ss(t,c,h),c}function Wu(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Bu(i,t,e){const s=ju(i),n=t.length/e;if(!s)return Math.max(n,1);const r=Ic(s);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>n)return l}return Math.max(n,1)}function Hu(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function $u(i,t,e,s){let n=0,r=e[0],o;for(s=Math.ceil(s),o=0;o<i.length;o++)o===r&&(t.push(i[o]),n++,r=e[n*s])}function ss(i,t,e,s,n){const r=E(s,0),o=Math.min(E(n,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=r;h<0;)a++,h=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===h&&(t.push(i[c]),a++,h=Math.round(r+a*e))}function ju(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const Uu=i=>i==="left"?"right":i==="right"?"left":i,po=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,yo=(i,t)=>Math.min(t||i,i);function bo(i,t){const e=[],s=i.length/t,n=i.length;let r=0;for(;r<n;r+=s)e.push(i[Math.floor(r)]);return e}function Yu(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),r=i._startPixel,o=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-r,o-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<r-a||l>o+a)))return l}function qu(i,t){z(i,e=>{const s=e.gc,n=s.length/2;let r;if(n>t){for(r=0;r<n;++r)delete e.data[s[r]];s.splice(0,n)}})}function mi(i){return i.drawTicks?i.tickLength:0}function xo(i,t){if(!i.display)return 0;const e=Q(i.font,t),s=nt(i.padding);return(B(i.text)?i.text.length:1)*e.lineHeight+s.height}function Zu(i,t){return Kt(i,{scale:t,type:"scale"})}function Xu(i,t,e){return Kt(i,{tick:e,index:t,type:"tick"})}function Gu(i,t,e){let s=$s(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Uu(s)),s}function Ju(i,t,e,s){const{top:n,left:r,bottom:o,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let u=0,d,f,g;const m=o-n,p=a-r;if(i.isHorizontal()){if(f=st(s,r,a),P(e)){const y=Object.keys(e)[0],b=e[y];g=h[y].getPixelForValue(b)+m-t}else e==="center"?g=(c.bottom+c.top)/2+m-t:g=po(i,e,t);d=a-r}else{if(P(e)){const y=Object.keys(e)[0],b=e[y];f=h[y].getPixelForValue(b)-p+t}else e==="center"?f=(c.left+c.right)/2-p+t:f=po(i,e,t);g=st(s,o,n),u=e==="left"?-q:q}return{titleX:f,titleY:g,maxWidth:d,rotation:u}}class be extends Et{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=mt(t,Number.POSITIVE_INFINITY),e=mt(e,Number.NEGATIVE_INFINITY),s=mt(s,Number.POSITIVE_INFINITY),n=mt(n,Number.NEGATIVE_INFINITY),{min:mt(t,s),max:mt(e,n),minDefined:Y(t),maxDefined:Y(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:r}=this.getUserBounds(),o;if(n&&r)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,o.min)),r||(s=Math.max(s,o.max));return e=r&&e>s?s:e,s=n&&e>s?e:s,{min:mt(e,mt(s,e)),max:mt(s,mt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){W(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ah(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?bo(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Vu(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){W(this.options.afterUpdate,[this])}beforeSetDimensions(){W(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){W(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),W(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){W(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,r;for(s=0,n=t.length;s<n;s++)r=t[s],r.label=W(e.callback,[r.value,s,t],this)}afterTickToLabelConversion(){W(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){W(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=yo(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,r=e.maxRotation;let o=n,a,l,c;if(!this._isVisible()||!e.display||n>=r||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=tt(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),u+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-mi(t.grid)-e.padding-xo(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=Ws(Math.min(Math.asin(tt((h.highest.height+6)/a,-1,1)),Math.asin(tt(l/c,-1,1))-Math.asin(tt(d/c,-1,1)))),o=Math.max(n,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){W(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){W(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=xo(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=mi(r)+l):(t.height=this.maxHeight,t.width=mi(r)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=s.padding*2,g=Ot(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){const y=s.mirror?0:p*u.width+m*d.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=s.mirror?0:m*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+y+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,s,n){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,f=0;l?c?(d=n*t.width,f=s*e.height):(d=s*t.height,f=n*e.width):r==="start"?f=e.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+o)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;r==="start"?(h=0,u=t.height):r==="end"&&(h=e.height,u=0),this.paddingTop=h+o,this.paddingBottom=u+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){W(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)F(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=bo(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/yo(e,s));let c=0,h=0,u,d,f,g,m,p,y,b,v,w,x;for(u=0;u<e;u+=l){if(g=t[u].label,m=this._resolveTickFontOptions(u),n.font=p=m.string,y=r[p]=r[p]||{data:{},gc:[]},b=m.lineHeight,v=w=0,!F(g)&&!B(g))v=Ui(n,y.data,y.gc,v,g),w=b;else if(B(g))for(d=0,f=g.length;d<f;++d)x=g[d],!F(x)&&!B(x)&&(v=Ui(n,y.data,y.gc,v,x),w+=b);o.push(v),a.push(w),c=Math.max(v,c),h=Math.max(w,h)}qu(r,e);const k=o.indexOf(c),S=a.indexOf(h),M=D=>({width:o[D]||0,height:a[D]||0});return{first:M(0),last:M(e-1),widest:M(k),highest:M(S),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Rc(this._alignToPixels?ce(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Xu(this.getContext(),t,s))}return this.$context||(this.$context=Zu(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ot(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:r,position:o,border:a}=n,l=r.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),d=mi(r),f=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,y=function(U){return ce(s,U,m)};let b,v,w,x,k,S,M,D,C,A,L,it;if(o==="top")b=y(this.bottom),S=this.bottom-d,D=b-p,A=y(t.top)+p,it=t.bottom;else if(o==="bottom")b=y(this.top),A=t.top,it=y(t.bottom)-p,S=b+p,D=this.top+d;else if(o==="left")b=y(this.right),k=this.right-d,M=b-p,C=y(t.left)+p,L=t.right;else if(o==="right")b=y(this.left),C=t.left,L=y(t.right)-p,k=b+p,M=this.left+d;else if(e==="x"){if(o==="center")b=y((t.top+t.bottom)/2+.5);else if(P(o)){const U=Object.keys(o)[0],G=o[U];b=y(this.chart.scales[U].getPixelForValue(G))}A=t.top,it=t.bottom,S=b+p,D=S+d}else if(e==="y"){if(o==="center")b=y((t.left+t.right)/2);else if(P(o)){const U=Object.keys(o)[0],G=o[U];b=y(this.chart.scales[U].getPixelForValue(G))}k=b-p,M=k-d,C=t.left,L=t.right}const _t=E(n.ticks.maxTicksLimit,u),V=Math.max(1,Math.ceil(u/_t));for(v=0;v<u;v+=V){const U=this.getContext(v),G=r.setContext(U),Lt=a.setContext(U),at=G.lineWidth,Ge=G.color,Is=Lt.dash||[],Je=Lt.dashOffset,Pi=G.tickWidth,Ii=G.tickColor,Li=G.tickBorderDash||[],Fi=G.tickBorderDashOffset;w=Yu(this,v,l),w!==void 0&&(x=ce(s,w,at),c?k=M=C=L=x:S=D=A=it=x,f.push({tx1:k,ty1:S,tx2:M,ty2:D,x1:C,y1:A,x2:L,y2:it,width:at,color:Ge,borderDash:Is,borderDashOffset:Je,tickWidth:Pi,tickColor:Ii,tickBorderDash:Li,tickBorderDashOffset:Fi}))}return this._ticksLength=u,this._borderValue=b,f}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:r}=s,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=r,d=mi(s.grid),f=d+h,g=u?-h:f,m=-Ot(this.labelRotation),p=[];let y,b,v,w,x,k,S,M,D,C,A,L,it="middle";if(n==="top")k=this.bottom-g,S=this._getXAxisLabelAlignment();else if(n==="bottom")k=this.top+g,S=this._getXAxisLabelAlignment();else if(n==="left"){const V=this._getYAxisLabelAlignment(d);S=V.textAlign,x=V.x}else if(n==="right"){const V=this._getYAxisLabelAlignment(d);S=V.textAlign,x=V.x}else if(e==="x"){if(n==="center")k=(t.top+t.bottom)/2+f;else if(P(n)){const V=Object.keys(n)[0],U=n[V];k=this.chart.scales[V].getPixelForValue(U)+f}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")x=(t.left+t.right)/2-f;else if(P(n)){const V=Object.keys(n)[0],U=n[V];x=this.chart.scales[V].getPixelForValue(U)}S=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?it="top":l==="end"&&(it="bottom"));const _t=this._getLabelSizes();for(y=0,b=a.length;y<b;++y){v=a[y],w=v.label;const V=r.setContext(this.getContext(y));M=this.getPixelForTick(y)+r.labelOffset,D=this._resolveTickFontOptions(y),C=D.lineHeight,A=B(w)?w.length:1;const U=A/2,G=V.color,Lt=V.textStrokeColor,at=V.textStrokeWidth;let Ge=S;o?(x=M,S==="inner"&&(y===b-1?Ge=this.options.reverse?"left":"right":y===0?Ge=this.options.reverse?"right":"left":Ge="center"),n==="top"?c==="near"||m!==0?L=-A*C+C/2:c==="center"?L=-_t.highest.height/2-U*C+C:L=-_t.highest.height+C/2:c==="near"||m!==0?L=C/2:c==="center"?L=_t.highest.height/2-U*C:L=_t.highest.height-A*C,u&&(L*=-1),m!==0&&!V.showLabelBackdrop&&(x+=C/2*Math.sin(m))):(k=M,L=(1-A)*C/2);let Is;if(V.showLabelBackdrop){const Je=nt(V.backdropPadding),Pi=_t.heights[y],Ii=_t.widths[y];let Li=L-Je.top,Fi=0-Je.left;switch(it){case"middle":Li-=Pi/2;break;case"bottom":Li-=Pi;break}switch(S){case"center":Fi-=Ii/2;break;case"right":Fi-=Ii;break}Is={left:Fi,top:Li,width:Ii+Je.width,height:Pi+Je.height,color:V.backdropColor}}p.push({label:w,font:D,textOffset:L,options:{rotation:m,color:G,strokeColor:Lt,strokeWidth:at,textAlign:Ge,textBaseline:it,translation:[x,k],backdrop:Is}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ot(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,h;return e==="left"?n?(h=this.right+r,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+r,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(r=>r.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(r=0,o=n.length;r<o;++r){const l=n[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,r=s.setContext(this.getContext()),o=s.display?r.width:0;if(!o)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,u,d;this.isHorizontal()?(c=ce(t,this.left,o)-o/2,h=ce(t,this.right,a)+a/2,u=d=l):(u=ce(t,this.top,o)-o/2,d=ce(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,u),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&Yi(s,n);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,h=o.textOffset;he(s,c,0,h,l,a)}n&&qi(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const r=Q(s.font),o=nt(s.padding),a=s.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||P(e)?(l+=o.bottom,B(s.text)&&(l+=r.lineHeight*(s.text.length-1))):l+=o.top;const{titleX:c,titleY:h,maxWidth:u,rotation:d}=Ju(this,l,e,a);he(t,s.text,0,0,r,{color:s.color,maxWidth:u,rotation:d,textAlign:Gu(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=E(t.grid&&t.grid.z,-1),n=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==be.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:s,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Q(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ns{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;td(e)&&(s=this.register(e));const n=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in n||(n[r]=t,Ku(t,o,s),this.override&&Z.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in Z[n]&&(delete Z[n][s],this.override&&delete le[s])}}function Ku(i,t,e){const s=pt(Object.create(null),[e?Z.get(e):{},Z.get(t),i.defaults]);Z.set(t,s),i.defaultRoutes&&Qu(t,i.defaultRoutes),i.descriptors&&Z.describe(t,i.descriptors)}function Qu(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),r=[i].concat(s).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");Z.route(r,n,l,a)})}function td(i){return"id"in i&&"defaults"in i}class ed{constructor(){this.controllers=new ns(Dt,"datasets",!0),this.elements=new ns(Et,"elements"),this.plugins=new ns(Object,"plugins"),this.scales=new ns(be,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const r=s||this._getRegistryForType(n);s||r.isForType(n)||r===this.plugins&&n.id?this._exec(t,r,n):z(n,o=>{const a=s||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,s){const n=Vs(t);W(s["before"+n],[],s),e[t](s),W(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var lt=new ed;class id{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(r,t,e,s);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,s,n){n=n||{};for(const r of t){const o=r.plugin,a=o[s],l=[e,n,r.options];if(W(a,l,o)===!1&&n.cancelable)return!1}return!0}invalidate(){F(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=E(s.options&&s.options.plugins,{}),r=sd(s);return n===!1&&!e?[]:rd(t,r,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function sd(i){const t={},e=[],s=Object.keys(lt.plugins.items);for(let r=0;r<s.length;r++)e.push(lt.getPlugin(s[r]));const n=i.plugins||[];for(let r=0;r<n.length;r++){const o=n[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function nd(i,t){return!t&&i===!1?null:i===!0?{}:i}function rd(i,{plugins:t,localIds:e},s,n){const r=[],o=i.getContext();for(const a of t){const l=a.id,c=nd(s[l],n);c!==null&&r.push({plugin:a,options:od(i.config,{plugin:a,local:e[l]},c,o)})}return r}function od(i,{plugin:t,local:e},s,n){const r=i.pluginScopeKeys(t),o=i.getOptionScopes(s,r);return e&&t.defaults&&o.push(t.defaults),i.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function cn(i,t){const e=Z.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function ad(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function ld(i,t){return i===t?"_index_":"_value_"}function _o(i){if(i==="x"||i==="y"||i==="r")return i}function cd(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function hn(i,...t){if(_o(i))return i;for(const e of t){const s=e.axis||cd(e.position)||i.length>1&&_o(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function wo(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function hd(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return wo(i,"x",e[0])||wo(i,"y",e[0])}return{}}function ud(i,t){const e=le[i.type]||{scales:{}},s=t.scales||{},n=cn(i.type,t),r=Object.create(null);return Object.keys(s).forEach(o=>{const a=s[o];if(!P(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=hn(o,a,hd(o,i),Z.scales[a.type]),c=ld(l,n),h=e.scales||{};r[o]=ti(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(o=>{const a=o.type||i.type,l=o.indexAxis||cn(a,t),h=(le[a]||{}).scales||{};Object.keys(h).forEach(u=>{const d=ad(u,l),f=o[d+"AxisID"]||d;r[f]=r[f]||Object.create(null),ti(r[f],[{axis:d},s[f],h[u]])})}),Object.keys(r).forEach(o=>{const a=r[o];ti(a,[Z.scales[a.type],Z.scale])}),r}function vo(i){const t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=ud(i,t)}function So(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function dd(i){return i=i||{},i.data=So(i.data),vo(i),i}const Mo=new Map,ko=new Set;function rs(i,t){let e=Mo.get(i);return e||(e=t(),Mo.set(i,e),ko.add(e)),e}const pi=(i,t,e)=>{const s=Xt(t,e);s!==void 0&&i.add(s)};class fd{constructor(t){this._config=dd(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=So(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),vo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rs(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rs(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rs(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return rs(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:r}=this,o=this._cachedScopes(t,s),a=o.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>pi(l,t,u))),h.forEach(u=>pi(l,n,u)),h.forEach(u=>pi(l,le[r]||{},u)),h.forEach(u=>pi(l,Z,u)),h.forEach(u=>pi(l,Ys,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ko.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,le[e]||{},Z.datasets[e]||{},{type:e},Z,Ys]}resolveNamedOptions(t,e,s,n=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=To(this._resolverCache,t,n);let l=o;if(md(o,e)){r.$shared=!1,s=Gt(s)?s():s;const c=this.createResolver(t,s,a);l=Ae(o,s,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,s=[""],n){const{resolver:r}=To(this._resolverCache,t,s);return P(e)?Ae(r,e,void 0,n):r}}function To(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let r=s.get(n);return r||(r={resolver:Gs(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,r)),r}const gd=i=>P(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||Gt(i[e]),!1);function md(i,t){const{isScriptable:e,isIndexable:s}=kr(i);for(const n of t){const r=e(n),o=s(n),a=(o||r)&&i[n];if(r&&(Gt(a)||gd(a))||o&&B(a))return!0}return!1}var pd="4.3.0";const yd=["top","bottom","left","right","chartArea"];function Oo(i,t){return i==="top"||i==="bottom"||yd.indexOf(i)===-1&&t==="x"}function Do(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Eo(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),W(e&&e.onComplete,[i],t)}function bd(i){const t=i.chart,e=t.options.animation;W(e&&e.onProgress,[i],t)}function Co(i){return Ir()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const os={},Ao=i=>{const t=Co(i);return Object.values(os).filter(e=>e.canvas===t).pop()};function xd(i,t,e){const s=Object.keys(i);for(const n of s){const r=+n;if(r>=t){const o=i[n];delete i[n],(e>0||r>t)&&(i[r+e]=o)}}}function _d(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function wd(i){const{xScale:t,yScale:e}=i;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}class ut{static register(...t){lt.add(...t),Po()}static unregister(...t){lt.remove(...t),Po()}constructor(t,e){const s=this.config=new fd(e),n=Co(t),r=Ao(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.");const o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||zu(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Mc(),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 id,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Wc(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],os[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$t.listen(this,"complete",Eo),$t.listen(this,"progress",bd),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:r}=this;return F(t)?e&&r?r:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return lt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Lr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return vr(this.canvas,this.ctx),this}stop(){return $t.stop(this),this}resize(t,e){$t.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,r=s.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,r),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Lr(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),W(s.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};z(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=hn(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=>{const a=o.options,l=a.id,c=hn(l,a),h=E(a.type,o.dtype);(a.position===void 0||Oo(a.position,c)!==Oo(o.dposition))&&(a.position=o.dposition),n[l]=!0;let u=null;if(l in s&&s[l].type===h)u=s[l];else{const d=lt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),s[u.id]=u}u.init(a,t)}),z(n,(o,a)=>{o||delete s[a]}),z(s,o=>{rt.configure(this,o,o.options),rt.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,r)=>n.index-r.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Do("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(r=>r===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const r=e[s];let o=this.getDatasetMeta(s);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(s),o=this.getDatasetMeta(s)),o.type=a,o.indexAxis=r.indexAxis||cn(a,this.options),o.order=r.order||0,o.index=s,o.label=""+r.label,o.visible=this.isDatasetVisible(s),o.controller)o.controller.updateIndex(s),o.controller.linkScales();else{const l=lt.getController(a),{datasetElementType:c,dataElementType:h}=Z.datasets[a];Object.assign(l,{dataElementType:lt.getElement(h),datasetElementType:c&&lt.getElement(c)}),o.controller=new l(this,s),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){z(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:u}=this.getDatasetMeta(c),d=!n&&r.indexOf(u)===-1;u.buildOrUpdateElements(d),o=Math.max(+u.getMaxOverflow(),o)}o=this._minPadding=s.layout.autoPadding?o:0,this._updateLayout(o),n||z(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Do("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){z(this.scales,t=>{rt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!rr(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:r}of e){const o=s==="_removeElements"?-r:r;xd(t,n,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),n=s(0);for(let r=1;r<e;r++)if(!rr(n,s(r)))return;return Array.from(n).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;rt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],z(this.boxes,n=>{s&&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,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Gt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&($t.has(this)?this.attached&&!$t.running(this)&&$t.start(this):(this.draw(),Eo({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resize(s,n),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,r;for(n=0,r=e.length;n<r;++n){const o=e[n];(!t||o.visible)&&s.push(o)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,r=wd(t)||this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(n&&Yi(e,{left:s.left===!1?0:r.left-s.left,right:s.right===!1?this.width:r.right+s.right,top:s.top===!1?0:r.top-s.top,bottom:s.bottom===!1?this.height:r.bottom+s.bottom}),t.controller.draw(),n&&qi(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Ht(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const r=yu.modes[e];return typeof r=="function"?r(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.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},s.push(n)),n}getContext(){return this.$context||(this.$context=Kt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,n);ei(e)?(r.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),o.update(r,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),$t.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),vr(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete os[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(r,o)=>{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=>s(r,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",r),s("detach",o)};o=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),s("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,s){const n=s?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Vi(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const 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=s?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){const s={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",s,n)===!1)return;const r=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(r||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:r}=this,o=e,a=this._getActiveElements(t,n,s,o),l=Cc(t),c=_d(t,this._lastEvent,s,l);s&&(this._lastEvent=null,W(r.onHover,[t,a,this],this),l&&W(r.onClick,[t,a,this],this));const h=!Vi(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}}_(ut,"defaults",Z),_(ut,"instances",os),_(ut,"overrides",le),_(ut,"registry",lt),_(ut,"version",pd),_(ut,"getChart",Ao);function Po(){return z(ut.instances,i=>i._plugins.invalidate())}function vd(i,t,e){const{startAngle:s,pixelMargin:n,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(r,o,a,s-c,e+c),l>n?(c=n/l,i.arc(r,o,l,e+c,s-c,!0)):i.arc(r,o,n,e+q,s-q),i.closePath(),i.clip()}function Sd(i){return Xs(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Md(i,t,e,s){const n=Sd(i.options.borderRadius),r=(e-t)/2,o=Math.min(r,s*t/2),a=l=>{const c=(e-Math.min(r,l))*s/2;return tt(l,0,Math.min(r,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:tt(n.innerStart,0,o),innerEnd:tt(n.innerEnd,0,o)}}function Le(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function as(i,t,e,s,n,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+s+e-c,0),d=h>0?h+s+e+c:0;let f=0;const g=n-l;if(s){const V=h>0?h-s:0,U=u>0?u-s:0,G=(V+U)/2,Lt=G!==0?g*G/(G+s):g;f=(g-Lt)/2}const m=Math.max(.001,g*u-e/j)/u,p=(g-m)/2,y=l+p+f,b=n-p-f,{outerStart:v,outerEnd:w,innerStart:x,innerEnd:k}=Md(t,d,u,b-y),S=u-v,M=u-w,D=y+v/S,C=b-w/M,A=d+x,L=d+k,it=y+x/A,_t=b-k/L;if(i.beginPath(),r){const V=(D+C)/2;if(i.arc(o,a,u,D,V),i.arc(o,a,u,V,C),w>0){const at=Le(M,C,o,a);i.arc(at.x,at.y,w,C,b+q)}const U=Le(L,b,o,a);if(i.lineTo(U.x,U.y),k>0){const at=Le(L,_t,o,a);i.arc(at.x,at.y,k,b+q,_t+Math.PI)}const G=(b-k/d+(y+x/d))/2;if(i.arc(o,a,d,b-k/d,G,!0),i.arc(o,a,d,G,y+x/d,!0),x>0){const at=Le(A,it,o,a);i.arc(at.x,at.y,x,it+Math.PI,y-q)}const Lt=Le(S,y,o,a);if(i.lineTo(Lt.x,Lt.y),v>0){const at=Le(S,D,o,a);i.arc(at.x,at.y,v,y-q,D)}}else{i.moveTo(o,a);const V=Math.cos(D)*u+o,U=Math.sin(D)*u+a;i.lineTo(V,U);const G=Math.cos(C)*u+o,Lt=Math.sin(C)*u+a;i.lineTo(G,Lt)}i.closePath()}function kd(i,t,e,s,n){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){as(i,t,e,s,l,n);for(let c=0;c<r;++c)i.fill();isNaN(a)||(l=o+(a%H||H))}return as(i,t,e,s,l,n),i.fill(),l}function Td(i,t,e,s,n){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:d}=l,f=l.borderAlign==="inner";if(!c)return;i.setLineDash(u||[]),i.lineDashOffset=d,f?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let g=t.endAngle;if(r){as(i,t,e,s,g,n);for(let m=0;m<r;++m)i.stroke();isNaN(a)||(g=o+(a%H||H))}f&&vd(i,t,g),r||(as(i,t,e,s,g,n),i.stroke())}class te extends Et{constructor(e){super();_(this,"circumference");_(this,"endAngle");_(this,"fullCircles");_(this,"innerRadius");_(this,"outerRadius");_(this,"pixelMargin");_(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,s,n){const r=this.getProps(["x","y"],n),{angle:o,distance:a}=hr(r,{x:e,y:s}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,m=E(d,c-l)>=H||si(o,l,c),p=Wt(a,h+f,u+f);return m&&p}getCenterPoint(e){const{x:s,y:n,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,u=(r+o)/2,d=(a+l+h+c)/2;return{x:s+Math.cos(u)*d,y:n+Math.sin(u)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:n}=this,r=(s.offset||0)/4,o=(s.spacing||0)/2,a=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>H?Math.floor(n/H):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(j,n||0)),h=r*c;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,kd(e,this,h,o,a),Td(e,this,h,o,a),e.restore()}}_(te,"id","arc"),_(te,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),_(te,"defaultRoutes",{backgroundColor:"backgroundColor"}),_(te,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Io(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function Od(i,t,e){i.lineTo(e.x,e.y)}function Dd(i){return i.stepped?Kc:i.tension||i.cubicInterpolationMode==="monotone"?Qc:Od}function Lo(i,t,e={}){const s=i.length,{start:n=0,end:r=s-1}=e,{start:o,end:a}=t,l=Math.max(n,o),c=Math.min(r,a),h=n<o&&r<o||n>a&&r>a;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function Ed(i,t,e,s){const{points:n,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Lo(n,e,s),h=Dd(r);let{move:u=!0,reverse:d}=s||{},f,g,m;for(f=0;f<=c;++f)g=n[(a+(d?c-f:f))%o],!g.skip&&(u?(i.moveTo(g.x,g.y),u=!1):h(i,m,g,d,r.stepped),m=g);return l&&(g=n[(a+(d?c:0))%o],h(i,m,g,d,r.stepped)),!!l}function Cd(i,t,e,s){const n=t.points,{count:r,start:o,ilen:a}=Lo(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,u=0,d,f,g,m,p,y;const b=w=>(o+(c?a-w:w))%r,v=()=>{m!==p&&(i.lineTo(h,p),i.lineTo(h,m),i.lineTo(h,y))};for(l&&(f=n[b(0)],i.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=n[b(d)],f.skip)continue;const w=f.x,x=f.y,k=w|0;k===g?(x<m?m=x:x>p&&(p=x),h=(u*h+w)/++u):(v(),i.lineTo(w,x),g=k,u=0,m=p=x),y=x}v()}function un(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Cd:Ed}function Ad(i){return i.stepped?Ah:i.tension||i.cubicInterpolationMode==="monotone"?Ph:ge}function Pd(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Io(i,t.options),i.stroke(n)}function Id(i,t,e,s){const{segments:n,options:r}=t,o=un(t);for(const a of n)Io(i,r,a.style),i.beginPath(),o(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Ld=typeof Path2D=="function";function Fd(i,t,e,s){Ld&&!t.options.segment?Pd(i,t,e,s):Id(i,t,e,s)}class ee extends Et{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;Sh(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=zh(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],r=this.points,o=Br(this,{property:e,start:n,end:n});if(!o.length)return;const a=[],l=Ad(s);let c,h;for(c=0,h=o.length;c<h;++c){const{start:u,end:d}=o[c],f=r[u],g=r[d];if(f===g){a.push(f);continue}const m=Math.abs((n-f[e])/(g[e]-f[e])),p=l(f,g,m,s.stepped);p[e]=t[e],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,e,s){return un(this)(t,this,e,s)}path(t,e,s){const n=this.segments,r=un(this);let o=this._loop;e=e||0,s=s||this.points.length-e;for(const a of n)o&=r(t,this,a,{start:e,end:e+s-1});return!!o}draw(t,e,s,n){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Fd(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}_(ee,"id","line"),_(ee,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),_(ee,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),_(ee,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Fo(i,t,e,s){const n=i.options,{[e]:r}=i.getProps([e],s);return Math.abs(t-r)<n.radius+n.hitRadius}class xe extends Et{constructor(e){super();_(this,"parsed");_(this,"skip");_(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,n){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],n);return Math.pow(e-o,2)+Math.pow(s-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,s){return Fo(this,e,"x",s)}inYRange(e,s){return Fo(this,e,"y",s)}getCenterPoint(e){const{x:s,y:n}=this.getProps(["x","y"],e);return{x:s,y:n}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const n=s&&e.borderWidth||0;return(s+n)*2}draw(e,s){const n=this.options;this.skip||n.radius<.1||!Ht(this,s,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Zs(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}_(xe,"id","point"),_(xe,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),_(xe,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ro(i,t){const{x:e,y:s,base:n,width:r,height:o}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,u;return i.horizontal?(u=o/2,a=Math.min(e,n),l=Math.max(e,n),c=s-u,h=s+u):(u=r/2,a=e-u,l=e+u,c=Math.min(s,n),h=Math.max(s,n)),{left:a,top:c,right:l,bottom:h}}function ie(i,t,e,s){return i?0:tt(t,e,s)}function Rd(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,r=Mr(s);return{t:ie(n.top,r.top,0,e),r:ie(n.right,r.right,0,t),b:ie(n.bottom,r.bottom,0,e),l:ie(n.left,r.left,0,t)}}function Nd(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,r=ue(n),o=Math.min(t,e),a=i.borderSkipped,l=s||P(n);return{topLeft:ie(!l||a.top||a.left,r.topLeft,0,o),topRight:ie(!l||a.top||a.right,r.topRight,0,o),bottomLeft:ie(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:ie(!l||a.bottom||a.right,r.bottomRight,0,o)}}function zd(i){const t=Ro(i),e=t.right-t.left,s=t.bottom-t.top,n=Rd(i,e/2,s/2),r=Nd(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:r},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,r.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(n.b,n.r))}}}}function dn(i,t,e,s){const n=t===null,r=e===null,a=i&&!(n&&r)&&Ro(i,s);return a&&(n||Wt(t,a.left,a.right))&&(r||Wt(e,a.top,a.bottom))}function Vd(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Wd(i,t){i.rect(t.x,t.y,t.w,t.h)}function fn(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,r=(i.x+i.w!==e.x+e.w?t:0)-s,o=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+r,h:i.h+o,radius:i.radius}}class _e extends Et{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:r,outer:o}=zd(this),a=Vd(o.radius)?ai:Wd;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,fn(o,e,r)),t.clip(),a(t,fn(r,-e,o)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,fn(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return dn(this,t,e,s)}inXRange(t,e){return dn(this,t,null,e)}inYRange(t,e){return dn(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+n)/2:e,y:r?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}_(_e,"id","bar"),_(_e,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),_(_e,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Bd=Object.freeze({__proto__:null,ArcElement:te,BarElement:_e,LineElement:ee,PointElement:xe});const gn=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],No=gn.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function zo(i){return gn[i%gn.length]}function Vo(i){return No[i%No.length]}function Hd(i,t){return i.borderColor=zo(t),i.backgroundColor=Vo(t),++t}function $d(i,t){return i.backgroundColor=i.data.map(()=>zo(t++)),t}function jd(i,t){return i.backgroundColor=i.data.map(()=>Vo(t++)),t}function Ud(i){let t=0;return(e,s)=>{const n=i.getDatasetMeta(s).controller;n instanceof me?t=$d(e,t):n instanceof Rt?t=jd(e,t):n&&(t=Hd(e,t))}}function Wo(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function Yd(i){return i&&(i.borderColor||i.backgroundColor)}var qd={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:s},options:n}=i.config,{elements:r}=n;if(!e.forceOverride&&(Wo(s)||Yd(n)||r&&Wo(r)))return;const o=Ud(i);s.forEach(o)}};function Zd(i,t,e,s,n){const r=n.samples||s;if(r>=e)return i.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let h=t,u,d,f,g,m;for(o[l++]=i[h],u=0;u<r-2;u++){let p=0,y=0,b;const v=Math.floor((u+1)*a)+1+t,w=Math.min(Math.floor((u+2)*a)+1,e)+t,x=w-v;for(b=v;b<w;b++)p+=i[b].x,y+=i[b].y;p/=x,y/=x;const k=Math.floor(u*a)+1+t,S=Math.min(Math.floor((u+1)*a)+1,e)+t,{x:M,y:D}=i[h];for(f=g=-1,b=k;b<S;b++)g=.5*Math.abs((M-p)*(i[b].y-D)-(M-i[b].x)*(y-D)),g>f&&(f=g,d=i[b],m=b);o[l++]=d,h=m}return o[l++]=i[c],o}function Xd(i,t,e,s){let n=0,r=0,o,a,l,c,h,u,d,f,g,m;const p=[],y=t+e-1,b=i[t].x,w=i[y].x-b;for(o=t;o<t+e;++o){a=i[o],l=(a.x-b)/w*s,c=a.y;const x=l|0;if(x===h)c<g?(g=c,u=o):c>m&&(m=c,d=o),n=(r*n+a.x)/++r;else{const k=o-1;if(!F(u)&&!F(d)){const S=Math.min(u,d),M=Math.max(u,d);S!==f&&S!==k&&p.push({...i[S],x:n}),M!==f&&M!==k&&p.push({...i[M],x:n})}o>0&&k!==f&&p.push(i[k]),p.push(a),h=x,r=0,g=m=c,u=d=f=o}}return p}function Bo(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ho(i){i.data.datasets.forEach(t=>{Bo(t)})}function Gd(i,t){const e=t.length;let s=0,n;const{iScale:r}=i,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(s=tt(Bt(t,r.axis,o).lo,0,e-1)),c?n=tt(Bt(t,r.axis,a).hi+1,s,e)-s:n=e-s,{start:s,count:n}}var Jd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){Ho(i);return}const s=i.width;i.data.datasets.forEach((n,r)=>{const{_data:o,indexAxis:a}=n,l=i.getDatasetMeta(r),c=o||n.data;if(li([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=i.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||i.options.parsing)return;let{start:u,count:d}=Gd(l,c);const f=e.threshold||4*s;if(d<=f){Bo(n);return}F(o)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(e.algorithm){case"lttb":g=Zd(c,u,d,s,e);break;case"min-max":g=Xd(c,u,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=g})},destroy(i){Ho(i)}};function Kd(i,t,e){const s=i.segments,n=i.points,r=t.points,o=[];for(const a of s){let{start:l,end:c}=a;c=pn(l,c,n);const h=mn(e,n[l],n[c],a.loop);if(!t.segments){o.push({source:a,target:h,start:n[l],end:n[c]});continue}const u=Br(t,h);for(const d of u){const f=mn(e,r[d.start],r[d.end],d.loop),g=Wr(a,n,f);for(const m of g)o.push({source:m,target:d,start:{[e]:$o(h,f,"start",Math.max)},end:{[e]:$o(h,f,"end",Math.min)}})}}return o}function mn(i,t,e,s){if(s)return;let n=t[i],r=e[i];return i==="angle"&&(n=yt(n),r=yt(r)),{property:i,start:n,end:r}}function Qd(i,t){const{x:e=null,y:s=null}=i||{},n=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=pn(o,a,n);const l=n[o],c=n[a];s!==null?(r.push({x:l.x,y:s}),r.push({x:c.x,y:s})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function pn(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function $o(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function jo(i,t){let e=[],s=!1;return B(i)?(s=!0,e=i):e=Qd(i,t),e.length?new ee({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Uo(i){return i&&i.fill!==!1}function tf(i,t,e){let n=i[t].fill;const r=[t];let o;if(!e)return n;for(;n!==!1&&r.indexOf(n)===-1;){if(!Y(n))return n;if(o=i[n],!o)return!1;if(o.visible)return n;r.push(n),n=o.fill}return!1}function ef(i,t,e){const s=of(i);if(P(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return Y(n)&&Math.floor(n)===n?sf(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function sf(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function nf(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:P(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function rf(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:P(i)?s=i.value:s=t.getBaseValue(),s}function of(i){const t=i.options,e=t.fill;let s=E(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function af(i){const{scale:t,index:e,line:s}=i,n=[],r=s.segments,o=s.points,a=lf(t,e);a.push(jo({x:null,y:t.bottom},s));for(let l=0;l<r.length;l++){const c=r[l];for(let h=c.start;h<=c.end;h++)cf(n,o[h],a)}return new ee({points:n,options:{}})}function lf(i,t){const e=[],s=i.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){const r=s[n];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function cf(i,t,e){const s=[];for(let n=0;n<e.length;n++){const r=e[n],{first:o,last:a,point:l}=hf(r,t,"x");if(!(!l||o&&a)){if(o)s.unshift(l);else if(i.push(l),!a)break}}i.push(...s)}function hf(i,t,e){const s=i.interpolate(t,e);if(!s)return{};const n=s[e],r=i.segments,o=i.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const h=r[c],u=o[h.start][e],d=o[h.end][e];if(Wt(n,u,d)){a=n===u,l=n===d;break}}return{first:a,last:l,point:s}}class Yo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:n,y:r,radius:o}=this;return e=e||{start:0,end:H},t.arc(n,r,o,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:s+Math.sin(r)*n,angle:r}}}function uf(i){const{chart:t,fill:e,line:s}=i;if(Y(e))return df(t,e);if(e==="stack")return af(i);if(e==="shape")return!0;const n=ff(i);return n instanceof Yo?n:jo(n,s)}function df(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function ff(i){return(i.scale||{}).getPointPositionForValue?mf(i):gf(i)}function gf(i){const{scale:t={},fill:e}=i,s=nf(e,t);if(Y(s)){const n=t.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function mf(i){const{scale:t,fill:e}=i,s=t.options,n=t.getLabels().length,r=s.reverse?t.max:t.min,o=rf(e,t,r),a=[];if(s.grid.circular){const l=t.getPointPositionForValue(0,r);return new Yo({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<n;++l)a.push(t.getPointPositionForValue(l,o));return a}function yn(i,t,e){const s=uf(t),{line:n,scale:r,axis:o}=t,a=n.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:u=c}=l||{};s&&n.points.length&&(Yi(i,e),pf(i,{line:n,target:s,above:h,below:u,area:e,scale:r,axis:o}),qi(i))}function pf(i,t){const{line:e,target:s,above:n,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;i.save(),l==="x"&&r!==n&&(qo(i,s,o.top),Zo(i,{line:e,target:s,color:n,scale:a,property:l}),i.restore(),i.save(),qo(i,s,o.bottom)),Zo(i,{line:e,target:s,color:r,scale:a,property:l}),i.restore()}function qo(i,t,e){const{segments:s,points:n}=t;let r=!0,o=!1;i.beginPath();for(const a of s){const{start:l,end:c}=a,h=n[l],u=n[pn(l,c,n)];r?(i.moveTo(h.x,h.y),r=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),o=!!t.pathSegment(i,a,{move:o}),o?i.closePath():i.lineTo(u.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Zo(i,t){const{line:e,target:s,property:n,color:r,scale:o}=t,a=Kd(e,s,n);for(const{source:l,target:c,start:h,end:u}of a){const{style:{backgroundColor:d=r}={}}=l,f=s!==!0;i.save(),i.fillStyle=d,yf(i,o,f&&mn(n,h,u)),i.beginPath();const g=!!e.pathSegment(i,l);let m;if(f){g?i.closePath():Xo(i,s,u,n);const p=!!s.pathSegment(i,c,{move:g,reverse:!0});m=g&&p,m||Xo(i,s,h,n)}i.closePath(),i.fill(m?"evenodd":"nonzero"),i.restore()}}function yf(i,t,e){const{top:s,bottom:n}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(i.beginPath(),i.rect(o,s,a-o,n-s),i.clip())}function Xo(i,t,e,s){const n=t.interpolate(e,s);n&&i.lineTo(n.x,n.y)}var bf={id:"filler",afterDatasetsUpdate(i,t,e){const s=(i.data.datasets||[]).length,n=[];let r,o,a,l;for(o=0;o<s;++o)r=i.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof ee&&(l={visible:i.isDatasetVisible(o),index:o,fill:ef(a,o,s),chart:i,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,n.push(l);for(o=0;o<s;++o)l=n[o],!(!l||l.fill===!1)&&(l.fill=tf(n,o,e.propagate))},beforeDraw(i,t,e){const s=e.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),r=i.chartArea;for(let o=n.length-1;o>=0;--o){const a=n[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),s&&a.fill&&yn(i.ctx,a,r))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const r=s[n].$filler;Uo(r)&&yn(i.ctx,r,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Uo(s)||e.drawTime!=="beforeDatasetDraw"||yn(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Go=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},xf=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Jo extends Et{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=W(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=Q(s.font),r=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Go(s,r);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(o,r,a,l)+10):(h=this.maxHeight,c=this._fitCols(o,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let u=t;r.textAlign="left",r.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((g,m)=>{const p=s+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,s,n){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=o-t;let u=a,d=0,f=0,g=0,m=0;return this.legendItems.forEach((p,y)=>{const{itemWidth:b,itemHeight:v}=_f(s,e,r,p,n);y>0&&f+v+2*a>h&&(u+=d+a,c.push({width:d,height:f}),g+=d+a,m++,d=f=0),l[y]={left:g,top:f,col:m,width:b,height:v},d=Math.max(d,b),f+=v+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:r}}=this,o=Ie(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=st(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=st(s,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=st(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=st(s,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){const t=this.ctx;Yi(t,this),this._draw(),qi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:r,labels:o}=t,a=Z.color,l=Ie(t.rtl,this.left,this.width),c=Q(o.font),{padding:h}=o,u=c.size,d=u/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=Go(o,u),y=function(k,S,M){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;n.save();const D=E(M.lineWidth,1);if(n.fillStyle=E(M.fillStyle,a),n.lineCap=E(M.lineCap,"butt"),n.lineDashOffset=E(M.lineDashOffset,0),n.lineJoin=E(M.lineJoin,"miter"),n.lineWidth=D,n.strokeStyle=E(M.strokeStyle,a),n.setLineDash(E(M.lineDash,[])),o.usePointStyle){const C={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:D},A=l.xPlus(k,g/2),L=S+d;Sr(n,C,A,L,o.pointStyleWidth&&g)}else{const C=S+Math.max((u-m)/2,0),A=l.leftForLtr(k,g),L=ue(M.borderRadius);n.beginPath(),Object.values(L).some(it=>it!==0)?ai(n,{x:A,y:C,w:g,h:m,radius:L}):n.rect(A,C,g,m),n.fill(),D!==0&&n.stroke()}n.restore()},b=function(k,S,M){he(n,M.text,k,S+p/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},v=this.isHorizontal(),w=this._computeTitleHeight();v?f={x:st(r,this.left+h,this.right-s[0]),y:this.top+h+w,line:0}:f={x:this.left+h,y:st(r,this.top+w+h,this.bottom-e[0].height),line:0},Rr(this.ctx,t.textDirection);const x=p+h;this.legendItems.forEach((k,S)=>{n.strokeStyle=k.fontColor,n.fillStyle=k.fontColor;const M=n.measureText(k.text).width,D=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),C=g+d+M;let A=f.x,L=f.y;l.setWidth(this.width),v?S>0&&A+C+h>this.right&&(L=f.y+=x,f.line++,A=f.x=st(r,this.left+h,this.right-s[f.line])):S>0&&L+x>this.bottom&&(A=f.x=A+e[f.line].width+h,f.line++,L=f.y=st(r,this.top+w+h,this.bottom-e[f.line].height));const it=l.x(A);if(y(it,L,k),A=Bc(D,A+g+d,v?A+C:this.right,t.rtl),b(l.x(A),L,k),v)f.x+=C+h;else if(typeof k.text!="string"){const _t=c.lineHeight;f.y+=Ko(k,_t)}else f.y+=x}),Nr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=Q(e.font),n=nt(e.padding);if(!e.display)return;const r=Ie(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=st(t.align,u,this.right-d);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);h=c+st(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=st(a,u,u+d);o.textAlign=r.textAlign($s(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=s.string,he(o,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=Q(t.font),s=nt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,r;if(Wt(t,this.left,this.right)&&Wt(e,this.top,this.bottom)){for(r=this.legendHitBoxes,s=0;s<r.length;++s)if(n=r[s],Wt(t,n.left,n.left+n.width)&&Wt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!Sf(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,r=xf(n,s);n&&!r&&W(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!r&&W(e.onHover,[t,s,this],this)}else s&&W(e.onClick,[t,s,this],this)}}function _f(i,t,e,s,n){const r=wf(s,i,t,e),o=vf(n,s,t.lineHeight);return{itemWidth:r,itemHeight:o}}function wf(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+s.measureText(n).width}function vf(i,t,e){let s=i;return typeof t.text!="string"&&(s=Ko(t,e)),s}function Ko(i,t){const e=i.text?i.text.length+.5:0;return t*e}function Sf(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Mf={id:"legend",_element:Jo,start(i,t,e){const s=i.legend=new Jo({ctx:i.ctx,options:e,chart:i});rt.configure(i,s,e),rt.addBox(i,s)},stop(i){rt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;rt.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:r,useBorderRadius:o,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=nt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class bn extends Et{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){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=B(s.text)?s.text.length:1;this._padding=nt(s.padding);const r=n*Q(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:r,options:o}=this,a=o.align;let l=0,c,h,u;return this.isHorizontal()?(h=st(a,s,r),u=e+t,c=r-s):(o.position==="left"?(h=s+t,u=st(a,n,e),l=j*-.5):(h=r-t,u=st(a,e,n),l=j*.5),c=n-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=Q(e.font),r=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);he(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:$s(e.align),textBaseline:"middle",translation:[o,a]})}}function kf(i,t){const e=new bn({ctx:i.ctx,options:t,chart:i});rt.configure(i,e,t),rt.addBox(i,e),i.titleBlock=e}var Tf={id:"title",_element:bn,start(i,t,e){kf(i,e)},stop(i){const t=i.titleBlock;rt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;rt.configure(i,s,e),s.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}};const ls=new WeakMap;var Of={id:"subtitle",start(i,t,e){const s=new bn({ctx:i.ctx,options:e,chart:i});rt.configure(i,s,e),rt.addBox(i,s),ls.set(i,s)},stop(i){rt.removeBox(i,ls.get(i)),ls.delete(i)},beforeUpdate(i,t,e){const s=ls.get(i);rt.configure(i,s,e),s.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}};const yi={average(i){if(!i.length)return!1;let t,e,s=0,n=0,r=0;for(t=0,e=i.length;t<e;++t){const o=i[t].element;if(o&&o.hasValue()){const a=o.tooltipPosition();s+=a.x,n+=a.y,++r}}return{x:s/r,y:n/r}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=i.length;r<o;++r){const l=i[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Bs(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function Nt(i,t){return t&&(B(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Ut(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
17
+ `)>-1?i.split(`
18
+ `):i}function Df(i,t){const{element:e,datasetIndex:s,index:n}=t,r=i.getDatasetMeta(s).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:i,label:o,parsed:r.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Qo(i,t){const e=i.chart.ctx,{body:s,footer:n,title:r}=i,{boxWidth:o,boxHeight:a}=t,l=Q(t.bodyFont),c=Q(t.titleFont),h=Q(t.footerFont),u=r.length,d=n.length,f=s.length,g=nt(t.padding);let m=g.height,p=0,y=s.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(y+=i.beforeBody.length+i.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),y){const w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*w+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}d&&(m+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let b=0;const v=function(w){p=Math.max(p,e.measureText(w).width+b)};return e.save(),e.font=c.string,z(i.title,v),e.font=l.string,z(i.beforeBody.concat(i.afterBody),v),b=t.displayColors?o+2+t.boxPadding:0,z(s,w=>{z(w.before,v),z(w.lines,v),z(w.after,v)}),b=0,e.font=h.string,z(i.footer,v),e.restore(),p+=g.width,{width:p,height:m}}function Ef(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Cf(i,t,e,s){const{x:n,width:r}=s,o=e.caretSize+e.caretPadding;if(i==="left"&&n+r+o>t.width||i==="right"&&n-r-o<0)return!0}function Af(i,t,e,s){const{x:n,width:r}=e,{width:o,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),Cf(c,i,t,e)&&(c="center"),c}function ta(i,t,e){const s=e.yAlign||t.yAlign||Ef(i,e);return{xAlign:e.xAlign||t.xAlign||Af(i,t,e,s),yAlign:s}}function Pf(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function If(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function ea(i,t,e,s){const{caretSize:n,caretPadding:r,cornerRadius:o}=i,{xAlign:a,yAlign:l}=e,c=n+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=ue(o);let g=Pf(t,a);const m=If(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+n:a==="right"&&(g+=Math.max(u,f)+n),{x:tt(g,0,s.width-t.width),y:tt(m,0,s.height-t.height)}}function cs(i,t,e){const s=nt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function ia(i){return Nt([],Ut(i))}function Lf(i,t,e){return Kt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function sa(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const na={beforeTitle:Vt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:Vt,beforeBody:Vt,beforeLabel:Vt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return F(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Vt,afterBody:Vt,beforeFooter:Vt,footer:Vt,afterFooter:Vt};function dt(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?na[t].call(e,s):n}class xn extends Et{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,r=new Ur(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Lf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=dt(s,"beforeTitle",this,t),r=dt(s,"title",this,t),o=dt(s,"afterTitle",this,t);let a=[];return a=Nt(a,Ut(n)),a=Nt(a,Ut(r)),a=Nt(a,Ut(o)),a}getBeforeBody(t,e){return ia(dt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return z(t,r=>{const o={before:[],lines:[],after:[]},a=sa(s,r);Nt(o.before,Ut(dt(a,"beforeLabel",this,r))),Nt(o.lines,dt(a,"label",this,r)),Nt(o.after,Ut(dt(a,"afterLabel",this,r))),n.push(o)}),n}getAfterBody(t,e){return ia(dt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=dt(s,"beforeFooter",this,t),r=dt(s,"footer",this,t),o=dt(s,"afterFooter",this,t);let a=[];return a=Nt(a,Ut(n)),a=Nt(a,Ut(r)),a=Nt(a,Ut(o)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Df(this.chart,e[l]));return t.filter&&(a=a.filter((h,u,d)=>t.filter(h,u,d,s))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,s))),z(a,h=>{const u=sa(t.callbacks,h);n.push(dt(u,"labelColor",this,h)),r.push(dt(u,"labelPointStyle",this,h)),o.push(dt(u,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let r,o=[];if(!n.length)this.opacity!==0&&(r={opacity:0});else{const a=yi[s.position].call(this,n,this._eventPosition);o=this._createItems(s),this.title=this.getTitle(o,s),this.beforeBody=this.getBeforeBody(o,s),this.body=this.getBody(o,s),this.afterBody=this.getAfterBody(o,s),this.footer=this.getFooter(o,s);const l=this._size=Qo(this,s),c=Object.assign({},a,l),h=ta(this.chart,s,c),u=ea(s,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&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const r=this.getCaretPosition(t,s,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:r}=this,{caretSize:o,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=ue(a),{x:d,y:f}=t,{width:g,height:m}=e;let p,y,b,v,w,x;return r==="center"?(w=f+m/2,n==="left"?(p=d,y=p-o,v=w+o,x=w-o):(p=d+g,y=p+o,v=w-o,x=w+o),b=p):(n==="left"?y=d+Math.max(l,h)+o:n==="right"?y=d+g-Math.max(c,u)-o:y=this.caretX,r==="top"?(v=f,w=v-o,p=y-o,b=y+o):(v=f+m,w=v+o,p=y+o,b=y-o),x=v),{x1:p,x2:y,x3:b,y1:v,y2:w,y3:x}}drawTitle(t,e,s){const n=this.title,r=n.length;let o,a,l;if(r){const c=Ie(s.rtl,this.x,this.width);for(t.x=cs(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",o=Q(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(n[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,r){const o=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=r,h=Q(r.bodyFont),u=cs(this,"left",r),d=n.x(u),f=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+f;if(r.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=n.leftForLtr(d,c)+c/2,y=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Zs(t,m,p,y),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Zs(t,m,p,y)}else{t.lineWidth=P(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=n.leftForLtr(d,c),p=n.leftForLtr(n.xPlus(d,1),c-2),y=ue(o.borderRadius);Object.values(y).some(b=>b!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ai(t,{x:m,y:g,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ai(t,{x:p,y:g+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,u=Q(s.bodyFont);let d=u.lineHeight,f=0;const g=Ie(s.rtl,this.x,this.width),m=function(M){e.fillText(M,g.x(t.x+f),t.y+d/2),t.y+=d+r},p=g.textAlign(o);let y,b,v,w,x,k,S;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=cs(this,p,s),e.fillStyle=s.bodyColor,z(this.beforeBody,m),f=a&&p!=="right"?o==="center"?c/2+h:c+2+h:0,w=0,k=n.length;w<k;++w){for(y=n[w],b=this.labelTextColors[w],e.fillStyle=b,z(y.before,m),v=y.lines,a&&v.length&&(this._drawColorBox(e,t,w,g,s),d=Math.max(u.lineHeight,l)),x=0,S=v.length;x<S;++x)m(v[x]),d=u.lineHeight;z(y.after,m)}f=0,d=u.lineHeight,z(this.afterBody,m),t.y-=r}drawFooter(t,e,s){const n=this.footer,r=n.length;let o,a;if(r){const l=Ie(s.rtl,this.x,this.width);for(t.x=cs(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",o=Q(s.footerFont),e.fillStyle=s.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(n[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=ue(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+u,l),o==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),o==="center"&&r==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-g),e.quadraticCurveTo(a+c,l+h,a+c-g,l+h),o==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),o==="center"&&r==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+u),e.quadraticCurveTo(a,l,a+u,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,r=s&&s.y;if(n||r){const o=yi[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Qo(this,t),l=Object.assign({},o,this._size),c=ta(e,t,l),h=ea(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){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},r={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const o=nt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(r,t,n,e),Rr(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Nr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Vi(s,n),o=this._positionChanged(n,e);(r||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,s),a=this._positionChanged(o,t),l=e||!Vi(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,s,n){const r=this.options;if(t.type==="mouseout")return[];if(!n)return e;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,s);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:s,caretY:n,options:r}=this,o=yi[r.position].call(this,t,e);return o!==!1&&(s!==o.x||n!==o.y)}}_(xn,"positioners",yi);var ra={id:"tooltip",_element:xn,positioners:yi,afterInit(i,t,e){e&&(i.tooltip=new xn({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:na},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ff=Object.freeze({__proto__:null,Colors:qd,Decimation:Jd,Filler:bf,Legend:Mf,SubTitle:Of,Title:Tf,Tooltip:ra});const Rf=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Nf(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Rf(i,t,e,s);const r=i.lastIndexOf(t);return n!==r?e:n}const zf=(i,t)=>i===null?null:tt(Math.round(i),0,t);function oa(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class Fe extends be{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:r}of e)s[n]===r&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(F(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Nf(s,t,E(e,t),this._addedLabels),zf(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){return oa.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}_(Fe,"id","category"),_(Fe,"defaults",{ticks:{callback:oa}});function Vf(i,t){const e=[],{bounds:n,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=i,f=r||1,g=h-1,{min:m,max:p}=t,y=!F(o),b=!F(a),v=!F(c),w=(p-m)/(u+1);let x=ar((p-m)/g/f)*f,k,S,M,D;if(x<1e-14&&!y&&!b)return[{value:m},{value:p}];D=Math.ceil(p/x)-Math.floor(m/x),D>g&&(x=ar(D*x/g/f)*f),F(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),n==="ticks"?(S=Math.floor(m/x)*x,M=Math.ceil(p/x)*x):(S=m,M=p),y&&b&&r&&Lc((a-o)/r,x/1e3)?(D=Math.round(Math.min((a-o)/x,h)),x=(a-o)/D,S=o,M=a):v?(S=y?o:S,M=b?a:M,D=c-1,x=(M-S)/D):(D=(M-S)/x,ii(D,Math.round(D),x/1e3)?D=Math.round(D):D=Math.ceil(D));const C=Math.max(cr(x),cr(S));k=Math.pow(10,F(l)?C:l),S=Math.round(S*k)/k,M=Math.round(M*k)/k;let A=0;for(y&&(d&&S!==o?(e.push({value:o}),S<o&&A++,ii(Math.round((S+A*x)*k)/k,o,aa(o,w,i))&&A++):S<o&&A++);A<D;++A){const L=Math.round((S+A*x)*k)/k;if(b&&L>a)break;e.push({value:L})}return b&&d&&M!==a?e.length&&ii(e[e.length-1].value,a,aa(a,w,i))?e[e.length-1].value=a:e.push({value:a}):(!b||M===a)&&e.push({value:M}),e}function aa(i,t,{horizontal:e,minRotation:s}){const n=Ot(s),r=(e?Math.sin(n):Math.cos(n))||.001,o=.75*t*(""+i).length;return Math.min(t/r,o)}class hs extends be{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return F(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:r}=this;const o=l=>n=e?n:l,a=l=>r=s?r:l;if(t){const l=Ft(n),c=Ft(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(n===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(n-l)}this.min=n,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=Vf(n,r);return t.bounds==="ticks"&&lr(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(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return ri(t,this.chart.options.locale,this.options.ticks.format)}}class we extends hs{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Y(t)?t:0,this.max=Y(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Ot(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.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}}_(we,"id","linear"),_(we,"defaults",{ticks:{callback:ji.formatters.numeric}});const bi=i=>Math.floor(Jt(i)),ve=(i,t)=>Math.pow(10,bi(i)+t);function la(i){return i/Math.pow(10,bi(i))===1}function ca(i,t,e){const s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function Wf(i,t){const e=t-i;let s=bi(e);for(;ca(i,t,s)>10;)s++;for(;ca(i,t,s)<10;)s--;return Math.min(s,bi(i))}function Bf(i,{min:t,max:e}){t=mt(i.min,t);const s=[],n=bi(t);let r=Wf(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=n>r?Math.pow(10,n):0,c=Math.round((t-l)*o)/o,h=Math.floor((t-l)/a/10)*a*10;let u=Math.floor((c-h)/Math.pow(10,r)),d=mt(i.min,Math.round((l+h+u*Math.pow(10,r))*o)/o);for(;d<e;)s.push({value:d,major:la(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(r++,u=2,o=r>=0?1:o),d=Math.round((l+h+u*Math.pow(10,r))*o)/o;const f=mt(i.max,d);return s.push({value:f,major:la(f),significand:u}),s}class _n extends be{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=hs.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return Y(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Y(t)?Math.max(0,t):null,this.max=Y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Y(this._userMin)&&(this.min=t===ve(this.min,0)?ve(this.min,-1):ve(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const r=a=>s=t?s:a,o=a=>n=e?n:a;s===n&&(s<=0?(r(1),o(10)):(r(ve(s,-1)),o(ve(n,1)))),s<=0&&r(ve(n,-1)),n<=0&&o(ve(s,1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=Bf(e,this);return t.bounds==="ticks"&&lr(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":ri(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Jt(t),this._valueRange=Jt(this.max)-Jt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Jt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}_(_n,"id","logarithmic"),_(_n,"defaults",{ticks:{callback:ji.formatters.logarithmic,major:{enabled:!0}}});function wn(i){const t=i.ticks;if(t.display&&i.display){const e=nt(t.backdropPadding);return E(t.font&&t.font.size,Z.font.size)+e.height}return 0}function Hf(i,t,e){return e=B(e)?e:[e],{w:Jc(i,t.string,e),h:e.length*t.lineHeight}}function ha(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:i<s||i>n?{start:t-e,end:t}:{start:t,end:t+e}}function $f(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],r=i._pointLabels.length,o=i.options.pointLabels,a=o.centerPointLabels?j/r:0;for(let l=0;l<r;l++){const c=o.setContext(i.getPointLabelContext(l));n[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+n[l],a),u=Q(c.font),d=Hf(i.ctx,u,i._pointLabels[l]);s[l]=d;const f=yt(i.getIndexAngle(l)+a),g=Math.round(Ws(f)),m=ha(g,h.x,d.w,0,180),p=ha(g,h.y,d.h,90,270);jf(e,t,f,m,p)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=qf(i,s,n)}function jf(i,t,e,s,n){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;s.start<t.l?(a=(t.l-s.start)/r,i.l=Math.min(i.l,t.l-a)):s.end>t.r&&(a=(s.end-t.r)/r,i.r=Math.max(i.r,t.r+a)),n.start<t.t?(l=(t.t-n.start)/o,i.t=Math.min(i.t,t.t-l)):n.end>t.b&&(l=(n.end-t.b)/o,i.b=Math.max(i.b,t.b+l))}function Uf(i,t,e){const s=i.drawingArea,{extra:n,additionalAngle:r,padding:o,size:a}=e,l=i.getPointPosition(t,s+n+o,r),c=Math.round(Ws(yt(l.angle+q))),h=Gf(l.y,a.h,c),u=Zf(c),d=Xf(l.x,a.w,u);return{visible:!0,x:l.x,y:h,textAlign:u,left:d,top:h,right:d+a.w,bottom:h+a.h}}function Yf(i,t){if(!t)return!0;const{left:e,top:s,right:n,bottom:r}=i;return!(Ht({x:e,y:s},t)||Ht({x:e,y:r},t)||Ht({x:n,y:s},t)||Ht({x:n,y:r},t))}function qf(i,t,e){const s=[],n=i._pointLabels.length,r=i.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:wn(r)/2,additionalAngle:o?j/n:0};let c;for(let h=0;h<n;h++){l.padding=e[h],l.size=t[h];const u=Uf(i,h,l);s.push(u),a==="auto"&&(u.visible=Yf(u,c),u.visible&&(c=u))}return s}function Zf(i){return i===0||i===180?"center":i<180?"left":"right"}function Xf(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function Gf(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Jf(i,t,e){const{left:s,top:n,right:r,bottom:o}=e,{backdropColor:a}=t;if(!F(a)){const l=ue(t.borderRadius),c=nt(t.backdropPadding);i.fillStyle=a;const h=s-c.left,u=n-c.top,d=r-s+c.width,f=o-n+c.height;Object.values(l).some(g=>g!==0)?(i.beginPath(),ai(i,{x:h,y:u,w:d,h:f,radius:l}),i.fill()):i.fillRect(h,u,d,f)}}function Kf(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const r=i._pointLabelItems[n];if(!r.visible)continue;const o=s.setContext(i.getPointLabelContext(n));Jf(e,o,r);const a=Q(o.font),{x:l,y:c,textAlign:h}=r;he(e,i._pointLabels[n],l,c+a.lineHeight/2,a,{color:o.color,textAlign:h,textBaseline:"middle"})}}function ua(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,H);else{let r=i.getPointPosition(0,t);n.moveTo(r.x,r.y);for(let o=1;o<s;o++)r=i.getPointPosition(o,t),n.lineTo(r.x,r.y)}}function Qf(i,t,e,s,n){const r=i.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!s||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(n.dash),r.lineDashOffset=n.dashOffset,r.beginPath(),ua(i,e,o,s),r.closePath(),r.stroke(),r.restore())}function tg(i,t,e){return Kt(i,{label:e,index:t,type:"pointLabel"})}class Re extends hs{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=nt(wn(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Y(t)&&!isNaN(t)?t:0,this.max=Y(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/wn(this.options))}generateTickLabels(t){hs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const n=W(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?$f(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){const e=H/(this._pointLabels.length||1),s=this.options.startAngle||0;return yt(t*e+Ot(s))}getDistanceFromCenterForValue(t){if(F(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(F(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const s=e[t];return tg(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const n=this.getIndexAngle(t)-q+s;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:s,right:n,bottom:r}=this._pointLabelItems[t];return{left:e,top:s,right:n,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),ua(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:s,grid:n,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&Kf(this,o),n.display&&this.ticks.forEach((h,u)=>{if(u!==0){l=this.getDistanceFromCenterForValue(h.value);const d=this.getContext(u),f=n.setContext(d),g=r.setContext(d);Qf(this,f,l,o,g)}}),s.display){for(t.save(),a=o-1;a>=0;a--){const h=s.setContext(this.getPointLabelContext(a)),{color:u,lineWidth:d}=h;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let 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;const c=s.setContext(this.getContext(l)),h=Q(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;const u=nt(c.backdropPadding);t.fillRect(-o/2-u.left,-r-h.size/2-u.top,o+u.width,h.size+u.height)}he(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}}_(Re,"id","radialLinear"),_(Re,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ji.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),_(Re,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),_(Re,"descriptors",{angleLines:{_fallback:"grid"}});const us={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}},ft=Object.keys(us);function eg(i,t){return i-t}function da(i,t){if(F(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:r}=i._parseOpts;let o=t;return typeof s=="function"&&(o=s(o)),Y(o)||(o=typeof s=="string"?e.parse(o,s):e.parse(o)),o===null?null:(n&&(o=n==="week"&&(Ce(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,n)),+o)}function fa(i,t,e,s){const n=ft.length;for(let r=ft.indexOf(i);r<n-1;++r){const o=us[ft[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=s)return ft[r]}return ft[n-1]}function ig(i,t,e,s,n){for(let r=ft.length-1;r>=ft.indexOf(e);r--){const o=ft[r];if(us[o].common&&i._adapter.diff(n,s,o)>=t-1)return o}return ft[e?ft.indexOf(e):0]}function sg(i){for(let t=ft.indexOf(i)+1,e=ft.length;t<e;++t)if(us[ft[t]].common)return ft[t]}function ga(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Hs(e,t),r=e[s]>=t?e[s]:e[n];i[r]=!0}}function ng(i,t,e,s){const n=i._adapter,r=+n.startOf(t[0].value,s),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function ma(i,t,e){const s=[],n={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],n[a]=o,s.push({value:a,major:!1});return r===0||!e?s:ng(i,s,n,e)}class xi extends be{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new so._date(t.adapters.date);n.init(e),ti(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:da(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=Y(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),r=Y(r)&&!isNaN(r)?r:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const r=this.min,o=this.max,a=zc(n,r,o);return this._unit=e.unit||(s.autoSkip?fa(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):ig(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:sg(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),ma(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=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?s=r:s=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=tt(e,0,o),s=tt(s,0,o),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,r=n.time,o=r.unit||fa(r.minUnit,e,s,this._getLabelCapacity(e)),a=E(n.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Ce(l)||l===!0,h={};let u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":o),t.diff(s,e,o)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+o);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<s;d=+t.add(d,a,o),f++)ga(h,d,g);return(d===s||n.bounds==="ticks"||f===1)&&ga(h,d,g),Object.keys(h).sort((m,p)=>m-p).map(m=>+m)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,r=this._unit,o=e||n[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,s,n){const r=this.options,o=r.ticks.callback;if(o)return W(o,[t,e,s],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],u=c&&a[c],d=s[e],f=c&&u&&d&&d.major;return this._adapter.format(t,n||(f?u:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=Ot(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),o=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*r+a*o,h:s*o+a*r}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,r=this._tickFormatFunction(t,0,ma(this,[t],this._majorUnit),n),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(da(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return fr(t.sort(eg))}}_(xi,"id","time"),_(xi,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ds(i,t,e){let s=0,n=i.length-1,r,o,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Bt(i,"pos",t)),{pos:r,time:a}=i[s],{pos:o,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Bt(i,"time",t)),{time:r,pos:a}=i[s],{time:o,pos:l}=i[n]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class vn extends xi{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ds(e,this.min),this._tableRange=ds(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],r=[];let o,a,l,c,h;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(o=0,a=n.length;o<a;++o)h=n[o+1],l=n[o-1],c=n[o],Math.round((h+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(ds(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return ds(this._table,s*this._tableRange+this._minPos,!0)}}_(vn,"id","timeseries"),_(vn,"defaults",xi.defaults);var rg=Object.freeze({__proto__:null,CategoryScale:Fe,LinearScale:we,LogarithmicScale:_n,RadialLinearScale:Re,TimeScale:xi,TimeSeriesScale:vn});const og=[du,Bd,Ff,rg];ut.register(...og);class Se extends Error{}class ag extends Se{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class lg extends Se{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class cg extends Se{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class _i extends Se{}class pa extends Se{constructor(t){super(`Invalid unit ${t}`)}}class St extends Se{}class se extends Se{constructor(){super("Zone is an abstract class")}}const T="numeric",Ct="short",bt="long",fs={year:T,month:T,day:T},ya={year:T,month:Ct,day:T},hg={year:T,month:Ct,day:T,weekday:Ct},ba={year:T,month:bt,day:T},xa={year:T,month:bt,day:T,weekday:bt},_a={hour:T,minute:T},wa={hour:T,minute:T,second:T},va={hour:T,minute:T,second:T,timeZoneName:Ct},Sa={hour:T,minute:T,second:T,timeZoneName:bt},Ma={hour:T,minute:T,hourCycle:"h23"},ka={hour:T,minute:T,second:T,hourCycle:"h23"},Ta={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:Ct},Oa={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:bt},Da={year:T,month:T,day:T,hour:T,minute:T},Ea={year:T,month:T,day:T,hour:T,minute:T,second:T},Ca={year:T,month:Ct,day:T,hour:T,minute:T},Aa={year:T,month:Ct,day:T,hour:T,minute:T,second:T},ug={year:T,month:Ct,day:T,weekday:Ct,hour:T,minute:T},Pa={year:T,month:bt,day:T,hour:T,minute:T,timeZoneName:Ct},Ia={year:T,month:bt,day:T,hour:T,minute:T,second:T,timeZoneName:Ct},La={year:T,month:bt,day:T,weekday:bt,hour:T,minute:T,timeZoneName:bt},Fa={year:T,month:bt,day:T,weekday:bt,hour:T,minute:T,second:T,timeZoneName:bt};class wi{get type(){throw new se}get name(){throw new se}get ianaName(){return this.name}get isUniversal(){throw new se}offsetName(t,e){throw new se}formatOffset(t,e){throw new se}offset(t){throw new se}equals(t){throw new se}get isValid(){throw new se}}let Sn=null;class gs extends wi{static get instance(){return Sn===null&&(Sn=new gs),Sn}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return Ya(t,e,s)}formatOffset(t,e){return ki(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let ms={};function dg(i){return ms[i]||(ms[i]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ms[i]}const fg={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function gg(i,t){const e=i.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e),[,n,r,o,a,l,c,h]=s;return[o,n,r,a,l,c,h]}function mg(i,t){const e=i.formatToParts(t),s=[];for(let n=0;n<e.length;n++){const{type:r,value:o}=e[n],a=fg[r];r==="era"?s[a]=o:I(a)||(s[a]=parseInt(o,10))}return s}let ps={};class Yt extends wi{static create(t){return ps[t]||(ps[t]=new Yt(t)),ps[t]}static resetCache(){ps={},ms={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Yt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return Ya(t,e,s,this.name)}formatOffset(t,e){return ki(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const s=dg(this.name);let[n,r,o,a,l,c,h]=s.formatToParts?mg(s,e):gg(s,e);a==="BC"&&(n=-Math.abs(n)+1);const d=An({year:n,month:r,day:o,hour:l===24?0:l,minute:c,second:h,millisecond:0});let f=+e;const g=f%1e3;return f-=g>=0?g:1e3+g,(d-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Ra={};function pg(i,t={}){const e=JSON.stringify([i,t]);let s=Ra[e];return s||(s=new Intl.ListFormat(i,t),Ra[e]=s),s}let Mn={};function kn(i,t={}){const e=JSON.stringify([i,t]);let s=Mn[e];return s||(s=new Intl.DateTimeFormat(i,t),Mn[e]=s),s}let Tn={};function yg(i,t={}){const e=JSON.stringify([i,t]);let s=Tn[e];return s||(s=new Intl.NumberFormat(i,t),Tn[e]=s),s}let On={};function bg(i,t={}){const{base:e,...s}=t,n=JSON.stringify([i,s]);let r=On[n];return r||(r=new Intl.RelativeTimeFormat(i,t),On[n]=r),r}let vi=null;function xg(){return vi||(vi=new Intl.DateTimeFormat().resolvedOptions().locale,vi)}function _g(i){const t=i.indexOf("-x-");t!==-1&&(i=i.substring(0,t));const e=i.indexOf("-u-");if(e===-1)return[i];{let s,n;try{s=kn(i).resolvedOptions(),n=i}catch{const l=i.substring(0,e);s=kn(l).resolvedOptions(),n=l}const{numberingSystem:r,calendar:o}=s;return[n,r,o]}}function wg(i,t,e){return(e||t)&&(i.includes("-u-")||(i+="-u"),e&&(i+=`-ca-${e}`),t&&(i+=`-nu-${t}`)),i}function vg(i){const t=[];for(let e=1;e<=12;e++){const s=O.utc(2016,e,1);t.push(i(s))}return t}function Sg(i){const t=[];for(let e=1;e<=7;e++){const s=O.utc(2016,11,13+e);t.push(i(s))}return t}function ys(i,t,e,s,n){const r=i.listingMode(e);return r==="error"?null:r==="en"?s(t):n(t)}function Mg(i){return i.numberingSystem&&i.numberingSystem!=="latn"?!1:i.numberingSystem==="latn"||!i.locale||i.locale.startsWith("en")||new Intl.DateTimeFormat(i.intl).resolvedOptions().numberingSystem==="latn"}class kg{constructor(t,e,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:n,floor:r,...o}=s;if(!e||Object.keys(o).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=yg(t,a)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}else{const e=this.floor?Math.floor(t):Cn(t,3);return K(e,this.padTo)}}}class Tg{constructor(t,e,s){this.opts=s,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const o=-1*(t.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&Yt.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);const r={...this.opts};r.timeZone=r.timeZone||n,this.dtf=kn(e,r)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(e=>{if(e.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:s}}else return e}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Og{constructor(t,e,s){this.opts={style:"long",...s},!e&&ja()&&(this.rtf=bg(t,s))}format(t,e){return this.rtf?this.rtf.format(t,e):jg(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class ${static fromOpts(t){return $.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,e,s,n=!1){const r=t||J.defaultLocale,o=r||(n?"en-US":xg()),a=e||J.defaultNumberingSystem,l=s||J.defaultOutputCalendar;return new $(o,a,l,r)}static resetCache(){vi=null,Mn={},Tn={},On={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:s}={}){return $.create(t,e,s)}constructor(t,e,s,n){const[r,o,a]=_g(t);this.locale=r,this.numberingSystem=e||o||null,this.outputCalendar=s||a||null,this.intl=wg(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Mg(this)),this.fastNumbersCached}listingMode(){const 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:$.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1,s=!0){return ys(this,t,s,Xa,()=>{const n=e?{month:t,day:"numeric"}:{month:t},r=e?"format":"standalone";return this.monthsCache[r][t]||(this.monthsCache[r][t]=vg(o=>this.extract(o,n,"month"))),this.monthsCache[r][t]})}weekdays(t,e=!1,s=!0){return ys(this,t,s,Ka,()=>{const n=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},r=e?"format":"standalone";return this.weekdaysCache[r][t]||(this.weekdaysCache[r][t]=Sg(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[r][t]})}meridiems(t=!0){return ys(this,void 0,t,()=>Qa,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[O.utc(2016,11,13,9),O.utc(2016,11,13,19)].map(s=>this.extract(s,e,"dayperiod"))}return this.meridiemCache})}eras(t,e=!0){return ys(this,t,e,tl,()=>{const s={era:t};return this.eraCache[t]||(this.eraCache[t]=[O.utc(-40,1,1),O.utc(2017,1,1)].map(n=>this.extract(n,s,"era"))),this.eraCache[t]})}extract(t,e,s){const n=this.dtFormatter(t,e),r=n.formatToParts(),o=r.find(a=>a.type.toLowerCase()===s);return o?o.value:null}numberFormatter(t={}){return new kg(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new Tg(t,this.intl,e)}relFormatter(t={}){return new Og(this.intl,this.isEnglish(),t)}listFormatter(t={}){return pg(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let Dn=null;class ct extends wi{static get utcInstance(){return Dn===null&&(Dn=new ct(0)),Dn}static instance(t){return t===0?ct.utcInstance:new ct(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new ct(ws(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ki(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ki(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return ki(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}}class Dg extends wi{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 ne(i,t){if(I(i)||i===null)return t;if(i instanceof wi)return i;if(Eg(i)){const e=i.toLowerCase();return e==="default"?t:e==="local"||e==="system"?gs.instance:e==="utc"||e==="gmt"?ct.utcInstance:ct.parseSpecifier(e)||Yt.create(i)}else return Me(i)?ct.instance(i):typeof i=="object"&&i.offset&&typeof i.offset=="number"?i:new Dg(i)}let Na=()=>Date.now(),za="system",Va=null,Wa=null,Ba=null,Ha=60,$a;class J{static get now(){return Na}static set now(t){Na=t}static set defaultZone(t){za=t}static get defaultZone(){return ne(za,gs.instance)}static get defaultLocale(){return Va}static set defaultLocale(t){Va=t}static get defaultNumberingSystem(){return Wa}static set defaultNumberingSystem(t){Wa=t}static get defaultOutputCalendar(){return Ba}static set defaultOutputCalendar(t){Ba=t}static get twoDigitCutoffYear(){return Ha}static set twoDigitCutoffYear(t){Ha=t%100}static get throwOnInvalid(){return $a}static set throwOnInvalid(t){$a=t}static resetCaches(){$.resetCache(),Yt.resetCache()}}function I(i){return typeof i>"u"}function Me(i){return typeof i=="number"}function bs(i){return typeof i=="number"&&i%1===0}function Eg(i){return typeof i=="string"}function Cg(i){return Object.prototype.toString.call(i)==="[object Date]"}function ja(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ag(i){return Array.isArray(i)?i:[i]}function Ua(i,t,e){if(i.length!==0)return i.reduce((s,n)=>{const r=[t(n),n];return s&&e(s[0],r[0])===s[0]?s:r},null)[1]}function Pg(i,t){return t.reduce((e,s)=>(e[s]=i[s],e),{})}function Ne(i,t){return Object.prototype.hasOwnProperty.call(i,t)}function qt(i,t,e){return bs(i)&&i>=t&&i<=e}function Ig(i,t){return i-t*Math.floor(i/t)}function K(i,t=2){const e=i<0;let s;return e?s="-"+(""+-i).padStart(t,"0"):s=(""+i).padStart(t,"0"),s}function re(i){if(!(I(i)||i===null||i===""))return parseInt(i,10)}function ke(i){if(!(I(i)||i===null||i===""))return parseFloat(i)}function En(i){if(!(I(i)||i===null||i==="")){const t=parseFloat("0."+i)*1e3;return Math.floor(t)}}function Cn(i,t,e=!1){const s=10**t;return(e?Math.trunc:Math.round)(i*s)/s}function Si(i){return i%4===0&&(i%100!==0||i%400===0)}function Mi(i){return Si(i)?366:365}function xs(i,t){const e=Ig(t-1,12)+1,s=i+(t-e)/12;return e===2?Si(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function An(i){let t=Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.millisecond);return i.year<100&&i.year>=0&&(t=new Date(t),t.setUTCFullYear(i.year,i.month-1,i.day)),+t}function _s(i){const t=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7,e=i-1,s=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7;return t===4||s===3?53:52}function Pn(i){return i>99?i:i>J.twoDigitCutoffYear?1900+i:2e3+i}function Ya(i,t,e,s=null){const n=new Date(i),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(r.timeZone=s);const o={timeZoneName:t,...r},a=new Intl.DateTimeFormat(e,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function ws(i,t){let e=parseInt(i,10);Number.isNaN(e)&&(e=0);const s=parseInt(t,10)||0,n=e<0||Object.is(e,-0)?-s:s;return e*60+n}function qa(i){const t=Number(i);if(typeof i=="boolean"||i===""||Number.isNaN(t))throw new St(`Invalid unit value ${i}`);return t}function vs(i,t){const e={};for(const s in i)if(Ne(i,s)){const n=i[s];if(n==null)continue;e[t(s)]=qa(n)}return e}function ki(i,t){const e=Math.trunc(Math.abs(i/60)),s=Math.trunc(Math.abs(i%60)),n=i>=0?"+":"-";switch(t){case"short":return`${n}${K(e,2)}:${K(s,2)}`;case"narrow":return`${n}${e}${s>0?`:${s}`:""}`;case"techie":return`${n}${K(e,2)}${K(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ss(i){return Pg(i,["hour","minute","second","millisecond"])}const Lg=["January","February","March","April","May","June","July","August","September","October","November","December"],Za=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fg=["J","F","M","A","M","J","J","A","S","O","N","D"];function Xa(i){switch(i){case"narrow":return[...Fg];case"short":return[...Za];case"long":return[...Lg];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}}const Ga=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ja=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Rg=["M","T","W","T","F","S","S"];function Ka(i){switch(i){case"narrow":return[...Rg];case"short":return[...Ja];case"long":return[...Ga];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Qa=["AM","PM"],Ng=["Before Christ","Anno Domini"],zg=["BC","AD"],Vg=["B","A"];function tl(i){switch(i){case"narrow":return[...Vg];case"short":return[...zg];case"long":return[...Ng];default:return null}}function Wg(i){return Qa[i.hour<12?0:1]}function Bg(i,t){return Ka(t)[i.weekday-1]}function Hg(i,t){return Xa(t)[i.month-1]}function $g(i,t){return tl(t)[i.year<0?0:1]}function jg(i,t,e="always",s=!1){const 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(i)===-1;if(e==="auto"&&r){const u=i==="days";switch(t){case 1:return u?"tomorrow":`next ${n[i][0]}`;case-1:return u?"yesterday":`last ${n[i][0]}`;case 0:return u?"today":`this ${n[i][0]}`}}const o=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,c=n[i],h=s?l?c[1]:c[2]||c[1]:l?n[i][0]:i;return o?`${a} ${h} ago`:`in ${a} ${h}`}function el(i,t){let e="";for(const s of i)s.literal?e+=s.val:e+=t(s.val);return e}const Ug={D:fs,DD:ya,DDD:ba,DDDD:xa,t:_a,tt:wa,ttt:va,tttt:Sa,T:Ma,TT:ka,TTT:Ta,TTTT:Oa,f:Da,ff:Ca,fff:Pa,ffff:La,F:Ea,FF:Aa,FFF:Ia,FFFF:Fa};class ot{static create(t,e={}){return new ot(t,e)}static parseFormat(t){let e=null,s="",n=!1;const r=[];for(let o=0;o<t.length;o++){const a=t.charAt(o);a==="'"?(s.length>0&&r.push({literal:n||/^\s+$/.test(s),val:s}),e=null,s="",n=!n):n||a===e?s+=a:(s.length>0&&r.push({literal:/^\s+$/.test(s),val:s}),s=a,e=a)}return s.length>0&&r.push({literal:n||/^\s+$/.test(s),val:s}),r}static macroTokenToFormatOpts(t){return Ug[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()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}formatInterval(t,e={}){return this.loc.dtFormatter(t.start,{...this.opts,...e}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return K(t,e);const s={...this.opts};return e>0&&(s.padTo=e),this.loc.numberFormatter(s).format(t)}formatDateTimeFromString(t,e){const s=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=()=>s?Wg(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,g)=>s?Hg(t,f):r(g?{month:f}:{month:f,day:"numeric"},"month"),c=(f,g)=>s?Bg(t,f):r(g?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),h=f=>{const g=ot.macroTokenToFormatOpts(f);return g?this.formatWithSystemDefault(t,g):f},u=f=>s?$g(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"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 el(ot.parseFormat(e),d)}formatDurationFromString(t,e){const s=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=l=>c=>{const h=s(c);return h?this.num(l.get(h),c.length):c},r=ot.parseFormat(e),o=r.reduce((l,{literal:c,val:h})=>c?l:l.concat(h),[]),a=t.shiftTo(...o.map(s).filter(l=>l));return el(r,n(a))}}class At{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const il=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ze(...i){const t=i.reduce((e,s)=>e+s.source,"");return RegExp(`^${t}$`)}function Ve(...i){return t=>i.reduce(([e,s,n],r)=>{const[o,a,l]=r(t,n);return[{...e,...o},a||s,l]},[{},null,1]).slice(0,2)}function We(i,...t){if(i==null)return[null,null];for(const[e,s]of t){const n=e.exec(i);if(n)return s(n)}return[null,null]}function sl(...i){return(t,e)=>{const s={};let n;for(n=0;n<i.length;n++)s[i[n]]=re(t[e+n]);return[s,null,e+n]}}const nl=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Yg=`(?:${nl.source}?(?:\\[(${il.source})\\])?)?`,In=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,rl=RegExp(`${In.source}${Yg}`),Ln=RegExp(`(?:T${rl.source})?`),qg=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Zg=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Xg=/(\d{4})-?(\d{3})/,Gg=sl("weekYear","weekNumber","weekDay"),Jg=sl("year","ordinal"),Kg=/(\d{4})-(\d\d)-(\d\d)/,ol=RegExp(`${In.source} ?(?:${nl.source}|(${il.source}))?`),Qg=RegExp(`(?: ${ol.source})?`);function Be(i,t,e){const s=i[t];return I(s)?e:re(s)}function tm(i,t){return[{year:Be(i,t),month:Be(i,t+1,1),day:Be(i,t+2,1)},null,t+3]}function He(i,t){return[{hours:Be(i,t,0),minutes:Be(i,t+1,0),seconds:Be(i,t+2,0),milliseconds:En(i[t+3])},null,t+4]}function Ti(i,t){const e=!i[t]&&!i[t+1],s=ws(i[t+1],i[t+2]),n=e?null:ct.instance(s);return[{},n,t+3]}function Oi(i,t){const e=i[t]?Yt.create(i[t]):null;return[{},e,t+1]}const em=RegExp(`^T?${In.source}$`),im=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function sm(i){const[t,e,s,n,r,o,a,l,c]=i,h=t[0]==="-",u=l&&l[0]==="-",d=(f,g=!1)=>f!==void 0&&(g||f&&h)?-f:f;return[{years:d(ke(e)),months:d(ke(s)),weeks:d(ke(n)),days:d(ke(r)),hours:d(ke(o)),minutes:d(ke(a)),seconds:d(ke(l),l==="-0"),milliseconds:d(En(c),u)}]}const nm={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Fn(i,t,e,s,n,r,o){const a={year:t.length===2?Pn(re(t)):re(t),month:Za.indexOf(e)+1,day:re(s),hour:re(n),minute:re(r)};return o&&(a.second=re(o)),i&&(a.weekday=i.length>3?Ga.indexOf(i)+1:Ja.indexOf(i)+1),a}const rm=/^(?:(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 om(i){const[,t,e,s,n,r,o,a,l,c,h,u]=i,d=Fn(t,n,s,e,r,o,a);let f;return l?f=nm[l]:c?f=0:f=ws(h,u),[d,new ct(f)]}function am(i){return i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const lm=/^(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$/,cm=/^(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$/,hm=/^(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 al(i){const[,t,e,s,n,r,o,a]=i;return[Fn(t,n,s,e,r,o,a),ct.utcInstance]}function um(i){const[,t,e,s,n,r,o,a]=i;return[Fn(t,a,e,s,n,r,o),ct.utcInstance]}const dm=ze(qg,Ln),fm=ze(Zg,Ln),gm=ze(Xg,Ln),mm=ze(rl),ll=Ve(tm,He,Ti,Oi),pm=Ve(Gg,He,Ti,Oi),ym=Ve(Jg,He,Ti,Oi),bm=Ve(He,Ti,Oi);function xm(i){return We(i,[dm,ll],[fm,pm],[gm,ym],[mm,bm])}function _m(i){return We(am(i),[rm,om])}function wm(i){return We(i,[lm,al],[cm,al],[hm,um])}function vm(i){return We(i,[im,sm])}const Sm=Ve(He);function Mm(i){return We(i,[em,Sm])}const km=ze(Kg,Qg),Tm=ze(ol),Om=Ve(He,Ti,Oi);function Dm(i){return We(i,[km,ll],[Tm,Om])}const Em="Invalid Duration",cl={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Cm={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:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...cl},Mt=146097/400,$e=146097/4800,Am={years:{quarters:4,months:12,weeks:Mt/7,days:Mt,hours:Mt*24,minutes:Mt*24*60,seconds:Mt*24*60*60,milliseconds:Mt*24*60*60*1e3},quarters:{months:3,weeks:Mt/28,days:Mt/4,hours:Mt*24/4,minutes:Mt*24*60/4,seconds:Mt*24*60*60/4,milliseconds:Mt*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},...cl},Te=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Pm=Te.slice(0).reverse();function oe(i,t,e=!1){const s={values:e?t.values:{...i.values,...t.values||{}},loc:i.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||i.conversionAccuracy,matrix:t.matrix||i.matrix};return new R(s)}function Im(i){return i<0?Math.floor(i):Math.ceil(i)}function hl(i,t,e,s,n){const r=i[n][e],o=t[e]/r,a=Math.sign(o)===Math.sign(s[n]),l=!a&&s[n]!==0&&Math.abs(o)<=1?Im(o):Math.trunc(o);s[n]+=l,t[e]-=l*r}function Lm(i,t){Pm.reduce((e,s)=>I(t[s])?e:(e&&hl(i,t,e,t,s),s),null)}function Fm(i){const t={};for(const[e,s]of Object.entries(i))s!==0&&(t[e]=s);return t}class R{constructor(t){const e=t.conversionAccuracy==="longterm"||!1;let s=e?Am:Cm;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||$.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,e){return R.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new St(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new R({values:vs(t,R.normalizeUnit),loc:$.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(Me(t))return R.fromMillis(t);if(R.isDuration(t))return t;if(typeof t=="object")return R.fromObject(t);throw new St(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[s]=vm(t);return s?R.fromObject(s,e):R.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[s]=Mm(t);return s?R.fromObject(s,e):R.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new St("need to specify a reason the Duration is invalid");const s=t instanceof At?t:new At(t,e);if(J.throwOnInvalid)throw new cg(s);return new R({invalid:s})}static normalizeUnit(t){const 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 pa(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={}){const s={...e,floor:e.round!==!1&&e.floor!==!1};return this.isValid?ot.create(this.loc,s).formatDurationFromString(this,t):Em}toHuman(t={}){const e=Te.map(s=>{const n=this.values[s];return I(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:s.slice(0,-1)}).format(n)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}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+=Cn(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const s=this.shiftTo("hours","minutes","seconds","milliseconds");let n=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||s.seconds!==0||s.milliseconds!==0)&&(n+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||s.milliseconds!==0)&&(n+=".SSS"));let r=s.toFormat(n);return t.includePrefix&&(r="T"+r),r}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=R.fromDurationLike(t),s={};for(const n of Te)(Ne(e.values,n)||Ne(this.values,n))&&(s[n]=e.get(n)+this.get(n));return oe(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const e=R.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const s of Object.keys(this.values))e[s]=qa(t(this.values[s],s));return oe(this,{values:e},!0)}get(t){return this[R.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const e={...this.values,...vs(t,R.normalizeUnit)};return oe(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:s,matrix:n}={}){const o={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:n,conversionAccuracy:s};return oe(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Lm(this.matrix,t),oe(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Fm(this.normalize().shiftToAll().toObject());return oe(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>R.normalizeUnit(o));const e={},s={},n=this.toObject();let r;for(const o of Te)if(t.indexOf(o)>=0){r=o;let a=0;for(const c in s)a+=this.matrix[c][o]*s[c],s[c]=0;Me(n[o])&&(a+=n[o]);const l=Math.trunc(a);e[o]=l,s[o]=(a*1e3-l*1e3)/1e3;for(const c in n)Te.indexOf(c)>Te.indexOf(o)&&hl(this.matrix,n,c,e,o)}else Me(n[o])&&(s[o]=n[o]);for(const o in s)s[o]!==0&&(e[r]+=o===r?s[o]:s[o]/this.matrix[r][o]);return oe(this,{values:e},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=this.values[e]===0?0:-this.values[e];return oe(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(s,n){return s===void 0||s===0?n===void 0||n===0:s===n}for(const s of Te)if(!e(this.values[s],t.values[s]))return!1;return!0}}const je="Invalid Interval";function Rm(i,t){return!i||!i.isValid?X.invalid("missing or invalid start"):!t||!t.isValid?X.invalid("missing or invalid end"):t<i?X.invalid("end before start",`The end of an interval must be after its start, but you had start=${i.toISO()} and end=${t.toISO()}`):null}class X{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new St("need to specify a reason the Interval is invalid");const s=t instanceof At?t:new At(t,e);if(J.throwOnInvalid)throw new lg(s);return new X({invalid:s})}static fromDateTimes(t,e){const s=Ci(t),n=Ci(e),r=Rm(s,n);return r??new X({start:s,end:n})}static after(t,e){const s=R.fromDurationLike(e),n=Ci(t);return X.fromDateTimes(n,n.plus(s))}static before(t,e){const s=R.fromDurationLike(e),n=Ci(t);return X.fromDateTimes(n.minus(s),n)}static fromISO(t,e){const[s,n]=(t||"").split("/",2);if(s&&n){let r,o;try{r=O.fromISO(s,e),o=r.isValid}catch{o=!1}let a,l;try{a=O.fromISO(n,e),l=a.isValid}catch{l=!1}if(o&&l)return X.fromDateTimes(r,a);if(o){const c=R.fromISO(n,e);if(c.isValid)return X.after(r,c)}else if(l){const c=R.fromISO(s,e);if(c.isValid)return X.before(a,c)}}return X.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const e=this.start.startOf(t),s=this.end.startOf(t);return Math.floor(s.diff(e,t).get(t))+(s.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:e}={}){return this.isValid?X.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Ci).filter(o=>this.contains(o)).sort(),s=[];let{s:n}=this,r=0;for(;n<this.e;){const o=e[r]||this.e,a=+o>+this.e?this.e:o;s.push(X.fromDateTimes(n,a)),n=a,r+=1}return s}splitBy(t){const e=R.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s}=this,n=1,r;const o=[];for(;s<this.e;){const a=this.start.plus(e.mapUnits(l=>l*n));r=+a>+this.e?this.e:a,o.push(X.fromDateTimes(s,r)),s=r,n+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,s=this.e<t.e?this.e:t.e;return e>=s?null:X.fromDateTimes(e,s)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,s=this.e>t.e?this.e:t.e;return X.fromDateTimes(e,s)}static merge(t){const[e,s]=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 s&&e.push(s),e}static xor(t){let e=null,s=0;const 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(const l of a)s+=l.type==="s"?1:-1,s===1?e=l.time:(e&&+e!=+l.time&&n.push(X.fromDateTimes(e,l.time)),e=null);return X.merge(n)}difference(...t){return X.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:je}toLocaleString(t=fs,e={}){return this.isValid?ot.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=" – "}={}){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):R.invalid(this.invalidReason)}mapEndpoints(t){return X.fromDateTimes(t(this.s),t(this.e))}}class Ms{static hasDST(t=J.defaultZone){const e=O.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return Yt.isValidZone(t)}static normalizeZone(t){return ne(t,J.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||$.create(e,s,r)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||$.create(e,s,r)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null}={}){return(n||$.create(e,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null}={}){return(n||$.create(e,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return $.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return $.create(e,null,"gregory").eras(t)}static features(){return{relative:ja()}}}function ul(i,t){const e=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=e(t)-e(i);return Math.floor(R.fromMillis(s).as("days"))}function Nm(i,t,e){const s=[["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)=>{const h=ul(l,c);return(h-h%7)/7}],["days",ul]],n={},r=i;let o,a;for(const[l,c]of s)e.indexOf(l)>=0&&(o=l,n[l]=c(i,t),a=r.plus(n),a>t?(n[l]--,i=r.plus(n)):i=a);return[i,n,a,o]}function zm(i,t,e,s){let[n,r,o,a]=Nm(i,t,e);const l=t-n,c=e.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);c.length===0&&(o<t&&(o=n.plus({[a]:1})),o!==n&&(r[a]=(r[a]||0)+l/(o-n)));const h=R.fromObject(r,s);return c.length>0?R.fromMillis(l,s).shiftTo(...c).plus(h):h}const Rn={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},dl={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]},Vm=Rn.hanidec.replace(/[\[|\]]/g,"").split("");function Wm(i){let t=parseInt(i,10);if(isNaN(t)){t="";for(let e=0;e<i.length;e++){const s=i.charCodeAt(e);if(i[e].search(Rn.hanidec)!==-1)t+=Vm.indexOf(i[e]);else for(const n in dl){const[r,o]=dl[n];s>=r&&s<=o&&(t+=s-r)}}return parseInt(t,10)}else return t}function Pt({numberingSystem:i},t=""){return new RegExp(`${Rn[i||"latn"]}${t}`)}const Bm="missing Intl.DateTimeFormat.formatToParts support";function N(i,t=e=>e){return{regex:i,deser:([e])=>t(Wm(e))}}const fl=`[ ${String.fromCharCode(160)}]`,gl=new RegExp(fl,"g");function Hm(i){return i.replace(/\./g,"\\.?").replace(gl,fl)}function ml(i){return i.replace(/\./g,"").replace(gl," ").toLowerCase()}function It(i,t){return i===null?null:{regex:RegExp(i.map(Hm).join("|")),deser:([e])=>i.findIndex(s=>ml(e)===ml(s))+t}}function pl(i,t){return{regex:i,deser:([,e,s])=>ws(e,s),groups:t}}function ks(i){return{regex:i,deser:([t])=>t}}function $m(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function jm(i,t){const e=Pt(t),s=Pt(t,"{2}"),n=Pt(t,"{3}"),r=Pt(t,"{4}"),o=Pt(t,"{6}"),a=Pt(t,"{1,2}"),l=Pt(t,"{1,3}"),c=Pt(t,"{1,6}"),h=Pt(t,"{1,9}"),u=Pt(t,"{2,4}"),d=Pt(t,"{4,6}"),f=p=>({regex:RegExp($m(p.val)),deser:([y])=>y,literal:!0}),m=(p=>{if(i.literal)return f(p);switch(p.val){case"G":return It(t.eras("short",!1),0);case"GG":return It(t.eras("long",!1),0);case"y":return N(c);case"yy":return N(u,Pn);case"yyyy":return N(r);case"yyyyy":return N(d);case"yyyyyy":return N(o);case"M":return N(a);case"MM":return N(s);case"MMM":return It(t.months("short",!0,!1),1);case"MMMM":return It(t.months("long",!0,!1),1);case"L":return N(a);case"LL":return N(s);case"LLL":return It(t.months("short",!1,!1),1);case"LLLL":return It(t.months("long",!1,!1),1);case"d":return N(a);case"dd":return N(s);case"o":return N(l);case"ooo":return N(n);case"HH":return N(s);case"H":return N(a);case"hh":return N(s);case"h":return N(a);case"mm":return N(s);case"m":return N(a);case"q":return N(a);case"qq":return N(s);case"s":return N(a);case"ss":return N(s);case"S":return N(l);case"SSS":return N(n);case"u":return ks(h);case"uu":return ks(a);case"uuu":return N(e);case"a":return It(t.meridiems(),0);case"kkkk":return N(r);case"kk":return N(u,Pn);case"W":return N(a);case"WW":return N(s);case"E":case"c":return N(e);case"EEE":return It(t.weekdays("short",!1,!1),1);case"EEEE":return It(t.weekdays("long",!1,!1),1);case"ccc":return It(t.weekdays("short",!0,!1),1);case"cccc":return It(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return pl(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return pl(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return ks(/[a-z_+-/]{1,256}?/i);case" ":return ks(/[^\S\n\r]/);default:return f(p)}})(i)||{invalidReason:Bm};return m.token=i,m}const Um={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",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Ym(i,t){const{type:e,value:s}=i;if(e==="literal"){const o=/^\s+$/.test(s);return{literal:!o,val:o?" ":s}}const n=t[e];let r=Um[e];if(typeof r=="object"&&(r=r[n]),r)return{literal:!1,val:r}}function qm(i){return[`^${i.map(e=>e.regex).reduce((e,s)=>`${e}(${s.source})`,"")}$`,i]}function Zm(i,t,e){const s=i.match(t);if(s){const n={};let r=1;for(const o in e)if(Ne(e,o)){const a=e[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(n[a.token.val[0]]=a.deser(s.slice(r,r+l))),r+=l}return[s,n]}else return[s,{}]}function Xm(i){const 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}};let e=null,s;return I(i.z)||(e=Yt.create(i.z)),I(i.Z)||(e||(e=new ct(i.Z)),s=i.Z),I(i.q)||(i.M=(i.q-1)*3+1),I(i.h)||(i.h<12&&i.a===1?i.h+=12:i.h===12&&i.a===0&&(i.h=0)),i.G===0&&i.y&&(i.y=-i.y),I(i.u)||(i.S=En(i.u)),[Object.keys(i).reduce((r,o)=>{const a=t(o);return a&&(r[a]=i[o]),r},{}),e,s]}let Nn=null;function Gm(){return Nn||(Nn=O.fromMillis(1555555555555)),Nn}function Jm(i,t){if(i.literal)return i;const e=ot.macroTokenToFormatOpts(i.val),s=xl(e,t);return s==null||s.includes(void 0)?i:s}function yl(i,t){return Array.prototype.concat(...i.map(e=>Jm(e,t)))}function bl(i,t,e){const s=yl(ot.parseFormat(e),i),n=s.map(o=>jm(o,i)),r=n.find(o=>o.invalidReason);if(r)return{input:t,tokens:s,invalidReason:r.invalidReason};{const[o,a]=qm(n),l=RegExp(o,"i"),[c,h]=Zm(t,l,a),[u,d,f]=h?Xm(h):[null,null,void 0];if(Ne(h,"a")&&Ne(h,"H"))throw new _i("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:s,regex:l,rawMatches:c,matches:h,result:u,zone:d,specificOffset:f}}}function Km(i,t,e){const{result:s,zone:n,specificOffset:r,invalidReason:o}=bl(i,t,e);return[s,n,r,o]}function xl(i,t){return i?ot.create(t,i).formatDateTimeParts(Gm()).map(n=>Ym(n,i)):null}const _l=[0,31,59,90,120,151,181,212,243,273,304,334],wl=[0,31,60,91,121,152,182,213,244,274,305,335];function kt(i,t){return new At("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${i}, which is invalid`)}function vl(i,t,e){const s=new Date(Date.UTC(i,t-1,e));i<100&&i>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const n=s.getUTCDay();return n===0?7:n}function Sl(i,t,e){return e+(Si(i)?wl:_l)[t-1]}function Ml(i,t){const e=Si(i)?wl:_l,s=e.findIndex(r=>r<t),n=t-e[s];return{month:s+1,day:n}}function zn(i){const{year:t,month:e,day:s}=i,n=Sl(t,e,s),r=vl(t,e,s);let o=Math.floor((n-r+10)/7),a;return o<1?(a=t-1,o=_s(a)):o>_s(t)?(a=t+1,o=1):a=t,{weekYear:a,weekNumber:o,weekday:r,...Ss(i)}}function kl(i){const{weekYear:t,weekNumber:e,weekday:s}=i,n=vl(t,1,4),r=Mi(t);let o=e*7+s-n-3,a;o<1?(a=t-1,o+=Mi(a)):o>r?(a=t+1,o-=Mi(t)):a=t;const{month:l,day:c}=Ml(a,o);return{year:a,month:l,day:c,...Ss(i)}}function Vn(i){const{year:t,month:e,day:s}=i,n=Sl(t,e,s);return{year:t,ordinal:n,...Ss(i)}}function Tl(i){const{year:t,ordinal:e}=i,{month:s,day:n}=Ml(t,e);return{year:t,month:s,day:n,...Ss(i)}}function Qm(i){const t=bs(i.weekYear),e=qt(i.weekNumber,1,_s(i.weekYear)),s=qt(i.weekday,1,7);return t?e?s?!1:kt("weekday",i.weekday):kt("week",i.week):kt("weekYear",i.weekYear)}function tp(i){const t=bs(i.year),e=qt(i.ordinal,1,Mi(i.year));return t?e?!1:kt("ordinal",i.ordinal):kt("year",i.year)}function Ol(i){const t=bs(i.year),e=qt(i.month,1,12),s=qt(i.day,1,xs(i.year,i.month));return t?e?s?!1:kt("day",i.day):kt("month",i.month):kt("year",i.year)}function Dl(i){const{hour:t,minute:e,second:s,millisecond:n}=i,r=qt(t,0,23)||t===24&&e===0&&s===0&&n===0,o=qt(e,0,59),a=qt(s,0,59),l=qt(n,0,999);return r?o?a?l?!1:kt("millisecond",n):kt("second",s):kt("minute",e):kt("hour",t)}const Wn="Invalid DateTime",El=864e13;function Ts(i){return new At("unsupported zone",`the zone "${i.name}" is not supported`)}function Bn(i){return i.weekData===null&&(i.weekData=zn(i.c)),i.weekData}function Di(i,t){const e={ts:i.ts,zone:i.zone,c:i.c,o:i.o,loc:i.loc,invalid:i.invalid};return new O({...e,...t,old:e})}function Cl(i,t,e){let s=i-t*60*1e3;const n=e.offset(s);if(t===n)return[s,t];s-=(n-t)*60*1e3;const r=e.offset(s);return n===r?[s,n]:[i-Math.min(n,r)*60*1e3,Math.max(n,r)]}function Al(i,t){i+=t*60*1e3;const e=new Date(i);return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds()}}function Os(i,t,e){return Cl(An(i),t,e)}function Pl(i,t){const e=i.o,s=i.c.year+Math.trunc(t.years),n=i.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,r={...i.c,year:s,month:n,day:Math.min(i.c.day,xs(s,n))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=R.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=An(r);let[l,c]=Cl(a,e,i.zone);return o!==0&&(l+=o,c=i.zone.offset(l)),{ts:l,o:c}}function Ei(i,t,e,s,n,r){const{setZone:o,zone:a}=e;if(i&&Object.keys(i).length!==0||t){const l=t||a,c=O.fromObject(i,{...e,zone:l,specificOffset:r});return o?c:c.setZone(a)}else return O.invalid(new At("unparsable",`the input "${n}" can't be parsed as ${s}`))}function Ds(i,t,e=!0){return i.isValid?ot.create($.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(i,t):null}function Hn(i,t){const e=i.c.year>9999||i.c.year<0;let s="";return e&&i.c.year>=0&&(s+="+"),s+=K(i.c.year,e?6:4),t?(s+="-",s+=K(i.c.month),s+="-",s+=K(i.c.day)):(s+=K(i.c.month),s+=K(i.c.day)),s}function Il(i,t,e,s,n,r){let o=K(i.c.hour);return t?(o+=":",o+=K(i.c.minute),(i.c.second!==0||!e)&&(o+=":")):o+=K(i.c.minute),(i.c.second!==0||!e)&&(o+=K(i.c.second),(i.c.millisecond!==0||!s)&&(o+=".",o+=K(i.c.millisecond,3))),n&&(i.isOffsetFixed&&i.offset===0&&!r?o+="Z":i.o<0?(o+="-",o+=K(Math.trunc(-i.o/60)),o+=":",o+=K(Math.trunc(-i.o%60))):(o+="+",o+=K(Math.trunc(i.o/60)),o+=":",o+=K(Math.trunc(i.o%60)))),r&&(o+="["+i.zone.ianaName+"]"),o}const Ll={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ep={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ip={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Fl=["year","month","day","hour","minute","second","millisecond"],sp=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],np=["year","ordinal","hour","minute","second","millisecond"];function Rl(i){const 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"}[i.toLowerCase()];if(!t)throw new pa(i);return t}function Nl(i,t){const e=ne(t.zone,J.defaultZone),s=$.fromObject(t),n=J.now();let r,o;if(I(i.year))r=n;else{for(const c of Fl)I(i[c])&&(i[c]=Ll[c]);const a=Ol(i)||Dl(i);if(a)return O.invalid(a);const l=e.offset(n);[r,o]=Os(i,l,e)}return new O({ts:r,zone:e,loc:s,o})}function zl(i,t,e){const s=I(e.round)?!0:e.round,n=(o,a)=>(o=Cn(o,s||e.calendary?0:2,!0),t.loc.clone(e).relFormatter(e).format(o,a)),r=o=>e.calendary?t.hasSame(i,o)?0:t.startOf(o).diff(i.startOf(o),o).get(o):t.diff(i,o).get(o);if(e.unit)return n(r(e.unit),e.unit);for(const o of e.units){const a=r(o);if(Math.abs(a)>=1)return n(a,o)}return n(i>t?-0:0,e.units[e.units.length-1])}function Vl(i){let t={},e;return i.length>0&&typeof i[i.length-1]=="object"?(t=i[i.length-1],e=Array.from(i).slice(0,i.length-1)):e=Array.from(i),[t,e]}class O{constructor(t){const e=t.zone||J.defaultZone;let s=t.invalid||(Number.isNaN(t.ts)?new At("invalid input"):null)||(e.isValid?null:Ts(e));this.ts=I(t.ts)?J.now():t.ts;let n=null,r=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,r]=[t.old.c,t.old.o];else{const a=e.offset(this.ts);n=Al(this.ts,a),s=Number.isNaN(n.year)?new At("invalid input"):null,n=s?null:n,r=s?null:a}this._zone=e,this.loc=t.loc||$.create(),this.invalid=s,this.weekData=null,this.c=n,this.o=r,this.isLuxonDateTime=!0}static now(){return new O({})}static local(){const[t,e]=Vl(arguments),[s,n,r,o,a,l,c]=e;return Nl({year:s,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static utc(){const[t,e]=Vl(arguments),[s,n,r,o,a,l,c]=e;return t.zone=ct.utcInstance,Nl({year:s,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,e={}){const s=Cg(t)?t.valueOf():NaN;if(Number.isNaN(s))return O.invalid("invalid input");const n=ne(e.zone,J.defaultZone);return n.isValid?new O({ts:s,zone:n,loc:$.fromObject(e)}):O.invalid(Ts(n))}static fromMillis(t,e={}){if(Me(t))return t<-El||t>El?O.invalid("Timestamp out of range"):new O({ts:t,zone:ne(e.zone,J.defaultZone),loc:$.fromObject(e)});throw new St(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(Me(t))return new O({ts:t*1e3,zone:ne(e.zone,J.defaultZone),loc:$.fromObject(e)});throw new St("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const s=ne(e.zone,J.defaultZone);if(!s.isValid)return O.invalid(Ts(s));const n=J.now(),r=I(e.specificOffset)?s.offset(n):e.specificOffset,o=vs(t,Rl),a=!I(o.ordinal),l=!I(o.year),c=!I(o.month)||!I(o.day),h=l||c,u=o.weekYear||o.weekNumber,d=$.fromObject(e);if((h||a)&&u)throw new _i("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new _i("Can't mix ordinal dates with month/day");const f=u||o.weekday&&!h;let g,m,p=Al(n,r);f?(g=sp,m=ep,p=zn(p)):a?(g=np,m=ip,p=Vn(p)):(g=Fl,m=Ll);let y=!1;for(const M of g){const D=o[M];I(D)?y?o[M]=m[M]:o[M]=p[M]:y=!0}const b=f?Qm(o):a?tp(o):Ol(o),v=b||Dl(o);if(v)return O.invalid(v);const w=f?kl(o):a?Tl(o):o,[x,k]=Os(w,r,s),S=new O({ts:x,zone:s,o:k,loc:d});return o.weekday&&h&&t.weekday!==S.weekday?O.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${S.toISO()}`):S}static fromISO(t,e={}){const[s,n]=xm(t);return Ei(s,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[s,n]=_m(t);return Ei(s,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[s,n]=wm(t);return Ei(s,n,e,"HTTP",e)}static fromFormat(t,e,s={}){if(I(t)||I(e))throw new St("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:r=null}=s,o=$.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[a,l,c,h]=Km(o,t,e);return h?O.invalid(h):Ei(a,l,s,`format ${e}`,t,c)}static fromString(t,e,s={}){return O.fromFormat(t,e,s)}static fromSQL(t,e={}){const[s,n]=Dm(t);return Ei(s,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new St("need to specify a reason the DateTime is invalid");const s=t instanceof At?t:new At(t,e);if(J.throwOnInvalid)throw new ag(s);return new O({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const s=xl(t,$.fromObject(e));return s?s.map(n=>n?n.val:null).join(""):null}static expandFormat(t,e={}){return yl(ot.parseFormat(t),$.fromObject(e)).map(n=>n.val).join("")}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?Bn(this).weekYear:NaN}get weekNumber(){return this.isValid?Bn(this).weekNumber:NaN}get weekday(){return this.isValid?Bn(this).weekday:NaN}get ordinal(){return this.isValid?Vn(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ms.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ms.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ms.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ms.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}get isInLeapYear(){return Si(this.year)}get daysInMonth(){return xs(this.year,this.month)}get daysInYear(){return this.isValid?Mi(this.year):NaN}get weeksInWeekYear(){return this.isValid?_s(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:s,calendar:n}=ot.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:s,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(ct.instance(t),e)}toLocal(){return this.setZone(J.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:s=!1}={}){if(t=ne(t,J.defaultZone),t.equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||s){const r=t.offset(this.ts),o=this.toObject();[n]=Os(o,r,t)}return Di(this,{ts:n,zone:t})}else return O.invalid(Ts(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:s}={}){const n=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:s});return Di(this,{loc:n})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=vs(t,Rl),s=!I(e.weekYear)||!I(e.weekNumber)||!I(e.weekday),n=!I(e.ordinal),r=!I(e.year),o=!I(e.month)||!I(e.day),a=r||o,l=e.weekYear||e.weekNumber;if((a||n)&&l)throw new _i("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&n)throw new _i("Can't mix ordinal dates with month/day");let c;s?c=kl({...zn(this.c),...e}):I(e.ordinal)?(c={...this.toObject(),...e},I(e.day)&&(c.day=Math.min(xs(c.year,c.month),c.day))):c=Tl({...Vn(this.c),...e});const[h,u]=Os(c,this.o,this.zone);return Di(this,{ts:h,o:u})}plus(t){if(!this.isValid)return this;const e=R.fromDurationLike(t);return Di(this,Pl(this,e))}minus(t){if(!this.isValid)return this;const e=R.fromDurationLike(t).negate();return Di(this,Pl(this,e))}startOf(t){if(!this.isValid)return this;const e={},s=R.normalizeUnit(t);switch(s){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0;break}if(s==="weeks"&&(e.weekday=1),s==="quarters"){const n=Math.ceil(this.month/3);e.month=(n-1)*3+1}return this.set(e)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,e={}){return this.isValid?ot.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Wn}toLocaleString(t=fs,e={}){return this.isValid?ot.create(this.loc.clone(e),t).formatDateTime(this):Wn}toLocaleParts(t={}){return this.isValid?ot.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:s=!1,includeOffset:n=!0,extendedZone:r=!1}={}){if(!this.isValid)return null;const o=t==="extended";let a=Hn(this,o);return a+="T",a+=Il(this,o,e,s,n,r),a}toISODate({format:t="extended"}={}){return this.isValid?Hn(this,t==="extended"):null}toISOWeekDate(){return Ds(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:s=!0,includePrefix:n=!1,extendedZone:r=!1,format:o="extended"}={}){return this.isValid?(n?"T":"")+Il(this,o==="extended",e,t,s,r):null}toRFC2822(){return Ds(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ds(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Hn(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:s=!0}={}){let n="HH:mm:ss.SSS";return(e||t)&&(s&&(n+=" "),e?n+="z":t&&(n+="ZZ")),Ds(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Wn}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{};const 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",s={}){if(!this.isValid||!t.isValid)return R.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...s},r=Ag(e).map(R.normalizeUnit),o=t.valueOf()>this.valueOf(),a=o?this:t,l=o?t:this,c=zm(a,l,r,n);return o?c.negate():c}diffNow(t="milliseconds",e={}){return this.diff(O.now(),t,e)}until(t){return this.isValid?X.fromDateTimes(this,t):this}hasSame(t,e){if(!this.isValid)return!1;const s=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=s&&s<=n.endOf(e)}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;const e=t.base||O.fromObject({},{zone:this.zone}),s=t.padding?this<e?-t.padding:t.padding:0;let n=["years","months","days","hours","minutes","seconds"],r=t.unit;return Array.isArray(t.unit)&&(n=t.unit,r=void 0),zl(e,this.plus(s),{...t,numeric:"always",units:n,unit:r})}toRelativeCalendar(t={}){return this.isValid?zl(t.base||O.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(O.isDateTime))throw new St("min requires all arguments be DateTimes");return Ua(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(O.isDateTime))throw new St("max requires all arguments be DateTimes");return Ua(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,s={}){const{locale:n=null,numberingSystem:r=null}=s,o=$.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return bl(o,t,e)}static fromStringExplain(t,e,s={}){return O.fromFormatExplain(t,e,s)}static get DATE_SHORT(){return fs}static get DATE_MED(){return ya}static get DATE_MED_WITH_WEEKDAY(){return hg}static get DATE_FULL(){return ba}static get DATE_HUGE(){return xa}static get TIME_SIMPLE(){return _a}static get TIME_WITH_SECONDS(){return wa}static get TIME_WITH_SHORT_OFFSET(){return va}static get TIME_WITH_LONG_OFFSET(){return Sa}static get TIME_24_SIMPLE(){return Ma}static get TIME_24_WITH_SECONDS(){return ka}static get TIME_24_WITH_SHORT_OFFSET(){return Ta}static get TIME_24_WITH_LONG_OFFSET(){return Oa}static get DATETIME_SHORT(){return Da}static get DATETIME_SHORT_WITH_SECONDS(){return Ea}static get DATETIME_MED(){return Ca}static get DATETIME_MED_WITH_SECONDS(){return Aa}static get DATETIME_MED_WITH_WEEKDAY(){return ug}static get DATETIME_FULL(){return Pa}static get DATETIME_FULL_WITH_SECONDS(){return Ia}static get DATETIME_HUGE(){return La}static get DATETIME_HUGE_WITH_SECONDS(){return Fa}}function Ci(i){if(O.isDateTime(i))return i;if(i&&i.valueOf&&Me(i.valueOf()))return O.fromJSDate(i);if(i&&typeof i=="object")return O.fromObject(i);throw new St(`Unknown datetime argument: ${i}, of type ${typeof i}`)}/*!
19
+ * chartjs-adapter-luxon v1.3.1
20
+ * https://www.chartjs.org
21
+ * (c) 2023 chartjs-adapter-luxon Contributors
22
+ * Released under the MIT license
23
+ */const rp={datetime:O.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:O.TIME_WITH_SECONDS,minute:O.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};so._date.override({_id:"luxon",_create:function(i){return O.fromMillis(i,this.options)},init(i){this.options.locale||(this.options.locale=i.locale)},formats:function(){return rp},parse:function(i,t){const e=this.options,s=typeof i;return i===null||s==="undefined"?null:(s==="number"?i=this._create(i):s==="string"?typeof t=="string"?i=O.fromFormat(i,t,e):i=O.fromISO(i,e):i instanceof Date?i=O.fromJSDate(i,e):s==="object"&&!(i instanceof O)&&(i=O.fromObject(i,e)),i.isValid?i.valueOf():null)},format:function(i,t){const e=this._create(i);return typeof t=="string"?e.toFormat(t):e.toLocaleString(t)},add:function(i,t,e){const s={};return s[e]=t,this._create(i).plus(s).valueOf()},diff:function(i,t,e){return this._create(i).diff(this._create(t)).as(e).valueOf()},startOf:function(i,t,e){if(t==="isoWeek"){e=Math.trunc(Math.min(Math.max(0,e),6));const s=this._create(i);return s.minus({days:(s.weekday-e+7)%7}).startOf("day").valueOf()}return t?this._create(i).startOf(t).valueOf():i},endOf:function(i,t){return this._create(i).endOf(t).valueOf()}});const Es={errorBarLineWidth:{v:[1,3]},errorBarColor:{v:["#2c2c2c","#1f1f1f"]},errorBarWhiskerLineWidth:{v:[1,3]},errorBarWhiskerRatio:{v:[.2,.25]},errorBarWhiskerSize:{v:[20,24]},errorBarWhiskerColor:{v:["#2c2c2c","#1f1f1f"]}},$n={_scriptable:!0,_indexable:i=>i!=="v"},Wl=Object.keys(Es);function jn(i,t){const e=Array.isArray(i)?i:[i],s=Array.isArray(t)?t:[t];if(e.length===s.length)return e.map((r,o)=>[r,s[o]]);const n=Math.max(e.length,s.length);return Array(n).map((r,o)=>[e[o%e.length],s[o%s.length]])}function gt(i,t){if(typeof i=="string"||typeof i=="number")return i;const e=Array.isArray(i)?i:i.v;return e[t%e.length]}function Un(i,t,e){const s=gt(t.errorBarWhiskerRatio,e);return i!=null&&s>0?i*s*.5:gt(t.errorBarWhiskerSize,e)*.5}function op(i,t,e,s,n){n.save(),n.translate(i.x,0);const r=jn(t??i.y,e??i.y);r.reverse().forEach(([o,a],l)=>{const c=r.length-l-1,h=Un(i.width,s,c);n.lineWidth=gt(s.errorBarLineWidth,c),n.strokeStyle=gt(s.errorBarColor,c),n.beginPath(),n.moveTo(0,o),n.lineTo(0,a),n.stroke(),n.lineWidth=gt(s.errorBarWhiskerLineWidth,c),n.strokeStyle=gt(s.errorBarWhiskerColor,c),n.beginPath(),n.moveTo(-h,o),n.lineTo(h,o),n.moveTo(-h,a),n.lineTo(h,a),n.stroke()}),n.restore()}function ap(i,t,e,s,n){n.save(),n.translate(0,i.y);const r=jn(t??i.x,e??i.x);r.reverse().forEach(([o,a],l)=>{const c=r.length-l-1,h=Un(i.height,s,c);n.lineWidth=gt(s.errorBarLineWidth,c),n.strokeStyle=gt(s.errorBarColor,c),n.beginPath(),n.moveTo(o,0),n.lineTo(a,0),n.stroke(),n.lineWidth=gt(s.errorBarWhiskerLineWidth,c),n.strokeStyle=gt(s.errorBarWhiskerColor,c),n.beginPath(),n.moveTo(o,-h),n.lineTo(o,h),n.moveTo(a,-h),n.lineTo(a,h),n.stroke()}),n.restore()}function Bl(i,t){var e,s,n,r;const o=i.getProps(["x","y","width","height","xMin","xMax","yMin","yMax"]);(o.xMin!=null||o.xMax!=null)&&ap(o,(e=o.xMin)!==null&&e!==void 0?e:null,(s=o.xMax)!==null&&s!==void 0?s:null,i.options,t),(o.yMin!=null||o.yMax!=null)&&op(o,(n=o.yMin)!==null&&n!==void 0?n:null,(r=o.yMax)!==null&&r!==void 0?r:null,i.options,t)}function lp(i,t,e,s,n){n.save(),n.translate(i.x,i.y);const r=(i.startAngle+i.endAngle)/2,o=Math.cos(r),a=Math.sin(r),l={x:-a,y:o},c=Math.sqrt(l.x*l.x+l.y*l.y);l.x/=c,l.y/=c;const h=jn(t??i.outerRadius,e??i.outerRadius);h.reverse().forEach(([u,d],f)=>{const g=h.length-f-1,m=u*o,p=u*a,y=d*o,b=d*a,v=Un(null,s,g),w=l.x*v,x=l.y*v;n.lineWidth=gt(s.errorBarLineWidth,g),n.strokeStyle=gt(s.errorBarColor,g),n.beginPath(),n.moveTo(m,p),n.lineTo(y,b),n.stroke(),n.lineWidth=gt(s.errorBarWhiskerLineWidth,g),n.strokeStyle=gt(s.errorBarWhiskerColor,g),n.beginPath(),n.moveTo(m+w,p+x),n.lineTo(m-w,p-x),n.moveTo(y+w,b+x),n.lineTo(y-w,b-x),n.stroke()}),n.restore()}function cp(i,t){const e=i.getProps(["x","y","startAngle","endAngle","rMin","rMax","outerRadius"]);(e.rMin!=null||e.rMax!=null)&&lp(e,e.rMin,e.rMax,i.options,t)}class Ue extends _e{draw(t){super.draw(t),Bl(this,t)}}Ue.id="barWithErrorBar",Ue.defaults={..._e.defaults,...Es},Ue.defaultRoutes=_e.defaultRoutes,Ue.descriptors=$n;class xt extends xe{draw(t,e){super.draw.call(this,t,e),Bl(this,t)}}xt.id="pointWithErrorBar",xt.defaults={...xe.defaults,...Es},xt.defaultRoutes=xe.defaultRoutes,xt.descriptors=$n;class Ye extends te{draw(t){super.draw(t),cp(this,t)}}Ye.id="arcWithErrorBar",Ye.defaults={...te.defaults,...Es},Ye.defaultRoutes=te.defaultRoutes,Ye.descriptors=$n;const Yn=["xMin","xMax","yMin","yMax"];function Hl(i){return i?Yn.slice(0,2):Yn.slice(2)}function Ai(i,t,e,s,n){const r=[`${s.axis}Min`,`${s.axis}Max`],o=s.getBasePixel();for(const a of r){const l=t[a];Array.isArray(l)?i[a]=l.map(c=>n?o:s.getPixelForValue(c,e)):typeof l=="number"?i[a]=n?o:s.getPixelForValue(l,e):i[a]=null}}function hp(i,t,e,s,n){const r=n.animation,o=[`${e.axis}Min`,`${e.axis}Max`],a=l=>{const c=e.getDistanceFromCenterForValue(l),h=r.animateScale?0:c;return s?h:c};for(const l of o){const c=t[l];Array.isArray(c)?i[l]=c.map(a):typeof c=="number"?i[l]=a(c):i[l]=null}}function qn(i){return Array.isArray(i)?i.slice().reverse():i}function $l(i){const t=Hl(i.element.horizontal),e=ra.defaults.callbacks.label.call(this,i),s=i.chart.data.datasets[i.datasetIndex].data[i.dataIndex];return s==null||t.every(n=>s[n]==null)?e:`${e} (${qn(s[t[0]])} .. ${s[t[1]]})`}function up(i){const t=i.chart.data.datasets[i.datasetIndex].data[i.dataIndex],e=(s,n)=>{const r=Hl(n);return t==null||r.every(o=>t[o]==null)?s:`${s} [${qn(t[r[0]])} .. ${t[r[1]]}]`};return`(${e(i.label,!0)}, ${e(i.parsed.y,!1)})`}function dp(i){const t=Rt.overrides.plugins.tooltip.callbacks.label.call(this,i),e=i.chart.data.datasets[i.datasetIndex].data[i.dataIndex],s=["rMin","rMax"];return e==null||s.every(n=>e[n]==null)?t:`${t} [${qn(e[s[0]])} .. ${e[s[1]]}]`}const jl={color(i,t,e){const s=i||"transparent",n=t||"transparent";if(s===n)return t;const r=$i(s),o=r.valid&&$i(n);return o&&o.valid?o.mix(r,e).hexString():t},number(i,t,e){return i===t?t:i+(t-i)*e}};function Ul(i,t,e,s,n){if(typeof i===s&&typeof t===s)return n(i,t,e);if(Array.isArray(i)&&Array.isArray(t))return i.map((o,a)=>n(o,t[a],e));const r=o=>o&&Array.isArray(o.v);return r(i)&&r(t)?{v:i.v.map((o,a)=>n(o,t.v[a],e))}:t}function fp(i,t,e){return Ul(i,t,e,"number",jl.number)}function gp(i,t,e){return Ul(i,t,e,"string",jl.color)}const Cs={animations:{numberArray:{fn:fp,properties:Yn.concat(Wl.filter(i=>!i.endsWith("Color")),["rMin","rMax"])},colorArray:{fn:gp,properties:Wl.filter(i=>i.endsWith("Color"))}}};function As(i,t){const{axis:e}=i;i.axis=`${e}MinMin`;const{min:s}=t(i);i.axis=`${e}MaxMax`;const{max:n}=t(i);return i.axis=e,{min:s,max:n}}function Yl(i,t,e){return Array.isArray(t)?e(i,...t):typeof t=="number"?e(i,t):i}function qe(i,t,e,s,n){const r=typeof t=="string"?t:t.axis,o=`${r}Min`,a=`${r}Max`,l=`${r}MinMin`,c=`${r}MaxMax`;for(let h=0;h<n;h+=1){const u=h+s,d=i[h];d[o]=typeof e[u]=="object"?e[u][o]:null,d[a]=typeof e[u]=="object"?e[u][a]:null,d[l]=Yl(d[r],d[o],Math.min),d[c]=Yl(d[r],d[a],Math.max)}}function ql(i,t,e,s){const{axis:n}=t,r=t.getLabels();for(let o=0;o<s;o+=1){const a=o+e,l=i[o];l[n]=t.parse(r[a],a)}}function Ps(i,t,e,s=[],n=[]){lt.addControllers(e),Array.isArray(s)?lt.addElements(...s):lt.addElements(s),Array.isArray(n)?lt.addScales(...n):lt.addScales(n);const r=t;return r.type=i,r}class Ze extends Qt{getMinMax(t,e){return As(t,s=>super.getMinMax(s,e))}parsePrimitiveData(t,e,s,n){const r=super.parsePrimitiveData(t,e,s,n);return this.parseErrorData(r,t,e,s,n),r}parseObjectData(t,e,s,n){const r=super.parseObjectData(t,e,s,n);return this.parseErrorData(r,t,e,s,n),r}parseErrorData(t,e,s,n,r){qe(t,e.vScale,s,n,r),ql(t,e.iScale,n,r)}updateElement(t,e,s,n){typeof e=="number"&&Ai(s,this.getParsed(e),e,this._cachedMeta.vScale,n==="reset"),super.updateElement(t,e,s,n)}}Ze.id="barWithErrorBars",Ze.defaults=pt({},[Qt.defaults,Cs,{dataElementType:Ue.id}]),Ze.overrides=pt({},[Qt.overrides,{plugins:{tooltip:{callbacks:{label:$l}}}}]),Ze.defaultRoutes=Qt.defaultRoutes;class mp extends ut{constructor(t,e){super(t,Ps("barWithErrorBars",e,Ze,Ue,[we,Fe]))}}mp.id=Ze.id;const Zl=["linear","logarithmic","time","timeseries"];class Oe extends jt{getMinMax(t,e){return As(t,s=>super.getMinMax(s,e))}parsePrimitiveData(t,e,s,n){const r=super.parsePrimitiveData(t,e,s,n);return this.parseErrorData(r,t,e,s,n),r}parseObjectData(t,e,s,n){const r=super.parseObjectData(t,e,s,n);return this.parseErrorData(r,t,e,s,n),r}parseErrorData(t,e,s,n,r){qe(t,e.vScale,s,n,r);const o=e.iScale;Zl.includes(o.type)?qe(t,e.iScale,s,n,r):ql(t,e.iScale,n,r)}updateElement(t,e,s,n){t instanceof xt&&typeof e=="number"&&this.updateElementScale(e,s,n),super.updateElement(t,e,s,n)}updateElementScale(t,e,s){Ai(e,this.getParsed(t),t,this._cachedMeta.vScale,s==="reset");const n=this._cachedMeta.iScale;Zl.includes(n.type)&&Ai(e,this.getParsed(t),t,this._cachedMeta.iScale,s==="reset")}updateElements(t,e,s,n){const r=n==="reset",a=this.chart._animationsDisabled||r||n==="none";if(super.updateElements(t,e,s,n),!!a)for(let l=e;l<e+s;++l){const c=t[l];c instanceof xt&&this.updateElementScale(l,c,n)}}}Oe.id="lineWithErrorBars",Oe.defaults=pt({},[jt.defaults,Cs,{dataElementType:xt.id}]),Oe.overrides=pt({},[jt.overrides,{plugins:{tooltip:{callbacks:{label:$l}}}}]),Oe.defaultRoutes=jt.defaultRoutes;class Xl extends ut{constructor(t,e){super(t,Ps("lineWithErrorBars",e,Oe,xt,[we,Fe]))}}Xl.id=Oe.id;class De extends pe{getMinMax(t,e){return As(t,s=>super.getMinMax(s,e))}parsePrimitiveData(t,e,s,n){const r=super.parsePrimitiveData(t,e,s,n);return this.parseErrorData(r,t,e,s,n),r}parseObjectData(t,e,s,n){const r=super.parseObjectData(t,e,s,n);return this.parseErrorData(r,t,e,s,n),r}parseErrorData(t,e,s,n,r){qe(t,e.xScale,s,n,r),qe(t,e.yScale,s,n,r)}updateElement(t,e,s,n){t instanceof xt&&typeof e=="number"&&this.updateElementScale(e,s,n),super.updateElement(t,e,s,n)}updateElementScale(t,e,s){Ai(e,this.getParsed(t),t,this._cachedMeta.xScale,s==="reset"),Ai(e,this.getParsed(t),t,this._cachedMeta.yScale,s==="reset")}updateElements(t,e,s,n){const r=n==="reset",a=this.chart._animationsDisabled||r||n==="none";if(super.updateElements(t,e,s,n),!!a)for(let l=e;l<e+s;++l){const c=t[l];c instanceof xt&&this.updateElementScale(l,c,n)}}}De.id="scatterWithErrorBars",De.defaults=pt({},[pe.defaults,Cs,{dataElementType:xt.id}]),De.overrides=pt({},[pe.overrides,{plugins:{tooltip:{callbacks:{label:up}}}}]),De.defaultRoutes=jt.defaultRoutes;class Gl extends ut{constructor(t,e){super(t,Ps("scatterWithErrorBars",e,De,xt,[we]))}}Gl.id=De.id;class Xe extends Rt{getMinMaxImpl(t){const e=this._cachedMeta,s={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((n,r)=>{const o=this.getParsed(r)[t.axis];Number.isNaN(o)||!this.chart.getDataVisibility(r)||(o<s.min&&(s.min=o),o>s.max&&(s.max=o))}),s}getMinMax(t){return As(t,e=>this.getMinMaxImpl(e))}countVisibleElements(){const t=this._cachedMeta;return t.data.reduce((e,s,n)=>!Number.isNaN(t._parsed[n].r)&&this.chart.getDataVisibility(n)?e+1:e,0)}parsePrimitiveData(t,e,s,n){const r=super.parsePrimitiveData(t,e,s,n);return this.parseErrorData(r,t,e,s,n),r}parseObjectData(t,e,s,n){const r=super.parseObjectData(t,e,s,n);return this.parseErrorData(r,t,e,s,n),r}parseErrorData(t,e,s,n,r){const o=e.rScale;for(let a=0;a<r;a+=1){const l=a+n,c=s[l],h=o.parse(c[o.axis],l);t[a]={[o.axis]:h}}qe(t,o,s,n,r)}updateElement(t,e,s,n){typeof e=="number"&&hp(s,this.getParsed(e),this._cachedMeta.rScale,n==="reset",this.chart.options),super.updateElement(t,e,s,n)}updateElements(t,e,s,n){const r=this.chart.scales.r,o=r.getDistanceFromCenterForValue;r.getDistanceFromCenterForValue=function(l){return typeof l=="number"?o.call(this,l):o.call(this,l.r)},super.updateElements(t,e,s,n),r.getDistanceFromCenterForValue=o}}Xe.id="polarAreaWithErrorBars",Xe.defaults=pt({},[Rt.defaults,Cs,{dataElementType:Ye.id}]),Xe.overrides=pt({},[Rt.overrides,{plugins:{tooltip:{callbacks:{label:dp}}}}]),Xe.defaultRoutes=Rt.defaultRoutes;class pp extends ut{constructor(t,e){super(t,Ps("polarAreaWithErrorBars",e,Xe,Ye,[Re]))}}pp.id=Xe.id;function yp(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Jl={};function Tt(i,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var bp=Tt;Tt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Tt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Tt.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var t=new Date().getTime();if(i&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var e=this._timeouts.shift();if(e===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),e=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},e),this._options.unref&&this._timer.unref(),!0},Tt.prototype.attempt=function(i,t){this._fn=i,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var e=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){e._operationTimeoutCb()},e._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},Tt.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)},Tt.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)},Tt.prototype.start=Tt.prototype.try,Tt.prototype.errors=function(){return this._errors},Tt.prototype.attempts=function(){return this._attempts},Tt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},t=null,e=0,s=0;s<this._errors.length;s++){var n=this._errors[s],r=n.message,o=(i[r]||0)+1;i[r]=o,o>=e&&(t=n,e=o)}return t},function(i){var t=bp;i.operation=function(e){var s=i.timeouts(e);return new t(s,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},i.timeouts=function(e){if(e instanceof Array)return[].concat(e);var s={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)s[n]=e[n];if(s.minTimeout>s.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<s.retries;o++)r.push(this.createTimeout(o,s));return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,s)),r.sort(function(a,l){return a-l}),r},i.createTimeout=function(e,s){var n=s.randomize?Math.random()+1:1,r=Math.round(n*Math.max(s.minTimeout,1)*Math.pow(s.factor,e));return r=Math.min(r,s.maxTimeout),r},i.wrap=function(e,s,n){if(s instanceof Array&&(n=s,s=null),!n){n=[];for(var r in e)typeof e[r]=="function"&&n.push(r)}for(var o=0;o<n.length;o++){var a=n[o],l=e[a];e[a]=function(h){var u=i.operation(s),d=Array.prototype.slice.call(arguments,1),f=d.pop();d.push(function(g){u.retry(g)||(g&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){h.apply(e,d)})}.bind(e,l),e[a].options=s}}}(Jl);var xp=Jl;const _p=yp(xp),wp=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed"]);class Zn extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const vp=(i,t,e)=>{const s=e.retries-(t-1);return i.attemptNumber=t,i.retriesLeft=s,i},Sp=i=>wp.has(i),Kl=i=>globalThis.DOMException===void 0?new Error(i):new DOMException(i);async function Ql(i,t){return new Promise((e,s)=>{t={onFailedAttempt(){},retries:10,...t};const n=_p.operation(t);n.attempt(async r=>{try{e(await i(r))}catch(o){if(!(o instanceof Error)){s(new TypeError(`Non-error was thrown: "${o}". You should only throw errors.`));return}if(o instanceof Zn)n.stop(),s(o.originalError);else if(o instanceof TypeError&&!Sp(o.message))n.stop(),s(o);else{vp(o,r,t);try{await t.onFailedAttempt(o)}catch(a){s(a);return}n.retry(o)||s(n.mainError())}}}),t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",()=>{n.stop();const r=t.signal.reason===void 0?Kl("The operation was aborted."):t.signal.reason;s(r instanceof Error?r:Kl(r))},{once:!0})})}class Mp{constructor(t,e,s,n,r,o,a,l){_(this,"type");_(this,"endpoint");_(this,"parameters");_(this,"retries");_(this,"source");_(this,"table");_(this,"geometry");_(this,"timeParameter");this.type=t,this.endpoint=e,this.parameters=s,this.retries=n,this.source=r,this.table=o,this.geometry=a,this.timeParameter=l}fetchData(t,e,s){switch(this.type){case"signals":return this.fetchSignals(t,e,s);case"geodb":return this.fetchGeoDBData(t,e,s);default:return null}}fetchGeoDBData(t,e,s){const n=this.parameters[t].join(","),r=`and=(${this.timeParameter}.gte.${e.toISODate()},${this.timeParameter}.lte.${s.toISODate()})`,o=`${this.endpoint}/${this.source}_${this.table}?${r}&select=${n},${this.timeParameter}`;async function a(){const l=await fetch(o,{headers:{"Content-Type":"application/json; charset=utf-8"},method:"GET",mode:"cors"});if(l.status===404)throw new Zn(l.statusText);if(l.status!==200)throw Error(l.statusText);return l}return Ql(a,{onFailedAttempt:l=>{console.log(`Attempt ${l.attemptNumber} failed. There are ${l.retriesLeft} retries left.`)},retries:this.retries}).then(function(l){return l.json()})}fetchSignals(t,e,s){const n=this.parameters[t].map(c=>`feature=${c}`).join("&"),r=`${e?"&start_date="+e.toISODate():""}${s?"&end_date="+s.toISODate():""}`,o=`${this.endpoint}?source=${this.source}&${n}${r}`,a=this.geometry;async function l(){const c=await fetch(o,{headers:{"Content-Type":"application/json; charset=utf-8"},method:"POST",mode:"cors",body:JSON.stringify({geometry:a})});if(c.status===404)throw new Zn(c.statusText);if(c.status!==200)throw Error(c.statusText);return c}return Ql(l,{onFailedAttempt:c=>{console.log(`Attempt ${c.attemptNumber} failed. There are ${c.retriesLeft} retries left.`)},retries:this.retries}).then(function(c){return c.json()})}convertData(t){switch(this.type){case"signals":return this.convertSignals(t);case"geodb":return this.convertGeoDBData(t);default:return null}}convertSignals(t){let e={};const s=t.basicStats;return t&&t.date!=="missing"&&(e={x:O.fromISO(t.date).setZone("UTC"),y:s.mean,yMin:s.min,yMax:s.max}),e}convertGeoDBData(t){let e={};return t&&t.date!=="missing"&&(e={x:O.fromISO(t.date).setZone("UTC"),y:t.basicStats.mean,yMin:null,yMax:null}),e}setGeometry(t){this.geometry=t}}ut.register(Oe,Xl,xt,Gl,De,we,Fe);class kp{constructor(t,e,s){_(this,"type");_(this,"chart");_(this,"startTime");_(this,"endTime");_(this,"timeAggregation");_(this,"options");_(this,"chartOptions");_(this,"dataStorage");_(this,"status");_(this,"activeFields");_(this,"requestHandler");_(this,"additionalYAxis");if(this.type=t,this.chart=e,this.options=s,this.startTime=O.now().minus(s.timeInterval),this.endTime=O.now(),s.startTime&&s.endTime&&(this.startTime=O.fromISO(s.startTime).setZone("UTC"),this.endTime=O.fromISO(s.endTime).setZone("UTC")),this.options.timeAggregation&&(this.timeAggregation=this.options.timeAggregation),this.options.retries=this.options.retries?this.options.retries:5,this.options.normalize=this.options.normalize?this.options.normalize:!1,this.options.showMinMax=this.options.showMinMax?this.options.showMinMax:!1,this.additionalYAxis=this.options.additionalYAxis?this.options.additionalYAxis:null,this.dataStorage={},this.options.features.forEach((n,r)=>this.dataStorage[r]={}),this.requestHandler=new Mp(t,this.options.endpoint,this.options.features,this.options.retries,this.options.source,this.options.table,this.options.geometry,this.options.timeParameter),this.status="ready",this.chartOptions={responsive:!0,maintainAspectRatio:!1,scales:{x:{type:"time",min:this.startTime.toISODate(),max:this.endTime.toISODate(),ticks:{minRotation:0,maxRotation:0}}},interaction:{axis:"x",mode:"nearest",intersect:!1},plugins:{htmlLegend:{containerID:"legend-container",onClick:(n,r)=>{if(r.hidden)this.setActiveFields([...this.activeFields,r.text]);else{const o=this.activeFields.indexOf(r.text),a=this.activeFields;a.splice(o,1),this.setActiveFields(a)}}},legend:{display:!1},tooltip:{callbacks:{title:n=>{var o;return((o=n[0])==null?void 0:o.raw).x.toISODate()},label:n=>{const r=n.raw,o=r.yMin!==null?`; ↓ ${r.yMin.toPrecision(3)}`:"",a=r.yMax!==null?`, ↑ ${r.yMax.toPrecision(3)}`:"";return`${n.dataset.label}: ↔ ${r.y.toPrecision(3)}${o}${a}`}}}}},this.additionalYAxis!==null)for(let n=0;n<this.additionalYAxis.length;n++){const r=this.additionalYAxis[n];this.chartOptions.scales[r.id]={type:"linear",position:"right"}}}checkLoadingStatus(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#loadingIndicator");let e=!1;Object.keys(this.dataStorage).forEach((s,n)=>{Object.keys(this.dataStorage[n]).forEach(r=>{this.dataStorage[n][r].status==="fetching"&&(e=!0)})}),t.className=e?"loader":"loader hidden"}updateChart(){this.checkLoadingStatus(),this.chart.options=this.chartOptions;const t=[];this.options.features.flat().forEach((e,s)=>{let n=-1;if(this.options.features.forEach((r,o)=>{r.includes(e)&&(n=o)}),n!==-1){let r=[],o=Number.MAX_VALUE,a=Number.MIN_VALUE;Object.keys(this.dataStorage[n]).forEach(u=>{const d=this.dataStorage[n][u];if(d.status==="finished"){if(this.type==="signals"&&Object.keys(d.data).length!==0&&Object.keys(d.data).includes(e)&&(d.data[e].forEach(f=>{const g=f.basicStats;this.options.showMinMax?(o=g.min<o?g.min:o,a=g.max>a?g.max:a):(o=g.mean<o?g.mean:o,a=g.mean>a?g.mean:a)}),r.push(...d.data[e])),this.type==="geodb"&&Object.keys(d.data).length!==0){const f=d.data.map(g=>(g[e]!==null&&(o=g[e]<o?g[e]:o,a=g[e]>a?g[e]:a),{date:g[this.options.timeParameter],basicStats:{mean:g[e]}}));r.push(...f)}}else r.push({date:"missing"})});let l=!1,c=r.map(u=>this.requestHandler.convertData(u));if(c.sort((u,d)=>u.x-d.x),c.length>0&&(l=!0),l&&this.timeAggregation){let u=Number.MIN_VALUE,d=Number.MAX_VALUE;o=Number.MAX_VALUE,a=Number.MIN_VALUE;const f=[];let g=0,m=O.fromObject({year:this.startTime.year,month:this.startTime.month,day:this.startTime.day});for(;m<this.endTime;){let p=0,y=!1;for(;g<c.length&&(Object.keys(c[g]).length===0||c[g].x<m);)g++;const b=g;for(;g<c.length&&(Object.keys(c[g]).length===0||c[g].x<m.plus(this.timeAggregation));){const x=c[g];p+=x.y,u=x.y!==null&&x.y>u?x.y:u,u=x.yMax!==null&&x.yMax>u?x.yMax:u,d=x.y!==null&&x.y<d?x.y:d,d=x.yMin!==null&&x.yMin<d?x.yMin:d,g++,y=!0}const w=g-b;if(w>0&&y){const x=p/w;this.options.showMinMax?(o=d<o?d:o,a=u>a?u:a):(o=x<o?x:o,a=x>a?x:a),f.push({x:m,y:x,yMin:d,yMax:u}),u=Number.MIN_VALUE,d=Number.MAX_VALUE}m=m.plus(this.timeAggregation)}c=f}if(l&&this.options.normalize){const u=a-o;c=c.map(d=>(d.y!==null?d.y=(d.y-o)/u:d.y=null,d.yMin=(d.yMin-o)/u,d.yMax=(d.yMax-o)/u,d))}let h={type:"line",label:e,data:c,hidden:!this.activeFields.includes(e)};if(this.options.showMinMax&&(h={type:"lineWithErrorBars",label:e,data:c,hidden:!this.activeFields.includes(e),errorBarWhiskerLineWidth:2,errorBarColor:"#00000000"}),this.options.colors&&this.options.colors.length>=s){const u=this.options.colors[s];h.backgroundColor=u,h.borderColor=u,this.options.showMinMax&&(h={type:"lineWithErrorBars",label:e,data:c,hidden:!this.activeFields.includes(e),errorBarWhiskerLineWidth:2,errorBarColor:"#00000000",errorBarWhiskerColor:u,errorBarWhiskerSize:10,backgroundColor:u,borderColor:u})}if(this.additionalYAxis!==null)for(let u=0;u<this.additionalYAxis.length;u++){const d=this.additionalYAxis[u];d.containedSignals.includes(e)&&(h.yAxisID=d.id)}t.push(h)}}),this.chart.data={datasets:t},this.chart.update("none")}retrieveMissingData(){const t=[];this.activeFields.forEach(n=>{this.options.features.forEach((r,o)=>{r.includes(n)&&!t.includes(o)&&t.push(o)})});let e=O.fromObject({year:this.endTime.year,month:this.endTime.month}).plus({month:1}).minus({second:1});const s=O.fromObject({year:this.startTime.year,month:this.startTime.month}).plus({month:1}).minus({second:1});for(;e>s;){const n=e.toFormat("yyyyMM");t.forEach(r=>{if(!(n in this.dataStorage[r])){const o=this.requestHandler.fetchData(r,O.fromObject({year:e.year,month:e.month}),O.fromObject({year:e.year,month:e.month}).plus({month:1}).minus({second:1})).then(a=>{this.dataStorage[r][n].data=a,this.dataStorage[r][n].status="finished",this.updateChart()}).catch(()=>{this.dataStorage[r][n].status="failed",this.updateChart()});this.dataStorage[r][n]={request:o,status:"fetching"}}}),e=e.minus({months:1})}}triggerCSVDownload(){const t=[],e=[],s=this.activeFields;s.forEach((l,c)=>{let h=-1;if(this.options.features.forEach((u,d)=>{u.includes(l)&&(h=d)}),h!==-1){let u=[];Object.keys(this.dataStorage[h]).forEach(d=>{const f=this.dataStorage[h][d];f.status==="finished"&&Object.keys(f.data).length!==0&&Object.keys(f.data).includes(l)&&u.push(...f.data[l])}),u.length>0&&(e.push(s[c]),t.push(u))}});const n={};e.forEach((l,c)=>{t[c].forEach(h=>{n[h.date]||(n[h.date]={}),n[h.date][l]=h.basicStats})});let r="time,";const o=e.map(l=>[l,`${l}_max`,`${l}_min`]);r+=o.flat().join(","),r+=`
24
+ `,Object.keys(n).forEach(l=>{const c=[l];e.forEach(h=>{const u=n[l][h]?n[l][h]:null;u!=null?c.push(u.mean,u.max,u.min):c.push("","","")}),r+=c.join(","),r+=`
25
+ `});const a=document.createElement("a");a.href="data:text/csv;charset=utf-8,"+encodeURI(r),a.target="_blank",a.download="chart_data.csv",a.click()}setGeometry(t){this.dataStorage={},this.options.features.forEach((e,s)=>this.dataStorage[s]={}),this.options.geometry=t,this.requestHandler.setGeometry(t),this.retrieveMissingData(),this.updateChart()}setActiveFields(t){this.activeFields=t,this.retrieveMissingData(),this.updateChart()}setTimeInterval(t,e){this.startTime=t,this.endTime=e,this.chartOptions.scales.x.min=t.toISODate(),this.chartOptions.scales.x.max=e.toISODate(),this.retrieveMissingData(),this.updateChart()}setNormalize(t){this.options.normalize=t,this.updateChart()}setShowMinMax(t){this.options.showMinMax=t,this.updateChart()}setTimeAggregation(t){this.timeAggregation=t,this.updateChart()}}class Tp{constructor(t,e,s,n){_(this,"element");_(this,"sdm");_(this,"sdmOptions");_(this,"options");this.element=t,this.sdm=e,this.options=n,this.sdmOptions=s,this.generateTimeAggregationOptions(),this.addNormalizeCheckbox(),this.addShowMinMax(),this.addCSVDownload(),this.generateTimeSelectionOptions(),document.querySelector("eox-chart").shadowRoot.querySelector("#controls").style.display="flex",document.querySelector("eox-chart").shadowRoot.querySelector("#legend-container").style.display="block",document.querySelector("eox-chart").shadowRoot.querySelector("#chart-container").classList.add("controls")}removeStartEndInputs(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#startInput"),e=document.querySelector("eox-chart").shadowRoot.querySelector("#endInput"),s=document.querySelector("eox-chart").shadowRoot.querySelector("#setTime");t&&e&&s&&(t.style.display="none",e.style.display="none",s.style.display="none")}addStartEndInputs(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#startInput");t.value=this.sdm.startTime.toISODate(),t.style.display="inline";const e=document.querySelector("eox-chart").shadowRoot.querySelector("#endInput");e.value=this.sdm.endTime.toISODate(),e.style.display="inline";const s=document.querySelector("eox-chart").shadowRoot.querySelector("#setTime");s.style.display="inline",s.addEventListener("click",()=>{const n=O.fromISO(t.value),r=O.fromISO(e.value);n.isValid&&r.isValid?this.sdm.setTimeInterval(n,r):(t.className=n.isValid?"":"parsingError",e.className=r.isValid?"":"parsingError")})}addNormalizeCheckbox(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#normalize");t.checked=this.sdmOptions.normalize,t.addEventListener("change",()=>{this.sdm.setNormalize(t.checked)})}addShowMinMax(){const t=document.querySelector("eox-chart").shadowRoot.querySelector("#showMinMax");t.checked=this.sdmOptions.showMinMax,t.addEventListener("change",()=>{this.sdm.setShowMinMax(t.checked)})}addCSVDownload(){document.querySelector("eox-chart").shadowRoot.querySelector("#csvDownload").addEventListener("click",()=>{this.sdm.triggerCSVDownload()})}generateTimeSelectionOptions(){document.querySelector("eox-chart").shadowRoot.querySelector("#dateSelect").addEventListener("change",e=>{const s=O.now(),[n,r]=e.target.value.split("-");switch(this.removeStartEndInputs(),n){case"month":this.sdm.setTimeInterval(s.minus({month:Number(r)}),s);break;case"year":this.sdm.setTimeInterval(s.minus({year:Number(r)}),s);break;case"custom":this.addStartEndInputs();break}})}generateTimeAggregationOptions(){document.querySelector("eox-chart").shadowRoot.querySelector("#aggregationSelect").addEventListener("change",e=>{const[s,n]=e.target.value.split("-");switch(s){case"none":this.sdm.setTimeAggregation(null);break;case"week":this.sdm.setTimeAggregation({week:Number(n)});break;case"month":this.sdm.setTimeAggregation({month:Number(n)});break;case"year":this.sdm.setTimeAggregation({year:Number(n)});break}})}}const Op=(i,t)=>{const e=document.querySelector("eox-chart").shadowRoot.getElementById(t);if(!e)return;let s=e.querySelector("ul");return s||(s=document.createElement("ul"),s.style.display="flex",s.style.flexDirection="column",s.style.margin=0,s.style.padding="20px",e.appendChild(s)),s},Dp={id:"htmlLegend",afterUpdate(i,t,e){const s=Op(i,e.containerID);if(!s)return;for(;s.firstChild;)s.firstChild.remove();i.options.plugins.legend.labels.generateLabels(i).sort((r,o)=>r.text<o.text?-1:1).forEach(r=>{const o=document.createElement("li");o.style.alignItems="center",o.style.cursor="pointer",o.style.display="flex",o.style.flexDirection="row",o.style.marginLeft="10px";const a=()=>{e.onClick(null,r)};o.onclick=a;const l=document.createElement("span");l.style.background=r.fillStyle,l.style.borderColor=r.strokeStyle,l.style.borderWidth=r.lineWidth+"px",l.style.display="inline-block",l.style.height="10px",l.style.marginRight="10px",l.style.width="10px";const c=document.createElement("p");c.style.color=r.fontColor,c.style.margin=0,c.style.padding=0,c.style.opacity=r.hidden?"0.5":"1",c.style.fontWeight=r.hidden?"300":"900";const h=document.createTextNode(r.text);c.appendChild(h),o.appendChild(l),o.appendChild(c),s.appendChild(o)})}},Ep=`
26
+ <style>
27
+ .hidden {
28
+ visibility: hidden;
29
+ }
30
+ .loader {
31
+ position: absolute;
32
+ top: 5px;
33
+ right: 30px;
34
+ width: 24px;
35
+ height: 24px;
36
+ border-radius: 50%;
37
+ display: inline-block;
38
+ border-top: 4px solid #000;
39
+ border-right: 4px solid transparent;
40
+ box-sizing: border-box;
41
+ animation: rotation 1s linear infinite;
42
+ }
43
+ .loader::after {
44
+ content: "";
45
+ box-sizing: border-box;
46
+ position: absolute;
47
+ left: 0;
48
+ top: 0;
49
+ width: 24px;
50
+ height: 24px;
51
+ border-radius: 50%;
52
+ border-left: 4px solid #004170;
53
+ border-bottom: 4px solid transparent;
54
+ animation: rotation 0.5s linear infinite reverse;
55
+ }
56
+ @keyframes rotation {
57
+ 0% {
58
+ transform: rotate(0deg);
59
+ }
60
+ 100% {
61
+ transform: rotate(360deg);
62
+ }
63
+ }
64
+ #controls {
65
+ position: absolute;
66
+ width: 100%;
67
+ display: none;
68
+ gap: 5px;
69
+ flex-direction: row;
70
+ }
71
+ .parsingError {
72
+ background-color: #ff6d6d;
73
+ }
74
+ #chart-container {
75
+ width: 100%; height: 100%;
76
+ }
77
+ #chart-container.controls {
78
+ padding-top: 30px;
79
+ flex-basis: 80%;
80
+ width: unset;
81
+ }
82
+ #legend-container {
83
+ flex-basis: 20%;
84
+ }
85
+ </style>
86
+ <div style="display: flex; width: 100%; height: 100%;">
87
+ <div id="controls" class="controls" data-cy="controls">
88
+ <select id="aggregationSelect">
89
+ <option value="none">no aggregation</option>
90
+ <option value="week-1">1 week</option>
91
+ <option value="week-2">2 weeks</option>
92
+ <option value="month-1">1 month</option>
93
+ <option value="month-3">3 months</option>
94
+ <option value="month-6">6 months</option>
95
+ </select>
96
+ <label for="normalize">normalize</label>
97
+ <input type="checkbox" id="normalize" value="normalize">
98
+ <label for="showMinMax">show min/max</label>
99
+ <input type="checkbox" id="showMinMax" value="showMinMax">
100
+ <button id="csvDownload">download csv</button>
101
+ <select id="dateSelect">
102
+ <option value="month-3">3 months back</option>
103
+ <option value="month-6">6 months back</option>
104
+ <option value="year-1">1 year back</option>
105
+ <option value="year-2">2 years back</option>
106
+ <option value="year-3">3 years back</option>
107
+ <option value="custom">custom</option>
108
+ </select>
109
+ <input id="startInput" size="8" style="display: none">
110
+ <input id="endInput" size="8" style="display: none">
111
+ <button id="setTime" style="display: none">ok</button>
112
+ <span id="loadingIndicator" class="loader hidden"></span>
113
+ </div>
114
+ <div id="chart-container">
115
+ <canvas id="chart" class="chart" data-cy="chart"></canvas>
116
+ </div>
117
+ <div id="legend-container" style="display: none"></div>
118
+ </div>
119
+ `,tc=document.createElement("template");tc.innerHTML=Ep;class ec extends HTMLElement{constructor(){super();_(this,"shadowRoot");_(this,"chart");_(this,"setData");_(this,"setOptions");_(this,"setSignalsData");_(this,"setSignalsEndpoint");this.shadowRoot=this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(tc.content.cloneNode(!0)),this.chart=new ut(this.shadowRoot.querySelector("canvas"),{options:{maintainAspectRatio:!1,responsive:!0},data:{labels:[],datasets:[]},plugins:[Dp,{id:"selectionLineHighlight",afterDraw:s=>{if(s&&s.tooltip){const n=s.tooltip.getActiveElements();if(n!=null&&n.length){let r=n[0].element.x,o=s.scales.y,a=s.ctx;a.save(),a.beginPath(),a.moveTo(r,o.top),a.lineTo(r,o.bottom),a.lineWidth=1,a.strokeStyle="rgba(0, 0, 255, 0.4)",a.stroke(),a.restore()}}}}]}),this.setData=s=>{this.chart.data=s,this.chart.update("none")},this.setOptions=s=>{this.chart.options=s,this.chart.update("none")},this.setSignalsData=s=>{this.chart.data={datasets:Object.entries(s).map(([n,r])=>({type:"line",label:n,data:r}))},this.chart.update("none")};let e=null;this.setSignalsEndpoint=s=>{e=new kp("signals",this.chart,s),new Tp(document.getElementById("controls"),e,s),e.setActiveFields(s.active)}}}customElements.define("eox-chart",ec),wt.EOxChart=ec,Object.defineProperty(wt,Symbol.toStringTag,{value:"Module"})});