genus-ui 2.51.52 → 2.52.52
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/dist/index.es.js +64 -19
- package/dist/index.umd.js +65 -17
- package/package.json +2 -2
- package/types/genus-accordion/index.d.ts +1 -1
- package/types/genus-chart/index.d.ts +1 -1
- package/types/genus-checkbox/index.d.ts +1 -1
- package/types/genus-checkbox-group/genus-checkbox-group.d.ts +1 -1
- package/types/genus-checkbox-group/genus-checkbox-option.d.ts +1 -1
- package/types/genus-data-card/index.d.ts +1 -1
- package/types/genus-date-picker/index.d.ts +1 -1
- package/types/genus-dropdown-select/genus-dropdown-option.d.ts +1 -1
- package/types/genus-numeric-slider/index.d.ts +1 -1
- package/types/genus-radiobtn-group/index.d.ts +1 -1
- package/types/genus-range-slider/index.d.ts +1 -1
- package/types/genus-slider/index.d.ts +1 -1
- package/types/genus-step-wizard/genus-step-content.d.ts +1 -1
- package/types/genus-step-wizard/genus-step-wizard.d.ts +1 -1
- package/types/genus-tabs/genus-tab-container.d.ts +1 -1
- package/types/genus-tabs/genus-tab-content.d.ts +1 -1
- package/types/genus-textarea/index.d.ts +1 -1
- package/types/genus-textbox/index.d.ts +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1972,22 +1972,7 @@
|
|
|
1972
1972
|
justify-content: space-between;
|
|
1973
1973
|
align-items: center;
|
|
1974
1974
|
}
|
|
1975
|
-
`;/*!
|
|
1976
|
-
* @kurkle/color v0.3.4
|
|
1977
|
-
* https://github.com/kurkle/color#readme
|
|
1978
|
-
* (c) 2024 Jukka Kurkela
|
|
1979
|
-
* Released under the MIT License
|
|
1980
|
-
*/function Ge(i){return i+.5|0}const zt=(i,t,e)=>Math.max(Math.min(i,e),t);function Be(i){return zt(Ge(i*2.55),0,255)}function Ot(i){return zt(Ge(i*255),0,255)}function xt(i){return zt(Ge(i/2.55)/100,0,1)}function Rn(i){return zt(Ge(i*100),0,100)}const ht={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},Ei=[..."0123456789ABCDEF"],sl=i=>Ei[i&15],ol=i=>Ei[(i&240)>>4]+Ei[i&15],Xe=i=>(i&240)>>4===(i&15),al=i=>Xe(i.r)&&Xe(i.g)&&Xe(i.b)&&Xe(i.a);function rl(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&ht[i[1]]*17,g:255&ht[i[2]]*17,b:255&ht[i[3]]*17,a:t===5?ht[i[4]]*17:255}:(t===7||t===9)&&(e={r:ht[i[1]]<<4|ht[i[2]],g:ht[i[3]]<<4|ht[i[4]],b:ht[i[5]]<<4|ht[i[6]],a:t===9?ht[i[7]]<<4|ht[i[8]]:255})),e}const ll=(i,t)=>i<255?t(i):"";function cl(i){var t=al(i)?sl:ol;return i?"#"+t(i.r)+t(i.g)+t(i.b)+ll(i.a,t):void 0}const hl=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Nn(i,t,e){const n=t*Math.min(e,1-e),s=(o,a=(o+i/30)%12)=>e-n*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function Al(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function dl(i,t,e){const n=Nn(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function ul(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function ki(i){const e=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(e,n,s),a=Math.min(e,n,s),r=(o+a)/2;let l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=ul(e,n,s,h,o),l=l*60+.5),[l|0,c||0,r]}function Qi(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(Ot)}function Pi(i,t,e){return Qi(Nn,i,t,e)}function gl(i,t,e){return Qi(dl,i,t,e)}function fl(i,t,e){return Qi(Al,i,t,e)}function Vn(i){return(i%360+360)%360}function pl(i){const t=hl.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?Be(+t[5]):Ot(+t[5]));const s=Vn(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=gl(s,o,a):t[1]==="hsv"?n=fl(s,o,a):n=Pi(s,o,a),{r:n[0],g:n[1],b:n[2],a:e}}function wl(i,t){var e=ki(i);e[0]=Vn(e[0]+t),e=Pi(e),i.r=e[0],i.g=e[1],i.b=e[2]}function ml(i){if(!i)return;const t=ki(i),e=t[0],n=Rn(t[1]),s=Rn(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${xt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const Hn={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"},Fn={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 bl(){const i={},t=Object.keys(Fn),e=Object.keys(Hn);let n,s,o,a,r;for(n=0;n<t.length;n++){for(a=r=t[n],s=0;s<e.length;s++)o=e[s],r=r.replace(o,Hn[o]);o=parseInt(Fn[a],16),i[r]=[o>>16&255,o>>8&255,o&255]}return i}let Je;function Ml(i){Je||(Je=bl(),Je.transparent=[0,0,0,0]);const t=Je[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Dl=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Gl(i){const t=Dl.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const a=+t[7];e=t[8]?Be(a):zt(a*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?Be(n):zt(n,0,255)),s=255&(t[4]?Be(s):zt(s,0,255)),o=255&(t[6]?Be(o):zt(o,0,255)),{r:n,g:s,b:o,a:e}}}function Bl(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${xt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ti=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,he=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function xl(i,t,e){const n=he(xt(i.r)),s=he(xt(i.g)),o=he(xt(i.b));return{r:Ot(Ti(n+e*(he(xt(t.r))-n))),g:Ot(Ti(s+e*(he(xt(t.g))-s))),b:Ot(Ti(o+e*(he(xt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function qe(i,t,e){if(i){let n=ki(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Pi(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function jn(i,t){return i&&Object.assign(t||{},i)}function Wn(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=Ot(i[3]))):(t=jn(i,{r:0,g:0,b:0,a:1}),t.a=Ot(t.a)),t}function vl(i){return i.charAt(0)==="r"?Gl(i):pl(i)}class xe{constructor(t){if(t instanceof xe)return t;const e=typeof t;let n;e==="object"?n=Wn(t):e==="string"&&(n=rl(t)||Ml(t)||vl(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=jn(this._rgb);return t&&(t.a=xt(t.a)),t}set rgb(t){this._rgb=Wn(t)}rgbString(){return this._valid?Bl(this._rgb):void 0}hexString(){return this._valid?cl(this._rgb):void 0}hslString(){return this._valid?ml(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=n.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=a*n.a+(1-a)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=xl(this._rgb,t._rgb,e)),this}clone(){return new xe(this.rgb)}alpha(t){return this._rgb.a=Ot(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ge(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 qe(this._rgb,2,t),this}darken(t){return qe(this._rgb,2,-t),this}saturate(t){return qe(this._rgb,1,t),this}desaturate(t){return qe(this._rgb,1,-t),this}rotate(t){return wl(this._rgb,t),this}}/*!
|
|
1981
|
-
* Chart.js v4.5.1
|
|
1982
|
-
* https://www.chartjs.org
|
|
1983
|
-
* (c) 2025 Chart.js Contributors
|
|
1984
|
-
* Released under the MIT License
|
|
1985
|
-
*/function vt(){}const yl=(()=>{let i=0;return()=>i++})();function Q(i){return i==null}function V(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function P(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function j(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function lt(i,t){return j(i)?i:t}function I(i,t){return typeof i>"u"?t:i}const Yl=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Zn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function R(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function z(i,t,e,n){let s,o,a;if(V(i))for(o=i.length,s=0;s<o;s++)t.call(e,i[s],s);else if(P(i))for(a=Object.keys(i),o=a.length,s=0;s<o;s++)t.call(e,i[a[s]],a[s])}function _e(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function $e(i){if(V(i))return i.map($e);if(P(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=$e(i[e[s]]);return t}return i}function Un(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Cl(i,t,e,n){if(!Un(i))return;const s=t[i],o=e[i];P(s)&&P(o)?ve(s,o,n):t[i]=$e(o)}function ve(i,t,e){const n=V(t)?t:[t],s=n.length;if(!P(i))return i;e=e||{};const o=e.merger||Cl;let a;for(let r=0;r<s;++r){if(a=n[r],!P(a))continue;const l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],i,a,e)}return i}function ye(i,t){return ve(i,t,{merger:Il})}function Il(i,t,e){if(!Un(i))return;const n=t[i],s=e[i];P(n)&&P(s)?ye(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=$e(s))}const Kn={"":i=>i,x:i=>i.x,y:i=>i.y};function El(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function kl(i){const t=El(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Rt(i,t){return(Kn[t]||(Kn[t]=kl(t)))(i)}function Si(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Ye=i=>typeof i<"u",Nt=i=>typeof i=="function",Xn=(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 S=Math.PI,N=2*S,Pl=N+S,ti=Number.POSITIVE_INFINITY,Tl=S/180,W=S/2,Jt=S/4,Jn=S*2/3,Vt=Math.log10,bt=Math.sign;function Ce(i,t,e){return Math.abs(i-t)<e}function qn(i){const t=Math.round(i);i=Ce(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Vt(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Sl(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function Ll(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Ae(i){return!Ll(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function zl(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function _n(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ft(i){return i*(S/180)}function Li(i){return i*(180/S)}function $n(i){if(!j(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function ts(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*S&&(o+=N),{angle:o,distance:s}}function zi(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Ol(i,t){return(i-t+Pl)%N-S}function q(i){return(i%N+N)%N}function Ie(i,t,e,n){const s=q(i),o=q(t),a=q(e),r=q(o-s),l=q(a-s),c=q(s-o),h=q(s-a);return s===o||s===a||n&&o===a||r>l&&c<h}function K(i,t,e){return Math.max(t,Math.min(e,i))}function Rl(i){return K(i,-32768,32767)}function yt(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Oi(i,t,e){e=e||(a=>i[a]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Yt=(i,t,e,n)=>Oi(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),Nl=(i,t,e)=>Oi(i,e,n=>i[n][t]>=e);function Vl(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const es=["push","pop","shift","splice","unshift"];function Hl(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),es.forEach(e=>{const n="_onData"+Si(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o)}),a}})})}function is(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(es.forEach(o=>{delete i[o]}),delete i._chartjs)}function ns(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const ss=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function os(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,ss.call(window,()=>{n=!1,i.apply(t,e)}))}}function Fl(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Ri=i=>i==="start"?"left":i==="end"?"right":"center",_=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,jl=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function as(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:a,vScale:r,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=a.axis,{min:A,max:d,minDefined:u,maxDefined:f}=a.getUserBounds();if(u){if(s=Math.min(Yt(l,h,A).lo,e?n:Yt(t,h,a.getPixelForValue(A)).lo),c){const p=l.slice(0,s+1).reverse().findIndex(b=>!Q(b[r.axis]));s-=Math.max(0,p)}s=K(s,0,n-1)}if(f){let p=Math.max(Yt(l,a.axis,d,!0).hi+1,e?0:Yt(t,h,a.getPixelForValue(d),!0).hi+1);if(c){const b=l.slice(p-1).findIndex(M=>!Q(M[r.axis]));p+=Math.max(0,b)}o=K(p,s,n)-s}else o=n-s}return{start:s,count:o}}function rs(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const ei=i=>i===0||i===1,ls=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*N/e)),cs=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*N/e)+1,Ee={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*W)+1,easeOutSine:i=>Math.sin(i*W),easeInOutSine:i=>-.5*(Math.cos(S*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=>ei(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=>ei(i)?i:ls(i,.075,.3),easeOutElastic:i=>ei(i)?i:cs(i,.075,.3),easeInOutElastic(i){return ei(i)?i:i<.5?.5*ls(i*2,.1125,.45):.5+.5*cs(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-Ee.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?Ee.easeInBounce(i*2)*.5:Ee.easeOutBounce(i*2-1)*.5+.5};function Ni(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function hs(i){return Ni(i)?i:new xe(i)}function Vi(i){return Ni(i)?i:new xe(i).saturate(.5).darken(.1).hexString()}const Wl=["x","y","borderWidth","radius","tension"],Zl=["color","borderColor","backgroundColor"];function Ul(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:Zl},numbers:{type:"number",properties:Wl}}),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 Kl(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const As=new Map;function Xl(i,t){t=t||{};const e=i+JSON.stringify(t);let n=As.get(e);return n||(n=new Intl.NumberFormat(i,t),As.set(e,n)),n}function ke(i,t,e){return Xl(t,e).format(i)}const ds={values(i){return V(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,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)&&(s="scientific"),o=Jl(i,e)}const a=Vt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ke(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(Vt(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?ds.numeric.call(this,i,t,e):""}};function Jl(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 ii={formatters:ds};function ql(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ii.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 qt=Object.create(null),Hi=Object.create(null);function Qe(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function Fi(i,t,e){return typeof t=="string"?ve(Qe(i,t),e):ve(Qe(i,""),t)}class _l{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=n=>n.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=(n,s)=>Vi(s.backgroundColor),this.hoverBorderColor=(n,s)=>Vi(s.borderColor),this.hoverColor=(n,s)=>Vi(s.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 Fi(this,t,e)}get(t){return Qe(this,t)}describe(t,e){return Fi(Hi,t,e)}override(t,e){return Fi(qt,t,e)}route(t,e,n,s){const o=Qe(this,t),a=Qe(this,n),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[s];return P(l)?Object.assign({},c,l):I(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var H=new _l({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ul,Kl,ql]);function $l(i){return!i||Q(i.size)||Q(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ni(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function tc(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let a=0;const r=e.length;let l,c,h,A,d;for(l=0;l<r;l++)if(A=e[l],A!=null&&!V(A))a=ni(i,s,o,a,A);else if(V(A))for(c=0,h=A.length;c<h;c++)d=A[c],d!=null&&!V(d)&&(a=ni(i,s,o,a,d));i.restore();const u=o.length/2;if(u>e.length){for(l=0;l<u;l++)delete s[o[l]];o.splice(0,u)}return a}function _t(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function us(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function ji(i,t,e,n){gs(i,t,e,n,null)}function gs(i,t,e,n,s){let o,a,r,l,c,h,A,d;const u=t.pointStyle,f=t.rotation,p=t.radius;let b=(f||0)*Tl;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(b),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),u){default:s?i.ellipse(e,n,s/2,p,0,0,N):i.arc(e,n,p,0,N),i.closePath();break;case"triangle":h=s?s/2:p,i.moveTo(e+Math.sin(b)*h,n-Math.cos(b)*p),b+=Jn,i.lineTo(e+Math.sin(b)*h,n-Math.cos(b)*p),b+=Jn,i.lineTo(e+Math.sin(b)*h,n-Math.cos(b)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(b+Jt)*l,A=Math.cos(b+Jt)*(s?s/2-c:l),r=Math.sin(b+Jt)*l,d=Math.sin(b+Jt)*(s?s/2-c:l),i.arc(e-A,n-r,c,b-S,b-W),i.arc(e+d,n-a,c,b-W,b),i.arc(e+A,n+r,c,b,b+W),i.arc(e-d,n+a,c,b+W,b+S),i.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*p,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}b+=Jt;case"rectRot":A=Math.cos(b)*(s?s/2:p),a=Math.cos(b)*p,r=Math.sin(b)*p,d=Math.sin(b)*(s?s/2:p),i.moveTo(e-A,n-r),i.lineTo(e+d,n-a),i.lineTo(e+A,n+r),i.lineTo(e-d,n+a),i.closePath();break;case"crossRot":b+=Jt;case"cross":A=Math.cos(b)*(s?s/2:p),a=Math.cos(b)*p,r=Math.sin(b)*p,d=Math.sin(b)*(s?s/2:p),i.moveTo(e-A,n-r),i.lineTo(e+A,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a);break;case"star":A=Math.cos(b)*(s?s/2:p),a=Math.cos(b)*p,r=Math.sin(b)*p,d=Math.sin(b)*(s?s/2:p),i.moveTo(e-A,n-r),i.lineTo(e+A,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a),b+=Jt,A=Math.cos(b)*(s?s/2:p),a=Math.cos(b)*p,r=Math.sin(b)*p,d=Math.sin(b)*(s?s/2:p),i.moveTo(e-A,n-r),i.lineTo(e+A,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a);break;case"line":a=s?s/2:Math.cos(b)*p,r=Math.sin(b)*p,i.moveTo(e-a,n-r),i.lineTo(e+a,n+r);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(b)*(s?s/2:p),n+Math.sin(b)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Ct(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 si(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function oi(i){i.restore()}function ec(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function ic(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function nc(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),Q(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 sc(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(a,h),i.lineTo(r,h),i.stroke()}}function oc(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function $t(i,t,e,n,s,o={}){const a=V(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,nc(i,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&oc(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),Q(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),sc(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function Pe(i,t){const{x:e,y:n,w:s,h:o,radius:a}=t;i.arc(e+a.topLeft,n+a.topLeft,a.topLeft,1.5*S,S,!0),i.lineTo(e,n+o-a.bottomLeft),i.arc(e+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,S,W,!0),i.lineTo(e+s-a.bottomRight,n+o),i.arc(e+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,W,0,!0),i.lineTo(e+s,n+a.topRight),i.arc(e+s-a.topRight,n+a.topRight,a.topRight,0,-W,!0),i.lineTo(e+a.topLeft,n)}const ac=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,rc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function lc(i,t){const e=(""+i).match(ac);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 Wi(i,t){const e={},n=P(t),s=n?Object.keys(t):t,o=P(i)?n?a=>I(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of s)e[a]=cc(o(a));return e}function fs(i){return Wi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function te(i){return Wi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function $(i){const t=fs(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function U(i,t){i=i||{},t=t||H.font;let e=I(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=I(i.style,t.style);n&&!(""+n).match(rc)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:I(i.family,t.family),lineHeight:lc(I(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:I(i.weight,t.weight),string:""};return s.string=$l(s),s}function Te(i,t,e,n){let s,o,a;for(s=0,o=i.length;s<o;++s)if(a=i[s],a!==void 0&&a!==void 0)return a}function hc(i,t,e){const{min:n,max:s}=i,o=Zn(t,(s-n)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function Ht(i,t){return Object.assign(Object.create(i),t)}function Zi(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=Ms("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>Zi([r,...i],t,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return ws(r,l,()=>mc(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Ds(r).includes(l)},ownKeys(r){return Ds(r)},set(r,l,c){const h=r._storage||(r._storage=s());return r[l]=h[l]=c,delete r._keys,!0}})}function de(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:ps(i,n),setContext:o=>de(i,o,e,n),override:o=>de(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return ws(o,a,()=>dc(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function ps(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Nt(e)?e:()=>e,isIndexable:Nt(n)?n:()=>n}}const Ac=(i,t)=>i?i+Si(t):t,Ui=(i,t)=>P(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ws(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function dc(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=i;let r=n[t];return Nt(r)&&a.isScriptable(t)&&(r=uc(t,r,i,e)),V(r)&&r.length&&(r=gc(t,r,i,a.isIndexable)),Ui(t,r)&&(r=de(r,s,o&&o[t],a)),r}function uc(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||n);return r.delete(i),Ui(i,l)&&(l=Ki(s._scopes,s,i,l)),l}function gc(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(P(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const A=Ki(c,s,i,h);t.push(de(A,o,a&&a[i],r))}}return t}function ms(i,t,e){return Nt(i)?i(t,e):i}const fc=(i,t)=>i===!0?t:typeof i=="string"?Rt(t,i):void 0;function pc(i,t,e,n,s){for(const o of t){const a=fc(e,o);if(a){i.add(a);const r=ms(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==n)return r}else if(a===!1&&typeof n<"u"&&e!==n)return null}return!1}function Ki(i,t,e,n){const s=t._rootScopes,o=ms(t._fallback,e,n),a=[...i,...s],r=new Set;r.add(n);let l=bs(r,a,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=bs(r,a,o,l,n),l===null)?!1:Zi(Array.from(r),[""],s,o,()=>wc(t,e,n))}function bs(i,t,e,n,s){for(;e;)e=pc(i,t,e,n,s);return e}function wc(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return V(s)&&P(e)?e:s||{}}function mc(i,t,e,n){let s;for(const o of t)if(s=Ms(Ac(o,i),e),typeof s<"u")return Ui(i,s)?Ki(e,n,i,s):s}function Ms(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Ds(i){let t=i._keys;return t||(t=i._keys=bc(i._scopes)),t}function bc(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function Gs(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,a=new Array(n);let r,l,c,h;for(r=0,l=n;r<l;++r)c=r+e,h=t[c],a[r]={r:s.parse(Rt(h,o),c)};return a}const Mc=Number.EPSILON||1e-14,ue=(i,t)=>t<i.length&&!i[t].skip&&i[t],Bs=i=>i==="x"?"y":"x";function Dc(i,t,e,n){const s=i.skip?t:i,o=t,a=e.skip?t:e,r=zi(o,s),l=zi(a,o);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const A=n*c,d=n*h;return{previous:{x:o.x-A*(a.x-s.x),y:o.y-A*(a.y-s.y)},next:{x:o.x+d*(a.x-s.x),y:o.y+d*(a.y-s.y)}}}function Gc(i,t,e){const n=i.length;let s,o,a,r,l,c=ue(i,0);for(let h=0;h<n-1;++h)if(l=c,c=ue(i,h+1),!(!l||!c)){if(Ce(t[h],0,Mc)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=s*a*t[h],e[h+1]=o*a*t[h])}}function Bc(i,t,e="x"){const n=Bs(e),s=i.length;let o,a,r,l=ue(i,0);for(let c=0;c<s;++c){if(a=r,r=l,l=ue(i,c+1),!r)continue;const h=r[e],A=r[n];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${n}`]=A-o*t[c]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${n}`]=A+o*t[c])}}function xc(i,t="x"){const e=Bs(t),n=i.length,s=Array(n).fill(0),o=Array(n);let a,r,l,c=ue(i,0);for(a=0;a<n;++a)if(r=l,l=c,c=ue(i,a+1),!!l){if(c){const h=c[t]-l[t];s[a]=h!==0?(c[e]-l[e])/h:0}o[a]=r?c?bt(s[a-1])!==bt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Gc(i,s,o),Bc(i,o,t)}function ai(i,t,e){return Math.max(Math.min(i,e),t)}function vc(i,t){let e,n,s,o,a,r=Ct(i[0],t);for(e=0,n=i.length;e<n;++e)a=o,o=r,r=e<n-1&&Ct(i[e+1],t),o&&(s=i[e],a&&(s.cp1x=ai(s.cp1x,t.left,t.right),s.cp1y=ai(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=ai(s.cp2x,t.left,t.right),s.cp2y=ai(s.cp2y,t.top,t.bottom)))}function yc(i,t,e,n,s){let o,a,r,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")xc(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=Dc(c,r,i[Math.min(o+1,a-(n?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&vc(i,e)}function Xi(){return typeof window<"u"&&typeof document<"u"}function Ji(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ri(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const li=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Yc(i,t){return li(i).getPropertyValue(t)}const Cc=["top","right","bottom","left"];function ee(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Cc[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Ic=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Ec(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let a=!1,r,l;if(Ic(s,o,i.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=n.clientX-c.left,l=n.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function ie(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=li(e),o=s.boxSizing==="border-box",a=ee(s,"padding"),r=ee(s,"border","width"),{x:l,y:c,box:h}=Ec(i,e),A=a.left+(h&&r.left),d=a.top+(h&&r.top);let{width:u,height:f}=t;return o&&(u-=a.width+r.width,f-=a.height+r.height),{x:Math.round((l-A)/u*e.width/n),y:Math.round((c-d)/f*e.height/n)}}function kc(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&Ji(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=li(o),l=ee(r,"border","width"),c=ee(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,n=ri(r.maxWidth,o,"clientWidth"),s=ri(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||ti,maxHeight:s||ti}}const Ft=i=>Math.round(i*10)/10;function Qc(i,t,e,n){const s=li(i),o=ee(s,"margin"),a=ri(s.maxWidth,i,"clientWidth")||ti,r=ri(s.maxHeight,i,"clientHeight")||ti,l=kc(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const d=ee(s,"border","width"),u=ee(s,"padding");c-=u.width+d.width,h-=u.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Ft(Math.min(c,a,l.maxWidth)),h=Ft(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Ft(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=Ft(Math.floor(h*n))),{width:c,height:h}}function xs(i,t,e){const n=t||1,s=Ft(i.height*n),o=Ft(i.width*n);i.height=Ft(i.height),i.width=Ft(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(i.currentDevicePixelRatio=n,a.height=s,a.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Pc=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Xi()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function vs(i,t){const e=Yc(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ne(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Tc(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Sc(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=ne(i,s,e),r=ne(s,o,e),l=ne(o,t,e),c=ne(a,r,e),h=ne(r,l,e);return ne(c,h,e)}const Lc=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,n){return e-n},leftForLtr(e,n){return e-n}}},zc=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function ge(i,t,e){return i?Lc(t,e):zc()}function ys(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Ys(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Cs(i){return i==="angle"?{between:Ie,compare:Ol,normalize:q}:{between:yt,compare:(t,e)=>t-e,normalize:t=>t}}function Is({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Oc(i,t,e){const{property:n,start:s,end:o}=e,{between:a,normalize:r}=Cs(n),l=t.length;let{start:c,end:h,loop:A}=i,d,u;if(A){for(c+=l,h+=l,d=0,u=l;d<u&&a(r(t[c%l][n]),s,o);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:A,style:i.style}}function Es(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=Cs(n),{start:h,end:A,loop:d,style:u}=Oc(i,t,e),f=[];let p=!1,b=null,M,D,x;const B=()=>l(s,x,M)&&r(s,x)!==0,G=()=>r(o,M)===0||l(o,x,M),v=()=>p||B(),y=()=>!p||G();for(let Y=h,C=h;Y<=A;++Y)D=t[Y%a],!D.skip&&(M=c(D[n]),M!==x&&(p=l(M,s,o),b===null&&v()&&(b=r(M,s)===0?Y:C),b!==null&&y()&&(f.push(Is({start:b,end:Y,loop:d,count:a,style:u})),b=null),C=Y,x=M));return b!==null&&f.push(Is({start:b,end:A,loop:d,count:a,style:u})),f}function ks(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=Es(n[s],i.points,t);o.length&&e.push(...o)}return e}function Rc(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Nc(i,t,e,n){const s=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?r.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:n}),o}function Vc(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:a,end:r}=Rc(e,s,o,n);if(n===!0)return Qs(i,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,c=!!i._fullLoop&&a===0&&r===s-1;return Qs(i,Nc(e,a,l,c),e,t)}function Qs(i,t,e,n){return!n||!n.setContext||!e?t:Hc(i,t,e,n)}function Hc(i,t,e,n){const s=i._chart.getContext(),o=Ps(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=e.length,c=[];let h=o,A=t[0].start,d=A;function u(f,p,b,M){const D=r?-1:1;if(f!==p){for(f+=l;e[f%l].skip;)f-=D;for(;e[p%l].skip;)p+=D;f%l!==p%l&&(c.push({start:f%l,end:p%l,loop:b,style:M}),h=M,A=p%l)}}for(const f of t){A=r?A:f.start;let p=e[A%l],b;for(d=A+1;d<=f.end;d++){const M=e[d%l];b=Ps(n.setContext(Ht(s,{type:"segment",p0:p,p1:M,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:a}))),Fc(b,h)&&u(A,d-1,f.loop,h),p=M,h=b}A<d-1&&u(A,d-1,f.loop,h)}return c}function Ps(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Fc(i,t){if(!t)return!1;const e=[],n=function(s,o){return Ni(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}function ci(i,t,e){return i.options.clip?i[e]:t[e]}function jc(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:ci(e,t,"left"),right:ci(e,t,"right"),top:ci(n,t,"top"),bottom:ci(n,t,"bottom")}:t}function Ts(i,t){const e=t._clip;if(e.disabled)return!1;const n=jc(t,i.chartArea);return{left:e.left===!1?0:n.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:n.right+(e.right===!0?0:e.right),top:e.top===!1?0:n.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:n.bottom+(e.bottom===!0?0:e.bottom)}}/*!
|
|
1986
|
-
* Chart.js v4.5.1
|
|
1987
|
-
* https://www.chartjs.org
|
|
1988
|
-
* (c) 2025 Chart.js Contributors
|
|
1989
|
-
* Released under the MIT License
|
|
1990
|
-
*/class Wc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=ss.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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((n,s)=>Math.max(n,s._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 n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var It=new Wc;const Ss="transparent",Zc={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=hs(i||Ss),s=n.valid&&hs(t||Ss);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Uc{constructor(t,e,n,s){const o=e[n];s=Te([t.to,s,o,t.from]);const a=Te([t.from,o,s]);this._active=!0,this._fn=t.fn||Zc[t.type||typeof a],this._easing=Ee[t.easing]||Ee.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=n,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Te([t.to,e,s,t.from]),this._from=Te([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<n),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class Ls{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;const e=Object.keys(H.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!P(o))return;const a={};for(const r of e)a[r]=o[r];(V(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a)})})}_animateOptions(t,e){const n=e.options,s=Xc(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&Kc(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let A=o[c];const d=n.get(c);if(A)if(d&&A.active()){A.update(d,h,r);continue}else A.cancel();if(!d||!d.duration){t[c]=h;continue}o[c]=A=new Uc(d,t,c,h),s.push(A)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return It.add(this._chart,n),!0}}function Kc(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Xc(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 zs(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function Jc(i,t,e){if(e===!1)return!1;const n=zs(i,e),s=zs(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function qc(i){let t,e,n,s;return P(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Os(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function Rs(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let a,r,l,c;if(t===null)return;let h=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(h=!0,n.all)continue;break}c=i.values[l],j(c)&&(o||t===0||bt(t)===bt(c))&&(t+=c)}return!h&&!n.all?0:t}function _c(i,t){const{iScale:e,vScale:n}=t,s=e.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",a=Object.keys(i),r=new Array(a.length);let l,c,h;for(l=0,c=a.length;l<c;++l)h=a[l],r[l]={[s]:h,[o]:i[h]};return r}function qi(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function $c(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function th(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function eh(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function Ns(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Vs(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,c=a.axis,h=$c(o,a,n),A=t.length;let d;for(let u=0;u<A;++u){const f=t[u],{[l]:p,[c]:b}=f,M=f._stacks||(f._stacks={});d=M[c]=eh(s,h,p),d[r]=b,d._top=Ns(d,a,!0,n.type),d._bottom=Ns(d,a,!1,n.type);const D=d._visualValues||(d._visualValues={});D[r]=b}}function _i(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function ih(i,t){return Ht(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function nh(i,t,e){return Ht(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Se(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const $i=i=>i==="reset"||i==="none",Hs=(i,t)=>t?i:Object.assign({},i),sh=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Os(e,!0),values:null};class jt{static defaults={};static datasetElementType=null;static dataElementType=null;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=qi(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&&Se(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(A,d,u,f)=>A==="x"?d:A==="r"?f:u,o=e.xAxisID=I(n.xAxisID,_i(t,"x")),a=e.yAxisID=I(n.yAxisID,_i(t,"y")),r=e.rAxisID=I(n.rAxisID,_i(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),h=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),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&&is(this._data,this),t._stacked&&Se(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(P(e)){const s=this._cachedMeta;this._data=_c(e,s)}else if(n!==e){if(n){is(n,this);const s=this._cachedMeta;Se(s),s._parsed=[]}e&&Object.isExtensible(e)&&Hl(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,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=qi(e.vScale,e),e.stack!==n.stack&&(s=!0,Se(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Vs(this,e._parsed),e._stacked=qi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,r=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,A,d;if(this._parsing===!1)n._parsed=s,n._sorted=!0,d=s;else{V(s[t])?d=this.parseArrayData(n,s,t,e):P(s[t])?d=this.parseObjectData(n,s,t,e):d=this.parsePrimitiveData(n,s,t,e);const u=()=>A[r]===null||c&&A[r]<c[r];for(h=0;h<e;++h)n._parsed[h+t]=A=d[h],l&&(u()&&(l=!1),c=A);n._sorted=l}a&&Vs(this,d)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,A=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+n,A[d]={[r]:h||o.parse(c[f],f),[l]:a.parse(e[f],f)};return A}parseArrayData(t,e,n,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,h,A;for(l=0,c=s;l<c;++l)h=l+n,A=e[h],r[l]={x:o.parse(A[0],h),y:a.parse(A[1],h)};return r}parseObjectData(t,e,n,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,A,d,u;for(h=0,A=s;h<A;++h)d=h+n,u=e[d],c[h]={x:o.parse(Rt(u,r),d),y:a.parse(Rt(u,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:Os(s,!0),values:e._stacks[t.axis]._visualValues};return Rs(r,a,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let a=o===null?NaN:o;const r=s&&n._stacks[e.axis];s&&r&&(s.values=r,a=Rs(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,a=s.length,r=this._getOtherScale(t),l=sh(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:A}=th(r);let d,u;function f(){u=s[d];const p=u[r.axis];return!j(u[t.axis])||h>p||A<p}for(d=0;d<a&&!(!f()&&(this.updateRangeFromParsed(c,t,u,l),o));++d);if(o){for(d=a-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],j(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=qc(I(this.options.clip,Jc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const A=s[h];A.hidden||(A.active&&c?a.push(A):A.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=nh(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=ih(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,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",n){const s=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&Ye(n);if(r)return Hs(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),A=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),u=Object.keys(H.elements[t]),f=()=>this.getContext(n,s,e),p=c.resolveNamedOptions(d,u,f,A);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(Hs(p,l))),p}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const h=this.chart.config,A=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),A);l=h.createResolver(d,this.getContext(t,n,e))}const c=new Ls(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||$i(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:a}}updateElement(t,e,n,s){$i(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!$i(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=n.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&Se(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}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 n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function oh(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,o=e.length;s<o;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=ns(n.sort((s,o)=>s-o))}return i._cache.$bar}function ah(i){const t=i.iScale,e=oh(t,i.type);let n=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(Ye(r)&&(n=Math.min(n,Math.abs(a-r)||n)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return n}function rh(i,t,e,n){const s=e.barThickness;let o,a;return Q(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*n,a=1),{chunk:o/n,ratio:a,start:t.pixels[i]-o/2}}function lh(i,t,e,n){const s=t.pixels,o=s[i];let a=i>0?s[i-1]:null,r=i<s.length-1?s[i+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/n,ratio:e.barPercentage,start:c}}function ch(i,t,e,n){const s=e.parse(i[0],n),o=e.parse(i[1],n),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function Fs(i,t,e,n){return V(i)?ch(i,t,e,n):t[e.axis]=e.parse(i,n),t}function js(i,t,e,n){const s=i.iScale,o=i.vScale,a=s.getLabels(),r=s===o,l=[];let c,h,A,d;for(c=e,h=e+n;c<h;++c)d=t[c],A={},A[s.axis]=r||s.parse(a[c],c),l.push(Fs(d,A,o,c));return l}function tn(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function hh(i,t,e){return i!==0?bt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Ah(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:n,reverse:t,top:s,bottom:o}}function dh(i,t,e,n){let s=t.borderSkipped;const o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:h}=Ah(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=h:(o[Ws(h,a,r,l)]=!0,s=c)),o[Ws(s,a,r,l)]=!0,i.borderSkipped=o}function Ws(i,t,e,n){return n?(i=uh(i,t,e),i=Zs(i,e,t)):i=Zs(i,t,e),i}function uh(i,t,e){return i===t?e:i===e?t:i}function Zs(i,t,e){return i==="start"?t:i==="end"?e:i}function gh(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class fh extends jt{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,n,s){return js(t,e,n,s)}parseArrayData(t,e,n,s){return js(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,h=a.axis==="x"?r:l,A=[];let d,u,f,p;for(d=n,u=n+s;d<u;++d)p=e[d],f={},f[o.axis]=o.parse(Rt(p,c),d),A.push(Fs(Rt(p,h),f,a,d));return A}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const o=n._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:n,vScale:s}=e,o=this.getParsed(t),a=o._custom,r=tn(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:r}}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,n,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:A,includeOptions:d}=this._getSharedOptions(e,s);for(let u=e;u<e+n;u++){const f=this.getParsed(u),p=o||Q(f[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(u),b=this._calculateBarIndexPixels(u,h),M=(f._stacks||{})[r.axis],D={horizontal:c,base:p.base,enableBorderRadius:!M||tn(f._custom)||a===M._top||a===M._bottom,x:c?p.head:b.center,y:c?b.center:p.head,height:c?b.size:Math.abs(p.size),width:c?Math.abs(p.size):b.size};d&&(D.options=A||this.resolveDataElementOptions(u,t[u].active?"active":s));const x=D.options||t[u].options;dh(D,x,M,a),gh(D,x,h.ratio),this.updateElement(t[u],u,D,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=n.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[n.axis],c=h=>{const A=h._parsed.find(u=>u[n.axis]===l),d=A&&A[h.vScale.axis];if(Q(d)||isNaN(d))return!0};for(const h of s)if(!(e!==void 0&&c(h))&&((o===!1||a.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const n of this.chart.data.datasets)t[I(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const r=t.barThickness;return{min:r||ah(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=tn(c);let A=l[e.axis],d=0,u=n?this.applyStack(e,l,n):A,f,p;u!==A&&(d=u-A,u=A),h&&(A=c.barStart,u=c.barEnd-c.barStart,A!==0&&bt(A)!==bt(c.barEnd)&&(d=0),d+=A);const b=!Q(o)&&!h?o:d;let M=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?f=e.getPixelForValue(d+u):f=M,p=f-M,Math.abs(p)<a){p=hh(p,e,r)*a,A===r&&(M-=p/2);const D=e.getPixelForDecimal(0),x=e.getPixelForDecimal(1),B=Math.min(D,x),G=Math.max(D,x);M=Math.max(Math.min(M,G),B),f=M+p,n&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(f)-e.getValueForPixel(M))}if(M===e.getPixelForValue(r)){const D=bt(p)*e.getLineWidthForValue(r)/2;M+=D,p-=D}return{size:p,base:M,head:f,center:f+p/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,o=s.skipNull,a=I(s.maxBarThickness,1/0);let r,l;const c=this._getAxisCount();if(e.grouped){const h=o?this._getStackCount(t):e.stackCount,A=s.barThickness==="flex"?lh(t,e,s,h*c):rh(t,e,s,h*c),d=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,u=this._getAxis().indexOf(I(d,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+u;r=A.start+A.chunk*f+A.chunk/2,l=Math.min(a,A.chunk*A.ratio)}else r=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}}class ph extends jt{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const o=super.parsePrimitiveData(t,e,n,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+n).radius;return o}parseArrayData(t,e,n,s){const o=super.parseArrayData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=I(r[2],this.resolveDataElementOptions(a+n).radius)}return o}parseObjectData(t,e,n,s){const o=super.parseObjectData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=I(r&&r.r&&+r.r,this.resolveDataElementOptions(a+n).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:n[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=a.axis,A=r.axis;for(let d=e;d<e+n;d++){const u=t[d],f=!o&&this.getParsed(d),p={},b=p[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(f[h]),M=p[A]=o?r.getBasePixel():r.getPixelForValue(f[A]);p.skip=isNaN(b)||isNaN(M),c&&(p.options=l||this.resolveDataElementOptions(d,u.active?"active":s),o&&(p.options.radius=0)),this.updateElement(u,d,p,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=I(n&&n._custom,o),s}}function wh(i,t,e){let n=1,s=1,o=0,a=0;if(t<N){const r=i,l=r+t,c=Math.cos(r),h=Math.sin(r),A=Math.cos(l),d=Math.sin(l),u=(x,B,G)=>Ie(x,r,l,!0)?1:Math.max(B,B*e,G,G*e),f=(x,B,G)=>Ie(x,r,l,!0)?-1:Math.min(B,B*e,G,G*e),p=u(0,c,A),b=u(W,h,d),M=f(S,c,A),D=f(S+W,h,d);n=(p-M)/2,s=(b-D)/2,o=-(p+M)/2,a=-(b+D)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:a}}class en extends jt{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const A=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:A.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:A.borderDash,lineDashOffset:A.borderDashOffset,lineJoin:A.borderJoinStyle,lineWidth:A.borderWidth,strokeStyle:A.borderColor,textAlign:s,pointStyle:n,borderRadius:a&&(r||A.borderRadius),index:c}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}};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 n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(P(n[t])){const{key:l="value"}=this._parsing;o=c=>+Rt(n[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return ft(this.options.rotation-90)}_getCircumference(){return ft(this.options.circumference)}_getRotationExtents(){let t=N,e=-N;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(Yl(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:A}=this._getRotationExtents(),{ratioX:d,ratioY:u,offsetX:f,offsetY:p}=wh(A,h,l),b=(n.width-a)/d,M=(n.height-a)/u,D=Math.max(Math.min(b,M)/2,0),x=Zn(this.options.radius,D),B=Math.max(x*l,0),G=(x-B)/this._getVisibleDatasetWeightTotal();this.offsetX=f*x,this.offsetY=p*x,s.total=this.calculateTotal(),this.outerRadius=x-G*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-G*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/N)}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,h=(r.left+r.right)/2,A=(r.top+r.bottom)/2,d=o&&c.animateScale,u=d?0:this.innerRadius,f=d?0:this.outerRadius,{sharedOptions:p,includeOptions:b}=this._getSharedOptions(e,s);let M=this._getRotation(),D;for(D=0;D<e;++D)M+=this._circumference(D,o);for(D=e;D<e+n;++D){const x=this._circumference(D,o),B=t[D],G={x:h+this.offsetX,y:A+this.offsetY,startAngle:M,endAngle:M+x,circumference:x,outerRadius:f,innerRadius:u};b&&(G.options=p||this.resolveDataElementOptions(D,B.active?"active":s)),M+=x,this.updateElement(B,D,G,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?N*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ke(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){a=n.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(I(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class mh extends jt{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=as(e,s,a);this._drawStart=r,this._drawCount=l,rs(e)&&(r=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},t),this.updateElements(s,r,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:A}=this._getSharedOptions(e,s),d=a.axis,u=r.axis,{spanGaps:f,segment:p}=this.options,b=Ae(f)?f:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||o||s==="none",D=e+n,x=t.length;let B=e>0&&this.getParsed(e-1);for(let G=0;G<x;++G){const v=t[G],y=M?v:{};if(G<e||G>=D){y.skip=!0;continue}const Y=this.getParsed(G),C=Q(Y[u]),E=y[d]=a.getPixelForValue(Y[d],G),k=y[u]=o||C?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,Y,l):Y[u],G);y.skip=isNaN(E)||isNaN(k)||C,y.stop=G>0&&Math.abs(Y[d]-B[d])>b,p&&(y.parsed=Y,y.raw=c.data[G]),A&&(y.options=h||this.resolveDataElementOptions(G,v.active?"active":s)),M||this.updateElement(v,G,y,s),B=Y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Us extends jt{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ke(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return Gs.bind(this)(t,e,n,s)}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((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),a=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,A=c.yCenter,d=c.getIndexAngle(0)-.5*S;let u=d,f;const p=360/this.countVisibleElements();for(f=0;f<e;++f)u+=this._computeAngle(f,s,p);for(f=e;f<e+n;f++){const b=t[f];let M=u,D=u+this._computeAngle(f,s,p),x=a.getDataVisibility(f)?c.getDistanceFromCenterForValue(this.getParsed(f).r):0;u=D,o&&(l.animateScale&&(x=0),l.animateRotate&&(M=D=d));const B={x:h,y:A,innerRadius:0,outerRadius:x,startAngle:M,endAngle:D,options:this.resolveDataElementOptions(f,b.active?"active":s)};this.updateElement(b,f,B,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?ft(this.resolveDataElementOptions(t,e).angle||n):0}}class bh extends en{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Mh extends jt{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return Gs.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(n,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=e;r<e+n;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),A=a?o.xCenter:h.x,d=a?o.yCenter:h.y,u={x:A,y:d,angle:h.angle,skip:isNaN(A)||isNaN(d),options:c};this.updateElement(l,r,u,s)}}}class Dh extends jt{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:n[t]||"",value:"("+r+", "+l+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=as(e,n,s);if(this._drawStart=o,this._drawCount=a,rs(e)&&(o=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=n;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),A=this.getSharedOptions(h),d=this.includeOptions(s,A),u=a.axis,f=r.axis,{spanGaps:p,segment:b}=this.options,M=Ae(p)?p:Number.POSITIVE_INFINITY,D=this.chart._animationsDisabled||o||s==="none";let x=e>0&&this.getParsed(e-1);for(let B=e;B<e+n;++B){const G=t[B],v=this.getParsed(B),y=D?G:{},Y=Q(v[f]),C=y[u]=a.getPixelForValue(v[u],B),E=y[f]=o||Y?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[f],B);y.skip=isNaN(C)||isNaN(E)||Y,y.stop=B>0&&Math.abs(v[u]-x[u])>M,b&&(y.parsed=v,y.raw=c.data[B]),d&&(y.options=A||this.resolveDataElementOptions(B,G.active?"active":s)),D||this.updateElement(G,B,y,s),x=v}this.updateSharedOptions(A,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,a)/2}}var Gh=Object.freeze({__proto__:null,BarController:fh,BubbleController:ph,DoughnutController:en,LineController:mh,PieController:bh,PolarAreaController:Us,RadarController:Mh,ScatterController:Dh});function se(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class nn{static override(t){Object.assign(nn.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return se()}parse(){return se()}format(){return se()}add(){return se()}diff(){return se()}startOf(){return se()}endOf(){return se()}}var Bh={_date:nn};function xh(i,t,e,n){const{controller:s,data:o,_sorted:a}=i,r=s._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const c=r._reversePixels?Nl:Yt;if(n){if(s._sharedOptions){const h=o[0],A=typeof h.getRange=="function"&&h.getRange(t);if(A){const d=c(o,t,e-A),u=c(o,t,e+A);return{lo:d.lo,hi:u.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:A}=s._cachedMeta,{_parsed:d}=i,u=d.slice(0,h.lo+1).reverse().findIndex(p=>!Q(p[A.axis]));h.lo-=Math.max(0,u);const f=d.slice(h.hi).findIndex(p=>!Q(p[A.axis]));h.hi+=Math.max(0,f)}return h}}return{lo:0,hi:o.length-1}}function hi(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:h}=o[r],{lo:A,hi:d}=xh(o[r],t,a,s);for(let u=A;u<=d;++u){const f=h[u];f.skip||n(f,c,u)}}}function vh(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,a=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function sn(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||hi(i,e,t,function(r,l,c){!s&&!Ct(r,i.chartArea,0)||r.inRange(t.x,t.y,n)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function yh(i,t,e,n){let s=[];function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],n),{angle:A}=ts(a,{x:t.x,y:t.y});Ie(A,c,h)&&s.push({element:a,datasetIndex:r,index:l})}return hi(i,e,t,o),s}function Yh(i,t,e,n,s,o){let a=[];const r=vh(e);let l=Number.POSITIVE_INFINITY;function c(h,A,d){const u=h.inRange(t.x,t.y,s);if(n&&!u)return;const f=h.getCenterPoint(s);if(!(!!o||i.isPointInArea(f))&&!u)return;const b=r(t,f);b<l?(a=[{element:h,datasetIndex:A,index:d}],l=b):b===l&&a.push({element:h,datasetIndex:A,index:d})}return hi(i,e,t,c),a}function on(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?yh(i,t,e,s):Yh(i,t,e,n,s,o)}function Ks(i,t,e,n,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return hi(i,e,t,(l,c,h)=>{l[a]&&l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,s))}),n&&!r?[]:o}var Ch={modes:{index(i,t,e,n){const s=ie(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?sn(i,s,o,n,a):on(i,s,o,!1,n,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,A=c.data[h];A&&!A.skip&&l.push({element:A,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?sn(i,s,o,n,a):on(i,s,o,!1,n,a);if(r.length>0){const l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(i,t,e,n){const s=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return sn(i,s,o,n,a)},nearest(i,t,e,n){const s=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return on(i,s,o,e.intersect,n,a)},x(i,t,e,n){const s=ie(t,i);return Ks(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=ie(t,i);return Ks(i,s,"y",e.intersect,n)}}};const Xs=["left","top","right","bottom"];function Le(i,t){return i.filter(e=>e.pos===t)}function Js(i,t){return i.filter(e=>Xs.indexOf(e.pos)===-1&&e.box.axis===t)}function ze(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Ih(i){const t=[];let e,n,s,o,a,r;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function Eh(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!Xs.includes(s))continue;const a=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function kh(i,t){const e=Eh(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*n:l&&t.availableWidth,r.height=s):(r.width=n,r.height=h?h*s:l&&t.availableHeight)}return e}function Qh(i){const t=Ih(i),e=ze(t.filter(c=>c.box.fullSize),!0),n=ze(Le(t,"left"),!0),s=ze(Le(t,"right")),o=ze(Le(t,"top"),!0),a=ze(Le(t,"bottom")),r=Js(t,"x"),l=Js(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Le(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function qs(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function _s(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 Ph(i,t,e,n){const{pos:s,box:o}=e,a=i.maxPadding;if(!P(s)){e.size&&(i[s]-=e.size);const A=n[e.stack]||{size:0,count:1};A.size=Math.max(A.size,e.horizontal?o.height:o.width),e.size=A.size/A.count,i[s]+=e.size}o.getPadding&&_s(a,o.getPadding());const r=Math.max(0,t.outerWidth-qs(a,i,"left","right")),l=Math.max(0,t.outerHeight-qs(a,i,"top","bottom")),c=r!==i.w,h=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Th(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Sh(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return n(i?["left","right"]:["top","bottom"])}function Oe(i,t,e,n){const s=[];let o,a,r,l,c,h;for(o=0,a=i.length,c=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Sh(r.horizontal,t));const{same:A,other:d}=Ph(t,e,r,n);c|=A&&s.length,h=h||d,l.fullSize||s.push(r)}return c&&Oe(s,t,e,n)||h}function Ai(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function $s(i,t,e,n){const s=e.padding;let{x:o,y:a}=t;for(const r of i){const l=r.box,c=n[r.stack]||{placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const A=t.w*h,d=c.size||l.height;Ye(c.start)&&(a=c.start),l.fullSize?Ai(l,s.left,a,e.outerWidth-s.right-s.left,d):Ai(l,t.left+c.placed,a,A,d),c.start=a,c.placed+=A,a=l.bottom}else{const A=t.h*h,d=c.size||l.width;Ye(c.start)&&(o=c.start),l.fullSize?Ai(l,o,s.top,d,e.outerHeight-s.bottom-s.top):Ai(l,o,t.top+c.placed,d,A),c.start=o,c.placed+=A,o=l.right}}t.x=o,t.y=a}var tt={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,n){if(!i)return;const s=$(i.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=Qh(i.boxes),l=r.vertical,c=r.horizontal;z(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,b)=>b.box.options&&b.box.options.display===!1?p:p+1,0)||1,A=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),d=Object.assign({},s);_s(d,$(n));const u=Object.assign({maxPadding:d,w:o,h:a,x:s.left,y:s.top},s),f=kh(l.concat(c),A);Oe(r.fullSize,u,A,f),Oe(l,u,A,f),Oe(c,u,A,f)&&Oe(l,u,A,f),Th(u),$s(r.leftAndTop,u,A,f),u.x+=u.w,u.y+=u.h,$s(r.rightAndBottom,u,A,f),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},z(r.chartArea,p=>{const b=p.box;Object.assign(b,i.chartArea),b.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class to{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Lh extends to{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const di="$chartjs",zh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},eo=i=>i===null||i==="";function Oh(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[di]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",eo(s)){const o=vs(i,"width");o!==void 0&&(i.width=o)}if(eo(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=vs(i,"height");o!==void 0&&(i.height=o)}return i}const io=Pc?{passive:!0}:!1;function Rh(i,t,e){i&&i.addEventListener(t,e,io)}function Nh(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,io)}function Vh(i,t){const e=zh[i.type]||i.type,{x:n,y:s}=ie(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function ui(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Hh(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ui(r.addedNodes,n),a=a&&!ui(r.removedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Fh(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ui(r.removedNodes,n),a=a&&!ui(r.addedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Re=new Map;let no=0;function so(){const i=window.devicePixelRatio;i!==no&&(no=i,Re.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function jh(i,t){Re.size||window.addEventListener("resize",so),Re.set(i,t)}function Wh(i){Re.delete(i),Re.size||window.removeEventListener("resize",so)}function Zh(i,t,e){const n=i.canvas,s=n&&Ji(n);if(!s)return;const o=os((r,l)=>{const c=s.clientWidth;e(r,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(s),jh(i,o),a}function an(i,t,e){e&&e.disconnect(),t==="resize"&&Wh(i)}function Uh(i,t,e){const n=i.canvas,s=os(o=>{i.ctx!==null&&e(Vh(o,i))},i);return Rh(n,t,s),s}class Kh extends to{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Oh(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[di])return!1;const n=e[di].initial;["height","width"].forEach(o=>{const a=n[o];Q(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[di],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Hh,detach:Fh,resize:Zh}[e]||Uh;s[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:an,detach:an,resize:an}[e]||Nh)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Qc(t,e,n,s)}isAttached(t){const e=t&&Ji(t);return!!(e&&e.isConnected)}}function Xh(i){return!Xi()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Lh:Kh}class Et{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Ae(this.x)&&Ae(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}function Jh(i,t){const e=i.options.ticks,n=qh(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?$h(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return tA(t,c,o,a/s),c;const h=_h(o,t,s);if(a>0){let A,d;const u=a>1?Math.round((l-r)/(a-1)):null;for(gi(t,c,h,Q(u)?0:r-u,r),A=0,d=a-1;A<d;A++)gi(t,c,h,o[A],o[A+1]);return gi(t,c,h,l,Q(u)?t.length:l+u),c}return gi(t,c,h),c}function qh(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function _h(i,t,e){const n=eA(i),s=t.length/e;if(!n)return Math.max(s,1);const o=Sl(n);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function $h(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function tA(i,t,e,n){let s=0,o=e[0],a;for(n=Math.ceil(n),a=0;a<i.length;a++)a===o&&(t.push(i[a]),s++,o=e[s*n])}function gi(i,t,e,n,s){const o=I(n,0),a=Math.min(I(s,i.length),i.length);let r=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(i[c]),r++,h=Math.round(o+r*e))}function eA(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const iA=i=>i==="left"?"right":i==="right"?"left":i,oo=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,ao=(i,t)=>Math.min(t||i,i);function ro(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function nA(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,a=i._endPixel,r=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-o,a-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function sA(i,t){z(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function Ne(i){return i.drawTicks?i.tickLength:0}function lo(i,t){if(!i.display)return 0;const e=U(i.font,t),n=$(i.padding);return(V(i.text)?i.text.length:1)*e.lineHeight+n.height}function oA(i,t){return Ht(i,{scale:t,type:"scale"})}function aA(i,t,e){return Ht(i,{tick:e,index:t,type:"tick"})}function rA(i,t,e){let n=Ri(i);return(e&&t!=="right"||!e&&t==="right")&&(n=iA(n)),n}function lA(i,t,e,n){const{top:s,left:o,bottom:a,right:r,chart:l}=i,{chartArea:c,scales:h}=l;let A=0,d,u,f;const p=a-s,b=r-o;if(i.isHorizontal()){if(u=_(n,o,r),P(e)){const M=Object.keys(e)[0],D=e[M];f=h[M].getPixelForValue(D)+p-t}else e==="center"?f=(c.bottom+c.top)/2+p-t:f=oo(i,e,t);d=r-o}else{if(P(e)){const M=Object.keys(e)[0],D=e[M];u=h[M].getPixelForValue(D)-b+t}else e==="center"?u=(c.left+c.right)/2-b+t:u=oo(i,e,t);f=_(n,a,s),A=e==="left"?-W:W}return{titleX:u,titleY:f,maxWidth:d,rotation:A}}class oe extends Et{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:s}=this;return t=lt(t,Number.POSITIVE_INFINITY),e=lt(e,Number.NEGATIVE_INFINITY),n=lt(n,Number.POSITIVE_INFINITY),s=lt(s,Number.NEGATIVE_INFINITY),{min:lt(t,n),max:lt(e,s),minDefined:j(t),maxDefined:j(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:e,max:n};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(n=Math.max(n,a.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:lt(e,lt(n,e)),max:lt(n,lt(e,n))}}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(){R(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=hc(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?ro(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Jh(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,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){R(this.options.afterUpdate,[this])}beforeSetDimensions(){R(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(){R(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),R(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){R(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=R(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){R(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){R(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=ao(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),A=h.widest.width,d=h.highest.height,u=K(this.chart.width-A,0,this.maxWidth);r=t.offset?this.maxWidth/n:u/(n-1),A+6>r&&(r=u/(n-(t.offset?.5:1)),l=this.maxHeight-Ne(t.grid)-e.padding-lo(t.title,this.chart.options.font),c=Math.sqrt(A*A+d*d),a=Li(Math.min(Math.asin(K((h.highest.height+6)/r,-1,1)),Math.asin(K(l/c,-1,1))-Math.asin(K(d/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){R(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){R(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=lo(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ne(o)+l):(t.height=this.maxHeight,t.width=Ne(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:A,highest:d}=this._getLabelSizes(),u=n.padding*2,f=ft(this.labelRotation),p=Math.cos(f),b=Math.sin(f);if(r){const M=n.mirror?0:b*A.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+M+u)}else{const M=n.mirror?0:p*A.width+b*d.height;t.width=Math.min(this.maxWidth,t.width+M+u)}this._calculatePadding(c,h,b,p)}}this._handleMargins(),r?(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,n,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,A=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,u=0;l?c?(d=s*t.width,u=n*e.height):(d=n*t.height,u=s*e.width):o==="start"?u=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,u=e.width/2),this.paddingLeft=Math.max((d-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-A+a)*this.width/(this.width-A),0)}else{let h=e.height/2,A=t.height/2;o==="start"?(h=0,A=t.height):o==="end"&&(h=e.height,A=0),this.paddingTop=h+a,this.paddingBottom=A+a}}_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(){R(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,n;for(e=0,n=t.length;e<n;e++)Q(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=ro(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/ao(e,n));let c=0,h=0,A,d,u,f,p,b,M,D,x,B,G;for(A=0;A<e;A+=l){if(f=t[A].label,p=this._resolveTickFontOptions(A),s.font=b=p.string,M=o[b]=o[b]||{data:{},gc:[]},D=p.lineHeight,x=B=0,!Q(f)&&!V(f))x=ni(s,M.data,M.gc,x,f),B=D;else if(V(f))for(d=0,u=f.length;d<u;++d)G=f[d],!Q(G)&&!V(G)&&(x=ni(s,M.data,M.gc,x,G),B+=D);a.push(x),r.push(B),c=Math.max(x,c),h=Math.max(B,h)}sA(o,e);const v=a.indexOf(c),y=r.indexOf(h),Y=C=>({width:a[C]||0,height:r[C]||0});return{first:Y(0),last:Y(e-1),widest:Y(v),highest:Y(y),widths:a,heights:r}}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 Rl(this._alignToPixels?_t(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 n=e[t];return n.$context||(n.$context=aA(this.getContext(),t,n))}return this.$context||(this.$context=oA(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ft(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*n>r*s?r/n:l/s:l*s<r*n?l/n:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),A=this.ticks.length+(l?1:0),d=Ne(o),u=[],f=r.setContext(this.getContext()),p=f.display?f.width:0,b=p/2,M=function(F){return _t(n,F,p)};let D,x,B,G,v,y,Y,C,E,k,T,J;if(a==="top")D=M(this.bottom),y=this.bottom-d,C=D-b,k=M(t.top)+b,J=t.bottom;else if(a==="bottom")D=M(this.top),k=t.top,J=M(t.bottom)-b,y=D+b,C=this.top+d;else if(a==="left")D=M(this.right),v=this.right-d,Y=D-b,E=M(t.left)+b,T=t.right;else if(a==="right")D=M(this.left),E=t.left,T=M(t.right)-b,v=D+b,Y=this.left+d;else if(e==="x"){if(a==="center")D=M((t.top+t.bottom)/2+.5);else if(P(a)){const F=Object.keys(a)[0],Z=a[F];D=M(this.chart.scales[F].getPixelForValue(Z))}k=t.top,J=t.bottom,y=D+b,C=y+d}else if(e==="y"){if(a==="center")D=M((t.left+t.right)/2);else if(P(a)){const F=Object.keys(a)[0],Z=a[F];D=M(this.chart.scales[F].getPixelForValue(Z))}v=D-b,Y=v-d,E=t.left,T=t.right}const ct=I(s.ticks.maxTicksLimit,A),O=Math.max(1,Math.ceil(A/ct));for(x=0;x<A;x+=O){const F=this.getContext(x),Z=o.setContext(F),wt=r.setContext(F),et=Z.lineWidth,we=Z.color,Ci=wt.dash||[],me=wt.dashOffset,je=Z.tickWidth,le=Z.tickColor,We=Z.tickBorderDash||[],ce=Z.tickBorderDashOffset;B=nA(this,x,l),B!==void 0&&(G=_t(n,B,et),c?v=Y=E=T=G:y=C=k=J=G,u.push({tx1:v,ty1:y,tx2:Y,ty2:C,x1:E,y1:k,x2:T,y2:J,width:et,color:we,borderDash:Ci,borderDashOffset:me,tickWidth:je,tickColor:le,tickBorderDash:We,tickBorderDashOffset:ce}))}return this._ticksLength=A,this._borderValue=D,u}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:A}=o,d=Ne(n.grid),u=d+h,f=A?-h:u,p=-ft(this.labelRotation),b=[];let M,D,x,B,G,v,y,Y,C,E,k,T,J="middle";if(s==="top")v=this.bottom-f,y=this._getXAxisLabelAlignment();else if(s==="bottom")v=this.top+f,y=this._getXAxisLabelAlignment();else if(s==="left"){const O=this._getYAxisLabelAlignment(d);y=O.textAlign,G=O.x}else if(s==="right"){const O=this._getYAxisLabelAlignment(d);y=O.textAlign,G=O.x}else if(e==="x"){if(s==="center")v=(t.top+t.bottom)/2+u;else if(P(s)){const O=Object.keys(s)[0],F=s[O];v=this.chart.scales[O].getPixelForValue(F)+u}y=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")G=(t.left+t.right)/2-u;else if(P(s)){const O=Object.keys(s)[0],F=s[O];G=this.chart.scales[O].getPixelForValue(F)}y=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?J="top":l==="end"&&(J="bottom"));const ct=this._getLabelSizes();for(M=0,D=r.length;M<D;++M){x=r[M],B=x.label;const O=o.setContext(this.getContext(M));Y=this.getPixelForTick(M)+o.labelOffset,C=this._resolveTickFontOptions(M),E=C.lineHeight,k=V(B)?B.length:1;const F=k/2,Z=O.color,wt=O.textStrokeColor,et=O.textStrokeWidth;let we=y;a?(G=Y,y==="inner"&&(M===D-1?we=this.options.reverse?"left":"right":M===0?we=this.options.reverse?"right":"left":we="center"),s==="top"?c==="near"||p!==0?T=-k*E+E/2:c==="center"?T=-ct.highest.height/2-F*E+E:T=-ct.highest.height+E/2:c==="near"||p!==0?T=E/2:c==="center"?T=ct.highest.height/2-F*E:T=ct.highest.height-k*E,A&&(T*=-1),p!==0&&!O.showLabelBackdrop&&(G+=E/2*Math.sin(p))):(v=Y,T=(1-k)*E/2);let Ci;if(O.showLabelBackdrop){const me=$(O.backdropPadding),je=ct.heights[M],le=ct.widths[M];let We=T-me.top,ce=0-me.left;switch(J){case"middle":We-=je/2;break;case"bottom":We-=je;break}switch(y){case"center":ce-=le/2;break;case"right":ce-=le;break;case"inner":M===D-1?ce-=le:M>0&&(ce-=le/2);break}Ci={left:ce,top:We,width:le+me.width,height:je+me.height,color:O.backdropColor}}b.push({label:B,font:C,textOffset:T,options:{rotation:p,color:Z,strokeColor:wt,strokeWidth:et,textAlign:we,textBaseline:J,translation:[G,v],backdrop:Ci}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ft(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,n==="near"?c="left":n==="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:n,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({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:n,grid:s}}=this,o=n.setContext(this.getContext()),a=n.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,A,d;this.isHorizontal()?(c=_t(t,this.left,a)-a/2,h=_t(t,this.right,r)+r/2,A=d=l):(A=_t(t,this.top,a)-a/2,d=_t(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,A),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&si(n,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,h=a.textOffset;$t(n,c,0,h,l,r)}s&&oi(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=U(n.font),a=$(n.padding),r=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||P(e)?(l+=a.bottom,V(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:A,rotation:d}=lA(this,l,e,r);$t(t,n.text,0,0,o,{color:n.color,maxWidth:A,rotation:d,textAlign:rA(r,e,s),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,n=I(t.grid&&t.grid.z,-1),s=I(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==oe.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[n]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return U(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class fi{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,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 n;AA(e)&&(n=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,cA(t,a,n),this.override&&H.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in H[s]&&(delete H[s][n],this.override&&delete qt[n])}}function cA(i,t,e){const n=ve(Object.create(null),[e?H.get(e):{},H.get(t),i.defaults]);H.set(t,n),i.defaultRoutes&&hA(t,i.defaultRoutes),i.descriptors&&H.describe(t,i.descriptors)}function hA(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");H.route(o,s,l,r)})}function AA(i){return"id"in i&&"defaults"in i}class dA{constructor(){this.controllers=new fi(jt,"datasets",!0),this.elements=new fi(Et,"elements"),this.plugins=new fi(Object,"plugins"),this.scales=new fi(oe,"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,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):z(s,a=>{const r=n||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,n){const s=Si(t);R(n["before"+s],[],n),e[t](n),R(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var Mt=new dA;class uA{constructor(){this._init=void 0}notify(t,e,n,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,n,s){s=s||{};for(const o of t){const a=o.plugin,r=a[n],l=[e,s,o.options];if(R(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){Q(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 n=t&&t.config,s=I(n.options&&n.options.plugins,{}),o=gA(n);return s===!1&&!e?[]:pA(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function gA(i){const t={},e=[],n=Object.keys(Mt.plugins.items);for(let o=0;o<n.length;o++)e.push(Mt.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function fA(i,t){return!t&&i===!1?null:i===!0?{}:i}function pA(i,{plugins:t,localIds:e},n,s){const o=[],a=i.getContext();for(const r of t){const l=r.id,c=fA(n[l],s);c!==null&&o.push({plugin:r,options:wA(i.config,{plugin:r,local:e[l]},c,a)})}return o}function wA(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(n,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function rn(i,t){const e=H.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function mA(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function bA(i,t){return i===t?"_index_":"_value_"}function co(i){if(i==="x"||i==="y"||i==="r")return i}function MA(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function ln(i,...t){if(co(i))return i;for(const e of t){const n=e.axis||MA(e.position)||i.length>1&&co(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function ho(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function DA(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return ho(i,"x",e[0])||ho(i,"y",e[0])}return{}}function GA(i,t){const e=qt[i.type]||{scales:{}},n=t.scales||{},s=rn(i.type,t),o=Object.create(null);return Object.keys(n).forEach(a=>{const r=n[a];if(!P(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=ln(a,r,DA(a,i),H.scales[r.type]),c=bA(l,s),h=e.scales||{};o[a]=ye(Object.create(null),[{axis:l},r,h[l],h[c]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||rn(r,t),h=(qt[r]||{}).scales||{};Object.keys(h).forEach(A=>{const d=mA(A,l),u=a[d+"AxisID"]||d;o[u]=o[u]||Object.create(null),ye(o[u],[{axis:d},n[u],h[A]])})}),Object.keys(o).forEach(a=>{const r=o[a];ye(r,[H.scales[r.type],H.scale])}),o}function Ao(i){const t=i.options||(i.options={});t.plugins=I(t.plugins,{}),t.scales=GA(i,t)}function uo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function BA(i){return i=i||{},i.data=uo(i.data),Ao(i),i}const go=new Map,fo=new Set;function pi(i,t){let e=go.get(i);return e||(e=t(),go.set(i,e),fo.add(e)),e}const Ve=(i,t,e)=>{const n=Rt(t,e);n!==void 0&&i.add(n)};class xA{constructor(t){this._config=BA(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=uo(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(),Ao(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return pi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return pi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return pi(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,a=this._cachedScopes(t,n),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(A=>Ve(l,t,A))),h.forEach(A=>Ve(l,s,A)),h.forEach(A=>Ve(l,qt[o]||{},A)),h.forEach(A=>Ve(l,H,A)),h.forEach(A=>Ve(l,Hi,A))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),fo.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,qt[e]||{},H.datasets[e]||{},{type:e},H,Hi]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=po(this._resolverCache,t,s);let l=a;if(yA(a,e)){o.$shared=!1,n=Nt(n)?n():n;const c=this.createResolver(t,n,r);l=de(a,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=po(this._resolverCache,t,n);return P(e)?de(o,e,void 0,s):o}}function po(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:Zi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o}const vA=i=>P(i)&&Object.getOwnPropertyNames(i).some(t=>Nt(i[t]));function yA(i,t){const{isScriptable:e,isIndexable:n}=ps(i);for(const s of t){const o=e(s),a=n(s),r=(a||o)&&i[s];if(o&&(Nt(r)||vA(r))||a&&V(r))return!0}return!1}var YA="4.5.1";const CA=["top","bottom","left","right","chartArea"];function wo(i,t){return i==="top"||i==="bottom"||CA.indexOf(i)===-1&&t==="x"}function mo(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function bo(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),R(e&&e.onComplete,[i],t)}function IA(i){const t=i.chart,e=t.options.animation;R(e&&e.onProgress,[i],t)}function Mo(i){return Xi()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const wi={},Do=i=>{const t=Mo(i);return Object.values(wi).filter(e=>e.canvas===t).pop()};function EA(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const a=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=a)}}}function kA(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}class cn{static defaults=H;static instances=wi;static overrides=qt;static registry=Mt;static version=YA;static getChart=Do;static register(...t){Mt.add(...t),Go()}static unregister(...t){Mt.remove(...t),Go()}constructor(t,e){const n=this.config=new xA(e),s=Mo(t),o=Do(s);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 a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Xh(s)),this.platform.updateConfig(n);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=yl(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,this._options=a,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 uA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Fl(A=>this.update(A),a.resizeDelay||0),this._dataChanges=[],wi[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}It.listen(this,"complete",bo),It.listen(this,"progress",IA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return Q(t)?e&&o?o:s?n/s: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 Mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():xs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return us(this.canvas,this.ctx),this}stop(){return It.stop(this),this}resize(t,e){It.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,xs(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),R(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};z(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=ln(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),z(o,a=>{const r=a.options,l=r.id,c=ln(l,r),h=I(r.type,a.dtype);(r.position===void 0||wo(r.position,c)!==wo(a.dposition))&&(r.position=a.dposition),s[l]=!0;let A=null;if(l in n&&n[l].type===h)A=n[l];else{const d=Mt.getScale(h);A=new d({id:l,type:h,ctx:this.ctx,chart:this}),n[A.id]=A}A.init(r,t)}),z(s,(a,r)=>{a||delete n[r]}),z(n,a=>{tt.configure(this,a,a.options),tt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(mo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let a=this.getDatasetMeta(n);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=r,a.indexAxis=o.indexAxis||rn(r,this.options),a.order=o.order||0,a.index=n,a.label=""+o.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const l=Mt.getController(r),{datasetElementType:c,dataElementType:h}=H.datasets[r];Object.assign(l,{dataElementType:Mt.getElement(h),datasetElementType:c&&Mt.getElement(c)}),a.controller=new l(this,n),t.push(a.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 n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.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 a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:A}=this.getDatasetMeta(c),d=!s&&o.indexOf(A)===-1;A.buildOrUpdateElements(d),a=Math.max(+A.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),s||z(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(mo("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){z(this.scales,t=>{tt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Xn(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const a=n==="_removeElements"?-o:o;EA(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!Xn(s,n(o)))return;return Array.from(s).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;tt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],z(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Nt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(It.has(this)?this.attached&&!It.running(this)&&It.start(this):(this.draw(),bo({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}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,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&n.push(a)}return n}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,n={meta:t,index:t.index,cancelable:!0},s=Ts(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&si(e,s),t.controller.draw(),s&&oi(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return Ct(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=Ch.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={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},n.push(s)),s}getContext(){return this.$context||(this.$context=Ht(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);Ye(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(r=>r.datasetIndex===t?s: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(),It.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(),us(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete wi[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,n=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};z(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",r)},e.isAttached(this.canvas)?r():a()}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,n){const s=n?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!_e(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(A=>h.datasetIndex===A.datasetIndex&&h.index===A.index)),a=o(e,t),r=n?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,n,a),l=Ql(t),c=kA(t,this._lastEvent,n,l);n&&(this._lastEvent=null,R(o.onHover,[t,r,this],this),l&&R(o.onClick,[t,r,this],this));const h=!_e(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function Go(){return z(cn.instances,i=>i._plugins.invalidate())}function QA(i,t,e){const{startAngle:n,x:s,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,A=Math.min(c/a,q(n-e));if(i.beginPath(),i.arc(s,o,a-c/2,n+A/2,e-A/2),r>0){const d=Math.min(c/r,q(n-e));i.arc(s,o,r+c/2,e-d/2,n+d/2,!0)}else{const d=Math.min(c/2,a*q(n-e));if(h==="round")i.arc(s,o,d,e-S/2,n+S/2,!0);else if(h==="bevel"){const u=2*d*d,f=-u*Math.cos(e+S/2)+s,p=-u*Math.sin(e+S/2)+o,b=u*Math.cos(n+S/2)+s,M=u*Math.sin(n+S/2)+o;i.lineTo(f,p),i.lineTo(b,M)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function PA(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;i.beginPath(),i.arc(o,a,r,n-c,e+c),l>s?(c=s/l,i.arc(o,a,l,e+c,n-c,!0)):i.arc(o,a,s,e+W,n-W),i.closePath(),i.clip()}function TA(i){return Wi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function SA(i,t,e,n){const s=TA(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,n*t/2),r=l=>{const c=(e-Math.min(o,l))*n/2;return K(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:K(s.innerStart,0,a),innerEnd:K(s.innerEnd,0,a)}}function fe(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function mi(i,t,e,n,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,A=Math.max(t.outerRadius+n+e-c,0),d=h>0?h+n+e+c:0;let u=0;const f=s-l;if(n){const O=h>0?h-n:0,F=A>0?A-n:0,Z=(O+F)/2,wt=Z!==0?f*Z/(Z+n):f;u=(f-wt)/2}const p=Math.max(.001,f*A-e/S)/A,b=(f-p)/2,M=l+b+u,D=s-b-u,{outerStart:x,outerEnd:B,innerStart:G,innerEnd:v}=SA(t,d,A,D-M),y=A-x,Y=A-B,C=M+x/y,E=D-B/Y,k=d+G,T=d+v,J=M+G/k,ct=D-v/T;if(i.beginPath(),o){const O=(C+E)/2;if(i.arc(a,r,A,C,O),i.arc(a,r,A,O,E),B>0){const et=fe(Y,E,a,r);i.arc(et.x,et.y,B,E,D+W)}const F=fe(T,D,a,r);if(i.lineTo(F.x,F.y),v>0){const et=fe(T,ct,a,r);i.arc(et.x,et.y,v,D+W,ct+Math.PI)}const Z=(D-v/d+(M+G/d))/2;if(i.arc(a,r,d,D-v/d,Z,!0),i.arc(a,r,d,Z,M+G/d,!0),G>0){const et=fe(k,J,a,r);i.arc(et.x,et.y,G,J+Math.PI,M-W)}const wt=fe(y,M,a,r);if(i.lineTo(wt.x,wt.y),x>0){const et=fe(y,C,a,r);i.arc(et.x,et.y,x,M-W,C)}}else{i.moveTo(a,r);const O=Math.cos(C)*A+a,F=Math.sin(C)*A+r;i.lineTo(O,F);const Z=Math.cos(E)*A+a,wt=Math.sin(E)*A+r;i.lineTo(Z,wt)}i.closePath()}function LA(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){mi(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(r)||(l=a+(r%N||N))}return mi(i,t,e,n,l,s),i.fill(),l}function zA(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:A,borderDashOffset:d,borderRadius:u}=l,f=l.borderAlign==="inner";if(!c)return;i.setLineDash(A||[]),i.lineDashOffset=d,f?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let p=t.endAngle;if(o){mi(i,t,e,n,p,s);for(let b=0;b<o;++b)i.stroke();isNaN(r)||(p=a+(r%N||N))}f&&PA(i,t,p),l.selfJoin&&p-a>=S&&u===0&&h!=="miter"&&QA(i,t,p),o||(mi(i,t,e,n,p,s),i.stroke())}class OA extends Et{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;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,n){const s=this.getProps(["x","y"],n),{angle:o,distance:a}=ts(s,{x:t,y:e}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:A}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=(this.options.spacing+this.options.borderWidth)/2,u=I(A,l-r),f=Ie(o,r,l)&&r!==l,p=u>=N||f,b=yt(a,c+d,h+d);return p&&b}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(s+o)/2,A=(a+r+c+l)/2;return{x:e+Math.cos(h)*A,y:n+Math.sin(h)*A}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>N?Math.floor(n/N):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const l=1-Math.sin(Math.min(S,n||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,LA(t,this,c,o,a),zA(t,this,c,o,a),t.restore()}}function Bo(i,t,e=t){i.lineCap=I(e.borderCapStyle,t.borderCapStyle),i.setLineDash(I(e.borderDash,t.borderDash)),i.lineDashOffset=I(e.borderDashOffset,t.borderDashOffset),i.lineJoin=I(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=I(e.borderWidth,t.borderWidth),i.strokeStyle=I(e.borderColor,t.borderColor)}function RA(i,t,e){i.lineTo(e.x,e.y)}function NA(i){return i.stepped?ec:i.tension||i.cubicInterpolationMode==="monotone"?ic:RA}function xo(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function VA(i,t,e,n){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=xo(s,e,n),h=NA(o);let{move:A=!0,reverse:d}=n||{},u,f,p;for(u=0;u<=c;++u)f=s[(r+(d?c-u:u))%a],!f.skip&&(A?(i.moveTo(f.x,f.y),A=!1):h(i,p,f,d,o.stepped),p=f);return l&&(f=s[(r+(d?c:0))%a],h(i,p,f,d,o.stepped)),!!l}function HA(i,t,e,n){const s=t.points,{count:o,start:a,ilen:r}=xo(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,A=0,d,u,f,p,b,M;const D=B=>(a+(c?r-B:B))%o,x=()=>{p!==b&&(i.lineTo(h,b),i.lineTo(h,p),i.lineTo(h,M))};for(l&&(u=s[D(0)],i.moveTo(u.x,u.y)),d=0;d<=r;++d){if(u=s[D(d)],u.skip)continue;const B=u.x,G=u.y,v=B|0;v===f?(G<p?p=G:G>b&&(b=G),h=(A*h+B)/++A):(x(),i.lineTo(B,G),f=v,A=0,p=b=G),M=G}x()}function hn(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?HA:VA}function FA(i){return i.stepped?Tc:i.tension||i.cubicInterpolationMode==="monotone"?Sc:ne}function jA(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Bo(i,t.options),i.stroke(s)}function WA(i,t,e,n){const{segments:s,options:o}=t,a=hn(t);for(const r of s)Bo(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const ZA=typeof Path2D=="function";function UA(i,t,e,n){ZA&&!t.options.segment?jA(i,t,e,n):WA(i,t,e,n)}class bi extends Et{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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 n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;yc(this._points,n,t,s,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=Vc(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,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,a=ks(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=FA(n);let c,h;for(c=0,h=a.length;c<h;++c){const{start:A,end:d}=a[c],u=o[A],f=o[d];if(u===f){r.push(u);continue}const p=Math.abs((s-u[e])/(f[e]-u[e])),b=l(u,f,p,n.stepped);b[e]=t[e],r.push(b)}return r.length===1?r[0]:r}pathSegment(t,e,n){return hn(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=hn(this);let a=this._loop;e=e||0,n=n||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+n-1});return!!a}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),UA(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function vo(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class KA extends Et{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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,n){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return vo(this,t,"x",e)}inYRange(t,e){return vo(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!Ct(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,ji(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function yo(i,t){const{x:e,y:n,base:s,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,l,c,h,A;return i.horizontal?(A=a/2,r=Math.min(e,s),l=Math.max(e,s),c=n-A,h=n+A):(A=o/2,r=e-A,l=e+A,c=Math.min(n,s),h=Math.max(n,s)),{left:r,top:c,right:l,bottom:h}}function Wt(i,t,e,n){return i?0:K(t,e,n)}function XA(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,o=fs(n);return{t:Wt(s.top,o.top,0,e),r:Wt(s.right,o.right,0,t),b:Wt(s.bottom,o.bottom,0,e),l:Wt(s.left,o.left,0,t)}}function JA(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=te(s),a=Math.min(t,e),r=i.borderSkipped,l=n||P(s);return{topLeft:Wt(!l||r.top||r.left,o.topLeft,0,a),topRight:Wt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Wt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Wt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function qA(i){const t=yo(i),e=t.right-t.left,n=t.bottom-t.top,s=XA(i,e/2,n/2),o=JA(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function An(i,t,e,n){const s=t===null,o=e===null,r=i&&!(s&&o)&&yo(i,n);return r&&(s||yt(t,r.left,r.right))&&(o||yt(e,r.top,r.bottom))}function _A(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function $A(i,t){i.rect(t.x,t.y,t.w,t.h)}function dn(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-n,a=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+o,h:i.h+a,radius:i.radius}}class td extends Et{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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:n,backgroundColor:s}}=this,{inner:o,outer:a}=qA(this),r=_A(a.radius)?Pe:$A;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,dn(a,e,o)),t.clip(),r(t,dn(o,-e,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),r(t,dn(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return An(this,t,e,n)}inXRange(t,e){return An(this,t,null,e)}inYRange(t,e){return An(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var ed=Object.freeze({__proto__:null,ArcElement:OA,BarElement:td,LineElement:bi,PointElement:KA});const un=["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)"],Yo=un.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Co(i){return un[i%un.length]}function Io(i){return Yo[i%Yo.length]}function id(i,t){return i.borderColor=Co(t),i.backgroundColor=Io(t),++t}function nd(i,t){return i.backgroundColor=i.data.map(()=>Co(t++)),t}function sd(i,t){return i.backgroundColor=i.data.map(()=>Io(t++)),t}function od(i){let t=0;return(e,n)=>{const s=i.getDatasetMeta(n).controller;s instanceof en?t=nd(e,t):s instanceof Us?t=sd(e,t):s&&(t=id(e,t))}}function Eo(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function ad(i){return i&&(i.borderColor||i.backgroundColor)}function rd(){return H.borderColor!=="rgba(0,0,0,0.1)"||H.backgroundColor!=="rgba(0,0,0,0.1)"}var ld={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:n},options:s}=i.config,{elements:o}=s,a=Eo(n)||ad(s)||o&&Eo(o)||rd();if(!e.forceOverride&&a)return;const r=od(i);n.forEach(r)}};function cd(i,t,e,n,s){const o=s.samples||n;if(o>=e)return i.slice(t,t+e);const a=[],r=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,A,d,u,f,p;for(a[l++]=i[h],A=0;A<o-2;A++){let b=0,M=0,D;const x=Math.floor((A+1)*r)+1+t,B=Math.min(Math.floor((A+2)*r)+1,e)+t,G=B-x;for(D=x;D<B;D++)b+=i[D].x,M+=i[D].y;b/=G,M/=G;const v=Math.floor(A*r)+1+t,y=Math.min(Math.floor((A+1)*r)+1,e)+t,{x:Y,y:C}=i[h];for(u=f=-1,D=v;D<y;D++)f=.5*Math.abs((Y-b)*(i[D].y-C)-(Y-i[D].x)*(M-C)),f>u&&(u=f,d=i[D],p=D);a[l++]=d,h=p}return a[l++]=i[c],a}function hd(i,t,e,n){let s=0,o=0,a,r,l,c,h,A,d,u,f,p;const b=[],M=t+e-1,D=i[t].x,B=i[M].x-D;for(a=t;a<t+e;++a){r=i[a],l=(r.x-D)/B*n,c=r.y;const G=l|0;if(G===h)c<f?(f=c,A=a):c>p&&(p=c,d=a),s=(o*s+r.x)/++o;else{const v=a-1;if(!Q(A)&&!Q(d)){const y=Math.min(A,d),Y=Math.max(A,d);y!==u&&y!==v&&b.push({...i[y],x:s}),Y!==u&&Y!==v&&b.push({...i[Y],x:s})}a>0&&v!==u&&b.push(i[v]),b.push(r),h=G,o=0,f=p=c,A=d=u=a}}return b}function ko(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 Qo(i){i.data.datasets.forEach(t=>{ko(t)})}function Ad(i,t){const e=t.length;let n=0,s;const{iScale:o}=i,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=K(Yt(t,o.axis,a).lo,0,e-1)),c?s=K(Yt(t,o.axis,r).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var dd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){Qo(i);return}const n=i.width;i.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=i.getDatasetMeta(o),c=a||s.data;if(Te([r,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:A,count:d}=Ad(l,c);const u=e.threshold||4*n;if(d<=u){ko(s);return}Q(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let f;switch(e.algorithm){case"lttb":f=cd(c,A,d,n,e);break;case"min-max":f=hd(c,A,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=f})},destroy(i){Qo(i)}};function ud(i,t,e){const n=i.segments,s=i.points,o=t.points,a=[];for(const r of n){let{start:l,end:c}=r;c=Mi(l,c,s);const h=gn(e,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[l],end:s[c]});continue}const A=ks(t,h);for(const d of A){const u=gn(e,o[d.start],o[d.end],d.loop),f=Es(r,s,u);for(const p of f)a.push({source:p,target:d,start:{[e]:Po(h,u,"start",Math.max)},end:{[e]:Po(h,u,"end",Math.min)}})}}return a}function gn(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=q(s),o=q(o)),{property:i,start:s,end:o}}function gd(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Mi(a,r,s);const l=s[a],c=s[r];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Mi(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Po(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function To(i,t){let e=[],n=!1;return V(i)?(n=!0,e=i):e=gd(i,t),e.length?new bi({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function So(i){return i&&i.fill!==!1}function fd(i,t,e){let s=i[t].fill;const o=[t];let a;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!j(s))return s;if(a=i[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function pd(i,t,e){const n=Md(i);if(P(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return j(s)&&Math.floor(s)===s?wd(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function wd(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function md(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:P(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function bd(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:P(i)?n=i.value:n=t.getBaseValue(),n}function Md(i){const t=i.options,e=t.fill;let n=I(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Dd(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,a=n.points,r=Gd(t,e);r.push(To({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Bd(s,a[h],r)}return new bi({points:s,options:{}})}function Gd(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Bd(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=xd(o,t,"x");if(!(!l||a&&r)){if(a)n.unshift(l);else if(i.push(l),!r)break}}i.push(...n)}function xd(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,a=i.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],A=a[h.start][e],d=a[h.end][e];if(yt(s,A,d)){r=s===A,l=s===d;break}}return{first:r,last:l,point:n}}class Lo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:N},t.arc(s,o,a,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function vd(i){const{chart:t,fill:e,line:n}=i;if(j(e))return yd(t,e);if(e==="stack")return Dd(i);if(e==="shape")return!0;const s=Yd(i);return s instanceof Lo?s:To(s,n)}function yd(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Yd(i){return(i.scale||{}).getPointPositionForValue?Id(i):Cd(i)}function Cd(i){const{scale:t={},fill:e}=i,n=md(e,t);if(j(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Id(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,a=bd(e,t,o),r=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new Lo({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function fn(i,t,e){const n=vd(t),{chart:s,index:o,line:a,scale:r,axis:l}=t,c=a.options,h=c.fill,A=c.backgroundColor,{above:d=A,below:u=A}=h||{},f=s.getDatasetMeta(o),p=Ts(s,f);n&&a.points.length&&(si(i,e),Ed(i,{line:a,target:n,above:d,below:u,area:e,scale:r,axis:l,clip:p}),oi(i))}function Ed(i,t){const{line:e,target:n,above:s,below:o,area:a,scale:r,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let h=o;o!==s&&(c==="x"?(zo(i,n,a.top),pn(i,{line:e,target:n,color:s,scale:r,property:c,clip:l}),i.restore(),i.save(),zo(i,n,a.bottom)):c==="y"&&(Oo(i,n,a.left),pn(i,{line:e,target:n,color:o,scale:r,property:c,clip:l}),i.restore(),i.save(),Oo(i,n,a.right),h=s)),pn(i,{line:e,target:n,color:h,scale:r,property:c,clip:l}),i.restore()}function zo(i,t,e){const{segments:n,points:s}=t;let o=!0,a=!1;i.beginPath();for(const r of n){const{start:l,end:c}=r,h=s[l],A=s[Mi(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(A.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Oo(i,t,e){const{segments:n,points:s}=t;let o=!0,a=!1;i.beginPath();for(const r of n){const{start:l,end:c}=r,h=s[l],A=s[Mi(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(e,h.y),i.lineTo(h.x,h.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(e,A.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function pn(i,t){const{line:e,target:n,property:s,color:o,scale:a,clip:r}=t,l=ud(e,n,s);for(const{source:c,target:h,start:A,end:d}of l){const{style:{backgroundColor:u=o}={}}=c,f=n!==!0;i.save(),i.fillStyle=u,kd(i,a,r,f&&gn(s,A,d)),i.beginPath();const p=!!e.pathSegment(i,c);let b;if(f){p?i.closePath():Ro(i,n,d,s);const M=!!n.pathSegment(i,h,{move:p,reverse:!0});b=p&&M,b||Ro(i,n,A,s)}i.closePath(),i.fill(b?"evenodd":"nonzero"),i.restore()}}function kd(i,t,e,n){const s=t.chart.chartArea,{property:o,start:a,end:r}=n||{};if(o==="x"||o==="y"){let l,c,h,A;o==="x"?(l=a,c=s.top,h=r,A=s.bottom):(l=s.left,c=a,h=s.right,A=r),i.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),A=Math.min(A,e.bottom)),i.rect(l,c,h-l,A-c),i.clip()}}function Ro(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var Qd={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<n;++a)o=i.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof bi&&(l={visible:i.isDatasetVisible(a),index:a,fill:pd(r,a,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<n;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=fd(s,a,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),n&&r.fill&&fn(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;So(o)&&fn(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!So(n)||e.drawTime!=="beforeDatasetDraw"||fn(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const No=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},Pd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Vo extends Et{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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=R(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,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 n=t.labels,s=U(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=No(n,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+r;let A=t;o.textAlign="left",o.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach((f,p)=>{const b=n+e/2+o.measureText(f.text).width;(p===0||c[c.length-1]+b+2*r>a)&&(A+=h,c[c.length-(p>0?0:1)]=0,u+=h,d++),l[p]={left:0,top:u,row:d,width:b,height:s},c[c.length-1]+=b+r}),A}_fitCols(t,e,n,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t;let A=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach((b,M)=>{const{itemWidth:D,itemHeight:x}=Td(n,e,o,b,s);M>0&&u+x+2*r>h&&(A+=d+r,c.push({width:d,height:u}),f+=d+r,p++,d=u=0),l[M]={left:f,top:u,col:p,width:D,height:x},d=Math.max(d,D),u+=x+r}),A+=d,c.push({width:d,height:u}),A}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,a=ge(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=_(n,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=_(n,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=_(n,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=_(n,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;si(t,this),this._draw(),oi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:a}=t,r=H.color,l=ge(t.rtl,this.left,this.width),c=U(a.font),{padding:h}=a,A=c.size,d=A/2;let u;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:f,boxHeight:p,itemHeight:b}=No(a,A),M=function(v,y,Y){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;s.save();const C=I(Y.lineWidth,1);if(s.fillStyle=I(Y.fillStyle,r),s.lineCap=I(Y.lineCap,"butt"),s.lineDashOffset=I(Y.lineDashOffset,0),s.lineJoin=I(Y.lineJoin,"miter"),s.lineWidth=C,s.strokeStyle=I(Y.strokeStyle,r),s.setLineDash(I(Y.lineDash,[])),a.usePointStyle){const E={radius:p*Math.SQRT2/2,pointStyle:Y.pointStyle,rotation:Y.rotation,borderWidth:C},k=l.xPlus(v,f/2),T=y+d;gs(s,E,k,T,a.pointStyleWidth&&f)}else{const E=y+Math.max((A-p)/2,0),k=l.leftForLtr(v,f),T=te(Y.borderRadius);s.beginPath(),Object.values(T).some(J=>J!==0)?Pe(s,{x:k,y:E,w:f,h:p,radius:T}):s.rect(k,E,f,p),s.fill(),C!==0&&s.stroke()}s.restore()},D=function(v,y,Y){$t(s,Y.text,v,y+b/2,c,{strikethrough:Y.hidden,textAlign:l.textAlign(Y.textAlign)})},x=this.isHorizontal(),B=this._computeTitleHeight();x?u={x:_(o,this.left+h,this.right-n[0]),y:this.top+h+B,line:0}:u={x:this.left+h,y:_(o,this.top+B+h,this.bottom-e[0].height),line:0},ys(this.ctx,t.textDirection);const G=b+h;this.legendItems.forEach((v,y)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;const Y=s.measureText(v.text).width,C=l.textAlign(v.textAlign||(v.textAlign=a.textAlign)),E=f+d+Y;let k=u.x,T=u.y;l.setWidth(this.width),x?y>0&&k+E+h>this.right&&(T=u.y+=G,u.line++,k=u.x=_(o,this.left+h,this.right-n[u.line])):y>0&&T+G>this.bottom&&(k=u.x=k+e[u.line].width+h,u.line++,T=u.y=_(o,this.top+B+h,this.bottom-e[u.line].height));const J=l.x(k);if(M(J,T,v),k=jl(C,k+f+d,x?k+E:this.right,t.rtl),D(l.x(k),T,v),x)u.x+=E+h;else if(typeof v.text!="string"){const ct=c.lineHeight;u.y+=Ho(v,ct)+h}else u.y+=G}),Ys(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=U(e.font),s=$(e.padding);if(!e.display)return;const o=ge(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=n.size/2,c=s.top+l;let h,A=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,A=_(t.align,A,this.right-d);else{const f=this.columnSizes.reduce((p,b)=>Math.max(p,b.height),0);h=c+_(t.align,this.top,this.bottom-f-t.labels.padding-this._computeTitleHeight())}const u=_(r,A,A+d);a.textAlign=o.textAlign(Ri(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=n.string,$t(a,e.text,u,h,n)}_computeTitleHeight(){const t=this.options.title,e=U(t.font),n=$(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(yt(t,this.left,this.right)&&yt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],yt(t,s.left,s.left+s.width)&&yt(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!zd(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Pd(s,n);s&&!o&&R(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&R(e.onHover,[t,n,this],this)}else n&&R(e.onClick,[t,n,this],this)}}function Td(i,t,e,n,s){const o=Sd(n,i,t,e),a=Ld(s,n,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Sd(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+n.measureText(s).width}function Ld(i,t,e){let n=i;return typeof t.text!="string"&&(n=Ho(t,e)),n}function Ho(i,t){const e=i.text?i.text.length:0;return t*e}function zd(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Od={id:"legend",_element:Vo,start(i,t,e){const n=i.legend=new Vo({ctx:i.ctx,options:e,chart:i});tt.configure(i,n,e),tt.addBox(i,n)},stop(i){tt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;tt.configure(i,n,e),n.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 n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),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:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=$(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:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||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 wn extends Et{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=V(n.text)?n.text.length:1;this._padding=$(n.padding);const o=s*U(n.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:n,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,h,A;return this.isHorizontal()?(h=_(r,n,o),A=e+t,c=o-n):(a.position==="left"?(h=n+t,A=_(r,s,e),l=S*-.5):(h=o-t,A=_(r,e,s),l=S*.5),c=s-e),{titleX:h,titleY:A,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=U(e.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);$t(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Ri(e.align),textBaseline:"middle",translation:[a,r]})}}function Rd(i,t){const e=new wn({ctx:i.ctx,options:t,chart:i});tt.configure(i,e,t),tt.addBox(i,e),i.titleBlock=e}var Nd={id:"title",_element:wn,start(i,t,e){Rd(i,e)},stop(i){const t=i.titleBlock;tt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;tt.configure(i,n,e),n.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 Di=new WeakMap;var Vd={id:"subtitle",start(i,t,e){const n=new wn({ctx:i.ctx,options:e,chart:i});tt.configure(i,n,e),tt.addBox(i,n),Di.set(i,n)},stop(i){tt.removeBox(i,Di.get(i)),Di.delete(i)},beforeUpdate(i,t,e){const n=Di.get(i);tt.configure(i,n,e),n.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 He={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;t<e;++t){const r=i[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((r,l)=>r+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=zi(t,c);h<s&&(s=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function Dt(i,t){return t&&(V(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function kt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
1975
|
+
`;function Ge(i){return i+.5|0}const zt=(i,t,e)=>Math.max(Math.min(i,e),t);function Be(i){return zt(Ge(i*2.55),0,255)}function Ot(i){return zt(Ge(i*255),0,255)}function xt(i){return zt(Ge(i/2.55)/100,0,1)}function Rn(i){return zt(Ge(i*100),0,100)}const ht={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},Ei=[..."0123456789ABCDEF"],sl=i=>Ei[i&15],ol=i=>Ei[(i&240)>>4]+Ei[i&15],Xe=i=>(i&240)>>4===(i&15),al=i=>Xe(i.r)&&Xe(i.g)&&Xe(i.b)&&Xe(i.a);function rl(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&ht[i[1]]*17,g:255&ht[i[2]]*17,b:255&ht[i[3]]*17,a:t===5?ht[i[4]]*17:255}:(t===7||t===9)&&(e={r:ht[i[1]]<<4|ht[i[2]],g:ht[i[3]]<<4|ht[i[4]],b:ht[i[5]]<<4|ht[i[6]],a:t===9?ht[i[7]]<<4|ht[i[8]]:255})),e}const ll=(i,t)=>i<255?t(i):"";function cl(i){var t=al(i)?sl:ol;return i?"#"+t(i.r)+t(i.g)+t(i.b)+ll(i.a,t):void 0}const hl=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Nn(i,t,e){const n=t*Math.min(e,1-e),s=(o,a=(o+i/30)%12)=>e-n*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function Al(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function dl(i,t,e){const n=Nn(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function ul(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function ki(i){const e=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(e,n,s),a=Math.min(e,n,s),r=(o+a)/2;let l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=ul(e,n,s,h,o),l=l*60+.5),[l|0,c||0,r]}function Qi(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(Ot)}function Pi(i,t,e){return Qi(Nn,i,t,e)}function gl(i,t,e){return Qi(dl,i,t,e)}function fl(i,t,e){return Qi(Al,i,t,e)}function Vn(i){return(i%360+360)%360}function pl(i){const t=hl.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?Be(+t[5]):Ot(+t[5]));const s=Vn(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=gl(s,o,a):t[1]==="hsv"?n=fl(s,o,a):n=Pi(s,o,a),{r:n[0],g:n[1],b:n[2],a:e}}function wl(i,t){var e=ki(i);e[0]=Vn(e[0]+t),e=Pi(e),i.r=e[0],i.g=e[1],i.b=e[2]}function ml(i){if(!i)return;const t=ki(i),e=t[0],n=Rn(t[1]),s=Rn(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${xt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const Hn={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"},Fn={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 bl(){const i={},t=Object.keys(Fn),e=Object.keys(Hn);let n,s,o,a,r;for(n=0;n<t.length;n++){for(a=r=t[n],s=0;s<e.length;s++)o=e[s],r=r.replace(o,Hn[o]);o=parseInt(Fn[a],16),i[r]=[o>>16&255,o>>8&255,o&255]}return i}let Je;function Ml(i){Je||(Je=bl(),Je.transparent=[0,0,0,0]);const t=Je[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Dl=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Gl(i){const t=Dl.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const a=+t[7];e=t[8]?Be(a):zt(a*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?Be(n):zt(n,0,255)),s=255&(t[4]?Be(s):zt(s,0,255)),o=255&(t[6]?Be(o):zt(o,0,255)),{r:n,g:s,b:o,a:e}}}function Bl(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${xt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ti=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,he=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function xl(i,t,e){const n=he(xt(i.r)),s=he(xt(i.g)),o=he(xt(i.b));return{r:Ot(Ti(n+e*(he(xt(t.r))-n))),g:Ot(Ti(s+e*(he(xt(t.g))-s))),b:Ot(Ti(o+e*(he(xt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function qe(i,t,e){if(i){let n=ki(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Pi(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function jn(i,t){return i&&Object.assign(t||{},i)}function Wn(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=Ot(i[3]))):(t=jn(i,{r:0,g:0,b:0,a:1}),t.a=Ot(t.a)),t}function vl(i){return i.charAt(0)==="r"?Gl(i):pl(i)}class xe{constructor(t){if(t instanceof xe)return t;const e=typeof t;let n;e==="object"?n=Wn(t):e==="string"&&(n=rl(t)||Ml(t)||vl(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=jn(this._rgb);return t&&(t.a=xt(t.a)),t}set rgb(t){this._rgb=Wn(t)}rgbString(){return this._valid?Bl(this._rgb):void 0}hexString(){return this._valid?cl(this._rgb):void 0}hslString(){return this._valid?ml(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=n.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=a*n.a+(1-a)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=xl(this._rgb,t._rgb,e)),this}clone(){return new xe(this.rgb)}alpha(t){return this._rgb.a=Ot(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ge(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 qe(this._rgb,2,t),this}darken(t){return qe(this._rgb,2,-t),this}saturate(t){return qe(this._rgb,1,t),this}desaturate(t){return qe(this._rgb,1,-t),this}rotate(t){return wl(this._rgb,t),this}}function vt(){}const yl=(()=>{let i=0;return()=>i++})();function Q(i){return i==null}function V(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function P(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function j(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function lt(i,t){return j(i)?i:t}function I(i,t){return typeof i>"u"?t:i}const Yl=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Zn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function R(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function z(i,t,e,n){let s,o,a;if(V(i))for(o=i.length,s=0;s<o;s++)t.call(e,i[s],s);else if(P(i))for(a=Object.keys(i),o=a.length,s=0;s<o;s++)t.call(e,i[a[s]],a[s])}function _e(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function $e(i){if(V(i))return i.map($e);if(P(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=$e(i[e[s]]);return t}return i}function Un(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Cl(i,t,e,n){if(!Un(i))return;const s=t[i],o=e[i];P(s)&&P(o)?ve(s,o,n):t[i]=$e(o)}function ve(i,t,e){const n=V(t)?t:[t],s=n.length;if(!P(i))return i;e=e||{};const o=e.merger||Cl;let a;for(let r=0;r<s;++r){if(a=n[r],!P(a))continue;const l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],i,a,e)}return i}function ye(i,t){return ve(i,t,{merger:Il})}function Il(i,t,e){if(!Un(i))return;const n=t[i],s=e[i];P(n)&&P(s)?ye(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=$e(s))}const Kn={"":i=>i,x:i=>i.x,y:i=>i.y};function El(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function kl(i){const t=El(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Rt(i,t){return(Kn[t]||(Kn[t]=kl(t)))(i)}function Si(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Ye=i=>typeof i<"u",Nt=i=>typeof i=="function",Xn=(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 S=Math.PI,N=2*S,Pl=N+S,ti=Number.POSITIVE_INFINITY,Tl=S/180,W=S/2,Jt=S/4,Jn=S*2/3,Vt=Math.log10,bt=Math.sign;function Ce(i,t,e){return Math.abs(i-t)<e}function qn(i){const t=Math.round(i);i=Ce(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Vt(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Sl(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function Ll(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Ae(i){return!Ll(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function zl(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function _n(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ft(i){return i*(S/180)}function Li(i){return i*(180/S)}function $n(i){if(!j(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function ts(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*S&&(o+=N),{angle:o,distance:s}}function zi(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Ol(i,t){return(i-t+Pl)%N-S}function q(i){return(i%N+N)%N}function Ie(i,t,e,n){const s=q(i),o=q(t),a=q(e),r=q(o-s),l=q(a-s),c=q(s-o),h=q(s-a);return s===o||s===a||n&&o===a||r>l&&c<h}function K(i,t,e){return Math.max(t,Math.min(e,i))}function Rl(i){return K(i,-32768,32767)}function yt(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Oi(i,t,e){e=e||(a=>i[a]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Yt=(i,t,e,n)=>Oi(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),Nl=(i,t,e)=>Oi(i,e,n=>i[n][t]>=e);function Vl(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const es=["push","pop","shift","splice","unshift"];function Hl(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),es.forEach(e=>{const n="_onData"+Si(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o)}),a}})})}function is(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(es.forEach(o=>{delete i[o]}),delete i._chartjs)}function ns(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const ss=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function os(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,ss.call(window,()=>{n=!1,i.apply(t,e)}))}}function Fl(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Ri=i=>i==="start"?"left":i==="end"?"right":"center",_=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,jl=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function as(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:a,vScale:r,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=a.axis,{min:A,max:d,minDefined:u,maxDefined:f}=a.getUserBounds();if(u){if(s=Math.min(Yt(l,h,A).lo,e?n:Yt(t,h,a.getPixelForValue(A)).lo),c){const p=l.slice(0,s+1).reverse().findIndex(b=>!Q(b[r.axis]));s-=Math.max(0,p)}s=K(s,0,n-1)}if(f){let p=Math.max(Yt(l,a.axis,d,!0).hi+1,e?0:Yt(t,h,a.getPixelForValue(d),!0).hi+1);if(c){const b=l.slice(p-1).findIndex(M=>!Q(M[r.axis]));p+=Math.max(0,b)}o=K(p,s,n)-s}else o=n-s}return{start:s,count:o}}function rs(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const ei=i=>i===0||i===1,ls=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*N/e)),cs=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*N/e)+1,Ee={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*W)+1,easeOutSine:i=>Math.sin(i*W),easeInOutSine:i=>-.5*(Math.cos(S*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=>ei(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=>ei(i)?i:ls(i,.075,.3),easeOutElastic:i=>ei(i)?i:cs(i,.075,.3),easeInOutElastic(i){return ei(i)?i:i<.5?.5*ls(i*2,.1125,.45):.5+.5*cs(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-Ee.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?Ee.easeInBounce(i*2)*.5:Ee.easeOutBounce(i*2-1)*.5+.5};function Ni(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function hs(i){return Ni(i)?i:new xe(i)}function Vi(i){return Ni(i)?i:new xe(i).saturate(.5).darken(.1).hexString()}const Wl=["x","y","borderWidth","radius","tension"],Zl=["color","borderColor","backgroundColor"];function Ul(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:Zl},numbers:{type:"number",properties:Wl}}),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 Kl(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const As=new Map;function Xl(i,t){t=t||{};const e=i+JSON.stringify(t);let n=As.get(e);return n||(n=new Intl.NumberFormat(i,t),As.set(e,n)),n}function ke(i,t,e){return Xl(t,e).format(i)}const ds={values(i){return V(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,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)&&(s="scientific"),o=Jl(i,e)}const a=Vt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ke(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(Vt(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?ds.numeric.call(this,i,t,e):""}};function Jl(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 ii={formatters:ds};function ql(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ii.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 qt=Object.create(null),Hi=Object.create(null);function Qe(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function Fi(i,t,e){return typeof t=="string"?ve(Qe(i,t),e):ve(Qe(i,""),t)}class _l{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=n=>n.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=(n,s)=>Vi(s.backgroundColor),this.hoverBorderColor=(n,s)=>Vi(s.borderColor),this.hoverColor=(n,s)=>Vi(s.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 Fi(this,t,e)}get(t){return Qe(this,t)}describe(t,e){return Fi(Hi,t,e)}override(t,e){return Fi(qt,t,e)}route(t,e,n,s){const o=Qe(this,t),a=Qe(this,n),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[s];return P(l)?Object.assign({},c,l):I(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var H=new _l({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ul,Kl,ql]);function $l(i){return!i||Q(i.size)||Q(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ni(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function tc(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let a=0;const r=e.length;let l,c,h,A,d;for(l=0;l<r;l++)if(A=e[l],A!=null&&!V(A))a=ni(i,s,o,a,A);else if(V(A))for(c=0,h=A.length;c<h;c++)d=A[c],d!=null&&!V(d)&&(a=ni(i,s,o,a,d));i.restore();const u=o.length/2;if(u>e.length){for(l=0;l<u;l++)delete s[o[l]];o.splice(0,u)}return a}function _t(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function us(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function ji(i,t,e,n){gs(i,t,e,n,null)}function gs(i,t,e,n,s){let o,a,r,l,c,h,A,d;const u=t.pointStyle,f=t.rotation,p=t.radius;let b=(f||0)*Tl;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(b),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),u){default:s?i.ellipse(e,n,s/2,p,0,0,N):i.arc(e,n,p,0,N),i.closePath();break;case"triangle":h=s?s/2:p,i.moveTo(e+Math.sin(b)*h,n-Math.cos(b)*p),b+=Jn,i.lineTo(e+Math.sin(b)*h,n-Math.cos(b)*p),b+=Jn,i.lineTo(e+Math.sin(b)*h,n-Math.cos(b)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(b+Jt)*l,A=Math.cos(b+Jt)*(s?s/2-c:l),r=Math.sin(b+Jt)*l,d=Math.sin(b+Jt)*(s?s/2-c:l),i.arc(e-A,n-r,c,b-S,b-W),i.arc(e+d,n-a,c,b-W,b),i.arc(e+A,n+r,c,b,b+W),i.arc(e-d,n+a,c,b+W,b+S),i.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*p,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}b+=Jt;case"rectRot":A=Math.cos(b)*(s?s/2:p),a=Math.cos(b)*p,r=Math.sin(b)*p,d=Math.sin(b)*(s?s/2:p),i.moveTo(e-A,n-r),i.lineTo(e+d,n-a),i.lineTo(e+A,n+r),i.lineTo(e-d,n+a),i.closePath();break;case"crossRot":b+=Jt;case"cross":A=Math.cos(b)*(s?s/2:p),a=Math.cos(b)*p,r=Math.sin(b)*p,d=Math.sin(b)*(s?s/2:p),i.moveTo(e-A,n-r),i.lineTo(e+A,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a);break;case"star":A=Math.cos(b)*(s?s/2:p),a=Math.cos(b)*p,r=Math.sin(b)*p,d=Math.sin(b)*(s?s/2:p),i.moveTo(e-A,n-r),i.lineTo(e+A,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a),b+=Jt,A=Math.cos(b)*(s?s/2:p),a=Math.cos(b)*p,r=Math.sin(b)*p,d=Math.sin(b)*(s?s/2:p),i.moveTo(e-A,n-r),i.lineTo(e+A,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a);break;case"line":a=s?s/2:Math.cos(b)*p,r=Math.sin(b)*p,i.moveTo(e-a,n-r),i.lineTo(e+a,n+r);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(b)*(s?s/2:p),n+Math.sin(b)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Ct(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 si(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function oi(i){i.restore()}function ec(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function ic(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function nc(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),Q(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 sc(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(a,h),i.lineTo(r,h),i.stroke()}}function oc(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function $t(i,t,e,n,s,o={}){const a=V(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,nc(i,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&oc(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),Q(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),sc(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function Pe(i,t){const{x:e,y:n,w:s,h:o,radius:a}=t;i.arc(e+a.topLeft,n+a.topLeft,a.topLeft,1.5*S,S,!0),i.lineTo(e,n+o-a.bottomLeft),i.arc(e+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,S,W,!0),i.lineTo(e+s-a.bottomRight,n+o),i.arc(e+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,W,0,!0),i.lineTo(e+s,n+a.topRight),i.arc(e+s-a.topRight,n+a.topRight,a.topRight,0,-W,!0),i.lineTo(e+a.topLeft,n)}const ac=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,rc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function lc(i,t){const e=(""+i).match(ac);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 Wi(i,t){const e={},n=P(t),s=n?Object.keys(t):t,o=P(i)?n?a=>I(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of s)e[a]=cc(o(a));return e}function fs(i){return Wi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function te(i){return Wi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function $(i){const t=fs(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function U(i,t){i=i||{},t=t||H.font;let e=I(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=I(i.style,t.style);n&&!(""+n).match(rc)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:I(i.family,t.family),lineHeight:lc(I(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:I(i.weight,t.weight),string:""};return s.string=$l(s),s}function Te(i,t,e,n){let s,o,a;for(s=0,o=i.length;s<o;++s)if(a=i[s],a!==void 0&&a!==void 0)return a}function hc(i,t,e){const{min:n,max:s}=i,o=Zn(t,(s-n)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function Ht(i,t){return Object.assign(Object.create(i),t)}function Zi(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=Ms("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>Zi([r,...i],t,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return ws(r,l,()=>mc(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Ds(r).includes(l)},ownKeys(r){return Ds(r)},set(r,l,c){const h=r._storage||(r._storage=s());return r[l]=h[l]=c,delete r._keys,!0}})}function de(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:ps(i,n),setContext:o=>de(i,o,e,n),override:o=>de(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return ws(o,a,()=>dc(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function ps(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Nt(e)?e:()=>e,isIndexable:Nt(n)?n:()=>n}}const Ac=(i,t)=>i?i+Si(t):t,Ui=(i,t)=>P(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ws(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function dc(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=i;let r=n[t];return Nt(r)&&a.isScriptable(t)&&(r=uc(t,r,i,e)),V(r)&&r.length&&(r=gc(t,r,i,a.isIndexable)),Ui(t,r)&&(r=de(r,s,o&&o[t],a)),r}function uc(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||n);return r.delete(i),Ui(i,l)&&(l=Ki(s._scopes,s,i,l)),l}function gc(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(P(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const A=Ki(c,s,i,h);t.push(de(A,o,a&&a[i],r))}}return t}function ms(i,t,e){return Nt(i)?i(t,e):i}const fc=(i,t)=>i===!0?t:typeof i=="string"?Rt(t,i):void 0;function pc(i,t,e,n,s){for(const o of t){const a=fc(e,o);if(a){i.add(a);const r=ms(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==n)return r}else if(a===!1&&typeof n<"u"&&e!==n)return null}return!1}function Ki(i,t,e,n){const s=t._rootScopes,o=ms(t._fallback,e,n),a=[...i,...s],r=new Set;r.add(n);let l=bs(r,a,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=bs(r,a,o,l,n),l===null)?!1:Zi(Array.from(r),[""],s,o,()=>wc(t,e,n))}function bs(i,t,e,n,s){for(;e;)e=pc(i,t,e,n,s);return e}function wc(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return V(s)&&P(e)?e:s||{}}function mc(i,t,e,n){let s;for(const o of t)if(s=Ms(Ac(o,i),e),typeof s<"u")return Ui(i,s)?Ki(e,n,i,s):s}function Ms(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Ds(i){let t=i._keys;return t||(t=i._keys=bc(i._scopes)),t}function bc(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function Gs(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,a=new Array(n);let r,l,c,h;for(r=0,l=n;r<l;++r)c=r+e,h=t[c],a[r]={r:s.parse(Rt(h,o),c)};return a}const Mc=Number.EPSILON||1e-14,ue=(i,t)=>t<i.length&&!i[t].skip&&i[t],Bs=i=>i==="x"?"y":"x";function Dc(i,t,e,n){const s=i.skip?t:i,o=t,a=e.skip?t:e,r=zi(o,s),l=zi(a,o);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const A=n*c,d=n*h;return{previous:{x:o.x-A*(a.x-s.x),y:o.y-A*(a.y-s.y)},next:{x:o.x+d*(a.x-s.x),y:o.y+d*(a.y-s.y)}}}function Gc(i,t,e){const n=i.length;let s,o,a,r,l,c=ue(i,0);for(let h=0;h<n-1;++h)if(l=c,c=ue(i,h+1),!(!l||!c)){if(Ce(t[h],0,Mc)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=s*a*t[h],e[h+1]=o*a*t[h])}}function Bc(i,t,e="x"){const n=Bs(e),s=i.length;let o,a,r,l=ue(i,0);for(let c=0;c<s;++c){if(a=r,r=l,l=ue(i,c+1),!r)continue;const h=r[e],A=r[n];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${n}`]=A-o*t[c]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${n}`]=A+o*t[c])}}function xc(i,t="x"){const e=Bs(t),n=i.length,s=Array(n).fill(0),o=Array(n);let a,r,l,c=ue(i,0);for(a=0;a<n;++a)if(r=l,l=c,c=ue(i,a+1),!!l){if(c){const h=c[t]-l[t];s[a]=h!==0?(c[e]-l[e])/h:0}o[a]=r?c?bt(s[a-1])!==bt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Gc(i,s,o),Bc(i,o,t)}function ai(i,t,e){return Math.max(Math.min(i,e),t)}function vc(i,t){let e,n,s,o,a,r=Ct(i[0],t);for(e=0,n=i.length;e<n;++e)a=o,o=r,r=e<n-1&&Ct(i[e+1],t),o&&(s=i[e],a&&(s.cp1x=ai(s.cp1x,t.left,t.right),s.cp1y=ai(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=ai(s.cp2x,t.left,t.right),s.cp2y=ai(s.cp2y,t.top,t.bottom)))}function yc(i,t,e,n,s){let o,a,r,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")xc(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=Dc(c,r,i[Math.min(o+1,a-(n?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&vc(i,e)}function Xi(){return typeof window<"u"&&typeof document<"u"}function Ji(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ri(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const li=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Yc(i,t){return li(i).getPropertyValue(t)}const Cc=["top","right","bottom","left"];function ee(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Cc[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Ic=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Ec(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let a=!1,r,l;if(Ic(s,o,i.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=n.clientX-c.left,l=n.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function ie(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=li(e),o=s.boxSizing==="border-box",a=ee(s,"padding"),r=ee(s,"border","width"),{x:l,y:c,box:h}=Ec(i,e),A=a.left+(h&&r.left),d=a.top+(h&&r.top);let{width:u,height:f}=t;return o&&(u-=a.width+r.width,f-=a.height+r.height),{x:Math.round((l-A)/u*e.width/n),y:Math.round((c-d)/f*e.height/n)}}function kc(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&Ji(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=li(o),l=ee(r,"border","width"),c=ee(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,n=ri(r.maxWidth,o,"clientWidth"),s=ri(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||ti,maxHeight:s||ti}}const Ft=i=>Math.round(i*10)/10;function Qc(i,t,e,n){const s=li(i),o=ee(s,"margin"),a=ri(s.maxWidth,i,"clientWidth")||ti,r=ri(s.maxHeight,i,"clientHeight")||ti,l=kc(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const d=ee(s,"border","width"),u=ee(s,"padding");c-=u.width+d.width,h-=u.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Ft(Math.min(c,a,l.maxWidth)),h=Ft(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Ft(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=Ft(Math.floor(h*n))),{width:c,height:h}}function xs(i,t,e){const n=t||1,s=Ft(i.height*n),o=Ft(i.width*n);i.height=Ft(i.height),i.width=Ft(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(i.currentDevicePixelRatio=n,a.height=s,a.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Pc=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Xi()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function vs(i,t){const e=Yc(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ne(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Tc(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Sc(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=ne(i,s,e),r=ne(s,o,e),l=ne(o,t,e),c=ne(a,r,e),h=ne(r,l,e);return ne(c,h,e)}const Lc=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,n){return e-n},leftForLtr(e,n){return e-n}}},zc=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function ge(i,t,e){return i?Lc(t,e):zc()}function ys(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Ys(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Cs(i){return i==="angle"?{between:Ie,compare:Ol,normalize:q}:{between:yt,compare:(t,e)=>t-e,normalize:t=>t}}function Is({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Oc(i,t,e){const{property:n,start:s,end:o}=e,{between:a,normalize:r}=Cs(n),l=t.length;let{start:c,end:h,loop:A}=i,d,u;if(A){for(c+=l,h+=l,d=0,u=l;d<u&&a(r(t[c%l][n]),s,o);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:A,style:i.style}}function Es(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=Cs(n),{start:h,end:A,loop:d,style:u}=Oc(i,t,e),f=[];let p=!1,b=null,M,D,x;const B=()=>l(s,x,M)&&r(s,x)!==0,G=()=>r(o,M)===0||l(o,x,M),v=()=>p||B(),y=()=>!p||G();for(let Y=h,C=h;Y<=A;++Y)D=t[Y%a],!D.skip&&(M=c(D[n]),M!==x&&(p=l(M,s,o),b===null&&v()&&(b=r(M,s)===0?Y:C),b!==null&&y()&&(f.push(Is({start:b,end:Y,loop:d,count:a,style:u})),b=null),C=Y,x=M));return b!==null&&f.push(Is({start:b,end:A,loop:d,count:a,style:u})),f}function ks(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=Es(n[s],i.points,t);o.length&&e.push(...o)}return e}function Rc(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Nc(i,t,e,n){const s=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?r.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:n}),o}function Vc(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:a,end:r}=Rc(e,s,o,n);if(n===!0)return Qs(i,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,c=!!i._fullLoop&&a===0&&r===s-1;return Qs(i,Nc(e,a,l,c),e,t)}function Qs(i,t,e,n){return!n||!n.setContext||!e?t:Hc(i,t,e,n)}function Hc(i,t,e,n){const s=i._chart.getContext(),o=Ps(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=e.length,c=[];let h=o,A=t[0].start,d=A;function u(f,p,b,M){const D=r?-1:1;if(f!==p){for(f+=l;e[f%l].skip;)f-=D;for(;e[p%l].skip;)p+=D;f%l!==p%l&&(c.push({start:f%l,end:p%l,loop:b,style:M}),h=M,A=p%l)}}for(const f of t){A=r?A:f.start;let p=e[A%l],b;for(d=A+1;d<=f.end;d++){const M=e[d%l];b=Ps(n.setContext(Ht(s,{type:"segment",p0:p,p1:M,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:a}))),Fc(b,h)&&u(A,d-1,f.loop,h),p=M,h=b}A<d-1&&u(A,d-1,f.loop,h)}return c}function Ps(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Fc(i,t){if(!t)return!1;const e=[],n=function(s,o){return Ni(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}function ci(i,t,e){return i.options.clip?i[e]:t[e]}function jc(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:ci(e,t,"left"),right:ci(e,t,"right"),top:ci(n,t,"top"),bottom:ci(n,t,"bottom")}:t}function Ts(i,t){const e=t._clip;if(e.disabled)return!1;const n=jc(t,i.chartArea);return{left:e.left===!1?0:n.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:n.right+(e.right===!0?0:e.right),top:e.top===!1?0:n.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:n.bottom+(e.bottom===!0?0:e.bottom)}}class Wc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=ss.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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((n,s)=>Math.max(n,s._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 n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var It=new Wc;const Ss="transparent",Zc={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=hs(i||Ss),s=n.valid&&hs(t||Ss);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Uc{constructor(t,e,n,s){const o=e[n];s=Te([t.to,s,o,t.from]);const a=Te([t.from,o,s]);this._active=!0,this._fn=t.fn||Zc[t.type||typeof a],this._easing=Ee[t.easing]||Ee.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=n,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Te([t.to,e,s,t.from]),this._from=Te([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<n),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class Ls{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;const e=Object.keys(H.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!P(o))return;const a={};for(const r of e)a[r]=o[r];(V(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a)})})}_animateOptions(t,e){const n=e.options,s=Xc(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&Kc(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let A=o[c];const d=n.get(c);if(A)if(d&&A.active()){A.update(d,h,r);continue}else A.cancel();if(!d||!d.duration){t[c]=h;continue}o[c]=A=new Uc(d,t,c,h),s.push(A)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return It.add(this._chart,n),!0}}function Kc(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Xc(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 zs(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function Jc(i,t,e){if(e===!1)return!1;const n=zs(i,e),s=zs(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function qc(i){let t,e,n,s;return P(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Os(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function Rs(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let a,r,l,c;if(t===null)return;let h=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(h=!0,n.all)continue;break}c=i.values[l],j(c)&&(o||t===0||bt(t)===bt(c))&&(t+=c)}return!h&&!n.all?0:t}function _c(i,t){const{iScale:e,vScale:n}=t,s=e.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",a=Object.keys(i),r=new Array(a.length);let l,c,h;for(l=0,c=a.length;l<c;++l)h=a[l],r[l]={[s]:h,[o]:i[h]};return r}function qi(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function $c(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function th(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function eh(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function Ns(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Vs(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,c=a.axis,h=$c(o,a,n),A=t.length;let d;for(let u=0;u<A;++u){const f=t[u],{[l]:p,[c]:b}=f,M=f._stacks||(f._stacks={});d=M[c]=eh(s,h,p),d[r]=b,d._top=Ns(d,a,!0,n.type),d._bottom=Ns(d,a,!1,n.type);const D=d._visualValues||(d._visualValues={});D[r]=b}}function _i(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function ih(i,t){return Ht(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function nh(i,t,e){return Ht(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Se(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const $i=i=>i==="reset"||i==="none",Hs=(i,t)=>t?i:Object.assign({},i),sh=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Os(e,!0),values:null};class jt{static defaults={};static datasetElementType=null;static dataElementType=null;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=qi(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&&Se(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(A,d,u,f)=>A==="x"?d:A==="r"?f:u,o=e.xAxisID=I(n.xAxisID,_i(t,"x")),a=e.yAxisID=I(n.yAxisID,_i(t,"y")),r=e.rAxisID=I(n.rAxisID,_i(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),h=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),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&&is(this._data,this),t._stacked&&Se(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(P(e)){const s=this._cachedMeta;this._data=_c(e,s)}else if(n!==e){if(n){is(n,this);const s=this._cachedMeta;Se(s),s._parsed=[]}e&&Object.isExtensible(e)&&Hl(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,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=qi(e.vScale,e),e.stack!==n.stack&&(s=!0,Se(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Vs(this,e._parsed),e._stacked=qi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,r=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,A,d;if(this._parsing===!1)n._parsed=s,n._sorted=!0,d=s;else{V(s[t])?d=this.parseArrayData(n,s,t,e):P(s[t])?d=this.parseObjectData(n,s,t,e):d=this.parsePrimitiveData(n,s,t,e);const u=()=>A[r]===null||c&&A[r]<c[r];for(h=0;h<e;++h)n._parsed[h+t]=A=d[h],l&&(u()&&(l=!1),c=A);n._sorted=l}a&&Vs(this,d)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,A=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+n,A[d]={[r]:h||o.parse(c[f],f),[l]:a.parse(e[f],f)};return A}parseArrayData(t,e,n,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,h,A;for(l=0,c=s;l<c;++l)h=l+n,A=e[h],r[l]={x:o.parse(A[0],h),y:a.parse(A[1],h)};return r}parseObjectData(t,e,n,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,A,d,u;for(h=0,A=s;h<A;++h)d=h+n,u=e[d],c[h]={x:o.parse(Rt(u,r),d),y:a.parse(Rt(u,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:Os(s,!0),values:e._stacks[t.axis]._visualValues};return Rs(r,a,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let a=o===null?NaN:o;const r=s&&n._stacks[e.axis];s&&r&&(s.values=r,a=Rs(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,a=s.length,r=this._getOtherScale(t),l=sh(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:A}=th(r);let d,u;function f(){u=s[d];const p=u[r.axis];return!j(u[t.axis])||h>p||A<p}for(d=0;d<a&&!(!f()&&(this.updateRangeFromParsed(c,t,u,l),o));++d);if(o){for(d=a-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],j(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=qc(I(this.options.clip,Jc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const A=s[h];A.hidden||(A.active&&c?a.push(A):A.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=nh(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=ih(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,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",n){const s=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&Ye(n);if(r)return Hs(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),A=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),u=Object.keys(H.elements[t]),f=()=>this.getContext(n,s,e),p=c.resolveNamedOptions(d,u,f,A);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(Hs(p,l))),p}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const h=this.chart.config,A=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),A);l=h.createResolver(d,this.getContext(t,n,e))}const c=new Ls(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||$i(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:a}}updateElement(t,e,n,s){$i(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!$i(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=n.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&Se(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}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 n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function oh(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,o=e.length;s<o;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=ns(n.sort((s,o)=>s-o))}return i._cache.$bar}function ah(i){const t=i.iScale,e=oh(t,i.type);let n=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(Ye(r)&&(n=Math.min(n,Math.abs(a-r)||n)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return n}function rh(i,t,e,n){const s=e.barThickness;let o,a;return Q(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*n,a=1),{chunk:o/n,ratio:a,start:t.pixels[i]-o/2}}function lh(i,t,e,n){const s=t.pixels,o=s[i];let a=i>0?s[i-1]:null,r=i<s.length-1?s[i+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/n,ratio:e.barPercentage,start:c}}function ch(i,t,e,n){const s=e.parse(i[0],n),o=e.parse(i[1],n),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function Fs(i,t,e,n){return V(i)?ch(i,t,e,n):t[e.axis]=e.parse(i,n),t}function js(i,t,e,n){const s=i.iScale,o=i.vScale,a=s.getLabels(),r=s===o,l=[];let c,h,A,d;for(c=e,h=e+n;c<h;++c)d=t[c],A={},A[s.axis]=r||s.parse(a[c],c),l.push(Fs(d,A,o,c));return l}function tn(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function hh(i,t,e){return i!==0?bt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Ah(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:n,reverse:t,top:s,bottom:o}}function dh(i,t,e,n){let s=t.borderSkipped;const o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:h}=Ah(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=h:(o[Ws(h,a,r,l)]=!0,s=c)),o[Ws(s,a,r,l)]=!0,i.borderSkipped=o}function Ws(i,t,e,n){return n?(i=uh(i,t,e),i=Zs(i,e,t)):i=Zs(i,t,e),i}function uh(i,t,e){return i===t?e:i===e?t:i}function Zs(i,t,e){return i==="start"?t:i==="end"?e:i}function gh(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class fh extends jt{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,n,s){return js(t,e,n,s)}parseArrayData(t,e,n,s){return js(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,h=a.axis==="x"?r:l,A=[];let d,u,f,p;for(d=n,u=n+s;d<u;++d)p=e[d],f={},f[o.axis]=o.parse(Rt(p,c),d),A.push(Fs(Rt(p,h),f,a,d));return A}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const o=n._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:n,vScale:s}=e,o=this.getParsed(t),a=o._custom,r=tn(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:r}}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,n,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:A,includeOptions:d}=this._getSharedOptions(e,s);for(let u=e;u<e+n;u++){const f=this.getParsed(u),p=o||Q(f[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(u),b=this._calculateBarIndexPixels(u,h),M=(f._stacks||{})[r.axis],D={horizontal:c,base:p.base,enableBorderRadius:!M||tn(f._custom)||a===M._top||a===M._bottom,x:c?p.head:b.center,y:c?b.center:p.head,height:c?b.size:Math.abs(p.size),width:c?Math.abs(p.size):b.size};d&&(D.options=A||this.resolveDataElementOptions(u,t[u].active?"active":s));const x=D.options||t[u].options;dh(D,x,M,a),gh(D,x,h.ratio),this.updateElement(t[u],u,D,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=n.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[n.axis],c=h=>{const A=h._parsed.find(u=>u[n.axis]===l),d=A&&A[h.vScale.axis];if(Q(d)||isNaN(d))return!0};for(const h of s)if(!(e!==void 0&&c(h))&&((o===!1||a.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const n of this.chart.data.datasets)t[I(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const r=t.barThickness;return{min:r||ah(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=tn(c);let A=l[e.axis],d=0,u=n?this.applyStack(e,l,n):A,f,p;u!==A&&(d=u-A,u=A),h&&(A=c.barStart,u=c.barEnd-c.barStart,A!==0&&bt(A)!==bt(c.barEnd)&&(d=0),d+=A);const b=!Q(o)&&!h?o:d;let M=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?f=e.getPixelForValue(d+u):f=M,p=f-M,Math.abs(p)<a){p=hh(p,e,r)*a,A===r&&(M-=p/2);const D=e.getPixelForDecimal(0),x=e.getPixelForDecimal(1),B=Math.min(D,x),G=Math.max(D,x);M=Math.max(Math.min(M,G),B),f=M+p,n&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(f)-e.getValueForPixel(M))}if(M===e.getPixelForValue(r)){const D=bt(p)*e.getLineWidthForValue(r)/2;M+=D,p-=D}return{size:p,base:M,head:f,center:f+p/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,o=s.skipNull,a=I(s.maxBarThickness,1/0);let r,l;const c=this._getAxisCount();if(e.grouped){const h=o?this._getStackCount(t):e.stackCount,A=s.barThickness==="flex"?lh(t,e,s,h*c):rh(t,e,s,h*c),d=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,u=this._getAxis().indexOf(I(d,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+u;r=A.start+A.chunk*f+A.chunk/2,l=Math.min(a,A.chunk*A.ratio)}else r=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}}class ph extends jt{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const o=super.parsePrimitiveData(t,e,n,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+n).radius;return o}parseArrayData(t,e,n,s){const o=super.parseArrayData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=I(r[2],this.resolveDataElementOptions(a+n).radius)}return o}parseObjectData(t,e,n,s){const o=super.parseObjectData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=I(r&&r.r&&+r.r,this.resolveDataElementOptions(a+n).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:n[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=a.axis,A=r.axis;for(let d=e;d<e+n;d++){const u=t[d],f=!o&&this.getParsed(d),p={},b=p[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(f[h]),M=p[A]=o?r.getBasePixel():r.getPixelForValue(f[A]);p.skip=isNaN(b)||isNaN(M),c&&(p.options=l||this.resolveDataElementOptions(d,u.active?"active":s),o&&(p.options.radius=0)),this.updateElement(u,d,p,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=I(n&&n._custom,o),s}}function wh(i,t,e){let n=1,s=1,o=0,a=0;if(t<N){const r=i,l=r+t,c=Math.cos(r),h=Math.sin(r),A=Math.cos(l),d=Math.sin(l),u=(x,B,G)=>Ie(x,r,l,!0)?1:Math.max(B,B*e,G,G*e),f=(x,B,G)=>Ie(x,r,l,!0)?-1:Math.min(B,B*e,G,G*e),p=u(0,c,A),b=u(W,h,d),M=f(S,c,A),D=f(S+W,h,d);n=(p-M)/2,s=(b-D)/2,o=-(p+M)/2,a=-(b+D)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:a}}class en extends jt{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const A=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:A.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:A.borderDash,lineDashOffset:A.borderDashOffset,lineJoin:A.borderJoinStyle,lineWidth:A.borderWidth,strokeStyle:A.borderColor,textAlign:s,pointStyle:n,borderRadius:a&&(r||A.borderRadius),index:c}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}};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 n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(P(n[t])){const{key:l="value"}=this._parsing;o=c=>+Rt(n[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return ft(this.options.rotation-90)}_getCircumference(){return ft(this.options.circumference)}_getRotationExtents(){let t=N,e=-N;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(Yl(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:A}=this._getRotationExtents(),{ratioX:d,ratioY:u,offsetX:f,offsetY:p}=wh(A,h,l),b=(n.width-a)/d,M=(n.height-a)/u,D=Math.max(Math.min(b,M)/2,0),x=Zn(this.options.radius,D),B=Math.max(x*l,0),G=(x-B)/this._getVisibleDatasetWeightTotal();this.offsetX=f*x,this.offsetY=p*x,s.total=this.calculateTotal(),this.outerRadius=x-G*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-G*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/N)}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,h=(r.left+r.right)/2,A=(r.top+r.bottom)/2,d=o&&c.animateScale,u=d?0:this.innerRadius,f=d?0:this.outerRadius,{sharedOptions:p,includeOptions:b}=this._getSharedOptions(e,s);let M=this._getRotation(),D;for(D=0;D<e;++D)M+=this._circumference(D,o);for(D=e;D<e+n;++D){const x=this._circumference(D,o),B=t[D],G={x:h+this.offsetX,y:A+this.offsetY,startAngle:M,endAngle:M+x,circumference:x,outerRadius:f,innerRadius:u};b&&(G.options=p||this.resolveDataElementOptions(D,B.active?"active":s)),M+=x,this.updateElement(B,D,G,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?N*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ke(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){a=n.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(I(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class mh extends jt{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=as(e,s,a);this._drawStart=r,this._drawCount=l,rs(e)&&(r=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},t),this.updateElements(s,r,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:A}=this._getSharedOptions(e,s),d=a.axis,u=r.axis,{spanGaps:f,segment:p}=this.options,b=Ae(f)?f:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||o||s==="none",D=e+n,x=t.length;let B=e>0&&this.getParsed(e-1);for(let G=0;G<x;++G){const v=t[G],y=M?v:{};if(G<e||G>=D){y.skip=!0;continue}const Y=this.getParsed(G),C=Q(Y[u]),E=y[d]=a.getPixelForValue(Y[d],G),k=y[u]=o||C?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,Y,l):Y[u],G);y.skip=isNaN(E)||isNaN(k)||C,y.stop=G>0&&Math.abs(Y[d]-B[d])>b,p&&(y.parsed=Y,y.raw=c.data[G]),A&&(y.options=h||this.resolveDataElementOptions(G,v.active?"active":s)),M||this.updateElement(v,G,y,s),B=Y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Us extends jt{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ke(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return Gs.bind(this)(t,e,n,s)}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((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),a=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,A=c.yCenter,d=c.getIndexAngle(0)-.5*S;let u=d,f;const p=360/this.countVisibleElements();for(f=0;f<e;++f)u+=this._computeAngle(f,s,p);for(f=e;f<e+n;f++){const b=t[f];let M=u,D=u+this._computeAngle(f,s,p),x=a.getDataVisibility(f)?c.getDistanceFromCenterForValue(this.getParsed(f).r):0;u=D,o&&(l.animateScale&&(x=0),l.animateRotate&&(M=D=d));const B={x:h,y:A,innerRadius:0,outerRadius:x,startAngle:M,endAngle:D,options:this.resolveDataElementOptions(f,b.active?"active":s)};this.updateElement(b,f,B,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?ft(this.resolveDataElementOptions(t,e).angle||n):0}}class bh extends en{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Mh extends jt{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return Gs.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(n,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=e;r<e+n;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),A=a?o.xCenter:h.x,d=a?o.yCenter:h.y,u={x:A,y:d,angle:h.angle,skip:isNaN(A)||isNaN(d),options:c};this.updateElement(l,r,u,s)}}}class Dh extends jt{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:n[t]||"",value:"("+r+", "+l+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=as(e,n,s);if(this._drawStart=o,this._drawCount=a,rs(e)&&(o=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=n;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),A=this.getSharedOptions(h),d=this.includeOptions(s,A),u=a.axis,f=r.axis,{spanGaps:p,segment:b}=this.options,M=Ae(p)?p:Number.POSITIVE_INFINITY,D=this.chart._animationsDisabled||o||s==="none";let x=e>0&&this.getParsed(e-1);for(let B=e;B<e+n;++B){const G=t[B],v=this.getParsed(B),y=D?G:{},Y=Q(v[f]),C=y[u]=a.getPixelForValue(v[u],B),E=y[f]=o||Y?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[f],B);y.skip=isNaN(C)||isNaN(E)||Y,y.stop=B>0&&Math.abs(v[u]-x[u])>M,b&&(y.parsed=v,y.raw=c.data[B]),d&&(y.options=A||this.resolveDataElementOptions(B,G.active?"active":s)),D||this.updateElement(G,B,y,s),x=v}this.updateSharedOptions(A,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,a)/2}}var Gh=Object.freeze({__proto__:null,BarController:fh,BubbleController:ph,DoughnutController:en,LineController:mh,PieController:bh,PolarAreaController:Us,RadarController:Mh,ScatterController:Dh});function se(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class nn{static override(t){Object.assign(nn.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return se()}parse(){return se()}format(){return se()}add(){return se()}diff(){return se()}startOf(){return se()}endOf(){return se()}}var Bh={_date:nn};function xh(i,t,e,n){const{controller:s,data:o,_sorted:a}=i,r=s._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const c=r._reversePixels?Nl:Yt;if(n){if(s._sharedOptions){const h=o[0],A=typeof h.getRange=="function"&&h.getRange(t);if(A){const d=c(o,t,e-A),u=c(o,t,e+A);return{lo:d.lo,hi:u.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:A}=s._cachedMeta,{_parsed:d}=i,u=d.slice(0,h.lo+1).reverse().findIndex(p=>!Q(p[A.axis]));h.lo-=Math.max(0,u);const f=d.slice(h.hi).findIndex(p=>!Q(p[A.axis]));h.hi+=Math.max(0,f)}return h}}return{lo:0,hi:o.length-1}}function hi(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:h}=o[r],{lo:A,hi:d}=xh(o[r],t,a,s);for(let u=A;u<=d;++u){const f=h[u];f.skip||n(f,c,u)}}}function vh(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,a=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function sn(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||hi(i,e,t,function(r,l,c){!s&&!Ct(r,i.chartArea,0)||r.inRange(t.x,t.y,n)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function yh(i,t,e,n){let s=[];function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],n),{angle:A}=ts(a,{x:t.x,y:t.y});Ie(A,c,h)&&s.push({element:a,datasetIndex:r,index:l})}return hi(i,e,t,o),s}function Yh(i,t,e,n,s,o){let a=[];const r=vh(e);let l=Number.POSITIVE_INFINITY;function c(h,A,d){const u=h.inRange(t.x,t.y,s);if(n&&!u)return;const f=h.getCenterPoint(s);if(!(!!o||i.isPointInArea(f))&&!u)return;const b=r(t,f);b<l?(a=[{element:h,datasetIndex:A,index:d}],l=b):b===l&&a.push({element:h,datasetIndex:A,index:d})}return hi(i,e,t,c),a}function on(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?yh(i,t,e,s):Yh(i,t,e,n,s,o)}function Ks(i,t,e,n,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return hi(i,e,t,(l,c,h)=>{l[a]&&l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,s))}),n&&!r?[]:o}var Ch={modes:{index(i,t,e,n){const s=ie(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?sn(i,s,o,n,a):on(i,s,o,!1,n,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,A=c.data[h];A&&!A.skip&&l.push({element:A,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?sn(i,s,o,n,a):on(i,s,o,!1,n,a);if(r.length>0){const l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(i,t,e,n){const s=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return sn(i,s,o,n,a)},nearest(i,t,e,n){const s=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return on(i,s,o,e.intersect,n,a)},x(i,t,e,n){const s=ie(t,i);return Ks(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=ie(t,i);return Ks(i,s,"y",e.intersect,n)}}};const Xs=["left","top","right","bottom"];function Le(i,t){return i.filter(e=>e.pos===t)}function Js(i,t){return i.filter(e=>Xs.indexOf(e.pos)===-1&&e.box.axis===t)}function ze(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Ih(i){const t=[];let e,n,s,o,a,r;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function Eh(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!Xs.includes(s))continue;const a=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function kh(i,t){const e=Eh(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*n:l&&t.availableWidth,r.height=s):(r.width=n,r.height=h?h*s:l&&t.availableHeight)}return e}function Qh(i){const t=Ih(i),e=ze(t.filter(c=>c.box.fullSize),!0),n=ze(Le(t,"left"),!0),s=ze(Le(t,"right")),o=ze(Le(t,"top"),!0),a=ze(Le(t,"bottom")),r=Js(t,"x"),l=Js(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Le(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function qs(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function _s(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 Ph(i,t,e,n){const{pos:s,box:o}=e,a=i.maxPadding;if(!P(s)){e.size&&(i[s]-=e.size);const A=n[e.stack]||{size:0,count:1};A.size=Math.max(A.size,e.horizontal?o.height:o.width),e.size=A.size/A.count,i[s]+=e.size}o.getPadding&&_s(a,o.getPadding());const r=Math.max(0,t.outerWidth-qs(a,i,"left","right")),l=Math.max(0,t.outerHeight-qs(a,i,"top","bottom")),c=r!==i.w,h=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Th(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Sh(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return n(i?["left","right"]:["top","bottom"])}function Oe(i,t,e,n){const s=[];let o,a,r,l,c,h;for(o=0,a=i.length,c=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Sh(r.horizontal,t));const{same:A,other:d}=Ph(t,e,r,n);c|=A&&s.length,h=h||d,l.fullSize||s.push(r)}return c&&Oe(s,t,e,n)||h}function Ai(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function $s(i,t,e,n){const s=e.padding;let{x:o,y:a}=t;for(const r of i){const l=r.box,c=n[r.stack]||{placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const A=t.w*h,d=c.size||l.height;Ye(c.start)&&(a=c.start),l.fullSize?Ai(l,s.left,a,e.outerWidth-s.right-s.left,d):Ai(l,t.left+c.placed,a,A,d),c.start=a,c.placed+=A,a=l.bottom}else{const A=t.h*h,d=c.size||l.width;Ye(c.start)&&(o=c.start),l.fullSize?Ai(l,o,s.top,d,e.outerHeight-s.bottom-s.top):Ai(l,o,t.top+c.placed,d,A),c.start=o,c.placed+=A,o=l.right}}t.x=o,t.y=a}var tt={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,n){if(!i)return;const s=$(i.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=Qh(i.boxes),l=r.vertical,c=r.horizontal;z(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,b)=>b.box.options&&b.box.options.display===!1?p:p+1,0)||1,A=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),d=Object.assign({},s);_s(d,$(n));const u=Object.assign({maxPadding:d,w:o,h:a,x:s.left,y:s.top},s),f=kh(l.concat(c),A);Oe(r.fullSize,u,A,f),Oe(l,u,A,f),Oe(c,u,A,f)&&Oe(l,u,A,f),Th(u),$s(r.leftAndTop,u,A,f),u.x+=u.w,u.y+=u.h,$s(r.rightAndBottom,u,A,f),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},z(r.chartArea,p=>{const b=p.box;Object.assign(b,i.chartArea),b.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class to{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Lh extends to{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const di="$chartjs",zh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},eo=i=>i===null||i==="";function Oh(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[di]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",eo(s)){const o=vs(i,"width");o!==void 0&&(i.width=o)}if(eo(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=vs(i,"height");o!==void 0&&(i.height=o)}return i}const io=Pc?{passive:!0}:!1;function Rh(i,t,e){i&&i.addEventListener(t,e,io)}function Nh(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,io)}function Vh(i,t){const e=zh[i.type]||i.type,{x:n,y:s}=ie(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function ui(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Hh(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ui(r.addedNodes,n),a=a&&!ui(r.removedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Fh(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ui(r.removedNodes,n),a=a&&!ui(r.addedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Re=new Map;let no=0;function so(){const i=window.devicePixelRatio;i!==no&&(no=i,Re.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function jh(i,t){Re.size||window.addEventListener("resize",so),Re.set(i,t)}function Wh(i){Re.delete(i),Re.size||window.removeEventListener("resize",so)}function Zh(i,t,e){const n=i.canvas,s=n&&Ji(n);if(!s)return;const o=os((r,l)=>{const c=s.clientWidth;e(r,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(s),jh(i,o),a}function an(i,t,e){e&&e.disconnect(),t==="resize"&&Wh(i)}function Uh(i,t,e){const n=i.canvas,s=os(o=>{i.ctx!==null&&e(Vh(o,i))},i);return Rh(n,t,s),s}class Kh extends to{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Oh(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[di])return!1;const n=e[di].initial;["height","width"].forEach(o=>{const a=n[o];Q(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[di],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Hh,detach:Fh,resize:Zh}[e]||Uh;s[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:an,detach:an,resize:an}[e]||Nh)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Qc(t,e,n,s)}isAttached(t){const e=t&&Ji(t);return!!(e&&e.isConnected)}}function Xh(i){return!Xi()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Lh:Kh}class Et{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Ae(this.x)&&Ae(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}function Jh(i,t){const e=i.options.ticks,n=qh(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?$h(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return tA(t,c,o,a/s),c;const h=_h(o,t,s);if(a>0){let A,d;const u=a>1?Math.round((l-r)/(a-1)):null;for(gi(t,c,h,Q(u)?0:r-u,r),A=0,d=a-1;A<d;A++)gi(t,c,h,o[A],o[A+1]);return gi(t,c,h,l,Q(u)?t.length:l+u),c}return gi(t,c,h),c}function qh(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function _h(i,t,e){const n=eA(i),s=t.length/e;if(!n)return Math.max(s,1);const o=Sl(n);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function $h(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function tA(i,t,e,n){let s=0,o=e[0],a;for(n=Math.ceil(n),a=0;a<i.length;a++)a===o&&(t.push(i[a]),s++,o=e[s*n])}function gi(i,t,e,n,s){const o=I(n,0),a=Math.min(I(s,i.length),i.length);let r=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(i[c]),r++,h=Math.round(o+r*e))}function eA(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const iA=i=>i==="left"?"right":i==="right"?"left":i,oo=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,ao=(i,t)=>Math.min(t||i,i);function ro(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function nA(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,a=i._endPixel,r=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-o,a-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function sA(i,t){z(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function Ne(i){return i.drawTicks?i.tickLength:0}function lo(i,t){if(!i.display)return 0;const e=U(i.font,t),n=$(i.padding);return(V(i.text)?i.text.length:1)*e.lineHeight+n.height}function oA(i,t){return Ht(i,{scale:t,type:"scale"})}function aA(i,t,e){return Ht(i,{tick:e,index:t,type:"tick"})}function rA(i,t,e){let n=Ri(i);return(e&&t!=="right"||!e&&t==="right")&&(n=iA(n)),n}function lA(i,t,e,n){const{top:s,left:o,bottom:a,right:r,chart:l}=i,{chartArea:c,scales:h}=l;let A=0,d,u,f;const p=a-s,b=r-o;if(i.isHorizontal()){if(u=_(n,o,r),P(e)){const M=Object.keys(e)[0],D=e[M];f=h[M].getPixelForValue(D)+p-t}else e==="center"?f=(c.bottom+c.top)/2+p-t:f=oo(i,e,t);d=r-o}else{if(P(e)){const M=Object.keys(e)[0],D=e[M];u=h[M].getPixelForValue(D)-b+t}else e==="center"?u=(c.left+c.right)/2-b+t:u=oo(i,e,t);f=_(n,a,s),A=e==="left"?-W:W}return{titleX:u,titleY:f,maxWidth:d,rotation:A}}class oe extends Et{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:s}=this;return t=lt(t,Number.POSITIVE_INFINITY),e=lt(e,Number.NEGATIVE_INFINITY),n=lt(n,Number.POSITIVE_INFINITY),s=lt(s,Number.NEGATIVE_INFINITY),{min:lt(t,n),max:lt(e,s),minDefined:j(t),maxDefined:j(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:e,max:n};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(n=Math.max(n,a.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:lt(e,lt(n,e)),max:lt(n,lt(e,n))}}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(){R(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=hc(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?ro(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Jh(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,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){R(this.options.afterUpdate,[this])}beforeSetDimensions(){R(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(){R(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),R(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){R(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=R(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){R(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){R(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=ao(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),A=h.widest.width,d=h.highest.height,u=K(this.chart.width-A,0,this.maxWidth);r=t.offset?this.maxWidth/n:u/(n-1),A+6>r&&(r=u/(n-(t.offset?.5:1)),l=this.maxHeight-Ne(t.grid)-e.padding-lo(t.title,this.chart.options.font),c=Math.sqrt(A*A+d*d),a=Li(Math.min(Math.asin(K((h.highest.height+6)/r,-1,1)),Math.asin(K(l/c,-1,1))-Math.asin(K(d/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){R(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){R(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=lo(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ne(o)+l):(t.height=this.maxHeight,t.width=Ne(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:A,highest:d}=this._getLabelSizes(),u=n.padding*2,f=ft(this.labelRotation),p=Math.cos(f),b=Math.sin(f);if(r){const M=n.mirror?0:b*A.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+M+u)}else{const M=n.mirror?0:p*A.width+b*d.height;t.width=Math.min(this.maxWidth,t.width+M+u)}this._calculatePadding(c,h,b,p)}}this._handleMargins(),r?(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,n,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,A=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,u=0;l?c?(d=s*t.width,u=n*e.height):(d=n*t.height,u=s*e.width):o==="start"?u=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,u=e.width/2),this.paddingLeft=Math.max((d-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-A+a)*this.width/(this.width-A),0)}else{let h=e.height/2,A=t.height/2;o==="start"?(h=0,A=t.height):o==="end"&&(h=e.height,A=0),this.paddingTop=h+a,this.paddingBottom=A+a}}_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(){R(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,n;for(e=0,n=t.length;e<n;e++)Q(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=ro(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/ao(e,n));let c=0,h=0,A,d,u,f,p,b,M,D,x,B,G;for(A=0;A<e;A+=l){if(f=t[A].label,p=this._resolveTickFontOptions(A),s.font=b=p.string,M=o[b]=o[b]||{data:{},gc:[]},D=p.lineHeight,x=B=0,!Q(f)&&!V(f))x=ni(s,M.data,M.gc,x,f),B=D;else if(V(f))for(d=0,u=f.length;d<u;++d)G=f[d],!Q(G)&&!V(G)&&(x=ni(s,M.data,M.gc,x,G),B+=D);a.push(x),r.push(B),c=Math.max(x,c),h=Math.max(B,h)}sA(o,e);const v=a.indexOf(c),y=r.indexOf(h),Y=C=>({width:a[C]||0,height:r[C]||0});return{first:Y(0),last:Y(e-1),widest:Y(v),highest:Y(y),widths:a,heights:r}}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 Rl(this._alignToPixels?_t(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 n=e[t];return n.$context||(n.$context=aA(this.getContext(),t,n))}return this.$context||(this.$context=oA(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ft(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*n>r*s?r/n:l/s:l*s<r*n?l/n:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),A=this.ticks.length+(l?1:0),d=Ne(o),u=[],f=r.setContext(this.getContext()),p=f.display?f.width:0,b=p/2,M=function(F){return _t(n,F,p)};let D,x,B,G,v,y,Y,C,E,k,T,J;if(a==="top")D=M(this.bottom),y=this.bottom-d,C=D-b,k=M(t.top)+b,J=t.bottom;else if(a==="bottom")D=M(this.top),k=t.top,J=M(t.bottom)-b,y=D+b,C=this.top+d;else if(a==="left")D=M(this.right),v=this.right-d,Y=D-b,E=M(t.left)+b,T=t.right;else if(a==="right")D=M(this.left),E=t.left,T=M(t.right)-b,v=D+b,Y=this.left+d;else if(e==="x"){if(a==="center")D=M((t.top+t.bottom)/2+.5);else if(P(a)){const F=Object.keys(a)[0],Z=a[F];D=M(this.chart.scales[F].getPixelForValue(Z))}k=t.top,J=t.bottom,y=D+b,C=y+d}else if(e==="y"){if(a==="center")D=M((t.left+t.right)/2);else if(P(a)){const F=Object.keys(a)[0],Z=a[F];D=M(this.chart.scales[F].getPixelForValue(Z))}v=D-b,Y=v-d,E=t.left,T=t.right}const ct=I(s.ticks.maxTicksLimit,A),O=Math.max(1,Math.ceil(A/ct));for(x=0;x<A;x+=O){const F=this.getContext(x),Z=o.setContext(F),wt=r.setContext(F),et=Z.lineWidth,we=Z.color,Ci=wt.dash||[],me=wt.dashOffset,je=Z.tickWidth,le=Z.tickColor,We=Z.tickBorderDash||[],ce=Z.tickBorderDashOffset;B=nA(this,x,l),B!==void 0&&(G=_t(n,B,et),c?v=Y=E=T=G:y=C=k=J=G,u.push({tx1:v,ty1:y,tx2:Y,ty2:C,x1:E,y1:k,x2:T,y2:J,width:et,color:we,borderDash:Ci,borderDashOffset:me,tickWidth:je,tickColor:le,tickBorderDash:We,tickBorderDashOffset:ce}))}return this._ticksLength=A,this._borderValue=D,u}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:A}=o,d=Ne(n.grid),u=d+h,f=A?-h:u,p=-ft(this.labelRotation),b=[];let M,D,x,B,G,v,y,Y,C,E,k,T,J="middle";if(s==="top")v=this.bottom-f,y=this._getXAxisLabelAlignment();else if(s==="bottom")v=this.top+f,y=this._getXAxisLabelAlignment();else if(s==="left"){const O=this._getYAxisLabelAlignment(d);y=O.textAlign,G=O.x}else if(s==="right"){const O=this._getYAxisLabelAlignment(d);y=O.textAlign,G=O.x}else if(e==="x"){if(s==="center")v=(t.top+t.bottom)/2+u;else if(P(s)){const O=Object.keys(s)[0],F=s[O];v=this.chart.scales[O].getPixelForValue(F)+u}y=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")G=(t.left+t.right)/2-u;else if(P(s)){const O=Object.keys(s)[0],F=s[O];G=this.chart.scales[O].getPixelForValue(F)}y=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?J="top":l==="end"&&(J="bottom"));const ct=this._getLabelSizes();for(M=0,D=r.length;M<D;++M){x=r[M],B=x.label;const O=o.setContext(this.getContext(M));Y=this.getPixelForTick(M)+o.labelOffset,C=this._resolveTickFontOptions(M),E=C.lineHeight,k=V(B)?B.length:1;const F=k/2,Z=O.color,wt=O.textStrokeColor,et=O.textStrokeWidth;let we=y;a?(G=Y,y==="inner"&&(M===D-1?we=this.options.reverse?"left":"right":M===0?we=this.options.reverse?"right":"left":we="center"),s==="top"?c==="near"||p!==0?T=-k*E+E/2:c==="center"?T=-ct.highest.height/2-F*E+E:T=-ct.highest.height+E/2:c==="near"||p!==0?T=E/2:c==="center"?T=ct.highest.height/2-F*E:T=ct.highest.height-k*E,A&&(T*=-1),p!==0&&!O.showLabelBackdrop&&(G+=E/2*Math.sin(p))):(v=Y,T=(1-k)*E/2);let Ci;if(O.showLabelBackdrop){const me=$(O.backdropPadding),je=ct.heights[M],le=ct.widths[M];let We=T-me.top,ce=0-me.left;switch(J){case"middle":We-=je/2;break;case"bottom":We-=je;break}switch(y){case"center":ce-=le/2;break;case"right":ce-=le;break;case"inner":M===D-1?ce-=le:M>0&&(ce-=le/2);break}Ci={left:ce,top:We,width:le+me.width,height:je+me.height,color:O.backdropColor}}b.push({label:B,font:C,textOffset:T,options:{rotation:p,color:Z,strokeColor:wt,strokeWidth:et,textAlign:we,textBaseline:J,translation:[G,v],backdrop:Ci}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ft(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,n==="near"?c="left":n==="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:n,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({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:n,grid:s}}=this,o=n.setContext(this.getContext()),a=n.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,A,d;this.isHorizontal()?(c=_t(t,this.left,a)-a/2,h=_t(t,this.right,r)+r/2,A=d=l):(A=_t(t,this.top,a)-a/2,d=_t(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,A),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&si(n,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,h=a.textOffset;$t(n,c,0,h,l,r)}s&&oi(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=U(n.font),a=$(n.padding),r=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||P(e)?(l+=a.bottom,V(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:A,rotation:d}=lA(this,l,e,r);$t(t,n.text,0,0,o,{color:n.color,maxWidth:A,rotation:d,textAlign:rA(r,e,s),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,n=I(t.grid&&t.grid.z,-1),s=I(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==oe.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[n]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return U(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class fi{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,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 n;AA(e)&&(n=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,cA(t,a,n),this.override&&H.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in H[s]&&(delete H[s][n],this.override&&delete qt[n])}}function cA(i,t,e){const n=ve(Object.create(null),[e?H.get(e):{},H.get(t),i.defaults]);H.set(t,n),i.defaultRoutes&&hA(t,i.defaultRoutes),i.descriptors&&H.describe(t,i.descriptors)}function hA(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");H.route(o,s,l,r)})}function AA(i){return"id"in i&&"defaults"in i}class dA{constructor(){this.controllers=new fi(jt,"datasets",!0),this.elements=new fi(Et,"elements"),this.plugins=new fi(Object,"plugins"),this.scales=new fi(oe,"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,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):z(s,a=>{const r=n||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,n){const s=Si(t);R(n["before"+s],[],n),e[t](n),R(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var Mt=new dA;class uA{constructor(){this._init=void 0}notify(t,e,n,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,n,s){s=s||{};for(const o of t){const a=o.plugin,r=a[n],l=[e,s,o.options];if(R(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){Q(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 n=t&&t.config,s=I(n.options&&n.options.plugins,{}),o=gA(n);return s===!1&&!e?[]:pA(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function gA(i){const t={},e=[],n=Object.keys(Mt.plugins.items);for(let o=0;o<n.length;o++)e.push(Mt.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function fA(i,t){return!t&&i===!1?null:i===!0?{}:i}function pA(i,{plugins:t,localIds:e},n,s){const o=[],a=i.getContext();for(const r of t){const l=r.id,c=fA(n[l],s);c!==null&&o.push({plugin:r,options:wA(i.config,{plugin:r,local:e[l]},c,a)})}return o}function wA(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(n,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function rn(i,t){const e=H.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function mA(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function bA(i,t){return i===t?"_index_":"_value_"}function co(i){if(i==="x"||i==="y"||i==="r")return i}function MA(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function ln(i,...t){if(co(i))return i;for(const e of t){const n=e.axis||MA(e.position)||i.length>1&&co(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function ho(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function DA(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return ho(i,"x",e[0])||ho(i,"y",e[0])}return{}}function GA(i,t){const e=qt[i.type]||{scales:{}},n=t.scales||{},s=rn(i.type,t),o=Object.create(null);return Object.keys(n).forEach(a=>{const r=n[a];if(!P(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=ln(a,r,DA(a,i),H.scales[r.type]),c=bA(l,s),h=e.scales||{};o[a]=ye(Object.create(null),[{axis:l},r,h[l],h[c]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||rn(r,t),h=(qt[r]||{}).scales||{};Object.keys(h).forEach(A=>{const d=mA(A,l),u=a[d+"AxisID"]||d;o[u]=o[u]||Object.create(null),ye(o[u],[{axis:d},n[u],h[A]])})}),Object.keys(o).forEach(a=>{const r=o[a];ye(r,[H.scales[r.type],H.scale])}),o}function Ao(i){const t=i.options||(i.options={});t.plugins=I(t.plugins,{}),t.scales=GA(i,t)}function uo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function BA(i){return i=i||{},i.data=uo(i.data),Ao(i),i}const go=new Map,fo=new Set;function pi(i,t){let e=go.get(i);return e||(e=t(),go.set(i,e),fo.add(e)),e}const Ve=(i,t,e)=>{const n=Rt(t,e);n!==void 0&&i.add(n)};class xA{constructor(t){this._config=BA(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=uo(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(),Ao(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return pi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return pi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return pi(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,a=this._cachedScopes(t,n),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(A=>Ve(l,t,A))),h.forEach(A=>Ve(l,s,A)),h.forEach(A=>Ve(l,qt[o]||{},A)),h.forEach(A=>Ve(l,H,A)),h.forEach(A=>Ve(l,Hi,A))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),fo.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,qt[e]||{},H.datasets[e]||{},{type:e},H,Hi]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=po(this._resolverCache,t,s);let l=a;if(yA(a,e)){o.$shared=!1,n=Nt(n)?n():n;const c=this.createResolver(t,n,r);l=de(a,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=po(this._resolverCache,t,n);return P(e)?de(o,e,void 0,s):o}}function po(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:Zi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o}const vA=i=>P(i)&&Object.getOwnPropertyNames(i).some(t=>Nt(i[t]));function yA(i,t){const{isScriptable:e,isIndexable:n}=ps(i);for(const s of t){const o=e(s),a=n(s),r=(a||o)&&i[s];if(o&&(Nt(r)||vA(r))||a&&V(r))return!0}return!1}var YA="4.5.1";const CA=["top","bottom","left","right","chartArea"];function wo(i,t){return i==="top"||i==="bottom"||CA.indexOf(i)===-1&&t==="x"}function mo(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function bo(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),R(e&&e.onComplete,[i],t)}function IA(i){const t=i.chart,e=t.options.animation;R(e&&e.onProgress,[i],t)}function Mo(i){return Xi()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const wi={},Do=i=>{const t=Mo(i);return Object.values(wi).filter(e=>e.canvas===t).pop()};function EA(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const a=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=a)}}}function kA(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}class cn{static defaults=H;static instances=wi;static overrides=qt;static registry=Mt;static version=YA;static getChart=Do;static register(...t){Mt.add(...t),Go()}static unregister(...t){Mt.remove(...t),Go()}constructor(t,e){const n=this.config=new xA(e),s=Mo(t),o=Do(s);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 a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Xh(s)),this.platform.updateConfig(n);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=yl(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,this._options=a,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 uA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Fl(A=>this.update(A),a.resizeDelay||0),this._dataChanges=[],wi[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}It.listen(this,"complete",bo),It.listen(this,"progress",IA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return Q(t)?e&&o?o:s?n/s: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 Mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():xs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return us(this.canvas,this.ctx),this}stop(){return It.stop(this),this}resize(t,e){It.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,xs(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),R(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};z(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=ln(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),z(o,a=>{const r=a.options,l=r.id,c=ln(l,r),h=I(r.type,a.dtype);(r.position===void 0||wo(r.position,c)!==wo(a.dposition))&&(r.position=a.dposition),s[l]=!0;let A=null;if(l in n&&n[l].type===h)A=n[l];else{const d=Mt.getScale(h);A=new d({id:l,type:h,ctx:this.ctx,chart:this}),n[A.id]=A}A.init(r,t)}),z(s,(a,r)=>{a||delete n[r]}),z(n,a=>{tt.configure(this,a,a.options),tt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(mo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let a=this.getDatasetMeta(n);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=r,a.indexAxis=o.indexAxis||rn(r,this.options),a.order=o.order||0,a.index=n,a.label=""+o.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const l=Mt.getController(r),{datasetElementType:c,dataElementType:h}=H.datasets[r];Object.assign(l,{dataElementType:Mt.getElement(h),datasetElementType:c&&Mt.getElement(c)}),a.controller=new l(this,n),t.push(a.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 n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.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 a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:A}=this.getDatasetMeta(c),d=!s&&o.indexOf(A)===-1;A.buildOrUpdateElements(d),a=Math.max(+A.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),s||z(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(mo("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){z(this.scales,t=>{tt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Xn(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const a=n==="_removeElements"?-o:o;EA(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!Xn(s,n(o)))return;return Array.from(s).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;tt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],z(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Nt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(It.has(this)?this.attached&&!It.running(this)&&It.start(this):(this.draw(),bo({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}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,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&n.push(a)}return n}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,n={meta:t,index:t.index,cancelable:!0},s=Ts(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&si(e,s),t.controller.draw(),s&&oi(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return Ct(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=Ch.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={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},n.push(s)),s}getContext(){return this.$context||(this.$context=Ht(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);Ye(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(r=>r.datasetIndex===t?s: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(),It.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(),us(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete wi[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,n=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};z(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",r)},e.isAttached(this.canvas)?r():a()}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,n){const s=n?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!_e(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(A=>h.datasetIndex===A.datasetIndex&&h.index===A.index)),a=o(e,t),r=n?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,n,a),l=Ql(t),c=kA(t,this._lastEvent,n,l);n&&(this._lastEvent=null,R(o.onHover,[t,r,this],this),l&&R(o.onClick,[t,r,this],this));const h=!_e(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function Go(){return z(cn.instances,i=>i._plugins.invalidate())}function QA(i,t,e){const{startAngle:n,x:s,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,A=Math.min(c/a,q(n-e));if(i.beginPath(),i.arc(s,o,a-c/2,n+A/2,e-A/2),r>0){const d=Math.min(c/r,q(n-e));i.arc(s,o,r+c/2,e-d/2,n+d/2,!0)}else{const d=Math.min(c/2,a*q(n-e));if(h==="round")i.arc(s,o,d,e-S/2,n+S/2,!0);else if(h==="bevel"){const u=2*d*d,f=-u*Math.cos(e+S/2)+s,p=-u*Math.sin(e+S/2)+o,b=u*Math.cos(n+S/2)+s,M=u*Math.sin(n+S/2)+o;i.lineTo(f,p),i.lineTo(b,M)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function PA(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;i.beginPath(),i.arc(o,a,r,n-c,e+c),l>s?(c=s/l,i.arc(o,a,l,e+c,n-c,!0)):i.arc(o,a,s,e+W,n-W),i.closePath(),i.clip()}function TA(i){return Wi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function SA(i,t,e,n){const s=TA(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,n*t/2),r=l=>{const c=(e-Math.min(o,l))*n/2;return K(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:K(s.innerStart,0,a),innerEnd:K(s.innerEnd,0,a)}}function fe(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function mi(i,t,e,n,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,A=Math.max(t.outerRadius+n+e-c,0),d=h>0?h+n+e+c:0;let u=0;const f=s-l;if(n){const O=h>0?h-n:0,F=A>0?A-n:0,Z=(O+F)/2,wt=Z!==0?f*Z/(Z+n):f;u=(f-wt)/2}const p=Math.max(.001,f*A-e/S)/A,b=(f-p)/2,M=l+b+u,D=s-b-u,{outerStart:x,outerEnd:B,innerStart:G,innerEnd:v}=SA(t,d,A,D-M),y=A-x,Y=A-B,C=M+x/y,E=D-B/Y,k=d+G,T=d+v,J=M+G/k,ct=D-v/T;if(i.beginPath(),o){const O=(C+E)/2;if(i.arc(a,r,A,C,O),i.arc(a,r,A,O,E),B>0){const et=fe(Y,E,a,r);i.arc(et.x,et.y,B,E,D+W)}const F=fe(T,D,a,r);if(i.lineTo(F.x,F.y),v>0){const et=fe(T,ct,a,r);i.arc(et.x,et.y,v,D+W,ct+Math.PI)}const Z=(D-v/d+(M+G/d))/2;if(i.arc(a,r,d,D-v/d,Z,!0),i.arc(a,r,d,Z,M+G/d,!0),G>0){const et=fe(k,J,a,r);i.arc(et.x,et.y,G,J+Math.PI,M-W)}const wt=fe(y,M,a,r);if(i.lineTo(wt.x,wt.y),x>0){const et=fe(y,C,a,r);i.arc(et.x,et.y,x,M-W,C)}}else{i.moveTo(a,r);const O=Math.cos(C)*A+a,F=Math.sin(C)*A+r;i.lineTo(O,F);const Z=Math.cos(E)*A+a,wt=Math.sin(E)*A+r;i.lineTo(Z,wt)}i.closePath()}function LA(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){mi(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(r)||(l=a+(r%N||N))}return mi(i,t,e,n,l,s),i.fill(),l}function zA(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:A,borderDashOffset:d,borderRadius:u}=l,f=l.borderAlign==="inner";if(!c)return;i.setLineDash(A||[]),i.lineDashOffset=d,f?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let p=t.endAngle;if(o){mi(i,t,e,n,p,s);for(let b=0;b<o;++b)i.stroke();isNaN(r)||(p=a+(r%N||N))}f&&PA(i,t,p),l.selfJoin&&p-a>=S&&u===0&&h!=="miter"&&QA(i,t,p),o||(mi(i,t,e,n,p,s),i.stroke())}class OA extends Et{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;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,n){const s=this.getProps(["x","y"],n),{angle:o,distance:a}=ts(s,{x:t,y:e}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:A}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=(this.options.spacing+this.options.borderWidth)/2,u=I(A,l-r),f=Ie(o,r,l)&&r!==l,p=u>=N||f,b=yt(a,c+d,h+d);return p&&b}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(s+o)/2,A=(a+r+c+l)/2;return{x:e+Math.cos(h)*A,y:n+Math.sin(h)*A}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>N?Math.floor(n/N):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const l=1-Math.sin(Math.min(S,n||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,LA(t,this,c,o,a),zA(t,this,c,o,a),t.restore()}}function Bo(i,t,e=t){i.lineCap=I(e.borderCapStyle,t.borderCapStyle),i.setLineDash(I(e.borderDash,t.borderDash)),i.lineDashOffset=I(e.borderDashOffset,t.borderDashOffset),i.lineJoin=I(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=I(e.borderWidth,t.borderWidth),i.strokeStyle=I(e.borderColor,t.borderColor)}function RA(i,t,e){i.lineTo(e.x,e.y)}function NA(i){return i.stepped?ec:i.tension||i.cubicInterpolationMode==="monotone"?ic:RA}function xo(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function VA(i,t,e,n){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=xo(s,e,n),h=NA(o);let{move:A=!0,reverse:d}=n||{},u,f,p;for(u=0;u<=c;++u)f=s[(r+(d?c-u:u))%a],!f.skip&&(A?(i.moveTo(f.x,f.y),A=!1):h(i,p,f,d,o.stepped),p=f);return l&&(f=s[(r+(d?c:0))%a],h(i,p,f,d,o.stepped)),!!l}function HA(i,t,e,n){const s=t.points,{count:o,start:a,ilen:r}=xo(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,A=0,d,u,f,p,b,M;const D=B=>(a+(c?r-B:B))%o,x=()=>{p!==b&&(i.lineTo(h,b),i.lineTo(h,p),i.lineTo(h,M))};for(l&&(u=s[D(0)],i.moveTo(u.x,u.y)),d=0;d<=r;++d){if(u=s[D(d)],u.skip)continue;const B=u.x,G=u.y,v=B|0;v===f?(G<p?p=G:G>b&&(b=G),h=(A*h+B)/++A):(x(),i.lineTo(B,G),f=v,A=0,p=b=G),M=G}x()}function hn(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?HA:VA}function FA(i){return i.stepped?Tc:i.tension||i.cubicInterpolationMode==="monotone"?Sc:ne}function jA(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Bo(i,t.options),i.stroke(s)}function WA(i,t,e,n){const{segments:s,options:o}=t,a=hn(t);for(const r of s)Bo(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const ZA=typeof Path2D=="function";function UA(i,t,e,n){ZA&&!t.options.segment?jA(i,t,e,n):WA(i,t,e,n)}class bi extends Et{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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 n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;yc(this._points,n,t,s,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=Vc(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,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,a=ks(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=FA(n);let c,h;for(c=0,h=a.length;c<h;++c){const{start:A,end:d}=a[c],u=o[A],f=o[d];if(u===f){r.push(u);continue}const p=Math.abs((s-u[e])/(f[e]-u[e])),b=l(u,f,p,n.stepped);b[e]=t[e],r.push(b)}return r.length===1?r[0]:r}pathSegment(t,e,n){return hn(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=hn(this);let a=this._loop;e=e||0,n=n||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+n-1});return!!a}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),UA(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function vo(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class KA extends Et{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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,n){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return vo(this,t,"x",e)}inYRange(t,e){return vo(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!Ct(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,ji(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function yo(i,t){const{x:e,y:n,base:s,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,l,c,h,A;return i.horizontal?(A=a/2,r=Math.min(e,s),l=Math.max(e,s),c=n-A,h=n+A):(A=o/2,r=e-A,l=e+A,c=Math.min(n,s),h=Math.max(n,s)),{left:r,top:c,right:l,bottom:h}}function Wt(i,t,e,n){return i?0:K(t,e,n)}function XA(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,o=fs(n);return{t:Wt(s.top,o.top,0,e),r:Wt(s.right,o.right,0,t),b:Wt(s.bottom,o.bottom,0,e),l:Wt(s.left,o.left,0,t)}}function JA(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=te(s),a=Math.min(t,e),r=i.borderSkipped,l=n||P(s);return{topLeft:Wt(!l||r.top||r.left,o.topLeft,0,a),topRight:Wt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Wt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Wt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function qA(i){const t=yo(i),e=t.right-t.left,n=t.bottom-t.top,s=XA(i,e/2,n/2),o=JA(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function An(i,t,e,n){const s=t===null,o=e===null,r=i&&!(s&&o)&&yo(i,n);return r&&(s||yt(t,r.left,r.right))&&(o||yt(e,r.top,r.bottom))}function _A(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function $A(i,t){i.rect(t.x,t.y,t.w,t.h)}function dn(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-n,a=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+o,h:i.h+a,radius:i.radius}}class td extends Et{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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:n,backgroundColor:s}}=this,{inner:o,outer:a}=qA(this),r=_A(a.radius)?Pe:$A;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,dn(a,e,o)),t.clip(),r(t,dn(o,-e,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),r(t,dn(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return An(this,t,e,n)}inXRange(t,e){return An(this,t,null,e)}inYRange(t,e){return An(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var ed=Object.freeze({__proto__:null,ArcElement:OA,BarElement:td,LineElement:bi,PointElement:KA});const un=["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)"],Yo=un.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Co(i){return un[i%un.length]}function Io(i){return Yo[i%Yo.length]}function id(i,t){return i.borderColor=Co(t),i.backgroundColor=Io(t),++t}function nd(i,t){return i.backgroundColor=i.data.map(()=>Co(t++)),t}function sd(i,t){return i.backgroundColor=i.data.map(()=>Io(t++)),t}function od(i){let t=0;return(e,n)=>{const s=i.getDatasetMeta(n).controller;s instanceof en?t=nd(e,t):s instanceof Us?t=sd(e,t):s&&(t=id(e,t))}}function Eo(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function ad(i){return i&&(i.borderColor||i.backgroundColor)}function rd(){return H.borderColor!=="rgba(0,0,0,0.1)"||H.backgroundColor!=="rgba(0,0,0,0.1)"}var ld={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:n},options:s}=i.config,{elements:o}=s,a=Eo(n)||ad(s)||o&&Eo(o)||rd();if(!e.forceOverride&&a)return;const r=od(i);n.forEach(r)}};function cd(i,t,e,n,s){const o=s.samples||n;if(o>=e)return i.slice(t,t+e);const a=[],r=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,A,d,u,f,p;for(a[l++]=i[h],A=0;A<o-2;A++){let b=0,M=0,D;const x=Math.floor((A+1)*r)+1+t,B=Math.min(Math.floor((A+2)*r)+1,e)+t,G=B-x;for(D=x;D<B;D++)b+=i[D].x,M+=i[D].y;b/=G,M/=G;const v=Math.floor(A*r)+1+t,y=Math.min(Math.floor((A+1)*r)+1,e)+t,{x:Y,y:C}=i[h];for(u=f=-1,D=v;D<y;D++)f=.5*Math.abs((Y-b)*(i[D].y-C)-(Y-i[D].x)*(M-C)),f>u&&(u=f,d=i[D],p=D);a[l++]=d,h=p}return a[l++]=i[c],a}function hd(i,t,e,n){let s=0,o=0,a,r,l,c,h,A,d,u,f,p;const b=[],M=t+e-1,D=i[t].x,B=i[M].x-D;for(a=t;a<t+e;++a){r=i[a],l=(r.x-D)/B*n,c=r.y;const G=l|0;if(G===h)c<f?(f=c,A=a):c>p&&(p=c,d=a),s=(o*s+r.x)/++o;else{const v=a-1;if(!Q(A)&&!Q(d)){const y=Math.min(A,d),Y=Math.max(A,d);y!==u&&y!==v&&b.push({...i[y],x:s}),Y!==u&&Y!==v&&b.push({...i[Y],x:s})}a>0&&v!==u&&b.push(i[v]),b.push(r),h=G,o=0,f=p=c,A=d=u=a}}return b}function ko(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 Qo(i){i.data.datasets.forEach(t=>{ko(t)})}function Ad(i,t){const e=t.length;let n=0,s;const{iScale:o}=i,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=K(Yt(t,o.axis,a).lo,0,e-1)),c?s=K(Yt(t,o.axis,r).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var dd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){Qo(i);return}const n=i.width;i.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=i.getDatasetMeta(o),c=a||s.data;if(Te([r,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:A,count:d}=Ad(l,c);const u=e.threshold||4*n;if(d<=u){ko(s);return}Q(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let f;switch(e.algorithm){case"lttb":f=cd(c,A,d,n,e);break;case"min-max":f=hd(c,A,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=f})},destroy(i){Qo(i)}};function ud(i,t,e){const n=i.segments,s=i.points,o=t.points,a=[];for(const r of n){let{start:l,end:c}=r;c=Mi(l,c,s);const h=gn(e,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[l],end:s[c]});continue}const A=ks(t,h);for(const d of A){const u=gn(e,o[d.start],o[d.end],d.loop),f=Es(r,s,u);for(const p of f)a.push({source:p,target:d,start:{[e]:Po(h,u,"start",Math.max)},end:{[e]:Po(h,u,"end",Math.min)}})}}return a}function gn(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=q(s),o=q(o)),{property:i,start:s,end:o}}function gd(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Mi(a,r,s);const l=s[a],c=s[r];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Mi(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Po(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function To(i,t){let e=[],n=!1;return V(i)?(n=!0,e=i):e=gd(i,t),e.length?new bi({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function So(i){return i&&i.fill!==!1}function fd(i,t,e){let s=i[t].fill;const o=[t];let a;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!j(s))return s;if(a=i[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function pd(i,t,e){const n=Md(i);if(P(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return j(s)&&Math.floor(s)===s?wd(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function wd(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function md(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:P(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function bd(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:P(i)?n=i.value:n=t.getBaseValue(),n}function Md(i){const t=i.options,e=t.fill;let n=I(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Dd(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,a=n.points,r=Gd(t,e);r.push(To({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Bd(s,a[h],r)}return new bi({points:s,options:{}})}function Gd(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Bd(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=xd(o,t,"x");if(!(!l||a&&r)){if(a)n.unshift(l);else if(i.push(l),!r)break}}i.push(...n)}function xd(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,a=i.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],A=a[h.start][e],d=a[h.end][e];if(yt(s,A,d)){r=s===A,l=s===d;break}}return{first:r,last:l,point:n}}class Lo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:N},t.arc(s,o,a,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function vd(i){const{chart:t,fill:e,line:n}=i;if(j(e))return yd(t,e);if(e==="stack")return Dd(i);if(e==="shape")return!0;const s=Yd(i);return s instanceof Lo?s:To(s,n)}function yd(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Yd(i){return(i.scale||{}).getPointPositionForValue?Id(i):Cd(i)}function Cd(i){const{scale:t={},fill:e}=i,n=md(e,t);if(j(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Id(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,a=bd(e,t,o),r=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new Lo({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function fn(i,t,e){const n=vd(t),{chart:s,index:o,line:a,scale:r,axis:l}=t,c=a.options,h=c.fill,A=c.backgroundColor,{above:d=A,below:u=A}=h||{},f=s.getDatasetMeta(o),p=Ts(s,f);n&&a.points.length&&(si(i,e),Ed(i,{line:a,target:n,above:d,below:u,area:e,scale:r,axis:l,clip:p}),oi(i))}function Ed(i,t){const{line:e,target:n,above:s,below:o,area:a,scale:r,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let h=o;o!==s&&(c==="x"?(zo(i,n,a.top),pn(i,{line:e,target:n,color:s,scale:r,property:c,clip:l}),i.restore(),i.save(),zo(i,n,a.bottom)):c==="y"&&(Oo(i,n,a.left),pn(i,{line:e,target:n,color:o,scale:r,property:c,clip:l}),i.restore(),i.save(),Oo(i,n,a.right),h=s)),pn(i,{line:e,target:n,color:h,scale:r,property:c,clip:l}),i.restore()}function zo(i,t,e){const{segments:n,points:s}=t;let o=!0,a=!1;i.beginPath();for(const r of n){const{start:l,end:c}=r,h=s[l],A=s[Mi(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(A.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Oo(i,t,e){const{segments:n,points:s}=t;let o=!0,a=!1;i.beginPath();for(const r of n){const{start:l,end:c}=r,h=s[l],A=s[Mi(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(e,h.y),i.lineTo(h.x,h.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(e,A.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function pn(i,t){const{line:e,target:n,property:s,color:o,scale:a,clip:r}=t,l=ud(e,n,s);for(const{source:c,target:h,start:A,end:d}of l){const{style:{backgroundColor:u=o}={}}=c,f=n!==!0;i.save(),i.fillStyle=u,kd(i,a,r,f&&gn(s,A,d)),i.beginPath();const p=!!e.pathSegment(i,c);let b;if(f){p?i.closePath():Ro(i,n,d,s);const M=!!n.pathSegment(i,h,{move:p,reverse:!0});b=p&&M,b||Ro(i,n,A,s)}i.closePath(),i.fill(b?"evenodd":"nonzero"),i.restore()}}function kd(i,t,e,n){const s=t.chart.chartArea,{property:o,start:a,end:r}=n||{};if(o==="x"||o==="y"){let l,c,h,A;o==="x"?(l=a,c=s.top,h=r,A=s.bottom):(l=s.left,c=a,h=s.right,A=r),i.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),A=Math.min(A,e.bottom)),i.rect(l,c,h-l,A-c),i.clip()}}function Ro(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var Qd={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<n;++a)o=i.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof bi&&(l={visible:i.isDatasetVisible(a),index:a,fill:pd(r,a,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<n;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=fd(s,a,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),n&&r.fill&&fn(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;So(o)&&fn(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!So(n)||e.drawTime!=="beforeDatasetDraw"||fn(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const No=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},Pd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Vo extends Et{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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=R(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,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 n=t.labels,s=U(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=No(n,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+r;let A=t;o.textAlign="left",o.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach((f,p)=>{const b=n+e/2+o.measureText(f.text).width;(p===0||c[c.length-1]+b+2*r>a)&&(A+=h,c[c.length-(p>0?0:1)]=0,u+=h,d++),l[p]={left:0,top:u,row:d,width:b,height:s},c[c.length-1]+=b+r}),A}_fitCols(t,e,n,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t;let A=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach((b,M)=>{const{itemWidth:D,itemHeight:x}=Td(n,e,o,b,s);M>0&&u+x+2*r>h&&(A+=d+r,c.push({width:d,height:u}),f+=d+r,p++,d=u=0),l[M]={left:f,top:u,col:p,width:D,height:x},d=Math.max(d,D),u+=x+r}),A+=d,c.push({width:d,height:u}),A}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,a=ge(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=_(n,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=_(n,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=_(n,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=_(n,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;si(t,this),this._draw(),oi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:a}=t,r=H.color,l=ge(t.rtl,this.left,this.width),c=U(a.font),{padding:h}=a,A=c.size,d=A/2;let u;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:f,boxHeight:p,itemHeight:b}=No(a,A),M=function(v,y,Y){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;s.save();const C=I(Y.lineWidth,1);if(s.fillStyle=I(Y.fillStyle,r),s.lineCap=I(Y.lineCap,"butt"),s.lineDashOffset=I(Y.lineDashOffset,0),s.lineJoin=I(Y.lineJoin,"miter"),s.lineWidth=C,s.strokeStyle=I(Y.strokeStyle,r),s.setLineDash(I(Y.lineDash,[])),a.usePointStyle){const E={radius:p*Math.SQRT2/2,pointStyle:Y.pointStyle,rotation:Y.rotation,borderWidth:C},k=l.xPlus(v,f/2),T=y+d;gs(s,E,k,T,a.pointStyleWidth&&f)}else{const E=y+Math.max((A-p)/2,0),k=l.leftForLtr(v,f),T=te(Y.borderRadius);s.beginPath(),Object.values(T).some(J=>J!==0)?Pe(s,{x:k,y:E,w:f,h:p,radius:T}):s.rect(k,E,f,p),s.fill(),C!==0&&s.stroke()}s.restore()},D=function(v,y,Y){$t(s,Y.text,v,y+b/2,c,{strikethrough:Y.hidden,textAlign:l.textAlign(Y.textAlign)})},x=this.isHorizontal(),B=this._computeTitleHeight();x?u={x:_(o,this.left+h,this.right-n[0]),y:this.top+h+B,line:0}:u={x:this.left+h,y:_(o,this.top+B+h,this.bottom-e[0].height),line:0},ys(this.ctx,t.textDirection);const G=b+h;this.legendItems.forEach((v,y)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;const Y=s.measureText(v.text).width,C=l.textAlign(v.textAlign||(v.textAlign=a.textAlign)),E=f+d+Y;let k=u.x,T=u.y;l.setWidth(this.width),x?y>0&&k+E+h>this.right&&(T=u.y+=G,u.line++,k=u.x=_(o,this.left+h,this.right-n[u.line])):y>0&&T+G>this.bottom&&(k=u.x=k+e[u.line].width+h,u.line++,T=u.y=_(o,this.top+B+h,this.bottom-e[u.line].height));const J=l.x(k);if(M(J,T,v),k=jl(C,k+f+d,x?k+E:this.right,t.rtl),D(l.x(k),T,v),x)u.x+=E+h;else if(typeof v.text!="string"){const ct=c.lineHeight;u.y+=Ho(v,ct)+h}else u.y+=G}),Ys(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=U(e.font),s=$(e.padding);if(!e.display)return;const o=ge(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=n.size/2,c=s.top+l;let h,A=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,A=_(t.align,A,this.right-d);else{const f=this.columnSizes.reduce((p,b)=>Math.max(p,b.height),0);h=c+_(t.align,this.top,this.bottom-f-t.labels.padding-this._computeTitleHeight())}const u=_(r,A,A+d);a.textAlign=o.textAlign(Ri(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=n.string,$t(a,e.text,u,h,n)}_computeTitleHeight(){const t=this.options.title,e=U(t.font),n=$(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(yt(t,this.left,this.right)&&yt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],yt(t,s.left,s.left+s.width)&&yt(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!zd(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Pd(s,n);s&&!o&&R(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&R(e.onHover,[t,n,this],this)}else n&&R(e.onClick,[t,n,this],this)}}function Td(i,t,e,n,s){const o=Sd(n,i,t,e),a=Ld(s,n,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Sd(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+n.measureText(s).width}function Ld(i,t,e){let n=i;return typeof t.text!="string"&&(n=Ho(t,e)),n}function Ho(i,t){const e=i.text?i.text.length:0;return t*e}function zd(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Od={id:"legend",_element:Vo,start(i,t,e){const n=i.legend=new Vo({ctx:i.ctx,options:e,chart:i});tt.configure(i,n,e),tt.addBox(i,n)},stop(i){tt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;tt.configure(i,n,e),n.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 n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),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:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=$(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:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||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 wn extends Et{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=V(n.text)?n.text.length:1;this._padding=$(n.padding);const o=s*U(n.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:n,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,h,A;return this.isHorizontal()?(h=_(r,n,o),A=e+t,c=o-n):(a.position==="left"?(h=n+t,A=_(r,s,e),l=S*-.5):(h=o-t,A=_(r,e,s),l=S*.5),c=s-e),{titleX:h,titleY:A,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=U(e.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);$t(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Ri(e.align),textBaseline:"middle",translation:[a,r]})}}function Rd(i,t){const e=new wn({ctx:i.ctx,options:t,chart:i});tt.configure(i,e,t),tt.addBox(i,e),i.titleBlock=e}var Nd={id:"title",_element:wn,start(i,t,e){Rd(i,e)},stop(i){const t=i.titleBlock;tt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;tt.configure(i,n,e),n.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 Di=new WeakMap;var Vd={id:"subtitle",start(i,t,e){const n=new wn({ctx:i.ctx,options:e,chart:i});tt.configure(i,n,e),tt.addBox(i,n),Di.set(i,n)},stop(i){tt.removeBox(i,Di.get(i)),Di.delete(i)},beforeUpdate(i,t,e){const n=Di.get(i);tt.configure(i,n,e),n.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 He={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;t<e;++t){const r=i[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((r,l)=>r+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=zi(t,c);h<s&&(s=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function Dt(i,t){return t&&(V(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function kt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
1991
1976
|
`)>-1?i.split(`
|
|
1992
1977
|
`):i}function Hd(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:i,label:a,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function Fo(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=U(t.bodyFont),c=U(t.titleFont),h=U(t.footerFont),A=o.length,d=s.length,u=n.length,f=$(t.padding);let p=f.height,b=0,M=n.reduce((B,G)=>B+G.before.length+G.lines.length+G.after.length,0);if(M+=i.beforeBody.length+i.afterBody.length,A&&(p+=A*c.lineHeight+(A-1)*t.titleSpacing+t.titleMarginBottom),M){const B=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=u*B+(M-u)*l.lineHeight+(M-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let D=0;const x=function(B){b=Math.max(b,e.measureText(B).width+D)};return e.save(),e.font=c.string,z(i.title,x),e.font=l.string,z(i.beforeBody.concat(i.afterBody),x),D=t.displayColors?a+2+t.boxPadding:0,z(n,B=>{z(B.before,x),z(B.lines,x),z(B.after,x)}),D=0,e.font=h.string,z(i.footer,x),e.restore(),b+=f.width,{width:b,height:p}}function Fd(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function jd(i,t,e,n){const{x:s,width:o}=n,a=e.caretSize+e.caretPadding;if(i==="left"&&s+o+a>t.width||i==="right"&&s-o-a<0)return!0}function Wd(i,t,e,n){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let c="center";return n==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),jd(c,i,t,e)&&(c="center"),c}function jo(i,t,e){const n=e.yAlign||t.yAlign||Fd(i,e);return{xAlign:e.xAlign||t.xAlign||Wd(i,t,e,n),yAlign:n}}function Zd(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Ud(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function Wo(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:h,topRight:A,bottomLeft:d,bottomRight:u}=te(a);let f=Zd(t,r);const p=Ud(t,l,c);return l==="center"?r==="left"?f+=c:r==="right"&&(f-=c):r==="left"?f-=Math.max(h,d)+s:r==="right"&&(f+=Math.max(A,u)+s),{x:K(f,0,n.width-t.width),y:K(p,0,n.height-t.height)}}function Gi(i,t,e){const n=$(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function Zo(i){return Dt([],kt(i))}function Kd(i,t,e){return Ht(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Uo(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Ko={beforeTitle:vt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:vt,beforeBody:vt,beforeLabel:vt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return Q(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:vt,afterBody:vt,beforeFooter:vt,footer:vt,afterFooter:vt};function at(i,t,e,n){const s=i[t].call(e,n);return typeof s>"u"?Ko[t].call(e,n):s}class Xo extends Et{static positioners=He;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,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new Ls(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Kd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=at(n,"beforeTitle",this,t),o=at(n,"title",this,t),a=at(n,"afterTitle",this,t);let r=[];return r=Dt(r,kt(s)),r=Dt(r,kt(o)),r=Dt(r,kt(a)),r}getBeforeBody(t,e){return Zo(at(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return z(t,o=>{const a={before:[],lines:[],after:[]},r=Uo(n,o);Dt(a.before,kt(at(r,"beforeLabel",this,o))),Dt(a.lines,at(r,"label",this,o)),Dt(a.after,kt(at(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return Zo(at(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=at(n,"beforeFooter",this,t),o=at(n,"footer",this,t),a=at(n,"afterFooter",this,t);let r=[];return r=Dt(r,kt(s)),r=Dt(r,kt(o)),r=Dt(r,kt(a)),r}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(Hd(this.chart,e[l]));return t.filter&&(r=r.filter((h,A,d)=>t.filter(h,A,d,n))),t.itemSort&&(r=r.sort((h,A)=>t.itemSort(h,A,n))),z(r,h=>{const A=Uo(t.callbacks,h);s.push(at(A,"labelColor",this,h)),o.push(at(A,"labelPointStyle",this,h)),a.push(at(A,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=He[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const l=this._size=Fo(this,n),c=Object.assign({},r,l),h=jo(this.chart,n,c),A=Wo(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:A.x,y:A.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:A}=te(r),{x:d,y:u}=t,{width:f,height:p}=e;let b,M,D,x,B,G;return o==="center"?(B=u+p/2,s==="left"?(b=d,M=b-a,x=B+a,G=B-a):(b=d+f,M=b+a,x=B-a,G=B+a),D=b):(s==="left"?M=d+Math.max(l,h)+a:s==="right"?M=d+f-Math.max(c,A)-a:M=this.caretX,o==="top"?(x=u,B=x-a,b=M-a,D=M+a):(x=u+p,B=x+a,b=M+a,D=M-a),G=x),{x1:b,x2:M,x3:D,y1:x,y2:B,y3:G}}drawTitle(t,e,n){const s=this.title,o=s.length;let a,r,l;if(o){const c=ge(n.rtl,this.x,this.width);for(t.x=Gi(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",a=U(n.titleFont),r=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=n.titleMarginBottom-r)}}_drawColorBox(t,e,n,s,o){const a=this.labelColors[n],r=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,h=U(o.bodyFont),A=Gi(this,"left",o),d=s.x(A),u=l<h.lineHeight?(h.lineHeight-l)/2:0,f=e.y+u;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=s.leftForLtr(d,c)+c/2,M=f+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ji(t,p,b,M),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ji(t,p,b,M)}else{t.lineWidth=P(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(d,c),b=s.leftForLtr(s.xPlus(d,1),c-2),M=te(a.borderRadius);Object.values(M).some(D=>D!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Pe(t,{x:p,y:f,w:c,h:l,radius:M}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Pe(t,{x:b,y:f+1,w:c-2,h:l-2,radius:M}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,f,c,l),t.strokeRect(p,f,c,l),t.fillStyle=a.backgroundColor,t.fillRect(b,f+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=n,A=U(n.bodyFont);let d=A.lineHeight,u=0;const f=ge(n.rtl,this.x,this.width),p=function(Y){e.fillText(Y,f.x(t.x+u),t.y+d/2),t.y+=d+o},b=f.textAlign(a);let M,D,x,B,G,v,y;for(e.textAlign=a,e.textBaseline="middle",e.font=A.string,t.x=Gi(this,b,n),e.fillStyle=n.bodyColor,z(this.beforeBody,p),u=r&&b!=="right"?a==="center"?c/2+h:c+2+h:0,B=0,v=s.length;B<v;++B){for(M=s[B],D=this.labelTextColors[B],e.fillStyle=D,z(M.before,p),x=M.lines,r&&x.length&&(this._drawColorBox(e,t,B,f,n),d=Math.max(A.lineHeight,l)),G=0,y=x.length;G<y;++G)p(x[G]),d=A.lineHeight;z(M.after,p)}u=0,d=A.lineHeight,z(this.afterBody,p),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let a,r;if(o){const l=ge(n.rtl,this.x,this.width);for(t.x=Gi(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",a=U(n.footerFont),e.fillStyle=n.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=n,{topLeft:A,topRight:d,bottomLeft:u,bottomRight:f}=te(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+A,l),a==="top"&&this.drawCaret(t,e,n,s),e.lineTo(r+c-d,l),e.quadraticCurveTo(r+c,l,r+c,l+d),a==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(r+c,l+h-f),e.quadraticCurveTo(r+c,l+h,r+c-f,l+h),a==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(r+u,l+h),e.quadraticCurveTo(r,l+h,r,l+h-u),a==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(r,l+A),e.quadraticCurveTo(r,l,r+A,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const a=He[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Fo(this,t),l=Object.assign({},a,this._size),c=jo(e,t,l),h=Wo(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=$(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),ys(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Ys(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!_e(n,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,n),r=this._positionChanged(a,t),l=e||!_e(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,a=He[o.position].call(this,t,e);return a!==!1&&(n!==a.x||s!==a.y)}}var Xd={id:"tooltip",_element:Xo,positioners:He,afterInit(i,t,e){e&&(i.tooltip=new Xo({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:Ko},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"]},Jd=Object.freeze({__proto__:null,Colors:ld,Decimation:dd,Filler:Qd,Legend:Od,SubTitle:Vd,Title:Nd,Tooltip:Xd});const qd=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function _d(i,t,e,n){const s=i.indexOf(t);if(s===-1)return qd(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const $d=(i,t)=>i===null?null:K(Math.round(i),0,t);function Jo(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class tu extends oe{static id="category";static defaults={ticks:{callback:Jo}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Q(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:_d(n,t,I(e,t),this._addedLabels),$d(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Jo.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}}function eu(i,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:A,includeBounds:d}=i,u=o||1,f=h-1,{min:p,max:b}=t,M=!Q(a),D=!Q(r),x=!Q(c),B=(b-p)/(A+1);let G=qn((b-p)/f/u)*u,v,y,Y,C;if(G<1e-14&&!M&&!D)return[{value:p},{value:b}];C=Math.ceil(b/G)-Math.floor(p/G),C>f&&(G=qn(C*G/f/u)*u),Q(l)||(v=Math.pow(10,l),G=Math.ceil(G*v)/v),s==="ticks"?(y=Math.floor(p/G)*G,Y=Math.ceil(b/G)*G):(y=p,Y=b),M&&D&&o&&zl((r-a)/o,G/1e3)?(C=Math.round(Math.min((r-a)/G,h)),G=(r-a)/C,y=a,Y=r):x?(y=M?a:y,Y=D?r:Y,C=c-1,G=(Y-y)/C):(C=(Y-y)/G,Ce(C,Math.round(C),G/1e3)?C=Math.round(C):C=Math.ceil(C));const E=Math.max($n(G),$n(y));v=Math.pow(10,Q(l)?E:l),y=Math.round(y*v)/v,Y=Math.round(Y*v)/v;let k=0;for(M&&(d&&y!==a?(e.push({value:a}),y<a&&k++,Ce(Math.round((y+k*G)*v)/v,a,qo(a,B,i))&&k++):y<a&&k++);k<C;++k){const T=Math.round((y+k*G)*v)/v;if(D&&T>r)break;e.push({value:T})}return D&&d&&Y!==r?e.length&&Ce(e[e.length-1].value,r,qo(r,B,i))?e[e.length-1].value=r:e.push({value:r}):(!D||Y===r)&&e.push({value:Y}),e}function qo(i,t,{horizontal:e,minRotation:n}){const s=ft(n),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class Bi extends oe{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 Q(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=n?o:l;if(t){const l=bt(s),c=bt(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,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,a=eu(s,o);return t.bounds==="ticks"&&_n(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return ke(t,this.chart.options.locale,this.options.ticks.format)}}class iu extends Bi{static id="linear";static defaults={ticks:{callback:ii.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=j(t)?t:0,this.max=j(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=ft(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Fe=i=>Math.floor(Vt(i)),ae=(i,t)=>Math.pow(10,Fe(i)+t);function _o(i){return i/Math.pow(10,Fe(i))===1}function $o(i,t,e){const n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function nu(i,t){const e=t-i;let n=Fe(e);for(;$o(i,t,n)>10;)n++;for(;$o(i,t,n)<10;)n--;return Math.min(n,Fe(i))}function su(i,{min:t,max:e}){t=lt(i.min,t);const n=[],s=Fe(t);let o=nu(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,h=Math.floor((t-l)/r/10)*r*10;let A=Math.floor((c-h)/Math.pow(10,o)),d=lt(i.min,Math.round((l+h+A*Math.pow(10,o))*a)/a);for(;d<e;)n.push({value:d,major:_o(d),significand:A}),A>=10?A=A<15?15:20:A++,A>=20&&(o++,A=2,a=o>=0?1:a),d=Math.round((l+h+A*Math.pow(10,o))*a)/a;const u=lt(i.max,d);return n.push({value:u,major:_o(u),significand:A}),n}class ou extends oe{static id="logarithmic";static defaults={ticks:{callback:ii.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Bi.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return j(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=j(t)?Math.max(0,t):null,this.max=j(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!j(this._userMin)&&(this.min=t===ae(this.min,0)?ae(this.min,-1):ae(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const o=r=>n=t?n:r,a=r=>s=e?s:r;n===s&&(n<=0?(o(1),a(10)):(o(ae(n,-1)),a(ae(s,1)))),n<=0&&o(ae(s,-1)),s<=0&&a(ae(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=su(e,this);return t.bounds==="ticks"&&_n(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":ke(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Vt(t),this._valueRange=Vt(this.max)-Vt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Vt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function mn(i){const t=i.ticks;if(t.display&&i.display){const e=$(t.backdropPadding);return I(t.font&&t.font.size,H.font.size)+e.height}return 0}function au(i,t,e){return e=V(e)?e:[e],{w:tc(i,t.string,e),h:e.length*t.lineHeight}}function ta(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function ru(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),n=[],s=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?S/o:0;for(let l=0;l<o;l++){const c=a.setContext(i.getPointLabelContext(l));s[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+s[l],r),A=U(c.font),d=au(i.ctx,A,i._pointLabels[l]);n[l]=d;const u=q(i.getIndexAngle(l)+r),f=Math.round(Li(u)),p=ta(f,h.x,d.w,0,180),b=ta(f,h.y,d.h,90,270);lu(e,t,u,p,b)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Au(i,n,s)}function lu(i,t,e,n,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,l=0;n.start<t.l?(r=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-r)):n.end>t.r&&(r=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,i.b=Math.max(i.b,t.b+l))}function cu(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=i.getPointPosition(t,n+s+a,o),c=Math.round(Li(q(l.angle+W))),h=gu(l.y,r.h,c),A=du(c),d=uu(l.x,r.w,A);return{visible:!0,x:l.x,y:h,textAlign:A,left:d,top:h,right:d+r.w,bottom:h+r.h}}function hu(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(Ct({x:e,y:n},t)||Ct({x:e,y:o},t)||Ct({x:s,y:n},t)||Ct({x:s,y:o},t))}function Au(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:mn(o)/2,additionalAngle:a?S/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const A=cu(i,h,l);n.push(A),r==="auto"&&(A.visible=hu(A,c),A.visible&&(c=A))}return n}function du(i){return i===0||i===180?"center":i<180?"left":"right"}function uu(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function gu(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function fu(i,t,e){const{left:n,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!Q(r)){const l=te(t.borderRadius),c=$(t.backdropPadding);i.fillStyle=r;const h=n-c.left,A=s-c.top,d=o-n+c.width,u=a-s+c.height;Object.values(l).some(f=>f!==0)?(i.beginPath(),Pe(i,{x:h,y:A,w:d,h:u,radius:l}),i.fill()):i.fillRect(h,A,d,u)}}function pu(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const a=n.setContext(i.getPointLabelContext(s));fu(e,a,o);const r=U(a.font),{x:l,y:c,textAlign:h}=o;$t(e,i._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function ea(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,N);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<n;a++)o=i.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function wu(i,t,e,n,s){const o=i.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!n||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ea(i,e,a,n),o.closePath(),o.stroke(),o.restore())}function mu(i,t,e){return Ht(i,{label:e,index:t,type:"pointLabel"})}class bu extends Bi{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ii.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=$(mn(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=j(t)&&!isNaN(t)?t:0,this.max=j(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/mn(this.options))}generateTickLabels(t){Bi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=R(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?ru(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=N/(this._pointLabels.length||1),n=this.options.startAngle||0;return q(t*e+ft(n))}getDistanceFromCenterForValue(t){if(Q(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(Q(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 n=e[t];return mu(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-W+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}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:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),ea(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s,border:o}=e,a=this._pointLabels.length;let r,l,c;if(e.pointLabels.display&&pu(this,a),s.display&&this.ticks.forEach((h,A)=>{if(A!==0||A===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const d=this.getContext(A),u=s.setContext(d),f=o.setContext(d);wu(this,u,l,a,f)}}),n.display){for(t.save(),r=a-1;r>=0;r--){const h=n.setContext(this.getPointLabelContext(r)),{color:A,lineWidth:d}=h;!d||!A||(t.lineWidth=d,t.strokeStyle=A,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(r,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,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=U(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const A=$(c.backdropPadding);t.fillRect(-a/2-A.left,-o-h.size/2-A.top,a+A.width,h.size+A.height)}$t(t,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const xi={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}},rt=Object.keys(xi);function ia(i,t){return i-t}function na(i,t){if(Q(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let a=t;return typeof n=="function"&&(a=n(a)),j(a)||(a=typeof n=="string"?e.parse(a,n):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(Ae(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function sa(i,t,e,n){const s=rt.length;for(let o=rt.indexOf(i);o<s-1;++o){const a=xi[rt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=n)return rt[o]}return rt[s-1]}function Mu(i,t,e,n,s){for(let o=rt.length-1;o>=rt.indexOf(e);o--){const a=rt[o];if(xi[a].common&&i._adapter.diff(s,n,a)>=t-1)return a}return rt[e?rt.indexOf(e):0]}function Du(i){for(let t=rt.indexOf(i)+1,e=rt.length;t<e;++t)if(xi[rt[t]].common)return rt[t]}function oa(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=Oi(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function Gu(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=e[r],l>=0&&(t[l].major=!0);return t}function aa(i,t,e){const n=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,n.push({value:r,major:!1});return o===0||!e?n:Gu(i,n,s,e)}class bn extends oe{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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 n=t.time||(t.time={}),s=this._adapter=new Bh._date(t.adapters.date);s.init(e),ye(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:na(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=j(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=j(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,r=Vl(s,o,a);return this._unit=e.unit||(n.autoSkip?sa(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Mu(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Du(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),aa(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=K(e,0,a),n=K(n,0,a),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,a=o.unit||sa(o.minUnit,e,n,this._getLabelCapacity(e)),r=I(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Ae(l)||l===!0,h={};let A=e,d,u;if(c&&(A=+t.startOf(A,"isoWeek",l)),A=+t.startOf(A,c?"day":a),t.diff(n,e,a)>1e5*r)throw new Error(e+" and "+n+" are too far apart with stepSize of "+r+" "+a);const f=s.ticks.source==="data"&&this.getDataTimestamps();for(d=A,u=0;d<n;d=+t.add(d,r,a),u++)oa(h,d,f);return(d===n||s.bounds==="ticks"||u===1)&&oa(h,d,f),Object.keys(h).sort(ia).map(p=>+p)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,n,s){const o=this.options,a=o.ticks.callback;if(a)return R(a,[t,e,n],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],A=c&&r[c],d=n[e],u=c&&A&&d&&d.major;return this._adapter.format(t,s||(u?A:h))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=ft(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:n*o+r*a,h:n*a+r*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,aa(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(na(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ns(t.sort(ia))}}function vi(i,t,e){let n=0,s=i.length-1,o,a,r,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Yt(i,"pos",t)),{pos:o,time:r}=i[n],{pos:a,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Yt(i,"time",t)),{time:o,pos:r}=i[n],{time:a,pos:l}=i[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class Bu extends bn{static id="timeseries";static defaults=bn.defaults;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=vi(e,this.min),this._tableRange=vi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(a=0,r=s.length;a<r;++a)h=s[a+1],l=s[a-1],c=s[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(e)||n.length===1)&&n.push(e),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(vi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return vi(this._table,n*this._tableRange+this._minPos,!0)}}var xu=Object.freeze({__proto__:null,CategoryScale:tu,LinearScale:iu,LogarithmicScale:ou,RadialLinearScale:bu,TimeScale:bn,TimeSeriesScale:Bu});const vu=[Gh,ed,Jd,xu];cn.register(...vu);var yu=Object.defineProperty,Yu=Object.getOwnPropertyDescriptor,Qt=(i,t,e,n)=>{for(var s=n>1?void 0:n?Yu(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(n?a(t,e,s):a(s))||s);return n&&s&&yu(t,e,s),s};w.GenusChart=class extends g.LitElement{constructor(){super(...arguments),this.chartTitle="",this.chartType="",this.chartLabels=[],this.chartDataSets=[],this.chartOptions={},this.isLoading=0,this.createChart=()=>{this._chart=new cn(this._chartCanvas,{type:this.chartType,data:{labels:[...this.chartLabels],datasets:[...this.chartDataSets]},options:{...this.chartOptions}})}}firstUpdated(){this.createChart()}updated(){this._chart.data.labels=[...this.chartLabels],this._chart.data.datasets=[...this.chartDataSets],this._chart.update()}render(){return this.isLoading?g.html`<div class='content-loader'></div>`:g.html`
|
|
1993
1978
|
<div class='chart'>
|
|
@@ -2049,6 +2034,69 @@
|
|
|
2049
2034
|
.table-loader__body table thead, .table-loader__body table tfoot { background: #999999; }
|
|
2050
2035
|
|
|
2051
2036
|
.table-loader__body table tbody tr { border-bottom: 0.0675rem solid #f0f1f2; }
|
|
2037
|
+
|
|
2038
|
+
/* Medium devices (tablets, less than 992px) */
|
|
2039
|
+
@media (max-width: 991.98px)
|
|
2040
|
+
{
|
|
2041
|
+
.data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr {
|
|
2042
|
+
display: block;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
/* hide the original header row */
|
|
2046
|
+
.data-table thead {
|
|
2047
|
+
display: none;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
.data-table tr {
|
|
2051
|
+
border: 0.0625rem solid var(--porcelain);
|
|
2052
|
+
border-radius: 0.5rem;
|
|
2053
|
+
padding: 0.5rem;
|
|
2054
|
+
margin-bottom: 0.75rem;
|
|
2055
|
+
background: var(--card-background, #ffffff);
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
.data-table td {
|
|
2059
|
+
display: flex;
|
|
2060
|
+
justify-content: space-between;
|
|
2061
|
+
align-items: center;
|
|
2062
|
+
padding: 0.5rem 0.5rem;
|
|
2063
|
+
border: none;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
/* ensure illustrations scale down */
|
|
2067
|
+
.no-result-illustration, .data-table td img {
|
|
2068
|
+
max-width: 100%;
|
|
2069
|
+
height: auto;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
/* compact actions */
|
|
2073
|
+
.actions {
|
|
2074
|
+
display: flex;
|
|
2075
|
+
gap: 0.5rem;
|
|
2076
|
+
justify-content: flex-end;
|
|
2077
|
+
flex: 1 1 auto;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
/* adjust checkbox size/spacing for touch */
|
|
2081
|
+
.genus-table-master-checkbox, .genus-table-row-checkbox, .genus-checkbox {
|
|
2082
|
+
transform: scale(1.1);
|
|
2083
|
+
margin: 0;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
.pagination-control {
|
|
2087
|
+
padding: 0.5rem 0;
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
.card__head, .card__body, .card__footer {
|
|
2091
|
+
padding-left: 0.5rem;
|
|
2092
|
+
padding-right: 0.5rem;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
.dialog {
|
|
2096
|
+
width: calc(100% - 2rem);
|
|
2097
|
+
max-width: none;
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2052
2100
|
`,Iu=g.css`
|
|
2053
2101
|
*
|
|
2054
2102
|
{
|
|
@@ -2325,7 +2373,6 @@
|
|
|
2325
2373
|
input[type='text']
|
|
2326
2374
|
{
|
|
2327
2375
|
border: var(--input-border, none);
|
|
2328
|
-
background: var(--input-background-color, var(--iceberg));
|
|
2329
2376
|
color: var(--input-color, var(--nile-blue))
|
|
2330
2377
|
}
|
|
2331
2378
|
|
|
@@ -2335,6 +2382,7 @@
|
|
|
2335
2382
|
{
|
|
2336
2383
|
width: 1.875rem;
|
|
2337
2384
|
height: 1.5625rem;
|
|
2385
|
+
background: var(--input-background-color, var(--iceberg));
|
|
2338
2386
|
border-radius: 0.375rem;
|
|
2339
2387
|
text-align: center;
|
|
2340
2388
|
}
|