PageSourceSearch

https://o7support-docker-production.up.railway.app/vite/assets/BarChart-CNdiqjj3.js

js o7support-docker-production.up.railway.app collected 2026-10-03 12:13:53 UTC 146,245 bytes, 19 lines download raw bytes

vendor: 7,024 bytes, lines 1-6
1var fn=Object.defineProperty;var un=(i,t,e)=>t in i?fn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var w=(i,t,e)=>un(i,typeof t!="symbol"?t+"":t,e);import{d as ks,a2 as ws,h as We,af as gn,r as pn,H as mn,R as bn,w as _n,ag as $e,ah as Ms,u as xn,c as yn,o as vn,a as kn,B as wn}from"./_plugin-vue_export-helper-D5KCe0UY.js";/*!
2 * @kurkle/color v0.3.2
3 * https://github.com/kurkle/color#readme
4 * (c) 2023 Jukka Kurkela
5 * Released under the MIT License
6 */function Zt(i){return i+.5|0}const ot=(i,t,e)=>Math.max(Math.min(i,e),t);function Bt(i){return ot(Zt(i*2.55),0,255)}function lt(i){return ot(Zt(i*255),0,255)}function et(i){return ot(Zt(i/2.55)/100,0,1)}function fi(i){return ot(Zt(i*100),0,100)}const W={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},Ye=[..."0123456789ABCDEF"],Mn=i=>Ye[i&15],Sn=i=>Ye[(i&240)>>4]+Ye[i&15],ee=i=>(i&240)>>4===(i&15),Pn=i=>ee(i.r)&&ee(i.g)&&ee(i.b)&&ee(i.a);function On(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&W[i[1]]*17,g:255&W[i[2]]*17,b:255&W[i[3]]*17,a:t===5?W[i[4]]*17:255}:(t===7||t===9)&&(e={r:W[i[1]]<<4|W[i[2]],g:W[i[3]]<<4|W[i[4]],b:W[i[5]]<<4|W[i[6]],a:t===9?W[i[7]]<<4|W[i[8]]:255})),e}const Dn=(i,t)=>i<255?t(i):"";function Cn(i){var t=Pn(i)?Mn:Sn;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Dn(i.a,t):void 0}const Tn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ss(i,t,e){const s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function An(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Ln(i,t,e){const s=Ss(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Fn(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function ei(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),a=Math.min(e,s,n),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=Fn(e,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function ii(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(lt)}function si(i,t,e){return ii(Ss,i,t,e)}function In(i,t,e){return ii(Ln,i,t,e)}function Rn(i,t,e){return ii(An,i,t,e)}function Ps(i){return(i%360+360)%360}function En(i){const t=Tn.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Bt(+t[5]):lt(+t[5]));const n=Ps(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=In(n,o,a):t[1]==="hsv"?s=Rn(n,o,a):s=si(n,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function zn(i,t){var e=ei(i);e[0]=Ps(e[0]+t),e=si(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Bn(i){if(!i)return;const t=ei(i),e=t[0],s=fi(t[1]),n=fi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${et(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const ui={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"},gi={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 Vn(){const i={},t=Object.keys(gi),e=Object.keys(ui);let s,n,o,a,r;for(s=0;s<t.length;s++){for(a=r=t[s],n=0;n<e.length;n++)o=e[n],r=r.replace(o,ui[o]);o=parseInt(gi[a],16),i[r]=[o>>16&255,o>>8&255,o&255]}return i}let ie;function Hn(i){ie||(ie=Vn(),ie.transparent=[0,0,0,0]);const t=ie[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Nn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function jn(i){const t=Nn.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const a=+t[7];e=t[8]?Bt(a):ot(a*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Bt(s):ot(s,0,255)),n=255&(t[4]?Bt(n):ot(n,0,255)),o=255&(t[6]?Bt(o):ot(o,0,255)),{r:s,g:n,b:o,a:e}}}function Wn(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${et(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Te=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,St=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function $n(i,t,e){const s=St(et(i.r)),n=St(et(i.g)),o=St(et(i.b));return{r:lt(Te(s+e*(St(et(t.r))-s))),g:lt(Te(n+e*(St(et(t.g))-n))),b:lt(Te(o+e*(St(et(t.b))-o))),a:i.a+e*(t.a-i.a)}}function se(i,t,e){if(i){let s=ei(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=si(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function Os(i,t){return i&&Object.assign(t||{},i)}function pi(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=lt(i[3]))):(t=Os(i,{r:0,g:0,b:0,a:1}),t.a=lt(t.a)),t}function Yn(i){return i.charAt(0)==="r"?jn(i):En(i)}class Kt{constructor(t){if(t instanceof Kt)return t;const e=typeof t;let s;e==="object"?s=pi(t):e==="string"&&(s=On(t)||Hn(t)||Yn(t)),this._rgb=s,this._val
vendor: 47,452 bytes, lines 6-16
6id=!!s}get valid(){return this._valid}get rgb(){var t=Os(this._rgb);return t&&(t.a=et(t.a)),t}set rgb(t){this._rgb=pi(t)}rgbString(){return this._valid?Wn(this._rgb):void 0}hexString(){return this._valid?Cn(this._rgb):void 0}hslString(){return this._valid?Bn(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=s.a-n.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=a*s.a+(1-a)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=$n(this._rgb,t._rgb,e)),this}clone(){return new Kt(this.rgb)}alpha(t){return this._rgb.a=lt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Zt(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 se(this._rgb,2,t),this}darken(t){return se(this._rgb,2,-t),this}saturate(t){return se(this._rgb,1,t),this}desaturate(t){return se(this._rgb,1,-t),this}rotate(t){return zn(this._rgb,t),this}}/*!
7 * Chart.js v4.4.4
8 * https://www.chartjs.org
9 * (c) 2024 Chart.js Contributors
10 * Released under the MIT License
11 */function Q(){}const Un=(()=>{let i=0;return()=>i++})();function C(i){return i===null||typeof i>"u"}function z(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 M(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function Y(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function q(i,t){return Y(i)?i:t}function T(i,t){return typeof i>"u"?t:i}const Kn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function L(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function O(i,t,e,s){let n,o,a;if(z(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(M(i))for(a=Object.keys(i),o=a.length,n=0;n<o;n++)t.call(e,i[a[n]],a[n])}function xe(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ye(i){if(z(i))return i.map(ye);if(M(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=ye(i[e[n]]);return t}return i}function Ds(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Xn(i,t,e,s){if(!Ds(i))return;const n=t[i],o=e[i];M(n)&&M(o)?Xt(n,o,s):t[i]=ye(o)}function Xt(i,t,e){const s=z(t)?t:[t],n=s.length;if(!M(i))return i;e=e||{};const o=e.merger||Xn;let a;for(let r=0;r<n;++r){if(a=s[r],!M(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 Nt(i,t){return Xt(i,t,{merger:qn})}function qn(i,t,e){if(!Ds(i))return;const s=t[i],n=e[i];M(s)&&M(n)?Nt(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ye(n))}const mi={"":i=>i,x:i=>i.x,y:i=>i.y};function Gn(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Zn(i){const t=Gn(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Ot(i,t){return(mi[t]||(mi[t]=Zn(t)))(i)}function ni(i){return i.charAt(0).toUpperCase()+i.slice(1)}const qt=i=>typeof i<"u",ht=i=>typeof i=="function",bi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Qn(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const V=Math.PI,xt=2*V,ve=Number.POSITIVE_INFINITY,Jn=V/180,U=V/2,ut=V/4,_i=V*2/3,Cs=Math.log10,ct=Math.sign;function ge(i,t,e){return Math.abs(i-t)<e}function xi(i){const t=Math.round(i);i=ge(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Cs(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function to(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function ke(i){return!isNaN(parseFloat(i))&&isFinite(i)}function eo(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function io(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function _t(i){return i*(V/180)}function so(i){return i*(180/V)}function yi(i){if(!Y(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function no(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*V&&(o+=xt),{angle:o,distance:n}}function oo(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function gt(i){return(i%xt+xt)%xt}function ao(i,t,e,s){const n=gt(i),o=gt(t),a=gt(e),r=gt(o-n),l=gt(a-n),c=gt(n-o),h=gt(n-a);return n===o||n===a||s||r>l&&c<h}function K(i,t,e){return Math.max(t,Math.min(e,i))}function ro(i){return K(i,-32768,32767)}function vi(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function oi(i,t,e){e=e||(a=>i[a]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Ue=(i,t,e,s)=>oi(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),lo=(i,t,e)=>oi(i,e,s=>i[s][t]>=e);function co(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const Ts=["push","pop","shift","splice","unshift"];function ho(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ts.forEach(e=>{const s="_onData"+ni(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})})}function ki(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Ts.forEach(o=>{delete i[o]}),delete i._chartjs)}function As(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Ls=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Fs(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Ls.call(window,()=>{s=!1,i.apply(t,e)}))}}function fo(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Is=i=>i==="start"?"left":i==="end"?"right":"center",jt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,ne=i=>i===0||i===1,wi=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*xt/e)),Mi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*xt/e)+1,Wt={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*U)+1,easeOutSine:i=>Math.sin(i*U),easeInOutSine:i=>-.5*(Math.cos(V*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=>ne(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=>ne(i)?i:wi(i,.075,.3),easeOutElastic:i=>ne(i)?i:Mi(i,.075,.3),easeInOutElastic(i){return ne(i)?i:i<.5?.5*wi(i*2,.1125,.45):.5+.5*Mi(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-Wt.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?Wt.easeInBounce(i*2)*.5:Wt.easeOutBounce(i*2-1)*.5+.5};function Rs(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Si(i){return Rs(i)?i:new Kt(i)}function Ae(i){return Rs(i)?i:new Kt(i).saturate(.5).darken(.1).hexString()}const uo=["x","y","borderWidth","radius","tension"],go=["color","borderColor","backgroundColor"];function po(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:go},numbers:{type:"number",properties:uo}}),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 mo(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Pi=new Map;function bo(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Pi.get(e);return s||(s=new Intl.NumberFormat(i,t),Pi.set(e,s)),s}function Es(i,t,e){return bo(t,e).format(i)}const _o={values(i){return z(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=xo(i,e)}const a=Cs(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Es(i,s,l)}};function xo(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 zs={formatters:_o};function yo(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:zs.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 vt=Object.create(null),Ke=Object.create(null);function $t(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Le(i,t,e){return typeof t=="string"?Xt($t(i,t),e):Xt($t(i,""),t)}class vo{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>Ae(n.backgroundColor),this.hoverBorderColor=(s,n)=>Ae(n.borderColor),this.hoverColor=(s,n)=>Ae(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Le(this,t,e)}get(t){return $t(this,t)}describe(t,e){return Le(Ke,t,e)}override(t,e){return Le(vt,t,e)}route(t,e,s,n){const o=$t(this,t),a=$t(this,s),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[n];return M(l)?Object.assign({},c,l):T(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var F=new vo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[po,mo,yo]);function ko(i){return!i||C(i.size)||C(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Oi(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function pt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function Di(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Ci(i,t,e,s){wo(i,t,e,s)}function wo(i,t,e,s,n){let o,a,r,l,c,h,d,f;const u=t.pointStyle,m=t.rotation,g=t.radius;let p=(m||0)*Jn;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(p),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),u){default:i.arc(e,s,g,0,xt),i.closePath();break;case"triangle":h=g,i.moveTo(e+Math.sin(p)*h,s-Math.cos(p)*g),p+=_i,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*g),p+=_i,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,a=Math.cos(p+ut)*l,d=Math.cos(p+ut)*l,r=Math.sin(p+ut)*l,f=Math.sin(p+ut)*l,i.arc(e-d,s-r,c,p-V,p-U),i.arc(e+f,s-a,c,p-U,p),i.arc(e+d,s+r,c,p,p+U),i.arc(e-f,s+a,c,p+U,p+V),i.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,h=l,i.rect(e-h,s-l,2*h,2*l);break}p+=ut;case"rectRot":d=Math.cos(p)*g,a=Math.cos(p)*g,r=Math.sin(p)*g,f=Math.sin(p)*g,i.moveTo(e-d,s-r),i.lineTo(e+f,s-a),i.lineTo(e+d,s+r),i.lineTo(e-f,s+a),i.closePath();break;case"crossRot":p+=ut;case"cross":d=Math.cos(p)*g,a=Math.cos(p)*g,r=Math.sin(p)*g,f=Math.sin(p)*g,i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+f,s-a),i.lineTo(e-f,s+a);break;case"star":d=Math.cos(p)*g,a=Math.cos(p)*g,r=Math.sin(p)*g,f=Math.sin(p)*g,i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+f,s-a),i.lineTo(e-f,s+a),p+=ut,d=Math.cos(p)*g,a=Math.cos(p)*g,r=Math.sin(p)*g,f=Math.sin(p)*g,i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+f,s-a),i.lineTo(e-f,s+a);break;case"line":a=Math.cos(p)*g,r=Math.sin(p)*g,i.moveTo(e-a,s-r),i.lineTo(e+a,s+r);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(p)*g,s+Math.sin(p)*g);break;case!1:i.closePath();break}i.fill(),i.stroke()}}function Bs(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 Vs(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Hs(i){i.restore()}function Mo(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),C(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 So(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(a,h),i.lineTo(r,h),i.stroke()}}function Po(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Xe(i,t,e,s,n,o={}){const a=z(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Mo(i,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&Po(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),C(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),So(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function qe(i,t){const{x:e,y:s,w:n,h:o,radius:a}=t;i.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*V,V,!0),i.lineTo(e,s+o-a.bottomLeft),i.arc(e+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,V,U,!0),i.lineTo(e+n-a.bottomRight,s+o),i.arc(e+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,U,0,!0),i.lineTo(e+n,s+a.topRight),i.arc(e+n-a.topRight,s+a.topRight,a.topRight,0,-U,!0),i.lineTo(e+a.topLeft,s)}const Oo=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Do=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Co(i,t){const e=(""+i).match(Oo);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 To=i=>+i||0;function Ns(i,t){const e={},s=M(t),n=s?Object.keys(t):t,o=M(i)?s?a=>T(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of n)e[a]=To(o(a));return e}function js(i){return Ns(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Yt(i){return Ns(i,["topLeft","topRight","bottomLeft","bottomRight"])}function it(i){const t=js(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(i,t){i=i||{},t=t||F.font;let e=T(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=T(i.style,t.style);s&&!(""+s).match(Do)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:T(i.family,t.family),lineHeight:Co(T(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:T(i.weight,t.weight),string:""};return n.string=ko(n),n}function oe(i,t,e,s){let n,o,a;for(n=0,o=i.length;n<o;++n)if(a=i[n],a!==void 0&&a!==void 0)return a}function Ao(i,t,e){const{min:s,max:n}=i,o=Kn(t,(n-s)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function Ct(i,t){return Object.assign(Object.create(i),t)}function ai(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=Us("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>ai([r,...i],t,o,s)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return $s(r,l,()=>Vo(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Ai(r).includes(l)},ownKeys(r){return Ai(r)},set(r,l,c){const h=r._storage||(r._storage=n());return r[l]=h[l]=c,delete r._keys,!0}})}function Dt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ws(i,s),setContext:o=>Dt(i,o,e,s),override:o=>Dt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return $s(o,a,()=>Fo(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 Ws(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:ht(e)?e:()=>e,isIndexable:ht(s)?s:()=>s}}const Lo=(i,t)=>i?i+ni(t):t,ri=(i,t)=>M(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function $s(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function Fo(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=i;let r=s[t];return ht(r)&&a.isScriptable(t)&&(r=Io(t,r,i,e)),z(r)&&r.length&&(r=Ro(t,r,i,a.isIndexable)),ri(t,r)&&(r=Dt(r,n,o&&o[t],a)),r}function Io(i,t,e,s){const{_proxy:n,_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||s);return r.delete(i),ri(i,l)&&(l=li(n._scopes,n,i,l)),l}function Ro(i,t,e,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(M(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=li(c,n,i,h);t.push(Dt(d,o,a&&a[i],r))}}return t}function Ys(i,t,e){return ht(i)?i(t,e):i}const Eo=(i,t)=>i===!0?t:typeof i=="string"?Ot(t,i):void 0;function zo(i,t,e,s,n){for(const o of t){const a=Eo(e,o);if(a){i.add(a);const r=Ys(a._fallback,e,n);if(typeof r<"u"&&r!==e&&r!==s)return r}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function li(i,t,e,s){const n=t._rootScopes,o=Ys(t._fallback,e,s),a=[...i,...n],r=new Set;r.add(s);let l=Ti(r,a,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=Ti(r,a,o,l,s),l===null)?!1:ai(Array.from(r),[""],n,o,()=>Bo(t,e,s))}function Ti(i,t,e,s,n){for(;e;)e=zo(i,t,e,s,n);return e}function Bo(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return z(n)&&M(e)?e:n||{}}function Vo(i,t,e,s){let n;for(const o of t)if(n=Us(Lo(o,i),e),typeof n<"u")return ri(i,n)?li(e,s,i,n):n}function Us(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Ai(i){let t=i._keys;return t||(t=i._keys=Ho(i._scopes)),t}function Ho(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function ci(){return typeof window<"u"&&typeof document<"u"}function hi(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function we(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const Pe=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function No(i,t){return Pe(i).getPropertyValue(t)}const jo=["top","right","bottom","left"];function yt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=jo[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Wo=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function $o(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let a=!1,r,l;if(Wo(n,o,i.target))r=n,l=o;else{const c=t.getBoundingClientRect();r=s.clientX-c.left,l=s.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function bt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Pe(e),o=n.boxSizing==="border-box",a=yt(n,"padding"),r=yt(n,"border","width"),{x:l,y:c,box:h}=$o(i,e),d=a.left+(h&&r.left),f=a.top+(h&&r.top);let{width:u,height:m}=t;return o&&(u-=a.width+r.width,m-=a.height+r.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/m*e.height/s)}}function Yo(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&hi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=Pe(o),l=yt(r,"border","width"),c=yt(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,s=we(r.maxWidth,o,"clientWidth"),n=we(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||ve,maxHeight:n||ve}}const ae=i=>Math.round(i*10)/10;function Uo(i,t,e,s){const n=Pe(i),o=yt(n,"margin"),a=we(n.maxWidth,i,"clientWidth")||ve,r=we(n.maxHeight,i,"clientHeight")||ve,l=Yo(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=yt(n,"border","width"),u=yt(n,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=ae(Math.min(c,a,l.maxWidth)),h=ae(Math.min(h,r,l.maxHeight)),c&&!h&&(h=ae(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=ae(Math.floor(h*s))),{width:c,height:h}}function Li(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const 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!==s||a.height!==n||a.width!==o?(i.currentDevicePixelRatio=s,a.height=n,a.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Ko=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};ci()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function Fi(i,t){const e=No(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const Xo=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},qo=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Fe(i,t,e){return i?Xo(t,e):qo()}function Go(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Zo(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}/*!
12 * Chart.js v4.4.4
13 * https://www.chartjs.org
14 * (c) 2024 Chart.js Contributors
15 * Released under the MIT License
16 */class Qo{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Ls.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var J=new Qo;const Ii="transparent",Jo={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Si(i||Ii),n=s.valid&&Si(t||Ii);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class ta{constructor(t,e,s,n){const o=e[s];n=oe([t.to,n,o,t.from]);const a=oe([t.from,o,n]);this._active=!0,this._fn=t.fn||Jo[t.type||typeof a],this._easing=Wt[t.easing]||Wt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=oe([t.to,e,n,t.from]),this._from=oe([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<s),!this._active){this._target[n]=r,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class Ks{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!M(t))return;const e=Object.keys(F.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!M(o))return;const a={};for(const r of e)a[r]=o[r];(z(o.properties)&&o.properties||[n]).forEach(r=>{(r===n||!s.has(r))&&s.set(r,a)})})}_animateOptions(t,e){const s=e.options,n=ia(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&ea(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],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"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,h,r);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new ta(f,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return J.add(this._chart,s),!0}}function ea(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function ia(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 Ri(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function sa(i,t,e){if(e===!1)return!1;const s=Ri(i,e),n=Ri(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function na(i){let t,e,s,n;return M(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Xs(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function Ei(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let a,r,l,c;if(t!==null){for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===e){if(s.all)continue;break}c=i.values[l],Y(c)&&(o||t===0||ct(t)===ct(c))&&(t+=c)}return t}}function oa(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.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]={[n]:h,[o]:i[h]};return r}function zi(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function aa(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function ra(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function la(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function Bi(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Vi(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,c=a.axis,h=aa(o,a,s),d=t.length;let f;for(let u=0;u<d;++u){const m=t[u],{[l]:g,[c]:p}=m,b=m._stacks||(m._stacks={});f=b[c]=la(n,h,g),f[r]=p,f._top=Bi(f,a,!0,s.type),f._bottom=Bi(f,a,!1,s.type);const _=f._visualValues||(f._visualValues={});_[r]=p}}function Ie(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function ca(i,t){return Ct(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ha(i,t,e){return Ct(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ft(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const Re=i=>i==="reset"||i==="none",Hi=(i,t)=>t?i:Object.assign({},i),da=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Xs(e,!0),values:null};class Ut{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=zi(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&&Ft(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,m)=>d==="x"?f:d==="r"?m:u,o=e.xAxisID=T(s.xAxisID,Ie(t,"x")),a=e.yAxisID=T(s.yAxisID,Ie(t,"y")),r=e.rAxisID=T(s.rAxisID,Ie(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,a,r),h=e.vAxisID=n(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&&ki(this._data,this),t._stacked&&Ft(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(M(e)){const n=this._cachedMeta;this._data=oa(e,n)}else if(s!==e){if(s){ki(s,this);const n=this._cachedMeta;Ft(n),n._parsed=[]}e&&Object.isExtensible(e)&&ho(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=zi(e.vScale,e),e.stack!==s.stack&&(n=!0,Ft(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&Vi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:a}=s,r=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,f;if(this._parsing===!1)s._parsed=n,s._sorted=!0,f=n;else{z(n[t])?f=this.parseArrayData(s,n,t,e):M(n[t])?f=this.parseObjectData(s,n,t,e):f=this.parsePrimitiveData(s,n,t,e);const u=()=>d[r]===null||c&&d[r]<c[r];for(h=0;h<e;++h)s._parsed[h+t]=d=f[h],l&&(u()&&(l=!1),c=d);s._sorted=l}a&&Vi(this,f)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,d=new Array(n);let f,u,m;for(f=0,u=n;f<u;++f)m=f+s,d[f]={[r]:h||o.parse(c[m],m),[l]:a.parse(e[m],m)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:a}=t,r=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],r[l]={x:o.parse(d[0],h),y:a.parse(d[1],h)};return r}parseObjectData(t,e,s,n){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,f,u;for(h=0,d=n;h<d;++h)f=h+s,u=e[f],c[h]={x:o.parse(Ot(u,r),f),y:a.parse(Ot(u,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:Xs(n,!0),values:e._stacks[t.axis]._visualValues};return Ei(r,a,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let a=o===null?NaN:o;const r=n&&s._stacks[e.axis];n&&r&&(n.values=r,a=Ei(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,a=n.length,r=this._getOtherScale(t),l=da(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=ra(r);let f,u;function m(){u=n[f];const g=u[r.axis];return!Y(u[t.axis])||h>g||d<g}for(f=0;f<a&&!(!m()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],Y(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=na(T(this.options.clip,sa(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||n.length-r,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const d=n[h];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=ha(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=ca(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&qt(s);if(r)return Hi(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),u=Object.keys(F.elements[t]),m=()=>this.getContext(s,n,e),g=c.resolveNamedOptions(f,u,m,d);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(Hi(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,s,e))}const c=new Ks(n,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||Re(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,n){Re(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Re(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const n=s.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,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(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&Ft(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}w(Ut,"defaults",{}),w(Ut,"datasetElementType",null),w(Ut,"dataElementType",null);function fa(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let s=[];for(let n=0,o=e.length;n<o;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=As(s.sort((n,o)=>n-o))}return i._cache.$bar}function ua(i){const t=i.iScale,e=fa(t,i.type);let s=t._length,n,o,a,r;const l=()=>{a===32767||a===-32768||(qt(r)&&(s=Math.min(s,Math.abs(a-r)||s)),r=a)};for(n=0,o=e.length;n<o;++n)a=t.getPixelForValue(e[n]),l();for(r=void 0,n=0,o=t.ticks.length;n<o;++n)a=t.getPixelForTick(n),l();return s}function ga(i,t,e,s){const n=e.barThickness;let o,a;return C(n)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[i]-o/2}}function pa(i,t,e,s){const n=t.pixels,o=n[i];let a=i>0?n[i-1]:null,r=i<n.length-1?n[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/s,ratio:e.barPercentage,start:c}}function ma(i,t,e,s){const n=e.parse(i[0],s),o=e.parse(i[1],s),a=Math.min(n,o),r=Math.max(n,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:n,end:o,min:a,max:r}}function qs(i,t,e,s){return z(i)?ma(i,t,e,s):t[e.axis]=e.parse(i,s),t}function Ni(i,t,e,s){const n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,l=[];let c,h,d,f;for(c=e,h=e+s;c<h;++c)f=t[c],d={},d[n.axis]=r||n.parse(a[c],c),l.push(qs(f,d,o,c));return l}function Ee(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function ba(i,t,e){return i!==0?ct(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function _a(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:s,reverse:t,top:n,bottom:o}}function xa(i,t,e,s){let n=t.borderSkipped;const o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:h}=_a(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=h:(o[ji(h,a,r,l)]=!0,n=c)),o[ji(n,a,r,l)]=!0,i.borderSkipped=o}function ji(i,t,e,s){return s?(i=ya(i,t,e),i=Wi(i,e,t)):i=Wi(i,t,e),i}function ya(i,t,e){return i===t?e:i===e?t:i}function Wi(i,t,e){return i==="start"?t:i==="end"?e:i}function va(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class pe extends Ut{parsePrimitiveData(t,e,s,n){return Ni(t,e,s,n)}parseArrayData(t,e,s,n){return Ni(t,e,s,n)}parseObjectData(t,e,s,n){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,d=[];let f,u,m,g;for(f=s,u=s+n;f<u;++f)g=e[f],m={},m[o.axis]=o.parse(Ot(g,c),f),d.push(qs(Ot(g,h),m,a,f));return d}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);const o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:n}=e,o=this.getParsed(t),a=o._custom,r=Ee(a)?"["+a.start+", "+a.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+s.getLabelForValue(o[s.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,s,n){const o=n==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,n);for(let u=e;u<e+s;u++){const m=this.getParsed(u),g=o||C(m[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(u),p=this._calculateBarIndexPixels(u,h),b=(m._stacks||{})[r.axis],_={horizontal:c,base:g.base,enableBorderRadius:!b||Ee(m._custom)||a===b._top||a===b._bottom,x:c?g.head:p.center,y:c?p.center:g.head,height:c?p.size:Math.abs(g.size),width:c?Math.abs(g.size):p.size};f&&(_.options=d||this.resolveDataElementOptions(u,t[u].active?"active":n));const y=_.options||t[u].options;xa(_,y,b,a),va(_,y,h.ratio),this.updateElement(t[u],u,_,n)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=s.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[s.axis],c=h=>{const d=h._parsed.find(u=>u[s.axis]===l),f=d&&d[h.vScale.axis];if(C(f)||isNaN(f))return!0};for(const h of n)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}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,a;for(o=0,a=e.data.length;o<a;++o)n.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const r=t.barThickness;return{min:r||ua(e),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:n},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=Ee(c);let d=l[e.axis],f=0,u=s?this.applyStack(e,l,s):d,m,g;u!==d&&(f=u-d,u=d),h&&(d=c.barStart,u=c.barEnd-c.barStart,d!==0&&ct(d)!==ct(c.barEnd)&&(f=0),f+=d);const p=!C(o)&&!h?o:f;let b=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(f+u):m=b,g=m-b,Math.abs(g)<a){g=ba(g,e,r)*a,d===r&&(b-=g/2);const _=e.getPixelForDecimal(0),y=e.getPixelForDecimal(1),v=Math.min(_,y),x=Math.max(_,y);b=Math.max(Math.min(b,x),v),m=b+g,s&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(m)-e.getValueForPixel(b))}if(b===e.getPixelForValue(r)){const _=ct(g)*e.getLineWidthForValue(r)/2;b+=_,g-=_}
vendor: 4,525 bytes, line 16
16return{size:g,base:b,head:m,center:m+g/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,o=n.skipNull,a=T(n.maxBarThickness,1/0);let r,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=n.barThickness==="flex"?pa(t,e,n,c):ga(t,e,n,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=h.start+h.chunk*d+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else r=s.getPixelForValue(this.getParsed(t)[s.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,s=t.data,n=s.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!s[o].hidden&&s[o].draw(this._ctx)}}w(pe,"id","bar"),w(pe,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),w(pe,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function mt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class di{constructor(t){w(this,"options");this.options=t||{}}static override(t){Object.assign(di.prototype,t)}init(){}formats(){return mt()}parse(){return mt()}format(){return mt()}add(){return mt()}diff(){return mt()}startOf(){return mt()}endOf(){return mt()}}var ka={_date:di};function wa(i,t,e,s){const{controller:n,data:o,_sorted:a}=i,r=n._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const l=r._reversePixels?lo:Ue;if(s){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),f=l(o,t,e+h);return{lo:d.lo,hi:f.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Oe(i,t,e,s,n){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:d,hi:f}=wa(o[r],t,a,n);for(let u=d;u<=f;++u){const m=h[u];m.skip||s(m,c,u)}}}function Ma(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,a=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function ze(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||Oe(i,e,t,function(r,l,c){!n&&!Bs(r,i.chartArea,0)||r.inRange(t.x,t.y,s)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function Sa(i,t,e,s){let n=[];function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:d}=no(a,{x:t.x,y:t.y});ao(d,c,h)&&n.push({element:a,datasetIndex:r,index:l})}return Oe(i,e,t,o),n}function Pa(i,t,e,s,n,o){let a=[];const r=Ma(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const u=h.inRange(t.x,t.y,n);if(s&&!u)return;const m=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(m))&&!u)return;const p=r(t,m);p<l?(a=[{element:h,datasetIndex:d,index:f}],l=p):p===l&&a.push({element:h,datasetIndex:d,index:f})}return Oe(i,e,t,c),a}function Be(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?Sa(i,t,e,n):Pa(i,t,e,s,n,o)}function $i(i,t,e,s,n){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return Oe(i,e,t,(l,c,h)=>{l[a]&&l[a](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,n))}),s&&!r?[]:o}var Oa={modes:{index(i,t,e,s){const n=bt(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?ze(i,n,o,s,a):Be(i,n,o,!1,s,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=bt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?ze(i,n,o,s,a):Be(i,n,o,!1,s,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,s){const n=bt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return ze(i,n,o,s,a)},nearest(i,t,e,s){const n=bt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return Be(i,n,o,e.intersect,s,a)},x(i,t,e,s){const n=bt(t,i);return $i(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=bt(t,i);return $i(i,n,"y",e.intersect,s)}}};const Gs=["left","top","right","bottom"];function It(i,t){return i.filter(e=>e.pos===t)}function Yi(i,t){return i.filter(e=>Gs.indexOf(e.pos)===-1&&e.box.axis===t)}function Rt(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Da(i){const t=[];let e,s,n,o,a,r;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:a,stackWeight:r=1}}
vendor: 78,655 bytes, lines 16-18
16=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return t}function Ca(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!Gs.includes(n))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Ta(i,t){const e=Ca(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=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*s:l&&t.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:l&&t.availableHeight)}return e}function Aa(i){const t=Da(i),e=Rt(t.filter(c=>c.box.fullSize),!0),s=Rt(It(t,"left"),!0),n=Rt(It(t,"right")),o=Rt(It(t,"top"),!0),a=Rt(It(t,"bottom")),r=Yi(t,"x"),l=Yi(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:It(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}function Ui(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Zs(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 La(i,t,e,s){const{pos:n,box:o}=e,a=i.maxPadding;if(!M(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Zs(a,o.getPadding());const r=Math.max(0,t.outerWidth-Ui(a,i,"left","right")),l=Math.max(0,t.outerHeight-Ui(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 Fa(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Ia(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(i?["left","right"]:["top","bottom"])}function Vt(i,t,e,s){const n=[];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,Ia(r.horizontal,t));const{same:d,other:f}=La(t,e,r,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(r)}return c&&Vt(n,t,e,s)||h}function re(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function Ki(i,t,e,s){const n=e.padding;let{x:o,y:a}=t;for(const r of i){const l=r.box,c=s[r.stack]||{placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const d=t.w*h,f=c.size||l.height;qt(c.start)&&(a=c.start),l.fullSize?re(l,n.left,a,e.outerWidth-n.right-n.left,f):re(l,t.left+c.placed,a,d,f),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*h,f=c.size||l.width;qt(c.start)&&(o=c.start),l.fullSize?re(l,o,n.top,f,e.outerHeight-n.bottom-n.top):re(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var at={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=it(i.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(e-n.height,0),r=Aa(i.boxes),l=r.vertical,c=r.horizontal;O(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),f=Object.assign({},n);Zs(f,it(s));const u=Object.assign({maxPadding:f,w:o,h:a,x:n.left,y:n.top},n),m=Ta(l.concat(c),d);Vt(r.fullSize,u,d,m),Vt(l,u,d,m),Vt(c,u,d,m)&&Vt(l,u,d,m),Fa(u),Ki(r.leftAndTop,u,d,m),u.x+=u.w,u.y+=u.h,Ki(r.rightAndBottom,u,d,m),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},O(r.chartArea,g=>{const p=g.box;Object.assign(p,i.chartArea),p.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class Qs{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class Ra extends Qs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const me="$chartjs",Ea={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xi=i=>i===null||i==="";function za(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[me]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Xi(n)){const o=Fi(i,"width");o!==void 0&&(i.width=o)}if(Xi(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Fi(i,"height");o!==void 0&&(i.height=o)}return i}const Js=Ko?{passive:!0}:!1;function Ba(i,t,e){i&&i.addEventListener(t,e,Js)}function Va(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Js)}function Ha(i,t){const e=Ea[i.type]||i.type,{x:s,y:n}=bt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Me(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Na(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Me(r.addedNodes,s),a=a&&!Me(r.removedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function ja(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Me(r.removedNodes,s),a=a&&!Me(r.addedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Gt=new Map;let qi=0;function tn(){const i=window.devicePixelRatio;i!==qi&&(qi=i,Gt.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Wa(i,t){Gt.size||window.addEventListener("resize",tn),Gt.set(i,t)}function $a(i){Gt.delete(i),Gt.size||window.removeEventListener("resize",tn)}function Ya(i,t,e){const s=i.canvas,n=s&&hi(s);if(!n)return;const o=Fs((r,l)=>{const c=n.clientWidth;e(r,l),c<n.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(n),Wa(i,o),a}function Ve(i,t,e){e&&e.disconnect(),t==="resize"&&$a(i)}function Ua(i,t,e){const s=i.canvas,n=Fs(o=>{i.ctx!==null&&e(Ha(o,i))},i);return Ba(s,t,n),n}class Ka extends Qs{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(za(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[me])return!1;const s=e[me].initial;["height","width"].forEach(o=>{const a=s[o];C(a)?e.removeAttribute(o):e.setAttribute(o,a)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[me],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:Na,detach:ja,resize:Ya}[e]||Ua;n[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:Ve,detach:Ve,resize:Ve}[e]||Va)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Uo(t,e,s,n)}isAttached(t){const e=t&&hi(t);return!!(e&&e.isConnected)}}function Xa(i){return!ci()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Ra:Ka}class kt{constructor(){w(this,"x");w(this,"y");w(this,"active",!1);w(this,"options");w(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return ke(this.x)&&ke(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}w(kt,"defaults",{}),w(kt,"defaultRoutes");function qa(i,t){const e=i.options.ticks,s=Ga(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Qa(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>n)return Ja(t,c,o,a/n),c;const h=Za(o,t,n);if(a>0){let d,f;const u=a>1?Math.round((l-r)/(a-1)):null;for(le(t,c,h,C(u)?0:r-u,r),d=0,f=a-1;d<f;d++)le(t,c,h,o[d],o[d+1]);return le(t,c,h,l,C(u)?t.length:l+u),c}return le(t,c,h),c}function Ga(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Za(i,t,e){const s=tr(i),n=t.length/e;if(!s)return Math.max(n,1);const o=to(s);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>n)return l}return Math.max(n,1)}function Qa(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Ja(i,t,e,s){let n=0,o=e[0],a;for(s=Math.ceil(s),a=0;a<i.length;a++)a===o&&(t.push(i[a]),n++,o=e[n*s])}function le(i,t,e,s,n){const o=T(s,0),a=Math.min(T(n,i.length),i.length);let r=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,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 tr(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const er=i=>i==="left"?"right":i==="right"?"left":i,Gi=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Zi=(i,t)=>Math.min(t||i,i);function Qi(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function ir(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,a=i._endPixel,r=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,a-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-r||l>a+r)))return l}function sr(i,t){O(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Et(i){return i.drawTicks?i.tickLength:0}function Ji(i,t){if(!i.display)return 0;const e=$(i.font,t),s=it(i.padding);return(z(i.text)?i.text.length:1)*e.lineHeight+s.height}function nr(i,t){return Ct(i,{scale:t,type:"scale"})}function or(i,t,e){return Ct(i,{tick:e,index:t,type:"tick"})}function ar(i,t,e){let s=Is(i);return(e&&t!=="right"||!e&&t==="right")&&(s=er(s)),s}function rr(i,t,e,s){const{top:n,left:o,bottom:a,right:r,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,u,m;const g=a-n,p=r-o;if(i.isHorizontal()){if(u=jt(s,o,r),M(e)){const b=Object.keys(e)[0],_=e[b];m=h[b].getPixelForValue(_)+g-t}else e==="center"?m=(c.bottom+c.top)/2+g-t:m=Gi(i,e,t);f=r-o}else{if(M(e)){const b=Object.keys(e)[0],_=e[b];u=h[b].getPixelForValue(_)-p+t}else e==="center"?u=(c.left+c.right)/2-p+t:u=Gi(i,e,t);m=jt(s,a,n),d=e==="left"?-U:U}return{titleX:u,titleY:m,maxWidth:f,rotation:d}}class Tt extends kt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=q(t,Number.POSITIVE_INFINITY),e=q(e,Number.NEGATIVE_INFINITY),s=q(s,Number.POSITIVE_INFINITY),n=q(n,Number.NEGATIVE_INFINITY),{min:q(t,s),max:q(e,n),minDefined:Y(t),maxDefined:Y(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),a;if(n&&o)return{min:e,max:s};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),n||(e=Math.min(e,a.min)),o||(s=Math.max(s,a.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:q(e,q(s,e)),max:q(s,q(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){L(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ao(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?Qi(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=qa(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){L(this.options.afterUpdate,[this])}beforeSetDimensions(){L(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(){L(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),L(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){L(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=L(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){L(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){L(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Zi(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let a=n,r,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=K(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/s:u/(s-1),d+6>r&&(r=u/(s-(t.offset?.5:1)),l=this.maxHeight-Et(t.grid)-e.padding-Ji(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),a=so(Math.min(Math.asin(K((h.highest.height+6)/r,-1,1)),Math.asin(K(l/c,-1,1))-Math.asin(K(f/c,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){L(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){L(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Ji(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Et(o)+l):(t.height=this.maxHeight,t.width=Et(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,m=_t(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(r){const b=s.mirror?0:p*d.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+b+u)}else{const b=s.mirror?0:g*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+b+u)}this._calculatePadding(c,h,p,g)}}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,s,n){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,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,u=0;l?c?(f=n*t.width,u=s*e.height):(f=s*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=e.width/2),this.paddingLeft=Math.max((f-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+a)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+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(){L(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)C(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Qi(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Zi(e,s));let c=0,h=0,d,f,u,m,g,p,b,_,y,v,x;for(d=0;d<e;d+=l){if(m=t[d].label,g=this._resolveTickFontOptions(d),n.font=p=g.string,b=o[p]=o[p]||{data:{},gc:[]},_=g.lineHeight,y=v=0,!C(m)&&!z(m))y=Oi(n,b.data,b.gc,y,m),v=_;else if(z(m))for(f=0,u=m.length;f<u;++f)x=m[f],!C(x)&&!z(x)&&(y=Oi(n,b.data,b.gc,y,x),v+=_);a.push(y),r.push(v),c=Math.max(y,c),h=Math.max(v,h)}sr(o,e);const S=a.indexOf(c),k=r.indexOf(h),P=D=>({width:a[D]||0,height:r[D]||0});return{first:P(0),last:P(e-1),widest:P(S),highest:P(k),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 ro(this._alignToPixels?pt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=or(this.getContext(),t,s))}return this.$context||(this.$context=nr(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=_t(this.labelRotation),s=Math.abs(Math.cos(e)),n=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*s>r*n?r/s:l/n:l*n<r*s?l/s:r/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Et(o),u=[],m=r.setContext(this.getContext()),g=m.display?m.width:0,p=g/2,b=function(B){return pt(s,B,g)};let _,y,v,x,S,k,P,D,I,R,E,X;if(a==="top")_=b(this.bottom),k=this.bottom-f,D=_-p,R=b(t.top)+p,X=t.bottom;else if(a==="bottom")_=b(this.top),R=t.top,X=b(t.bottom)-p,k=_+p,D=this.top+f;else if(a==="left")_=b(this.right),S=this.right-f,P=_-p,I=b(t.left)+p,E=t.right;else if(a==="right")_=b(this.left),I=t.left,E=b(t.right)-p,S=_+p,P=this.left+f;else if(e==="x"){if(a==="center")_=b((t.top+t.bottom)/2+.5);else if(M(a)){const B=Object.keys(a)[0],j=a[B];_=b(this.chart.scales[B].getPixelForValue(j))}R=t.top,X=t.bottom,k=_+p,D=k+f}else if(e==="y"){if(a==="center")_=b((t.left+t.right)/2);else if(M(a)){const B=Object.keys(a)[0],j=a[B];_=b(this.chart.scales[B].getPixelForValue(j))}S=_-p,P=S-f,I=t.left,E=t.right}const st=T(n.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/st));for(y=0;y<d;y+=A){const B=this.getContext(y),j=o.setContext(B),Qt=r.setContext(B),Jt=j.lineWidth,wt=j.color,te=Qt.dash||[],Mt=Qt.dashOffset,At=j.tickWidth,dt=j.tickColor,Lt=j.tickBorderDash||[],ft=j.tickBorderDashOffset;v=ir(this,y,l),v!==void 0&&(x=pt(s,v,Jt),c?S=P=I=E=x:k=D=R=X=x,u.push({tx1:S,ty1:k,tx2:P,ty2:D,x1:I,y1:R,x2:E,y2:X,width:Jt,color:wt,borderDash:te,borderDashOffset:Mt,tickWidth:At,tickColor:dt,tickBorderDash:Lt,tickBorderDashOffset:ft}))}return this._ticksLength=d,this._borderValue=_,u}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Et(s.grid),u=f+h,m=d?-h:u,g=-_t(this.labelRotation),p=[];let b,_,y,v,x,S,k,P,D,I,R,E,X="middle";if(n==="top")S=this.bottom-m,k=this._getXAxisLabelAlignment();else if(n==="bottom")S=this.top+m,k=this._getXAxisLabelAlignment();else if(n==="left"){const A=this._getYAxisLabelAlignment(f);k=A.textAlign,x=A.x}else if(n==="right"){const A=this._getYAxisLabelAlignment(f);k=A.textAlign,x=A.x}else if(e==="x"){if(n==="center")S=(t.top+t.bottom)/2+u;else if(M(n)){const A=Object.keys(n)[0],B=n[A];S=this.chart.scales[A].getPixelForValue(B)+u}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")x=(t.left+t.right)/2-u;else if(M(n)){const A=Object.keys(n)[0],B=n[A];x=this.chart.scales[A].getPixelForValue(B)}k=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const st=this._getLabelSizes();for(b=0,_=r.length;b<_;++b){y=r[b],v=y.label;const A=o.setContext(this.getContext(b));P=this.getPixelForTick(b)+o.labelOffset,D=this._resolveTickFontOptions(b),I=D.lineHeight,R=z(v)?v.length:1;const B=R/2,j=A.color,Qt=A.textStrokeColor,Jt=A.textStrokeWidth;let wt=k;a?(x=P,k==="inner"&&(b===_-1?wt=this.options.reverse?"left":"right":b===0?wt=this.options.reverse?"right":"left":wt="center"),n==="top"?c==="near"||g!==0?E=-R*I+I/2:c==="center"?E=-st.highest.height/2-B*I+I:E=-st.highest.height+I/2:c==="near"||g!==0?E=I/2:c==="center"?E=st.highest.height/2-B*I:E=st.highest.height-R*I,d&&(E*=-1),g!==0&&!A.showLabelBackdrop&&(x+=I/2*Math.sin(g))):(S=P,E=(1-R)*I/2);let te;if(A.showLabelBackdrop){const Mt=it(A.backdropPadding),At=st.heights[b],dt=st.widths[b];let Lt=E-Mt.top,ft=0-Mt.left;switch(X){case"middle":Lt-=At/2;break;case"bottom":Lt-=At;break}switch(k){case"center":ft-=dt/2;break;case"right":ft-=dt;break;case"inner":b===_-1?ft-=dt:b>0&&(ft-=dt/2);break}te={left:ft,top:Lt,width:dt+Mt.width,height:At+Mt.height,color:A.backdropColor}}p.push({label:v,font:D,textOffset:E,options:{rotation:g,color:j,strokeColor:Qt,strokeWidth:Jt,textAlign:wt,textBaseline:X,translation:[x,S],backdrop:te}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-_t(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=n.length;o<a;++o){const l=n[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:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=pt(t,this.left,a)-a/2,h=pt(t,this.right,r)+r/2,d=f=l):(d=pt(t,this.top,a)-a/2,f=pt(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&Vs(s,n);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,h=a.textOffset;Xe(s,c,0,h,l,r)}n&&Hs(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=$(s.font),a=it(s.padding),r=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||M(e)?(l+=a.bottom,z(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=rr(this,l,e,r);Xe(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:ar(r,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=T(t.grid&&t.grid.z,-1),n=T(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Tt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[s]===this.id&&(!t||r.type===t)&&n.push(r)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return $(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ce{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;hr(e)&&(s=this.register(e));const n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,lr(t,a,s),this.override&&F.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in F[n]&&(delete F[n][s],this.override&&delete vt[s])}}function lr(i,t,e){const s=Xt(Object.create(null),[e?F.get(e):{},F.get(t),i.defaults]);F.set(t,s),i.defaultRoutes&&cr(t,i.defaultRoutes),i.descriptors&&F.describe(t,i.descriptors)}function cr(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");F.route(o,n,l,r)})}function hr(i){return"id"in i&&"defaults"in i}class dr{constructor(){this.controllers=new ce(Ut,"datasets",!0),this.elements=new ce(kt,"elements"),this.plugins=new ce(Object,"plugins"),this.scales=new ce(Tt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):O(n,a=>{const r=s||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,s){const n=ni(t);L(s["before"+n],[],s),e[t](s),L(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var Z=new dr;class fr{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,s,n){n=n||{};for(const o of t){const a=o.plugin,r=a[s],l=[e,n,o.options];if(L(r,l,a)===!1&&n.cancelable)return!1}return!0}invalidate(){C(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=T(s.options&&s.options.plugins,{}),o=ur(s);return n===!1&&!e?[]:pr(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function ur(i){const t={},e=[],s=Object.keys(Z.plugins.items);for(let o=0;o<s.length;o++)e.push(Z.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const a=n[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function gr(i,t){return!t&&i===!1?null:i===!0?{}:i}function pr(i,{plugins:t,localIds:e},s,n){const o=[],a=i.getContext();for(const r of t){const l=r.id,c=gr(s[l],n);c!==null&&o.push({plugin:r,options:mr(i.config,{plugin:r,local:e[l]},c,a)})}return o}function mr(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ge(i,t){const e=F.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function br(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function _r(i,t){return i===t?"_index_":"_value_"}function ts(i){if(i==="x"||i==="y"||i==="r")return i}function xr(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Ze(i,...t){if(ts(i))return i;for(const e of t){const s=e.axis||xr(e.position)||i.length>1&&ts(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function es(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function yr(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return es(i,"x",e[0])||es(i,"y",e[0])}return{}}function vr(i,t){const e=vt[i.type]||{scales:{}},s=t.scales||{},n=Ge(i.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{const r=s[a];if(!M(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=Ze(a,r,yr(a,i),F.scales[r.type]),c=_r(l,n),h=e.scales||{};o[a]=Nt(Object.create(null),[{axis:l},r,h[l],h[c]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||Ge(r,t),h=(vt[r]||{}).scales||{};Object.keys(h).forEach(d=>{const f=br(d,l),u=a[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Nt(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(a=>{const r=o[a];Nt(r,[F.scales[r.type],F.scale])}),o}function en(i){const t=i.options||(i.options={});t.plugins=T(t.plugins,{}),t.scales=vr(i,t)}function sn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function kr(i){return i=i||{},i.data=sn(i.data),en(i),i}const is=new Map,nn=new Set;function he(i,t){let e=is.get(i);return e||(e=t(),is.set(i,e),nn.add(e)),e}const zt=(i,t,e)=>{const s=Ot(t,e);s!==void 0&&i.add(s)};class wr{constructor(t){this._config=kr(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=sn(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(),en(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return he(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return he(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return he(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return he(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,a=this._cachedScopes(t,s),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>zt(l,t,d))),h.forEach(d=>zt(l,n,d)),h.forEach(d=>zt(l,vt[o]||{},d)),h.forEach(d=>zt(l,F,d)),h.forEach(d=>zt(l,Ke,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),nn.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,vt[e]||{},F.datasets[e]||{},{type:e},F,Ke]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=ss(this._resolverCache,t,n);let l=a;if(Sr(a,e)){o.$shared=!1,s=ht(s)?s():s;const c=this.createResolver(t,s,r);l=Dt(a,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=ss(this._resolverCache,t,s);return M(e)?Dt(o,e,void 0,n):o}}function ss(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:ai(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},s.set(n,o)),o}const Mr=i=>M(i)&&Object.getOwnPropertyNames(i).some(t=>ht(i[t]));function Sr(i,t){const{isScriptable:e,isIndexable:s}=Ws(i);for(const n of t){const o=e(n),a=s(n),r=(a||o)&&i[n];if(o&&(ht(r)||Mr(r))||a&&z(r))return!0}return!1}var Pr="4.4.4";const Or=["top","bottom","left","right","chartArea"];function ns(i,t){return i==="top"||i==="bottom"||Or.indexOf(i)===-1&&t==="x"}function os(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function as(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),L(e&&e.onComplete,[i],t)}function Dr(i){const t=i.chart,e=t.options.animation;L(e&&e.onProgress,[i],t)}function on(i){return ci()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const be={},rs=i=>{const t=on(i);return Object.values(be).filter(e=>e.canvas===t).pop()};function Cr(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const a=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=a)}}}function Tr(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function de(i,t,e){return i.options.clip?i[e]:t[e]}function Ar(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:de(e,t,"left"),right:de(e,t,"right"),top:de(s,t,"top"),bottom:de(s,t,"bottom")}:t}var nt;let De=(nt=class{static register(...t){Z.add(...t),ls()}static unregister(...t){Z.remove(...t),ls()}constructor(t,e){const s=this.config=new wr(e),n=on(t),o=rs(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Xa(n)),this.platform.updateConfig(s);const r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Un(),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 fr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=fo(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],be[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}J.listen(this,"complete",as),J.listen(this,"progress",Dr),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return C(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Z}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Li(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Di(this.canvas,this.ctx),this}stop(){return J.stop(this),this}resize(t,e){J.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Li(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),L(s.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};O(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=Ze(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),O(o,a=>{const r=a.options,l=r.id,c=Ze(l,r),h=T(r.type,a.dtype);(r.position===void 0||ns(r.position,c)!==ns(a.dposition))&&(r.position=a.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const f=Z.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(r,t)}),O(n,(a,r)=>{a||delete s[r]}),O(s,a=>{at.configure(this,a,a.options),at.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(os("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let a=this.getDatasetMeta(s);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=r,a.indexAxis=o.indexAxis||Ge(r,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const l=Z.getController(r),{datasetElementType:c,dataElementType:h}=F.datasets[r];Object.assign(l,{dataElementType:Z.getElement(h),datasetElementType:c&&Z.getElement(c)}),a.controller=new l(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){O(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),n||O(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(os("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){O(this.scales,t=>{at.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!bi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const a=s==="_removeElements"?-o:o;Cr(t,n,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!bi(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;at.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],O(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,ht(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(J.has(this)?this.attached&&!J.running(this)&&J.start(this):(this.draw(),as({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const a=e[n];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=Ar(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(n&&Vs(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&Hs(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Bs(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Oa.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Ct(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);qt(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),J.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(),Di(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete be[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};O(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){O(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},O(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[n+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=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}});!xe(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),a=o(e,t),r=s?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,s,a),l=Qn(t),c=Tr(t,this._lastEvent,s,l);s&&(this._lastEvent=null,L(o.onHover,[t,r,this],this),l&&L(o.onClick,[t,r,this],this));const h=!xe(r,n);return(h||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}},w(nt,"defaults",F),w(nt,"instances",be),w(nt,"overrides",vt),w(nt,"registry",Z),w(nt,"version",Pr),w(nt,"getChart",rs),nt);function ls(){return O(De.instances,i=>i._plugins.invalidate())}function an(i,t){const{x:e,y:s,base:n,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,l,c,h,d;return i.horizontal?(d=a/2,r=Math.min(e,n),l=Math.max(e,n),c=s-d,h=s+d):(d=o/2,r=e-d,l=e+d,c=Math.min(s,n),h=Math.max(s,n)),{left:r,top:c,right:l,bottom:h}}function rt(i,t,e,s){return i?0:K(t,e,s)}function Lr(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=js(s);return{t:rt(n.top,o.top,0,e),r:rt(n.right,o.right,0,t),b:rt(n.bottom,o.bottom,0,e),l:rt(n.left,o.left,0,t)}}function Fr(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=Yt(n),a=Math.min(t,e),r=i.borderSkipped,l=s||M(n);return{topLeft:rt(!l||r.top||r.left,o.topLeft,0,a),topRight:rt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:rt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:rt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Ir(i){const t=an(i),e=t.right-t.left,s=t.bottom-t.top,n=Lr(i,e/2,s/2),o=Fr(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function He(i,t,e,s){const n=t===null,o=e===null,r=i&&!(n&&o)&&an(i,s);return r&&(n||vi(t,r.left,r.right))&&(o||vi(e,r.top,r.bottom))}function Rr(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Er(i,t){i.rect(t.x,t.y,t.w,t.h)}function Ne(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,a=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+a,radius:i.radius}}class _e extends kt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:a}=Ir(this),r=Rr(a.radius)?qe:Er;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,Ne(a,e,o)),t.clip(),r(t,Ne(o,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),r(t,Ne(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return He(this,t,e,s)}inXRange(t,e){return He(this,t,null,e)}inYRange(t,e){return He(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}w(_e,"id","bar"),w(_e,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),w(_e,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});class rn extends kt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=z(s.text)?s.text.length:1;this._padding=it(s.padding);const o=n*$(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:a}=this,r=a.align;let l=0,c,h,d;return this.isHorizontal()?(h=jt(r,s,o),d=e+t,c=o-s):(a.position==="left"?(h=s+t,d=jt(r,n,e),l=V*-.5):(h=o-t,d=jt(r,e,n),l=V*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=$(e.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Xe(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:Is(e.align),textBaseline:"middle",translation:[a,r]})}}function zr(i,t){const e=new rn({ctx:i.ctx,options:t,chart:i});at.configure(i,e,t),at.addBox(i,e),i.titleBlock=e}var Br={id:"title",_element:rn,start(i,t,e){zr(i,e)},stop(i){const t=i.titleBlock;at.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;at.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ht={average(i){if(!i.length)return!1;let t,e,s=new Set,n=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();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((r,l)=>r+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=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=oo(t,c);h<n&&(n=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function G(i,t){return t&&(z(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function tt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
17`)>-1?i.split(`
18`):i}function Vr(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function cs(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=$(t.bodyFont),c=$(t.titleFont),h=$(t.footerFont),d=o.length,f=n.length,u=s.length,m=it(t.padding);let g=m.height,p=0,b=s.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=u*v+(b-u)*l.lineHeight+(b-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let _=0;const y=function(v){p=Math.max(p,e.measureText(v).width+_)};return e.save(),e.font=c.string,O(i.title,y),e.font=l.string,O(i.beforeBody.concat(i.afterBody),y),_=t.displayColors?a+2+t.boxPadding:0,O(s,v=>{O(v.before,y),O(v.lines,y),O(v.after,y)}),_=0,e.font=h.string,O(i.footer,y),e.restore(),p+=m.width,{width:p,height:g}}function Hr(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Nr(i,t,e,s){const{x:n,width:o}=s,a=e.caretSize+e.caretPadding;if(i==="left"&&n+o+a>t.width||i==="right"&&n-o-a<0)return!0}function jr(i,t,e,s){const{x:n,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let c="center";return s==="center"?c=n<=(r+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),Nr(c,i,t,e)&&(c="center"),c}function hs(i,t,e){const s=e.yAlign||t.yAlign||Hr(i,e);return{xAlign:e.xAlign||t.xAlign||jr(i,t,e,s),yAlign:s}}function Wr(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function $r(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function ds(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=Yt(a);let m=Wr(t,r);const g=$r(t,l,c);return l==="center"?r==="left"?m+=c:r==="right"&&(m-=c):r==="left"?m-=Math.max(h,f)+n:r==="right"&&(m+=Math.max(d,u)+n),{x:K(m,0,s.width-t.width),y:K(g,0,s.height-t.height)}}function fe(i,t,e){const s=it(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function fs(i){return G([],tt(i))}function Yr(i,t,e){return Ct(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function us(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const ln={beforeTitle:Q,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:Q,beforeBody:Q,beforeLabel:Q,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 C(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:Q,afterBody:Q,beforeFooter:Q,footer:Q,afterFooter:Q};function H(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?ln[t].call(e,s):n}class Qe extends kt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Ks(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Yr(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=H(s,"beforeTitle",this,t),o=H(s,"title",this,t),a=H(s,"afterTitle",this,t);let r=[];return r=G(r,tt(n)),r=G(r,tt(o)),r=G(r,tt(a)),r}getBeforeBody(t,e){return fs(H(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return O(t,o=>{const a={before:[],lines:[],after:[]},r=us(s,o);G(a.before,tt(H(r,"beforeLabel",this,o))),G(a.lines,H(r,"label",this,o)),G(a.after,tt(H(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return fs(H(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=H(s,"beforeFooter",this,t),o=H(s,"footer",this,t),a=H(s,"afterFooter",this,t);let r=[];return r=G(r,tt(n)),r=G(r,tt(o)),r=G(r,tt(a)),r}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(Vr(this.chart,e[l]));return t.filter&&(r=r.filter((h,d,f)=>t.filter(h,d,f,s))),t.itemSort&&(r=r.sort((h,d)=>t.itemSort(h,d,s))),O(r,h=>{const d=us(t.callbacks,h);n.push(H(d,"labelColor",this,h)),o.push(H(d,"labelPointStyle",this,h)),a.push(H(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,a=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const r=Ht[s.position].call(this,n,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const l=this._size=cs(this,s),c=Object.assign({},r,l),h=hs(this.chart,s,c),d=ds(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.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&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Yt(r),{x:f,y:u}=t,{width:m,height:g}=e;let p,b,_,y,v,x;return o==="center"?(v=u+g/2,n==="left"?(p=f,b=p-a,y=v+a,x=v-a):(p=f+m,b=p+a,y=v-a,x=v+a),_=p):(n==="left"?b=f+Math.max(l,h)+a:n==="right"?b=f+m-Math.max(c,d)-a:b=this.caretX,o==="top"?(y=u,v=y-a,p=b-a,_=b+a):(y=u+g,v=y+a,p=b+a,_=b-a),x=y),{x1:p,x2:b,x3:_,y1:y,y2:v,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let a,r,l;if(o){const c=Fe(s.rtl,this.x,this.width);for(t.x=fe(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",a=$(s.titleFont),r=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=s.titleMarginBottom-r)}}_drawColorBox(t,e,s,n,o){const a=this.labelColors[s],r=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=$(o.bodyFont),d=fe(this,"left",o),f=n.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,m=e.y+u;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation},p=n.leftForLtr(f,c)+c/2,b=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ci(t,g,p,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Ci(t,g,p,b)}else{t.lineWidth=M(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 g=n.leftForLtr(f,c),p=n.leftForLtr(n.xPlus(f,1),c-2),b=Yt(a.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,qe(t,{x:g,y:m,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),qe(t,{x:p,y:m+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,c,l),t.strokeRect(g,m,c,l),t.fillStyle=a.backgroundColor,t.fillRect(p,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=$(s.bodyFont);let f=d.lineHeight,u=0;const m=Fe(s.rtl,this.x,this.width),g=function(P){e.fillText(P,m.x(t.x+u),t.y+f/2),t.y+=f+o},p=m.textAlign(a);let b,_,y,v,x,S,k;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=fe(this,p,s),e.fillStyle=s.bodyColor,O(this.beforeBody,g),u=r&&p!=="right"?a==="center"?c/2+h:c+2+h:0,v=0,S=n.length;v<S;++v){for(b=n[v],_=this.labelTextColors[v],e.fillStyle=_,O(b.before,g),y=b.lines,r&&y.length&&(this._drawColorBox(e,t,v,m,s),f=Math.max(d.lineHeight,l)),x=0,k=y.length;x<k;++x)g(y[x]),f=d.lineHeight;O(b.after,g)}u=0,f=d.lineHeight,O(this.afterBody,g),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let a,r;if(o){const l=Fe(s.rtl,this.x,this.width);for(t.x=fe(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",a=$(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:m}=Yt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+d,l),a==="top"&&this.drawCaret(t,e,s,n),e.lineTo(r+c-f,l),e.quadraticCurveTo(r+c,l,r+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(r+c,l+h-m),e.quadraticCurveTo(r+c,l+h,r+c-m,l+h),a==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(r+u,l+h),e.quadraticCurveTo(r,l+h,r,l+h-u),a==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const a=Ht[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=cs(this,t),l=Object.assign({},a,this._size),c=hs(e,t,l),h=ds(t,l,c,e);(n._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 s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=it(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=s,this.drawBackground(o,t,n,e),Go(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Zo(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=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=!xe(s,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),r=this._positionChanged(a,t),l=e||!xe(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.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,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,a=Ht[o.position].call(this,t,e);return a!==!1&&(s!==a.x||n!==a.y)}}w(Qe,"positioners",Ht);var Ur={id:"tooltip",_element:Qe,positioners:Ht,afterInit(i,t,e){e&&(i.tooltip=new Qe({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:ln},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"]};const Kr=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Xr(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Kr(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const qr=(i,t)=>i===null?null:K(Math.round(i),0,t);function gs(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class Je extends Tt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(C(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Xr(s,t,T(e,t),this._addedLabels),qr(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)n.push({value:a});return n}getLabelForValue(t){return gs.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}}w(Je,"id","category"),w(Je,"defaults",{ticks:{callback:gs}});function Gr(i,t){const e=[],{bounds:n,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,u=o||1,m=h-1,{min:g,max:p}=t,b=!C(a),_=!C(r),y=!C(c),v=(p-g)/(d+1);let x=xi((p-g)/m/u)*u,S,k,P,D;if(x<1e-14&&!b&&!_)return[{value:g},{value:p}];D=Math.ceil(p/x)-Math.floor(g/x),D>m&&(x=xi(D*x/m/u)*u),C(l)||(S=Math.pow(10,l),x=Math.ceil(x*S)/S),n==="ticks"?(k=Math.floor(g/x)*x,P=Math.ceil(p/x)*x):(k=g,P=p),b&&_&&o&&eo((r-a)/o,x/1e3)?(D=Math.round(Math.min((r-a)/x,h)),x=(r-a)/D,k=a,P=r):y?(k=b?a:k,P=_?r:P,D=c-1,x=(P-k)/D):(D=(P-k)/x,ge(D,Math.round(D),x/1e3)?D=Math.round(D):D=Math.ceil(D));const I=Math.max(yi(x),yi(k));S=Math.pow(10,C(l)?I:l),k=Math.round(k*S)/S,P=Math.round(P*S)/S;let R=0;for(b&&(f&&k!==a?(e.push({value:a}),k<a&&R++,ge(Math.round((k+R*x)*S)/S,a,ps(a,v,i))&&R++):k<a&&R++);R<D;++R){const E=Math.round((k+R*x)*S)/S;if(_&&E>r)break;e.push({value:E})}return _&&f&&P!==r?e.length&&ge(e[e.length-1].value,r,ps(r,v,i))?e[e.length-1].value=r:e.push({value:r}):(!_||P===r)&&e.push({value:P}),e}function ps(i,t,{horizontal:e,minRotation:s}){const n=_t(s),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class Zr extends Tt{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 C(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const a=l=>n=e?n:l,r=l=>o=s?o:l;if(t){const l=ct(n),c=ct(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Gr(n,o);return t.bounds==="ticks"&&io(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,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Es(t,this.chart.options.locale,this.options.ticks.format)}}class ti extends Zr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Y(t)?t:0,this.max=Y(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=_t(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}w(ti,"id","linear"),w(ti,"defaults",{ticks:{callback:zs.formatters.numeric}});const Ce={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}},N=Object.keys(Ce);function ms(i,t){return i-t}function bs(i,t){if(C(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),Y(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(n&&(a=n==="week"&&(ke(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function _s(i,t,e,s){const n=N.length;for(let o=N.indexOf(i);o<n-1;++o){const a=Ce[N[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=s)return N[o]}return N[n-1]}function Qr(i,t,e,s,n){for(let o=N.length-1;o>=N.indexOf(e);o--){const a=N[o];if(Ce[a].common&&i._adapter.diff(n,s,a)>=t-1)return a}return N[e?N.indexOf(e):0]}function Jr(i){for(let t=N.indexOf(i)+1,e=N.length;t<e;++t)if(Ce[N[t]].common)return N[t]}function xs(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=oi(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function tl(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=e[r],l>=0&&(t[l].major=!0);return t}function ys(i,t,e){const s=[],n={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],n[r]=a,s.push({value:r,major:!1});return o===0||!e?s:tl(i,s,n,e)}class Se extends Tt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new ka._date(t.adapters.date);n.init(e),Nt(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:bs(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}
vendor: 6,346 bytes, line 18
18(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=Y(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=Y(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,a=this.max,r=co(n,o,a);return this._unit=e.unit||(s.autoSkip?_s(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Qr(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Jr(this._unit),this.initOffsets(n),t.reverse&&r.reverse(),ys(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=K(e,0,a),s=K(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||_s(o.minUnit,e,s,this._getLabelCapacity(e)),r=T(n.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=ke(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(s,e,a)>1e5*r)throw new Error(e+" and "+s+" are too far apart with stepSize of "+r+" "+a);const m=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<s;f=+t.add(f,r,a),u++)xs(h,f,m);return(f===s||n.bounds==="ticks"||u===1)&&xs(h,f,m),Object.keys(h).sort(ms).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,a=e||n[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,n){const o=this.options,a=o.ticks.callback;if(a)return L(a,[t,e,s],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],d=c&&r[c],f=s[e],u=c&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=_t(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:s*o+r*a,h:s*a+r*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,ys(this,[t],this._majorUnit),n),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,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(bs(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return As(t.sort(ms))}}w(Se,"id","time"),w(Se,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ue(i,t,e){let s=0,n=i.length-1,o,a,r,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Ue(i,"pos",t)),{pos:o,time:r}=i[s],{pos:a,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Ue(i,"time",t)),{time:o,pos:r}=i[s],{time:a,pos:l}=i[n]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class vs extends Se{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=ue(e,this.min),this._tableRange=ue(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,r=n.length;a<r;++a)h=n[a+1],l=n[a-1],c=n[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 s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(ue(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return ue(this._table,s*this._tableRange+this._minPos,!0)}}w(vs,"id","timeseries"),w(vs,"defaults",Se.defaults);const cn={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},el={ariaLabel:{type:String},ariaDescribedby:{type:String}},il={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...cn,...el},sl=gn[0]==="2"?(i,t)=>Object.assign(i,{attrs:t}):(i,t)=>Object.assign(i,t);function Pt(i){return Ms(i)?$e(i):i}function nl(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return Ms(t)?new Proxy(i,{}):i}function ol(i,t){const e=i.options;
18e&&t&&Object.assign(e,t)}function hn(i,t){i.labels=t}function dn(i,t,e){const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(a=>a[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function al(i,t){const e={labels:[],datasets:[]};return hn(e,i.labels),dn(e,i.datasets,t),e}const rl=ks({props:il,setup(i,t){let{expose:e,slots:s}=t;const n=pn(null),o=ws(null);e({chart:o});const a=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:f,datasetIdKey:u}=i,m=al(h,u),g=nl(m,h);o.value=new De(n.value,{type:c,data:g,options:{...d},plugins:f})},r=()=>{const c=$e(o.value);c&&(i.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},i.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(i.updateMode)};return mn(a),bn(r),_n([()=>i.options,()=>i.data],(c,h)=>{let[d,f]=c,[u,m]=h;const g=$e(o.value);if(!g)return;let p=!1;if(d){const b=Pt(d),_=Pt(u);b&&b!==_&&(ol(g,b),p=!0)}if(f){const b=Pt(f.labels),_=Pt(m.labels),y=Pt(f.datasets),v=Pt(m.datasets);b!==_&&(hn(g.config.data,b),p=!0),y&&y!==v&&(dn(g.config.data,y,i.datasetIdKey),p=!0)}p&&xn(()=>{l(g)})},{deep:!0}),()=>We("canvas",{role:"img",ariaLabel:i.ariaLabel,ariaDescribedby:i.ariaDescribedby,ref:n},[We("p",{},[s.default?s.default():""])])}});function ll(i,t){return De.register(t),ks({props:cn,setup(e,s){let{expose:n}=s;const o=ws(null),a=r=>{o.value=r==null?void 0:r.chart};return n({chart:o}),()=>We(rl,sl({ref:a},{type:i,...e}))}})}const cl=ll("bar",pe),je='Inter,-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',ul={__name:"BarChart",props:{collection:{type:Object,default:()=>({})},chartOptions:{type:Object,default:()=>({})}},setup(i){const t=i;De.register(Br,Ur,_e,Je,ti);const e={responsive:!0,maintainAspectRatio:!1,legend:{display:!1,labels:{fontFamily:je}},animation:{duration:0},datasets:{bar:{barPercentage:1}},scales:{x:{ticks:{fontFamily:je},grid:{drawOnChartArea:!1}},y:{type:"linear",position:"left",ticks:{fontFamily:je,beginAtZero:!0,stepSize:1},grid:{drawOnChartArea:!1}}}},s=yn(()=>({...e,...t.chartOptions}));return(n,o)=>(vn(),kn(wn(cl),{data:i.collection,options:s.value},null,8,["data","options"]))}};export{ul as _};
19//# sourceMappingURL=BarChart-CNdiqjj3.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.