@eox/chart 2.0.0-alpha2 → 2.0.0-alpha4
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.
- package/cypress/e2e/signalsEndpoint.cy.ts +28 -4
- package/dist/assets/main-998f4938.js +23 -0
- package/dist/index.html +11 -2
- package/index.html +10 -1
- package/package.json +2 -2
- package/src/chartControls.ts +59 -20
- package/src/interface.ts +1 -0
- package/src/main.ts +1 -1
- package/src/signalsDataManager.ts +108 -22
- package/dist/assets/main-7d9c1cfa.js +0 -23
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var Sl=Object.defineProperty;var Ml=(i,t,e)=>t in i?Sl(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var k=(i,t,e)=>(Ml(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 o of n)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function e(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(n){if(n.ep)return;n.ep=!0;const o=e(n);fetch(n.href,o)}})();/*!
|
|
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 di(i){return i+.5|0}const jt=(i,t,e)=>Math.max(Math.min(i,e),t);function $e(i){return jt(di(i*2.55),0,255)}function qt(i){return jt(di(i*255),0,255)}function Lt(i){return jt(di(i/2.55)/100,0,1)}function En(i){return jt(di(i*100),0,100)}const gt={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},zs=[..."0123456789ABCDEF"],kl=i=>zs[i&15],Tl=i=>zs[(i&240)>>4]+zs[i&15],_i=i=>(i&240)>>4===(i&15),Ol=i=>_i(i.r)&&_i(i.g)&&_i(i.b)&&_i(i.a);function Dl(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255>[i[1]]*17,g:255>[i[2]]*17,b:255>[i[3]]*17,a:t===5?gt[i[4]]*17:255}:(t===7||t===9)&&(e={r:gt[i[1]]<<4|gt[i[2]],g:gt[i[3]]<<4|gt[i[4]],b:gt[i[5]]<<4|gt[i[6]],a:t===9?gt[i[7]]<<4|gt[i[8]]:255})),e}const Cl=(i,t)=>i<255?t(i):"";function El(i){var t=Ol(i)?kl:Tl;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Cl(i.a,t):void 0}const Pl=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Sr(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Al(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Il(i,t,e){const s=Sr(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 Ll(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 ln(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),r=Math.min(e,s,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=Ll(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function cn(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(qt)}function hn(i,t,e){return cn(Sr,i,t,e)}function Fl(i,t,e){return cn(Il,i,t,e)}function Rl(i,t,e){return cn(Al,i,t,e)}function Mr(i){return(i%360+360)%360}function Nl(i){const t=Pl.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?$e(+t[5]):qt(+t[5]));const n=Mr(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=Fl(n,o,r):t[1]==="hsv"?s=Rl(n,o,r):s=hn(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function zl(i,t){var e=ln(i);e[0]=Mr(e[0]+t),e=hn(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Vl(i){if(!i)return;const t=ln(i),e=t[0],s=En(t[1]),n=En(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${Lt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Pn={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"},An={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 Wl(){const i={},t=Object.keys(An),e=Object.keys(Pn);let s,n,o,r,a;for(s=0;s<t.length;s++){for(r=a=t[s],n=0;n<e.length;n++)o=e[n],a=a.replace(o,Pn[o]);o=parseInt(An[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let wi;function Bl(i){wi||(wi=Wl(),wi.transparent=[0,0,0,0]);const t=wi[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Hl=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function $l(i){const t=Hl.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?$e(r):jt(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?$e(s):jt(s,0,255)),n=255&(t[4]?$e(n):jt(n,0,255)),o=255&(t[6]?$e(o):jt(o,0,255)),{r:s,g:n,b:o,a:e}}}function jl(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Lt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const xs=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,be=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Ul(i,t,e){const s=be(Lt(i.r)),n=be(Lt(i.g)),o=be(Lt(i.b));return{r:qt(xs(s+e*(be(Lt(t.r))-s))),g:qt(xs(n+e*(be(Lt(t.g))-n))),b:qt(xs(o+e*(be(Lt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function vi(i,t,e){if(i){let s=ln(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=hn(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function kr(i,t){return i&&Object.assign(t||{},i)}function In(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=kr(i,{r:0,g:0,b:0,a:1}),t.a=qt(t.a)),t}function Yl(i){return i.charAt(0)==="r"?$l(i):Nl(i)}class ni{constructor(t){if(t instanceof ni)return t;const e=typeof t;let s;e==="object"?s=In(t):e==="string"&&(s=Dl(t)||Bl(t)||Yl(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=kr(this._rgb);return t&&(t.a=Lt(t.a)),t}set rgb(t){this._rgb=In(t)}rgbString(){return this._valid?jl(this._rgb):void 0}hexString(){return this._valid?El(this._rgb):void 0}hslString(){return this._valid?Vl(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Ul(this._rgb,t._rgb,e)),this}clone(){return new ni(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=di(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 vi(this._rgb,2,t),this}darken(t){return vi(this._rgb,2,-t),this}saturate(t){return vi(this._rgb,1,t),this}desaturate(t){return vi(this._rgb,1,-t),this}rotate(t){return zl(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 Pt(){}const Zl=(()=>{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 A(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function Z(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function ut(i,t){return Z(i)?i:t}function C(i,t){return typeof i>"u"?t:i}const ql=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Tr=(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,o,r;if(H(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;n<o;n++)t.call(e,i[n],n);else if(A(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function Ji(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Ki(i){if(H(i))return i.map(Ki);if(A(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=Ki(i[e[n]]);return t}return i}function Or(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Xl(i,t,e,s){if(!Or(i))return;const n=t[i],o=e[i];A(n)&&A(o)?oi(n,o,s):t[i]=Ki(o)}function oi(i,t,e){const s=H(t)?t:[t],n=s.length;if(!A(i))return i;e=e||{};const o=e.merger||Xl;let r;for(let a=0;a<n;++a){if(r=s[a],!A(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function Ge(i,t){return oi(i,t,{merger:Gl})}function Gl(i,t,e){if(!Or(i))return;const s=t[i],n=e[i];A(s)&&A(n)?Ge(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Ki(n))}const Ln={"":i=>i,x:i=>i.x,y:i=>i.y};function Jl(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 Kl(i){const t=Jl(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Xt(i,t){return(Ln[t]||(Ln[t]=Kl(t)))(i)}function un(i){return i.charAt(0).toUpperCase()+i.slice(1)}const yt=i=>typeof i<"u",Gt=i=>typeof i=="function",Fn=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Ql(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const U=Math.PI,$=2*U,tc=$+U,Qi=Number.POSITIVE_INFINITY,ec=U/180,q=U/2,Kt=U/4,Rn=U*2/3,Ut=Math.log10,Et=Math.sign;function Je(i,t,e){return Math.abs(i-t)<e}function Nn(i){const t=Math.round(i);i=Je(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Ut(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,o)=>n-o).pop(),t}function Se(i){return!isNaN(parseFloat(i))&&isFinite(i)}function sc(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Dr(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function St(i){return i*(U/180)}function dn(i){return i*(180/U)}function zn(i){if(!Z(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Cr(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*U&&(o+=$),{angle:o,distance:n}}function Vs(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function nc(i,t){return(i-t+tc)%$-U}function dt(i){return(i%$+$)%$}function ri(i,t,e,s){const n=dt(i),o=dt(t),r=dt(e),a=dt(o-n),l=dt(r-n),c=dt(n-o),h=dt(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function tt(i,t,e){return Math.max(t,Math.min(e,i))}function oc(i){return tt(i,-32768,32767)}function Rt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function fn(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Nt=(i,t,e,s)=>fn(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),rc=(i,t,e)=>fn(i,e,s=>i[s][t]>=e);function ac(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 Er=["push","pop","shift","splice","unshift"];function lc(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Er.forEach(e=>{const s="_onData"+un(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function Vn(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)&&(Er.forEach(o=>{delete i[o]}),delete i._chartjs)}function Pr(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 Ar=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Ir(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Ar.call(window,()=>{s=!1,i.apply(t,e)}))}}function cc(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const gn=i=>i==="start"?"left":i==="end"?"right":"center",st=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,hc=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function Lr(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:u,maxDefined:d}=r.getUserBounds();u&&(n=tt(Math.min(Nt(a,r.axis,c).lo,e?s:Nt(t,l,r.getPixelForValue(c)).lo),0,s-1)),d?o=tt(Math.max(Nt(a,r.axis,h,!0).hi+1,e?0:Nt(t,l,r.getPixelForValue(h),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function Fr(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 o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const Si=i=>i===0||i===1,Wn=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*$/e)),Bn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*$/e)+1,Ke={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=>Si(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=>Si(i)?i:Wn(i,.075,.3),easeOutElastic:i=>Si(i)?i:Bn(i,.075,.3),easeInOutElastic(i){return Si(i)?i:i<.5?.5*Wn(i*2,.1125,.45):.5+.5*Bn(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-Ke.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?Ke.easeInBounce(i*2)*.5:Ke.easeOutBounce(i*2-1)*.5+.5};function Rr(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Hn(i){return Rr(i)?i:new ni(i)}function _s(i){return Rr(i)?i:new ni(i).saturate(.5).darken(.1).hexString()}const uc=["x","y","borderWidth","radius","tension"],dc=["color","borderColor","backgroundColor"];function fc(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:dc},numbers:{type:"number",properties:uc}}),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 gc(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const $n=new Map;function mc(i,t){t=t||{};const e=i+JSON.stringify(t);let s=$n.get(e);return s||(s=new Intl.NumberFormat(i,t),$n.set(e,s)),s}function fi(i,t,e){return mc(t,e).format(i)}const Nr={values(i){return H(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=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"),o=pc(i,e)}const r=Ut(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),fi(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(Ut(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?Nr.numeric.call(this,i,t,e):""}};function pc(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 hs={formatters:Nr};function bc(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:hs.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 ue=Object.create(null),Ws=Object.create(null);function Qe(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function ws(i,t,e){return typeof t=="string"?oi(Qe(i,t),e):oi(Qe(i,""),t)}class yc{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)=>_s(n.backgroundColor),this.hoverBorderColor=(s,n)=>_s(n.borderColor),this.hoverColor=(s,n)=>_s(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 ws(this,t,e)}get(t){return Qe(this,t)}describe(t,e){return ws(Ws,t,e)}override(t,e){return ws(ue,t,e)}route(t,e,s,n){const o=Qe(this,t),r=Qe(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return A(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var G=new yc({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[fc,gc,bc]);function xc(i){return!i||F(i.size)||F(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ts(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function _c(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let r=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)r=ts(i,n,o,r,u);else if(H(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!H(d)&&(r=ts(i,n,o,r,d));i.restore();const f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete n[o[l]];o.splice(0,f)}return r}function Qt(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 jn(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function Bs(i,t,e,s){zr(i,t,e,s,null)}function zr(i,t,e,s,n){let o,r,a,l,c,h,u,d;const f=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*ec;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(p),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(m)||m<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,m,0,0,$):i.arc(e,s,m,0,$),i.closePath();break;case"triangle":h=n?n/2:m,i.moveTo(e+Math.sin(p)*h,s-Math.cos(p)*m),p+=Rn,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*m),p+=Rn,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,r=Math.cos(p+Kt)*l,u=Math.cos(p+Kt)*(n?n/2-c:l),a=Math.sin(p+Kt)*l,d=Math.sin(p+Kt)*(n?n/2-c:l),i.arc(e-u,s-a,c,p-U,p-q),i.arc(e+d,s-r,c,p-q,p),i.arc(e+u,s+a,c,p,p+q),i.arc(e-d,s+r,c,p+q,p+U),i.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}p+=Kt;case"rectRot":u=Math.cos(p)*(n?n/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),i.moveTo(e-u,s-a),i.lineTo(e+d,s-r),i.lineTo(e+u,s+a),i.lineTo(e-d,s+r),i.closePath();break;case"crossRot":p+=Kt;case"cross":u=Math.cos(p)*(n?n/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),i.moveTo(e-u,s-a),i.lineTo(e+u,s+a),i.moveTo(e+d,s-r),i.lineTo(e-d,s+r);break;case"star":u=Math.cos(p)*(n?n/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),i.moveTo(e-u,s-a),i.lineTo(e+u,s+a),i.moveTo(e+d,s-r),i.lineTo(e-d,s+r),p+=Kt,u=Math.cos(p)*(n?n/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(n?n/2:m),i.moveTo(e-u,s-a),i.lineTo(e+u,s+a),i.moveTo(e+d,s-r),i.lineTo(e-d,s+r);break;case"line":r=n?n/2:Math.cos(p)*m,a=Math.sin(p)*m,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(p)*(n?n/2:m),s+Math.sin(p)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ai(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 us(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function ds(i){i.restore()}function wc(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,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 vc(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 de(i,t,e,s,n,o={}){const r=H(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Sc(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&kc(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),F(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),Mc(i,e,s,c,o),s+=n.lineHeight;i.restore()}function Sc(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 Mc(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function kc(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function li(i,t){const{x:e,y:s,w:n,h:o,radius:r}=t;i.arc(e+r.topLeft,s+r.topLeft,r.topLeft,-q,U,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,U,q,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,q,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-q,!0),i.lineTo(e+r.topLeft,s)}const Tc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Oc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Dc(i,t){const e=(""+i).match(Tc);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 Cc=i=>+i||0;function mn(i,t){const e={},s=A(t),n=s?Object.keys(t):t,o=A(i)?s?r=>C(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=Cc(o(r));return e}function Vr(i){return mn(i,{top:"y",right:"x",bottom:"y",left:"x"})}function le(i){return mn(i,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(i){const t=Vr(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=C(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=C(i.style,t.style);s&&!(""+s).match(Oc)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:C(i.family,t.family),lineHeight:Dc(C(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:C(i.weight,t.weight),string:""};return n.string=xc(n),n}function je(i,t,e,s){let n=!0,o,r,a;for(o=0,r=i.length;o<r;++o)if(a=i[o],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 Ec(i,t,e){const{min:s,max:n}=i,o=Tr(t,(n-s)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function Jt(i,t){return Object.assign(Object.create(i),t)}function pn(i,t=[""],e=i,s,n=()=>i[0]){yt(s)||(s=$r("_fallback",i));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:s,_getTarget:n,override:r=>pn([r,...i],t,e,s)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete i[0][a],!0},get(r,a){return Br(r,a,()=>zc(a,t,i,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,a){return Yn(r).includes(a)},ownKeys(r){return Yn(r)},set(r,a,l){const c=r._storage||(r._storage=n());return r[a]=c[a]=l,delete r._keys,!0}})}function Me(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Wr(i,s),setContext:o=>Me(i,o,e,s),override:o=>Me(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return Br(o,r,()=>Ac(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function Wr(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Gt(e)?e:()=>e,isIndexable:Gt(s)?s:()=>s}}const Pc=(i,t)=>i?i+un(t):t,bn=(i,t)=>A(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Br(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function Ac(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return Gt(a)&&r.isScriptable(t)&&(a=Ic(t,a,i,e)),H(a)&&a.length&&(a=Lc(t,a,i,r.isIndexable)),bn(t,a)&&(a=Me(a,n,o&&o[t],r)),a}function Ic(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),t=t(o,r||s),a.delete(i),bn(i,t)&&(t=yn(n._scopes,n,i,t)),t}function Lc(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(yt(o.index)&&s(i))t=t[o.index%t.length];else if(A(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=yn(c,n,i,h);t.push(Me(u,o,r&&r[i],a))}}return t}function Hr(i,t,e){return Gt(i)?i(t,e):i}const Fc=(i,t)=>i===!0?t:typeof i=="string"?Xt(t,i):void 0;function Rc(i,t,e,s,n){for(const o of t){const r=Fc(e,o);if(r){i.add(r);const a=Hr(r._fallback,e,n);if(yt(a)&&a!==e&&a!==s)return a}else if(r===!1&&yt(s)&&e!==s)return null}return!1}function yn(i,t,e,s){const n=t._rootScopes,o=Hr(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Un(a,r,e,o||e,s);return l===null||yt(o)&&o!==e&&(l=Un(a,r,o,l,s),l===null)?!1:pn(Array.from(a),[""],n,o,()=>Nc(t,e,s))}function Un(i,t,e,s,n){for(;e;)e=Rc(i,t,e,s,n);return e}function Nc(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return H(n)&&A(e)?e:n||{}}function zc(i,t,e,s){let n;for(const o of t)if(n=$r(Pc(o,i),e),yt(n))return bn(i,n)?yn(e,s,i,n):n}function $r(i,t){for(const e of t){if(!e)continue;const s=e[i];if(yt(s))return s}}function Yn(i){let t=i._keys;return t||(t=i._keys=Vc(i._scopes)),t}function Vc(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 jr(i,t,e,s){const{iScale:n}=i,{key:o="r"}=this._parsing,r=new Array(s);let a,l,c,h;for(a=0,l=s;a<l;++a)c=a+e,h=t[c],r[a]={r:n.parse(Xt(h,o),c)};return r}const Wc=Number.EPSILON||1e-14,ke=(i,t)=>t<i.length&&!i[t].skip&&i[t],Ur=i=>i==="x"?"y":"x";function Bc(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=Vs(o,n),l=Vs(r,o);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:o.x-u*(r.x-n.x),y:o.y-u*(r.y-n.y)},next:{x:o.x+d*(r.x-n.x),y:o.y+d*(r.y-n.y)}}}function Hc(i,t,e){const s=i.length;let n,o,r,a,l,c=ke(i,0);for(let h=0;h<s-1;++h)if(l=c,c=ke(i,h+1),!(!l||!c)){if(Je(t[h],0,Wc)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=n*r*t[h],e[h+1]=o*r*t[h])}}function $c(i,t,e="x"){const s=Ur(e),n=i.length;let o,r,a,l=ke(i,0);for(let c=0;c<n;++c){if(r=a,a=l,l=ke(i,c+1),!a)continue;const h=a[e],u=a[s];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${s}`]=u-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${s}`]=u+o*t[c])}}function jc(i,t="x"){const e=Ur(t),s=i.length,n=Array(s).fill(0),o=Array(s);let r,a,l,c=ke(i,0);for(r=0;r<s;++r)if(a=l,l=c,c=ke(i,r+1),!!l){if(c){const h=c[t]-l[t];n[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?Et(n[r-1])!==Et(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}Hc(i,n,o),$c(i,o,t)}function Mi(i,t,e){return Math.max(Math.min(i,e),t)}function Uc(i,t){let e,s,n,o,r,a=ai(i[0],t);for(e=0,s=i.length;e<s;++e)r=o,o=a,a=e<s-1&&ai(i[e+1],t),o&&(n=i[e],r&&(n.cp1x=Mi(n.cp1x,t.left,t.right),n.cp1y=Mi(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=Mi(n.cp2x,t.left,t.right),n.cp2y=Mi(n.cp2y,t.top,t.bottom)))}function Yc(i,t,e,s,n){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")jc(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=Bc(c,a,i[Math.min(o+1,r-(s?0:1))%r],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&&Uc(i,e)}function Yr(){return typeof window<"u"&&typeof document<"u"}function xn(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function es(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 fs=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Zc(i,t){return fs(i).getPropertyValue(t)}const qc=["top","right","bottom","left"];function ce(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=qc[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Xc=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Gc(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(Xc(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function se(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=fs(e),o=n.boxSizing==="border-box",r=ce(n,"padding"),a=ce(n,"border","width"),{x:l,y:c,box:h}=Gc(i,e),u=r.left+(h&&a.left),d=r.top+(h&&a.top);let{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-u)/f*e.width/s),y:Math.round((c-d)/g*e.height/s)}}function Jc(i,t,e){let s,n;if(t===void 0||e===void 0){const o=xn(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=fs(o),l=ce(a,"border","width"),c=ce(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=es(a.maxWidth,o,"clientWidth"),n=es(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Qi,maxHeight:n||Qi}}const ki=i=>Math.round(i*10)/10;function Kc(i,t,e,s){const n=fs(i),o=ce(n,"margin"),r=es(n.maxWidth,i,"clientWidth")||Qi,a=es(n.maxHeight,i,"clientHeight")||Qi,l=Jc(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const d=ce(n,"border","width"),f=ce(n,"padding");c-=f.width+d.width,h-=f.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=ki(Math.min(c,r,l.maxWidth)),h=ki(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ki(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=ki(Math.floor(h*s))),{width:c,height:h}}function Zn(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Qc=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 qn(i,t){const e=Zc(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function ne(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function th(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 eh(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=ne(i,n,e),a=ne(n,o,e),l=ne(o,t,e),c=ne(r,a,e),h=ne(a,l,e);return ne(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}}},sh=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function we(i,t,e){return i?ih(t,e):sh()}function Zr(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 qr(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Xr(i){return i==="angle"?{between:ri,compare:nc,normalize:dt}:{between:Rt,compare:(t,e)=>t-e,normalize:t=>t}}function Xn({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 nh(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=Xr(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&&r(a(t[c%l][s]),n,o);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:i.style}}function Gr(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=Xr(s),{start:h,end:u,loop:d,style:f}=nh(i,t,e),g=[];let m=!1,p=null,b,y,_;const w=()=>l(n,_,b)&&a(n,_)!==0,x=()=>a(o,b)===0||l(o,_,b),M=()=>m||w(),v=()=>!m||x();for(let S=h,D=h;S<=u;++S)y=t[S%r],!y.skip&&(b=c(y[s]),b!==_&&(m=l(b,n,o),p===null&&M()&&(p=a(b,n)===0?S:D),p!==null&&v()&&(g.push(Xn({start:p,end:S,loop:d,count:r,style:f})),p=null),D=S,_=b));return p!==null&&g.push(Xn({start:p,end:u,loop:d,count:r,style:f})),g}function Jr(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=Gr(s[n],i.points,t);o.length&&e.push(...o)}return e}function oh(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function rh(i,t,e,s){const n=i.length,o=[];let r=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,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function ah(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=oh(e,n,o,s);if(s===!0)return Gn(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,c=!!i._fullLoop&&r===0&&a===n-1;return Gn(i,rh(e,r,l,c),e,t)}function Gn(i,t,e,s){return!s||!s.setContext||!e?t:lh(i,t,e,s)}function lh(i,t,e,s){const n=i._chart.getContext(),o=Jn(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,u=t[0].start,d=u;function f(g,m,p,b){const y=a?-1:1;if(g!==m){for(g+=l;e[g%l].skip;)g-=y;for(;e[m%l].skip;)m+=y;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:p,style:b}),h=b,u=m%l)}}for(const g of t){u=a?u:g.start;let m=e[u%l],p;for(d=u+1;d<=g.end;d++){const b=e[d%l];p=Jn(s.setContext(Jt(n,{type:"segment",p0:m,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:r}))),ch(p,h)&&f(u,d-1,g.loop,h),m=b,h=p}u<d-1&&f(u,d-1,g.loop,h)}return c}function Jn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function ch(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 hh{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Ar.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 o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.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 At=new hh;const Kn="transparent",uh={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Hn(i||Kn),n=s.valid&&Hn(t||Kn);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class dh{constructor(t,e,s,n){const o=e[s];n=je([t.to,n,o,t.from]);const r=je([t.from,o,n]);this._active=!0,this._fn=t.fn||uh[t.type||typeof r],this._easing=Ke[t.easing]||Ke.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=r,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],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=je([t.to,e,n,t.from]),this._from=je([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,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){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 Kr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!A(t))return;const e=Object.keys(G.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!A(o))return;const r={};for(const a of e)r[a]=o[a];(H(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=gh(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&fh(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let u=o[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}o[c]=u=new dh(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 At.add(this._chart,s),!0}}function fh(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function gh(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 Qn(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function mh(i,t,e){if(e===!1)return!1;const s=Qn(i,e),n=Qn(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function ph(i){let t,e,s,n;return A(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Qr(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function to(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let r,a,l,c;if(t!==null){for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(s.all)continue;break}c=i.values[l],Z(c)&&(o||t===0||Et(t)===Et(c))&&(t+=c)}return t}}function bh(i){const t=Object.keys(i),e=new Array(t.length);let s,n,o;for(s=0,n=t.length;s<n;++s)o=t[s],e[s]={x:o,y:i[o]};return e}function eo(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function yh(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function xh(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 _h(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function io(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function so(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=yh(o,r,s),u=t.length;let d;for(let f=0;f<u;++f){const g=t[f],{[l]:m,[c]:p}=g,b=g._stacks||(g._stacks={});d=b[c]=_h(n,h,m),d[a]=p,d._top=io(d,r,!0,s.type),d._bottom=io(d,r,!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 wh(i,t){return Jt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function vh(i,t,e){return Jt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Fe(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 o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const Ss=i=>i==="reset"||i==="none",no=(i,t)=>t?i:Object.assign({},i),Sh=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Qr(e,!0),values:null};class kt{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=eo(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&&Fe(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(u,d,f,g)=>u==="x"?d:u==="r"?g:f,o=e.xAxisID=C(s.xAxisID,vs(t,"x")),r=e.yAxisID=C(s.yAxisID,vs(t,"y")),a=e.rAxisID=C(s.rAxisID,vs(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),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&&Vn(this._data,this),t._stacked&&Fe(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(A(e))this._data=bh(e);else if(s!==e){if(s){Vn(s,this);const n=this._cachedMeta;Fe(n),n._parsed=[]}e&&Object.isExtensible(e)&&lc(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 o=e._stacked;e._stacked=eo(e.vScale,e),e.stack!==s.stack&&(n=!0,Fe(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&so(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:o,_stacked:r}=s,a=o.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):A(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}r&&so(this,d)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,u=new Array(n);let d,f,g;for(d=0,f=n;d<f;++d)g=d+s,u[d]={[a]:h||o.parse(c[g],g),[l]:r.parse(e[g],g)};return u}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=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:o.parse(u[0],h),y:r.parse(u[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=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:o.parse(Xt(f,a),d),y:r.parse(Xt(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Qr(n,!0),values:e._stacks[t.axis]._visualValues};return to(a,r,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let r=o===null?NaN:o;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,r=to(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,r=n.length,a=this._getOtherScale(t),l=Sh(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=xh(a);let d,f;function g(){f=n[d];const m=f[a.axis];return!Z(f[t.axis])||h>m||u<m}for(d=0;d<r&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++d);if(o){for(d=r-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],Z(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=ph(C(this.options.clip,mh(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const u=n[h];u.hidden||(u.active&&c?r.push(u):u.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}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 o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=vh(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=wh(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}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",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&yt(s);if(a)return no(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]),g=()=>this.getContext(s,n,e),m=c.resolveNamedOptions(d,f,g,u);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(no(m,l))),m}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];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 Kr(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ss(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){Ss(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Ss(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}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,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,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&&Fe(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(kt,"defaults",{}),k(kt,"datasetElementType",null),k(kt,"dataElementType",null);function Mh(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let s=[];for(let n=0,o=e.length;n<o;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=Pr(s.sort((n,o)=>n-o))}return i._cache.$bar}function kh(i){const t=i.iScale,e=Mh(t,i.type);let s=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(yt(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(n=0,o=e.length;n<o;++n)r=t.getPixelForValue(e[n]),l();for(a=void 0,n=0,o=t.ticks.length;n<o;++n)r=t.getPixelForTick(n),l();return s}function Th(i,t,e,s){const n=e.barThickness;let o,r;return F(n)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=n*s,r=1),{chunk:o/s,ratio:r,start:t.pixels[i]-o/2}}function Oh(i,t,e,s){const n=t.pixels,o=n[i];let r=i>0?n[i-1]:null,a=i<n.length-1?n[i+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/s,ratio:e.barPercentage,start:c}}function Dh(i,t,e,s){const n=e.parse(i[0],s),o=e.parse(i[1],s),r=Math.min(n,o),a=Math.max(n,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function ta(i,t,e,s){return H(i)?Dh(i,t,e,s):t[e.axis]=e.parse(i,s),t}function oo(i,t,e,s){const n=i.iScale,o=i.vScale,r=n.getLabels(),a=n===o,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(r[c],c),l.push(ta(d,u,o,c));return l}function Ms(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function Ch(i,t,e){return i!==0?Et(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Eh(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:s,reverse:t,top:n,bottom:o}}function Ph(i,t,e,s){let n=t.borderSkipped;const o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=Eh(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=h:(o[ro(h,r,a,l)]=!0,n=c)),o[ro(n,r,a,l)]=!0,i.borderSkipped=o}function ro(i,t,e,s){return s?(i=Ah(i,t,e),i=ao(i,e,t)):i=ao(i,t,e),i}function Ah(i,t,e){return i===t?e:i===e?t:i}function ao(i,t,e){return i==="start"?t:i==="end"?e:i}function Ih(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class Vi extends kt{parsePrimitiveData(t,e,s,n){return oo(t,e,s,n)}parseArrayData(t,e,s,n){return oo(t,e,s,n)}parseObjectData(t,e,s,n){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,h=r.axis==="x"?a:l,u=[];let d,f,g,m;for(d=s,f=s+n;d<f;++d)m=e[d],g={},g[o.axis]=o.parse(Xt(m,c),d),u.push(ta(Xt(m,h),g,r,d));return u}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);const o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:n}=e,o=this.getParsed(t),r=o._custom,a=Ms(r)?"["+r.start+", "+r.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+s.getLabelForValue(o[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 o=n==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,n);for(let f=e;f<e+s;f++){const g=this.getParsed(f),m=o||F(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,h),b=(g._stacks||{})[a.axis],y={horizontal:c,base:m.base,enableBorderRadius:!b||Ms(g._custom)||r===b._top||r===b._bottom,x:c?m.head:p.center,y:c?p.center:m.head,height:c?p.size:Math.abs(m.size),width:c?Math.abs(m.size):p.size};d&&(y.options=u||this.resolveDataElementOptions(f,t[f].active?"active":n));const _=y.options||t[f].options;Ph(y,_,b,r),Ih(y,_,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),o=s.options.stacked,r=[],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))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o<r;++o)n.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const a=t.barThickness;return{min:a||kh(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:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=Ms(c);let u=l[e.axis],d=0,f=s?this.applyStack(e,l,s):u,g,m;f!==u&&(d=f-u,f=u),h&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Et(u)!==Et(c.barEnd)&&(d=0),d+=u);const p=!F(o)&&!h?o:d;let b=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(d+f):g=b,m=g-b,Math.abs(m)<r){m=Ch(m,e,a)*r,u===a&&(b-=m/2);const y=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),w=Math.min(y,_),x=Math.max(y,_);b=Math.max(Math.min(b,x),w),g=b+m,s&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(g)-e.getValueForPixel(b))}if(b===e.getPixelForValue(a)){const y=Et(m)*e.getLineWidthForValue(a)/2;b+=y,m-=y}return{size:m,base:b,head:g,center:g+m/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,o=n.skipNull,r=C(n.maxBarThickness,1/0);let a,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=n.barThickness==="flex"?Oh(t,e,n,c):Th(t,e,n,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=h.start+h.chunk*u+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=s.getPixelForValue(this.getParsed(t)[s.axis],t),l=Math.min(r,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 o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&s[o].draw(this._ctx)}}k(Vi,"id","bar"),k(Vi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),k(Vi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Wi extends kt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,s,n){const o=super.parsePrimitiveData(t,e,s,n);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+s).radius;return o}parseArrayData(t,e,s,n){const o=super.parseArrayData(t,e,s,n);for(let r=0;r<o.length;r++){const a=e[s+r];o[r]._custom=C(a[2],this.resolveDataElementOptions(r+s).radius)}return o}parseObjectData(t,e,s,n){const o=super.parseObjectData(t,e,s,n);for(let r=0;r<o.length;r++){const a=e[s+r];o[r]._custom=C(a&&a.r&&+a.r,this.resolveDataElementOptions(r+s).radius)}return o}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:o}=e,r=this.getParsed(t),a=n.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._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 o=n==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=r.axis,u=a.axis;for(let d=e;d<e+s;d++){const f=t[d],g=!o&&this.getParsed(d),m={},p=m[h]=o?r.getPixelForDecimal(.5):r.getPixelForValue(g[h]),b=m[u]=o?a.getBasePixel():a.getPixelForValue(g[u]);m.skip=isNaN(p)||isNaN(b),c&&(m.options=l||this.resolveDataElementOptions(d,f.active?"active":n),o&&(m.options.radius=0)),this.updateElement(f,d,m,n)}}resolveDataElementOptions(t,e){const s=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const o=n.radius;return e!=="active"&&(n.radius=0),n.radius+=C(s&&s._custom,o),n}}k(Wi,"id","bubble"),k(Wi,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),k(Wi,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Lh(i,t,e){let s=1,n=1,o=0,r=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=(_,w,x)=>ri(_,a,l,!0)?1:Math.max(w,w*e,x,x*e),g=(_,w,x)=>ri(_,a,l,!0)?-1:Math.min(w,w*e,x,x*e),m=f(0,c,u),p=f(q,h,d),b=g(U,c,u),y=g(U+q,h,d);s=(m-b)/2,n=(p-y)/2,o=-(m+b)/2,r=-(p+y)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}class ae extends kt{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 o=l=>+s[l];if(A(s[t])){const{key:l="value"}=this._parsing;o=c=>+Xt(s[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)n._parsed[r]=o(r)}}_getRotation(){return St(this.options.rotation-90)}_getCircumference(){return St(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,o=n._getRotation(),r=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(s.width,s.height)-r)/2,0),l=Math.min(ql(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:g,offsetY:m}=Lh(u,h,l),p=(s.width-r)/d,b=(s.height-r)/f,y=Math.max(Math.min(p,b)/2,0),_=Tr(this.options.radius,y),w=Math.max(_*l,0),x=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=m*_,n.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,n=this._cachedMeta,o=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]*o/$)}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=o&&c.animateScale,f=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:m,includeOptions:p}=this._getSharedOptions(e,n);let b=this._getRotation(),y;for(y=0;y<e;++y)b+=this._circumference(y,o);for(y=e;y<e+s;++y){const _=this._circumference(y,o),w=t[y],x={x:h+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:g,innerRadius:f};p&&(x.options=m||this.resolveDataElementOptions(y,w.active?"active":n)),b+=_,this.updateElement(w,y,x,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(o))}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||[],o=fi(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){r=s.getDatasetMeta(n),t=r.data,a=r.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++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 o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.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(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}k(ae,"id","doughnut"),k(ae,"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(ae,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"}),k(ae,"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((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class Bi extends kt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Lr(e,n,r);this._drawStart=a,this._drawCount=l,Fr(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._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:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,n),d=r.axis,f=a.axis,{spanGaps:g,segment:m}=this.options,p=Se(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none",y=e+s,_=t.length;let w=e>0&&this.getParsed(e-1);for(let x=0;x<_;++x){const M=t[x],v=b?M:{};if(x<e||x>=y){v.skip=!0;continue}const S=this.getParsed(x),D=F(S[f]),E=v[d]=r.getPixelForValue(S[d],x),P=v[f]=o||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,S,l):S[f],x);v.skip=isNaN(E)||isNaN(P)||D,v.stop=x>0&&Math.abs(S[d]-w[d])>p,m&&(v.parsed=S,v.raw=c.data[x]),u&&(v.options=h||this.resolveDataElementOptions(x,M.active?"active":n)),b||this.updateElement(M,x,v,n),w=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 o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}k(Bi,"id","line"),k(Bi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),k(Bi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ti extends kt{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||[],o=fi(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return jr.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 o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),r=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*U;let f=d,g;const m=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,n,m);for(g=e;g<e+s;g++){const p=t[g];let b=f,y=f+this._computeAngle(g,n,m),_=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=y,o&&(l.animateScale&&(_=0),l.animateRotate&&(b=y=d));const w={x:h,y:u,innerRadius:0,outerRadius:_,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(g,p.active?"active":n)};this.updateElement(p,g,w,n)}}countVisibleElements(){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)?St(this.resolveDataElementOptions(t,e).angle||s):0}}k(ti,"id","polarArea"),k(ti,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),k(ti,"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((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r}})}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 Hs extends ae{}k(Hs,"id","pie"),k(Hs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Hi extends kt{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 jr.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta,s=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(s.points=n,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===n.length,options:r};this.updateElement(s,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){const o=this._cachedMeta.rScale,r=n==="reset";for(let a=e;a<e+s;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":n),h=o.getPointPositionForValue(a,this.getParsed(a).r),u=r?o.xCenter:h.x,d=r?o.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(Hi,"id","radar"),k(Hi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),k(Hi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class $i extends kt{getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:o}=e,r=this.getParsed(t),a=n.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:s[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:s=[]}=e,n=this.chart._animationsDisabled;let{start:o,count:r}=Lr(e,s,n);if(this._drawStart=o,this._drawCount=r,Fr(e)&&(o=0,r=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,o,r,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 o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),u=this.getSharedOptions(h),d=this.includeOptions(n,u),f=r.axis,g=a.axis,{spanGaps:m,segment:p}=this.options,b=Se(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||n==="none";let _=e>0&&this.getParsed(e-1);for(let w=e;w<e+s;++w){const x=t[w],M=this.getParsed(w),v=y?x:{},S=F(M[g]),D=v[f]=r.getPixelForValue(M[f],w),E=v[g]=o||S?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[g],w);v.skip=isNaN(D)||isNaN(E)||S,v.stop=w>0&&Math.abs(M[f]-_[f])>b,p&&(v.parsed=M,v.raw=c.data[w]),d&&(v.options=u||this.resolveDataElementOptions(w,x.active?"active":n)),y||this.updateElement(x,w,v,n),_=M}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 o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,r)/2}}k($i,"id","scatter"),k($i,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),k($i,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Fh=Object.freeze({__proto__:null,BarController:Vi,BubbleController:Wi,DoughnutController:ae,LineController:Bi,PolarAreaController:ti,PieController:Hs,RadarController:Hi,ScatterController:$i});function te(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class _n{static override(t){Object.assign(_n.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return te()}parse(){return te()}format(){return te()}add(){return te()}diff(){return te()}startOf(){return te()}endOf(){return te()}}var ea={_date:_n};function Rh(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?rc:Nt;if(s){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const u=l(o,t,e-h),d=l(o,t,e+h);return{lo:u.lo,hi:d.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function gi(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:u,hi:d}=Rh(o[a],t,r,n);for(let f=u;f<=d;++f){const g=h[f];g.skip||s(g,c,f)}}}function Nh(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,r=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function ks(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||gi(i,e,t,function(a,l,c){!n&&!ai(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function zh(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:u}=Cr(r,{x:t.x,y:t.y});ri(u,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return gi(i,e,t,o),n}function Vh(i,t,e,s,n,o){let r=[];const a=Nh(e);let l=Number.POSITIVE_INFINITY;function c(h,u,d){const f=h.inRange(t.x,t.y,n);if(s&&!f)return;const g=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(g))&&!f)return;const p=a(t,g);p<l?(r=[{element:h,datasetIndex:u,index:d}],l=p):p===l&&r.push({element:h,datasetIndex:u,index:d})}return gi(i,e,t,c),r}function Ts(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?zh(i,t,e,n):Vh(i,t,e,s,n,o)}function lo(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return gi(i,e,t,(l,c,h)=>{l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var Wh={evaluateInteractionItems:gi,modes:{index(i,t,e,s){const n=se(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?ks(i,n,o,s,r):Ts(i,n,o,!1,s,r),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=se(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?ks(i,n,o,s,r):Ts(i,n,o,!1,s,r);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=se(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return ks(i,n,o,s,r)},nearest(i,t,e,s){const n=se(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return Ts(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=se(t,i);return lo(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=se(t,i);return lo(i,n,"y",e.intersect,s)}}};const ia=["left","top","right","bottom"];function Re(i,t){return i.filter(e=>e.pos===t)}function co(i,t){return i.filter(e=>ia.indexOf(e.pos)===-1&&e.box.axis===t)}function Ne(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Bh(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function Hh(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!ia.includes(n))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function $h(i,t){const e=Hh(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];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 jh(i){const t=Bh(i),e=Ne(t.filter(c=>c.box.fullSize),!0),s=Ne(Re(t,"left"),!0),n=Ne(Re(t,"right")),o=Ne(Re(t,"top"),!0),r=Ne(Re(t,"bottom")),a=co(t,"x"),l=co(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:Re(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function ho(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function sa(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 Uh(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!A(n)){e.size&&(i[n]-=e.size);const u=s[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,i[n]+=e.size}o.getPadding&&sa(r,o.getPadding());const a=Math.max(0,t.outerWidth-ho(r,i,"left","right")),l=Math.max(0,t.outerHeight-ho(r,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 Yh(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 Zh(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Ue(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Zh(a.horizontal,t));const{same:u,other:d}=Uh(t,e,a,s);c|=u&&n.length,h=h||d,l.fullSize||n.push(a)}return c&&Ue(n,t,e,s)||h}function Ti(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 uo(i,t,e,s){const n=e.padding;let{x:o,y:r}=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;yt(c.start)&&(r=c.start),l.fullSize?Ti(l,n.left,r,e.outerWidth-n.right-n.left,d):Ti(l,t.left+c.placed,r,u,d),c.start=r,c.placed+=u,r=l.bottom}else{const u=t.h*h,d=c.size||l.width;yt(c.start)&&(o=c.start),l.fullSize?Ti(l,o,n.top,d,e.outerHeight-n.bottom-n.top):Ti(l,o,t.top+c.placed,d,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=r}var ot={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=rt(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=jh(i.boxes),l=a.vertical,c=a.horizontal;z(i.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),d=Object.assign({},n);sa(d,rt(s));const f=Object.assign({maxPadding:d,w:o,h:r,x:n.left,y:n.top},n),g=$h(l.concat(c),u);Ue(a.fullSize,f,u,g),Ue(l,f,u,g),Ue(c,f,u,g)&&Ue(l,f,u,g),Yh(f),uo(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,uo(a.rightAndBottom,f,u,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},z(a.chartArea,m=>{const p=m.box;Object.assign(p,i.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class na{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 qh extends na{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ji="$chartjs",Xh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fo=i=>i===null||i==="";function Gh(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ji]={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",fo(n)){const o=qn(i,"width");o!==void 0&&(i.width=o)}if(fo(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=qn(i,"height");o!==void 0&&(i.height=o)}return i}const oa=Qc?{passive:!0}:!1;function Jh(i,t,e){i.addEventListener(t,e,oa)}function Kh(i,t,e){i.canvas.removeEventListener(t,e,oa)}function Qh(i,t){const e=Xh[i.type]||i.type,{x:s,y:n}=se(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function is(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function tu(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||is(a.addedNodes,s),r=r&&!is(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function eu(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||is(a.removedNodes,s),r=r&&!is(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const ci=new Map;let go=0;function ra(){const i=window.devicePixelRatio;i!==go&&(go=i,ci.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function iu(i,t){ci.size||window.addEventListener("resize",ra),ci.set(i,t)}function su(i){ci.delete(i),ci.size||window.removeEventListener("resize",ra)}function nu(i,t,e){const s=i.canvas,n=s&&xn(s);if(!n)return;const o=Ir((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),iu(i,o),r}function Os(i,t,e){e&&e.disconnect(),t==="resize"&&su(i)}function ou(i,t,e){const s=i.canvas,n=Ir(o=>{i.ctx!==null&&e(Qh(o,i))},i);return Jh(s,t,n),n}class ru extends na{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Gh(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ji])return!1;const s=e[ji].initial;["height","width"].forEach(o=>{const r=s[o];F(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[ji],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:tu,detach:eu,resize:nu}[e]||ou;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:Os,detach:Os,resize:Os}[e]||Kh)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Kc(t,e,s,n)}isAttached(t){const e=xn(t);return!!(e&&e.isConnected)}}function au(i){return!Yr()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?qh:ru}class Tt{constructor(){k(this,"active",!1)}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Se(this.x)&&Se(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}k(Tt,"defaults",{}),k(Tt,"defaultRoutes");function lu(i,t){const e=i.options.ticks,s=cu(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?uu(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return du(t,c,o,r/n),c;const h=hu(o,t,n);if(r>0){let u,d;const f=r>1?Math.round((l-a)/(r-1)):null;for(Oi(t,c,h,F(f)?0:a-f,a),u=0,d=r-1;u<d;u++)Oi(t,c,h,o[u],o[u+1]);return Oi(t,c,h,l,F(f)?t.length:l+f),c}return Oi(t,c,h),c}function cu(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 hu(i,t,e){const s=fu(i),n=t.length/e;if(!s)return Math.max(n,1);const o=ic(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function uu(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function du(i,t,e,s){let n=0,o=e[0],r;for(s=Math.ceil(s),r=0;r<i.length;r++)r===o&&(t.push(i[r]),n++,o=e[n*s])}function Oi(i,t,e,s,n){const o=C(s,0),r=Math.min(C(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=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function fu(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 gu=i=>i==="left"?"right":i==="right"?"left":i,mo=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,po=(i,t)=>Math.min(t||i,i);function bo(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function mu(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function pu(i,t){z(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function ze(i){return i.drawTicks?i.tickLength:0}function yo(i,t){if(!i.display)return 0;const e=Q(i.font,t),s=rt(i.padding);return(H(i.text)?i.text.length:1)*e.lineHeight+s.height}function bu(i,t){return Jt(i,{scale:t,type:"scale"})}function yu(i,t,e){return Jt(i,{tick:e,index:t,type:"tick"})}function xu(i,t,e){let s=gn(i);return(e&&t!=="right"||!e&&t==="right")&&(s=gu(s)),s}function _u(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let u=0,d,f,g;const m=r-n,p=a-o;if(i.isHorizontal()){if(f=st(s,o,a),A(e)){const b=Object.keys(e)[0],y=e[b];g=h[b].getPixelForValue(y)+m-t}else e==="center"?g=(c.bottom+c.top)/2+m-t:g=mo(i,e,t);d=a-o}else{if(A(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=mo(i,e,t);g=st(s,r,n),u=e==="left"?-q:q}return{titleX:f,titleY:g,maxWidth:d,rotation:u}}class fe extends Tt{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=ut(t,Number.POSITIVE_INFINITY),e=ut(e,Number.NEGATIVE_INFINITY),s=ut(s,Number.POSITIVE_INFINITY),n=ut(n,Number.NEGATIVE_INFINITY),{min:ut(t,s),max:ut(e,n),minDefined:Z(t),maxDefined:Z(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(s=Math.max(s,r.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:ut(e,ut(s,e)),max:ut(s,ut(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:o,ticks:r}=this.options,a=r.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=Ec(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?bo(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=lu(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,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=W(e.callback,[o.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=po(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||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-ze(t.grid)-e.padding-yo(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),r=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)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}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:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=yo(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=ze(o)+l):(t.height=this.maxHeight,t.width=ze(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=s.padding*2,g=St(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){const b=s.mirror?0:p*u.width+m*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:m*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,p,m)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},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):o==="start"?f=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+r)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;o==="start"?(h=0,u=t.height):o==="end"&&(h=e.height,u=0),this.paddingTop=h+r,this.paddingBottom=u+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){W(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)F(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=bo(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/po(e,s));let c=0,h=0,u,d,f,g,m,p,b,y,_,w,x;for(u=0;u<e;u+=l){if(g=t[u].label,m=this._resolveTickFontOptions(u),n.font=p=m.string,b=o[p]=o[p]||{data:{},gc:[]},y=m.lineHeight,_=w=0,!F(g)&&!H(g))_=ts(n,b.data,b.gc,_,g),w=y;else if(H(g))for(d=0,f=g.length;d<f;++d)x=g[d],!F(x)&&!H(x)&&(_=ts(n,b.data,b.gc,_,x),w+=y);r.push(_),a.push(w),c=Math.max(_,c),h=Math.max(w,h)}pu(o,e);const M=r.indexOf(c),v=a.indexOf(h),S=D=>({width:r[D]||0,height:a[D]||0});return{first:S(0),last:S(e-1),widest:S(M),highest:S(v),widths:r,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 oc(this._alignToPixels?Qt(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=yu(this.getContext(),t,s))}return this.$context||(this.$context=bu(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=St(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){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:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),d=ze(o),f=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,b=function(j){return Qt(s,j,m)};let y,_,w,x,M,v,S,D,E,P,R,et;if(r==="top")y=b(this.bottom),v=this.bottom-d,D=y-p,P=b(t.top)+p,et=t.bottom;else if(r==="bottom")y=b(this.top),P=t.top,et=b(t.bottom)-p,v=y+p,D=this.top+d;else if(r==="left")y=b(this.right),M=this.right-d,S=y-p,E=b(t.left)+p,R=t.right;else if(r==="right")y=b(this.left),E=t.left,R=b(t.right)-p,M=y+p,S=this.left+d;else if(e==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(A(r)){const j=Object.keys(r)[0],X=r[j];y=b(this.chart.scales[j].getPixelForValue(X))}P=t.top,et=t.bottom,v=y+p,D=v+d}else if(e==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(A(r)){const j=Object.keys(r)[0],X=r[j];y=b(this.chart.scales[j].getPixelForValue(X))}M=y-p,S=M-d,E=t.left,R=t.right}const ht=C(n.ticks.maxTicksLimit,u),V=Math.max(1,Math.ceil(u/ht));for(_=0;_<u;_+=V){const j=this.getContext(_),X=o.setContext(j),_t=a.setContext(j),it=X.lineWidth,me=X.color,xi=_t.dash||[],pe=_t.dashOffset,Pe=X.tickWidth,Ae=X.tickColor,Ie=X.tickBorderDash||[],Le=X.tickBorderDashOffset;w=mu(this,_,l),w!==void 0&&(x=Qt(s,w,it),c?M=S=E=R=x:v=D=P=et=x,f.push({tx1:M,ty1:v,tx2:S,ty2:D,x1:E,y1:P,x2:R,y2:et,width:it,color:me,borderDash:xi,borderDashOffset:pe,tickWidth:Pe,tickColor:Ae,tickBorderDash:Ie,tickBorderDashOffset:Le}))}return this._ticksLength=u,this._borderValue=y,f}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=o,d=ze(s.grid),f=d+h,g=u?-h:f,m=-St(this.labelRotation),p=[];let b,y,_,w,x,M,v,S,D,E,P,R,et="middle";if(n==="top")M=this.bottom-g,v=this._getXAxisLabelAlignment();else if(n==="bottom")M=this.top+g,v=this._getXAxisLabelAlignment();else if(n==="left"){const V=this._getYAxisLabelAlignment(d);v=V.textAlign,x=V.x}else if(n==="right"){const V=this._getYAxisLabelAlignment(d);v=V.textAlign,x=V.x}else if(e==="x"){if(n==="center")M=(t.top+t.bottom)/2+f;else if(A(n)){const V=Object.keys(n)[0],j=n[V];M=this.chart.scales[V].getPixelForValue(j)+f}v=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")x=(t.left+t.right)/2-f;else if(A(n)){const V=Object.keys(n)[0],j=n[V];x=this.chart.scales[V].getPixelForValue(j)}v=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?et="top":l==="end"&&(et="bottom"));const ht=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){_=a[b],w=_.label;const V=o.setContext(this.getContext(b));S=this.getPixelForTick(b)+o.labelOffset,D=this._resolveTickFontOptions(b),E=D.lineHeight,P=H(w)?w.length:1;const j=P/2,X=V.color,_t=V.textStrokeColor,it=V.textStrokeWidth;let me=v;r?(x=S,v==="inner"&&(b===y-1?me=this.options.reverse?"left":"right":b===0?me=this.options.reverse?"right":"left":me="center"),n==="top"?c==="near"||m!==0?R=-P*E+E/2:c==="center"?R=-ht.highest.height/2-j*E+E:R=-ht.highest.height+E/2:c==="near"||m!==0?R=E/2:c==="center"?R=ht.highest.height/2-j*E:R=ht.highest.height-P*E,u&&(R*=-1),m!==0&&!V.showLabelBackdrop&&(x+=E/2*Math.sin(m))):(M=S,R=(1-P)*E/2);let xi;if(V.showLabelBackdrop){const pe=rt(V.backdropPadding),Pe=ht.heights[b],Ae=ht.widths[b];let Ie=R-pe.top,Le=0-pe.left;switch(et){case"middle":Ie-=Pe/2;break;case"bottom":Ie-=Pe;break}switch(v){case"center":Le-=Ae/2;break;case"right":Le-=Ae;break}xi={left:Le,top:Ie,width:Ae+pe.width,height:Pe+pe.height,color:V.backdropColor}}p.push({label:w,font:D,textOffset:R,options:{rotation:m,color:X,strokeColor:_t,strokeWidth:it,textAlign:me,textBaseline:et,translation:[x,M],backdrop:xi}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-St(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:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;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:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.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 o,r;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(o=0,r=n.length;o<r;++o){const l=n[o];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,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,u,d;this.isHorizontal()?(c=Qt(t,this.left,r)-r/2,h=Qt(t,this.right,a)+a/2,u=d=l):(u=Qt(t,this.top,r)-r/2,d=Qt(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.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&&us(s,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;de(s,c,0,h,l,a)}n&&ds(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=Q(s.font),r=rt(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||A(e)?(l+=r.bottom,H(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:u,rotation:d}=_u(this,l,e,a);de(t,s.text,0,0,o,{color:s.color,maxWidth:u,rotation:d,textAlign:xu(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=C(t.grid&&t.grid.z,-1),n=C(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==fe.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];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 Di{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;Su(e)&&(s=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,wu(t,r,s),this.override&&G.override(t.id,t.overrides)),r}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 ue[s])}}function wu(i,t,e){const s=oi(Object.create(null),[e?G.get(e):{},G.get(t),i.defaults]);G.set(t,s),i.defaultRoutes&&vu(t,i.defaultRoutes),i.descriptors&&G.describe(t,i.descriptors)}function vu(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");G.route(o,n,l,a)})}function Su(i){return"id"in i&&"defaults"in i}class Mu{constructor(){this.controllers=new Di(kt,"datasets",!0),this.elements=new Di(Tt,"elements"),this.plugins=new Di(Object,"plugins"),this.scales=new Di(fe,"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 o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):z(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=un(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 Ct=new Mu;class ku{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(W(a,l,r)===!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=C(s.options&&s.options.plugins,{}),o=Tu(s);return n===!1&&!e?[]:Du(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Tu(i){const t={},e=[],s=Object.keys(Ct.plugins.items);for(let o=0;o<s.length;o++)e.push(Ct.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Ou(i,t){return!t&&i===!1?null:i===!0?{}:i}function Du(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Ou(s[l],n);c!==null&&o.push({plugin:a,options:Cu(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Cu(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(s,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $s(i,t){const e=G.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Eu(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Pu(i,t){return i===t?"_index_":"_value_"}function Au(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function ss(i,t){if(i==="x"||i==="y"||i==="r"||(i=t.axis||Au(t.position)||i.length>1&&ss(i[0].toLowerCase(),t),i))return i;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function Iu(i,t){const e=ue[i.type]||{scales:{}},s=t.scales||{},n=$s(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!A(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=ss(r,a),c=Pu(l,n),h=e.scales||{};o[r]=Ge(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||$s(a,t),h=(ue[a]||{}).scales||{};Object.keys(h).forEach(u=>{const d=Eu(u,l),f=r[d+"AxisID"]||d;o[f]=o[f]||Object.create(null),Ge(o[f],[{axis:d},s[f],h[u]])})}),Object.keys(o).forEach(r=>{const a=o[r];Ge(a,[G.scales[a.type],G.scale])}),o}function aa(i){const t=i.options||(i.options={});t.plugins=C(t.plugins,{}),t.scales=Iu(i,t)}function la(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Lu(i){return i=i||{},i.data=la(i.data),aa(i),i}const xo=new Map,ca=new Set;function Ci(i,t){let e=xo.get(i);return e||(e=t(),xo.set(i,e),ca.add(e)),e}const Ve=(i,t,e)=>{const s=Xt(t,e);s!==void 0&&i.add(s)};class Fu{constructor(t){this._config=Lu(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=la(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(),aa(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ci(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ci(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ci(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return Ci(`${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:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>Ve(l,t,u))),h.forEach(u=>Ve(l,n,u)),h.forEach(u=>Ve(l,ue[o]||{},u)),h.forEach(u=>Ve(l,G,u)),h.forEach(u=>Ve(l,Ws,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ca.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,ue[e]||{},G.datasets[e]||{},{type:e},G,Ws]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=_o(this._resolverCache,t,n);let l=r;if(Nu(r,e)){o.$shared=!1,s=Gt(s)?s():s;const c=this.createResolver(t,s,a);l=Me(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=_o(this._resolverCache,t,s);return A(e)?Me(o,e,void 0,n):o}}function _o(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:pn(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const Ru=i=>A(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||Gt(i[e]),!1);function Nu(i,t){const{isScriptable:e,isIndexable:s}=Wr(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(Gt(a)||Ru(a))||r&&H(a))return!0}return!1}var zu="4.2.1";const Vu=["top","bottom","left","right","chartArea"];function wo(i,t){return i==="top"||i==="bottom"||Vu.indexOf(i)===-1&&t==="x"}function vo(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function So(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),W(e&&e.onComplete,[i],t)}function Wu(i){const t=i.chart,e=t.options.animation;W(e&&e.onProgress,[i],t)}function ha(i){return Yr()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ui={},Mo=i=>{const t=ha(i);return Object.values(Ui).filter(e=>e.canvas===t).pop()};function Bu(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function Hu(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function $u(i){const{xScale:t,yScale:e}=i;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}class Ft{static register(...t){Ct.add(...t),ko()}static unregister(...t){Ct.remove(...t),ko()}constructor(t,e){const s=this.config=new Fu(e),n=ha(t),o=Mo(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||au(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Zl(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,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 ku,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=cc(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],Ui[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}At.listen(this,"complete",So),At.listen(this,"progress",Wu),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return F(t)?e&&o?o: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 Ct}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Zn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return jn(this.canvas,this.ctx),this}stop(){return At.stop(this),this}resize(t,e){At.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Zn(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),W(s.onResize,[this,r],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((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=ss(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),z(o,r=>{const a=r.options,l=a.id,c=ss(l,a),h=C(a.type,r.dtype);(a.position===void 0||wo(a.position,c)!==wo(r.dposition))&&(a.position=r.dposition),n[l]=!0;let u=null;if(l in s&&s[l].type===h)u=s[l];else{const d=Ct.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),s[u.id]=u}u.init(a,t)}),z(n,(r,a)=>{r||delete s[a]}),z(s,r=>{ot.configure(this,r,r.options),ot.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(vo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===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 o=e[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||$s(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=Ct.getController(a),{datasetElementType:c,dataElementType:h}=G.datasets[a];Object.assign(l,{dataElementType:Ct.getElement(h),datasetElementType:c&&Ct.getElement(c)}),r.controller=new l(this,s),t.push(r.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 o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:u}=this.getDatasetMeta(c),d=!n&&o.indexOf(u)===-1;u.buildOrUpdateElements(d),r=Math.max(+u.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),n||z(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(vo("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=>{ot.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Fn(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:o}of e){const r=s==="_removeElements"?-o:o;Bu(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!Fn(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ot.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,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Gt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(At.has(this)?this.attached&&!At.running(this)&&At.start(this):(this.draw(),So({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,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&s.push(r)}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,o=$u(t)||this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&us(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&ds(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ai(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Wh.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._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=Jt(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",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);yt(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{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(),At.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(),jn(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ui[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=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};z(this.options.events,o=>s(o,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])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}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 o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ji(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,o=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,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=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=Ql(t),c=Hu(t,this._lastEvent,s,l);s&&(this._lastEvent=null,W(o.onHover,[t,a,this],this),l&&W(o.onClick,[t,a,this],this));const h=!Ji(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 o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}k(Ft,"defaults",G),k(Ft,"instances",Ui),k(Ft,"overrides",ue),k(Ft,"registry",Ct),k(Ft,"version",zu),k(Ft,"getChart",Mo);function ko(){return z(Ft.instances,i=>i._plugins.invalidate())}function ju(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+q,s-q),i.closePath(),i.clip()}function Uu(i){return mn(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Yu(i,t,e,s){const n=Uu(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return tt(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:tt(n.innerStart,0,r),innerEnd:tt(n.innerEnd,0,r)}}function ye(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function ns(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+s+e-c,0),d=h>0?h+s+e+c:0;let f=0;const g=n-l;if(s){const V=h>0?h-s:0,j=u>0?u-s:0,X=(V+j)/2,_t=X!==0?g*X/(X+s):g;f=(g-_t)/2}const m=Math.max(.001,g*u-e/U)/u,p=(g-m)/2,b=l+p+f,y=n-p-f,{outerStart:_,outerEnd:w,innerStart:x,innerEnd:M}=Yu(t,d,u,y-b),v=u-_,S=u-w,D=b+_/v,E=y-w/S,P=d+x,R=d+M,et=b+x/P,ht=y-M/R;if(i.beginPath(),o){const V=(D+E)/2;if(i.arc(r,a,u,D,V),i.arc(r,a,u,V,E),w>0){const it=ye(S,E,r,a);i.arc(it.x,it.y,w,E,y+q)}const j=ye(R,y,r,a);if(i.lineTo(j.x,j.y),M>0){const it=ye(R,ht,r,a);i.arc(it.x,it.y,M,y+q,ht+Math.PI)}const X=(y-M/d+(b+x/d))/2;if(i.arc(r,a,d,y-M/d,X,!0),i.arc(r,a,d,X,b+x/d,!0),x>0){const it=ye(P,et,r,a);i.arc(it.x,it.y,x,et+Math.PI,b-q)}const _t=ye(v,b,r,a);if(i.lineTo(_t.x,_t.y),_>0){const it=ye(v,D,r,a);i.arc(it.x,it.y,_,b-q,D)}}else{i.moveTo(r,a);const V=Math.cos(D)*u+r,j=Math.sin(D)*u+a;i.lineTo(V,j);const X=Math.cos(E)*u+r,_t=Math.sin(E)*u+a;i.lineTo(X,_t)}i.closePath()}function Zu(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){ns(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%$||$))}return ns(i,t,e,s,l,n),i.fill(),l}function qu(i,t,e,s,n){const{fullCircles:o,startAngle:r,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(o){ns(i,t,e,s,d,n);for(let f=0;f<o;++f)i.stroke();isNaN(a)||(d=r+(a%$||$))}u&&ju(i,t,d),o||(ns(i,t,e,s,d,n),i.stroke())}class Yi extends Tt{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:o,distance:r}=Cr(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,g=C(u,l-a)>=$||ri(o,a,l),m=Rt(r,c+d,h+d);return g&&m}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,u=(r+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,o=(e.spacing||0)/2,r=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,Zu(t,this,c,o,r),qu(t,this,c,o,r),t.restore()}}k(Yi,"id","arc"),k(Yi,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),k(Yi,"defaultRoutes",{backgroundColor:"backgroundColor"});function ua(i,t,e=t){i.lineCap=C(e.borderCapStyle,t.borderCapStyle),i.setLineDash(C(e.borderDash,t.borderDash)),i.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),i.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=C(e.borderWidth,t.borderWidth),i.strokeStyle=C(e.borderColor,t.borderColor)}function Xu(i,t,e){i.lineTo(e.x,e.y)}function Gu(i){return i.stepped?wc:i.tension||i.cubicInterpolationMode==="monotone"?vc:Xu}function da(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function Ju(i,t,e,s){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:c}=da(n,e,s),h=Gu(o);let{move:u=!0,reverse:d}=s||{},f,g,m;for(f=0;f<=c;++f)g=n[(a+(d?c-f:f))%r],!g.skip&&(u?(i.moveTo(g.x,g.y),u=!1):h(i,m,g,d,o.stepped),m=g);return l&&(g=n[(a+(d?c:0))%r],h(i,m,g,d,o.stepped)),!!l}function Ku(i,t,e,s){const n=t.points,{count:o,start:r,ilen:a}=da(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,u=0,d,f,g,m,p,b;const y=w=>(r+(c?a-w:w))%o,_=()=>{m!==p&&(i.lineTo(h,p),i.lineTo(h,m),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 w=f.x,x=f.y,M=w|0;M===g?(x<m?m=x:x>p&&(p=x),h=(u*h+w)/++u):(_(),i.lineTo(w,x),g=M,u=0,m=p=x),b=x}_()}function js(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ku:Ju}function Qu(i){return i.stepped?th:i.tension||i.cubicInterpolationMode==="monotone"?eh:ne}function td(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),ua(i,t.options),i.stroke(n)}function ed(i,t,e,s){const{segments:n,options:o}=t,r=js(t);for(const a of n)ua(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const id=typeof Path2D=="function";function sd(i,t,e,s){id&&!t.options.segment?td(i,t,e,s):ed(i,t,e,s)}class Yt extends Tt{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;Yc(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=ah(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],o=this.points,r=Jr(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=Qu(s);let c,h;for(c=0,h=r.length;c<h;++c){const{start:u,end:d}=r[c],f=o[u],g=o[d];if(f===g){a.push(f);continue}const m=Math.abs((n-f[e])/(g[e]-f[e])),p=l(f,g,m,s.stepped);p[e]=t[e],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,e,s){return js(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=js(this);let r=this._loop;e=e||0,s=s||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+s-1});return!!r}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),sd(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}k(Yt,"id","line"),k(Yt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),k(Yt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),k(Yt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function To(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class Zi extends Tt{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:o,y:r}=this.getProps(["x","y"],s);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return To(this,t,"x",e)}inYRange(t,e){return To(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||!ai(this,e,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,Bs(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}k(Zi,"id","point"),k(Zi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),k(Zi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function fa(i,t){const{x:e,y:s,base:n,width:o,height:r}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,u;return i.horizontal?(u=r/2,a=Math.min(e,n),l=Math.max(e,n),c=s-u,h=s+u):(u=o/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 Zt(i,t,e,s){return i?0:tt(t,e,s)}function nd(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=Vr(s);return{t:Zt(n.top,o.top,0,e),r:Zt(n.right,o.right,0,t),b:Zt(n.bottom,o.bottom,0,e),l:Zt(n.left,o.left,0,t)}}function od(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=le(n),r=Math.min(t,e),a=i.borderSkipped,l=s||A(n);return{topLeft:Zt(!l||a.top||a.left,o.topLeft,0,r),topRight:Zt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Zt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Zt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function rd(i){const t=fa(i),e=t.right-t.left,s=t.bottom-t.top,n=nd(i,e/2,s/2),o=od(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},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,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function Ds(i,t,e,s){const n=t===null,o=e===null,a=i&&!(n&&o)&&fa(i,s);return a&&(n||Rt(t,a.left,a.right))&&(o||Rt(e,a.top,a.bottom))}function ad(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function ld(i,t){i.rect(t.x,t.y,t.w,t.h)}function Cs(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,r=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+r,radius:i.radius}}class qi extends Tt{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:o,outer:r}=rd(this),a=ad(r.radius)?li:ld;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Cs(r,e,o)),t.clip(),a(t,Cs(o,-e,r)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,Cs(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return Ds(this,t,e,s)}inXRange(t,e){return Ds(this,t,null,e)}inYRange(t,e){return Ds(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}k(qi,"id","bar"),k(qi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),k(qi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var cd=Object.freeze({__proto__:null,ArcElement:Yi,LineElement:Yt,PointElement:Zi,BarElement:qi});const Us=["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)"],Oo=Us.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function ga(i){return Us[i%Us.length]}function ma(i){return Oo[i%Oo.length]}function hd(i,t){return i.borderColor=ga(t),i.backgroundColor=ma(t),++t}function ud(i,t){return i.backgroundColor=i.data.map(()=>ga(t++)),t}function dd(i,t){return i.backgroundColor=i.data.map(()=>ma(t++)),t}function fd(i){let t=0;return(e,s)=>{const n=i.getDatasetMeta(s).controller;n instanceof ae?t=ud(e,t):n instanceof ti?t=dd(e,t):n&&(t=hd(e,t))}}function Do(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function gd(i){return i&&(i.borderColor||i.backgroundColor)}var md={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:s},options:n}=i.config,{elements:o}=n;if(!e.forceOverride&&(Do(s)||gd(n)||o&&Do(o)))return;const r=fd(i);s.forEach(r)}};function pd(i,t,e,s,n){const o=n.samples||s;if(o>=e)return i.slice(t,t+e);const r=[],a=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,u,d,f,g,m;for(r[l++]=i[h],u=0;u<o-2;u++){let p=0,b=0,y;const _=Math.floor((u+1)*a)+1+t,w=Math.min(Math.floor((u+2)*a)+1,e)+t,x=w-_;for(y=_;y<w;y++)p+=i[y].x,b+=i[y].y;p/=x,b/=x;const M=Math.floor(u*a)+1+t,v=Math.min(Math.floor((u+1)*a)+1,e)+t,{x:S,y:D}=i[h];for(f=g=-1,y=M;y<v;y++)g=.5*Math.abs((S-p)*(i[y].y-D)-(S-i[y].x)*(b-D)),g>f&&(f=g,d=i[y],m=y);r[l++]=d,h=m}return r[l++]=i[c],r}function bd(i,t,e,s){let n=0,o=0,r,a,l,c,h,u,d,f,g,m;const p=[],b=t+e-1,y=i[t].x,w=i[b].x-y;for(r=t;r<t+e;++r){a=i[r],l=(a.x-y)/w*s,c=a.y;const x=l|0;if(x===h)c<g?(g=c,u=r):c>m&&(m=c,d=r),n=(o*n+a.x)/++o;else{const M=r-1;if(!F(u)&&!F(d)){const v=Math.min(u,d),S=Math.max(u,d);v!==f&&v!==M&&p.push({...i[v],x:n}),S!==f&&S!==M&&p.push({...i[S],x:n})}r>0&&M!==f&&p.push(i[M]),p.push(a),h=x,o=0,g=m=c,u=d=f=r}}return p}function pa(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 Co(i){i.data.datasets.forEach(t=>{pa(t)})}function yd(i,t){const e=t.length;let s=0,n;const{iScale:o}=i,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=tt(Nt(t,o.axis,r).lo,0,e-1)),c?n=tt(Nt(t,o.axis,a).hi+1,s,e)-s:n=e-s,{start:s,count:n}}var xd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){Co(i);return}const s=i.width;i.data.datasets.forEach((n,o)=>{const{_data:r,indexAxis:a}=n,l=i.getDatasetMeta(o),c=r||n.data;if(je([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}=yd(l,c);const f=e.threshold||4*s;if(d<=f){pa(n);return}F(r)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(e.algorithm){case"lttb":g=pd(c,u,d,s,e);break;case"min-max":g=bd(c,u,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=g})},destroy(i){Co(i)}};function _d(i,t,e){const s=i.segments,n=i.points,o=t.points,r=[];for(const a of s){let{start:l,end:c}=a;c=wn(l,c,n);const h=Ys(e,n[l],n[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:n[l],end:n[c]});continue}const u=Jr(t,h);for(const d of u){const f=Ys(e,o[d.start],o[d.end],d.loop),g=Gr(a,n,f);for(const m of g)r.push({source:m,target:d,start:{[e]:Eo(h,f,"start",Math.max)},end:{[e]:Eo(h,f,"end",Math.min)}})}}return r}function Ys(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=dt(n),o=dt(o)),{property:i,start:n,end:o}}function wd(i,t){const{x:e=null,y:s=null}=i||{},n=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=wn(r,a,n);const l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function wn(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function Eo(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function ba(i,t){let e=[],s=!1;return H(i)?(s=!0,e=i):e=wd(i,t),e.length?new Yt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Po(i){return i&&i.fill!==!1}function vd(i,t,e){let n=i[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!Z(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function Sd(i,t,e){const s=Od(i);if(A(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return Z(n)&&Math.floor(n)===n?Md(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Md(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function kd(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:A(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Td(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:A(i)?s=i.value:s=t.getBaseValue(),s}function Od(i){const t=i.options,e=t.fill;let s=C(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Dd(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=Cd(t,e);a.push(ba({x:null,y:t.bottom},s));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Ed(n,r[h],a)}return new Yt({points:n,options:{}})}function Cd(i,t){const e=[],s=i.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){const o=s[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Ed(i,t,e){const s=[];for(let n=0;n<e.length;n++){const o=e[n],{first:r,last:a,point:l}=Pd(o,t,"x");if(!(!l||r&&a)){if(r)s.unshift(l);else if(i.push(l),!a)break}}i.push(...s)}function Pd(i,t,e){const s=i.interpolate(t,e);if(!s)return{};const n=s[e],o=i.segments,r=i.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],u=r[h.start][e],d=r[h.end][e];if(Rt(n,u,d)){a=n===u,l=n===d;break}}return{first:a,last:l,point:s}}class ya{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:n,y:o,radius:r}=this;return e=e||{start:0,end:$},t.arc(n,o,r,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}}function Ad(i){const{chart:t,fill:e,line:s}=i;if(Z(e))return Id(t,e);if(e==="stack")return Dd(i);if(e==="shape")return!0;const n=Ld(i);return n instanceof ya?n:ba(n,s)}function Id(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Ld(i){return(i.scale||{}).getPointPositionForValue?Rd(i):Fd(i)}function Fd(i){const{scale:t={},fill:e}=i,s=kd(e,t);if(Z(s)){const n=t.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function Rd(i){const{scale:t,fill:e}=i,s=t.options,n=t.getLabels().length,o=s.reverse?t.max:t.min,r=Td(e,t,o),a=[];if(s.grid.circular){const l=t.getPointPositionForValue(0,o);return new ya({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<n;++l)a.push(t.getPointPositionForValue(l,r));return a}function Es(i,t,e){const s=Ad(t),{line:n,scale:o,axis:r}=t,a=n.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:u=c}=l||{};s&&n.points.length&&(us(i,e),Nd(i,{line:n,target:s,above:h,below:u,area:e,scale:o,axis:r}),ds(i))}function Nd(i,t){const{line:e,target:s,above:n,below:o,area:r,scale:a}=t,l=e._loop?"angle":t.axis;i.save(),l==="x"&&o!==n&&(Ao(i,s,r.top),Io(i,{line:e,target:s,color:n,scale:a,property:l}),i.restore(),i.save(),Ao(i,s,r.bottom)),Io(i,{line:e,target:s,color:o,scale:a,property:l}),i.restore()}function Ao(i,t,e){const{segments:s,points:n}=t;let o=!0,r=!1;i.beginPath();for(const a of s){const{start:l,end:c}=a,h=n[l],u=n[wn(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(u.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Io(i,t){const{line:e,target:s,property:n,color:o,scale:r}=t,a=_d(e,s,n);for(const{source:l,target:c,start:h,end:u}of a){const{style:{backgroundColor:d=o}={}}=l,f=s!==!0;i.save(),i.fillStyle=d,zd(i,r,f&&Ys(n,h,u)),i.beginPath();const g=!!e.pathSegment(i,l);let m;if(f){g?i.closePath():Lo(i,s,u,n);const p=!!s.pathSegment(i,c,{move:g,reverse:!0});m=g&&p,m||Lo(i,s,h,n)}i.closePath(),i.fill(m?"evenodd":"nonzero"),i.restore()}}function zd(i,t,e){const{top:s,bottom:n}=t.chart.chartArea,{property:o,start:r,end:a}=e||{};o==="x"&&(i.beginPath(),i.rect(r,s,a-r,n-s),i.clip())}function Lo(i,t,e,s){const n=t.interpolate(e,s);n&&i.lineTo(n.x,n.y)}var Vd={id:"filler",afterDatasetsUpdate(i,t,e){const s=(i.data.datasets||[]).length,n=[];let o,r,a,l;for(r=0;r<s;++r)o=i.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Yt&&(l={visible:i.isDatasetVisible(r),index:r,fill:Sd(a,r,s),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<s;++r)l=n[r],!(!l||l.fill===!1)&&(l.fill=vd(n,r,e.propagate))},beforeDraw(i,t,e){const s=e.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=n.length-1;r>=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),s&&a.fill&&Es(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;Po(o)&&Es(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Po(s)||e.drawTime!=="beforeDatasetDraw"||Es(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Fo=(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)}},Wd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Ro extends Tt{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),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Fo(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let u=t;o.textAlign="left",o.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((g,m)=>{const p=s+e/2+o.measureText(g.text).width;(m===0||c[c.length-1]+p+2*a>r)&&(u+=h,c[c.length-(m>0?0:1)]=0,f+=h,d++),l[m]={left:0,top:f,row:d,width:p,height:n},c[c.length-1]+=p+a}),u}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let u=a,d=0,f=0,g=0,m=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:y,itemHeight:_}=Bd(s,e,o,p,n);b>0&&f+_+2*a>h&&(u+=d+a,c.push({width:d,height:f}),g+=d+a,m++,d=f=0),l[b]={left:g,top:f,col:m,width:y,height:_},d=Math.max(d,y),f+=_+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=we(o,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=r.leftForLtr(r.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=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;us(t,this),this._draw(),ds(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=G.color,l=we(t.rtl,this.left,this.width),c=Q(r.font),{padding:h}=r,u=c.size,d=u/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=Fo(r,u),b=function(M,v,S){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;n.save();const D=C(S.lineWidth,1);if(n.fillStyle=C(S.fillStyle,a),n.lineCap=C(S.lineCap,"butt"),n.lineDashOffset=C(S.lineDashOffset,0),n.lineJoin=C(S.lineJoin,"miter"),n.lineWidth=D,n.strokeStyle=C(S.strokeStyle,a),n.setLineDash(C(S.lineDash,[])),r.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:D},P=l.xPlus(M,g/2),R=v+d;zr(n,E,P,R,r.pointStyleWidth&&g)}else{const E=v+Math.max((u-m)/2,0),P=l.leftForLtr(M,g),R=le(S.borderRadius);n.beginPath(),Object.values(R).some(et=>et!==0)?li(n,{x:P,y:E,w:g,h:m,radius:R}):n.rect(P,E,g,m),n.fill(),D!==0&&n.stroke()}n.restore()},y=function(M,v,S){de(n,S.text,M,v+p/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?f={x:st(o,this.left+h,this.right-s[0]),y:this.top+h+w,line:0}:f={x:this.left+h,y:st(o,this.top+w+h,this.bottom-e[0].height),line:0},Zr(this.ctx,t.textDirection);const x=p+h;this.legendItems.forEach((M,v)=>{n.strokeStyle=M.fontColor,n.fillStyle=M.fontColor;const S=n.measureText(M.text).width,D=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),E=g+d+S;let P=f.x,R=f.y;l.setWidth(this.width),_?v>0&&P+E+h>this.right&&(R=f.y+=x,f.line++,P=f.x=st(o,this.left+h,this.right-s[f.line])):v>0&&R+x>this.bottom&&(P=f.x=P+e[f.line].width+h,f.line++,R=f.y=st(o,this.top+w+h,this.bottom-e[f.line].height));const et=l.x(P);if(b(et,R,M),P=hc(D,P+g+d,_?P+E:this.right,t.rtl),y(l.x(P),R,M),_)f.x+=E+h;else if(typeof M.text!="string"){const ht=c.lineHeight;f.y+=xa(M,ht)}else f.y+=x}),qr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=Q(e.font),n=rt(e.padding);if(!e.display)return;const o=we(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=st(t.align,u,this.right-d);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);h=c+st(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=st(a,u,u+d);r.textAlign=o.textAlign(gn(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,de(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=Q(t.font),s=rt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Rt(t,this.left,this.right)&&Rt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Rt(t,n.left,n.left+n.width)&&Rt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!jd(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=Wd(n,s);n&&!o&&W(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&W(e.onHover,[t,s,this],this)}else s&&W(e.onClick,[t,s,this],this)}}function Bd(i,t,e,s,n){const o=Hd(s,i,t,e),r=$d(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Hd(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function $d(i,t,e){let s=i;return typeof t.text!="string"&&(s=xa(t,e)),s}function xa(i,t){const e=i.text?i.text.length+.5:0;return t*e}function jd(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Ud={id:"legend",_element:Ro,start(i,t,e){const s=i.legend=new Ro({ctx:i.ctx,options:e,chart:i});ot.configure(i,s,e),ot.addBox(i,s)},stop(i){ot.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;ot.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:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=rt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color: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 vn extends Tt{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=rt(s.padding);const o=n*Q(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,u;return this.isHorizontal()?(h=st(a,s,o),u=e+t,c=o-s):(r.position==="left"?(h=s+t,u=st(a,n,e),l=U*-.5):(h=o-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),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);de(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:gn(e.align),textBaseline:"middle",translation:[r,a]})}}function Yd(i,t){const e=new vn({ctx:i.ctx,options:t,chart:i});ot.configure(i,e,t),ot.addBox(i,e),i.titleBlock=e}var Zd={id:"title",_element:vn,start(i,t,e){Yd(i,e)},stop(i){const t=i.titleBlock;ot.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;ot.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 Ei=new WeakMap;var qd={id:"subtitle",start(i,t,e){const s=new vn({ctx:i.ctx,options:e,chart:i});ot.configure(i,s,e),ot.addBox(i,s),Ei.set(i,s)},stop(i){ot.removeBox(i,Ei.get(i)),Ei.delete(i)},beforeUpdate(i,t,e){const s=Ei.get(i);ot.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 Ye={average(i){if(!i.length)return!1;let t,e,s=0,n=0,o=0;for(t=0,e=i.length;t<e;++t){const r=i[t].element;if(r&&r.hasValue()){const a=r.tooltipPosition();s+=a.x,n+=a.y,++o}}return{x:s/o,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Vs(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 Dt(i,t){return t&&(H(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function It(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
17
|
-
`)>-1?i.split(`
|
|
18
|
-
`):i}function Xd(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function No(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=Q(t.bodyFont),c=Q(t.titleFont),h=Q(t.footerFont),u=o.length,d=n.length,f=s.length,g=rt(t.padding);let m=g.height,p=0,b=s.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*w+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(m+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let y=0;const _=function(w){p=Math.max(p,e.measureText(w).width+y)};return e.save(),e.font=c.string,z(i.title,_),e.font=l.string,z(i.beforeBody.concat(i.afterBody),_),y=t.displayColors?r+2+t.boxPadding:0,z(s,w=>{z(w.before,_),z(w.lines,_),z(w.after,_)}),y=0,e.font=h.string,z(i.footer,_),e.restore(),p+=g.width,{width:p,height:m}}function Gd(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Jd(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Kd(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Jd(c,i,t,e)&&(c="center"),c}function zo(i,t,e){const s=e.yAlign||t.yAlign||Gd(i,e);return{xAlign:e.xAlign||t.xAlign||Kd(i,t,e,s),yAlign:s}}function Qd(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function tf(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Vo(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=le(r);let g=Qd(t,a);const m=tf(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+n:a==="right"&&(g+=Math.max(u,f)+n),{x:tt(g,0,s.width-t.width),y:tt(m,0,s.height-t.height)}}function Pi(i,t,e){const s=rt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Wo(i){return Dt([],It(i))}function ef(i,t,e){return Jt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Bo(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const _a={beforeTitle:Pt,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:Pt,beforeBody:Pt,beforeLabel:Pt,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:Pt,afterBody:Pt,beforeFooter:Pt,footer:Pt,afterFooter:Pt};function lt(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?_a[t].call(e,s):n}class Zs extends Tt{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,o=new Kr(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=ef(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=lt(s,"beforeTitle",this,t),o=lt(s,"title",this,t),r=lt(s,"afterTitle",this,t);let a=[];return a=Dt(a,It(n)),a=Dt(a,It(o)),a=Dt(a,It(r)),a}getBeforeBody(t,e){return Wo(lt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return z(t,o=>{const r={before:[],lines:[],after:[]},a=Bo(s,o);Dt(r.before,It(lt(a,"beforeLabel",this,o))),Dt(r.lines,lt(a,"label",this,o)),Dt(r.after,It(lt(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Wo(lt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=lt(s,"beforeFooter",this,t),o=lt(s,"footer",this,t),r=lt(s,"afterFooter",this,t);let a=[];return a=Dt(a,It(n)),a=Dt(a,It(o)),a=Dt(a,It(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Xd(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=Bo(t.callbacks,h);n.push(lt(u,"labelColor",this,h)),o.push(lt(u,"labelPointStyle",this,h)),r.push(lt(u,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Ye[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=No(this,s),c=Object.assign({},a,l),h=zo(this.chart,s,c),u=Vo(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=le(a),{x:d,y:f}=t,{width:g,height:m}=e;let p,b,y,_,w,x;return o==="center"?(w=f+m/2,n==="left"?(p=d,b=p-r,_=w+r,x=w-r):(p=d+g,b=p+r,_=w-r,x=w+r),y=p):(n==="left"?b=d+Math.max(l,h)+r:n==="right"?b=d+g-Math.max(c,u)-r:b=this.caretX,o==="top"?(_=f,w=_-r,p=b-r,y=b+r):(_=f+m,w=_+r,p=b+r,y=b-r),x=_),{x1:p,x2:b,x3:y,y1:_,y2:w,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=we(s.rtl,this.x,this.width);for(t.x=Pi(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=Q(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c,boxPadding:h}=o,u=Q(o.bodyFont),d=Pi(this,"left",o),f=n.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,m=e.y+g;if(o.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=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Bs(t,p,b,y),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Bs(t,p,b,y)}else{t.lineWidth=A(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const p=n.leftForLtr(f,c-h),b=n.leftForLtr(n.xPlus(f,1),c-h-2),y=le(r.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,li(t,{x:p,y:m,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),li(t,{x:b,y:m+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,m,c,l),t.strokeRect(p,m,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,u=Q(s.bodyFont);let d=u.lineHeight,f=0;const g=we(s.rtl,this.x,this.width),m=function(S){e.fillText(S,g.x(t.x+f),t.y+d/2),t.y+=d+o},p=g.textAlign(r);let b,y,_,w,x,M,v;for(e.textAlign=r,e.textBaseline="middle",e.font=u.string,t.x=Pi(this,p,s),e.fillStyle=s.bodyColor,z(this.beforeBody,m),f=a&&p!=="right"?r==="center"?c/2+h:c+2+h:0,w=0,M=n.length;w<M;++w){for(b=n[w],y=this.labelTextColors[w],e.fillStyle=y,z(b.before,m),_=b.lines,a&&_.length&&(this._drawColorBox(e,t,w,g,s),d=Math.max(u.lineHeight,l)),x=0,v=_.length;x<v;++x)m(_[x]),d=u.lineHeight;z(b.after,m)}f=0,d=u.lineHeight,z(this.afterBody,m),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;if(o){const l=we(s.rtl,this.x,this.width);for(t.x=Pi(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=Q(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=le(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+u,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-g),e.quadraticCurveTo(a+c,l+h,a+c-g,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="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,o=s&&s.y;if(n||o){const r=Ye[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=No(this,t),l=Object.assign({},r,this._size),c=zo(e,t,l),h=Vo(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.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},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=rt(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(o,t,n,e),Zr(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),qr(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}}),o=!Ji(s,n),r=this._positionChanged(n,e);(o||r)&&(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,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!Ji(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=Ye[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}k(Zs,"positioners",Ye);var sf={id:"tooltip",_element:Zs,positioners:Ye,afterInit(i,t,e){e&&(i.tooltip=new Zs({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:_a},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"]},nf=Object.freeze({__proto__:null,Colors:md,Decimation:xd,Filler:Vd,Legend:Ud,SubTitle:qd,Title:Zd,Tooltip:sf});const of=(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 of(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const af=(i,t)=>i===null?null:tt(Math.round(i),0,t);function Ho(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class qs extends fe{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:o}of e)s[n]===o&&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,C(e,t),this._addedLabels),af(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 o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return Ho.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(qs,"id","category"),k(qs,"defaults",{ticks:{callback:Ho}});function lf(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=i,f=o||1,g=h-1,{min:m,max:p}=t,b=!F(r),y=!F(a),_=!F(c),w=(p-m)/(u+1);let x=Nn((p-m)/g/f)*f,M,v,S,D;if(x<1e-14&&!b&&!y)return[{value:m},{value:p}];D=Math.ceil(p/x)-Math.floor(m/x),D>g&&(x=Nn(D*x/g/f)*f),F(l)||(M=Math.pow(10,l),x=Math.ceil(x*M)/M),n==="ticks"?(v=Math.floor(m/x)*x,S=Math.ceil(p/x)*x):(v=m,S=p),b&&y&&o&&sc((a-r)/o,x/1e3)?(D=Math.round(Math.min((a-r)/x,h)),x=(a-r)/D,v=r,S=a):_?(v=b?r:v,S=y?a:S,D=c-1,x=(S-v)/D):(D=(S-v)/x,Je(D,Math.round(D),x/1e3)?D=Math.round(D):D=Math.ceil(D));const E=Math.max(zn(x),zn(v));M=Math.pow(10,F(l)?E:l),v=Math.round(v*M)/M,S=Math.round(S*M)/M;let P=0;for(b&&(d&&v!==r?(e.push({value:r}),v<r&&P++,Je(Math.round((v+P*x)*M)/M,r,$o(r,w,i))&&P++):v<r&&P++);P<D;++P)e.push({value:Math.round((v+P*x)*M)/M});return y&&d&&S!==a?e.length&&Je(e[e.length-1].value,a,$o(a,w,i))?e[e.length-1].value=a:e.push({value:a}):(!y||S===a)&&e.push({value:S}),e}function $o(i,t,{horizontal:e,minRotation:s}){const n=St(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class os extends fe{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:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=Et(n),c=Et(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}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},o=this._range||this,r=lf(n,o);return t.bounds==="ticks"&&Dr(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}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 fi(t,this.chart.options.locale,this.options.ticks.format)}}class Xs extends os{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=St(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.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(Xs,"id","linear"),k(Xs,"defaults",{ticks:{callback:hs.formatters.numeric}});const hi=i=>Math.floor(Ut(i)),ee=(i,t)=>Math.pow(10,hi(i)+t);function jo(i){return i/Math.pow(10,hi(i))===1}function Uo(i,t,e){const s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function cf(i,t){const e=t-i;let s=hi(e);for(;Uo(i,t,s)>10;)s++;for(;Uo(i,t,s)<10;)s--;return Math.min(s,hi(i))}function hf(i,{min:t,max:e}){t=ut(i.min,t);const s=[],n=hi(t);let o=cf(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10;let u=Math.floor((c-h)/Math.pow(10,o)),d=ut(i.min,Math.round((l+h+u*Math.pow(10,o))*r)/r);for(;d<e;)s.push({value:d,major:jo(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,r=o>=0?1:r),d=Math.round((l+h+u*Math.pow(10,o))*r)/r;const f=ut(i.max,d);return s.push({value:f,major:jo(f),significand:u}),s}class Gs extends fe{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=os.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===ee(this.min,0)?ee(this.min,-1):ee(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const o=a=>s=t?s:a,r=a=>n=e?n:a;s===n&&(s<=0?(o(1),r(10)):(o(ee(s,-1)),r(ee(n,1)))),s<=0&&o(ee(n,-1)),n<=0&&r(ee(s,1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=hf(e,this);return t.bounds==="ticks"&&Dr(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":fi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ut(t),this._valueRange=Ut(this.max)-Ut(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ut(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}k(Gs,"id","logarithmic"),k(Gs,"defaults",{ticks:{callback:hs.formatters.logarithmic,major:{enabled:!0}}});function Js(i){const t=i.ticks;if(t.display&&i.display){const e=rt(t.backdropPadding);return C(t.font&&t.font.size,G.font.size)+e.height}return 0}function uf(i,t,e){return e=H(e)?e:[e],{w:_c(i,t.string,e),h:e.length*t.lineHeight}}function Yo(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 df(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=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?U/o:0;for(let l=0;l<o;l++){const c=r.setContext(i.getPointLabelContext(l));n[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+n[l],a),u=Q(c.font),d=uf(i.ctx,u,i._pointLabels[l]);s[l]=d;const f=dt(i.getIndexAngle(l)+a),g=Math.round(dn(f)),m=Yo(g,h.x,d.w,0,180),p=Yo(g,h.y,d.h,90,270);ff(e,t,f,m,p)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=gf(i,s,n)}function ff(i,t,e,s,n){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;s.start<t.l?(a=(t.l-s.start)/o,i.l=Math.min(i.l,t.l-a)):s.end>t.r&&(a=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),n.start<t.t?(l=(t.t-n.start)/r,i.t=Math.min(i.t,t.t-l)):n.end>t.b&&(l=(n.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function gf(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,r=Js(o)/2,a=i.drawingArea,l=o.pointLabels.centerPointLabels?U/n:0;for(let c=0;c<n;c++){const h=i.getPointPosition(c,a+r+e[c],l),u=Math.round(dn(dt(h.angle+q))),d=t[c],f=bf(h.y,d.h,u),g=mf(u),m=pf(h.x,d.w,g);s.push({x:h.x,y:f,textAlign:g,left:m,top:f,right:m+d.w,bottom:f+d.h})}return s}function mf(i){return i===0||i===180?"center":i<180?"left":"right"}function pf(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function bf(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function yf(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const o=s.setContext(i.getPointLabelContext(n)),r=Q(o.font),{x:a,y:l,textAlign:c,left:h,top:u,right:d,bottom:f}=i._pointLabelItems[n],{backdropColor:g}=o;if(!F(g)){const m=le(o.borderRadius),p=rt(o.backdropPadding);e.fillStyle=g;const b=h-p.left,y=u-p.top,_=d-h+p.width,w=f-u+p.height;Object.values(m).some(x=>x!==0)?(e.beginPath(),li(e,{x:b,y,w:_,h:w,radius:m}),e.fill()):e.fillRect(b,y,_,w)}de(e,i._pointLabels[n],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function wa(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,$);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let r=1;r<s;r++)o=i.getPointPosition(r,t),n.lineTo(o.x,o.y)}}function xf(i,t,e,s,n){const o=i.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!s||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(n.dash),o.lineDashOffset=n.dashOffset,o.beginPath(),wa(i,e,r,s),o.closePath(),o.stroke(),o.restore())}function _f(i,t,e){return Jt(i,{label:e,index:t,type:"pointLabel"})}class Ze extends os{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=rt(Js(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/Js(this.options))}generateTickLabels(t){os.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?df(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 dt(t*e+St(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 _f(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:o}=this._pointLabelItems[t];return{left:e,top:s,right:n,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),wa(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:o}=e,r=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&yf(this,r),n.display&&this.ticks.forEach((h,u)=>{if(u!==0){l=this.getDistanceFromCenterForValue(h.value);const d=this.getContext(u),f=n.setContext(d),g=o.setContext(d);xf(this,f,l,r,g)}}),s.display){for(t.save(),a=r-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 o,r;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(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const u=rt(c.backdropPadding);t.fillRect(-r/2-u.left,-o-h.size/2-u.top,r+u.width,h.size+u.height)}de(t,a.label,0,-o,h,{color:c.color})}),t.restore()}drawTitle(){}}k(Ze,"id","radialLinear"),k(Ze,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:hs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),k(Ze,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),k(Ze,"descriptors",{angleLines:{_fallback:"grid"}});const gs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ct=Object.keys(gs);function wf(i,t){return i-t}function Zo(i,t){if(F(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),Z(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Se(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function qo(i,t,e,s){const n=ct.length;for(let o=ct.indexOf(i);o<n-1;++o){const r=gs[ct[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return ct[o]}return ct[n-1]}function vf(i,t,e,s,n){for(let o=ct.length-1;o>=ct.indexOf(e);o--){const r=ct[o];if(gs[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return ct[e?ct.indexOf(e):0]}function Sf(i){for(let t=ct.indexOf(i)+1,e=ct.length;t<e;++t)if(gs[ct[t]].common)return ct[t]}function Xo(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=fn(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Mf(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;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={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,s.push({value:a,major:!1});return o===0||!e?s:Mf(i,s,n,e)}class ui extends fe{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 ea._date(t.adapters.date);n.init(e),Ge(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:Zo(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:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!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),o=Z(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_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 o=this.min,r=this.max,a=ac(n,o,r);return this._unit=e.unit||(s.autoSkip?qo(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):vf(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Sf(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,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=tt(e,0,r),s=tt(s,0,r),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,o=n.time,r=o.unit||qo(o.minUnit,e,s,this._getLabelCapacity(e)),a=C(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Se(l)||l===!0,h={};let u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<s;d=+t.add(d,a,r),f++)Xo(h,d,g);return(d===s||n.bounds==="ticks"||f===1)&&Xo(h,d,g),Object.keys(h).sort((m,p)=>m-p).map(m=>+m)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return W(r,[t,e,s],this);const a=o.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=St(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,Go(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.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(Zo(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Pr(t.sort(wf))}}k(ui,"id","time"),k(ui,"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 Ai(i,t,e){let s=0,n=i.length-1,o,r,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Nt(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Nt(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Ks extends ui{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=Ai(e,this.min),this._tableRange=Ai(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_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(Ai(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Ai(this._table,s*this._tableRange+this._minPos,!0)}}k(Ks,"id","timeseries"),k(Ks,"defaults",ui.defaults);var kf=Object.freeze({__proto__:null,CategoryScale:qs,LinearScale:Xs,LogarithmicScale:Gs,RadialLinearScale:Ze,TimeScale:ui,TimeSeriesScale:Ks});const Tf=[Fh,cd,nf,kf];Ft.register(...Tf);class ge extends Error{}class Of extends ge{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Df extends ge{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Cf extends ge{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class qe extends ge{}class va extends ge{constructor(t){super(`Invalid unit ${t}`)}}class pt extends ge{}class Wt extends ge{constructor(){super("Zone is an abstract class")}}const T="numeric",Ot="short",ft="long",rs={year:T,month:T,day:T},Sa={year:T,month:Ot,day:T},Ef={year:T,month:Ot,day:T,weekday:Ot},Ma={year:T,month:ft,day:T},ka={year:T,month:ft,day:T,weekday:ft},Ta={hour:T,minute:T},Oa={hour:T,minute:T,second:T},Da={hour:T,minute:T,second:T,timeZoneName:Ot},Ca={hour:T,minute:T,second:T,timeZoneName:ft},Ea={hour:T,minute:T,hourCycle:"h23"},Pa={hour:T,minute:T,second:T,hourCycle:"h23"},Aa={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:Ot},Ia={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:ft},La={year:T,month:T,day:T,hour:T,minute:T},Fa={year:T,month:T,day:T,hour:T,minute:T,second:T},Ra={year:T,month:Ot,day:T,hour:T,minute:T},Na={year:T,month:Ot,day:T,hour:T,minute:T,second:T},Pf={year:T,month:Ot,day:T,weekday:Ot,hour:T,minute:T},za={year:T,month:ft,day:T,hour:T,minute:T,timeZoneName:Ot},Va={year:T,month:ft,day:T,hour:T,minute:T,second:T,timeZoneName:Ot},Wa={year:T,month:ft,day:T,weekday:ft,hour:T,minute:T,timeZoneName:ft},Ba={year:T,month:ft,day:T,weekday:ft,hour:T,minute:T,second:T,timeZoneName:ft};class mi{get type(){throw new Wt}get name(){throw new Wt}get ianaName(){return this.name}get isUniversal(){throw new Wt}offsetName(t,e){throw new Wt}formatOffset(t,e){throw new Wt}offset(t){throw new Wt}equals(t){throw new Wt}get isValid(){throw new Wt}}let Ps=null;class ms extends mi{static get instance(){return Ps===null&&(Ps=new ms),Ps}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return $a(t,e,s)}formatOffset(t,e){return ii(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Xi={};function Af(i){return Xi[i]||(Xi[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"})),Xi[i]}const If={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Lf(i,t){const e=i.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e),[,n,o,r,a,l,c,h]=s;return[r,n,o,a,l,c,h]}function Ff(i,t){const e=i.formatToParts(t),s=[];for(let n=0;n<e.length;n++){const{type:o,value:r}=e[n],a=If[o];o==="era"?s[a]=r:I(a)||(s[a]=parseInt(r,10))}return s}let Ii={};class Vt extends mi{static create(t){return Ii[t]||(Ii[t]=new Vt(t)),Ii[t]}static resetCache(){Ii={},Xi={}}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=Vt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:s}){return $a(t,e,s,this.name)}formatOffset(t,e){return ii(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const s=Af(this.name);let[n,o,r,a,l,c,h]=s.formatToParts?Ff(s,e):Lf(s,e);a==="BC"&&(n=-Math.abs(n)+1);const d=kn({year:n,month:o,day:r,hour:l===24?0:l,minute:c,second:h,millisecond:0});let f=+e;const g=f%1e3;return f-=g>=0?g:1e3+g,(d-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Jo={};function Rf(i,t={}){const e=JSON.stringify([i,t]);let s=Jo[e];return s||(s=new Intl.ListFormat(i,t),Jo[e]=s),s}let Qs={};function tn(i,t={}){const e=JSON.stringify([i,t]);let s=Qs[e];return s||(s=new Intl.DateTimeFormat(i,t),Qs[e]=s),s}let en={};function Nf(i,t={}){const e=JSON.stringify([i,t]);let s=en[e];return s||(s=new Intl.NumberFormat(i,t),en[e]=s),s}let sn={};function zf(i,t={}){const{base:e,...s}=t,n=JSON.stringify([i,s]);let o=sn[n];return o||(o=new Intl.RelativeTimeFormat(i,t),sn[n]=o),o}let Xe=null;function Vf(){return Xe||(Xe=new Intl.DateTimeFormat().resolvedOptions().locale,Xe)}function Wf(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=tn(i).resolvedOptions(),n=i}catch{const l=i.substring(0,e);s=tn(l).resolvedOptions(),n=l}const{numberingSystem:o,calendar:r}=s;return[n,o,r]}}function Bf(i,t,e){return(e||t)&&(i.includes("-u-")||(i+="-u"),e&&(i+=`-ca-${e}`),t&&(i+=`-nu-${t}`)),i}function Hf(i){const t=[];for(let e=1;e<=12;e++){const s=O.utc(2016,e,1);t.push(i(s))}return t}function $f(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 Li(i,t,e,s,n){const o=i.listingMode(e);return o==="error"?null:o==="en"?s(t):n(t)}function jf(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 Uf{constructor(t,e,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:n,floor:o,...r}=s;if(!e||Object.keys(r).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=Nf(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):Mn(t,3);return K(e,this.padTo)}}}class Yf{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 r=-1*(t.offset/60),a=r>=0?`Etc/GMT+${r}`:`Etc/GMT${r}`;t.offset!==0&&Vt.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 o={...this.opts};o.timeZone=o.timeZone||n,this.dtf=tn(e,o)}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 Zf{constructor(t,e,s){this.opts={style:"long",...s},!e&&Ha()&&(this.rtf=zf(t,s))}format(t,e){return this.rtf?this.rtf.format(t,e):hg(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 o=t||J.defaultLocale,r=o||(n?"en-US":Vf()),a=e||J.defaultNumberingSystem,l=s||J.defaultOutputCalendar;return new B(r,a,l,o)}static resetCache(){Xe=null,Qs={},en={},sn={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:s}={}){return B.create(t,e,s)}constructor(t,e,s,n){const[o,r,a]=Wf(t);this.locale=o,this.numberingSystem=e||r||null,this.outputCalendar=s||a||null,this.intl=Bf(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=jf(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 Li(this,t,s,Ya,()=>{const n=e?{month:t,day:"numeric"}:{month:t},o=e?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Hf(r=>this.extract(r,n,"month"))),this.monthsCache[o][t]})}weekdays(t,e=!1,s=!0){return Li(this,t,s,Xa,()=>{const n=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=e?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=$f(r=>this.extract(r,n,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Li(this,void 0,t,()=>Ga,()=>{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 Li(this,t,e,Ja,()=>{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),o=n.formatToParts(),r=o.find(a=>a.type.toLowerCase()===s);return r?r.value:null}numberFormatter(t={}){return new Uf(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new Yf(t,this.intl,e)}relFormatter(t={}){return new Zf(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Rf(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 As=null;class at extends mi{static get utcInstance(){return As===null&&(As=new at(0)),As}static instance(t){return t===0?at.utcInstance:new at(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new at(bs(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ii(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ii(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return ii(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 qf extends mi{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 $t(i,t){if(I(i)||i===null)return t;if(i instanceof mi)return i;if(Xf(i)){const e=i.toLowerCase();return e==="default"?t:e==="local"||e==="system"?ms.instance:e==="utc"||e==="gmt"?at.utcInstance:at.parseSpecifier(e)||Vt.create(i)}else return he(i)?at.instance(i):typeof i=="object"&&i.offset&&typeof i.offset=="number"?i:new qf(i)}let Ko=()=>Date.now(),Qo="system",tr=null,er=null,ir=null,sr=60,nr;class J{static get now(){return Ko}static set now(t){Ko=t}static set defaultZone(t){Qo=t}static get defaultZone(){return $t(Qo,ms.instance)}static get defaultLocale(){return tr}static set defaultLocale(t){tr=t}static get defaultNumberingSystem(){return er}static set defaultNumberingSystem(t){er=t}static get defaultOutputCalendar(){return ir}static set defaultOutputCalendar(t){ir=t}static get twoDigitCutoffYear(){return sr}static set twoDigitCutoffYear(t){sr=t%100}static get throwOnInvalid(){return nr}static set throwOnInvalid(t){nr=t}static resetCaches(){B.resetCache(),Vt.resetCache()}}function I(i){return typeof i>"u"}function he(i){return typeof i=="number"}function ps(i){return typeof i=="number"&&i%1===0}function Xf(i){return typeof i=="string"}function Gf(i){return Object.prototype.toString.call(i)==="[object Date]"}function Ha(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Jf(i){return Array.isArray(i)?i:[i]}function or(i,t,e){if(i.length!==0)return i.reduce((s,n)=>{const o=[t(n),n];return s&&e(s[0],o[0])===s[0]?s:o},null)[1]}function Kf(i,t){return t.reduce((e,s)=>(e[s]=i[s],e),{})}function Te(i,t){return Object.prototype.hasOwnProperty.call(i,t)}function zt(i,t,e){return ps(i)&&i>=t&&i<=e}function Qf(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 Ht(i){if(!(I(i)||i===null||i===""))return parseInt(i,10)}function ie(i){if(!(I(i)||i===null||i===""))return parseFloat(i)}function Sn(i){if(!(I(i)||i===null||i==="")){const t=parseFloat("0."+i)*1e3;return Math.floor(t)}}function Mn(i,t,e=!1){const s=10**t;return(e?Math.trunc:Math.round)(i*s)/s}function pi(i){return i%4===0&&(i%100!==0||i%400===0)}function ei(i){return pi(i)?366:365}function as(i,t){const e=Qf(t-1,12)+1,s=i+(t-e)/12;return e===2?pi(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function kn(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 ls(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 nn(i){return i>99?i:i>J.twoDigitCutoffYear?1900+i:2e3+i}function $a(i,t,e,s=null){const n=new Date(i),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(o.timeZone=s);const r={timeZoneName:t,...o},a=new Intl.DateTimeFormat(e,r).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function bs(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 ja(i){const t=Number(i);if(typeof i=="boolean"||i===""||Number.isNaN(t))throw new pt(`Invalid unit value ${i}`);return t}function cs(i,t){const e={};for(const s in i)if(Te(i,s)){const n=i[s];if(n==null)continue;e[t(s)]=ja(n)}return e}function ii(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 ys(i){return Kf(i,["hour","minute","second","millisecond"])}const tg=["January","February","March","April","May","June","July","August","September","October","November","December"],Ua=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],eg=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ya(i){switch(i){case"narrow":return[...eg];case"short":return[...Ua];case"long":return[...tg];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 Za=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],qa=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ig=["M","T","W","T","F","S","S"];function Xa(i){switch(i){case"narrow":return[...ig];case"short":return[...qa];case"long":return[...Za];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ga=["AM","PM"],sg=["Before Christ","Anno Domini"],ng=["BC","AD"],og=["B","A"];function Ja(i){switch(i){case"narrow":return[...og];case"short":return[...ng];case"long":return[...sg];default:return null}}function rg(i){return Ga[i.hour<12?0:1]}function ag(i,t){return Xa(t)[i.weekday-1]}function lg(i,t){return Ya(t)[i.month-1]}function cg(i,t){return Ja(t)[i.year<0?0:1]}function hg(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."]},o=["hours","minutes","seconds"].indexOf(i)===-1;if(e==="auto"&&o){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 r=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 r?`${a} ${h} ago`:`in ${a} ${h}`}function rr(i,t){let e="";for(const s of i)s.literal?e+=s.val:e+=t(s.val);return e}const ug={D:rs,DD:Sa,DDD:Ma,DDDD:ka,t:Ta,tt:Oa,ttt:Da,tttt:Ca,T:Ea,TT:Pa,TTT:Aa,TTTT:Ia,f:La,ff:Ra,fff:za,ffff:Wa,F:Fa,FF:Na,FFF:Va,FFFF:Ba};class nt{static create(t,e={}){return new nt(t,e)}static parseFormat(t){let e=null,s="",n=!1;const o=[];for(let r=0;r<t.length;r++){const a=t.charAt(r);a==="'"?(s.length>0&&o.push({literal:n||/^\s+$/.test(s),val:s}),e=null,s="",n=!n):n||a===e?s+=a:(s.length>0&&o.push({literal:/^\s+$/.test(s),val:s}),s=a,e=a)}return s.length>0&&o.push({literal:n||/^\s+$/.test(s),val:s}),o}static macroTokenToFormatOpts(t){return ug[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}formatInterval(t,e={}){return this.loc.dtFormatter(t.start,{...this.opts,...e}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return K(t,e);const s={...this.opts};return e>0&&(s.padTo=e),this.loc.numberFormatter(s).format(t)}formatDateTimeFromString(t,e){const s=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(f,g)=>this.loc.extract(t,f,g),r=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>s?rg(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,g)=>s?lg(t,f):o(g?{month:f}:{month:f,day:"numeric"},"month"),c=(f,g)=>s?ag(t,f):o(g?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),h=f=>{const g=nt.macroTokenToFormatOpts(f);return g?this.formatWithSystemDefault(t,g):f},u=f=>s?cg(t,f):o({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 r({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return r({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return r({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?o({day:"numeric"},"day"):this.num(t.day);case"dd":return n?o({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?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?o({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?o({month:"numeric"},"month"):this.num(t.month);case"MM":return n?o({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?o({year:"numeric"},"year"):this.num(t.year);case"yy":return n?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?o({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 rr(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},o=nt.parseFormat(e),r=o.reduce((l,{literal:c,val:h})=>c?l:l.concat(h),[]),a=t.shiftTo(...r.map(s).filter(l=>l));return rr(o,n(a))}}class Mt{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Ka=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Oe(...i){const t=i.reduce((e,s)=>e+s.source,"");return RegExp(`^${t}$`)}function De(...i){return t=>i.reduce(([e,s,n],o)=>{const[r,a,l]=o(t,n);return[{...e,...r},a||s,l]},[{},null,1]).slice(0,2)}function Ce(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 Qa(...i){return(t,e)=>{const s={};let n;for(n=0;n<i.length;n++)s[i[n]]=Ht(t[e+n]);return[s,null,e+n]}}const tl=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,dg=`(?:${tl.source}?(?:\\[(${Ka.source})\\])?)?`,Tn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,el=RegExp(`${Tn.source}${dg}`),On=RegExp(`(?:T${el.source})?`),fg=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,gg=/(\d{4})-?W(\d\d)(?:-?(\d))?/,mg=/(\d{4})-?(\d{3})/,pg=Qa("weekYear","weekNumber","weekDay"),bg=Qa("year","ordinal"),yg=/(\d{4})-(\d\d)-(\d\d)/,il=RegExp(`${Tn.source} ?(?:${tl.source}|(${Ka.source}))?`),xg=RegExp(`(?: ${il.source})?`);function ve(i,t,e){const s=i[t];return I(s)?e:Ht(s)}function _g(i,t){return[{year:ve(i,t),month:ve(i,t+1,1),day:ve(i,t+2,1)},null,t+3]}function Ee(i,t){return[{hours:ve(i,t,0),minutes:ve(i,t+1,0),seconds:ve(i,t+2,0),milliseconds:Sn(i[t+3])},null,t+4]}function bi(i,t){const e=!i[t]&&!i[t+1],s=bs(i[t+1],i[t+2]),n=e?null:at.instance(s);return[{},n,t+3]}function yi(i,t){const e=i[t]?Vt.create(i[t]):null;return[{},e,t+1]}const wg=RegExp(`^T?${Tn.source}$`),vg=/^-?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 Sg(i){const[t,e,s,n,o,r,a,l,c]=i,h=t[0]==="-",u=l&&l[0]==="-",d=(f,g=!1)=>f!==void 0&&(g||f&&h)?-f:f;return[{years:d(ie(e)),months:d(ie(s)),weeks:d(ie(n)),days:d(ie(o)),hours:d(ie(r)),minutes:d(ie(a)),seconds:d(ie(l),l==="-0"),milliseconds:d(Sn(c),u)}]}const Mg={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 Dn(i,t,e,s,n,o,r){const a={year:t.length===2?nn(Ht(t)):Ht(t),month:Ua.indexOf(e)+1,day:Ht(s),hour:Ht(n),minute:Ht(o)};return r&&(a.second=Ht(r)),i&&(a.weekday=i.length>3?Za.indexOf(i)+1:qa.indexOf(i)+1),a}const kg=/^(?:(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 Tg(i){const[,t,e,s,n,o,r,a,l,c,h,u]=i,d=Dn(t,n,s,e,o,r,a);let f;return l?f=Mg[l]:c?f=0:f=bs(h,u),[d,new at(f)]}function Og(i){return i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Dg=/^(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$/,Cg=/^(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$/,Eg=/^(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 ar(i){const[,t,e,s,n,o,r,a]=i;return[Dn(t,n,s,e,o,r,a),at.utcInstance]}function Pg(i){const[,t,e,s,n,o,r,a]=i;return[Dn(t,a,e,s,n,o,r),at.utcInstance]}const Ag=Oe(fg,On),Ig=Oe(gg,On),Lg=Oe(mg,On),Fg=Oe(el),sl=De(_g,Ee,bi,yi),Rg=De(pg,Ee,bi,yi),Ng=De(bg,Ee,bi,yi),zg=De(Ee,bi,yi);function Vg(i){return Ce(i,[Ag,sl],[Ig,Rg],[Lg,Ng],[Fg,zg])}function Wg(i){return Ce(Og(i),[kg,Tg])}function Bg(i){return Ce(i,[Dg,ar],[Cg,ar],[Eg,Pg])}function Hg(i){return Ce(i,[vg,Sg])}const $g=De(Ee);function jg(i){return Ce(i,[wg,$g])}const Ug=Oe(yg,xg),Yg=Oe(il),Zg=De(Ee,bi,yi);function qg(i){return Ce(i,[Ug,sl],[Yg,Zg])}const Xg="Invalid Duration",nl={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}},Gg={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},...nl},mt=146097/400,xe=146097/4800,Jg={years:{quarters:4,months:12,weeks:mt/7,days:mt,hours:mt*24,minutes:mt*24*60,seconds:mt*24*60*60,milliseconds:mt*24*60*60*1e3},quarters:{months:3,weeks:mt/28,days:mt/4,hours:mt*24/4,minutes:mt*24*60/4,seconds:mt*24*60*60/4,milliseconds:mt*24*60*60*1e3/4},months:{weeks:xe/7,days:xe,hours:xe*24,minutes:xe*24*60,seconds:xe*24*60*60,milliseconds:xe*24*60*60*1e3},...nl},oe=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Kg=oe.slice(0).reverse();function Bt(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 Qg(i){return i<0?Math.floor(i):Math.ceil(i)}function ol(i,t,e,s,n){const o=i[n][e],r=t[e]/o,a=Math.sign(r)===Math.sign(s[n]),l=!a&&s[n]!==0&&Math.abs(r)<=1?Qg(r):Math.trunc(r);s[n]+=l,t[e]-=l*o}function tm(i,t){Kg.reduce((e,s)=>I(t[s])?e:(e&&ol(i,t,e,t,s),s),null)}function em(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?Jg:Gg;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 pt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new L({values:cs(t,L.normalizeUnit),loc:B.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(he(t))return L.fromMillis(t);if(L.isDuration(t))return t;if(typeof t=="object")return L.fromObject(t);throw new pt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[s]=Hg(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]=jg(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 pt("need to specify a reason the Duration is invalid");const s=t instanceof Mt?t:new Mt(t,e);if(J.throwOnInvalid)throw new Cf(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 va(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):Xg}toHuman(t={}){const e=oe.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+=Mn(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 o=s.toFormat(n);return t.includePrefix&&(o="T"+o),o}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 oe)(Te(e.values,n)||Te(this.values,n))&&(s[n]=e.get(n)+this.get(n));return Bt(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]=ja(t(this.values[s],s));return Bt(this,{values:e},!0)}get(t){return this[L.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const e={...this.values,...cs(t,L.normalizeUnit)};return Bt(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:s,matrix:n}={}){const r={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:n,conversionAccuracy:s};return Bt(this,r)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return tm(this.matrix,t),Bt(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=em(this.normalize().shiftToAll().toObject());return Bt(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(r=>L.normalizeUnit(r));const e={},s={},n=this.toObject();let o;for(const r of oe)if(t.indexOf(r)>=0){o=r;let a=0;for(const c in s)a+=this.matrix[c][r]*s[c],s[c]=0;he(n[r])&&(a+=n[r]);const l=Math.trunc(a);e[r]=l,s[r]=(a*1e3-l*1e3)/1e3;for(const c in n)oe.indexOf(c)>oe.indexOf(r)&&ol(this.matrix,n,c,e,r)}else he(n[r])&&(s[r]=n[r]);for(const r in s)s[r]!==0&&(e[o]+=r===o?s[r]:s[r]/this.matrix[o][r]);return Bt(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 Bt(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 oe)if(!e(this.values[s],t.values[s]))return!1;return!0}}const _e="Invalid Interval";function im(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 pt("need to specify a reason the Interval is invalid");const s=t instanceof Mt?t:new Mt(t,e);if(J.throwOnInvalid)throw new Df(s);return new Y({invalid:s})}static fromDateTimes(t,e){const s=He(t),n=He(e),o=im(s,n);return o??new Y({start:s,end:n})}static after(t,e){const s=L.fromDurationLike(e),n=He(t);return Y.fromDateTimes(n,n.plus(s))}static before(t,e){const s=L.fromDurationLike(e),n=He(t);return Y.fromDateTimes(n.minus(s),n)}static fromISO(t,e){const[s,n]=(t||"").split("/",2);if(s&&n){let o,r;try{o=O.fromISO(s,e),r=o.isValid}catch{r=!1}let a,l;try{a=O.fromISO(n,e),l=a.isValid}catch{l=!1}if(r&&l)return Y.fromDateTimes(o,a);if(r){const c=L.fromISO(n,e);if(c.isValid)return Y.after(o,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(He).filter(r=>this.contains(r)).sort(),s=[];let{s:n}=this,o=0;for(;n<this.e;){const r=e[o]||this.e,a=+r>+this.e?this.e:r;s.push(Y.fromDateTimes(n,a)),n=a,o+=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,o;const r=[];for(;s<this.e;){const a=this.start.plus(e.mapUnits(l=>l*n));o=+a>+this.e?this.e:a,r.push(Y.fromDateTimes(s,o)),s=o,n+=1}return r}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,o)=>n.s-o.s).reduce(([n,o],r)=>o?o.overlaps(r)||o.abutsStart(r)?[n,o.union(r)]:[n.concat([o]),r]:[n,r],[[],null]);return s&&e.push(s),e}static xor(t){let e=null,s=0;const n=[],o=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),r=Array.prototype.concat(...o),a=r.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()})`:_e}toLocaleString(t=rs,e={}){return this.isValid?nt.create(this.s.loc.clone(e),t).formatInterval(this):_e}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:_e}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:_e}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:_e}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:_e}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 Fi{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 Vt.isValidZone(t)}static normalizeZone(t){return $t(t,J.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||B.create(e,s,o)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||B.create(e,s,o)).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:Ha()}}}function lr(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 sm(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=lr(l,c);return(h-h%7)/7}],["days",lr]],n={},o=i;let r,a;for(const[l,c]of s)e.indexOf(l)>=0&&(r=l,n[l]=c(i,t),a=o.plus(n),a>t?(n[l]--,i=o.plus(n)):i=a);return[i,n,a,r]}function nm(i,t,e,s){let[n,o,r,a]=sm(i,t,e);const l=t-n,c=e.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);c.length===0&&(r<t&&(r=n.plus({[a]:1})),r!==n&&(o[a]=(o[a]||0)+l/(r-n)));const h=L.fromObject(o,s);return c.length>0?L.fromMillis(l,s).shiftTo(...c).plus(h):h}const Cn={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},cr={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]},om=Cn.hanidec.replace(/[\[|\]]/g,"").split("");function rm(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(Cn.hanidec)!==-1)t+=om.indexOf(i[e]);else for(const n in cr){const[o,r]=cr[n];s>=o&&s<=r&&(t+=s-o)}}return parseInt(t,10)}else return t}function wt({numberingSystem:i},t=""){return new RegExp(`${Cn[i||"latn"]}${t}`)}const am="missing Intl.DateTimeFormat.formatToParts support";function N(i,t=e=>e){return{regex:i,deser:([e])=>t(rm(e))}}const lm=String.fromCharCode(160),rl=`[ ${lm}]`,al=new RegExp(rl,"g");function cm(i){return i.replace(/\./g,"\\.?").replace(al,rl)}function hr(i){return i.replace(/\./g,"").replace(al," ").toLowerCase()}function vt(i,t){return i===null?null:{regex:RegExp(i.map(cm).join("|")),deser:([e])=>i.findIndex(s=>hr(e)===hr(s))+t}}function ur(i,t){return{regex:i,deser:([,e,s])=>bs(e,s),groups:t}}function Ri(i){return{regex:i,deser:([t])=>t}}function hm(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function um(i,t){const e=wt(t),s=wt(t,"{2}"),n=wt(t,"{3}"),o=wt(t,"{4}"),r=wt(t,"{6}"),a=wt(t,"{1,2}"),l=wt(t,"{1,3}"),c=wt(t,"{1,6}"),h=wt(t,"{1,9}"),u=wt(t,"{2,4}"),d=wt(t,"{4,6}"),f=p=>({regex:RegExp(hm(p.val)),deser:([b])=>b,literal:!0}),m=(p=>{if(i.literal)return f(p);switch(p.val){case"G":return vt(t.eras("short",!1),0);case"GG":return vt(t.eras("long",!1),0);case"y":return N(c);case"yy":return N(u,nn);case"yyyy":return N(o);case"yyyyy":return N(d);case"yyyyyy":return N(r);case"M":return N(a);case"MM":return N(s);case"MMM":return vt(t.months("short",!0,!1),1);case"MMMM":return vt(t.months("long",!0,!1),1);case"L":return N(a);case"LL":return N(s);case"LLL":return vt(t.months("short",!1,!1),1);case"LLLL":return vt(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 Ri(h);case"uu":return Ri(a);case"uuu":return N(e);case"a":return vt(t.meridiems(),0);case"kkkk":return N(o);case"kk":return N(u,nn);case"W":return N(a);case"WW":return N(s);case"E":case"c":return N(e);case"EEE":return vt(t.weekdays("short",!1,!1),1);case"EEEE":return vt(t.weekdays("long",!1,!1),1);case"ccc":return vt(t.weekdays("short",!0,!1),1);case"cccc":return vt(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return ur(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return ur(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return Ri(/[a-z_+-/]{1,256}?/i);case" ":return Ri(/[^\S\n\r]/);default:return f(p)}})(i)||{invalidReason:am};return m.token=i,m}const dm={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 fm(i,t){const{type:e,value:s}=i;if(e==="literal"){const r=/^\s+$/.test(s);return{literal:!r,val:r?" ":s}}const n=t[e];let o=dm[e];if(typeof o=="object"&&(o=o[n]),o)return{literal:!1,val:o}}function gm(i){return[`^${i.map(e=>e.regex).reduce((e,s)=>`${e}(${s.source})`,"")}$`,i]}function mm(i,t,e){const s=i.match(t);if(s){const n={};let o=1;for(const r in e)if(Te(e,r)){const a=e[r],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(n[a.token.val[0]]=a.deser(s.slice(o,o+l))),o+=l}return[s,n]}else return[s,{}]}function pm(i){const t=o=>{switch(o){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=Vt.create(i.z)),I(i.Z)||(e||(e=new at(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=Sn(i.u)),[Object.keys(i).reduce((o,r)=>{const a=t(r);return a&&(o[a]=i[r]),o},{}),e,s]}let Is=null;function bm(){return Is||(Is=O.fromMillis(1555555555555)),Is}function ym(i,t){if(i.literal)return i;const e=nt.macroTokenToFormatOpts(i.val),s=hl(e,t);return s==null||s.includes(void 0)?i:s}function ll(i,t){return Array.prototype.concat(...i.map(e=>ym(e,t)))}function cl(i,t,e){const s=ll(nt.parseFormat(e),i),n=s.map(r=>um(r,i)),o=n.find(r=>r.invalidReason);if(o)return{input:t,tokens:s,invalidReason:o.invalidReason};{const[r,a]=gm(n),l=RegExp(r,"i"),[c,h]=mm(t,l,a),[u,d,f]=h?pm(h):[null,null,void 0];if(Te(h,"a")&&Te(h,"H"))throw new qe("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 xm(i,t,e){const{result:s,zone:n,specificOffset:o,invalidReason:r}=cl(i,t,e);return[s,n,o,r]}function hl(i,t){return i?nt.create(t,i).formatDateTimeParts(bm()).map(n=>fm(n,i)):null}const ul=[0,31,59,90,120,151,181,212,243,273,304,334],dl=[0,31,60,91,121,152,182,213,244,274,305,335];function bt(i,t){return new Mt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${i}, which is invalid`)}function fl(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 gl(i,t,e){return e+(pi(i)?dl:ul)[t-1]}function ml(i,t){const e=pi(i)?dl:ul,s=e.findIndex(o=>o<t),n=t-e[s];return{month:s+1,day:n}}function on(i){const{year:t,month:e,day:s}=i,n=gl(t,e,s),o=fl(t,e,s);let r=Math.floor((n-o+10)/7),a;return r<1?(a=t-1,r=ls(a)):r>ls(t)?(a=t+1,r=1):a=t,{weekYear:a,weekNumber:r,weekday:o,...ys(i)}}function dr(i){const{weekYear:t,weekNumber:e,weekday:s}=i,n=fl(t,1,4),o=ei(t);let r=e*7+s-n-3,a;r<1?(a=t-1,r+=ei(a)):r>o?(a=t+1,r-=ei(t)):a=t;const{month:l,day:c}=ml(a,r);return{year:a,month:l,day:c,...ys(i)}}function Ls(i){const{year:t,month:e,day:s}=i,n=gl(t,e,s);return{year:t,ordinal:n,...ys(i)}}function fr(i){const{year:t,ordinal:e}=i,{month:s,day:n}=ml(t,e);return{year:t,month:s,day:n,...ys(i)}}function _m(i){const t=ps(i.weekYear),e=zt(i.weekNumber,1,ls(i.weekYear)),s=zt(i.weekday,1,7);return t?e?s?!1:bt("weekday",i.weekday):bt("week",i.week):bt("weekYear",i.weekYear)}function wm(i){const t=ps(i.year),e=zt(i.ordinal,1,ei(i.year));return t?e?!1:bt("ordinal",i.ordinal):bt("year",i.year)}function pl(i){const t=ps(i.year),e=zt(i.month,1,12),s=zt(i.day,1,as(i.year,i.month));return t?e?s?!1:bt("day",i.day):bt("month",i.month):bt("year",i.year)}function bl(i){const{hour:t,minute:e,second:s,millisecond:n}=i,o=zt(t,0,23)||t===24&&e===0&&s===0&&n===0,r=zt(e,0,59),a=zt(s,0,59),l=zt(n,0,999);return o?r?a?l?!1:bt("millisecond",n):bt("second",s):bt("minute",e):bt("hour",t)}const Fs="Invalid DateTime",gr=864e13;function Ni(i){return new Mt("unsupported zone",`the zone "${i.name}" is not supported`)}function Rs(i){return i.weekData===null&&(i.weekData=on(i.c)),i.weekData}function We(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 yl(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 o=e.offset(s);return n===o?[s,n]:[i-Math.min(n,o)*60*1e3,Math.max(n,o)]}function mr(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 Gi(i,t,e){return yl(kn(i),t,e)}function pr(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,o={...i.c,year:s,month:n,day:Math.min(i.c.day,as(s,n))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},r=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=kn(o);let[l,c]=yl(a,e,i.zone);return r!==0&&(l+=r,c=i.zone.offset(l)),{ts:l,o:c}}function Be(i,t,e,s,n,o){const{setZone:r,zone:a}=e;if(i&&Object.keys(i).length!==0||t){const l=t||a,c=O.fromObject(i,{...e,zone:l,specificOffset:o});return r?c:c.setZone(a)}else return O.invalid(new Mt("unparsable",`the input "${n}" can't be parsed as ${s}`))}function zi(i,t,e=!0){return i.isValid?nt.create(B.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(i,t):null}function Ns(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 br(i,t,e,s,n,o){let r=K(i.c.hour);return t?(r+=":",r+=K(i.c.minute),(i.c.second!==0||!e)&&(r+=":")):r+=K(i.c.minute),(i.c.second!==0||!e)&&(r+=K(i.c.second),(i.c.millisecond!==0||!s)&&(r+=".",r+=K(i.c.millisecond,3))),n&&(i.isOffsetFixed&&i.offset===0&&!o?r+="Z":i.o<0?(r+="-",r+=K(Math.trunc(-i.o/60)),r+=":",r+=K(Math.trunc(-i.o%60))):(r+="+",r+=K(Math.trunc(i.o/60)),r+=":",r+=K(Math.trunc(i.o%60)))),o&&(r+="["+i.zone.ianaName+"]"),r}const xl={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},vm={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Sm={ordinal:1,hour:0,minute:0,second:0,millisecond:0},_l=["year","month","day","hour","minute","second","millisecond"],Mm=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],km=["year","ordinal","hour","minute","second","millisecond"];function yr(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 va(i);return t}function xr(i,t){const e=$t(t.zone,J.defaultZone),s=B.fromObject(t),n=J.now();let o,r;if(I(i.year))o=n;else{for(const c of _l)I(i[c])&&(i[c]=xl[c]);const a=pl(i)||bl(i);if(a)return O.invalid(a);const l=e.offset(n);[o,r]=Gi(i,l,e)}return new O({ts:o,zone:e,loc:s,o:r})}function _r(i,t,e){const s=I(e.round)?!0:e.round,n=(r,a)=>(r=Mn(r,s||e.calendary?0:2,!0),t.loc.clone(e).relFormatter(e).format(r,a)),o=r=>e.calendary?t.hasSame(i,r)?0:t.startOf(r).diff(i.startOf(r),r).get(r):t.diff(i,r).get(r);if(e.unit)return n(o(e.unit),e.unit);for(const r of e.units){const a=o(r);if(Math.abs(a)>=1)return n(a,r)}return n(i>t?-0:0,e.units[e.units.length-1])}function wr(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 Mt("invalid input"):null)||(e.isValid?null:Ni(e));this.ts=I(t.ts)?J.now():t.ts;let n=null,o=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,o]=[t.old.c,t.old.o];else{const a=e.offset(this.ts);n=mr(this.ts,a),s=Number.isNaN(n.year)?new Mt("invalid input"):null,n=s?null:n,o=s?null:a}this._zone=e,this.loc=t.loc||B.create(),this.invalid=s,this.weekData=null,this.c=n,this.o=o,this.isLuxonDateTime=!0}static now(){return new O({})}static local(){const[t,e]=wr(arguments),[s,n,o,r,a,l,c]=e;return xr({year:s,month:n,day:o,hour:r,minute:a,second:l,millisecond:c},t)}static utc(){const[t,e]=wr(arguments),[s,n,o,r,a,l,c]=e;return t.zone=at.utcInstance,xr({year:s,month:n,day:o,hour:r,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,e={}){const s=Gf(t)?t.valueOf():NaN;if(Number.isNaN(s))return O.invalid("invalid input");const n=$t(e.zone,J.defaultZone);return n.isValid?new O({ts:s,zone:n,loc:B.fromObject(e)}):O.invalid(Ni(n))}static fromMillis(t,e={}){if(he(t))return t<-gr||t>gr?O.invalid("Timestamp out of range"):new O({ts:t,zone:$t(e.zone,J.defaultZone),loc:B.fromObject(e)});throw new pt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(he(t))return new O({ts:t*1e3,zone:$t(e.zone,J.defaultZone),loc:B.fromObject(e)});throw new pt("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const s=$t(e.zone,J.defaultZone);if(!s.isValid)return O.invalid(Ni(s));const n=J.now(),o=I(e.specificOffset)?s.offset(n):e.specificOffset,r=cs(t,yr),a=!I(r.ordinal),l=!I(r.year),c=!I(r.month)||!I(r.day),h=l||c,u=r.weekYear||r.weekNumber,d=B.fromObject(e);if((h||a)&&u)throw new qe("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new qe("Can't mix ordinal dates with month/day");const f=u||r.weekday&&!h;let g,m,p=mr(n,o);f?(g=Mm,m=vm,p=on(p)):a?(g=km,m=Sm,p=Ls(p)):(g=_l,m=xl);let b=!1;for(const S of g){const D=r[S];I(D)?b?r[S]=m[S]:r[S]=p[S]:b=!0}const y=f?_m(r):a?wm(r):pl(r),_=y||bl(r);if(_)return O.invalid(_);const w=f?dr(r):a?fr(r):r,[x,M]=Gi(w,o,s),v=new O({ts:x,zone:s,o:M,loc:d});return r.weekday&&h&&t.weekday!==v.weekday?O.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${v.toISO()}`):v}static fromISO(t,e={}){const[s,n]=Vg(t);return Be(s,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[s,n]=Wg(t);return Be(s,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[s,n]=Bg(t);return Be(s,n,e,"HTTP",e)}static fromFormat(t,e,s={}){if(I(t)||I(e))throw new pt("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:o=null}=s,r=B.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),[a,l,c,h]=xm(r,t,e);return h?O.invalid(h):Be(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]=qg(t);return Be(s,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new pt("need to specify a reason the DateTime is invalid");const s=t instanceof Mt?t:new Mt(t,e);if(J.throwOnInvalid)throw new Of(s);return new O({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const s=hl(t,B.fromObject(e));return s?s.map(n=>n?n.val:null).join(""):null}static expandFormat(t,e={}){return ll(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?Rs(this).weekYear:NaN}get weekNumber(){return this.isValid?Rs(this).weekNumber:NaN}get weekday(){return this.isValid?Rs(this).weekday:NaN}get ordinal(){return this.isValid?Ls(this.c).ordinal:NaN}get monthShort(){return this.isValid?Fi.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Fi.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Fi.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Fi.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 pi(this.year)}get daysInMonth(){return as(this.year,this.month)}get daysInYear(){return this.isValid?ei(this.year):NaN}get weeksInWeekYear(){return this.isValid?ls(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(at.instance(t),e)}toLocal(){return this.setZone(J.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:s=!1}={}){if(t=$t(t,J.defaultZone),t.equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||s){const o=t.offset(this.ts),r=this.toObject();[n]=Gi(r,o,t)}return We(this,{ts:n,zone:t})}else return O.invalid(Ni(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:s}={}){const n=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:s});return We(this,{loc:n})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=cs(t,yr),s=!I(e.weekYear)||!I(e.weekNumber)||!I(e.weekday),n=!I(e.ordinal),o=!I(e.year),r=!I(e.month)||!I(e.day),a=o||r,l=e.weekYear||e.weekNumber;if((a||n)&&l)throw new qe("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(r&&n)throw new qe("Can't mix ordinal dates with month/day");let c;s?c=dr({...on(this.c),...e}):I(e.ordinal)?(c={...this.toObject(),...e},I(e.day)&&(c.day=Math.min(as(c.year,c.month),c.day))):c=fr({...Ls(this.c),...e});const[h,u]=Gi(c,this.o,this.zone);return We(this,{ts:h,o:u})}plus(t){if(!this.isValid)return this;const e=L.fromDurationLike(t);return We(this,pr(this,e))}minus(t){if(!this.isValid)return this;const e=L.fromDurationLike(t).negate();return We(this,pr(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):Fs}toLocaleString(t=rs,e={}){return this.isValid?nt.create(this.loc.clone(e),t).formatDateTime(this):Fs}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:o=!1}={}){if(!this.isValid)return null;const r=t==="extended";let a=Ns(this,r);return a+="T",a+=br(this,r,e,s,n,o),a}toISODate({format:t="extended"}={}){return this.isValid?Ns(this,t==="extended"):null}toISOWeekDate(){return zi(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:s=!0,includePrefix:n=!1,extendedZone:o=!1,format:r="extended"}={}){return this.isValid?(n?"T":"")+br(this,r==="extended",e,t,s,o):null}toRFC2822(){return zi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return zi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ns(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")),zi(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Fs}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},o=Jf(e).map(L.normalizeUnit),r=t.valueOf()>this.valueOf(),a=r?this:t,l=r?t:this,c=nm(a,l,o,n);return r?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"],o=t.unit;return Array.isArray(t.unit)&&(n=t.unit,o=void 0),_r(e,this.plus(s),{...t,numeric:"always",units:n,unit:o})}toRelativeCalendar(t={}){return this.isValid?_r(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 pt("min requires all arguments be DateTimes");return or(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(O.isDateTime))throw new pt("max requires all arguments be DateTimes");return or(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,s={}){const{locale:n=null,numberingSystem:o=null}=s,r=B.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0});return cl(r,t,e)}static fromStringExplain(t,e,s={}){return O.fromFormatExplain(t,e,s)}static get DATE_SHORT(){return rs}static get DATE_MED(){return Sa}static get DATE_MED_WITH_WEEKDAY(){return Ef}static get DATE_FULL(){return Ma}static get DATE_HUGE(){return ka}static get TIME_SIMPLE(){return Ta}static get TIME_WITH_SECONDS(){return Oa}static get TIME_WITH_SHORT_OFFSET(){return Da}static get TIME_WITH_LONG_OFFSET(){return Ca}static get TIME_24_SIMPLE(){return Ea}static get TIME_24_WITH_SECONDS(){return Pa}static get TIME_24_WITH_SHORT_OFFSET(){return Aa}static get TIME_24_WITH_LONG_OFFSET(){return Ia}static get DATETIME_SHORT(){return La}static get DATETIME_SHORT_WITH_SECONDS(){return Fa}static get DATETIME_MED(){return Ra}static get DATETIME_MED_WITH_SECONDS(){return Na}static get DATETIME_MED_WITH_WEEKDAY(){return Pf}static get DATETIME_FULL(){return za}static get DATETIME_FULL_WITH_SECONDS(){return Va}static get DATETIME_HUGE(){return Wa}static get DATETIME_HUGE_WITH_SECONDS(){return Ba}}function He(i){if(O.isDateTime(i))return i;if(i&&i.valueOf&&he(i.valueOf()))return O.fromJSDate(i);if(i&&typeof i=="object")return O.fromObject(i);throw new pt(`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 Tm={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"}};ea._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 Tm},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 Om(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var rn={},Dm={get exports(){return rn},set exports(i){rn=i}},wl={};function xt(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 Cm=xt;xt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};xt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};xt.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};xt.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)};xt.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};xt.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};xt.prototype.start=xt.prototype.try;xt.prototype.errors=function(){return this._errors};xt.prototype.attempts=function(){return this._attempts};xt.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],o=n.message,r=(i[o]||0)+1;i[o]=r,r>=e&&(t=n,e=r)}return t};(function(i){var t=Cm;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 o=[],r=0;r<s.retries;r++)o.push(this.createTimeout(r,s));return e&&e.forever&&!o.length&&o.push(this.createTimeout(r,s)),o.sort(function(a,l){return a-l}),o},i.createTimeout=function(e,s){var n=s.randomize?Math.random()+1:1,o=Math.round(n*Math.max(s.minTimeout,1)*Math.pow(s.factor,e));return o=Math.min(o,s.maxTimeout),o},i.wrap=function(e,s,n){if(s instanceof Array&&(n=s,s=null),!n){n=[];for(var o in e)typeof e[o]=="function"&&n.push(o)}for(var r=0;r<n.length;r++){var a=n[r],l=e[a];e[a]=function(h){var u=i.operation(s),d=Array.prototype.slice.call(arguments,1),f=d.pop();d.push(function(g){u.retry(g)||(g&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){h.apply(e,d)})}.bind(e,l),e[a].options=s}}})(wl);(function(i){i.exports=wl})(Dm);const Em=Om(rn),Pm=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed"]);class vl 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 Am=(i,t,e)=>{const s=e.retries-(t-1);return i.attemptNumber=t,i.retriesLeft=s,i},Im=i=>Pm.has(i),vr=i=>globalThis.DOMException===void 0?new Error(i):new DOMException(i);async function Lm(i,t){return new Promise((e,s)=>{t={onFailedAttempt(){},retries:10,...t};const n=Em.operation(t);n.attempt(async o=>{try{e(await i(o))}catch(r){if(!(r instanceof Error)){s(new TypeError(`Non-error was thrown: "${r}". You should only throw errors.`));return}if(r instanceof vl)n.stop(),s(r.originalError);else if(r instanceof TypeError&&!Im(r.message))n.stop(),s(r);else{Am(r,o,t);try{await t.onFailedAttempt(r)}catch(a){s(a);return}n.retry(r)||s(n.mainError())}}}),t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",()=>{n.stop();const o=t.signal.reason===void 0?vr("The operation was aborted."):t.signal.reason;s(o instanceof Error?o:vr(o))},{once:!0})})}class Fm{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");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.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}}},plugins:{legend:{labels:{sort:(s,n)=>s.text.localeCompare(n.text)},position:"right",onClick:(s,n)=>{if(n.hidden)this.setActiveFields([...this.activeFields,n.text]);else{const o=this.activeFields.indexOf(n.text),r=this.activeFields;r.splice(o,1),this.setActiveFields(r)}}}}}}checkLoadingStatus(){const t=document.getElementById("loadingIndicator");let e=!1;Object.keys(this.dataStorage).forEach((s,n)=>{Object.keys(this.dataStorage[n]).forEach(o=>{this.dataStorage[n][o].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("&"),o=`${e?"&start_date="+e.toISODate():""}${s?"&end_date="+s.toISODate():""}`,r=`${this.options.endpoint}?source=${this.options.source}&${n}${o}`,a=this.options.geometry;async function l(){const c=await fetch(r,{headers:{"Content-Type":"application/json; charset=utf-8"},method:"POST",mode:"cors",body:JSON.stringify({geometry:a})});if(c.status===404)throw new vl(c.statusText);if(c.status!==200)throw Error(c.statusText);return c}return Lm(l,{onFailedAttempt:c=>{console.log(`Attempt ${c.attemptNumber} failed. There are ${c.retriesLeft} retries left.`)},retries:1}).then(function(c){return c.json()})}updateChart(){this.checkLoadingStatus(),this.chart.options=this.chartOptions;const t=[];this.options.features.flat().forEach(e=>{let s=-1;if(this.options.features.forEach((n,o)=>{n.includes(e)&&(s=o)}),s!==-1){let n=[];Object.keys(this.dataStorage[s]).forEach(a=>{const l=this.dataStorage[s][a];l.status==="finished"?Object.keys(l.data).length!==0&&Object.keys(l.data).includes(e)&&n.push(...l.data[e]):n.push({date:"missing"})});let o=!1,r=n.map(a=>{let l={};return a&&a.date!=="missing"&&(l={x:O.fromISO(a.date).setZone("UTC"),y:a.basicStats.mean,yMin:[a.basicStats.min],yMax:[a.basicStats.max]},o=!0),l});if(o&&this.timeAggregation){console.log("applying aggregation"),console.log(r);const a=[];let l=0,c=O.fromObject({year:this.startTime.year,month:this.startTime.month,day:this.startTime.day});for(;c<this.endTime;){let h=0;for(;l<r.length&&r[l].x<c;)l++;const u=l;for(;l<r.length&&r[l].x<c.plus(this.timeAggregation);)h+=r[l].y,l++;const f=l-u;f>0&&a.push({x:c,y:h/f}),c=c.plus(this.timeAggregation)}r=a}t.push({type:"line",label:e,data:r,hidden:!this.activeFields.includes(e)})}}),this.chart.data={datasets:t},this.chart.update("none")}retrieveMissingData(){const t=[];this.activeFields.forEach(n=>{this.options.features.forEach((o,r)=>{o.includes(n)&&!t.includes(r)&&t.push(r)})});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(o=>{if(!(n in this.dataStorage[o])){const r=this.fetchSignals(o,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[o][n].data=a,this.dataStorage[o][n].status="finished",this.updateChart()}).catch(()=>{this.dataStorage[o][n].status="failed",this.updateChart()});this.dataStorage[o][n]={request:r,status:"fetching"}}}),e=e.minus({months:1})}}setGeometry(t){this.dataStorage={},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()}setTimeAggregation(t){this.timeAggregation=t,this.updateChart()}}class Rm{constructor(t,e,s){k(this,"element");k(this,"sdm");k(this,"options");this.element=t,this.sdm=e,this.options=s,this.generateTimeSelectionOptions(),this.generateTimeAggregationOptions();const n=document.createElement("span");n.id="loadingIndicator",n.className="loader hidden",this.element.appendChild(n)}generateTimeSelectionOptions(){const t=[{text:"3 months back",value:"months3"},{text:"6 months back",value:"months6"},{text:"1 year back",value:"year1"},{text:"2 years back",value:"year2"},{text:"3 years back",value:"year3"}],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();switch(s.target.value){case"months3":this.sdm.setTimeInterval(n.minus({months:3}),n);break;case"months6":this.sdm.setTimeInterval(n.minus({months:6}),n);break;case"year1":this.sdm.setTimeInterval(n.minus({years:1}),n);break;case"year2":this.sdm.setTimeInterval(n.minus({years:2}),n);break;case"year3":this.sdm.setTimeInterval(n.minus({years:3}),n);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 o=document.createElement("option");o.text=n.text,o.value=n.value,e.appendChild(o)}),this.element.appendChild(e),e.addEventListener("change",n=>{const[o,r]=n.target.value.split("-");switch(o){case"none":this.sdm.setTimeAggregation(null);break;case"week":this.sdm.setTimeAggregation({week:Number(r)});break;case"month":this.sdm.setTimeAggregation({month:Number(r)});break;case"year":this.sdm.setTimeAggregation({year:Number(r)});break}});const s=document.createElement("span");s.id="loadingIndicator",s.className="loader hidden",this.element.appendChild(s)}}const re=new Ft(document.getElementById("chart"),{data:{labels:[],datasets:[]}});let si=null,an;window.addEventListener("message",i=>{i.data==="init"&&(an=i.ports[0],an.onmessage=Nm)});const Nm=i=>{if(i.data.ts)switch(i.data.type){case"getFoo":console.log(i.data.body),an.postMessage({ts:i.data.ts,body:"foo bar"});break}else switch(i.data.type){case"setData":re.data=i.data.body.data,re.update("none");break;case"setSignalsEndpoint":zm(i.data.body.options);break;case"setSignalsGeometry":Vm(i.data.body.options);break;case"setSignalsData":re.data={datasets:Object.entries(i.data.body.data).map(([t,e])=>({type:"line",label:t,data:e}))},re.update("none");break;case"setOptions":re.options=i.data.body.options,re.update("none");break}},zm=i=>{si=new Fm(re,i),new Rm(document.getElementById("controls"),si),si.setActiveFields(i.active)},Vm=i=>{si&&si.setGeometry(i)};
|