@eox/chart 2.0.0-alpha12 → 2.0.0-alpha14

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.
@@ -1,25 +0,0 @@
1
- var tc=Object.defineProperty;var ec=(i,t,e)=>t in i?tc(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var k=(i,t,e)=>(ec(i,typeof t!="symbol"?t+"":t,e),e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function e(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=e(n);fetch(n.href,r)}})();/*!
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 Ci(i){return i+.5|0}const Xt=(i,t,e)=>Math.max(Math.min(i,e),t);function ci(i){return Xt(Ci(i*2.55),0,255)}function Qt(i){return Xt(Ci(i*255),0,255)}function Vt(i){return Xt(Ci(i/2.55)/100,0,1)}function Gn(i){return Xt(Ci(i*100),0,100)}const xt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},en=[..."0123456789ABCDEF"],ic=i=>en[i&15],sc=i=>en[(i&240)>>4]+en[i&15],zi=i=>(i&240)>>4===(i&15),nc=i=>zi(i.r)&&zi(i.g)&&zi(i.b)&&zi(i.a);function rc(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&xt[i[1]]*17,g:255&xt[i[2]]*17,b:255&xt[i[3]]*17,a:t===5?xt[i[4]]*17:255}:(t===7||t===9)&&(e={r:xt[i[1]]<<4|xt[i[2]],g:xt[i[3]]<<4|xt[i[4]],b:xt[i[5]]<<4|xt[i[6]],a:t===9?xt[i[7]]<<4|xt[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 Uo(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=Uo(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 Sn(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 kn(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Qt)}function Tn(i,t,e){return kn(Uo,i,t,e)}function dc(i,t,e){return kn(hc,i,t,e)}function fc(i,t,e){return kn(cc,i,t,e)}function Yo(i){return(i%360+360)%360}function mc(i){const t=lc.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?ci(+t[5]):Qt(+t[5]));const n=Yo(+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=Tn(n,r,o),{r:s[0],g:s[1],b:s[2],a:e}}function gc(i,t){var e=Sn(i);e[0]=Yo(e[0]+t),e=Tn(e),i.r=e[0],i.g=e[1],i.b=e[2]}function pc(i){if(!i)return;const t=Sn(i),e=t[0],s=Gn(t[1]),n=Gn(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${Vt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Jn={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"},Kn={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 bc(){const i={},t=Object.keys(Kn),e=Object.keys(Jn);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,Jn[r]);r=parseInt(Kn[o],16),i[a]=[r>>16&255,r>>8&255,r&255]}return i}let Vi;function yc(i){Vi||(Vi=bc(),Vi.transparent=[0,0,0,0]);const t=Vi[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]?ci(o):Xt(o*255,0,255)}return s=+t[1],n=+t[3],r=+t[5],s=255&(t[2]?ci(s):Xt(s,0,255)),n=255&(t[4]?ci(n):Xt(n,0,255)),r=255&(t[6]?ci(r):Xt(r,0,255)),{r:s,g:n,b:r,a:e}}}function vc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Vt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Rs=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Ce=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function wc(i,t,e){const s=Ce(Vt(i.r)),n=Ce(Vt(i.g)),r=Ce(Vt(i.b));return{r:Qt(Rs(s+e*(Ce(Vt(t.r))-s))),g:Qt(Rs(n+e*(Ce(Vt(t.g))-n))),b:Qt(Rs(r+e*(Ce(Vt(t.b))-r))),a:i.a+e*(t.a-i.a)}}function Wi(i,t,e){if(i){let s=Sn(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Tn(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function Zo(i,t){return i&&Object.assign(t||{},i)}function Qn(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=Qt(i[3]))):(t=Zo(i,{r:0,g:0,b:0,a:1}),t.a=Qt(t.a)),t}function Mc(i){return i.charAt(0)==="r"?_c(i):mc(i)}class wi{constructor(t){if(t instanceof wi)return t;const e=typeof t;let s;e==="object"?s=Qn(t):e==="string"&&(s=rc(t)||yc(t)||Mc(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=Zo(this._rgb);return t&&(t.a=Vt(t.a)),t}set rgb(t){this._rgb=Qn(t)}rgbString(){return this._valid?vc(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=wc(this._rgb,t._rgb,e)),this}clone(){return new wi(this.rgb)}alpha(t){return this._rgb.a=Qt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ci(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 Wi(this._rgb,2,t),this}darken(t){return Wi(this._rgb,2,-t),this}saturate(t){return Wi(this._rgb,1,t),this}desaturate(t){return Wi(this._rgb,1,-t),this}rotate(t){return gc(this._rgb,t),this}}/*!
7
- * Chart.js v4.2.1
8
- * https://www.chartjs.org
9
- * (c) 2023 Chart.js Contributors
10
- * Released under the MIT License
11
- */function Rt(){}const Sc=(()=>{let i=0;return()=>i++})();function F(i){return i===null||typeof i>"u"}function H(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 Z(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function mt(i,t){return Z(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,qo=(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(H(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 cs(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 hs(i){if(H(i))return i.map(hs);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]]=hs(i[e[n]]);return t}return i}function Xo(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Tc(i,t,e,s){if(!Xo(i))return;const n=t[i],r=e[i];P(n)&&P(r)?bt(n,r,s):t[i]=hs(r)}function bt(i,t,e){const s=H(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 gi(i,t){return bt(i,t,{merger:Oc})}function Oc(i,t,e){if(!Xo(i))return;const s=t[i],n=e[i];P(s)&&P(n)?gi(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=hs(n))}const tr={"":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 ee(i,t){return(tr[t]||(tr[t]=Ec(t)))(i)}function On(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Mt=i=>typeof i<"u",ie=i=>typeof i=="function",er=(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 U=Math.PI,$=2*U,Ac=$+U,us=Number.POSITIVE_INFINITY,Pc=U/180,q=U/2,ne=U/4,ir=U*2/3,Gt=Math.log10,Lt=Math.sign;function pi(i,t,e){return Math.abs(i-t)<e}function sr(i){const t=Math.round(i);i=pi(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Gt(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 Ne(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Lc(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Go(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 Dt(i){return i*(U/180)}function Dn(i){return i*(180/U)}function nr(i){if(!Z(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Jo(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*U&&(r+=$),{angle:r,distance:n}}function sn(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)%$-U}function gt(i){return(i%$+$)%$}function Mi(i,t,e,s){const n=gt(i),r=gt(t),o=gt(e),a=gt(r-n),l=gt(o-n),c=gt(n-r),h=gt(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 En(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)=>En(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)=>En(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 Ko=["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]}}),Ko.forEach(e=>{const s="_onData"+On(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 rr(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)&&(Ko.forEach(r=>{delete i[r]}),delete i._chartjs)}function Qo(i){const t=new Set;let e,s;for(e=0,s=i.length;e<s;++e)t.add(i[e]);return t.size===s?i:Array.from(t)}const ta=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function ea(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,ta.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 Cn=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 ia(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 sa(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 Bi=i=>i===0||i===1,or=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*$/e)),ar=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*$/e)+1,bi={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(U*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=>Bi(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=>Bi(i)?i:or(i,.075,.3),easeOutElastic:i=>Bi(i)?i:ar(i,.075,.3),easeInOutElastic(i){return Bi(i)?i:i<.5?.5*or(i*2,.1125,.45):.5+.5*ar(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-bi.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?bi.easeInBounce(i*2)*.5:bi.easeOutBounce(i*2-1)*.5+.5};function na(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ds(i){return na(i)?i:new wi(i)}function Ns(i){return na(i)?i:new wi(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 lr=new Map;function Yc(i,t){t=t||{};const e=i+JSON.stringify(t);let s=lr.get(e);return s||(s=new Intl.NumberFormat(i,t),lr.set(e,s)),s}function Ai(i,t,e){return Yc(t,e).format(i)}const ra={values(i){return H(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=Zc(i,e)}const o=Gt(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ai(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(Gt(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?ra.numeric.call(this,i,t,e):""}};function Zc(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 Ms={formatters:ra};function qc(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:Ms.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 ve=Object.create(null),nn=Object.create(null);function yi(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 zs(i,t,e){return typeof t=="string"?bt(yi(i,t),e):bt(yi(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)=>Ns(n.backgroundColor),this.hoverBorderColor=(s,n)=>Ns(n.borderColor),this.hoverColor=(s,n)=>Ns(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 zs(this,t,e)}get(t){return yi(this,t)}describe(t,e){return zs(nn,t,e)}override(t,e){return zs(ve,t,e)}route(t,e,s,n){const r=yi(this,t),o=yi(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 G=new Xc({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[jc,Uc,qc]);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 fs(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&&H(u)!==!0)o=fs(i,n,r,o,u);else if(H(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!H(d)&&(o=fs(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 re(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 cr(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function rn(i,t,e,s){oa(i,t,e,s,null)}function oa(i,t,e,s,n){let r,o,a,l,c,h,u,d;const f=t.pointStyle,m=t.rotation,g=t.radius;let p=(m||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(g)||g<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,g,0,0,$):i.arc(e,s,g,0,$),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(p)*h,s-Math.cos(p)*g),p+=ir,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*g),p+=ir,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,o=Math.cos(p+ne)*l,u=Math.cos(p+ne)*(n?n/2-c:l),a=Math.sin(p+ne)*l,d=Math.sin(p+ne)*(n?n/2-c:l),i.arc(e-u,s-a,c,p-U,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+U),i.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}p+=ne;case"rectRot":u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,a=Math.sin(p)*g,d=Math.sin(p)*(n?n/2:g),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+=ne;case"cross":u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,a=Math.sin(p)*g,d=Math.sin(p)*(n?n/2:g),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:g),o=Math.cos(p)*g,a=Math.sin(p)*g,d=Math.sin(p)*(n?n/2:g),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+=ne,u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,a=Math.sin(p)*g,d=Math.sin(p)*(n?n/2:g),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)*g,a=Math.sin(p)*g,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:g),s+Math.sin(p)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Si(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 Ss(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function ks(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 we(i,t,e,s,n,r={}){const o=H(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+=n.lineHeight;i.restore()}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 ki(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,U,!0),i.lineTo(e,s+r-o.bottomLeft),i.arc(e+o.bottomLeft,s+r-o.bottomLeft,o.bottomLeft,U,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 An(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 aa(i){return An(i,{top:"y",right:"x",bottom:"y",left:"x"})}function me(i){return An(i,["topLeft","topRight","bottomLeft","bottomRight"])}function ot(i){const t=aa(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Q(i,t){i=i||{},t=t||G.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 hi(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&&H(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=qo(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 se(i,t){return Object.assign(Object.create(i),t)}function Pn(i,t=[""],e=i,s,n=()=>i[0]){Mt(s)||(s=ua("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:s,_getTarget:n,override:o=>Pn([o,...i],t,e,s)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete i[0][a],!0},get(o,a){return ca(o,a,()=>gh(a,t,i,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(o,a){return ur(o).includes(a)},ownKeys(o){return ur(o)},set(o,a,l){const c=o._storage||(o._storage=n());return o[a]=c[a]=l,delete o._keys,!0}})}function ze(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:la(i,s),setContext:r=>ze(i,r,e,s),override:r=>ze(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 ca(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 la(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:ie(e)?e:()=>e,isIndexable:ie(s)?s:()=>s}}const lh=(i,t)=>i?i+On(t):t,In=(i,t)=>P(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ca(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 ie(a)&&o.isScriptable(t)&&(a=hh(t,a,i,e)),H(a)&&a.length&&(a=uh(t,a,i,o.isIndexable)),In(t,a)&&(a=ze(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);return a.add(i),t=t(r,o||s),a.delete(i),In(i,t)&&(t=Ln(n._scopes,n,i,t)),t}function uh(i,t,e,s){const{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=e;if(Mt(r.index)&&s(i))t=t[r.index%t.length];else if(P(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=Ln(c,n,i,h);t.push(ze(u,r,o&&o[i],a))}}return t}function ha(i,t,e){return ie(i)?i(t,e):i}const dh=(i,t)=>i===!0?t:typeof i=="string"?ee(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=ha(o._fallback,e,n);if(Mt(a)&&a!==e&&a!==s)return a}else if(o===!1&&Mt(s)&&e!==s)return null}return!1}function Ln(i,t,e,s){const n=t._rootScopes,r=ha(t._fallback,e,s),o=[...i,...n],a=new Set;a.add(s);let l=hr(a,o,e,r||e,s);return l===null||Mt(r)&&r!==e&&(l=hr(a,o,r,l,s),l===null)?!1:Pn(Array.from(a),[""],n,r,()=>mh(t,e,s))}function hr(i,t,e,s,n){for(;e;)e=fh(i,t,e,s,n);return e}function mh(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return H(n)&&P(e)?e:n||{}}function gh(i,t,e,s){let n;for(const r of t)if(n=ua(lh(r,i),e),Mt(n))return In(i,n)?Ln(e,s,i,n):n}function ua(i,t){for(const e of t){if(!e)continue;const s=e[i];if(Mt(s))return s}}function ur(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 da(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(ee(h,r),c)};return o}const bh=Number.EPSILON||1e-14,Ve=(i,t)=>t<i.length&&!i[t].skip&&i[t],fa=i=>i==="x"?"y":"x";function yh(i,t,e,s){const n=i.skip?t:i,r=t,o=e.skip?t:e,a=sn(r,n),l=sn(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=Ve(i,0);for(let h=0;h<s-1;++h)if(l=c,c=Ve(i,h+1),!(!l||!c)){if(pi(t[h],0,bh)){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=fa(e),n=i.length;let r,o,a,l=Ve(i,0);for(let c=0;c<n;++c){if(o=a,a=l,l=Ve(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 vh(i,t="x"){const e=fa(t),s=i.length,n=Array(s).fill(0),r=Array(s);let o,a,l,c=Ve(i,0);for(o=0;o<s;++o)if(a=l,l=c,c=Ve(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?Lt(n[o-1])!==Lt(n[o])?0:(n[o-1]+n[o])/2:n[o-1]:n[o]}xh(i,n,r),_h(i,r,t)}function Hi(i,t,e){return Math.max(Math.min(i,e),t)}function wh(i,t){let e,s,n,r,o,a=Si(i[0],t);for(e=0,s=i.length;e<s;++e)o=r,r=a,a=e<s-1&&Si(i[e+1],t),r&&(n=i[e],o&&(n.cp1x=Hi(n.cp1x,t.left,t.right),n.cp1y=Hi(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=Hi(n.cp2x,t.left,t.right),n.cp2y=Hi(n.cp2y,t.top,t.bottom)))}function Mh(i,t,e,s,n){let r,o,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")vh(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=yh(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&&wh(i,e)}function ma(){return typeof window<"u"&&typeof document<"u"}function Fn(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ms(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 Ts=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Sh(i,t){return Ts(i).getPropertyValue(t)}const kh=["top","right","bottom","left"];function ge(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 ce(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Ts(e),r=n.boxSizing==="border-box",o=ge(n,"padding"),a=ge(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:m}=t;return r&&(f-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-u)/f*e.width/s),y:Math.round((c-d)/m*e.height/s)}}function Dh(i,t,e){let s,n;if(t===void 0||e===void 0){const r=Fn(i);if(!r)t=i.clientWidth,e=i.clientHeight;else{const o=r.getBoundingClientRect(),a=Ts(r),l=ge(a,"border","width"),c=ge(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,s=ms(a.maxWidth,r,"clientWidth"),n=ms(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:s||us,maxHeight:n||us}}const $i=i=>Math.round(i*10)/10;function Eh(i,t,e,s){const n=Ts(i),r=ge(n,"margin"),o=ms(n.maxWidth,i,"clientWidth")||us,a=ms(n.maxHeight,i,"clientHeight")||us,l=Dh(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const d=ge(n,"border","width"),f=ge(n,"padding");c-=f.width+d.width,h-=f.height+d.height}return c=Math.max(0,c-r.width),h=Math.max(0,s?c/s:h-r.height),c=$i(Math.min(c,o,l.maxWidth)),h=$i(Math.min(h,a,l.maxHeight)),c&&!h&&(h=$i(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=$i(Math.floor(h*s))),{width:c,height:h}}function dr(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=Sh(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function he(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=he(i,n,e),a=he(n,r,e),l=he(r,t,e),c=he(o,a,e),h=he(a,l,e);return he(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 Fe(i,t,e){return i?Ih(t,e):Lh()}function ga(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 pa(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function ba(i){return i==="angle"?{between:Mi,compare:Fc,normalize:gt}:{between:Wt,compare:(t,e)=>t-e,normalize:t=>t}}function mr({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}=ba(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 ya(i,t,e){if(!e)return[i];const{property:s,start:n,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=ba(s),{start:h,end:u,loop:d,style:f}=Fh(i,t,e),m=[];let g=!1,p=null,b,y,v;const _=()=>l(n,v,b)&&a(n,v)!==0,x=()=>a(r,b)===0||l(r,v,b),w=()=>g||_(),M=()=>!g||x();for(let S=h,D=h;S<=u;++S)y=t[S%o],!y.skip&&(b=c(y[s]),b!==v&&(g=l(b,n,r),p===null&&w()&&(p=a(b,n)===0?S:D),p!==null&&M()&&(m.push(mr({start:p,end:S,loop:d,count:o,style:f})),p=null),D=S,v=b));return p!==null&&m.push(mr({start:p,end:u,loop:d,count:o,style:f})),m}function xa(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const r=ya(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 gr(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 gr(i,Nh(e,o,l,c),e,t)}function gr(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=pr(i.options),{_datasetIndex:o,options:{spanGaps:a}}=i,l=e.length,c=[];let h=r,u=t[0].start,d=u;function f(m,g,p,b){const y=a?-1:1;if(m!==g){for(m+=l;e[m%l].skip;)m-=y;for(;e[g%l].skip;)g+=y;m%l!==g%l&&(c.push({start:m%l,end:g%l,loop:p,style:b}),h=b,u=g%l)}}for(const m of t){u=a?u:m.start;let g=e[u%l],p;for(d=u+1;d<=m.end;d++){const b=e[d%l];p=pr(s.setContext(se(n,{type:"segment",p0:g,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),Wh(p,h)&&f(u,d-1,m.loop,h),g=b,h=p}u<d-1&&f(u,d-1,m.loop,h)}return c}function pr(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){return t&&JSON.stringify(i)!==JSON.stringify(t)}/*!
12
- * Chart.js v4.2.1
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=ta.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 Nt=new Bh;const br="transparent",Hh={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=ds(i||br),n=s.valid&&ds(t||br);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=hi([t.to,n,r,t.from]);const o=hi([t.from,r,n]);this._active=!0,this._fn=t.fn||Hh[t.type||typeof o],this._easing=bi[t.easing]||bi.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=hi([t.to,e,n,t.from]),this._from=hi([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 _a{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;const e=Object.keys(G.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];(H(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 Nt.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 Zh(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 va(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 xr(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],Z(c)&&(r||t===0||Lt(t)===Lt(c))&&(t+=c)}return t}}function qh(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 _r(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 vr(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 wr(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 m=t[f],{[l]:g,[c]:p}=m,b=m._stacks||(m._stacks={});d=b[c]=Jh(n,h,g),d[a]=p,d._top=vr(d,o,!0,s.type),d._bottom=vr(d,o,!1,s.type);const y=d._visualValues||(d._visualValues={});y[a]=p}}function Vs(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Kh(i,t){return se(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Qh(i,t,e){return se(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ei(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 Ws=i=>i==="reset"||i==="none",Mr=(i,t)=>t?i:Object.assign({},i),tu=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:va(e,!0),values:null};class Ct{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=_r(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&&ei(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(u,d,f,m)=>u==="x"?d:u==="r"?m:f,r=e.xAxisID=E(s.xAxisID,Vs(t,"x")),o=e.yAxisID=E(s.yAxisID,Vs(t,"y")),a=e.rAxisID=E(s.rAxisID,Vs(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&&rr(this._data,this),t._stacked&&ei(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(P(e))this._data=qh(e);else if(s!==e){if(s){rr(s,this);const n=this._cachedMeta;ei(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=_r(e.vScale,e),e.stack!==s.stack&&(n=!0,ei(e),e.stack=s.stack),this._resyncElements(t),(n||r!==e._stacked)&&wr(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{H(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&&wr(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,m;for(d=0,f=n;d<f;++d)m=d+s,u[d]={[a]:h||r.parse(c[m],m),[l]:o.parse(e[m],m)};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(ee(f,a),d),y:o.parse(ee(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:va(n,!0),values:e._stacks[t.axis]._visualValues};return xr(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=xr(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 m(){f=n[d];const g=f[a.axis];return!Z(f[t.axis])||h>g||u<g}for(d=0;d<o&&!(!m()&&(this.updateRangeFromParsed(c,t,f,l),r));++d);if(r){for(d=o-1;d>=0;--d)if(!m()){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],Z(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=Zh(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&&Mt(s);if(a)return Mr(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(G.elements[t]),m=()=>this.getContext(s,n,e),g=c.resolveNamedOptions(d,f,m,u);return g.$shared&&(g.$shared=l,r[o]=Object.freeze(Mr(g,l))),g}_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 _a(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||Ws(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){Ws(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Ws(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&&ei(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])}}k(Ct,"defaults",{}),k(Ct,"datasetElementType",null),k(Ct,"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=Qo(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||(Mt(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 wa(i,t,e,s){return H(i)?ru(i,t,e,s):t[e.axis]=e.parse(i,s),t}function Sr(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(wa(d,u,r,c));return l}function Bs(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function ou(i,t,e){return i!==0?Lt(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[kr(h,o,a,l)]=!0,n=c)),r[kr(n,o,a,l)]=!0,i.borderSkipped=r}function kr(i,t,e,s){return s?(i=cu(i,t,e),i=Tr(i,e,t)):i=Tr(i,t,e),i}function cu(i,t,e){return i===t?e:i===e?t:i}function Tr(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 te extends Ct{parsePrimitiveData(t,e,s,n){return Sr(t,e,s,n)}parseArrayData(t,e,s,n){return Sr(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,m,g;for(d=s,f=s+n;d<f;++d)g=e[d],m={},m[r.axis]=r.parse(ee(g,c),d),u.push(wa(ee(g,h),m,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=Bs(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 m=this.getParsed(f),g=r||F(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,h),b=(m._stacks||{})[a.axis],y={horizontal:c,base:g.base,enableBorderRadius:!b||Bs(m._custom)||o===b._top||o===b._bottom,x:c?g.head:p.center,y:c?p.center:g.head,height:c?p.size:Math.abs(g.size),width:c?Math.abs(g.size):p.size};d&&(y.options=u||this.resolveDataElementOptions(f,t[f].active?"active":n));const v=y.options||t[f].options;lu(y,v,b,o),hu(y,v,h.ratio),this.updateElement(t[f],f,y,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=Bs(c);let u=l[e.axis],d=0,f=s?this.applyStack(e,l,s):u,m,g;f!==u&&(d=f-u,f=u),h&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Lt(u)!==Lt(c.barEnd)&&(d=0),d+=u);const p=!F(r)&&!h?r:d;let b=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(d+f):m=b,g=m-b,Math.abs(g)<o){g=ou(g,e,a)*o,u===a&&(b-=g/2);const y=e.getPixelForDecimal(0),v=e.getPixelForDecimal(1),_=Math.min(y,v),x=Math.max(y,v);b=Math.max(Math.min(b,x),_),m=b+g,s&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(m)-e.getValueForPixel(b))}if(b===e.getPixelForValue(a)){const y=Lt(g)*e.getLineWidthForValue(a)/2;b+=y,g-=y}return{size:g,base:b,head:m,center:m+g/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)}}k(te,"id","bar"),k(te,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),k(te,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ss extends Ct{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],m=!r&&this.getParsed(d),g={},p=g[h]=r?o.getPixelForDecimal(.5):o.getPixelForValue(m[h]),b=g[u]=r?a.getBasePixel():a.getPixelForValue(m[u]);g.skip=isNaN(p)||isNaN(b),c&&(g.options=l||this.resolveDataElementOptions(d,f.active?"active":n),r&&(g.options.radius=0)),this.updateElement(f,d,g,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}}k(ss,"id","bubble"),k(ss,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),k(ss,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function uu(i,t,e){let s=1,n=1,r=0,o=0;if(t<$){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),f=(v,_,x)=>Mi(v,a,l,!0)?1:Math.max(_,_*e,x,x*e),m=(v,_,x)=>Mi(v,a,l,!0)?-1:Math.min(_,_*e,x,x*e),g=f(0,c,u),p=f(q,h,d),b=m(U,c,u),y=m(U+q,h,d);s=(g-b)/2,n=(p-y)/2,r=-(g+b)/2,o=-(p+y)/2}return{ratioX:s,ratioY:n,offsetX:r,offsetY:o}}class fe extends Ct{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=>+ee(s[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)n._parsed[o]=r(o)}}_getRotation(){return Dt(this.options.rotation-90)}_getCircumference(){return Dt(this.options.circumference)}_getRotationExtents(){let t=$,e=-$;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:m,offsetY:g}=uu(u,h,l),p=(s.width-o)/d,b=(s.height-o)/f,y=Math.max(Math.min(p,b)/2,0),v=qo(this.options.radius,y),_=Math.max(v*l,0),x=(v-_)/this._getVisibleDatasetWeightTotal();this.offsetX=m*v,this.offsetY=g*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/$)}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,m=d?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,n);let b=this._getRotation(),y;for(y=0;y<e;++y)b+=this._circumference(y,r);for(y=e;y<e+s;++y){const v=this._circumference(y,r),_=t[y],x={x:h+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+v,circumference:v,outerRadius:m,innerRadius:f};p&&(x.options=g||this.resolveDataElementOptions(y,_.active?"active":n)),b+=v,this.updateElement(_,y,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)?$*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],r=Ai(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}}k(fe,"id","doughnut"),k(fe,"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"}),k(fe,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"}),k(fe,"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 $t extends Ct{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}=ia(e,n,o);this._drawStart=a,this._drawCount=l,sa(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:m,segment:g}=this.options,p=Ne(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||n==="none",y=e+s,v=t.length;let _=e>0&&this.getParsed(e-1);for(let x=0;x<v;++x){const w=t[x],M=b?w:{};if(x<e||x>=y){M.skip=!0;continue}const S=this.getParsed(x),D=F(S[f]),C=M[d]=o.getPixelForValue(S[d],x),A=M[f]=r||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,S,l):S[f],x);M.skip=isNaN(C)||isNaN(A)||D,M.stop=x>0&&Math.abs(S[d]-_[d])>p,g&&(M.parsed=S,M.raw=c.data[x]),u&&(M.options=h||this.resolveDataElementOptions(x,w.active?"active":n)),b||this.updateElement(w,x,M,n),_=S}}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()}}k($t,"id","line"),k($t,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),k($t,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ft extends Ct{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=Ai(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,s,n){return da.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*U;let f=d,m;const g=360/this.countVisibleElements();for(m=0;m<e;++m)f+=this._computeAngle(m,n,g);for(m=e;m<e+s;m++){const p=t[m];let b=f,y=f+this._computeAngle(m,n,g),v=o.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;f=y,r&&(l.animateScale&&(v=0),l.animateRotate&&(b=y=d));const _={x:h,y:u,innerRadius:0,outerRadius:v,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(m,p.active?"active":n)};this.updateElement(p,m,_,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)?Dt(this.resolveDataElementOptions(t,e).angle||s):0}}k(Ft,"id","polarArea"),k(Ft,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),k(Ft,"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 on extends fe{}k(on,"id","pie"),k(on,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ns extends Ct{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 da.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)}}}k(ns,"id","radar"),k(ns,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),k(ns,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class pe extends Ct{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}=ia(e,s,n);if(this._drawStart=r,this._drawCount=o,sa(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,m=a.axis,{spanGaps:g,segment:p}=this.options,b=Ne(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||n==="none";let v=e>0&&this.getParsed(e-1);for(let _=e;_<e+s;++_){const x=t[_],w=this.getParsed(_),M=y?x:{},S=F(w[m]),D=M[f]=o.getPixelForValue(w[f],_),C=M[m]=r||S?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,w,l):w[m],_);M.skip=isNaN(D)||isNaN(C)||S,M.stop=_>0&&Math.abs(w[f]-v[f])>b,p&&(M.parsed=w,M.raw=c.data[_]),d&&(M.options=u||this.resolveDataElementOptions(_,x.active?"active":n)),y||this.updateElement(x,_,M,n),v=w}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}}k(pe,"id","scatter"),k(pe,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),k(pe,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var du=Object.freeze({__proto__:null,BarController:te,BubbleController:ss,DoughnutController:fe,LineController:$t,PolarAreaController:Ft,PieController:on,RadarController:ns,ScatterController:pe});function oe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Rn{static override(t){Object.assign(Rn.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return oe()}parse(){return oe()}format(){return oe()}add(){return oe()}diff(){return oe()}startOf(){return oe()}endOf(){return oe()}}var Ma={_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 Pi(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 m=h[f];m.skip||s(m,c,f)}}}function mu(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 Hs(i,t,e,s,n){const r=[];return!n&&!i.isPointInArea(t)||Pi(i,e,t,function(a,l,c){!n&&!Si(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function gu(i,t,e,s){let n=[];function r(o,a,l){const{startAngle:c,endAngle:h}=o.getProps(["startAngle","endAngle"],s),{angle:u}=Jo(o,{x:t.x,y:t.y});Mi(u,c,h)&&n.push({element:o,datasetIndex:a,index:l})}return Pi(i,e,t,r),n}function pu(i,t,e,s,n,r){let o=[];const a=mu(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 m=h.getCenterPoint(n);if(!(!!r||i.isPointInArea(m))&&!f)return;const p=a(t,m);p<l?(o=[{element:h,datasetIndex:u,index:d}],l=p):p===l&&o.push({element:h,datasetIndex:u,index:d})}return Pi(i,e,t,c),o}function $s(i,t,e,s,n,r){return!r&&!i.isPointInArea(t)?[]:e==="r"&&!s?gu(i,t,e,n):pu(i,t,e,s,n,r)}function Or(i,t,e,s,n){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return Pi(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 bu={evaluateInteractionItems:Pi,modes:{index(i,t,e,s){const n=ce(t,i),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Hs(i,n,r,s,o):$s(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=ce(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Hs(i,n,r,s,o):$s(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=ce(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return Hs(i,n,r,s,o)},nearest(i,t,e,s){const n=ce(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return $s(i,n,r,e.intersect,s,o)},x(i,t,e,s){const n=ce(t,i);return Or(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=ce(t,i);return Or(i,n,"y",e.intersect,s)}}};const Sa=["left","top","right","bottom"];function ii(i,t){return i.filter(e=>e.pos===t)}function Dr(i,t){return i.filter(e=>Sa.indexOf(e.pos)===-1&&e.box.axis===t)}function si(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 yu(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||!Sa.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 vu(i){const t=yu(i),e=si(t.filter(c=>c.box.fullSize),!0),s=si(ii(t,"left"),!0),n=si(ii(t,"right")),r=si(ii(t,"top"),!0),o=si(ii(t,"bottom")),a=Dr(t,"x"),l=Dr(t,"y");return{fullSize:e,leftAndTop:s.concat(r),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:ii(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:r.concat(o).concat(a)}}function Er(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function ka(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 wu(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&&ka(o,r.getPadding());const a=Math.max(0,t.outerWidth-Er(o,i,"left","right")),l=Math.max(0,t.outerHeight-Er(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 Mu(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 Su(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 ui(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,Su(a.horizontal,t));const{same:u,other:d}=wu(t,e,a,s);c|=u&&n.length,h=h||d,l.fullSize||n.push(a)}return c&&ui(n,t,e,s)||h}function ji(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 Cr(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;Mt(c.start)&&(o=c.start),l.fullSize?ji(l,n.left,o,e.outerWidth-n.right-n.left,d):ji(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;Mt(c.start)&&(r=c.start),l.fullSize?ji(l,r,n.top,d,e.outerHeight-n.bottom-n.top):ji(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=ot(i.options.layout.padding),r=Math.max(t-n.width,0),o=Math.max(e-n.height,0),a=vu(i.boxes),l=a.vertical,c=a.horizontal;z(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+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);ka(d,ot(s));const f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),m=_u(l.concat(c),u);ui(a.fullSize,f,u,m),ui(l,f,u,m),ui(c,f,u,m)&&ui(l,f,u,m),Mu(f),Cr(a.leftAndTop,f,u,m),f.x+=f.w,f.y+=f.h,Cr(a.rightAndBottom,f,u,m),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,g=>{const p=g.box;Object.assign(p,i.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Ta{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 Ta{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const rs="$chartjs",Tu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ar=i=>i===null||i==="";function Ou(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[rs]={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",Ar(n)){const r=fr(i,"width");r!==void 0&&(i.width=r)}if(Ar(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 Oa=Ch?{passive:!0}:!1;function Du(i,t,e){i.addEventListener(t,e,Oa)}function Eu(i,t,e){i.canvas.removeEventListener(t,e,Oa)}function Cu(i,t){const e=Tu[i.type]||i.type,{x:s,y:n}=ce(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function gs(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||gs(a.addedNodes,s),o=o&&!gs(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||gs(a.removedNodes,s),o=o&&!gs(a.addedNodes,s);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Ti=new Map;let Pr=0;function Da(){const i=window.devicePixelRatio;i!==Pr&&(Pr=i,Ti.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Iu(i,t){Ti.size||window.addEventListener("resize",Da),Ti.set(i,t)}function Lu(i){Ti.delete(i),Ti.size||window.removeEventListener("resize",Da)}function Fu(i,t,e){const s=i.canvas,n=s&&Fn(s);if(!n)return;const r=ea((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 js(i,t,e){e&&e.disconnect(),t==="resize"&&Lu(i)}function Ru(i,t,e){const s=i.canvas,n=ea(r=>{i.ctx!==null&&e(Cu(r,i))},i);return Du(s,t,n),n}class Nu extends Ta{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[rs])return!1;const s=e[rs].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[rs],!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:js,detach:js,resize:js}[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=Fn(t);return!!(e&&e.isConnected)}}function zu(i){return!ma()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?ku:Nu}class At{constructor(){k(this,"active",!1)}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Ne(this.x)&&Ne(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}}k(At,"defaults",{}),k(At,"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(Ui(t,c,h,F(f)?0:a-f,a),u=0,d=o-1;u<d;u++)Ui(t,c,h,r[u],r[u+1]);return Ui(t,c,h,l,F(f)?t.length:l+f),c}return Ui(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 Ui(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,Ir=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Lr=(i,t)=>Math.min(t||i,i);function Fr(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 Zu(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 ni(i){return i.drawTicks?i.tickLength:0}function Rr(i,t){if(!i.display)return 0;const e=Q(i.font,t),s=ot(i.padding);return(H(i.text)?i.text.length:1)*e.lineHeight+s.height}function qu(i,t){return se(i,{scale:t,type:"scale"})}function Xu(i,t,e){return se(i,{tick:e,index:t,type:"tick"})}function Gu(i,t,e){let s=Cn(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,m;const g=o-n,p=a-r;if(i.isHorizontal()){if(f=st(s,r,a),P(e)){const b=Object.keys(e)[0],y=e[b];m=h[b].getPixelForValue(y)+g-t}else e==="center"?m=(c.bottom+c.top)/2+g-t:m=Ir(i,e,t);d=a-r}else{if(P(e)){const b=Object.keys(e)[0],y=e[b];f=h[b].getPixelForValue(y)-p+t}else e==="center"?f=(c.left+c.right)/2-p+t:f=Ir(i,e,t);m=st(s,o,n),u=e==="left"?-q:q}return{titleX:f,titleY:m,maxWidth:d,rotation:u}}class Se extends At{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:Z(t),maxDefined:Z(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?Fr(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=Lr(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-ni(t.grid)-e.padding-Rr(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=Dn(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=Rr(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=ni(r)+l):(t.height=this.maxHeight,t.width=ni(r)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=s.padding*2,m=Dt(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){const b=s.mirror?0:p*u.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:g*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,p,g)}}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=Fr(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/Lr(e,s));let c=0,h=0,u,d,f,m,g,p,b,y,v,_,x;for(u=0;u<e;u+=l){if(m=t[u].label,g=this._resolveTickFontOptions(u),n.font=p=g.string,b=r[p]=r[p]||{data:{},gc:[]},y=g.lineHeight,v=_=0,!F(m)&&!H(m))v=fs(n,b.data,b.gc,v,m),_=y;else if(H(m))for(d=0,f=m.length;d<f;++d)x=m[d],!F(x)&&!H(x)&&(v=fs(n,b.data,b.gc,v,x),_+=y);o.push(v),a.push(_),c=Math.max(v,c),h=Math.max(_,h)}Zu(r,e);const w=o.indexOf(c),M=a.indexOf(h),S=D=>({width:o[D]||0,height:a[D]||0});return{first:S(0),last:S(e-1),widest:S(w),highest:S(M),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?re(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=qu(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Dt(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=ni(r),f=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,p=g/2,b=function(j){return re(s,j,g)};let y,v,_,x,w,M,S,D,C,A,R,et;if(o==="top")y=b(this.bottom),M=this.bottom-d,D=y-p,A=b(t.top)+p,et=t.bottom;else if(o==="bottom")y=b(this.top),A=t.top,et=b(t.bottom)-p,M=y+p,D=this.top+d;else if(o==="left")y=b(this.right),w=this.right-d,S=y-p,C=b(t.left)+p,R=t.right;else if(o==="right")y=b(this.left),C=t.left,R=b(t.right)-p,w=y+p,S=this.left+d;else if(e==="x"){if(o==="center")y=b((t.top+t.bottom)/2+.5);else if(P(o)){const j=Object.keys(o)[0],X=o[j];y=b(this.chart.scales[j].getPixelForValue(X))}A=t.top,et=t.bottom,M=y+p,D=M+d}else if(e==="y"){if(o==="center")y=b((t.left+t.right)/2);else if(P(o)){const j=Object.keys(o)[0],X=o[j];y=b(this.chart.scales[j].getPixelForValue(X))}w=y-p,S=w-d,C=t.left,R=t.right}const ft=E(n.ticks.maxTicksLimit,u),V=Math.max(1,Math.ceil(u/ft));for(v=0;v<u;v+=V){const j=this.getContext(v),X=r.setContext(j),kt=a.setContext(j),it=X.lineWidth,De=X.color,Ni=kt.dash||[],Ee=kt.dashOffset,Je=X.tickWidth,Ke=X.tickColor,Qe=X.tickBorderDash||[],ti=X.tickBorderDashOffset;_=Yu(this,v,l),_!==void 0&&(x=re(s,_,it),c?w=S=C=R=x:M=D=A=et=x,f.push({tx1:w,ty1:M,tx2:S,ty2:D,x1:C,y1:A,x2:R,y2:et,width:it,color:De,borderDash:Ni,borderDashOffset:Ee,tickWidth:Je,tickColor:Ke,tickBorderDash:Qe,tickBorderDashOffset:ti}))}return this._ticksLength=u,this._borderValue=y,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=ni(s.grid),f=d+h,m=u?-h:f,g=-Dt(this.labelRotation),p=[];let b,y,v,_,x,w,M,S,D,C,A,R,et="middle";if(n==="top")w=this.bottom-m,M=this._getXAxisLabelAlignment();else if(n==="bottom")w=this.top+m,M=this._getXAxisLabelAlignment();else if(n==="left"){const V=this._getYAxisLabelAlignment(d);M=V.textAlign,x=V.x}else if(n==="right"){const V=this._getYAxisLabelAlignment(d);M=V.textAlign,x=V.x}else if(e==="x"){if(n==="center")w=(t.top+t.bottom)/2+f;else if(P(n)){const V=Object.keys(n)[0],j=n[V];w=this.chart.scales[V].getPixelForValue(j)+f}M=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],j=n[V];x=this.chart.scales[V].getPixelForValue(j)}M=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?et="top":l==="end"&&(et="bottom"));const ft=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){v=a[b],_=v.label;const V=r.setContext(this.getContext(b));S=this.getPixelForTick(b)+r.labelOffset,D=this._resolveTickFontOptions(b),C=D.lineHeight,A=H(_)?_.length:1;const j=A/2,X=V.color,kt=V.textStrokeColor,it=V.textStrokeWidth;let De=M;o?(x=S,M==="inner"&&(b===y-1?De=this.options.reverse?"left":"right":b===0?De=this.options.reverse?"right":"left":De="center"),n==="top"?c==="near"||g!==0?R=-A*C+C/2:c==="center"?R=-ft.highest.height/2-j*C+C:R=-ft.highest.height+C/2:c==="near"||g!==0?R=C/2:c==="center"?R=ft.highest.height/2-j*C:R=ft.highest.height-A*C,u&&(R*=-1),g!==0&&!V.showLabelBackdrop&&(x+=C/2*Math.sin(g))):(w=S,R=(1-A)*C/2);let Ni;if(V.showLabelBackdrop){const Ee=ot(V.backdropPadding),Je=ft.heights[b],Ke=ft.widths[b];let Qe=R-Ee.top,ti=0-Ee.left;switch(et){case"middle":Qe-=Je/2;break;case"bottom":Qe-=Je;break}switch(M){case"center":ti-=Ke/2;break;case"right":ti-=Ke;break}Ni={left:ti,top:Qe,width:Ke+Ee.width,height:Je+Ee.height,color:V.backdropColor}}p.push({label:_,font:D,textOffset:R,options:{rotation:g,color:X,strokeColor:kt,strokeWidth:it,textAlign:De,textBaseline:et,translation:[x,w],backdrop:Ni}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Dt(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=re(t,this.left,o)-o/2,h=re(t,this.right,a)+a/2,u=d=l):(u=re(t,this.top,o)-o/2,d=re(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&&Ss(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;we(s,c,0,h,l,a)}n&&ks(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const r=Q(s.font),o=ot(s.padding),a=s.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||P(e)?(l+=o.bottom,H(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);we(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!==Se.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 Yi{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&&G.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 G[n]&&(delete G[n][s],this.override&&delete ve[s])}}function Ku(i,t,e){const s=bt(Object.create(null),[e?G.get(e):{},G.get(t),i.defaults]);G.set(t,s),i.defaultRoutes&&Qu(t,i.defaultRoutes),i.descriptors&&G.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(".");G.route(r,n,l,a)})}function td(i){return"id"in i&&"defaults"in i}class ed{constructor(){this.controllers=new Yi(Ct,"datasets",!0),this.elements=new Yi(At,"elements"),this.plugins=new Yi(Object,"plugins"),this.scales=new Yi(Se,"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=On(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 at=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(at.plugins.items);for(let r=0;r<s.length;r++)e.push(at.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 an(i,t){const e=G.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 cd(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function ps(i,t){if(i==="x"||i==="y"||i==="r"||(i=t.axis||cd(t.position)||i.length>1&&ps(i[0].toLowerCase(),t),i))return i;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function hd(i,t){const e=ve[i.type]||{scales:{}},s=t.scales||{},n=an(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=ps(o,a),c=ld(l,n),h=e.scales||{};r[o]=gi(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(o=>{const a=o.type||i.type,l=o.indexAxis||an(a,t),h=(ve[a]||{}).scales||{};Object.keys(h).forEach(u=>{const d=ad(u,l),f=o[d+"AxisID"]||d;r[f]=r[f]||Object.create(null),gi(r[f],[{axis:d},s[f],h[u]])})}),Object.keys(r).forEach(o=>{const a=r[o];gi(a,[G.scales[a.type],G.scale])}),r}function Ea(i){const t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=hd(i,t)}function Ca(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function ud(i){return i=i||{},i.data=Ca(i.data),Ea(i),i}const Nr=new Map,Aa=new Set;function Zi(i,t){let e=Nr.get(i);return e||(e=t(),Nr.set(i,e),Aa.add(e)),e}const ri=(i,t,e)=>{const s=ee(t,e);s!==void 0&&i.add(s)};class dd{constructor(t){this._config=ud(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ca(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(),Ea(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Zi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Zi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return Zi(`${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=>ri(l,t,u))),h.forEach(u=>ri(l,n,u)),h.forEach(u=>ri(l,ve[r]||{},u)),h.forEach(u=>ri(l,G,u)),h.forEach(u=>ri(l,nn,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Aa.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,ve[e]||{},G.datasets[e]||{},{type:e},G,nn]}resolveNamedOptions(t,e,s,n=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=zr(this._resolverCache,t,n);let l=o;if(md(o,e)){r.$shared=!1,s=ie(s)?s():s;const c=this.createResolver(t,s,a);l=ze(o,s,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,s=[""],n){const{resolver:r}=zr(this._resolverCache,t,s);return P(e)?ze(r,e,void 0,n):r}}function zr(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:Pn(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,r)),r}const fd=i=>P(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||ie(i[e]),!1);function md(i,t){const{isScriptable:e,isIndexable:s}=la(i);for(const n of t){const r=e(n),o=s(n),a=(o||r)&&i[n];if(r&&(ie(a)||fd(a))||o&&H(a))return!0}return!1}var gd="4.2.1";const pd=["top","bottom","left","right","chartArea"];function Vr(i,t){return i==="top"||i==="bottom"||pd.indexOf(i)===-1&&t==="x"}function Wr(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Br(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 Pa(i){return ma()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const os={},Hr=i=>{const t=Pa(i);return Object.values(os).filter(e=>e.canvas===t).pop()};function yd(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 xd(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function _d(i){const{xScale:t,yScale:e}=i;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}class ht{static register(...t){at.add(...t),$r()}static unregister(...t){at.remove(...t),$r()}constructor(t,e){const s=this.config=new dd(e),n=Pa(t),r=Hr(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=Sc(),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}Nt.listen(this,"complete",Br),Nt.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 at}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():dr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return cr(this.canvas,this.ctx),this}stop(){return Nt.stop(this),this}resize(t,e){Nt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){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,dr(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=ps(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=ps(l,a),h=E(a.type,o.dtype);(a.position===void 0||Vr(a.position,c)!==Vr(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=at.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(Wr("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||an(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=at.getController(a),{datasetElementType:c,dataElementType:h}=G.datasets[a];Object.assign(l,{dataElementType:at.getElement(h),datasetElementType:c&&at.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(Wr("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);(!er(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;yd(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(!er(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,ie(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&&(Nt.has(this)?this.attached&&!Nt.running(this)&&Nt.start(this):(this.draw(),Br({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=_d(t)||this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(n&&Ss(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&&ks(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Si(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const r=bu.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=se(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);Mt(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(),Nt.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(),cr(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}});!cs(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=xd(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=!cs(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)}}k(ht,"defaults",G),k(ht,"instances",os),k(ht,"overrides",ve),k(ht,"registry",at),k(ht,"version",gd),k(ht,"getChart",Hr);function $r(){return z(ht.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 wd(i){return An(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Md(i,t,e,s){const n=wd(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 Ae(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function bs(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 m=n-l;if(s){const V=h>0?h-s:0,j=u>0?u-s:0,X=(V+j)/2,kt=X!==0?m*X/(X+s):m;f=(m-kt)/2}const g=Math.max(.001,m*u-e/U)/u,p=(m-g)/2,b=l+p+f,y=n-p-f,{outerStart:v,outerEnd:_,innerStart:x,innerEnd:w}=Md(t,d,u,y-b),M=u-v,S=u-_,D=b+v/M,C=y-_/S,A=d+x,R=d+w,et=b+x/A,ft=y-w/R;if(i.beginPath(),r){const V=(D+C)/2;if(i.arc(o,a,u,D,V),i.arc(o,a,u,V,C),_>0){const it=Ae(S,C,o,a);i.arc(it.x,it.y,_,C,y+q)}const j=Ae(R,y,o,a);if(i.lineTo(j.x,j.y),w>0){const it=Ae(R,ft,o,a);i.arc(it.x,it.y,w,y+q,ft+Math.PI)}const X=(y-w/d+(b+x/d))/2;if(i.arc(o,a,d,y-w/d,X,!0),i.arc(o,a,d,X,b+x/d,!0),x>0){const it=Ae(A,et,o,a);i.arc(it.x,it.y,x,et+Math.PI,b-q)}const kt=Ae(M,b,o,a);if(i.lineTo(kt.x,kt.y),v>0){const it=Ae(M,D,o,a);i.arc(it.x,it.y,v,b-q,D)}}else{i.moveTo(o,a);const V=Math.cos(D)*u+o,j=Math.sin(D)*u+a;i.lineTo(V,j);const X=Math.cos(C)*u+o,kt=Math.sin(C)*u+a;i.lineTo(X,kt)}i.closePath()}function Sd(i,t,e,s,n){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){bs(i,t,e,s,l,n);for(let c=0;c<r;++c)i.fill();isNaN(a)||(l=o+(a%$||$))}return bs(i,t,e,s,l,n),i.fill(),l}function kd(i,t,e,s,n){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,u=l.borderAlign==="inner";if(!c)return;u?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let d=t.endAngle;if(r){bs(i,t,e,s,d,n);for(let f=0;f<r;++f)i.stroke();isNaN(a)||(d=o+(a%$||$))}u&&vd(i,t,d),r||(bs(i,t,e,s,d,n),i.stroke())}class be extends At{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,s){const n=this.getProps(["x","y"],s),{angle:r,distance:o}=Jo(n,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),d=this.options.spacing/2,m=E(u,l-a)>=$||Mi(r,a,l),g=Wt(o,c+d,h+d);return m&&g}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(n+r)/2,u=(o+a+c+l)/2;return{x:e+Math.cos(h)*u,y:s+Math.sin(h)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:s}=this,n=(e.offset||0)/4,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>$?Math.floor(s/$):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*n,Math.sin(a)*n);const l=1-Math.sin(Math.min(U,s||0)),c=n*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,Sd(t,this,c,r,o),kd(t,this,c,r,o),t.restore()}}k(be,"id","arc"),k(be,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),k(be,"defaultRoutes",{backgroundColor:"backgroundColor"});function Ia(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 Td(i,t,e){i.lineTo(e.x,e.y)}function Od(i){return i.stepped?Kc:i.tension||i.cubicInterpolationMode==="monotone"?Qc:Td}function La(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 Dd(i,t,e,s){const{points:n,options:r}=t,{count:o,start:a,loop:l,ilen:c}=La(n,e,s),h=Od(r);let{move:u=!0,reverse:d}=s||{},f,m,g;for(f=0;f<=c;++f)m=n[(a+(d?c-f:f))%o],!m.skip&&(u?(i.moveTo(m.x,m.y),u=!1):h(i,g,m,d,r.stepped),g=m);return l&&(m=n[(a+(d?c:0))%o],h(i,g,m,d,r.stepped)),!!l}function Ed(i,t,e,s){const n=t.points,{count:r,start:o,ilen:a}=La(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,u=0,d,f,m,g,p,b;const y=_=>(o+(c?a-_:_))%r,v=()=>{g!==p&&(i.lineTo(h,p),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(f=n[y(0)],i.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=n[y(d)],f.skip)continue;const _=f.x,x=f.y,w=_|0;w===m?(x<g?g=x:x>p&&(p=x),h=(u*h+_)/++u):(v(),i.lineTo(_,x),m=w,u=0,g=p=x),b=x}v()}function ln(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ed:Dd}function Cd(i){return i.stepped?Ah:i.tension||i.cubicInterpolationMode==="monotone"?Ph:he}function Ad(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Ia(i,t.options),i.stroke(n)}function Pd(i,t,e,s){const{segments:n,options:r}=t,o=ln(t);for(const a of n)Ia(i,r,a.style),i.beginPath(),o(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Id=typeof Path2D=="function";function Ld(i,t,e,s){Id&&!t.options.segment?Ad(i,t,e,s):Pd(i,t,e,s)}class Jt extends At{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;Mh(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=xa(this,{property:e,start:n,end:n});if(!o.length)return;const a=[],l=Cd(s);let c,h;for(c=0,h=o.length;c<h;++c){const{start:u,end:d}=o[c],f=r[u],m=r[d];if(f===m){a.push(f);continue}const g=Math.abs((n-f[e])/(m[e]-f[e])),p=l(f,m,g,s.stepped);p[e]=t[e],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,e,s){return ln(this)(t,this,e,s)}path(t,e,s){const n=this.segments,r=ln(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(),Ld(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}k(Jt,"id","line"),k(Jt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),k(Jt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),k(Jt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function jr(i,t,e,s){const n=i.options,{[e]:r}=i.getProps([e],s);return Math.abs(t-r)<n.radius+n.hitRadius}class ye extends At{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,s){const n=this.options,{x:r,y:o}=this.getProps(["x","y"],s);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return jr(this,t,"x",e)}inYRange(t,e){return jr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const s=e&&t.borderWidth||0;return(e+s)*2}draw(t,e){const s=this.options;this.skip||s.radius<.1||!Si(this,e,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,rn(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}k(ye,"id","point"),k(ye,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),k(ye,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Fa(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 Kt(i,t,e,s){return i?0:tt(t,e,s)}function Fd(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,r=aa(s);return{t:Kt(n.top,r.top,0,e),r:Kt(n.right,r.right,0,t),b:Kt(n.bottom,r.bottom,0,e),l:Kt(n.left,r.left,0,t)}}function Rd(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,r=me(n),o=Math.min(t,e),a=i.borderSkipped,l=s||P(n);return{topLeft:Kt(!l||a.top||a.left,r.topLeft,0,o),topRight:Kt(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Kt(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Kt(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Nd(i){const t=Fa(i),e=t.right-t.left,s=t.bottom-t.top,n=Fd(i,e/2,s/2),r=Rd(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 Us(i,t,e,s){const n=t===null,r=e===null,a=i&&!(n&&r)&&Fa(i,s);return a&&(n||Wt(t,a.left,a.right))&&(r||Wt(e,a.top,a.bottom))}function zd(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Vd(i,t){i.rect(t.x,t.y,t.w,t.h)}function Ys(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 xe extends At{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}=Nd(this),a=zd(o.radius)?ki:Vd;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,Ys(o,e,r)),t.clip(),a(t,Ys(r,-e,o)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,Ys(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return Us(this,t,e,s)}inXRange(t,e){return Us(this,t,null,e)}inYRange(t,e){return Us(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}}k(xe,"id","bar"),k(xe,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),k(xe,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Wd=Object.freeze({__proto__:null,ArcElement:be,LineElement:Jt,PointElement:ye,BarElement:xe});const cn=["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)"],Ur=cn.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ra(i){return cn[i%cn.length]}function Na(i){return Ur[i%Ur.length]}function Bd(i,t){return i.borderColor=Ra(t),i.backgroundColor=Na(t),++t}function Hd(i,t){return i.backgroundColor=i.data.map(()=>Ra(t++)),t}function $d(i,t){return i.backgroundColor=i.data.map(()=>Na(t++)),t}function jd(i){let t=0;return(e,s)=>{const n=i.getDatasetMeta(s).controller;n instanceof fe?t=Hd(e,t):n instanceof Ft?t=$d(e,t):n&&(t=Bd(e,t))}}function Yr(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function Ud(i){return i&&(i.borderColor||i.backgroundColor)}var Yd={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&&(Yr(s)||Ud(n)||r&&Yr(r)))return;const o=jd(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,m,g;for(o[l++]=i[h],u=0;u<r-2;u++){let p=0,b=0,y;const v=Math.floor((u+1)*a)+1+t,_=Math.min(Math.floor((u+2)*a)+1,e)+t,x=_-v;for(y=v;y<_;y++)p+=i[y].x,b+=i[y].y;p/=x,b/=x;const w=Math.floor(u*a)+1+t,M=Math.min(Math.floor((u+1)*a)+1,e)+t,{x:S,y:D}=i[h];for(f=m=-1,y=w;y<M;y++)m=.5*Math.abs((S-p)*(i[y].y-D)-(S-i[y].x)*(b-D)),m>f&&(f=m,d=i[y],g=y);o[l++]=d,h=g}return o[l++]=i[c],o}function qd(i,t,e,s){let n=0,r=0,o,a,l,c,h,u,d,f,m,g;const p=[],b=t+e-1,y=i[t].x,_=i[b].x-y;for(o=t;o<t+e;++o){a=i[o],l=(a.x-y)/_*s,c=a.y;const x=l|0;if(x===h)c<m?(m=c,u=o):c>g&&(g=c,d=o),n=(r*n+a.x)/++r;else{const w=o-1;if(!F(u)&&!F(d)){const M=Math.min(u,d),S=Math.max(u,d);M!==f&&M!==w&&p.push({...i[M],x:n}),S!==f&&S!==w&&p.push({...i[S],x:n})}o>0&&w!==f&&p.push(i[w]),p.push(a),h=x,r=0,m=g=c,u=d=f=o}}return p}function za(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 Zr(i){i.data.datasets.forEach(t=>{za(t)})}function Xd(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 Gd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){Zr(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(hi([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}=Xd(l,c);const f=e.threshold||4*s;if(d<=f){za(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(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=Zd(c,u,d,s,e);break;case"min-max":m=qd(c,u,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=m})},destroy(i){Zr(i)}};function Jd(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=Nn(l,c,n);const h=hn(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=xa(t,h);for(const d of u){const f=hn(e,r[d.start],r[d.end],d.loop),m=ya(a,n,f);for(const g of m)o.push({source:g,target:d,start:{[e]:qr(h,f,"start",Math.max)},end:{[e]:qr(h,f,"end",Math.min)}})}}return o}function hn(i,t,e,s){if(s)return;let n=t[i],r=e[i];return i==="angle"&&(n=gt(n),r=gt(r)),{property:i,start:n,end:r}}function Kd(i,t){const{x:e=null,y:s=null}=i||{},n=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Nn(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 Nn(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function qr(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function Va(i,t){let e=[],s=!1;return H(i)?(s=!0,e=i):e=Kd(i,t),e.length?new Jt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Xr(i){return i&&i.fill!==!1}function Qd(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(!Z(n))return n;if(o=i[n],!o)return!1;if(o.visible)return n;r.push(n),n=o.fill}return!1}function tf(i,t,e){const s=rf(i);if(P(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return Z(n)&&Math.floor(n)===n?ef(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function ef(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function sf(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 nf(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 rf(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 of(i){const{scale:t,index:e,line:s}=i,n=[],r=s.segments,o=s.points,a=af(t,e);a.push(Va({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++)lf(n,o[h],a)}return new Jt({points:n,options:{}})}function af(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 lf(i,t,e){const s=[];for(let n=0;n<e.length;n++){const r=e[n],{first:o,last:a,point:l}=cf(r,t,"x");if(!(!l||o&&a)){if(o)s.unshift(l);else if(i.push(l),!a)break}}i.push(...s)}function cf(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 Wa{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:$},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 hf(i){const{chart:t,fill:e,line:s}=i;if(Z(e))return uf(t,e);if(e==="stack")return of(i);if(e==="shape")return!0;const n=df(i);return n instanceof Wa?n:Va(n,s)}function uf(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function df(i){return(i.scale||{}).getPointPositionForValue?mf(i):ff(i)}function ff(i){const{scale:t={},fill:e}=i,s=sf(e,t);if(Z(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=nf(e,t,r),a=[];if(s.grid.circular){const l=t.getPointPositionForValue(0,r);return new Wa({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 Zs(i,t,e){const s=hf(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&&(Ss(i,e),gf(i,{line:n,target:s,above:h,below:u,area:e,scale:r,axis:o}),ks(i))}function gf(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&&(Gr(i,s,o.top),Jr(i,{line:e,target:s,color:n,scale:a,property:l}),i.restore(),i.save(),Gr(i,s,o.bottom)),Jr(i,{line:e,target:s,color:r,scale:a,property:l}),i.restore()}function Gr(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[Nn(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 Jr(i,t){const{line:e,target:s,property:n,color:r,scale:o}=t,a=Jd(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,pf(i,o,f&&hn(n,h,u)),i.beginPath();const m=!!e.pathSegment(i,l);let g;if(f){m?i.closePath():Kr(i,s,u,n);const p=!!s.pathSegment(i,c,{move:m,reverse:!0});g=m&&p,g||Kr(i,s,h,n)}i.closePath(),i.fill(g?"evenodd":"nonzero"),i.restore()}}function pf(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 Kr(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 Jt&&(l={visible:i.isDatasetVisible(o),index:o,fill:tf(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=Qd(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&&Zs(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;Xr(r)&&Zs(i.ctx,r,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Xr(s)||e.drawTime!=="beforeDatasetDraw"||Zs(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Qr=(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)}},yf=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class to extends At{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}=Qr(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((m,g)=>{const p=s+e/2+r.measureText(m.text).width;(g===0||c[c.length-1]+p+2*a>o)&&(u+=h,c[c.length-(g>0?0:1)]=0,f+=h,d++),l[g]={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,m=0,g=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:y,itemHeight:v}=xf(s,e,r,p,n);b>0&&f+v+2*a>h&&(u+=d+a,c.push({width:d,height:f}),m+=d+a,g++,d=f=0),l[b]={left:m,top:f,col:g,width:y,height:v},d=Math.max(d,y),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=Fe(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;Ss(t,this),this._draw(),ks(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:r,labels:o}=t,a=G.color,l=Fe(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:m,boxHeight:g,itemHeight:p}=Qr(o,u),b=function(w,M,S){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;n.save();const D=E(S.lineWidth,1);if(n.fillStyle=E(S.fillStyle,a),n.lineCap=E(S.lineCap,"butt"),n.lineDashOffset=E(S.lineDashOffset,0),n.lineJoin=E(S.lineJoin,"miter"),n.lineWidth=D,n.strokeStyle=E(S.strokeStyle,a),n.setLineDash(E(S.lineDash,[])),o.usePointStyle){const C={radius:g*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:D},A=l.xPlus(w,m/2),R=M+d;oa(n,C,A,R,o.pointStyleWidth&&m)}else{const C=M+Math.max((u-g)/2,0),A=l.leftForLtr(w,m),R=me(S.borderRadius);n.beginPath(),Object.values(R).some(et=>et!==0)?ki(n,{x:A,y:C,w:m,h:g,radius:R}):n.rect(A,C,m,g),n.fill(),D!==0&&n.stroke()}n.restore()},y=function(w,M,S){we(n,S.text,w,M+p/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},v=this.isHorizontal(),_=this._computeTitleHeight();v?f={x:st(r,this.left+h,this.right-s[0]),y:this.top+h+_,line:0}:f={x:this.left+h,y:st(r,this.top+_+h,this.bottom-e[0].height),line:0},ga(this.ctx,t.textDirection);const x=p+h;this.legendItems.forEach((w,M)=>{n.strokeStyle=w.fontColor,n.fillStyle=w.fontColor;const S=n.measureText(w.text).width,D=l.textAlign(w.textAlign||(w.textAlign=o.textAlign)),C=m+d+S;let A=f.x,R=f.y;l.setWidth(this.width),v?M>0&&A+C+h>this.right&&(R=f.y+=x,f.line++,A=f.x=st(r,this.left+h,this.right-s[f.line])):M>0&&R+x>this.bottom&&(A=f.x=A+e[f.line].width+h,f.line++,R=f.y=st(r,this.top+_+h,this.bottom-e[f.line].height));const et=l.x(A);if(b(et,R,w),A=Bc(D,A+m+d,v?A+C:this.right,t.rtl),y(l.x(A),R,w),v)f.x+=C+h;else if(typeof w.text!="string"){const ft=c.lineHeight;f.y+=Ba(w,ft)}else f.y+=x}),pa(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=Q(e.font),n=ot(e.padding);if(!e.display)return;const r=Fe(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 m=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);h=c+st(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const f=st(a,u,u+d);o.textAlign=r.textAlign(Cn(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=s.string,we(o,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=Q(t.font),s=ot(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(!wf(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,r=yf(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 xf(i,t,e,s,n){const r=_f(s,i,t,e),o=vf(n,s,t.lineHeight);return{itemWidth:r,itemHeight:o}}function _f(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=Ba(t,e)),s}function Ba(i,t){const e=i.text?i.text.length+.5:0;return t*e}function wf(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Mf={id:"legend",_element:to,start(i,t,e){const s=i.legend=new to({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=ot(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 zn extends At{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=H(s.text)?s.text.length:1;this._padding=ot(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=U*-.5):(h=r-t,u=st(a,e,n),l=U*.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);we(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:Cn(e.align),textBaseline:"middle",translation:[o,a]})}}function Sf(i,t){const e=new zn({ctx:i.ctx,options:t,chart:i});rt.configure(i,e,t),rt.addBox(i,e),i.titleBlock=e}var kf={id:"title",_element:zn,start(i,t,e){Sf(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 qi=new WeakMap;var Tf={id:"subtitle",start(i,t,e){const s=new zn({ctx:i.ctx,options:e,chart:i});rt.configure(i,s,e),rt.addBox(i,s),qi.set(i,s)},stop(i){rt.removeBox(i,qi.get(i)),qi.delete(i)},beforeUpdate(i,t,e){const s=qi.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 di={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=sn(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 It(i,t){return t&&(H(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function zt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
17
- `)>-1?i.split(`
18
- `):i}function Of(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 eo(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,m=ot(t.padding);let g=m.height,p=0,b=s.reduce((_,x)=>_+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*_+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(g+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let y=0;const v=function(_){p=Math.max(p,e.measureText(_).width+y)};return e.save(),e.font=c.string,z(i.title,v),e.font=l.string,z(i.beforeBody.concat(i.afterBody),v),y=t.displayColors?o+2+t.boxPadding:0,z(s,_=>{z(_.before,v),z(_.lines,v),z(_.after,v)}),y=0,e.font=h.string,z(i.footer,v),e.restore(),p+=m.width,{width:p,height:g}}function Df(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Ef(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 Cf(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"),Ef(c,i,t,e)&&(c="center"),c}function io(i,t,e){const s=e.yAlign||t.yAlign||Df(i,e);return{xAlign:e.xAlign||t.xAlign||Cf(i,t,e,s),yAlign:s}}function Af(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Pf(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function so(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}=me(o);let m=Af(t,a);const g=Pf(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(h,d)+n:a==="right"&&(m+=Math.max(u,f)+n),{x:tt(m,0,s.width-t.width),y:tt(g,0,s.height-t.height)}}function Xi(i,t,e){const s=ot(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function no(i){return It([],zt(i))}function If(i,t,e){return se(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ro(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Ha={beforeTitle:Rt,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:Rt,beforeBody:Rt,beforeLabel:Rt,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:Rt,afterBody:Rt,beforeFooter:Rt,footer:Rt,afterFooter:Rt};function ct(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?Ha[t].call(e,s):n}class un extends At{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 _a(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=If(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=ct(s,"beforeTitle",this,t),r=ct(s,"title",this,t),o=ct(s,"afterTitle",this,t);let a=[];return a=It(a,zt(n)),a=It(a,zt(r)),a=It(a,zt(o)),a}getBeforeBody(t,e){return no(ct(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return z(t,r=>{const o={before:[],lines:[],after:[]},a=ro(s,r);It(o.before,zt(ct(a,"beforeLabel",this,r))),It(o.lines,ct(a,"label",this,r)),It(o.after,zt(ct(a,"afterLabel",this,r))),n.push(o)}),n}getAfterBody(t,e){return no(ct(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=ct(s,"beforeFooter",this,t),r=ct(s,"footer",this,t),o=ct(s,"afterFooter",this,t);let a=[];return a=It(a,zt(n)),a=It(a,zt(r)),a=It(a,zt(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(Of(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=ro(t.callbacks,h);n.push(ct(u,"labelColor",this,h)),r.push(ct(u,"labelPointStyle",this,h)),o.push(ct(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=di[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=eo(this,s),c=Object.assign({},a,l),h=io(this.chart,s,c),u=so(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}=me(a),{x:d,y:f}=t,{width:m,height:g}=e;let p,b,y,v,_,x;return r==="center"?(_=f+g/2,n==="left"?(p=d,b=p-o,v=_+o,x=_-o):(p=d+m,b=p+o,v=_-o,x=_+o),y=p):(n==="left"?b=d+Math.max(l,h)+o:n==="right"?b=d+m-Math.max(c,u)-o:b=this.caretX,r==="top"?(v=f,_=v-o,p=b-o,y=b+o):(v=f+g,_=v+o,p=b+o,y=b-o),x=v),{x1:p,x2:b,x3:y,y1:v,y2:_,y3:x}}drawTitle(t,e,s){const n=this.title,r=n.length;let o,a,l;if(r){const c=Fe(s.rtl,this.x,this.width);for(t.x=Xi(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,boxPadding:h}=r,u=Q(r.bodyFont),d=Xi(this,"left",r),f=n.x(d),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+m;if(r.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=n.leftForLtr(f,c)+c/2,y=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,rn(t,p,b,y),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,rn(t,p,b,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 p=n.leftForLtr(f,c-h),b=n.leftForLtr(n.xPlus(f,1),c-h-2),y=me(o.borderRadius);Object.values(y).some(v=>v!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ki(t,{x:p,y:g,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ki(t,{x:b,y:g+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(b,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 m=Fe(s.rtl,this.x,this.width),g=function(S){e.fillText(S,m.x(t.x+f),t.y+d/2),t.y+=d+r},p=m.textAlign(o);let b,y,v,_,x,w,M;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=Xi(this,p,s),e.fillStyle=s.bodyColor,z(this.beforeBody,g),f=a&&p!=="right"?o==="center"?c/2+h:c+2+h:0,_=0,w=n.length;_<w;++_){for(b=n[_],y=this.labelTextColors[_],e.fillStyle=y,z(b.before,g),v=b.lines,a&&v.length&&(this._drawColorBox(e,t,_,m,s),d=Math.max(u.lineHeight,l)),x=0,M=v.length;x<M;++x)g(v[x]),d=u.lineHeight;z(b.after,g)}f=0,d=u.lineHeight,z(this.afterBody,g),t.y-=r}drawFooter(t,e,s){const n=this.footer,r=n.length;let o,a;if(r){const l=Fe(s.rtl,this.x,this.width);for(t.x=Xi(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:m}=me(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-m),e.quadraticCurveTo(a+c,l+h,a+c-m,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=di[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=eo(this,t),l=Object.assign({},o,this._size),c=io(e,t,l),h=so(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=ot(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),ga(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),pa(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=!cs(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||!cs(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=di[r.position].call(this,t,e);return o!==!1&&(s!==o.x||n!==o.y)}}k(un,"positioners",di);var $a={id:"tooltip",_element:un,positioners:di,afterInit(i,t,e){e&&(i.tooltip=new un({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:Ha},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"]},Lf=Object.freeze({__proto__:null,Colors:Yd,Decimation:Gd,Filler:bf,Legend:Mf,SubTitle:Tf,Title:kf,Tooltip:$a});const Ff=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Rf(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Ff(i,t,e,s);const r=i.lastIndexOf(t);return n!==r?e:n}const Nf=(i,t)=>i===null?null:tt(Math.round(i),0,t);function oo(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class We extends Se{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:Rf(s,t,E(e,t),this._addedLabels),Nf(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 oo.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}}k(We,"id","category"),k(We,"defaults",{ticks:{callback:oo}});function zf(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,m=h-1,{min:g,max:p}=t,b=!F(o),y=!F(a),v=!F(c),_=(p-g)/(u+1);let x=sr((p-g)/m/f)*f,w,M,S,D;if(x<1e-14&&!b&&!y)return[{value:g},{value:p}];D=Math.ceil(p/x)-Math.floor(g/x),D>m&&(x=sr(D*x/m/f)*f),F(l)||(w=Math.pow(10,l),x=Math.ceil(x*w)/w),n==="ticks"?(M=Math.floor(g/x)*x,S=Math.ceil(p/x)*x):(M=g,S=p),b&&y&&r&&Lc((a-o)/r,x/1e3)?(D=Math.round(Math.min((a-o)/x,h)),x=(a-o)/D,M=o,S=a):v?(M=b?o:M,S=y?a:S,D=c-1,x=(S-M)/D):(D=(S-M)/x,pi(D,Math.round(D),x/1e3)?D=Math.round(D):D=Math.ceil(D));const C=Math.max(nr(x),nr(M));w=Math.pow(10,F(l)?C:l),M=Math.round(M*w)/w,S=Math.round(S*w)/w;let A=0;for(b&&(d&&M!==o?(e.push({value:o}),M<o&&A++,pi(Math.round((M+A*x)*w)/w,o,ao(o,_,i))&&A++):M<o&&A++);A<D;++A)e.push({value:Math.round((M+A*x)*w)/w});return y&&d&&S!==a?e.length&&pi(e[e.length-1].value,a,ao(a,_,i))?e[e.length-1].value=a:e.push({value:a}):(!y||S===a)&&e.push({value:S}),e}function ao(i,t,{horizontal:e,minRotation:s}){const n=Dt(s),r=(e?Math.sin(n):Math.cos(n))||.001,o=.75*t*(""+i).length;return Math.min(t/r,o)}class ys extends Se{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=Lt(n),c=Lt(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=zf(n,r);return t.bounds==="ticks"&&Go(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 Ai(t,this.chart.options.locale,this.options.ticks.format)}}class Me extends ys{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?t:0,this.max=Z(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Dt(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}}k(Me,"id","linear"),k(Me,"defaults",{ticks:{callback:Ms.formatters.numeric}});const Oi=i=>Math.floor(Gt(i)),ae=(i,t)=>Math.pow(10,Oi(i)+t);function lo(i){return i/Math.pow(10,Oi(i))===1}function co(i,t,e){const s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function Vf(i,t){const e=t-i;let s=Oi(e);for(;co(i,t,s)>10;)s++;for(;co(i,t,s)<10;)s--;return Math.min(s,Oi(i))}function Wf(i,{min:t,max:e}){t=mt(i.min,t);const s=[],n=Oi(t);let r=Vf(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:lo(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:lo(f),significand:u}),s}class dn extends Se{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=ys.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return Z(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?Math.max(0,t):null,this.max=Z(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Z(this._userMin)&&(this.min=t===ae(this.min,0)?ae(this.min,-1):ae(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(ae(s,-1)),o(ae(n,1)))),s<=0&&r(ae(n,-1)),n<=0&&o(ae(s,1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=Wf(e,this);return t.bounds==="ticks"&&Go(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":Ai(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Gt(t),this._valueRange=Gt(this.max)-Gt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Gt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}k(dn,"id","logarithmic"),k(dn,"defaults",{ticks:{callback:Ms.formatters.logarithmic,major:{enabled:!0}}});function fn(i){const t=i.ticks;if(t.display&&i.display){const e=ot(t.backdropPadding);return E(t.font&&t.font.size,G.font.size)+e.height}return 0}function Bf(i,t,e){return e=H(e)?e:[e],{w:Jc(i,t.string,e),h:e.length*t.lineHeight}}function ho(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 Hf(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?U/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=Bf(i.ctx,u,i._pointLabels[l]);s[l]=d;const f=gt(i.getIndexAngle(l)+a),m=Math.round(Dn(f)),g=ho(m,h.x,d.w,0,180),p=ho(m,h.y,d.h,90,270);$f(e,t,f,g,p)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=jf(i,s,n)}function $f(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 jf(i,t,e){const s=[],n=i._pointLabels.length,r=i.options,o=fn(r)/2,a=i.drawingArea,l=r.pointLabels.centerPointLabels?U/n:0;for(let c=0;c<n;c++){const h=i.getPointPosition(c,a+o+e[c],l),u=Math.round(Dn(gt(h.angle+q))),d=t[c],f=Zf(h.y,d.h,u),m=Uf(u),g=Yf(h.x,d.w,m);s.push({x:h.x,y:f,textAlign:m,left:g,top:f,right:g+d.w,bottom:f+d.h})}return s}function Uf(i){return i===0||i===180?"center":i<180?"left":"right"}function Yf(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function Zf(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function qf(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const r=s.setContext(i.getPointLabelContext(n)),o=Q(r.font),{x:a,y:l,textAlign:c,left:h,top:u,right:d,bottom:f}=i._pointLabelItems[n],{backdropColor:m}=r;if(!F(m)){const g=me(r.borderRadius),p=ot(r.backdropPadding);e.fillStyle=m;const b=h-p.left,y=u-p.top,v=d-h+p.width,_=f-u+p.height;Object.values(g).some(x=>x!==0)?(e.beginPath(),ki(e,{x:b,y,w:v,h:_,radius:g}),e.fill()):e.fillRect(b,y,v,_)}we(e,i._pointLabels[n],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function ja(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,$);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 Xf(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(),ja(i,e,o,s),r.closePath(),r.stroke(),r.restore())}function Gf(i,t,e){return se(i,{label:e,index:t,type:"pointLabel"})}class Le extends ys{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=ot(fn(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=Z(t)&&!isNaN(t)?t:0,this.max=Z(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fn(this.options))}generateTickLabels(t){ys.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?Hf(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=$/(this._pointLabels.length||1),s=this.options.startAngle||0;return gt(t*e+Dt(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 Gf(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(),ja(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&&qf(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),m=r.setContext(d);Xf(this,f,l,o,m)}}),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=ot(c.backdropPadding);t.fillRect(-o/2-u.left,-r-h.size/2-u.top,o+u.width,h.size+u.height)}we(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}}k(Le,"id","radialLinear"),k(Le,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ms.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),k(Le,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),k(Le,"descriptors",{angleLines:{_fallback:"grid"}});const Os={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}},ut=Object.keys(Os);function Jf(i,t){return i-t}function uo(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)),Z(o)||(o=typeof s=="string"?e.parse(o,s):e.parse(o)),o===null?null:(n&&(o=n==="week"&&(Ne(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,n)),+o)}function fo(i,t,e,s){const n=ut.length;for(let r=ut.indexOf(i);r<n-1;++r){const o=Os[ut[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=s)return ut[r]}return ut[n-1]}function Kf(i,t,e,s,n){for(let r=ut.length-1;r>=ut.indexOf(e);r--){const o=ut[r];if(Os[o].common&&i._adapter.diff(n,s,o)>=t-1)return o}return ut[e?ut.indexOf(e):0]}function Qf(i){for(let t=ut.indexOf(i)+1,e=ut.length;t<e;++t)if(Os[ut[t]].common)return ut[t]}function mo(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=En(e,t),r=e[s]>=t?e[s]:e[n];i[r]=!0}}function tm(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 go(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:tm(i,s,n,e)}class Di extends Se{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 Ma._date(t.adapters.date);n.init(e),gi(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:uo(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=Z(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),r=Z(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?fo(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):Kf(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Qf(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),go(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||fo(r.minUnit,e,s,this._getLabelCapacity(e)),a=E(n.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Ne(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 m=n.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<s;d=+t.add(d,a,o),f++)mo(h,d,m);return(d===s||n.bounds==="ticks"||f===1)&&mo(h,d,m),Object.keys(h).sort((g,p)=>g-p).map(g=>+g)}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=Dt(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,go(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(uo(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Qo(t.sort(Jf))}}k(Di,"id","time"),k(Di,"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 Gi(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 mn extends Di{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=Gi(e,this.min),this._tableRange=Gi(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(Gi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Gi(this._table,s*this._tableRange+this._minPos,!0)}}k(mn,"id","timeseries"),k(mn,"defaults",Di.defaults);var em=Object.freeze({__proto__:null,CategoryScale:We,LinearScale:Me,LogarithmicScale:dn,RadialLinearScale:Le,TimeScale:Di,TimeSeriesScale:mn});const im=[du,Wd,Lf,em];ht.register(...im);class ke extends Error{}class sm extends ke{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class nm extends ke{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class rm extends ke{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class fi extends ke{}class Ua extends ke{constructor(t){super(`Invalid unit ${t}`)}}class vt extends ke{}class Ut extends ke{constructor(){super("Zone is an abstract class")}}const T="numeric",Pt="short",pt="long",xs={year:T,month:T,day:T},Ya={year:T,month:Pt,day:T},om={year:T,month:Pt,day:T,weekday:Pt},Za={year:T,month:pt,day:T},qa={year:T,month:pt,day:T,weekday:pt},Xa={hour:T,minute:T},Ga={hour:T,minute:T,second:T},Ja={hour:T,minute:T,second:T,timeZoneName:Pt},Ka={hour:T,minute:T,second:T,timeZoneName:pt},Qa={hour:T,minute:T,hourCycle:"h23"},tl={hour:T,minute:T,second:T,hourCycle:"h23"},el={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:Pt},il={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:pt},sl={year:T,month:T,day:T,hour:T,minute:T},nl={year:T,month:T,day:T,hour:T,minute:T,second:T},rl={year:T,month:Pt,day:T,hour:T,minute:T},ol={year:T,month:Pt,day:T,hour:T,minute:T,second:T},am={year:T,month:Pt,day:T,weekday:Pt,hour:T,minute:T},al={year:T,month:pt,day:T,hour:T,minute:T,timeZoneName:Pt},ll={year:T,month:pt,day:T,hour:T,minute:T,second:T,timeZoneName:Pt},cl={year:T,month:pt,day:T,weekday:pt,hour:T,minute:T,timeZoneName:pt},hl={year:T,month:pt,day:T,weekday:pt,hour:T,minute:T,second:T,timeZoneName:pt};class Ii{get type(){throw new Ut}get name(){throw new Ut}get ianaName(){return this.name}get isUniversal(){throw new Ut}offsetName(t,e){throw new Ut}formatOffset(t,e){throw new Ut}offset(t){throw new Ut}equals(t){throw new Ut}get isValid(){throw new Ut}}let qs=null;class Ds extends Ii{static get instance(){return qs===null&&(qs=new Ds),qs}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return dl(t,e,s)}formatOffset(t,e){return _i(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let as={};function lm(i){return as[i]||(as[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"})),as[i]}const cm={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function hm(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 um(i,t){const e=i.formatToParts(t),s=[];for(let n=0;n<e.length;n++){const{type:r,value:o}=e[n],a=cm[r];r==="era"?s[a]=o:I(a)||(s[a]=parseInt(o,10))}return s}let Ji={};class jt extends Ii{static create(t){return Ji[t]||(Ji[t]=new jt(t)),Ji[t]}static resetCache(){Ji={},as={}}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=jt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return dl(t,e,s,this.name)}formatOffset(t,e){return _i(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const s=lm(this.name);let[n,r,o,a,l,c,h]=s.formatToParts?um(s,e):hm(s,e);a==="BC"&&(n=-Math.abs(n)+1);const d=Bn({year:n,month:r,day:o,hour:l===24?0:l,minute:c,second:h,millisecond:0});let f=+e;const m=f%1e3;return f-=m>=0?m:1e3+m,(d-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let po={};function dm(i,t={}){const e=JSON.stringify([i,t]);let s=po[e];return s||(s=new Intl.ListFormat(i,t),po[e]=s),s}let gn={};function pn(i,t={}){const e=JSON.stringify([i,t]);let s=gn[e];return s||(s=new Intl.DateTimeFormat(i,t),gn[e]=s),s}let bn={};function fm(i,t={}){const e=JSON.stringify([i,t]);let s=bn[e];return s||(s=new Intl.NumberFormat(i,t),bn[e]=s),s}let yn={};function mm(i,t={}){const{base:e,...s}=t,n=JSON.stringify([i,s]);let r=yn[n];return r||(r=new Intl.RelativeTimeFormat(i,t),yn[n]=r),r}let mi=null;function gm(){return mi||(mi=new Intl.DateTimeFormat().resolvedOptions().locale,mi)}function pm(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=pn(i).resolvedOptions(),n=i}catch{const l=i.substring(0,e);s=pn(l).resolvedOptions(),n=l}const{numberingSystem:r,calendar:o}=s;return[n,r,o]}}function bm(i,t,e){return(e||t)&&(i.includes("-u-")||(i+="-u"),e&&(i+=`-ca-${e}`),t&&(i+=`-nu-${t}`)),i}function ym(i){const t=[];for(let e=1;e<=12;e++){const s=O.utc(2016,e,1);t.push(i(s))}return t}function xm(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 Ki(i,t,e,s,n){const r=i.listingMode(e);return r==="error"?null:r==="en"?s(t):n(t)}function _m(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 vm{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=fm(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):Wn(t,3);return K(e,this.padTo)}}}class wm{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&&jt.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=pn(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 Mm{constructor(t,e,s){this.opts={style:"long",...s},!e&&ul()&&(this.rtf=mm(t,s))}format(t,e){return this.rtf?this.rtf.format(t,e):Wm(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class B{static fromOpts(t){return B.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":gm()),a=e||J.defaultNumberingSystem,l=s||J.defaultOutputCalendar;return new B(o,a,l,r)}static resetCache(){mi=null,gn={},bn={},yn={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:s}={}){return B.create(t,e,s)}constructor(t,e,s,n){const[r,o,a]=pm(t);this.locale=r,this.numberingSystem=e||o||null,this.outputCalendar=s||a||null,this.intl=bm(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=_m(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:B.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 Ki(this,t,s,gl,()=>{const n=e?{month:t,day:"numeric"}:{month:t},r=e?"format":"standalone";return this.monthsCache[r][t]||(this.monthsCache[r][t]=ym(o=>this.extract(o,n,"month"))),this.monthsCache[r][t]})}weekdays(t,e=!1,s=!0){return Ki(this,t,s,yl,()=>{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]=xm(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[r][t]})}meridiems(t=!0){return Ki(this,void 0,t,()=>xl,()=>{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 Ki(this,t,e,_l,()=>{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 vm(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new wm(t,this.intl,e)}relFormatter(t={}){return new Mm(this.intl,this.isEnglish(),t)}listFormatter(t={}){return dm(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 Xs=null;class lt extends Ii{static get utcInstance(){return Xs===null&&(Xs=new lt(0)),Xs}static instance(t){return t===0?lt.utcInstance:new lt(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new lt(Cs(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${_i(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${_i(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return _i(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 Sm extends Ii{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function qt(i,t){if(I(i)||i===null)return t;if(i instanceof Ii)return i;if(km(i)){const e=i.toLowerCase();return e==="default"?t:e==="local"||e==="system"?Ds.instance:e==="utc"||e==="gmt"?lt.utcInstance:lt.parseSpecifier(e)||jt.create(i)}else return _e(i)?lt.instance(i):typeof i=="object"&&i.offset&&typeof i.offset=="number"?i:new Sm(i)}let bo=()=>Date.now(),yo="system",xo=null,_o=null,vo=null,wo=60,Mo;class J{static get now(){return bo}static set now(t){bo=t}static set defaultZone(t){yo=t}static get defaultZone(){return qt(yo,Ds.instance)}static get defaultLocale(){return xo}static set defaultLocale(t){xo=t}static get defaultNumberingSystem(){return _o}static set defaultNumberingSystem(t){_o=t}static get defaultOutputCalendar(){return vo}static set defaultOutputCalendar(t){vo=t}static get twoDigitCutoffYear(){return wo}static set twoDigitCutoffYear(t){wo=t%100}static get throwOnInvalid(){return Mo}static set throwOnInvalid(t){Mo=t}static resetCaches(){B.resetCache(),jt.resetCache()}}function I(i){return typeof i>"u"}function _e(i){return typeof i=="number"}function Es(i){return typeof i=="number"&&i%1===0}function km(i){return typeof i=="string"}function Tm(i){return Object.prototype.toString.call(i)==="[object Date]"}function ul(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Om(i){return Array.isArray(i)?i:[i]}function So(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 Dm(i,t){return t.reduce((e,s)=>(e[s]=i[s],e),{})}function Be(i,t){return Object.prototype.hasOwnProperty.call(i,t)}function Ht(i,t,e){return Es(i)&&i>=t&&i<=e}function Em(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 Zt(i){if(!(I(i)||i===null||i===""))return parseInt(i,10)}function le(i){if(!(I(i)||i===null||i===""))return parseFloat(i)}function Vn(i){if(!(I(i)||i===null||i==="")){const t=parseFloat("0."+i)*1e3;return Math.floor(t)}}function Wn(i,t,e=!1){const s=10**t;return(e?Math.trunc:Math.round)(i*s)/s}function Li(i){return i%4===0&&(i%100!==0||i%400===0)}function xi(i){return Li(i)?366:365}function _s(i,t){const e=Em(t-1,12)+1,s=i+(t-e)/12;return e===2?Li(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function Bn(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 vs(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 xn(i){return i>99?i:i>J.twoDigitCutoffYear?1900+i:2e3+i}function dl(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 Cs(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 fl(i){const t=Number(i);if(typeof i=="boolean"||i===""||Number.isNaN(t))throw new vt(`Invalid unit value ${i}`);return t}function ws(i,t){const e={};for(const s in i)if(Be(i,s)){const n=i[s];if(n==null)continue;e[t(s)]=fl(n)}return e}function _i(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 As(i){return Dm(i,["hour","minute","second","millisecond"])}const Cm=["January","February","March","April","May","June","July","August","September","October","November","December"],ml=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Am=["J","F","M","A","M","J","J","A","S","O","N","D"];function gl(i){switch(i){case"narrow":return[...Am];case"short":return[...ml];case"long":return[...Cm];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 pl=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],bl=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Pm=["M","T","W","T","F","S","S"];function yl(i){switch(i){case"narrow":return[...Pm];case"short":return[...bl];case"long":return[...pl];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const xl=["AM","PM"],Im=["Before Christ","Anno Domini"],Lm=["BC","AD"],Fm=["B","A"];function _l(i){switch(i){case"narrow":return[...Fm];case"short":return[...Lm];case"long":return[...Im];default:return null}}function Rm(i){return xl[i.hour<12?0:1]}function Nm(i,t){return yl(t)[i.weekday-1]}function zm(i,t){return gl(t)[i.month-1]}function Vm(i,t){return _l(t)[i.year<0?0:1]}function Wm(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 ko(i,t){let e="";for(const s of i)s.literal?e+=s.val:e+=t(s.val);return e}const Bm={D:xs,DD:Ya,DDD:Za,DDDD:qa,t:Xa,tt:Ga,ttt:Ja,tttt:Ka,T:Qa,TT:tl,TTT:el,TTTT:il,f:sl,ff:rl,fff:al,ffff:cl,F:nl,FF:ol,FFF:ll,FFFF:hl};class nt{static create(t,e={}){return new nt(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 Bm[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,m)=>this.loc.extract(t,f,m),o=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>s?Rm(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,m)=>s?zm(t,f):r(m?{month:f}:{month:f,day:"numeric"},"month"),c=(f,m)=>s?Nm(t,f):r(m?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),h=f=>{const m=nt.macroTokenToFormatOpts(f);return m?this.formatWithSystemDefault(t,m):f},u=f=>s?Vm(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 ko(nt.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=nt.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 ko(r,n(a))}}class Et{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const vl=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function $e(...i){const t=i.reduce((e,s)=>e+s.source,"");return RegExp(`^${t}$`)}function je(...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 Ue(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 wl(...i){return(t,e)=>{const s={};let n;for(n=0;n<i.length;n++)s[i[n]]=Zt(t[e+n]);return[s,null,e+n]}}const Ml=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Hm=`(?:${Ml.source}?(?:\\[(${vl.source})\\])?)?`,Hn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Sl=RegExp(`${Hn.source}${Hm}`),$n=RegExp(`(?:T${Sl.source})?`),$m=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,jm=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Um=/(\d{4})-?(\d{3})/,Ym=wl("weekYear","weekNumber","weekDay"),Zm=wl("year","ordinal"),qm=/(\d{4})-(\d\d)-(\d\d)/,kl=RegExp(`${Hn.source} ?(?:${Ml.source}|(${vl.source}))?`),Xm=RegExp(`(?: ${kl.source})?`);function Re(i,t,e){const s=i[t];return I(s)?e:Zt(s)}function Gm(i,t){return[{year:Re(i,t),month:Re(i,t+1,1),day:Re(i,t+2,1)},null,t+3]}function Ye(i,t){return[{hours:Re(i,t,0),minutes:Re(i,t+1,0),seconds:Re(i,t+2,0),milliseconds:Vn(i[t+3])},null,t+4]}function Fi(i,t){const e=!i[t]&&!i[t+1],s=Cs(i[t+1],i[t+2]),n=e?null:lt.instance(s);return[{},n,t+3]}function Ri(i,t){const e=i[t]?jt.create(i[t]):null;return[{},e,t+1]}const Jm=RegExp(`^T?${Hn.source}$`),Km=/^-?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 Qm(i){const[t,e,s,n,r,o,a,l,c]=i,h=t[0]==="-",u=l&&l[0]==="-",d=(f,m=!1)=>f!==void 0&&(m||f&&h)?-f:f;return[{years:d(le(e)),months:d(le(s)),weeks:d(le(n)),days:d(le(r)),hours:d(le(o)),minutes:d(le(a)),seconds:d(le(l),l==="-0"),milliseconds:d(Vn(c),u)}]}const tg={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 jn(i,t,e,s,n,r,o){const a={year:t.length===2?xn(Zt(t)):Zt(t),month:ml.indexOf(e)+1,day:Zt(s),hour:Zt(n),minute:Zt(r)};return o&&(a.second=Zt(o)),i&&(a.weekday=i.length>3?pl.indexOf(i)+1:bl.indexOf(i)+1),a}const eg=/^(?:(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 ig(i){const[,t,e,s,n,r,o,a,l,c,h,u]=i,d=jn(t,n,s,e,r,o,a);let f;return l?f=tg[l]:c?f=0:f=Cs(h,u),[d,new lt(f)]}function sg(i){return i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ng=/^(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$/,rg=/^(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$/,og=/^(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 To(i){const[,t,e,s,n,r,o,a]=i;return[jn(t,n,s,e,r,o,a),lt.utcInstance]}function ag(i){const[,t,e,s,n,r,o,a]=i;return[jn(t,a,e,s,n,r,o),lt.utcInstance]}const lg=$e($m,$n),cg=$e(jm,$n),hg=$e(Um,$n),ug=$e(Sl),Tl=je(Gm,Ye,Fi,Ri),dg=je(Ym,Ye,Fi,Ri),fg=je(Zm,Ye,Fi,Ri),mg=je(Ye,Fi,Ri);function gg(i){return Ue(i,[lg,Tl],[cg,dg],[hg,fg],[ug,mg])}function pg(i){return Ue(sg(i),[eg,ig])}function bg(i){return Ue(i,[ng,To],[rg,To],[og,ag])}function yg(i){return Ue(i,[Km,Qm])}const xg=je(Ye);function _g(i){return Ue(i,[Jm,xg])}const vg=$e(qm,Xm),wg=$e(kl),Mg=je(Ye,Fi,Ri);function Sg(i){return Ue(i,[vg,Tl],[wg,Mg])}const kg="Invalid Duration",Ol={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}},Tg={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},...Ol},_t=146097/400,Pe=146097/4800,Og={years:{quarters:4,months:12,weeks:_t/7,days:_t,hours:_t*24,minutes:_t*24*60,seconds:_t*24*60*60,milliseconds:_t*24*60*60*1e3},quarters:{months:3,weeks:_t/28,days:_t/4,hours:_t*24/4,minutes:_t*24*60/4,seconds:_t*24*60*60/4,milliseconds:_t*24*60*60*1e3/4},months:{weeks:Pe/7,days:Pe,hours:Pe*24,minutes:Pe*24*60,seconds:Pe*24*60*60,milliseconds:Pe*24*60*60*1e3},...Ol},ue=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Dg=ue.slice(0).reverse();function Yt(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 L(s)}function Eg(i){return i<0?Math.floor(i):Math.ceil(i)}function Dl(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?Eg(o):Math.trunc(o);s[n]+=l,t[e]-=l*r}function Cg(i,t){Dg.reduce((e,s)=>I(t[s])?e:(e&&Dl(i,t,e,t,s),s),null)}function Ag(i){const t={};for(const[e,s]of Object.entries(i))s!==0&&(t[e]=s);return t}class L{constructor(t){const e=t.conversionAccuracy==="longterm"||!1;let s=e?Og:Tg;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||B.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,e){return L.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new vt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new L({values:ws(t,L.normalizeUnit),loc:B.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(_e(t))return L.fromMillis(t);if(L.isDuration(t))return t;if(typeof t=="object")return L.fromObject(t);throw new vt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[s]=yg(t);return s?L.fromObject(s,e):L.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[s]=_g(t);return s?L.fromObject(s,e):L.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new vt("need to specify a reason the Duration is invalid");const s=t instanceof Et?t:new Et(t,e);if(J.throwOnInvalid)throw new rm(s);return new L({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 Ua(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?nt.create(this.loc,s).formatDurationFromString(this,t):kg}toHuman(t={}){const e=ue.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+=Wn(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=L.fromDurationLike(t),s={};for(const n of ue)(Be(e.values,n)||Be(this.values,n))&&(s[n]=e.get(n)+this.get(n));return Yt(this,{values:s},!0)}minus(t){if(!this.isValid)return this;const e=L.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]=fl(t(this.values[s],s));return Yt(this,{values:e},!0)}get(t){return this[L.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const e={...this.values,...ws(t,L.normalizeUnit)};return Yt(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 Yt(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Cg(this.matrix,t),Yt(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Ag(this.normalize().shiftToAll().toObject());return Yt(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>L.normalizeUnit(o));const e={},s={},n=this.toObject();let r;for(const o of ue)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;_e(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)ue.indexOf(c)>ue.indexOf(o)&&Dl(this.matrix,n,c,e,o)}else _e(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 Yt(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 Yt(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 ue)if(!e(this.values[s],t.values[s]))return!1;return!0}}const Ie="Invalid Interval";function Pg(i,t){return!i||!i.isValid?Y.invalid("missing or invalid start"):!t||!t.isValid?Y.invalid("missing or invalid end"):t<i?Y.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 Y{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 vt("need to specify a reason the Interval is invalid");const s=t instanceof Et?t:new Et(t,e);if(J.throwOnInvalid)throw new nm(s);return new Y({invalid:s})}static fromDateTimes(t,e){const s=li(t),n=li(e),r=Pg(s,n);return r??new Y({start:s,end:n})}static after(t,e){const s=L.fromDurationLike(e),n=li(t);return Y.fromDateTimes(n,n.plus(s))}static before(t,e){const s=L.fromDurationLike(e),n=li(t);return Y.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 Y.fromDateTimes(r,a);if(o){const c=L.fromISO(n,e);if(c.isValid)return Y.after(r,c)}else if(l){const c=L.fromISO(s,e);if(c.isValid)return Y.before(a,c)}}return Y.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?Y.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(li).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(Y.fromDateTimes(n,a)),n=a,r+=1}return s}splitBy(t){const e=L.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(Y.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:Y.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 Y.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(Y.fromDateTimes(e,l.time)),e=null);return Y.merge(n)}difference(...t){return Y.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ie}toLocaleString(t=xs,e={}){return this.isValid?nt.create(this.s.loc.clone(e),t).formatInterval(this):Ie}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Ie}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ie}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Ie}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:Ie}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):L.invalid(this.invalidReason)}mapEndpoints(t){return Y.fromDateTimes(t(this.s),t(this.e))}}class Qi{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 jt.isValidZone(t)}static normalizeZone(t){return qt(t,J.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||B.create(e,s,r)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||B.create(e,s,r)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null}={}){return(n||B.create(e,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null}={}){return(n||B.create(e,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return B.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return B.create(e,null,"gregory").eras(t)}static features(){return{relative:ul()}}}function Oo(i,t){const e=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=e(t)-e(i);return Math.floor(L.fromMillis(s).as("days"))}function Ig(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=Oo(l,c);return(h-h%7)/7}],["days",Oo]],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 Lg(i,t,e,s){let[n,r,o,a]=Ig(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=L.fromObject(r,s);return c.length>0?L.fromMillis(l,s).shiftTo(...c).plus(h):h}const Un={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Do={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]},Fg=Un.hanidec.replace(/[\[|\]]/g,"").split("");function Rg(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(Un.hanidec)!==-1)t+=Fg.indexOf(i[e]);else for(const n in Do){const[r,o]=Do[n];s>=r&&s<=o&&(t+=s-r)}}return parseInt(t,10)}else return t}function Tt({numberingSystem:i},t=""){return new RegExp(`${Un[i||"latn"]}${t}`)}const Ng="missing Intl.DateTimeFormat.formatToParts support";function N(i,t=e=>e){return{regex:i,deser:([e])=>t(Rg(e))}}const zg=String.fromCharCode(160),El=`[ ${zg}]`,Cl=new RegExp(El,"g");function Vg(i){return i.replace(/\./g,"\\.?").replace(Cl,El)}function Eo(i){return i.replace(/\./g,"").replace(Cl," ").toLowerCase()}function Ot(i,t){return i===null?null:{regex:RegExp(i.map(Vg).join("|")),deser:([e])=>i.findIndex(s=>Eo(e)===Eo(s))+t}}function Co(i,t){return{regex:i,deser:([,e,s])=>Cs(e,s),groups:t}}function ts(i){return{regex:i,deser:([t])=>t}}function Wg(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Bg(i,t){const e=Tt(t),s=Tt(t,"{2}"),n=Tt(t,"{3}"),r=Tt(t,"{4}"),o=Tt(t,"{6}"),a=Tt(t,"{1,2}"),l=Tt(t,"{1,3}"),c=Tt(t,"{1,6}"),h=Tt(t,"{1,9}"),u=Tt(t,"{2,4}"),d=Tt(t,"{4,6}"),f=p=>({regex:RegExp(Wg(p.val)),deser:([b])=>b,literal:!0}),g=(p=>{if(i.literal)return f(p);switch(p.val){case"G":return Ot(t.eras("short",!1),0);case"GG":return Ot(t.eras("long",!1),0);case"y":return N(c);case"yy":return N(u,xn);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 Ot(t.months("short",!0,!1),1);case"MMMM":return Ot(t.months("long",!0,!1),1);case"L":return N(a);case"LL":return N(s);case"LLL":return Ot(t.months("short",!1,!1),1);case"LLLL":return Ot(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 ts(h);case"uu":return ts(a);case"uuu":return N(e);case"a":return Ot(t.meridiems(),0);case"kkkk":return N(r);case"kk":return N(u,xn);case"W":return N(a);case"WW":return N(s);case"E":case"c":return N(e);case"EEE":return Ot(t.weekdays("short",!1,!1),1);case"EEEE":return Ot(t.weekdays("long",!1,!1),1);case"ccc":return Ot(t.weekdays("short",!0,!1),1);case"cccc":return Ot(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Co(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return Co(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return ts(/[a-z_+-/]{1,256}?/i);case" ":return ts(/[^\S\n\r]/);default:return f(p)}})(i)||{invalidReason:Ng};return g.token=i,g}const Hg={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 $g(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=Hg[e];if(typeof r=="object"&&(r=r[n]),r)return{literal:!1,val:r}}function jg(i){return[`^${i.map(e=>e.regex).reduce((e,s)=>`${e}(${s.source})`,"")}$`,i]}function Ug(i,t,e){const s=i.match(t);if(s){const n={};let r=1;for(const o in e)if(Be(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 Yg(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=jt.create(i.z)),I(i.Z)||(e||(e=new lt(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=Vn(i.u)),[Object.keys(i).reduce((r,o)=>{const a=t(o);return a&&(r[a]=i[o]),r},{}),e,s]}let Gs=null;function Zg(){return Gs||(Gs=O.fromMillis(1555555555555)),Gs}function qg(i,t){if(i.literal)return i;const e=nt.macroTokenToFormatOpts(i.val),s=Il(e,t);return s==null||s.includes(void 0)?i:s}function Al(i,t){return Array.prototype.concat(...i.map(e=>qg(e,t)))}function Pl(i,t,e){const s=Al(nt.parseFormat(e),i),n=s.map(o=>Bg(o,i)),r=n.find(o=>o.invalidReason);if(r)return{input:t,tokens:s,invalidReason:r.invalidReason};{const[o,a]=jg(n),l=RegExp(o,"i"),[c,h]=Ug(t,l,a),[u,d,f]=h?Yg(h):[null,null,void 0];if(Be(h,"a")&&Be(h,"H"))throw new fi("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 Xg(i,t,e){const{result:s,zone:n,specificOffset:r,invalidReason:o}=Pl(i,t,e);return[s,n,r,o]}function Il(i,t){return i?nt.create(t,i).formatDateTimeParts(Zg()).map(n=>$g(n,i)):null}const Ll=[0,31,59,90,120,151,181,212,243,273,304,334],Fl=[0,31,60,91,121,152,182,213,244,274,305,335];function wt(i,t){return new Et("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${i}, which is invalid`)}function Rl(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 Nl(i,t,e){return e+(Li(i)?Fl:Ll)[t-1]}function zl(i,t){const e=Li(i)?Fl:Ll,s=e.findIndex(r=>r<t),n=t-e[s];return{month:s+1,day:n}}function _n(i){const{year:t,month:e,day:s}=i,n=Nl(t,e,s),r=Rl(t,e,s);let o=Math.floor((n-r+10)/7),a;return o<1?(a=t-1,o=vs(a)):o>vs(t)?(a=t+1,o=1):a=t,{weekYear:a,weekNumber:o,weekday:r,...As(i)}}function Ao(i){const{weekYear:t,weekNumber:e,weekday:s}=i,n=Rl(t,1,4),r=xi(t);let o=e*7+s-n-3,a;o<1?(a=t-1,o+=xi(a)):o>r?(a=t+1,o-=xi(t)):a=t;const{month:l,day:c}=zl(a,o);return{year:a,month:l,day:c,...As(i)}}function Js(i){const{year:t,month:e,day:s}=i,n=Nl(t,e,s);return{year:t,ordinal:n,...As(i)}}function Po(i){const{year:t,ordinal:e}=i,{month:s,day:n}=zl(t,e);return{year:t,month:s,day:n,...As(i)}}function Gg(i){const t=Es(i.weekYear),e=Ht(i.weekNumber,1,vs(i.weekYear)),s=Ht(i.weekday,1,7);return t?e?s?!1:wt("weekday",i.weekday):wt("week",i.week):wt("weekYear",i.weekYear)}function Jg(i){const t=Es(i.year),e=Ht(i.ordinal,1,xi(i.year));return t?e?!1:wt("ordinal",i.ordinal):wt("year",i.year)}function Vl(i){const t=Es(i.year),e=Ht(i.month,1,12),s=Ht(i.day,1,_s(i.year,i.month));return t?e?s?!1:wt("day",i.day):wt("month",i.month):wt("year",i.year)}function Wl(i){const{hour:t,minute:e,second:s,millisecond:n}=i,r=Ht(t,0,23)||t===24&&e===0&&s===0&&n===0,o=Ht(e,0,59),a=Ht(s,0,59),l=Ht(n,0,999);return r?o?a?l?!1:wt("millisecond",n):wt("second",s):wt("minute",e):wt("hour",t)}const Ks="Invalid DateTime",Io=864e13;function es(i){return new Et("unsupported zone",`the zone "${i.name}" is not supported`)}function Qs(i){return i.weekData===null&&(i.weekData=_n(i.c)),i.weekData}function oi(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 Bl(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 Lo(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 ls(i,t,e){return Bl(Bn(i),t,e)}function Fo(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,_s(s,n))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=L.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=Bn(r);let[l,c]=Bl(a,e,i.zone);return o!==0&&(l+=o,c=i.zone.offset(l)),{ts:l,o:c}}function ai(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 Et("unparsable",`the input "${n}" can't be parsed as ${s}`))}function is(i,t,e=!0){return i.isValid?nt.create(B.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(i,t):null}function tn(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 Ro(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 Hl={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Kg={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Qg={ordinal:1,hour:0,minute:0,second:0,millisecond:0},$l=["year","month","day","hour","minute","second","millisecond"],tp=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ep=["year","ordinal","hour","minute","second","millisecond"];function No(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 Ua(i);return t}function zo(i,t){const e=qt(t.zone,J.defaultZone),s=B.fromObject(t),n=J.now();let r,o;if(I(i.year))r=n;else{for(const c of $l)I(i[c])&&(i[c]=Hl[c]);const a=Vl(i)||Wl(i);if(a)return O.invalid(a);const l=e.offset(n);[r,o]=ls(i,l,e)}return new O({ts:r,zone:e,loc:s,o})}function Vo(i,t,e){const s=I(e.round)?!0:e.round,n=(o,a)=>(o=Wn(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 Wo(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 Et("invalid input"):null)||(e.isValid?null:es(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=Lo(this.ts,a),s=Number.isNaN(n.year)?new Et("invalid input"):null,n=s?null:n,r=s?null:a}this._zone=e,this.loc=t.loc||B.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]=Wo(arguments),[s,n,r,o,a,l,c]=e;return zo({year:s,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static utc(){const[t,e]=Wo(arguments),[s,n,r,o,a,l,c]=e;return t.zone=lt.utcInstance,zo({year:s,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,e={}){const s=Tm(t)?t.valueOf():NaN;if(Number.isNaN(s))return O.invalid("invalid input");const n=qt(e.zone,J.defaultZone);return n.isValid?new O({ts:s,zone:n,loc:B.fromObject(e)}):O.invalid(es(n))}static fromMillis(t,e={}){if(_e(t))return t<-Io||t>Io?O.invalid("Timestamp out of range"):new O({ts:t,zone:qt(e.zone,J.defaultZone),loc:B.fromObject(e)});throw new vt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(_e(t))return new O({ts:t*1e3,zone:qt(e.zone,J.defaultZone),loc:B.fromObject(e)});throw new vt("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const s=qt(e.zone,J.defaultZone);if(!s.isValid)return O.invalid(es(s));const n=J.now(),r=I(e.specificOffset)?s.offset(n):e.specificOffset,o=ws(t,No),a=!I(o.ordinal),l=!I(o.year),c=!I(o.month)||!I(o.day),h=l||c,u=o.weekYear||o.weekNumber,d=B.fromObject(e);if((h||a)&&u)throw new fi("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new fi("Can't mix ordinal dates with month/day");const f=u||o.weekday&&!h;let m,g,p=Lo(n,r);f?(m=tp,g=Kg,p=_n(p)):a?(m=ep,g=Qg,p=Js(p)):(m=$l,g=Hl);let b=!1;for(const S of m){const D=o[S];I(D)?b?o[S]=g[S]:o[S]=p[S]:b=!0}const y=f?Gg(o):a?Jg(o):Vl(o),v=y||Wl(o);if(v)return O.invalid(v);const _=f?Ao(o):a?Po(o):o,[x,w]=ls(_,r,s),M=new O({ts:x,zone:s,o:w,loc:d});return o.weekday&&h&&t.weekday!==M.weekday?O.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${M.toISO()}`):M}static fromISO(t,e={}){const[s,n]=gg(t);return ai(s,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[s,n]=pg(t);return ai(s,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[s,n]=bg(t);return ai(s,n,e,"HTTP",e)}static fromFormat(t,e,s={}){if(I(t)||I(e))throw new vt("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:r=null}=s,o=B.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[a,l,c,h]=Xg(o,t,e);return h?O.invalid(h):ai(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]=Sg(t);return ai(s,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new vt("need to specify a reason the DateTime is invalid");const s=t instanceof Et?t:new Et(t,e);if(J.throwOnInvalid)throw new sm(s);return new O({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const s=Il(t,B.fromObject(e));return s?s.map(n=>n?n.val:null).join(""):null}static expandFormat(t,e={}){return Al(nt.parseFormat(t),B.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?Qs(this).weekYear:NaN}get weekNumber(){return this.isValid?Qs(this).weekNumber:NaN}get weekday(){return this.isValid?Qs(this).weekday:NaN}get ordinal(){return this.isValid?Js(this.c).ordinal:NaN}get monthShort(){return this.isValid?Qi.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Qi.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Qi.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Qi.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 Li(this.year)}get daysInMonth(){return _s(this.year,this.month)}get daysInYear(){return this.isValid?xi(this.year):NaN}get weeksInWeekYear(){return this.isValid?vs(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:s,calendar:n}=nt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:s,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(lt.instance(t),e)}toLocal(){return this.setZone(J.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:s=!1}={}){if(t=qt(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]=ls(o,r,t)}return oi(this,{ts:n,zone:t})}else return O.invalid(es(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:s}={}){const n=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:s});return oi(this,{loc:n})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=ws(t,No),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 fi("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&n)throw new fi("Can't mix ordinal dates with month/day");let c;s?c=Ao({..._n(this.c),...e}):I(e.ordinal)?(c={...this.toObject(),...e},I(e.day)&&(c.day=Math.min(_s(c.year,c.month),c.day))):c=Po({...Js(this.c),...e});const[h,u]=ls(c,this.o,this.zone);return oi(this,{ts:h,o:u})}plus(t){if(!this.isValid)return this;const e=L.fromDurationLike(t);return oi(this,Fo(this,e))}minus(t){if(!this.isValid)return this;const e=L.fromDurationLike(t).negate();return oi(this,Fo(this,e))}startOf(t){if(!this.isValid)return this;const e={},s=L.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?nt.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Ks}toLocaleString(t=xs,e={}){return this.isValid?nt.create(this.loc.clone(e),t).formatDateTime(this):Ks}toLocaleParts(t={}){return this.isValid?nt.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=tn(this,o);return a+="T",a+=Ro(this,o,e,s,n,r),a}toISODate({format:t="extended"}={}){return this.isValid?tn(this,t==="extended"):null}toISOWeekDate(){return is(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":"")+Ro(this,o==="extended",e,t,s,r):null}toRFC2822(){return is(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return is(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?tn(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")),is(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Ks}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 L.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...s},r=Om(e).map(L.normalizeUnit),o=t.valueOf()>this.valueOf(),a=o?this:t,l=o?t:this,c=Lg(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?Y.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),Vo(e,this.plus(s),{...t,numeric:"always",units:n,unit:r})}toRelativeCalendar(t={}){return this.isValid?Vo(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 vt("min requires all arguments be DateTimes");return So(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(O.isDateTime))throw new vt("max requires all arguments be DateTimes");return So(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,s={}){const{locale:n=null,numberingSystem:r=null}=s,o=B.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return Pl(o,t,e)}static fromStringExplain(t,e,s={}){return O.fromFormatExplain(t,e,s)}static get DATE_SHORT(){return xs}static get DATE_MED(){return Ya}static get DATE_MED_WITH_WEEKDAY(){return om}static get DATE_FULL(){return Za}static get DATE_HUGE(){return qa}static get TIME_SIMPLE(){return Xa}static get TIME_WITH_SECONDS(){return Ga}static get TIME_WITH_SHORT_OFFSET(){return Ja}static get TIME_WITH_LONG_OFFSET(){return Ka}static get TIME_24_SIMPLE(){return Qa}static get TIME_24_WITH_SECONDS(){return tl}static get TIME_24_WITH_SHORT_OFFSET(){return el}static get TIME_24_WITH_LONG_OFFSET(){return il}static get DATETIME_SHORT(){return sl}static get DATETIME_SHORT_WITH_SECONDS(){return nl}static get DATETIME_MED(){return rl}static get DATETIME_MED_WITH_SECONDS(){return ol}static get DATETIME_MED_WITH_WEEKDAY(){return am}static get DATETIME_FULL(){return al}static get DATETIME_FULL_WITH_SECONDS(){return ll}static get DATETIME_HUGE(){return cl}static get DATETIME_HUGE_WITH_SECONDS(){return hl}}function li(i){if(O.isDateTime(i))return i;if(i&&i.valueOf&&_e(i.valueOf()))return O.fromJSDate(i);if(i&&typeof i=="object")return O.fromObject(i);throw new vt(`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 ip={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"}};Ma._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 ip},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()}});function sp(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var vn={},np={get exports(){return vn},set exports(i){vn=i}},jl={};function St(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 rp=St;St.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};St.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};St.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};St.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)};St.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};St.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};St.prototype.start=St.prototype.try;St.prototype.errors=function(){return this._errors};St.prototype.attempts=function(){return this._attempts};St.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=rp;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(m){u.retry(m)||(m&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){h.apply(e,d)})}.bind(e,l),e[a].options=s}}})(jl);(function(i){i.exports=jl})(np);const op=sp(vn),ap=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed"]);class Ul 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 lp=(i,t,e)=>{const s=e.retries-(t-1);return i.attemptNumber=t,i.retriesLeft=s,i},cp=i=>ap.has(i),Bo=i=>globalThis.DOMException===void 0?new Error(i):new DOMException(i);async function hp(i,t){return new Promise((e,s)=>{t={onFailedAttempt(){},retries:10,...t};const n=op.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 Ul)n.stop(),s(o.originalError);else if(o instanceof TypeError&&!cp(o.message))n.stop(),s(o);else{lp(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?Bo("The operation was aborted."):t.signal.reason;s(r instanceof Error?r:Bo(r))},{once:!0})})}const Ps={errorBarLineWidth:{v:[1,3]},errorBarColor:{v:["#2c2c2c","#1f1f1f"]},errorBarWhiskerLineWidth:{v:[1,3]},errorBarWhiskerRatio:{v:[.2,.25]},errorBarWhiskerSize:{v:[20,24]},errorBarWhiskerColor:{v:["#2c2c2c","#1f1f1f"]}},Yn={_scriptable:!0,_indexable:i=>i!=="v"},Ho=Object.keys(Ps);function Zn(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 dt(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 qn(i,t,e){const s=dt(t.errorBarWhiskerRatio,e);return i!=null&&s>0?i*s*.5:dt(t.errorBarWhiskerSize,e)*.5}function up(i,t,e,s,n){n.save(),n.translate(i.x,0);const r=Zn(t??i.y,e??i.y);r.reverse().forEach(([o,a],l)=>{const c=r.length-l-1,h=qn(i.width,s,c);n.lineWidth=dt(s.errorBarLineWidth,c),n.strokeStyle=dt(s.errorBarColor,c),n.beginPath(),n.moveTo(0,o),n.lineTo(0,a),n.stroke(),n.lineWidth=dt(s.errorBarWhiskerLineWidth,c),n.strokeStyle=dt(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 dp(i,t,e,s,n){n.save(),n.translate(0,i.y);const r=Zn(t??i.x,e??i.x);r.reverse().forEach(([o,a],l)=>{const c=r.length-l-1,h=qn(i.height,s,c);n.lineWidth=dt(s.errorBarLineWidth,c),n.strokeStyle=dt(s.errorBarColor,c),n.beginPath(),n.moveTo(o,0),n.lineTo(a,0),n.stroke(),n.lineWidth=dt(s.errorBarWhiskerLineWidth,c),n.strokeStyle=dt(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 Yl(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)&&dp(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)&&up(o,(n=o.yMin)!==null&&n!==void 0?n:null,(r=o.yMax)!==null&&r!==void 0?r:null,i.options,t)}function fp(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=Zn(t??i.outerRadius,e??i.outerRadius);h.reverse().forEach(([u,d],f)=>{const m=h.length-f-1,g=u*o,p=u*a,b=d*o,y=d*a,v=qn(null,s,m),_=l.x*v,x=l.y*v;n.lineWidth=dt(s.errorBarLineWidth,m),n.strokeStyle=dt(s.errorBarColor,m),n.beginPath(),n.moveTo(g,p),n.lineTo(b,y),n.stroke(),n.lineWidth=dt(s.errorBarWhiskerLineWidth,m),n.strokeStyle=dt(s.errorBarWhiskerColor,m),n.beginPath(),n.moveTo(g+_,p+x),n.lineTo(g-_,p-x),n.moveTo(b+_,y+x),n.lineTo(b-_,y-x),n.stroke()}),n.restore()}function mp(i,t){const e=i.getProps(["x","y","startAngle","endAngle","rMin","rMax","outerRadius"]);(e.rMin!=null||e.rMax!=null)&&fp(e,e.rMin,e.rMax,i.options,t)}class Ze extends xe{draw(t){super.draw(t),Yl(this,t)}}Ze.id="barWithErrorBar";Ze.defaults={...xe.defaults,...Ps};Ze.defaultRoutes=xe.defaultRoutes;Ze.descriptors=Yn;class yt extends ye{draw(t,e){super.draw.call(this,t,e),Yl(this,t)}}yt.id="pointWithErrorBar";yt.defaults={...ye.defaults,...Ps};yt.defaultRoutes=ye.defaultRoutes;yt.descriptors=Yn;class qe extends be{draw(t){super.draw(t),mp(this,t)}}qe.id="arcWithErrorBar";qe.defaults={...be.defaults,...Ps};qe.defaultRoutes=be.defaultRoutes;qe.descriptors=Yn;const wn=["xMin","xMax","yMin","yMax"];function Zl(i){return i?wn.slice(0,2):wn.slice(2)}function Ei(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 gp(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 Xn(i){return Array.isArray(i)?i.slice().reverse():i}function ql(i){const t=Zl(i.element.horizontal),e=$a.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} (${Xn(s[t[0]])} .. ${s[t[1]]})`}function pp(i){const t=i.chart.data.datasets[i.datasetIndex].data[i.dataIndex],e=(s,n)=>{const r=Zl(n);return t==null||r.every(o=>t[o]==null)?s:`${s} [${Xn(t[r[0]])} .. ${t[r[1]]}]`};return`(${e(i.label,!0)}, ${e(i.parsed.y,!1)})`}function bp(i){const t=Ft.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} [${Xn(e[s[0]])} .. ${e[s[1]]}]`}const Xl={color(i,t,e){const s=i||"transparent",n=t||"transparent";if(s===n)return t;const r=ds(s),o=r.valid&&ds(n);return o&&o.valid?o.mix(r,e).hexString():t},number(i,t,e){return i===t?t:i+(t-i)*e}};function Gl(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 yp(i,t,e){return Gl(i,t,e,"number",Xl.number)}function xp(i,t,e){return Gl(i,t,e,"string",Xl.color)}const Is={animations:{numberArray:{fn:yp,properties:wn.concat(Ho.filter(i=>!i.endsWith("Color")),["rMin","rMax"])},colorArray:{fn:xp,properties:Ho.filter(i=>i.endsWith("Color"))}}};function Ls(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 $o(i,t,e){return Array.isArray(t)?e(i,...t):typeof t=="number"?e(i,t):i}function He(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]=$o(d[r],d[o],Math.min),d[c]=$o(d[r],d[a],Math.max)}}function Jl(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 Fs(i,t,e,s=[],n=[]){at.addControllers(e),Array.isArray(s)?at.addElements(...s):at.addElements(s),Array.isArray(n)?at.addScales(...n):at.addScales(n);const r=t;return r.type=i,r}class Xe extends te{getMinMax(t,e){return Ls(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){He(t,e.vScale,s,n,r),Jl(t,e.iScale,n,r)}updateElement(t,e,s,n){typeof e=="number"&&Ei(s,this.getParsed(e),e,this._cachedMeta.vScale,n==="reset"),super.updateElement(t,e,s,n)}}Xe.id="barWithErrorBars";Xe.defaults=bt({},[te.defaults,Is,{dataElementType:Ze.id}]);Xe.overrides=bt({},[te.overrides,{plugins:{tooltip:{callbacks:{label:ql}}}}]);Xe.defaultRoutes=te.defaultRoutes;class _p extends ht{constructor(t,e){super(t,Fs("barWithErrorBars",e,Xe,Ze,[Me,We]))}}_p.id=Xe.id;const jo=["linear","logarithmic","time","timeseries"];class Te extends $t{getMinMax(t,e){return Ls(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){He(t,e.vScale,s,n,r);const o=e.iScale;jo.includes(o.type)?He(t,e.iScale,s,n,r):Jl(t,e.iScale,n,r)}updateElement(t,e,s,n){t instanceof yt&&typeof e=="number"&&this.updateElementScale(e,s,n),super.updateElement(t,e,s,n)}updateElementScale(t,e,s){Ei(e,this.getParsed(t),t,this._cachedMeta.vScale,s==="reset");const n=this._cachedMeta.iScale;jo.includes(n.type)&&Ei(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 yt&&this.updateElementScale(l,c,n)}}}Te.id="lineWithErrorBars";Te.defaults=bt({},[$t.defaults,Is,{dataElementType:yt.id}]);Te.overrides=bt({},[$t.overrides,{plugins:{tooltip:{callbacks:{label:ql}}}}]);Te.defaultRoutes=$t.defaultRoutes;class Kl extends ht{constructor(t,e){super(t,Fs("lineWithErrorBars",e,Te,yt,[Me,We]))}}Kl.id=Te.id;class Oe extends pe{getMinMax(t,e){return Ls(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){He(t,e.xScale,s,n,r),He(t,e.yScale,s,n,r)}updateElement(t,e,s,n){t instanceof yt&&typeof e=="number"&&this.updateElementScale(e,s,n),super.updateElement(t,e,s,n)}updateElementScale(t,e,s){Ei(e,this.getParsed(t),t,this._cachedMeta.xScale,s==="reset"),Ei(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 yt&&this.updateElementScale(l,c,n)}}}Oe.id="scatterWithErrorBars";Oe.defaults=bt({},[pe.defaults,Is,{dataElementType:yt.id}]);Oe.overrides=bt({},[pe.overrides,{plugins:{tooltip:{callbacks:{label:pp}}}}]);Oe.defaultRoutes=$t.defaultRoutes;class Ql extends ht{constructor(t,e){super(t,Fs("scatterWithErrorBars",e,Oe,yt,[Me]))}}Ql.id=Oe.id;class Ge extends Ft{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 Ls(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}}He(t,o,s,n,r)}updateElement(t,e,s,n){typeof e=="number"&&gp(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}}Ge.id="polarAreaWithErrorBars";Ge.defaults=bt({},[Ft.defaults,Is,{dataElementType:qe.id}]);Ge.overrides=bt({},[Ft.overrides,{plugins:{tooltip:{callbacks:{label:bp}}}}]);Ge.defaultRoutes=Ft.defaultRoutes;class vp extends ht{constructor(t,e){super(t,Fs("polarAreaWithErrorBars",e,Ge,qe,[Le]))}}vp.id=Ge.id;ht.register(Te,Kl,yt,Ql,Oe,Me,We);class wp{constructor(t,e){k(this,"chart");k(this,"startTime");k(this,"endTime");k(this,"timeAggregation");k(this,"options");k(this,"chartOptions");k(this,"dataStorage");k(this,"status");k(this,"activeFields");k(this,"additionalYAxis");this.chart=t,this.options=e,this.startTime=O.now().minus(e.timeInterval),this.endTime=O.now(),e.startTime&&e.endTime&&(this.startTime=O.fromISO(e.startTime).setZone("UTC"),this.endTime=O.fromISO(e.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((s,n)=>this.dataStorage[n]={}),this.status="ready",this.chartOptions={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:{legend:{labels:{usePointStyle:!0,pointStyle:"rect",padding:5,sort:(s,n)=>s.text.localeCompare(n.text)},position:"right",onClick:(s,n)=>{if(n.hidden)this.setActiveFields([...this.activeFields,n.text]);else{const r=this.activeFields.indexOf(n.text),o=this.activeFields;o.splice(r,1),this.setActiveFields(o)}}},tooltip:{callbacks:{title:s=>{var r;return((r=s[0])==null?void 0:r.raw).x.toISODate()},label:s=>{const n=s.raw;return`${s.dataset.label}: ↔ ${n.y.toPrecision(3)}; ↓ ${n.yMin.toPrecision(3)}, ↑ ${n.yMax.toPrecision(3)}`}}}}};for(let s=0;s<this.additionalYAxis.length;s++){const n=this.additionalYAxis[s];this.chartOptions.scales[n.id]={type:"linear",position:"right"}}}checkLoadingStatus(){const t=document.getElementById("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"}fetchSignals(t,e,s){const n=this.options.features[t].map(c=>`feature=${c}`).join("&"),r=`${e?"&start_date="+e.toISODate():""}${s?"&end_date="+s.toISODate():""}`,o=`${this.options.endpoint}?source=${this.options.source}&${n}${r}`,a=this.options.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 Ul(c.statusText);if(c.status!==200)throw Error(c.statusText);return c}return hp(l,{onFailedAttempt:c=>{console.log(`Attempt ${c.attemptNumber} failed. There are ${c.retriesLeft} retries left.`)},retries:this.options.retries}).then(function(c){return c.json()})}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=[];Object.keys(this.dataStorage[n]).forEach(u=>{const d=this.dataStorage[n][u];d.status==="finished"?Object.keys(d.data).length!==0&&Object.keys(d.data).includes(e)&&r.push(...d.data[e]):r.push({date:"missing"})});let o=!1,a=Number.MIN_VALUE,l=Number.MAX_VALUE,c=r.map(u=>{let d={};if(u&&u.date!=="missing"){const f=u.basicStats;this.options.showMinMax?(l=f.min<l?f.min:l,a=f.max>a?f.max:a):(l=f.mean<l?f.mean:l,a=f.mean>a?f.mean:a),d={x:O.fromISO(u.date).setZone("UTC"),y:u.basicStats.mean,yMin:u.basicStats.min,yMax:u.basicStats.max},o=!0}return d});if(o&&this.timeAggregation){a=Number.MIN_VALUE,l=Number.MAX_VALUE;const u=[];let d=0,f=O.fromObject({year:this.startTime.year,month:this.startTime.month,day:this.startTime.day});for(;f<this.endTime;){let m=0,g=0,p=0;for(;d<c.length&&(Object.keys(c[d]).length===0||c[d].x<f);)d++;const b=d;for(;d<c.length&&(Object.keys(c[d]).length===0||c[d].x<f.plus(this.timeAggregation));){const _=c[d];m+=_.y,g+=_.yMin,p+=_.yMax,d++}const v=d-b;if(v>0){const _=m/v,x=g/v,w=p/v;this.options.showMinMax?(l=x<l?x:l,a=w>a?w:a):(l=_<l?_:l,a=_>a?_:a),u.push({x:f,y:_,yMin:x,yMax:w})}f=f.plus(this.timeAggregation)}c=u}o&&this.options.normalize&&(c=c.map(u=>(u.y=(u.y-l)/(a-l),u.yMin=(u.yMin-l)/(a-l),u.yMax=(u.yMax-l)/(a-l),u)));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.fetchSignals(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
- `});var 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.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 Mp{constructor(t,e,s,n){k(this,"element");k(this,"sdm");k(this,"sdmOptions");k(this,"options");this.element=t,this.sdm=e,this.options=n,this.sdmOptions=s,this.generateTimeAggregationOptions(),this.addNormalizeCheckbox(),this.addShowMinMax(),this.addCSVDownload(),this.generateTimeSelectionOptions();const r=document.createElement("span");r.id="loadingIndicator",r.className="loader hidden",this.element.appendChild(r)}removeStartEndInputs(){const t=document.getElementById("startInput"),e=document.getElementById("endInput"),s=document.getElementById("setTime");t&&e&&s&&(t.remove(),e.remove(),s.remove())}addStartEndInputs(){const t=document.createElement("input");t.id="startInput",t.size=8,t.value=this.sdm.startTime.toISODate();const e=document.createElement("input");e.id="endInput",e.size=8,e.value=this.sdm.endTime.toISODate(),this.element.appendChild(t),this.element.appendChild(e);var s=document.createElement("button");s.id="setTime",s.textContent="ok",this.element.appendChild(s),s.addEventListener("click",()=>{const n=O.fromISO(t.value),r=O.fromISO(e.value);n.isValid&&r.isValid?(this.sdm.setTimeInterval(n,r),this.removeStartEndInputs()):(t.className=n.isValid?"":"parsingError",e.className=r.isValid?"":"parsingError")})}addNormalizeCheckbox(){var t=document.createElement("input");t.type="checkbox",t.id="normalize",t.value="normalize",t.checked=this.sdmOptions.normalize;var e=document.createElement("label");e.htmlFor="normalize",e.appendChild(document.createTextNode("normalize")),this.element.appendChild(e),this.element.appendChild(t),t.addEventListener("change",()=>{this.sdm.setNormalize(t.checked)})}addShowMinMax(){var t=document.createElement("input");t.type="checkbox",t.id="showMinMax",t.value="showMinMax",t.checked=this.sdmOptions.showMinMax;var e=document.createElement("label");e.htmlFor="showMinMax",e.appendChild(document.createTextNode("show min/max")),this.element.appendChild(e),this.element.appendChild(t),t.addEventListener("change",()=>{this.sdm.setShowMinMax(t.checked)})}addCSVDownload(){var t=document.createElement("button");t.id="csvDownload",t.textContent="download csv",this.element.appendChild(t),t.addEventListener("click",()=>{this.sdm.triggerCSVDownload()})}generateTimeSelectionOptions(){const t=[{text:"3 months back",value:"month-3"},{text:"6 months back",value:"month-6"},{text:"1 year back",value:"year-1"},{text:"2 years back",value:"year-2"},{text:"3 years back",value:"year-3"},{text:"custom",value:"custom"}],e=document.createElement("select");t.forEach(s=>{const n=document.createElement("option");n.text=s.text,n.value=s.value,e.appendChild(n)}),this.element.appendChild(e),e.addEventListener("change",s=>{const n=O.now(),[r,o]=s.target.value.split("-");switch(this.removeStartEndInputs(),r){case"month":this.sdm.setTimeInterval(n.minus({month:Number(o)}),n);break;case"year":this.sdm.setTimeInterval(n.minus({year:Number(o)}),n);break;case"custom":this.addStartEndInputs();break}})}generateTimeAggregationOptions(){const t=[{text:"no aggregation",value:"none"},{text:"1 week",value:"week-1"},{text:"2 weeks",value:"week-2"},{text:"1 month",value:"month-1"},{text:"3 months",value:"month-3"},{text:"6 months",value:"month-6"}],e=document.createElement("select");t.forEach(n=>{const r=document.createElement("option");r.text=n.text,r.value=n.value,e.appendChild(r)}),this.element.appendChild(e),e.addEventListener("change",n=>{const[r,o]=n.target.value.split("-");switch(r){case"none":this.sdm.setTimeAggregation(null);break;case"week":this.sdm.setTimeAggregation({week:Number(o)});break;case"month":this.sdm.setTimeAggregation({month:Number(o)});break;case"year":this.sdm.setTimeAggregation({year:Number(o)});break}});const s=document.createElement("span");s.id="loadingIndicator",s.className="loader hidden",this.element.appendChild(s)}}const de=new ht(document.getElementById("chart"),{data:{labels:[],datasets:[]},plugins:[{id:"selectionLineHighlight",afterDraw:i=>{if(i&&i.tooltip){const t=i.tooltip.getActiveElements();if(t!=null&&t.length){let e=t[0].element.x,s=i.scales.y,n=i.ctx;n.save(),n.beginPath(),n.moveTo(e,s.top),n.lineTo(e,s.bottom),n.lineWidth=1,n.strokeStyle="rgba(0, 0, 255, 0.4)",n.stroke(),n.restore()}}}}]});let vi=null,Mn;window.addEventListener("message",i=>{i.data==="init"&&(Mn=i.ports[0],Mn.onmessage=Sp)});const Sp=i=>{if(i.data.ts)switch(i.data.type){case"getFoo":console.log(i.data.body),Mn.postMessage({ts:i.data.ts,body:"foo bar"});break}else switch(i.data.type){case"setData":de.data=i.data.body.data,de.update("none");break;case"setSignalsEndpoint":kp(i.data.body.options);break;case"setSignalsGeometry":Tp(i.data.body.geometry);break;case"setSignalsData":de.data={datasets:Object.entries(i.data.body.data).map(([t,e])=>({type:"line",label:t,data:e}))},de.update("none");break;case"setOptions":de.options=i.data.body.options,de.update("none");break}},kp=i=>{vi=new wp(de,i),new Mp(document.getElementById("controls"),vi,i),vi.setActiveFields(i.active)},Tp=i=>{vi&&vi.setGeometry(i)};