%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/projetos/radar.ongrace.com.br/
Upload File :
Create Path :
Current File : /var/www/projetos/radar.ongrace.com.br/18.js

/*! For license information please see 18.js.LICENSE.txt */
(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{203:function(t,e,i){"use strict";const n="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function o(t,e,i){const o=i||(t=>Array.prototype.slice.call(t));let s=!1,a=[];return function(...i){a=o(i),s||(s=!0,n.call(window,()=>{s=!1,t.apply(e,a)}))}}const s=t=>"start"===t?"left":"end"===t?"right":"center",a=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;const r=function(){let t=0;return function(){return t++}}();function l(t){return null==t}function c(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function h(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const d=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function u(t,e){return d(t)?t:e}function g(t,e){return void 0===t?e:t}const f=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function p(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function m(t,e,i,n){let o,s,a;if(c(t))if(s=t.length,n)for(o=s-1;o>=0;o--)e.call(i,t[o],o);else for(o=0;o<s;o++)e.call(i,t[o],o);else if(h(t))for(a=Object.keys(t),s=a.length,o=0;o<s;o++)e.call(i,t[a[o]],a[o])}function b(t,e){let i,n,o,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(o=t[i],s=e[i],o.datasetIndex!==s.datasetIndex||o.index!==s.index)return!1;return!0}function x(t){if(c(t))return t.map(x);if(h(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let o=0;for(;o<n;++o)e[i[o]]=x(t[i[o]]);return e}return t}function _(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function y(t,e,i,n){if(!_(t))return;const o=e[t],s=i[t];h(o)&&h(s)?v(o,s,n):e[t]=x(s)}function v(t,e,i){const n=c(e)?e:[e],o=n.length;if(!h(t))return t;const s=(i=i||{}).merger||y;for(let a=0;a<o;++a){if(!h(e=n[a]))continue;const o=Object.keys(e);for(let n=0,a=o.length;n<a;++n)s(o[n],t,e,i)}return t}function M(t,e){return v(t,e,{merger:w})}function w(t,e,i){if(!_(t))return;const n=e[t],o=i[t];h(n)&&h(o)?M(n,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=x(o))}function k(t,e){const i=t.indexOf(".",e);return-1===i?t.length:i}function S(t,e){if(""===e)return t;let i=0,n=k(e,i);for(;t&&n>i;)t=t[e.substr(i,n-i)],i=n+1,n=k(e,i);return t}function P(t){return t.charAt(0).toUpperCase()+t.slice(1)}const O=t=>void 0!==t,D=t=>"function"==typeof t,C=Math.PI,T=2*C,A=T+C,R=Number.POSITIVE_INFINITY,L=C/180,E=C/2,F=C/4,I=2*C/3,z=Math.log10,V=Math.sign;function B(t){const e=Math.round(t);t=W(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(z(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function N(t){return!isNaN(parseFloat(t))&&isFinite(t)}function W(t,e,i){return Math.abs(t-e)<i}function j(t,e,i){let n,o,s;for(n=0,o=t.length;n<o;n++)s=t[n][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function H(t){return t*(C/180)}function $(t){return t*(180/C)}function Y(t){if(!d(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function U(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function X(t,e){return(t-e+A)%T-C}function q(t){return(t%T+T)%T}function K(t,e,i,n){const o=q(t),s=q(e),a=q(i),r=q(s-o),l=q(a-o),c=q(o-s),h=q(o-a);return o===s||o===a||n&&s===a||r>l&&c<h}function G(t,e,i){return Math.max(e,Math.min(i,t))}const Z=t=>0===t||1===t,Q=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*T/i),J=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*T/i)+1,tt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*E),easeOutSine:t=>Math.sin(t*E),easeInOutSine:t=>-.5*(Math.cos(C*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Z(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Z(t)?t:Q(t,.075,.3),easeOutElastic:t=>Z(t)?t:J(t,.075,.3),easeInOutElastic(t){const e=.1125;return Z(t)?t:t<.5?.5*Q(2*t,e,.45):.5+.5*J(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-tt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*tt.easeInBounce(2*t):.5*tt.easeOutBounce(2*t-1)+.5},et={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},it="0123456789ABCDEF",nt=t=>it[15&t],ot=t=>it[(240&t)>>4]+it[15&t],st=t=>(240&t)>>4==(15&t);function at(t){var e=function(t){return st(t.r)&&st(t.g)&&st(t.b)&&st(t.a)}(t)?nt:ot;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function rt(t){return t+.5|0}const lt=(t,e,i)=>Math.max(Math.min(t,i),e);function ct(t){return lt(rt(2.55*t),0,255)}function ht(t){return lt(rt(255*t),0,255)}function dt(t){return lt(rt(t/2.55)/100,0,1)}function ut(t){return lt(rt(100*t),0,100)}const gt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const ft=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pt(t,e,i){const n=e*Math.min(i,1-i),o=(e,o=(e+t/30)%12)=>i-n*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}function mt(t,e,i){const n=(n,o=(n+t/60)%6)=>i-i*e*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function bt(t,e,i){const n=pt(t,1,.5);let o;for(e+i>1&&(o=1/(e+i),e*=o,i*=o),o=0;o<3;o++)n[o]*=1-e-i,n[o]+=e;return n}function xt(t){const e=t.r/255,i=t.g/255,n=t.b/255,o=Math.max(e,i,n),s=Math.min(e,i,n),a=(o+s)/2;let r,l,c;return o!==s&&(c=o-s,l=a>.5?c/(2-o-s):c/(o+s),r=o===e?(i-n)/c+(i<n?6:0):o===i?(n-e)/c+2:(e-i)/c+4,r=60*r+.5),[0|r,l||0,a]}function _t(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(ht)}function yt(t,e,i){return _t(pt,t,e,i)}function vt(t){return(t%360+360)%360}function Mt(t){const e=ft.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?ct(+e[5]):ht(+e[5]));const o=vt(+e[2]),s=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return _t(bt,t,e,i)}(o,s,a):"hsv"===e[1]?function(t,e,i){return _t(mt,t,e,i)}(o,s,a):yt(o,s,a),{r:i[0],g:i[1],b:i[2],a:n}}const wt={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"},kt={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"};let St;function Pt(t){St||(St=function(){const t={},e=Object.keys(kt),i=Object.keys(wt);let n,o,s,a,r;for(n=0;n<e.length;n++){for(a=r=e[n],o=0;o<i.length;o++)s=i[o],r=r.replace(s,wt[s]);s=parseInt(kt[a],16),t[r]=[s>>16&255,s>>8&255,255&s]}return t}(),St.transparent=[0,0,0,0]);const e=St[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function Ot(t,e,i){if(t){let n=xt(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=yt(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function Dt(t,e){return t?Object.assign(e||{},t):t}function Ct(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=ht(t[3]))):(e=Dt(t,{r:0,g:0,b:0,a:1})).a=ht(e.a),e}function Tt(t){return"r"===t.charAt(0)?function(t){const e=gt.exec(t);let i,n,o,s=255;if(e){if(e[7]!==i){const t=+e[7];s=255&(e[8]?ct(t):255*t)}return i=+e[1],n=+e[3],o=+e[5],i=255&(e[2]?ct(i):i),n=255&(e[4]?ct(n):n),o=255&(e[6]?ct(o):o),{r:i,g:n,b:o,a:s}}}(t):Mt(t)}class At{constructor(t){if(t instanceof At)return t;const e=typeof t;let i;var n,o,s;"object"===e?i=Ct(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?o={r:255&17*et[n[1]],g:255&17*et[n[2]],b:255&17*et[n[3]],a:5===s?17*et[n[4]]:255}:7!==s&&9!==s||(o={r:et[n[1]]<<4|et[n[2]],g:et[n[3]]<<4|et[n[4]],b:et[n[5]]<<4|et[n[6]],a:9===s?et[n[7]]<<4|et[n[8]]:255})),i=o||Pt(t)||Tt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Dt(this._rgb);return t&&(t.a=dt(t.a)),t}set rgb(t){this._rgb=Ct(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${dt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?at(this._rgb):this._rgb}hslString(){return this._valid?function(t){if(!t)return;const e=xt(t),i=e[0],n=ut(e[1]),o=ut(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${o}%, ${dt(t.a)})`:`hsl(${i}, ${n}%, ${o}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,o=t.rgb;let s;const a=e===s?.5:e,r=2*a-1,l=n.a-o.a,c=((r*l==-1?r:(r+l)/(1+r*l))+1)/2;s=1-c,n.r=255&c*n.r+s*o.r+.5,n.g=255&c*n.g+s*o.g+.5,n.b=255&c*n.b+s*o.b+.5,n.a=a*n.a+(1-a)*o.a,i.rgb=n}return i}clone(){return new At(this.rgb)}alpha(t){return this._rgb.a=ht(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=rt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.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 Ot(this._rgb,2,t),this}darken(t){return Ot(this._rgb,2,-t),this}saturate(t){return Ot(this._rgb,1,t),this}desaturate(t){return Ot(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=xt(t);i[0]=vt(i[0]+e),i=yt(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Rt(t){return new At(t)}const Lt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Et(t){return Lt(t)?t:Rt(t)}function Ft(t){return Lt(t)?t:Rt(t).saturate(.5).darken(.1).hexString()}const It=Object.create(null),zt=Object.create(null);function Vt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;e<n;++e){const n=i[e];t=t[n]||(t[n]=Object.create(null))}return t}function Bt(t,e,i){return"string"==typeof e?v(Vt(t,e),i):v(Vt(t,""),e)}var Nt=new class{constructor(t){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=t=>t.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=(t,e)=>Ft(e.backgroundColor),this.hoverBorderColor=(t,e)=>Ft(e.borderColor),this.hoverColor=(t,e)=>Ft(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},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.describe(t)}set(t,e){return Bt(this,t,e)}get(t){return Vt(this,t)}describe(t,e){return Bt(zt,t,e)}override(t,e){return Bt(It,t,e)}route(t,e,i,n){const o=Vt(this,t),s=Vt(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=s[n];return h(t)?Object.assign({},e,t):g(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Wt(t,e,i,n,o){let s=e[o];return s||(s=e[o]=t.measureText(o).width,i.push(o)),s>n&&(n=s),n}function jt(t,e,i,n){let o=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(o=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let a=0;const r=i.length;let l,h,d,u,g;for(l=0;l<r;l++)if(u=i[l],null!=u&&!0!==c(u))a=Wt(t,o,s,a,u);else if(c(u))for(h=0,d=u.length;h<d;h++)g=u[h],null==g||c(g)||(a=Wt(t,o,s,a,g));t.restore();const f=s.length/2;if(f>i.length){for(l=0;l<f;l++)delete o[s[l]];s.splice(0,f)}return a}function Ht(t,e,i){const n=t.currentDevicePixelRatio,o=0!==i?Math.max(i/2,.5):0;return Math.round((e-o)*n)/n+o}function $t(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Yt(t,e,i,n){let o,s,a,r,l;const c=e.pointStyle,h=e.rotation,d=e.radius;let u=(h||0)*L;if(c&&"object"==typeof c&&(o=c.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,n),t.rotate(u),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),c){default:t.arc(i,n,d,0,T),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(u)*d,n-Math.cos(u)*d),u+=I,t.lineTo(i+Math.sin(u)*d,n-Math.cos(u)*d),u+=I,t.lineTo(i+Math.sin(u)*d,n-Math.cos(u)*d),t.closePath();break;case"rectRounded":l=.516*d,r=d-l,s=Math.cos(u+F)*r,a=Math.sin(u+F)*r,t.arc(i-s,n-a,l,u-C,u-E),t.arc(i+a,n-s,l,u-E,u),t.arc(i+s,n+a,l,u,u+E),t.arc(i-a,n+s,l,u+E,u+C),t.closePath();break;case"rect":if(!h){r=Math.SQRT1_2*d,t.rect(i-r,n-r,2*r,2*r);break}u+=F;case"rectRot":s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+a,n-s),t.lineTo(i+s,n+a),t.lineTo(i-a,n+s),t.closePath();break;case"crossRot":u+=F;case"cross":s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+s,n+a),t.moveTo(i+a,n-s),t.lineTo(i-a,n+s);break;case"star":s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+s,n+a),t.moveTo(i+a,n-s),t.lineTo(i-a,n+s),u+=F,s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+s,n+a),t.moveTo(i+a,n-s),t.lineTo(i-a,n+s);break;case"line":s=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-s,n-a),t.lineTo(i+s,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(u)*d,n+Math.sin(u)*d)}t.fill(),e.borderWidth>0&&t.stroke()}}function Ut(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Xt(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function qt(t){t.restore()}function Kt(t,e,i,n,o){if(!e)return t.lineTo(i.x,i.y);if("middle"===o){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===o!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Gt(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Zt(t,e,i,n,o,s={}){const a=c(e)?e:[e],r=s.strokeWidth>0&&""!==s.strokeColor;let h,d;for(t.save(),t.font=o.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);l(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),h=0;h<a.length;++h)d=a[h],r&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),l(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,i,n,s.maxWidth)),t.fillText(d,i,n,s.maxWidth),Qt(t,i,n,d,s),n+=o.lineHeight;t.restore()}function Qt(t,e,i,n,o){if(o.strikethrough||o.underline){const s=t.measureText(n),a=e-s.actualBoundingBoxLeft,r=e+s.actualBoundingBoxRight,l=i-s.actualBoundingBoxAscent,c=i+s.actualBoundingBoxDescent,h=o.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=o.decorationWidth||2,t.moveTo(a,h),t.lineTo(r,h),t.stroke()}}function Jt(t,e){const{x:i,y:n,w:o,h:s,radius:a}=e;t.arc(i+a.topLeft,n+a.topLeft,a.topLeft,-E,C,!0),t.lineTo(i,n+s-a.bottomLeft),t.arc(i+a.bottomLeft,n+s-a.bottomLeft,a.bottomLeft,C,E,!0),t.lineTo(i+o-a.bottomRight,n+s),t.arc(i+o-a.bottomRight,n+s-a.bottomRight,a.bottomRight,E,0,!0),t.lineTo(i+o,n+a.topRight),t.arc(i+o-a.topRight,n+a.topRight,a.topRight,0,-E,!0),t.lineTo(i+a.topLeft,n)}const te=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),ee=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function ie(t,e){const i=(""+t).match(te);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function ne(t,e){const i={},n=h(e),o=n?Object.keys(e):e,s=h(t)?n?i=>g(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of o)i[t]=+s(t)||0;return i}function oe(t){return ne(t,{top:"y",right:"x",bottom:"y",left:"x"})}function se(t){return ne(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ae(t){const e=oe(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function re(t,e){t=t||{},e=e||Nt.font;let i=g(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=g(t.style,e.style);n&&!(""+n).match(ee)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const o={family:g(t.family,e.family),lineHeight:ie(g(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:g(t.weight,e.weight),string:""};return o.string=function(t){return!t||l(t.size)||l(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(o),o}function le(t,e,i,n){let o,s,a,r=!0;for(o=0,s=t.length;o<s;++o)if(a=t[o],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),r=!1),void 0!==i&&c(a)&&(a=a[i%a.length],r=!1),void 0!==a))return n&&!r&&(n.cacheable=!1),a}function ce(t,e,i){i=i||(i=>t[i]<e);let n,o=t.length-1,s=0;for(;o-s>1;)n=s+o>>1,i(n)?s=n:o=n;return{lo:s,hi:o}}const he=(t,e,i)=>ce(t,i,n=>t[n][e]<i),de=(t,e,i)=>ce(t,i,n=>t[n][e]>=i);const ue=["push","pop","shift","splice","unshift"];function ge(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,o=n.indexOf(e);-1!==o&&n.splice(o,1),n.length>0||(ue.forEach(e=>{delete t[e]}),delete t._chartjs)}function fe(t){const e=new Set;let i,n;for(i=0,n=t.length;i<n;++i)e.add(t[i]);return e.size===n?t:Array.from(e)}function pe(t,e=[""],i=t,n,o=(()=>t[0])){O(n)||(n=Pe("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:o,override:o=>pe([o,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>ye(i,n,()=>function(t,e,i,n){let o;for(const s of e)if(o=Pe(xe(s,t),i),O(o))return _e(t,o)?ke(i,n,t,o):o}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Oe(t).includes(e),ownKeys:t=>Oe(t),set:(t,e,i)=>((t._storage||(t._storage=o()))[e]=i,delete t[e],delete t._keys,!0)})}function me(t,e,i,n){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:be(t,n),setContext:e=>me(t,e,i,n),override:o=>me(t.override(o),e,i,n)};return new Proxy(o,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>ye(t,e,()=>function(t,e,i){const{_proxy:n,_context:o,_subProxy:s,_descriptors:a}=t;let r=n[e];D(r)&&a.isScriptable(e)&&(r=function(t,e,i,n){const{_proxy:o,_context:s,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t),e=e(s,a||n),r.delete(t),h(e)&&(e=ke(o._scopes,o,t,e));return e}(e,r,t,i));c(r)&&r.length&&(r=function(t,e,i,n){const{_proxy:o,_context:s,_subProxy:a,_descriptors:r}=i;if(O(s.index)&&n(t))e=e[s.index%e.length];else if(h(e[0])){const i=e,n=o._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=ke(n,o,t,l);e.push(me(i,s,a&&a[t],r))}}return e}(e,r,t,a.isIndexable));_e(e,r)&&(r=me(r,o,s&&s[e],a));return r}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function be(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:i,indexable:n,isScriptable:D(i)?i:()=>i,isIndexable:D(n)?n:()=>n}}const xe=(t,e)=>t?t+P(e):e,_e=(t,e)=>h(e)&&"adapters"!==t;function ye(t,e,i){let n=t[e];return O(n)||(n=i(),O(n)&&(t[e]=n)),n}function ve(t,e,i){return D(t)?t(e,i):t}const Me=(t,e)=>!0===t?e:"string"==typeof t?S(e,t):void 0;function we(t,e,i,n){for(const o of e){const e=Me(i,o);if(e){t.add(e);const o=ve(e._fallback,i,e);if(O(o)&&o!==i&&o!==n)return o}else if(!1===e&&O(n)&&i!==n)return null}return!1}function ke(t,e,i,n){const o=e._rootScopes,s=ve(e._fallback,i,n),a=[...t,...o],r=new Set;r.add(n);let l=Se(r,a,i,s||i);return null!==l&&((!O(s)||s===i||(l=Se(r,a,s,l),null!==l))&&pe(Array.from(r),[""],o,s,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const o=n[e];if(c(o)&&h(i))return i;return o}(e,i,n)))}function Se(t,e,i,n){for(;i;)i=we(t,e,i,n);return i}function Pe(t,e){for(const i of e){if(!i)continue;const e=i[t];if(O(e))return e}}function Oe(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const De=Number.EPSILON||1e-14,Ce=(t,e)=>e<t.length&&!t[e].skip&&t[e],Te=t=>"x"===t?"y":"x";function Ae(t,e,i,n){const o=t.skip?e:t,s=e,a=i.skip?e:i,r=U(s,o),l=U(a,s);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:s.x-d*(a.x-o.x),y:s.y-d*(a.y-o.y)},next:{x:s.x+u*(a.x-o.x),y:s.y+u*(a.y-o.y)}}}function Re(t,e="x"){const i=Te(e),n=t.length,o=Array(n).fill(0),s=Array(n);let a,r,l,c=Ce(t,0);for(a=0;a<n;++a)if(r=l,l=c,c=Ce(t,a+1),l){if(c){const t=c[e]-l[e];o[a]=0!==t?(c[i]-l[i])/t:0}s[a]=r?c?V(o[a-1])!==V(o[a])?0:(o[a-1]+o[a])/2:o[a-1]:o[a]}!function(t,e,i){const n=t.length;let o,s,a,r,l,c=Ce(t,0);for(let h=0;h<n-1;++h)l=c,c=Ce(t,h+1),l&&c&&(W(e[h],0,De)?i[h]=i[h+1]=0:(o=i[h]/e[h],s=i[h+1]/e[h],r=Math.pow(o,2)+Math.pow(s,2),r<=9||(a=3/Math.sqrt(r),i[h]=o*a*e[h],i[h+1]=s*a*e[h])))}(t,o,s),function(t,e,i="x"){const n=Te(i),o=t.length;let s,a,r,l=Ce(t,0);for(let c=0;c<o;++c){if(a=r,r=l,l=Ce(t,c+1),!r)continue;const o=r[i],h=r[n];a&&(s=(o-a[i])/3,r["cp1"+i]=o-s,r["cp1"+n]=h-s*e[c]),l&&(s=(l[i]-o)/3,r["cp2"+i]=o+s,r["cp2"+n]=h+s*e[c])}}(t,s,e)}function Le(t,e,i){return Math.max(Math.min(t,i),e)}function Ee(t,e,i,n,o){let s,a,r,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)Re(t,o);else{let i=n?t[t.length-1]:t[0];for(s=0,a=t.length;s<a;++s)r=t[s],l=Ae(i,r,t[Math.min(s+1,a-(n?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,n,o,s,a,r=Ut(t[0],e);for(i=0,n=t.length;i<n;++i)a=s,s=r,r=i<n-1&&Ut(t[i+1],e),s&&(o=t[i],a&&(o.cp1x=Le(o.cp1x,e.left,e.right),o.cp1y=Le(o.cp1y,e.top,e.bottom)),r&&(o.cp2x=Le(o.cp2x,e.left,e.right),o.cp2y=Le(o.cp2y,e.top,e.bottom)))}(t,i)}function Fe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Ie(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ze(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const Ve=t=>window.getComputedStyle(t,null);const Be=["top","right","bottom","left"];function Ne(t,e,i){const n={};i=i?"-"+i:"";for(let o=0;o<4;o++){const s=Be[o];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function We(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,o=Ve(i),s="border-box"===o.boxSizing,a=Ne(o,"padding"),r=Ne(o,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,o=n&&n.length?n[0]:i,{offsetX:s,offsetY:a}=o;let r,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,a,i.target))r=s,l=a;else{const t=e.getBoundingClientRect();r=o.clientX-t.left,l=o.clientY-t.top,c=!0}return{x:r,y:l,box:c}}(t,i),d=a.left+(h&&r.left),u=a.top+(h&&r.top);let{width:g,height:f}=e;return s&&(g-=a.width+r.width,f-=a.height+r.height),{x:Math.round((l-d)/g*i.width/n),y:Math.round((c-u)/f*i.height/n)}}const je=t=>Math.round(10*t)/10;function He(t,e,i,n){const o=Ve(t),s=Ne(o,"margin"),a=ze(o.maxWidth,t,"clientWidth")||R,r=ze(o.maxHeight,t,"clientHeight")||R,l=function(t,e,i){let n,o;if(void 0===e||void 0===i){const s=Ie(t);if(s){const t=s.getBoundingClientRect(),a=Ve(s),r=Ne(a,"border","width"),l=Ne(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,n=ze(a.maxWidth,s,"clientWidth"),o=ze(a.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||R,maxHeight:o||R}}(t,e,i);let{width:c,height:h}=l;if("content-box"===o.boxSizing){const t=Ne(o,"border","width"),e=Ne(o,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-s.width),h=Math.max(0,n?Math.floor(c/n):h-s.height),c=je(Math.min(c,a,l.maxWidth)),h=je(Math.min(h,r,l.maxHeight)),c&&!h&&(h=je(c/2)),{width:c,height:h}}function $e(t,e,i){const n=e||1,o=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=o/n,t.width=s/n;const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=t.height+"px",a.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||a.height!==o||a.width!==s)&&(t.currentDevicePixelRatio=n,a.height=o,a.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ye=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ue(t,e){const i=function(t,e){return Ve(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Xe(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function qe(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Ke(t,e,i,n){const o={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},a=Xe(t,o,i),r=Xe(o,s,i),l=Xe(s,e,i),c=Xe(a,r,i),h=Xe(r,l,i);return Xe(c,h,i)}const Ge=new Map;function Ze(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Ge.get(i);return n||(n=new Intl.NumberFormat(t,e),Ge.set(i,n)),n}(e,i).format(t)}function Qe(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Je(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function ti(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function ei(t){return"angle"===t?{between:K,compare:X,normalize:q}:{between:(t,e,i)=>t>=Math.min(e,i)&&t<=Math.max(i,e),compare:(t,e)=>t-e,normalize:t=>t}}function ii({start:t,end:e,count:i,loop:n,style:o}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:o}}function ni(t,e,i){if(!i)return[t];const{property:n,start:o,end:s}=i,a=e.length,{compare:r,between:l,normalize:c}=ei(n),{start:h,end:d,loop:u,style:g}=function(t,e,i){const{property:n,start:o,end:s}=i,{between:a,normalize:r}=ei(n),l=e.length;let c,h,{start:d,end:u,loop:g}=t;if(g){for(d+=l,u+=l,c=0,h=l;c<h&&a(r(e[d%l][n]),o,s);++c)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:g,style:t.style}}(t,e,i),f=[];let p,m,b,x=!1,_=null;const y=()=>x||l(o,b,p)&&0!==r(o,b),v=()=>!x||0===r(s,p)||l(s,b,p);for(let t=h,i=h;t<=d;++t)m=e[t%a],m.skip||(p=c(m[n]),p!==b&&(x=l(p,o,s),null===_&&y()&&(_=0===r(p,o)?t:i),null!==_&&v()&&(f.push(ii({start:_,end:t,loop:u,count:a,style:g})),_=null),i=t,b=p));return null!==_&&f.push(ii({start:_,end:d,loop:u,count:a,style:g})),f}function oi(t,e){const i=[],n=t.segments;for(let o=0;o<n.length;o++){const s=ni(n[o],t.points,e);s.length&&i.push(...s)}return i}function si(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const o=ai(t.options),s=i.length,a=[];let r=e[0].start,l=r;for(const c of e){let e,h=o,d=i[r%s];for(l=r+1;l<=c.end;l++){const o=i[l%s];e=ai(n.setContext({type:"segment",p0:d,p1:o,p0DataIndex:(l-1)%s,p1DataIndex:l%s,datasetIndex:t._datasetIndex})),ri(e,h)&&(a.push({start:r,end:l-1,loop:c.loop,style:h}),h=e,r=l-1),d=o,h=e}r<l-1&&(a.push({start:r,end:l-1,loop:c.loop,style:e}),r=l-1)}return a}(t,e,i,n):e}function ai(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function ri(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var li=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],s=e.duration;o.forEach(n=>n({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){const t=this;t._request||(t._running=!0,t._request=n.call(window,()=>{t._update(),t._request=null,t._running&&t._refresh()}))}_update(t=Date.now()){const e=this;let i=0;e._charts.forEach((n,o)=>{if(!n.running||!n.items.length)return;const s=n.items;let a,r=s.length-1,l=!1;for(;r>=0;--r)a=s[r],a._active?(a._total>n.duration&&(n.duration=a._total),a.tick(t),l=!0):(s[r]=s[s.length-1],s.pop());l&&(o.draw(),e._notify(o,n,t,"progress")),s.length||(n.running=!1,e._notify(o,n,t,"complete"),n.initial=!1),i+=s.length}),e._lastDate=t,0===i&&(e._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}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((t,e)=>Math.max(t,e._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 i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ci={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Et(t||"transparent"),o=n.valid&&Et(e||"transparent");return o&&o.valid?o.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class hi{constructor(t,e,i,n){const o=e[i];n=le([t.to,n,o,t.from]);const s=le([t.from,o,n]);this._active=!0,this._fn=t.fn||ci[t.type||typeof s],this._easing=tt[t.easing]||tt.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=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){const n=this;if(n._active){n._notify(!1);const o=n._target[n._prop],s=i-n._start,a=n._duration-s;n._start=i,n._duration=Math.floor(Math.max(a,t.duration)),n._total+=s,n._loop=!!t.loop,n._to=le([t.to,e,o,t.from]),n._from=le([t.from,o,e])}}cancel(){const t=this;t._active&&(t.tick(Date.now()),t._active=!1,t._notify(!1))}tick(t){const e=this,i=t-e._start,n=e._duration,o=e._prop,s=e._from,a=e._loop,r=e._to;let l;if(e._active=s!==r&&(a||i<n),!e._active)return e._target[o]=r,void e._notify(!0);i<0?e._target[o]=s:(l=i/n%2,l=a&&l>1?2-l:l,l=e._easing(Math.min(1,Math.max(0,l))),e._target[o]=e._fn(s,r,l))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}Nt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const di=Object.keys(Nt.animation);Nt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Nt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Nt.describe("animations",{_fallback:"animation"}),Nt.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=>0|t}}}});class ui{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!h(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!h(n))return;const o={};for(const t of di)o[t]=n[t];(c(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e<n.length;e++){const o=t[n[e]];o&&o.active()&&i.push(o.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),s=Object.keys(e),a=Date.now();let r;for(r=s.length-1;r>=0;--r){const l=s[r];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=o[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,a);continue}h.cancel()}d&&d.duration?(o[l]=h=new hi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(li.add(this._chart,i),!0):void 0}}function gi(t,e){const i=t&&t.options||{},n=i.reverse,o=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:o,end:n?o:s}}function fi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let o,s;for(o=0,s=n.length;o<s;++o)i.push(n[o].index);return i}function pi(t,e,i,n){const o=t.keys,s="single"===n.mode;let a,r,l,c;if(null!==e){for(a=0,r=o.length;a<r;++a){if(l=+o[a],l===i){if(n.all)continue;break}c=t.values[l],d(c)&&(s||0===e||V(e)===V(c))&&(e+=c)}return e}}function mi(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function bi(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function xi(t,e,i){for(const n of e.getMatchingVisibleMetas("bar").reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function _i(t,e){const{chart:i,_cachedMeta:n}=t,o=i._stacks||(i._stacks={}),{iScale:s,vScale:a,index:r}=n,l=s.axis,c=a.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,a,n),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:n,[c]:s}=i;u=(i._stacks||(i._stacks={}))[c]=bi(o,h,n),u[r]=s,u._top=xi(u,a,!0),u._bottom=xi(u,a,!1)}}function yi(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function vi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const Mi=t=>"reset"===t||"none"===t,wi=(t,e)=>e?t:Object.assign({},t);class ki{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.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=mi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&vi(this._cachedMeta),this.index=t}linkScales(){const t=this,e=t.chart,i=t._cachedMeta,n=t.getDataset(),o=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=i.xAxisID=g(n.xAxisID,yi(e,"x")),a=i.yAxisID=g(n.yAxisID,yi(e,"y")),r=i.rAxisID=g(n.rAxisID,yi(e,"r")),l=i.indexAxis,c=i.iAxisID=o(l,s,a,r),h=i.vAxisID=o(l,a,s,r);i.xScale=t.getScaleForId(s),i.yScale=t.getScaleForId(a),i.rScale=t.getScaleForId(r),i.iScale=t.getScaleForId(c),i.vScale=t.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&&ge(this._data,this),t._stacked&&vi(t)}_dataCheck(){const t=this,e=t.getDataset(),i=e.data||(e.data=[]),n=t._data;if(h(i))t._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,o,s;for(n=0,o=e.length;n<o;++n)s=e[n],i[n]={x:s,y:t[s]};return i}(i);else if(n!==i){if(n){ge(n,t);const e=t._cachedMeta;vi(e),e._parsed=[]}i&&Object.isExtensible(i)&&(s=t,(o=i)._chartjs?o._chartjs.listeners.push(s):(Object.defineProperty(o,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[s]}}),ue.forEach(t=>{const e="_onData"+P(t),i=o[t];Object.defineProperty(o,t,{configurable:!0,enumerable:!1,value(...t){const n=i.apply(this,t);return o._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),n}})}))),t._syncList=[],t._data=i}var o,s}addElements(){const t=this,e=t._cachedMeta;t._dataCheck(),t.datasetElementType&&(e.dataset=new t.datasetElementType)}buildOrUpdateElements(t){const e=this,i=e._cachedMeta,n=e.getDataset();let o=!1;e._dataCheck();const s=i._stacked;i._stacked=mi(i.vScale,i),i.stack!==n.stack&&(o=!0,vi(i),i.stack=n.stack),e._resyncElements(t),(o||s!==i._stacked)&&_i(e,i._parsed)}configure(){const t=this,e=t.chart.config,i=e.datasetScopeKeys(t._type),n=e.getOptionScopes(t.getDataset(),i,!0);t.options=e.createResolver(n,t.getContext()),t._parsing=t.options.parsing}parse(t,e){const i=this,{_cachedMeta:n,_data:o}=i,{iScale:s,_stacked:a}=n,r=s.axis;let l,d,u,g=0===t&&e===o.length||n._sorted,f=t>0&&n._parsed[t-1];if(!1===i._parsing)n._parsed=o,n._sorted=!0,u=o;else{u=c(o[t])?i.parseArrayData(n,o,t,e):h(o[t])?i.parseObjectData(n,o,t,e):i.parsePrimitiveData(n,o,t,e);const s=()=>null===d[r]||f&&d[r]<f[r];for(l=0;l<e;++l)n._parsed[l+t]=d=u[l],g&&(s()&&(g=!1),f=d);n._sorted=g}a&&_i(i,u)}parsePrimitiveData(t,e,i,n){const{iScale:o,vScale:s}=t,a=o.axis,r=s.axis,l=o.getLabels(),c=o===s,h=new Array(n);let d,u,g;for(d=0,u=n;d<u;++d)g=d+i,h[d]={[a]:c||o.parse(l[g],g),[r]:s.parse(e[g],g)};return h}parseArrayData(t,e,i,n){const{xScale:o,yScale:s}=t,a=new Array(n);let r,l,c,h;for(r=0,l=n;r<l;++r)c=r+i,h=e[c],a[r]={x:o.parse(h[0],c),y:s.parse(h[1],c)};return a}parseObjectData(t,e,i,n){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=new Array(n);let c,h,d,u;for(c=0,h=n;c<h;++c)d=c+i,u=e[d],l[c]={x:o.parse(S(u,a),d),y:s.parse(S(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,o=this._cachedMeta,s=e[t.axis];return pi({keys:fi(n,!0),values:e._stacks[t.axis]},s,o.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const o=i[e.axis];let s=null===o?NaN:o;const a=n&&i._stacks[e.axis];n&&a&&(n.values=a,t.min=Math.min(t.min,s),t.max=Math.max(t.max,s),s=pi(n,o,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this,n=i._cachedMeta,o=n._parsed,s=n._sorted&&t===n.iScale,a=o.length,r=i._getOtherScale(t),l=e&&n._stacked&&{keys:fi(i.chart,!0),values:null},c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=function(t){const{min:e,max:i,minDefined:n,maxDefined:o}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:o?i:Number.POSITIVE_INFINITY}}(r);let g,f,p,m;function b(){return p=o[g],f=p[t.axis],m=p[r.axis],!d(f)||h>m||u<m}for(g=0;g<a&&(b()||(i.updateRangeFromParsed(c,t,p,l),!s));++g);if(s)for(g=a-1;g>=0;--g)if(!b()){i.updateRangeFromParsed(c,t,p,l);break}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,s;for(n=0,o=e.length;n<o;++n)s=e[n][t.axis],d(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this,i=e._cachedMeta;e.configure(),e._cachedDataOpts={},e.update(t||"default"),i._clip=function(t){let e,i,n,o;return h(t)?(e=t.top,i=t.right,n=t.bottom,o=t.left):e=i=n=o=t,{top:e,right:i,bottom:n,left:o,disabled:!1===t}}(g(e.options.clip,function(t,e,i){if(!1===i)return!1;const n=gi(t,i),o=gi(e,i);return{top:o.end,right:n.end,bottom:o.start,left:n.start}}(i.xScale,i.yScale,e.getMaxOverflow())))}update(t){}draw(){const t=this,e=t._ctx,i=t.chart,n=t._cachedMeta,o=n.data||[],s=i.chartArea,a=[],r=t._drawStart||0,l=t._drawCount||o.length-r;let c;for(n.dataset&&n.dataset.draw(e,s,r,l),c=r;c<r+l;++c){const t=o[c];t.hidden||(t.active?a.push(t):t.draw(e,s))}for(c=0;c<a.length;++c)a[c].draw(e,s)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this,o=n.getDataset();let s;if(t>=0&&t<n._cachedMeta.data.length){const e=n._cachedMeta.data[t];s=e.$context||(e.$context=function(t,e,i){return Object.assign(Object.create(t),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(n.getContext(),t,e)),s.parsed=n.getParsed(t),s.raw=o.data[t],s.index=s.dataIndex=t}else s=n.$context||(n.$context=function(t,e){return Object.assign(Object.create(t),{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(n.chart.getContext(),n.index)),s.dataset=o,s.index=s.datasetIndex=n.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n=this,o="active"===e,s=n._cachedDataOpts,a=t+"-"+e,r=s[a],l=n.enableOptionSharing&&O(i);if(r)return wi(r,l);const c=n.chart.config,h=c.datasetElementScopeKeys(n._type,t),d=o?[t+"Hover","hover",t,""]:[t,""],u=c.getOptionScopes(n.getDataset(),h),g=Object.keys(Nt.elements[t]),f=c.resolveNamedOptions(u,g,()=>n.getContext(i,o),d);return f.$shared&&(f.$shared=l,s[a]=Object.freeze(wi(f,l))),f}_resolveAnimations(t,e,i){const n=this,o=n.chart,s=n._cachedDataOpts,a="animation-"+e,r=s[a];if(r)return r;let l;if(!1!==o.options.animation){const o=n.chart.config,s=o.datasetAnimationScopeKeys(n._type,e),a=o.getOptionScopes(n.getDataset(),s);l=o.createResolver(a,n.getContext(t,i,e))}const c=new ui(o,l&&l.animations);return l&&l._cacheable&&(s[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Mi(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){Mi(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Mi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"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,i=e._data,n=e._cachedMeta.data;for(const[t,i,n]of e._syncList)e[t](i,n);e._syncList=[];const o=n.length,s=i.length,a=Math.min(s,o);a&&e.parse(0,a),s>o?e._insertElements(o,s-o,t):s<o&&e._removeElements(s,o-s)}_insertElements(t,e,i=!0){const n=this,o=n._cachedMeta,s=o.data,a=t+e;let r;const l=t=>{for(t.length+=e,r=t.length-1;r>=a;r--)t[r]=t[r-e]};for(l(s),r=t;r<a;++r)s[r]=new n.dataElementType;n._parsing&&l(o._parsed),n.parse(t,e),i&&n.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&vi(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}}_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){this._sync(["_removeElements",t,e]),this._sync(["_insertElements",t,arguments.length-2])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Si(t){const e=function(t){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas("bar");let i=[];for(let n=0,o=e.length;n<o;n++)i=i.concat(e[n].controller.getAllParsedValues(t));t._cache.$bar=fe(i.sort((t,e)=>t-e))}return t._cache.$bar}(t);let i,n,o,s,a=t._length;const r=()=>{32767!==o&&-32768!==o&&(O(s)&&(a=Math.min(a,Math.abs(o-s)||a)),s=o)};for(i=0,n=e.length;i<n;++i)o=t.getPixelForValue(e[i]),r();for(s=void 0,i=0,n=t.ticks.length;i<n;++i)o=t.getPixelForTick(i),r();return a}function Pi(t,e,i,n){return c(t)?function(t,e,i,n){const o=i.parse(t[0],n),s=i.parse(t[1],n),a=Math.min(o,s),r=Math.max(o,s);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:o,end:s,min:a,max:r}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Oi(t,e,i,n){const o=t.iScale,s=t.vScale,a=o.getLabels(),r=o===s,l=[];let c,h,d,u;for(c=i,h=i+n;c<h;++c)u=e[c],d={},d[o.axis]=r||o.parse(a[c],c),l.push(Pi(u,d,s,c));return l}function Di(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Ci(t,e,i,n){let o=e.borderSkipped;const s={};if(!o)return void(t.borderSkipped=s);const{start:a,end:r,reverse:l,top:c,bottom:h}=function(t){let e,i,n,o,s;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(o="end",s="start"):(o="start",s="end"),{start:i,end:n,reverse:e,top:o,bottom:s}}(t);"middle"===o&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?o=c:(i._bottom||0)===n?o=h:(s[Ti(h,a,r,l)]=!0,o=c)),s[Ti(o,a,r,l)]=!0,t.borderSkipped=s}function Ti(t,e,i,n){var o,s,a;return n?(a=i,t=Ai(t=(o=t)===(s=e)?a:o===a?s:o,i,e)):t=Ai(t,e,i),t}function Ai(t,e,i){return"start"===t?e:"end"===t?i:t}ki.defaults={},ki.prototype.datasetElementType=null,ki.prototype.dataElementType=null;class Ri extends ki{parsePrimitiveData(t,e,i,n){return Oi(t,e,i,n)}parseArrayData(t,e,i,n){return Oi(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l="x"===o.axis?a:r,c="x"===s.axis?a:r,h=[];let d,u,g,f;for(d=i,u=i+n;d<u;++d)f=e[d],g={},g[o.axis]=o.parse(S(f,l),d),h.push(Pi(S(f,c),g,s,d));return h}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const o=i._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:i,vScale:n}=e,o=this.getParsed(t),s=o._custom,a=Di(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const o=this,s="reset"===n,{index:a,_cachedMeta:{vScale:r}}=o,c=r.getBasePixel(),h=r.isHorizontal(),d=o._getRuler(),u=o.resolveDataElementOptions(e,n),g=o.getSharedOptions(u),f=o.includeOptions(n,g);o.updateSharedOptions(g,n,u);for(let u=e;u<e+i;u++){const e=o.getParsed(u),i=s||l(e[r.axis])?{base:c,head:c}:o._calculateBarValuePixels(u),p=o._calculateBarIndexPixels(u,d),m=(e._stacks||{})[r.axis],b={horizontal:h,base:i.base,enableBorderRadius:!m||Di(e._custom)||a===m._top||a===m._bottom,x:h?i.head:p.center,y:h?p.center:i.head,height:h?p.size:Math.abs(i.size),width:h?Math.abs(i.size):p.size};f&&(b.options=g||o.resolveDataElementOptions(u,t[u].active?"active":n)),Ci(b,b.options||t[u].options,m,a),o.updateElement(t[u],u,b,n)}}_getStacks(t,e){const i=this._cachedMeta.iScale,n=i.getMatchingVisibleMetas(this._type),o=i.options.stacked,s=n.length,a=[];let r,c;for(r=0;r<s;++r)if(c=n[r],c.controller.options.grouped){if(void 0!==e){const t=c.controller.getParsed(e)[c.controller._cachedMeta.vScale.axis];if(l(t)||isNaN(t))continue}if((!1===o||-1===a.indexOf(c.stack)||void 0===o&&void 0===c.stack)&&a.push(c.stack),c.index===t)break}return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),o=void 0!==e?n.indexOf(e):-1;return-1===o?n.length-1:o}_getRuler(){const t=this,e=t.options,i=t._cachedMeta,n=i.iScale,o=[];let s,a;for(s=0,a=i.data.length;s<a;++s)o.push(n.getPixelForValue(t.getParsed(s)[n.axis],s));const r=e.barThickness;return{min:r||Si(n),pixels:o,start:n._startPixel,end:n._endPixel,stackCount:t._getStackCount(),scale:n,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:n,minBarLength:o}}=this,s=n||0,a=this.getParsed(t),r=a._custom,c=Di(r);let h,d,u=a[e.axis],g=0,f=i?this.applyStack(e,a,i):u;f!==u&&(g=f-u,f=u),c&&(u=r.barStart,f=r.barEnd-r.barStart,0!==u&&V(u)!==V(r.barEnd)&&(g=0),g+=u);const p=l(n)||c?g:n;let m=e.getPixelForValue(p);if(h=this.chart.getDataVisibility(t)?e.getPixelForValue(g+f):m,d=h-m,Math.abs(d)<o&&(d=function(t,e,i){return 0!==t?V(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(d,e,s)*o,u===s&&(m-=d/2),h=m+d),m===e.getPixelForValue(s)){const t=V(d)*e.getLineWidthForValue(s)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=this,n=e.scale,o=i.options,s=o.skipNull,a=g(o.maxBarThickness,1/0);let r,c;if(e.grouped){const n=s?i._getStackCount(t):e.stackCount,h="flex"===o.barThickness?function(t,e,i,n){const o=e.pixels,s=o[t];let a=t>0?o[t-1]:null,r=t<o.length-1?o[t+1]:null;const l=i.categoryPercentage;null===a&&(a=s-(null===r?e.end-e.start:r-s)),null===r&&(r=s+s-a);const c=s-(s-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/n,ratio:i.barPercentage,start:c}}(t,e,o,n):function(t,e,i,n){const o=i.barThickness;let s,a;return l(o)?(s=e.min*i.categoryPercentage,a=i.barPercentage):(s=o*n,a=1),{chunk:s/n,ratio:a,start:e.pixels[t]-s/2}}(t,e,o,n),d=i._getStackIndex(i.index,i._cachedMeta.stack,s?t:void 0);r=h.start+h.chunk*d+h.chunk/2,c=Math.min(a,h.chunk*h.ratio)}else r=n.getPixelForValue(i.getParsed(t)[n.axis],t),c=Math.min(a,e.min*e.ratio);return{base:r-c/2,head:r+c/2,center:r,size:c}}draw(){const t=this,e=t._cachedMeta,i=e.vScale,n=e.data,o=n.length;let s=0;for(;s<o;++s)null!==t.getParsed(s)[i.axis]&&n[s].draw(t._ctx)}}Ri.id="bar",Ri.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Ri.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Li extends ki{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(t,e,i,n){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=[];let c,h,d;for(c=i,h=i+n;c<h;++c)d=e[c],l.push({x:o.parse(S(d,a),c),y:s.parse(S(d,r),c),_custom:d&&d.r&&+d.r});return l}getMaxOverflow(){const{data:t,_parsed:e}=this._cachedMeta;let i=0;for(let n=t.length-1;n>=0;--n)i=Math.max(i,t[n].size()/2,e[n]._custom);return i>0&&i}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,o=this.getParsed(t),s=i.getLabelForValue(o.x),a=n.getLabelForValue(o.y),r=o._custom;return{label:e.label,value:"("+s+", "+a+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const o=this,s="reset"===n,{iScale:a,vScale:r}=o._cachedMeta,l=o.resolveDataElementOptions(e,n),c=o.getSharedOptions(l),h=o.includeOptions(n,c),d=a.axis,u=r.axis;for(let l=e;l<e+i;l++){const e=t[l],i=!s&&o.getParsed(l),c={},g=c[d]=s?a.getPixelForDecimal(.5):a.getPixelForValue(i[d]),f=c[u]=s?r.getBasePixel():r.getPixelForValue(i[u]);c.skip=isNaN(g)||isNaN(f),h&&(c.options=o.resolveDataElementOptions(l,e.active?"active":n),s&&(c.options.radius=0)),o.updateElement(e,l,c,n)}o.updateSharedOptions(c,n,l)}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const o=n.radius;return"active"!==e&&(n.radius=0),n.radius+=g(i&&i._custom,o),n}}Li.id="bubble",Li.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Li.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class Ei extends ki{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;let o,s;for(o=t,s=t+e;o<s;++o)n._parsed[o]=+i[o]}_getRotation(){return H(this.options.rotation-90)}_getCircumference(){return H(this.options.circumference)}_getRotationExtents(){let t=T,e=-T;const i=this;for(let n=0;n<i.chart.data.datasets.length;++n)if(i.chart.isDatasetVisible(n)){const o=i.chart.getDatasetMeta(n).controller,s=o._getRotation(),a=o._getCircumference();t=Math.min(t,s),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this,i=e.chart,{chartArea:n}=i,o=e._cachedMeta,s=o.data,a=e.getMaxBorderWidth()+e.getMaxOffset(s)+e.options.spacing,r=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min((c=e.options.cutout,h=r,"string"==typeof c&&c.endsWith("%")?parseFloat(c)/100:c/h),1);var c,h;const d=e._getRingWeight(e.index),{circumference:u,rotation:g}=e._getRotationExtents(),{ratioX:p,ratioY:m,offsetX:b,offsetY:x}=function(t,e,i){let n=1,o=1,s=0,a=0;if(e<T){const r=t,l=r+e,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),g=(t,e,n)=>K(t,r,l,!0)?1:Math.max(e,e*i,n,n*i),f=(t,e,n)=>K(t,r,l,!0)?-1:Math.min(e,e*i,n,n*i),p=g(0,c,d),m=g(E,h,u),b=f(C,c,d),x=f(C+E,h,u);n=(p-b)/2,o=(m-x)/2,s=-(p+b)/2,a=-(m+x)/2}return{ratioX:n,ratioY:o,offsetX:s,offsetY:a}}(g,u,l),_=(n.width-a)/p,y=(n.height-a)/m,v=Math.max(Math.min(_,y)/2,0),M=f(e.options.radius,v),w=(M-Math.max(M*l,0))/e._getVisibleDatasetWeightTotal();e.offsetX=b*M,e.offsetY=x*M,o.total=e.calculateTotal(),e.outerRadius=M-w*e._getRingWeightOffset(e.index),e.innerRadius=Math.max(e.outerRadius-w*d,0),e.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/T)}updateElements(t,e,i,n){const o=this,s="reset"===n,a=o.chart,r=a.chartArea,l=a.options.animation,c=(r.left+r.right)/2,h=(r.top+r.bottom)/2,d=s&&l.animateScale,u=d?0:o.innerRadius,g=d?0:o.outerRadius,f=o.resolveDataElementOptions(e,n),p=o.getSharedOptions(f),m=o.includeOptions(n,p);let b,x=o._getRotation();for(b=0;b<e;++b)x+=o._circumference(b,s);for(b=e;b<e+i;++b){const e=o._circumference(b,s),i=t[b],a={x:c+o.offsetX,y:h+o.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:g,innerRadius:u};m&&(a.options=p||o.resolveDataElementOptions(b,i.active?"active":n)),x+=e,o.updateElement(i,b,a,n)}o.updateSharedOptions(p,n,f)}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const o=t._parsed[i];null===o||isNaN(o)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?T*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=Ze(e._parsed[t],i.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){const e=this;let i=0;const n=e.chart;let o,s,a,r,l;if(!t)for(o=0,s=n.data.datasets.length;o<s;++o)if(n.isDatasetVisible(o)){a=n.getDatasetMeta(o),t=a.data,r=a.controller,r!==e&&r.configure();break}if(!t)return 0;for(o=0,s=t.length;o<s;++o)l=r.resolveDataElementOptions(o),"inner"!==l.borderAlign&&(i=Math.max(i,l.borderWidth||0,l.hoverBorderWidth||0));return i}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(g(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ei.id="doughnut",Ei.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},Ei.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},Ei.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return c(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Fi extends ki{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this,i=e._cachedMeta,{dataset:n,data:o=[],_dataset:s}=i,a=e.chart._animationsDisabled;let{start:r,count:l}=function(t,e,i){const n=e.length;let o=0,s=n;if(t._sorted){const{iScale:a,_parsed:r}=t,l=a.axis,{min:c,max:h,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(o=G(Math.min(he(r,a.axis,c).lo,i?n:he(e,l,a.getPixelForValue(c)).lo),0,n-1)),s=u?G(Math.max(he(r,a.axis,h).hi+1,i?0:he(e,l,a.getPixelForValue(h)).hi+1),o,n)-o:n-o}return{start:o,count:s}}(i,o,a);e._drawStart=r,e._drawCount=l,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,o={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=o,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,o),s}(i)&&(r=0,l=o.length),n._datasetIndex=e.index,n._decimated=!!s._decimated,n.points=o;const c=e.resolveDatasetElementOptions(t);e.options.showLine||(c.borderWidth=0),c.segment=e.options.segment,e.updateElement(n,void 0,{animated:!a,options:c},t),e.updateElements(o,r,l,t)}updateElements(t,e,i,n){const o=this,s="reset"===n,{iScale:a,vScale:r,_stacked:c}=o._cachedMeta,h=o.resolveDataElementOptions(e,n),d=o.getSharedOptions(h),u=o.includeOptions(n,d),g=a.axis,f=r.axis,p=o.options.spanGaps,m=N(p)?p:Number.POSITIVE_INFINITY,b=o.chart._animationsDisabled||s||"none"===n;let x=e>0&&o.getParsed(e-1);for(let h=e;h<e+i;++h){const e=t[h],i=o.getParsed(h),p=b?e:{},_=l(i[f]),y=p[g]=a.getPixelForValue(i[g],h),v=p[f]=s||_?r.getBasePixel():r.getPixelForValue(c?o.applyStack(r,i,c):i[f],h);p.skip=isNaN(y)||isNaN(v)||_,p.stop=h>0&&i[g]-x[g]>m,p.parsed=i,u&&(p.options=d||o.resolveDataElementOptions(h,e.active?"active":n)),b||o.updateElement(e,h,p,n),x=i}o.updateSharedOptions(d,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Fi.id="line",Fi.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Fi.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ii extends ki{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=Ze(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:o}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this,e=t.chart,i=e.chartArea,n=e.options,o=Math.min(i.right-i.left,i.bottom-i.top),s=Math.max(o/2,0),a=(s-Math.max(n.cutoutPercentage?s/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();t.outerRadius=s-a*t.index,t.innerRadius=t.outerRadius-a}updateElements(t,e,i,n){const o=this,s="reset"===n,a=o.chart,r=o.getDataset(),l=a.options.animation,c=o._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*C;let g,f=u;const p=360/o.countVisibleElements();for(g=0;g<e;++g)f+=o._computeAngle(g,n,p);for(g=e;g<e+i;g++){const e=t[g];let i=f,m=f+o._computeAngle(g,n,p),b=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(r.data[g]):0;f=m,s&&(l.animateScale&&(b=0),l.animateRotate&&(i=m=u));const x={x:h,y:d,innerRadius:0,outerRadius:b,startAngle:i,endAngle:m,options:o.resolveDataElementOptions(g,e.active?"active":n)};o.updateElement(e,g,x,n)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let i=0;return e.data.forEach((e,n)=>{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?H(this.resolveDataElementOptions(t,e).angle||i):0}}Ii.id="polarArea",Ii.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class zi extends Ei{}zi.id="pie",zi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Vi extends ki{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this,i=e._cachedMeta,n=i.dataset,o=i.data||[],s=i.iScale.getLabels();if(n.points=o,"resize"!==t){const i=e.resolveDatasetElementOptions(t);e.options.showLine||(i.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===o.length,options:i};e.updateElement(n,void 0,a,t)}e.updateElements(o,0,o.length,t)}updateElements(t,e,i,n){const o=this,s=o.getDataset(),a=o._cachedMeta.rScale,r="reset"===n;for(let l=e;l<e+i;l++){const e=t[l],i=o.resolveDataElementOptions(l,e.active?"active":n),c=a.getPointPositionForValue(l,s.data[l]),h=r?a.xCenter:c.x,d=r?a.yCenter:c.y,u={x:h,y:d,angle:c.angle,skip:isNaN(h)||isNaN(d),options:i};o.updateElement(e,l,u,n)}}}Vi.id="radar",Vi.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Vi.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Bi extends Fi{}Bi.id="scatter",Bi.defaults={showLine:!1,fill:!1},Bi.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Ni(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Wi{constructor(t){this.options=t||{}}formats(){return Ni()}parse(t,e){return Ni()}format(t,e){return Ni()}add(t,e,i){return Ni()}diff(t,e,i){return Ni()}startOf(t,e,i){return Ni()}endOf(t,e){return Ni()}}Wi.override=function(t){Object.assign(Wi.prototype,t)};var ji={_date:Wi};function Hi(t,e){return"native"in t?{x:t.x,y:t.y}:We(t,e)}function $i(t,e,i,n){const{controller:o,data:s,_sorted:a}=t,r=o._cachedMeta.iScale;if(r&&e===r.axis&&a&&s.length){const t=r._reversePixels?de:he;if(!n)return t(s,e,i);if(o._sharedOptions){const n=s[0],o="function"==typeof n.getRange&&n.getRange(e);if(o){const n=t(s,e,i-o),a=t(s,e,i+o);return{lo:n.lo,hi:a.hi}}}}return{lo:0,hi:s.length-1}}function Yi(t,e,i,n,o){const s=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=s.length;t<i;++t){const{index:i,data:r}=s[t],{lo:l,hi:c}=$i(s[t],e,a,o);for(let t=l;t<=c;++t){const e=r[t];e.skip||n(e,i,t)}}}function Ui(t,e,i,n){const o=[];if(!Ut(e,t.chartArea,t._minPadding))return o;return Yi(t,i,e,(function(t,i,s){t.inRange(e.x,e.y,n)&&o.push({element:t,datasetIndex:i,index:s})}),!0),o}function Xi(t,e,i,n,o){const s=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const o=e?Math.abs(t.x-n.x):0,s=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}(i);let a=Number.POSITIVE_INFINITY,r=[];if(!Ut(e,t.chartArea,t._minPadding))return r;return Yi(t,i,e,(function(i,l,c){if(n&&!i.inRange(e.x,e.y,o))return;const h=i.getCenterPoint(o);if(!Ut(h,t.chartArea,t._minPadding)&&!i.inRange(e.x,e.y,o))return;const d=s(e,h);d<a?(r=[{element:i,datasetIndex:l,index:c}],a=d):d===a&&r.push({element:i,datasetIndex:l,index:c})})),r}function qi(t,e,i,n){const o=Hi(e,t),s=[],a=i.axis,r="x"===a?"inXRange":"inYRange";let l=!1;return function(t,e){const i=t.getSortedVisibleDatasetMetas();let n,o,s;for(let t=0,a=i.length;t<a;++t){({index:n,data:o}=i[t]);for(let t=0,i=o.length;t<i;++t)s=o[t],s.skip||e(s,n,t)}}(t,(t,e,i)=>{t[r](o[a],n)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(o.x,o.y,n)&&(l=!0)}),i.intersect&&!l?[]:s}var Ki={modes:{index(t,e,i,n){const o=Hi(e,t),s=i.axis||"x",a=i.intersect?Ui(t,o,s,n):Xi(t,o,s,!1,n),r=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&r.push({element:i,datasetIndex:t.index,index:e})}),r):[]},dataset(t,e,i,n){const o=Hi(e,t),s=i.axis||"xy";let a=i.intersect?Ui(t,o,s,n):Xi(t,o,s,!1,n);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,n)=>Ui(t,Hi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Xi(t,Hi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>(i.axis="x",qi(t,e,i,n)),y:(t,e,i,n)=>(i.axis="y",qi(t,e,i,n))}};const Gi=["left","top","right","bottom"];function Zi(t,e){return t.filter(t=>t.pos===e)}function Qi(t,e){return t.filter(t=>-1===Gi.indexOf(t.pos)&&t.box.axis===e)}function Ji(t,e){return t.sort((t,i)=>{const n=e?i:t,o=e?t:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function tn(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:o}=i;if(!t||!Gi.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:o}=e;let s,a,r;for(s=0,a=t.length;s<a;++s){r=t[s];const{fullSize:a}=r.box,l=i[r.stack],c=l&&r.stackWeight/l.weight;r.horizontal?(r.width=c?c*n:a&&e.availableWidth,r.height=o):(r.width=n,r.height=c?c*o:a&&e.availableHeight)}return i}function en(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function nn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function on(t,e,i,n){const{pos:o,box:s}=i,a=t.maxPadding;if(!h(o)){i.size&&(t[o]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[o]+=i.size}s.getPadding&&nn(a,s.getPadding());const r=Math.max(0,e.outerWidth-en(a,t,"left","right")),l=Math.max(0,e.outerHeight-en(a,t,"top","bottom")),c=r!==t.w,d=l!==t.h;return t.w=r,t.h=l,i.horizontal?{same:c,other:d}:{same:d,other:c}}function sn(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function an(t,e,i,n){const o=[];let s,a,r,l,c,h;for(s=0,a=t.length,c=0;s<a;++s){r=t[s],l=r.box,l.update(r.width||e.w,r.height||e.h,sn(r.horizontal,e));const{same:a,other:d}=on(e,i,r,n);c|=a&&o.length,h=h||d,l.fullSize||o.push(r)}return c&&an(o,e,i,n)||h}function rn(t,e,i,n,o){t.top=i,t.left=e,t.right=e+n,t.bottom=i+o,t.width=n,t.height=o}function ln(t,e,i,n){const o=i.padding;let{x:s,y:a}=e;for(const r of t){const t=r.box,l=n[r.stack]||{count:1,placed:0,weight:1},c=r.stackWeight/l.weight||1;if(r.horizontal){const n=e.w*c,s=l.size||t.height;O(l.start)&&(a=l.start),t.fullSize?rn(t,o.left,a,i.outerWidth-o.right-o.left,s):rn(t,e.left+l.placed,a,n,s),l.start=a,l.placed+=n,a=t.bottom}else{const n=e.h*c,a=l.size||t.width;O(l.start)&&(s=l.start),t.fullSize?rn(t,s,o.top,a,i.outerHeight-o.bottom-o.top):rn(t,s,e.top+l.placed,a,n),l.start=s,l.placed+=n,s=t.right}}e.x=s,e.y=a}Nt.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var cn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const o=ae(t.options.layout.padding),s=Math.max(e-o.width,0),a=Math.max(i-o.height,0),r=function(t){const e=function(t){const e=[];let i,n,o,s,a,r;for(i=0,n=(t||[]).length;i<n;++i)o=t[i],({position:s,options:{stack:a,stackWeight:r=1}}=o),e.push({index:i,box:o,pos:s,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&s+a,stackWeight:r});return e}(t),i=Ji(e.filter(t=>t.box.fullSize),!0),n=Ji(Zi(e,"left"),!0),o=Ji(Zi(e,"right")),s=Ji(Zi(e,"top"),!0),a=Ji(Zi(e,"bottom")),r=Qi(e,"x"),l=Qi(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:o.concat(l).concat(a).concat(r),chartArea:Zi(e,"chartArea"),vertical:n.concat(o).concat(l),horizontal:s.concat(a).concat(r)}}(t.boxes),l=r.vertical,c=r.horizontal;m(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},o);nn(u,ae(n));const g=Object.assign({maxPadding:u,w:s,h:a,x:o.left,y:o.top},o),f=tn(l.concat(c),d);an(r.fullSize,g,d,f),an(l,g,d,f),an(c,g,d,f)&&an(l,g,d,f),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(g),ln(r.leftAndTop,g,d,f),g.x+=g.w,g.y+=g.h,ln(r.rightAndBottom,g,d,f),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},m(r.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h)})}};class hn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}}class dn extends hn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}}const un={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},gn=t=>null===t||""===t;const fn=!!Ye&&{passive:!0};function pn(t,e,i){t.canvas.removeEventListener(e,i,fn)}function mn(t,e,i){const n=t.canvas,o=n&&Ie(n)||n,s=new MutationObserver(t=>{const e=Ie(o);t.forEach(t=>{for(let n=0;n<t.addedNodes.length;n++){const s=t.addedNodes[n];s!==o&&s!==e||i(t.target)}})});return s.observe(document,{childList:!0,subtree:!0}),s}function bn(t,e,i){const n=t.canvas,o=n&&Ie(n);if(!o)return;const s=new MutationObserver(t=>{t.forEach(t=>{for(let e=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===n){i();break}})});return s.observe(o,{childList:!0}),s}const xn=new Map;let _n=0;function yn(){const t=window.devicePixelRatio;t!==_n&&(_n=t,xn.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function vn(t,e,i){const n=t.canvas,s=n&&Ie(n);if(!s)return;const a=o((t,e)=>{const n=s.clientWidth;i(t,e),n<s.clientWidth&&i()},window),r=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||a(i,n)});return r.observe(s),function(t,e){xn.size||window.addEventListener("resize",yn),xn.set(t,e)}(t,a),r}function Mn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){xn.delete(t),xn.size||window.removeEventListener("resize",yn)}(t)}function wn(t,e,i){const n=t.canvas,s=o(e=>{null!==t.ctx&&i(function(t,e){const i=un[t.type]||t.type,{x:n,y:o}=We(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==o?o:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,fn)}(n,e,s),s}class kn extends hn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",gn(o)){const e=Ue(t,"width");void 0!==e&&(t.width=e)}if(gn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ue(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];l(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),o={attach:mn,detach:bn,resize:vn}[e]||wn;n[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Mn,detach:Mn,resize:Mn}[e]||pn)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return He(t,e,i,n)}isAttached(t){const e=Ie(t);return!(!e||!e.isConnected)}}class Sn{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return N(this.x)&&N(this.y)}getProps(t,e){const i=this,n=this.$animations;if(!e||!n)return i;const o={};return t.forEach(t=>{o[t]=n[t]&&n[t].active()?n[t]._to:i[t]}),o}}Sn.defaults={},Sn.defaultRoutes=void 0;const Pn={values:t=>c(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let o,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const a=z(Math.abs(s)),r=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:o,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Ze(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(z(t)));return 1===n||2===n||5===n?Pn.numeric.call(this,t,e,i):""}};var On={formatters:Pn};function Dn(t,e){const i=t.options.ticks,n=i.maxTicksLimit||function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),o=t._maxLength/i;return Math.floor(Math.min(n,o))}(t),o=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}(e):[],s=o.length,a=o[0],r=o[s-1],c=[];if(s>n)return function(t,e,i,n){let o,s=0,a=i[0];for(n=Math.ceil(n),o=0;o<t.length;o++)o===a&&(e.push(t[o]),s++,a=i[s*n])}(e,c,o,s/n),c;const h=function(t,e,i){const n=function(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}(t),o=e.length/i;if(!n)return Math.max(o,1);const s=function(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n==0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}(n);for(let t=0,e=s.length-1;t<e;t++){const e=s[t];if(e>o)return e}return Math.max(o,1)}(o,e,n);if(s>0){let t,i;const n=s>1?Math.round((r-a)/(s-1)):null;for(Cn(e,c,h,l(n)?0:a-n,a),t=0,i=s-1;t<i;t++)Cn(e,c,h,o[t],o[t+1]);return Cn(e,c,h,r,l(n)?e.length:r+n),c}return Cn(e,c,h),c}function Cn(t,e,i,n,o){const s=g(n,0),a=Math.min(g(o,t.length),t.length);let r,l,c,h=0;for(i=Math.ceil(i),o&&(r=o-n,i=r/Math.floor(r/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);l<a;l++)l===c&&(e.push(t[l]),h++,c=Math.round(s+h*i))}Nt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:On.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Nt.route("scale.ticks","color","","color"),Nt.route("scale.grid","color","","borderColor"),Nt.route("scale.grid","borderColor","","borderColor"),Nt.route("scale.title","color","","color"),Nt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Nt.describe("scales",{_fallback:"scale"}),Nt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Tn=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function An(t,e){const i=[],n=t.length/e,o=t.length;let s=0;for(;s<o;s+=n)i.push(t[Math.floor(s)]);return i}function Rn(t,e,i){const n=t.ticks.length,o=Math.min(e,n-1),s=t._startPixel,a=t._endPixel;let r,l=t.getPixelForTick(o);if(!(i&&(r=1===n?Math.max(l-s,a-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(o-1))/2,l+=o<e?r:-r,l<s-1e-6||l>a+1e-6)))return l}function Ln(t){return t.drawTicks?t.tickLength:0}function En(t,e){if(!t.display)return 0;const i=re(t.font,e),n=ae(t.padding);return(c(t.text)?t.text.length:1)*i.lineHeight+n.height}function Fn(t,e,i){let n=s(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class In extends Sn{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){const e=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=u(t,Number.POSITIVE_INFINITY),e=u(e,Number.NEGATIVE_INFINITY),i=u(i,Number.POSITIVE_INFINITY),n=u(n,Number.NEGATIVE_INFINITY),{min:u(t,i),max:u(e,n),minDefined:d(t),maxDefined:d(e)}}getMinMax(t){const e=this;let i,{min:n,max:o,minDefined:s,maxDefined:a}=e.getUserBounds();if(s&&a)return{min:n,max:o};const r=e.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)i=r[l].controller.getMinMax(e,t),s||(n=Math.min(n,i.min)),a||(o=Math.max(o,i.max));return{min:u(n,u(o,n)),max:u(o,u(n,o))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){p(this.options.beforeUpdate,[this])}update(t,e,i){const n=this,o=n.options.ticks,s=o.sampleSize;n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),n.ticks=null,n._labelSizes=null,n._gridLineItems=null,n._labelItems=null,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n._maxLength=n.isHorizontal()?n.width+i.left+i.right:n.height+i.top+i.bottom,n._dataLimitsCached||(n.beforeDataLimits(),n.determineDataLimits(),n.afterDataLimits(),n._range=function(t,e){const{min:i,max:n}=t;return{min:i-Math.abs(f(e,i)),max:n+f(e,n)}}(n,n.options.grace),n._dataLimitsCached=!0),n.beforeBuildTicks(),n.ticks=n.buildTicks()||[],n.afterBuildTicks();const a=s<n.ticks.length;n._convertTicksToLabels(a?An(n.ticks,s):n.ticks),n.configure(),n.beforeCalculateLabelRotation(),n.calculateLabelRotation(),n.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(n.ticks=Dn(n,n.ticks),n._labelSizes=null),a&&n._convertTicksToLabels(n.ticks),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate()}configure(){const t=this;let e,i,n=t.options.reverse;t.isHorizontal()?(e=t.left,i=t.right):(e=t.top,i=t.bottom,n=!n),t._startPixel=e,t._endPixel=i,t._reversePixels=n,t._length=i-e,t._alignToPixels=t.options.alignToPixels}afterUpdate(){p(this.options.afterUpdate,[this])}beforeSetDimensions(){p(this.options.beforeSetDimensions,[this])}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0}afterSetDimensions(){p(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),p(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){p(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this,i=e.options.ticks;let n,o,s;for(n=0,o=t.length;n<o;n++)s=t[n],s.label=p(i.callback,[s.value,n,t],e)}afterTickToLabelConversion(){p(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){p(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this,e=t.options,i=e.ticks,n=t.ticks.length,o=i.minRotation||0,s=i.maxRotation;let a,r,l,c=o;if(!t._isVisible()||!i.display||o>=s||n<=1||!t.isHorizontal())return void(t.labelRotation=o);const h=t._getLabelSizes(),d=h.widest.width,u=h.highest.height,g=G(t.chart.width-d,0,t.maxWidth);a=e.offset?t.maxWidth/n:g/(n-1),d+6>a&&(a=g/(n-(e.offset?.5:1)),r=t.maxHeight-Ln(e.grid)-i.padding-En(e.title,t.chart.options.font),l=Math.sqrt(d*d+u*u),c=$(Math.min(Math.asin(G((h.highest.height+6)/a,-1,1)),Math.asin(G(r/l,-1,1))-Math.asin(G(u/l,-1,1)))),c=Math.max(o,Math.min(s,c))),t.labelRotation=c}afterCalculateLabelRotation(){p(this.options.afterCalculateLabelRotation,[this])}beforeFit(){p(this.options.beforeFit,[this])}fit(){const t=this,e={width:0,height:0},{chart:i,options:{ticks:n,title:o,grid:s}}=t,a=t._isVisible(),r=t.isHorizontal();if(a){const a=En(o,i.options.font);if(r?(e.width=t.maxWidth,e.height=Ln(s)+a):(e.height=t.maxHeight,e.width=Ln(s)+a),n.display&&t.ticks.length){const{first:i,last:o,widest:s,highest:a}=t._getLabelSizes(),l=2*n.padding,c=H(t.labelRotation),h=Math.cos(c),d=Math.sin(c);if(r){const i=n.mirror?0:d*s.width+h*a.height;e.height=Math.min(t.maxHeight,e.height+i+l)}else{const i=n.mirror?0:h*s.width+d*a.height;e.width=Math.min(t.maxWidth,e.width+i+l)}t._calculatePadding(i,o,d,h)}}t._handleMargins(),r?(t.width=t._length=i.width-t._margins.left-t._margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=i.height-t._margins.top-t._margins.bottom)}_calculatePadding(t,e,i,n){const o=this,{ticks:{align:s,padding:a},position:r}=o.options,l=0!==o.labelRotation,c="top"!==r&&"x"===o.axis;if(o.isHorizontal()){const r=o.getPixelForTick(0)-o.left,h=o.right-o.getPixelForTick(o.ticks.length-1);let d=0,u=0;l?c?(d=n*t.width,u=i*e.height):(d=i*t.height,u=n*e.width):"start"===s?u=e.width:"end"===s?d=t.width:(d=t.width/2,u=e.width/2),o.paddingLeft=Math.max((d-r+a)*o.width/(o.width-r),0),o.paddingRight=Math.max((u-h+a)*o.width/(o.width-h),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),o.paddingTop=i+a,o.paddingBottom=n+a}}_handleMargins(){const t=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}afterFit(){p(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)l(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){const t=this;let e=t._labelSizes;if(!e){const i=t.options.ticks.sampleSize;let n=t.ticks;i<n.length&&(n=An(n,i)),t._labelSizes=e=t._computeLabelSizes(n,n.length)}return e}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:n}=this,o=[],s=[];let a,r,h,d,u,g,f,p,b,x,_,y=0,v=0;for(a=0;a<e;++a){if(d=t[a].label,u=this._resolveTickFontOptions(a),i.font=g=u.string,f=n[g]=n[g]||{data:{},gc:[]},p=u.lineHeight,b=x=0,l(d)||c(d)){if(c(d))for(r=0,h=d.length;r<h;++r)_=d[r],l(_)||c(_)||(b=Wt(i,f.data,f.gc,b,_),x+=p)}else b=Wt(i,f.data,f.gc,b,d),x=p;o.push(b),s.push(x),y=Math.max(b,y),v=Math.max(x,v)}!function(t,e){m(t,t=>{const i=t.gc,n=i.length/2;let o;if(n>e){for(o=0;o<n;++o)delete t.data[i[o]];i.splice(0,n)}})}(n,e);const M=o.indexOf(y),w=s.indexOf(v),k=t=>({width:o[t]||0,height:s[t]||0});return{first:k(0),last:k(e-1),widest:k(M),highest:k(w),widths:o,heights:s}}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){const e=this;e._reversePixels&&(t=1-t);const i=e._startPixel+t*e._length;return G(e._alignToPixels?Ht(e.chart,i,0):i,-32768,32767)}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,i=e.ticks||[];if(t>=0&&t<i.length){const n=i[t];return n.$context||(n.$context=function(t,e,i){return Object.assign(Object.create(t),{tick:i,index:e,type:"tick"})}(e.getContext(),t,n))}return e.$context||(e.$context=(n=e.chart.getContext(),o=e,Object.assign(Object.create(n),{scale:o,type:"scale"})));var n,o}_tickSize(){const t=this.options.ticks,e=H(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,r=o?o.highest.height+s:0;return this.isHorizontal()?r*i>a*n?a/i:r/n:r*n<a*i?r/i:a/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this,i=e.axis,n=e.chart,o=e.options,{grid:s,position:a}=o,r=s.offset,l=e.isHorizontal(),c=e.ticks.length+(r?1:0),d=Ln(s),u=[],f=s.setContext(e.getContext()),p=f.drawBorder?f.borderWidth:0,m=p/2,b=function(t){return Ht(n,t,p)};let x,_,y,v,M,w,k,S,P,O,D,C;if("top"===a)x=b(e.bottom),w=e.bottom-d,S=x-m,O=b(t.top)+m,C=t.bottom;else if("bottom"===a)x=b(e.top),O=t.top,C=b(t.bottom)-m,w=x+m,S=e.top+d;else if("left"===a)x=b(e.right),M=e.right-d,k=x-m,P=b(t.left)+m,D=t.right;else if("right"===a)x=b(e.left),P=t.left,D=b(t.right)-m,M=x+m,k=e.left+d;else if("x"===i){if("center"===a)x=b((t.top+t.bottom)/2+.5);else if(h(a)){const t=Object.keys(a)[0],i=a[t];x=b(e.chart.scales[t].getPixelForValue(i))}O=t.top,C=t.bottom,w=x+m,S=w+d}else if("y"===i){if("center"===a)x=b((t.left+t.right)/2);else if(h(a)){const t=Object.keys(a)[0],i=a[t];x=b(e.chart.scales[t].getPixelForValue(i))}M=x-m,k=M-d,P=t.left,D=t.right}const T=g(o.ticks.maxTicksLimit,c),A=Math.max(1,Math.ceil(c/T));for(_=0;_<c;_+=A){const t=s.setContext(e.getContext(_)),i=t.lineWidth,o=t.color,a=s.borderDash||[],c=t.borderDashOffset,h=t.tickWidth,d=t.tickColor,g=t.tickBorderDash||[],f=t.tickBorderDashOffset;y=Rn(e,_,r),void 0!==y&&(v=Ht(n,y,i),l?M=k=P=D=v:w=S=O=C=v,u.push({tx1:M,ty1:w,tx2:k,ty2:S,x1:P,y1:O,x2:D,y2:C,width:i,color:o,borderDash:a,borderDashOffset:c,tickWidth:h,tickColor:d,tickBorderDash:g,tickBorderDashOffset:f}))}return e._ticksLength=c,e._borderValue=x,u}_computeLabelItems(t){const e=this,i=e.axis,n=e.options,{position:o,ticks:s}=n,a=e.isHorizontal(),r=e.ticks,{align:l,crossAlign:d,padding:u,mirror:g}=s,f=Ln(n.grid),p=f+u,m=g?-u:p,b=-H(e.labelRotation),x=[];let _,y,v,M,w,k,S,P,O,D,C,T,A="middle";if("top"===o)k=e.bottom-m,S=e._getXAxisLabelAlignment();else if("bottom"===o)k=e.top+m,S=e._getXAxisLabelAlignment();else if("left"===o){const t=e._getYAxisLabelAlignment(f);S=t.textAlign,w=t.x}else if("right"===o){const t=e._getYAxisLabelAlignment(f);S=t.textAlign,w=t.x}else if("x"===i){if("center"===o)k=(t.top+t.bottom)/2+p;else if(h(o)){const t=Object.keys(o)[0],i=o[t];k=e.chart.scales[t].getPixelForValue(i)+p}S=e._getXAxisLabelAlignment()}else if("y"===i){if("center"===o)w=(t.left+t.right)/2-p;else if(h(o)){const t=Object.keys(o)[0],i=o[t];w=e.chart.scales[t].getPixelForValue(i)}S=e._getYAxisLabelAlignment(f).textAlign}"y"===i&&("start"===l?A="top":"end"===l&&(A="bottom"));const R=e._getLabelSizes();for(_=0,y=r.length;_<y;++_){v=r[_],M=v.label;const t=s.setContext(e.getContext(_));P=e.getPixelForTick(_)+s.labelOffset,O=e._resolveTickFontOptions(_),D=O.lineHeight,C=c(M)?M.length:1;const i=C/2,n=t.color,l=t.textStrokeColor,h=t.textStrokeWidth;let u;if(a?(w=P,T="top"===o?"near"===d||0!==b?-C*D+D/2:"center"===d?-R.highest.height/2-i*D+D:-R.highest.height+D/2:"near"===d||0!==b?D/2:"center"===d?R.highest.height/2-i*D:R.highest.height-C*D,g&&(T*=-1)):(k=P,T=(1-C)*D/2),t.showLabelBackdrop){const e=ae(t.backdropPadding),i=R.heights[_],n=R.widths[_];let o=k+T-e.top,s=w-e.left;switch(A){case"middle":o-=i/2;break;case"bottom":o-=i}switch(S){case"center":s-=n/2;break;case"right":s-=n}u={left:s,top:o,width:n+e.width,height:i+e.height,color:t.backdropColor}}x.push({rotation:b,label:M,font:O,color:n,strokeColor:l,strokeWidth:h,textOffset:T,textAlign:S,textBaseline:A,translation:[w,k],backdrop:u})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-H(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align&&(i="right"),i}_getYAxisLabelAlignment(t){const e=this,{position:i,ticks:{crossAlign:n,mirror:o,padding:s}}=e.options,a=t+s,r=e._getLabelSizes().widest.width;let l,c;return"left"===i?o?(c=e.right+s,"near"===n?l="left":"center"===n?(l="center",c+=r/2):(l="right",c+=r)):(c=e.right-a,"near"===n?l="right":"center"===n?(l="center",c-=r/2):(l="left",c=e.left)):"right"===i?o?(c=e.left+s,"near"===n?l="right":"center"===n?(l="center",c-=r/2):(l="left",c-=r)):(c=e.left+a,"near"===n?l="left":"center"===n?(l="center",c+=r/2):(l="right",c=e.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){const t=this;if(t.options.ticks.mirror)return;const e=t.chart,i=t.options.position;return"left"===i||"right"===i?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===i||"bottom"===i?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,s),t.restore())}getLineWidthForValue(t){const e=this,i=e.options.grid;if(!e._isVisible()||!i.display)return 0;const n=e.ticks.findIndex(e=>e.value===t);if(n>=0){return i.setContext(e.getContext(n)).lineWidth}return 0}drawGrid(t){const e=this,i=e.options.grid,n=e.ctx,o=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));let s,a;const r=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(i.display)for(s=0,a=o.length;s<a;++s){const t=o[s];i.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),i.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const t=this,{chart:e,ctx:i,options:{grid:n}}=t,o=n.setContext(t.getContext()),s=n.drawBorder?o.borderWidth:0;if(!s)return;const a=n.setContext(t.getContext(0)).lineWidth,r=t._borderValue;let l,c,h,d;t.isHorizontal()?(l=Ht(e,t.left,s)-s/2,c=Ht(e,t.right,a)+a/2,h=d=r):(h=Ht(e,t.top,s)-s/2,d=Ht(e,t.bottom,a)+a/2,l=c=r),i.save(),i.lineWidth=o.borderWidth,i.strokeStyle=o.borderColor,i.beginPath(),i.moveTo(l,h),i.lineTo(c,d),i.stroke(),i.restore()}drawLabels(t){const e=this;if(!e.options.ticks.display)return;const i=e.ctx,n=e._computeLabelArea();n&&Xt(i,n);const o=e._labelItems||(e._labelItems=e._computeLabelItems(t));let s,a;for(s=0,a=o.length;s<a;++s){const t=o[s],e=t.font,n=t.label;t.backdrop&&(i.fillStyle=t.backdrop.color,i.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Zt(i,n,0,t.textOffset,e,t)}n&&qt(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=re(i.font),s=ae(i.padding),r=i.align;let l=o.lineHeight/2;"bottom"===e||"center"===e||h(e)?(l+=s.bottom,c(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=s.top;const{titleX:d,titleY:u,maxWidth:g,rotation:f}=function(t,e,i,n){const{top:o,left:s,bottom:r,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let g,f,p,m=0;const b=r-o,x=l-s;if(t.isHorizontal()){if(f=a(n,s,l),h(i)){const t=Object.keys(i)[0],n=i[t];p=u[t].getPixelForValue(n)+b-e}else p="center"===i?(d.bottom+d.top)/2+b-e:Tn(t,i,e);g=l-s}else{if(h(i)){const t=Object.keys(i)[0],n=i[t];f=u[t].getPixelForValue(n)-x+e}else f="center"===i?(d.left+d.right)/2-x+e:Tn(t,i,e);p=a(n,r,o),m="left"===i?-E:E}return{titleX:f,titleY:p,maxWidth:g,rotation:m}}(this,l,e,r);Zt(t,i.text,0,0,o,{color:i.color,maxWidth:g,rotation:f,textAlign:Fn(r,e,n),textBaseline:"middle",translation:[d,u]})}draw(t){const e=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}_layers(){const t=this,e=t.options,i=e.ticks&&e.ticks.z||0,n=g(e.grid&&e.grid.z,-1);return t._isVisible()&&t.draw===In.prototype.draw?[{z:n,draw(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:n+1,draw(){t.drawBorder()}},{z:i,draw(e){t.drawLabels(e)}}]:[{z:i,draw(e){t.draw(e)}}]}getMatchingVisibleMetas(t){const e=this,i=e.chart.getSortedVisibleDatasetMetas(),n=e.axis+"AxisID",o=[];let s,a;for(s=0,a=i.length;s<a;++s){const a=i[s];a[n]!==e.id||t&&a.type!==t||o.push(a)}return o}_resolveTickFontOptions(t){return re(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class zn{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=this,i=Object.getPrototypeOf(t);let n;(function(t){return"id"in t&&"defaults"in t})(i)&&(n=e.register(i));const o=e.items,s=t.id,a=e.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in o||(o[s]=t,function(t,e,i){const n=v(Object.create(null),[i?Nt.get(i):{},Nt.get(e),t.defaults]);Nt.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{const n=i.split("."),o=n.pop(),s=[t].concat(n).join("."),a=e[i].split("."),r=a.pop(),l=a.join(".");Nt.route(s,o,l,r)})}(e,t.defaultRoutes);t.descriptors&&Nt.describe(e,t.descriptors)}(t,a,n),e.override&&Nt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Nt[n]&&(delete Nt[n][i],this.override&&delete It[i])}}var Vn=new class{constructor(){this.controllers=new zn(ki,"datasets",!0),this.elements=new zn(Sn,"elements"),this.plugins=new zn(Object,"plugins"),this.scales=new zn(In,"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,i){const n=this;[...e].forEach(e=>{const o=i||n._getRegistryForType(e);i||o.isForType(e)||o===n.plugins&&e.id?n._exec(t,o,e):m(e,e=>{const o=i||n._getRegistryForType(e);n._exec(t,o,e)})})}_exec(t,e,i){const n=P(t);p(i["before"+n],[],i),e[t](i),p(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}};class Bn{constructor(){this._init=[]}notify(t,e,i,n){const o=this;"beforeInit"===e&&(o._init=o._createDescriptors(t,!0),o._notify(o._init,t,"install"));const s=n?o._descriptors(t).filter(n):o._descriptors(t),a=o._notify(s,t,e,i);return"destroy"===e&&(o._notify(s,t,"stop"),o._notify(o._init,t,"uninstall")),a}_notify(t,e,i,n){n=n||{};for(const o of t){const t=o.plugin;if(!1===p(t[i],[e,n,o.options],t)&&n.cancelable)return!1}return!0}invalidate(){l(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 i=t&&t.config,n=g(i.options&&i.options.plugins,{}),o=function(t){const e=[],i=Object.keys(Vn.plugins.items);for(let t=0;t<i.length;t++)e.push(Vn.getPlugin(i[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const i=n[t];-1===e.indexOf(i)&&e.push(i)}return e}(i);return!1!==n||e?function(t,e,i,n){const o=[],s=t.getContext();for(let a=0;a<e.length;a++){const r=e[a],l=r.id,c=Nn(i[l],n);null!==c&&o.push({plugin:r,options:Wn(t.config,r,c,s)})}return o}(t,o,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Nn(t,e){return e||!1!==t?!0===t?{}:t:null}function Wn(t,e,i,n){const o=t.pluginScopeKeys(e),s=t.getOptionScopes(i,o);return t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function jn(t,e){const i=Nt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Hn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function $n(t){const e=t.options||(t.options={});e.plugins=g(e.plugins,{}),e.scales=function(t,e){const i=It[t.type]||{scales:{}},n=e.scales||{},o=jn(t.type,e),s=Object.create(null),a=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t],r=Hn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(r,o),c=i.scales||{};s[r]=s[r]||t,a[t]=M(Object.create(null),[{axis:r},e,c[r],c[l]])}),t.data.datasets.forEach(i=>{const o=i.type||t.type,r=i.indexAxis||jn(o,e),l=(It[o]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),o=i[e+"AxisID"]||s[e]||e;a[o]=a[o]||Object.create(null),M(a[o],[{axis:e},n[o],l[t]])})}),Object.keys(a).forEach(t=>{const e=a[t];M(e,[Nt.scales[e.type],Nt.scale])}),a}(t,e)}function Yn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Un=new Map,Xn=new Set;function qn(t,e){let i=Un.get(t);return i||(i=e(),Un.set(t,i),Xn.add(i)),i}const Kn=(t,e,i)=>{const n=S(e,i);void 0!==n&&t.add(n)};class Gn{constructor(t){this._config=function(t){return(t=t||{}).data=Yn(t.data),$n(t),t}(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=Yn(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(),$n(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return qn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return qn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return qn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return qn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,s=this._cachedScopes(t,i),a=s.get(e);if(a)return a;const r=new Set;e.forEach(e=>{t&&(r.add(t),e.forEach(e=>Kn(r,t,e))),e.forEach(t=>Kn(r,n,t)),e.forEach(t=>Kn(r,It[o]||{},t)),e.forEach(t=>Kn(r,Nt,t)),e.forEach(t=>Kn(r,zt,t))});const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),Xn.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,It[e]||{},Nt.datasets[e]||{},{type:e},Nt,zt]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=Zn(this._resolverCache,t,n);let r=s;if(function(t,e){const{isScriptable:i,isIndexable:n}=be(t);for(const o of e)if(i(o)&&D(t[o])||n(o)&&c(t[o]))return!0;return!1}(s,e)){o.$shared=!1;r=me(s,i=D(i)?i():i,this.createResolver(t,i,a))}for(const t of e)o[t]=r[t];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Zn(this._resolverCache,t,i);return h(e)?me(o,e,void 0,n):o}}function Zn(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const o=i.join();let s=n.get(o);if(!s){s={resolver:pe(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(o,s)}return s}const Qn=["top","bottom","left","right","chartArea"];function Jn(t,e){return"top"===t||"bottom"===t||-1===Qn.indexOf(t)&&"x"===e}function to(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function eo(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),p(i&&i.onComplete,[t],e)}function io(t){const e=t.chart,i=e.options.animation;p(i&&i.onProgress,[t],e)}function no(t){return Fe()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const oo={},so=t=>{const e=no(t);return Object.values(oo).filter(t=>t.canvas===e).pop()};class ao{constructor(t,e){const i=this,n=this.config=new Gn(e),o=no(t),s=so(o);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");const a=n.createResolver(n.chartOptionScopes(),i.getContext());this.platform=new(n.platform||function(t){return!Fe()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?dn:kn}(o));const l=i.platform.acquireContext(o,a.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;this.id=r(),this.ctx=l,this.canvas=c,this.width=d,this.height=h,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 Bn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(){return e?(clearTimeout(i),i=setTimeout(t,e)):t(),e}}(()=>this.update("resize"),a.resizeDelay||0),oo[i.id]=i,l&&c?(li.listen(i,"complete",eo),li.listen(i,"progress",io),i._initialize(),i.attached&&i.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return l(t)?e&&o?o:n?i/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}_initialize(){const t=this;return t.notifyPlugins("beforeInit"),t.options.responsive?t.resize():$e(t,t.options.devicePixelRatio),t.bindEvents(),t.notifyPlugins("afterInit"),t}clear(){return $t(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(t,e){li.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this,n=i.options,o=i.canvas,s=n.maintainAspectRatio&&i.aspectRatio,a=i.platform.getMaximumSize(o,t,e,s),r=n.devicePixelRatio||i.platform.getDevicePixelRatio();i.width=a.width,i.height=a.height,i._aspectRatio=i.aspectRatio,$e(i,r,!0)&&(i.notifyPlugins("resize",{size:a}),p(n.onResize,[i,a],i),i.attached&&i._doResize()&&i.render())}ensureScalesHaveIDs(){m(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this,e=t.options,i=e.scales,n=t.scales,o=Object.keys(n).reduce((t,e)=>(t[e]=!1,t),{});let s=[];i&&(s=s.concat(Object.keys(i).map(t=>{const e=i[t],n=Hn(t,e),o="r"===n,s="x"===n;return{options:e,dposition:o?"chartArea":s?"bottom":"left",dtype:o?"radialLinear":s?"category":"linear"}}))),m(s,i=>{const s=i.options,a=s.id,r=Hn(a,s),l=g(s.type,i.dtype);void 0!==s.position&&Jn(s.position,r)===Jn(i.dposition)||(s.position=i.dposition),o[a]=!0;let c=null;if(a in n&&n[a].type===l)c=n[a];else{c=new(Vn.getScale(l))({id:a,type:l,ctx:t.ctx,chart:t}),n[c.id]=c}c.init(s,e)}),m(o,(t,e)=>{t||delete n[e]}),m(n,e=>{cn.configure(t,e,e.options),cn.addBox(t,e)})}_updateMetasets(){const t=this,e=t._metasets,i=t.data.datasets.length,n=e.length;if(e.sort((t,e)=>t.index-e.index),n>i){for(let e=i;e<n;++e)t._destroyDatasetMeta(e);e.splice(i,n-i)}t._sortedMetasets=e.slice(0).sort(to("order","index"))}_removeUnreferencedMetasets(){const t=this,{_metasets:e,data:{datasets:i}}=t;e.length>i.length&&delete t._stacks,e.forEach((e,n)=>{0===i.filter(t=>t===e._dataset).length&&t._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=this,e=[],i=t.data.datasets;let n,o;for(t._removeUnreferencedMetasets(),n=0,o=i.length;n<o;n++){const o=i[n];let s=t.getDatasetMeta(n);const a=o.type||t.config.type;if(s.type&&s.type!==a&&(t._destroyDatasetMeta(n),s=t.getDatasetMeta(n)),s.type=a,s.indexAxis=o.indexAxis||jn(a,t.options),s.order=o.order||0,s.index=n,s.label=""+o.label,s.visible=t.isDatasetVisible(n),s.controller)s.controller.updateIndex(n),s.controller.linkScales();else{const i=Vn.getController(a),{datasetElementType:o,dataElementType:r}=Nt.datasets[a];Object.assign(i.prototype,{dataElementType:Vn.getElement(r),datasetElementType:o&&Vn.getElement(o)}),s.controller=new i(t,n),e.push(s.controller)}}return t._updateMetasets(),e}_resetElements(){const t=this;m(t.data.datasets,(e,i)=>{t.getDatasetMeta(i).controller.reset()},t)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this,i=e.config;i.update(),e._options=i.createResolver(i.chartOptionScopes(),e.getContext()),m(e.scales,t=>{cn.removeBox(e,t)});const n=e._animationsDisabled=!e.options.animation;e.ensureScalesHaveIDs(),e.buildOrUpdateScales();if(((t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0})(new Set(Object.keys(e._listeners)),new Set(e.options.events))&&!!this._responsiveListeners===e.options.responsive||(e.unbindEvents(),e.bindEvents()),e._plugins.invalidate(),!1===e.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=e.buildOrUpdateControllers();e.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,i=e.data.datasets.length;t<i;t++){const{controller:i}=e.getDatasetMeta(t),a=!n&&-1===o.indexOf(i);i.buildOrUpdateElements(a),s=Math.max(+i.getMaxOverflow(),s)}e._minPadding=s,e._updateLayout(s),n||m(o,t=>{t.reset()}),e._updateDatasets(t),e.notifyPlugins("afterUpdate",{mode:t}),e._layers.sort(to("z","_idx")),e._lastEvent&&e._eventHandler(e._lastEvent,!0),e.render()}_updateLayout(t){const e=this;if(!1===e.notifyPlugins("beforeLayout",{cancelable:!0}))return;cn.update(e,e.width,e.height,t);const i=e.chartArea,n=i.width<=0||i.height<=0;e._layers=[],m(e.boxes,t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),e._layers.push(...t._layers()))},e),e._layers.forEach((t,e)=>{t._idx=e}),e.notifyPlugins("afterLayout")}_updateDatasets(t){const e=this,i="function"==typeof t;if(!1!==e.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let n=0,o=e.data.datasets.length;n<o;++n)e._updateDataset(n,i?t({datasetIndex:n}):t);e.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){const t=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(li.has(t)?t.attached&&!li.running(t)&&li.start(t):(t.draw(),eo({chart:t})))}draw(){const t=this;let e;if(t._resizeBeforeDraw){const{width:e,height:i}=t._resizeBeforeDraw;t._resize(e,i),t._resizeBeforeDraw=null}if(t.clear(),t.width<=0||t.height<=0)return;if(!1===t.notifyPlugins("beforeDraw",{cancelable:!0}))return;const i=t._layers;for(e=0;e<i.length&&i[e].z<=0;++e)i[e].draw(t.chartArea);for(t._drawDatasets();e<i.length;++e)i[e].draw(t.chartArea);t.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];t&&!o.visible||i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){const t=this;if(!1===t.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=t.getSortedVisibleDatasetMetas();for(let i=e.length-1;i>=0;--i)t._drawDataset(e[i]);t.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this,i=e.ctx,n=t._clip,o=!n.disabled,s=e.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==e.notifyPlugins("beforeDatasetDraw",a)&&(o&&Xt(i,{left:!1===n.left?0:s.left-n.left,right:!1===n.right?e.width:s.right+n.right,top:!1===n.top?0:s.top-n.top,bottom:!1===n.bottom?e.height:s.bottom+n.bottom}),t.controller.draw(),o&&qt(i),a.cancelable=!1,e.notifyPlugins("afterDatasetDraw",a))}getElementsAtEventForMode(t,e,i,n){const o=Ki.modes[e];return"function"==typeof o?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._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},i.push(n)),n}getContext(){return this.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=this,o=i?"show":"hide",s=n.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,o);O(e)?(s.data[e].hidden=!i,n.update()):(n.setDatasetVisibility(t,i),a.update(s,{visible:i}),n.update(e=>e.datasetIndex===t?o:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this,i=e._metasets&&e._metasets[t];i&&i.controller&&(i.controller._destroy(),delete e._metasets[t])}destroy(){const t=this,{canvas:e,ctx:i}=t;let n,o;for(t.stop(),li.remove(t),n=0,o=t.data.datasets.length;n<o;++n)t._destroyDatasetMeta(n);t.config.clearCache(),e&&(t.unbindEvents(),$t(e,i),t.platform.releaseContext(i),t.canvas=null,t.ctx=null),t.notifyPlugins("destroy"),delete oo[t.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this,e=t._listeners,i=t.platform,n=function(e,i,n){e.offsetX=i,e.offsetY=n,t._eventHandler(e)};m(t.options.events,o=>((n,o)=>{i.addEventListener(t,n,o),e[n]=o})(o,n))}bindResponsiveEvents(){const t=this;t._responsiveListeners||(t._responsiveListeners={});const e=t._responsiveListeners,i=t.platform,n=(n,o)=>{i.addEventListener(t,n,o),e[n]=o},o=(n,o)=>{e[n]&&(i.removeEventListener(t,n,o),delete e[n])},s=(e,i)=>{t.canvas&&t.resize(e,i)};let a;const r=()=>{o("attach",r),t.attached=!0,t.resize(),n("resize",s),n("detach",a)};a=()=>{t.attached=!1,o("resize",s),n("attach",r)},i.isAttached(t.canvas)?r():a()}unbindEvents(){const t=this;m(t._listeners,(e,i)=>{t.platform.removeEventListener(t,i,e)}),t._listeners={},m(t._responsiveListeners,(e,i)=>{t.platform.removeEventListener(t,i,e)}),t._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,s,a,r;for("dataset"===e&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){s=t[a];const e=s&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this,i=e._active||[],n=t.map(({datasetIndex:t,index:i})=>{const n=e.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[i],index:i}});!b(n,i)&&(e._active=n,e._updateHoverStyles(n,i))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this,o=n.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),a=s(e,t),r=i?t:s(t,e);a.length&&n.updateHoverStyle(a,o.mode,!1),r.length&&o.mode&&n.updateHoverStyle(r,o.mode,!0)}_eventHandler(t,e){const i=this,n={event:t,replay:e,cancelable:!0},o=e=>(e.options.events||this.options.events).includes(t.type);if(!1===i.notifyPlugins("beforeEvent",n,o))return;const s=i._handleEvent(t,e);return n.cancelable=!1,i.notifyPlugins("afterEvent",n,o),(s||n.changed)&&i.render(),i}_handleEvent(t,e){const i=this,{_active:n=[],options:o}=i,s=o.hover,a=e;let r=[],l=!1,c=null;return"mouseout"!==t.type&&(r=i.getElementsAtEventForMode(t,s.mode,s,a),c="click"===t.type?i._lastEvent:t),i._lastEvent=null,Ut(t,i.chartArea,i._minPadding)&&(p(o.onHover,[t,r,i],i),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||p(o.onClick,[t,r,i],i)),l=!b(r,n),(l||e)&&(i._active=r,i._updateHoverStyles(r,n,e)),i._lastEvent=c,l}}const ro=()=>m(ao.instances,t=>t._plugins.invalidate());function lo(t,e,i){const{startAngle:n,pixelMargin:o,x:s,y:a,outerRadius:r,innerRadius:l}=e;let c=o/r;t.beginPath(),t.arc(s,a,r,n-c,i+c),l>o?(c=o/l,t.arc(s,a,l,i+c,n-c,!0)):t.arc(s,a,o,i+E,n-E),t.closePath(),t.clip()}function co(t,e,i,n){const o=ne(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const s=(i-e)/2,a=Math.min(s,n*e/2),r=t=>{const e=(i-Math.min(s,t))*n/2;return G(t,0,Math.min(s,e))};return{outerStart:r(o.outerStart),outerEnd:r(o.outerEnd),innerStart:G(o.innerStart,0,a),innerEnd:G(o.innerEnd,0,a)}}function ho(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function uo(t,e,i,n,o){const{x:s,y:a,startAngle:r,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const g=o-r;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(g-(0!==t?g*t/(t+n):g))/2}const f=(g-Math.max(.001,g*h-i/C)/h)/2,p=r+f+u,m=o-f-u,{outerStart:b,outerEnd:x,innerStart:_,innerEnd:y}=co(e,d,h,m-p),v=h-b,M=h-x,w=p+b/v,k=m-x/M,S=d+_,P=d+y,O=p+_/S,D=m-y/P;if(t.beginPath(),t.arc(s,a,h,w,k),x>0){const e=ho(M,k,s,a);t.arc(e.x,e.y,x,k,m+E)}const T=ho(P,m,s,a);if(t.lineTo(T.x,T.y),y>0){const e=ho(P,D,s,a);t.arc(e.x,e.y,y,m+E,D+Math.PI)}if(t.arc(s,a,d,m-y/d,p+_/d,!0),_>0){const e=ho(S,O,s,a);t.arc(e.x,e.y,_,O+Math.PI,p-E)}const A=ho(v,p,s,a);if(t.lineTo(A.x,A.y),b>0){const e=ho(v,w,s,a);t.arc(e.x,e.y,b,p-E,w)}t.closePath()}function go(t,e,i,n,o){const{options:s}=e,a="inner"===s.borderAlign;s.borderWidth&&(a?(t.lineWidth=2*s.borderWidth,t.lineJoin="round"):(t.lineWidth=s.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,i){const{x:n,y:o,startAngle:s,pixelMargin:a,fullCircles:r}=e,l=Math.max(e.outerRadius-a,0),c=e.innerRadius+a;let h;for(i&&lo(t,e,s+T),t.beginPath(),t.arc(n,o,c,s+T,s,!0),h=0;h<r;++h)t.stroke();for(t.beginPath(),t.arc(n,o,l,s,s+T),h=0;h<r;++h)t.stroke()}(t,e,a),a&&lo(t,e,o),uo(t,e,i,n,o),t.stroke())}Object.defineProperties(ao,{defaults:{enumerable:!0,value:Nt},instances:{enumerable:!0,value:oo},overrides:{enumerable:!0,value:It},registry:{enumerable:!0,value:Vn},version:{enumerable:!0,value:"3.5.1"},getChart:{enumerable:!0,value:so},register:{enumerable:!0,value:(...t)=>{Vn.add(...t),ro()}},unregister:{enumerable:!0,value:(...t)=>{Vn.remove(...t),ro()}}});class fo extends Sn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:o,distance:s}=function(t,e){const i=e.x-t.x,n=e.y-t.y,o=Math.sqrt(i*i+n*n);let s=Math.atan2(n,i);return s<-.5*C&&(s+=T),{angle:s,distance:o}}(n,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2;return(h>=T||K(o,a,r))&&(s>=l+d&&s<=c+d)}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:o,innerRadius:s,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:l}=this.options,c=(n+o)/2,h=(s+a+l+r)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const e=this,{options:i,circumference:n}=e,o=(i.offset||0)/2,s=(i.spacing||0)/2;if(e.pixelMargin="inner"===i.borderAlign?.33:0,e.fullCircles=n>T?Math.floor(n/T):0,0===n||e.innerRadius<0||e.outerRadius<0)return;t.save();let a=0;if(o){a=o/2;const i=(e.startAngle+e.endAngle)/2;t.translate(Math.cos(i)*a,Math.sin(i)*a),e.circumference>=C&&(a=o)}t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor;const r=function(t,e,i,n){const{fullCircles:o,startAngle:s,circumference:a}=e;let r=e.endAngle;if(o){uo(t,e,i,n,s+T);for(let e=0;e<o;++e)t.fill();isNaN(a)||(r=s+a%T,a%T==0&&(r+=T))}return uo(t,e,i,n,r),t.fill(),r}(t,e,a,s);go(t,e,a,s,r),t.restore()}}function po(t,e,i=e){t.lineCap=g(i.borderCapStyle,e.borderCapStyle),t.setLineDash(g(i.borderDash,e.borderDash)),t.lineDashOffset=g(i.borderDashOffset,e.borderDashOffset),t.lineJoin=g(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=g(i.borderWidth,e.borderWidth),t.strokeStyle=g(i.borderColor,e.borderColor)}function mo(t,e,i){t.lineTo(i.x,i.y)}function bo(t,e,i={}){const n=t.length,{start:o=0,end:s=n-1}=i,{start:a,end:r}=e,l=Math.max(o,a),c=Math.min(s,r),h=o<a&&s<a||o>r&&s>r;return{count:n,start:l,loop:e.loop,ilen:c<l&&!h?n+c-l:c-l}}function xo(t,e,i,n){const{points:o,options:s}=e,{count:a,start:r,loop:l,ilen:c}=bo(o,i,n),h=function(t){return t.stepped?Kt:t.tension||"monotone"===t.cubicInterpolationMode?Gt:mo}(s);let d,u,g,{move:f=!0,reverse:p}=n||{};for(d=0;d<=c;++d)u=o[(r+(p?c-d:d))%a],u.skip||(f?(t.moveTo(u.x,u.y),f=!1):h(t,g,u,p,s.stepped),g=u);return l&&(u=o[(r+(p?c:0))%a],h(t,g,u,p,s.stepped)),!!l}function _o(t,e,i,n){const o=e.points,{count:s,start:a,ilen:r}=bo(o,i,n),{move:l=!0,reverse:c}=n||{};let h,d,u,g,f,p,m=0,b=0;const x=t=>(a+(c?r-t:t))%s,_=()=>{g!==f&&(t.lineTo(m,f),t.lineTo(m,g),t.lineTo(m,p))};for(l&&(d=o[x(0)],t.moveTo(d.x,d.y)),h=0;h<=r;++h){if(d=o[x(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(i<g?g=i:i>f&&(f=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),u=n,b=0,g=f=i),p=i}_()}function yo(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?_o:xo}fo.id="arc",fo.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},fo.defaultRoutes={backgroundColor:"backgroundColor"};const vo="function"==typeof Path2D;function Mo(t,e,i,n){vo&&1===e.segments.length?function(t,e,i,n){let o=e._path;o||(o=e._path=new Path2D,e.path(o,i,n)&&o.closePath()),po(t,e.options),t.stroke(o)}(t,e,i,n):function(t,e,i,n){const{segments:o,options:s}=e,a=yo(e);for(const r of o)po(t,s,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class wo extends Sn{constructor(t){super(),this.animated=!0,this.options=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this,n=i.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!i._pointsUpdated){const o=n.spanGaps?i._loop:i._fullLoop;Ee(i._points,n,t,o,e),i._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,o=i.length;if(!o)return[];const s=!!t._loop,{start:a,end:r}=function(t,e,i,n){let o=0,s=e-1;if(i&&!n)for(;o<e&&!t[o].skip;)o++;for(;o<e&&t[o].skip;)o++;for(o%=e,i&&(s+=o);s>o&&t[s%e].skip;)s--;return s%=e,{start:o,end:s}}(i,o,s,n);return si(t,!0===n?[{start:a,end:r,loop:s}]:function(t,e,i,n){const o=t.length,s=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%o];i.skip||i.stop?l.skip||(n=!1,s.push({start:e%o,end:(a-1)%o,loop:n}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&s.push({start:e%o,end:r%o,loop:n}),s}(i,a,r<a?r+o:r,!!t._fullLoop&&0===a&&r===o-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,s=oi(this,{property:e,start:n,end:n});if(!s.length)return;const a=[],r=function(t){return t.stepped?qe:t.tension||"monotone"===t.cubicInterpolationMode?Ke:Xe}(i);let l,c;for(l=0,c=s.length;l<c;++l){const{start:c,end:h}=s[l],d=o[c],u=o[h];if(d===u){a.push(d);continue}const g=r(d,u,Math.abs((n-d[e])/(u[e]-d[e])),i.stepped);g[e]=t[e],a.push(g)}return 1===a.length?a[0]:a}pathSegment(t,e,i){return yo(this)(t,this,e,i)}path(t,e,i){const n=this,o=n.segments,s=yo(n);let a=n._loop;e=e||0,i=i||n.points.length-e;for(const r of o)a&=s(t,n,r,{start:e,end:e+i-1});return!!a}draw(t,e,i,n){const o=this,s=o.options||{};(o.points||[]).length&&s.borderWidth&&(t.save(),Mo(t,o,i,n),t.restore(),o.animated&&(o._pointsUpdated=!1,o._path=void 0))}}function ko(t,e,i,n){const o=t.options,{[i]:s}=t.getProps([i],n);return Math.abs(e-s)<o.radius+o.hitRadius}wo.id="line",wo.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},wo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},wo.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class So extends Sn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:o,y:s}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-s,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return ko(this,t,"x",e)}inYRange(t,e){return ko(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this,n=i.options;i.skip||n.radius<.1||!Ut(i,e,i.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Yt(t,n,i.x,i.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Po(t,e){const{x:i,y:n,base:o,width:s,height:a}=t.getProps(["x","y","base","width","height"],e);let r,l,c,h,d;return t.horizontal?(d=a/2,r=Math.min(i,o),l=Math.max(i,o),c=n-d,h=n+d):(d=s/2,r=i-d,l=i+d,c=Math.min(n,o),h=Math.max(n,o)),{left:r,top:c,right:l,bottom:h}}function Oo(t,e,i,n){return t?0:G(e,i,n)}function Do(t){const e=Po(t),i=e.right-e.left,n=e.bottom-e.top,o=function(t,e,i){const n=t.options.borderWidth,o=t.borderSkipped,s=oe(n);return{t:Oo(o.top,s.top,0,i),r:Oo(o.right,s.right,0,e),b:Oo(o.bottom,s.bottom,0,i),l:Oo(o.left,s.left,0,e)}}(t,i/2,n/2),s=function(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,s=se(o),a=Math.min(e,i),r=t.borderSkipped,l=n||h(o);return{topLeft:Oo(!l||r.top||r.left,s.topLeft,0,a),topRight:Oo(!l||r.top||r.right,s.topRight,0,a),bottomLeft:Oo(!l||r.bottom||r.left,s.bottomLeft,0,a),bottomRight:Oo(!l||r.bottom||r.right,s.bottomRight,0,a)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:s},inner:{x:e.left+o.l,y:e.top+o.t,w:i-o.l-o.r,h:n-o.t-o.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,s.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(o.b,o.r))}}}}function Co(t,e,i,n){const o=null===e,s=null===i,a=t&&!(o&&s)&&Po(t,n);return a&&(o||e>=a.left&&e<=a.right)&&(s||i>=a.top&&i<=a.bottom)}function To(t,e){t.rect(e.x,e.y,e.w,e.h)}function Ao(t,e,i={}){const n=t.x!==i.x?-e:0,o=t.y!==i.y?-e:0,s=(t.x+t.w!==i.x+i.w?e:0)-n,a=(t.y+t.h!==i.y+i.h?e:0)-o;return{x:t.x+n,y:t.y+o,w:t.w+s,h:t.h+a,radius:t.radius}}So.id="point",So.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},So.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ro extends Sn{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const e=this.options,{inner:i,outer:n}=Do(this),o=(s=n.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?Jt:To;var s;t.save(),n.w===i.w&&n.h===i.h||(t.beginPath(),o(t,Ao(n,.33,i)),t.clip(),o(t,Ao(i,-.33,n)),t.fillStyle=e.borderColor,t.fill("evenodd")),t.beginPath(),o(t,Ao(i,.33,n)),t.fillStyle=e.backgroundColor,t.fill(),t.restore()}inRange(t,e,i){return Co(this,t,e,i)}inXRange(t,e){return Co(this,t,null,e)}inYRange(t,e){return Co(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Ro.id="bar",Ro.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},Ro.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};new WeakMap;const Lo={average(t){if(!t.length)return!1;let e,i,n=0,o=0,s=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n+=t.x,o+=t.y,++s}}return{x:n/s,y:o/s}},nearest(t,e){if(!t.length)return!1;let i,n,o,s=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=U(e,n.getCenterPoint());t<r&&(r=t,o=n)}}if(o){const t=o.tooltipPosition();s=t.x,a=t.y}return{x:s,y:a}}};function Eo(t,e){return e&&(c(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Fo(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Io(t,e){const{element:i,datasetIndex:n,index:o}=e,s=t.getDatasetMeta(n).controller,{label:a,value:r}=s.getLabelAndValue(o);return{chart:t,label:a,parsed:s.getParsed(o),raw:t.data.datasets[n].data[o],formattedValue:r,dataset:s.getDataset(),dataIndex:o,datasetIndex:n,element:i}}function zo(t,e){const i=t._chart.ctx,{body:n,footer:o,title:s}=t,{boxWidth:a,boxHeight:r}=e,l=re(e.bodyFont),c=re(e.titleFont),h=re(e.footerFont),d=s.length,u=o.length,g=n.length,f=ae(e.padding);let p=f.height,b=0,x=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x){p+=g*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(x-g)*l.lineHeight+(x-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let _=0;const y=function(t){b=Math.max(b,i.measureText(t).width+_)};return i.save(),i.font=c.string,m(t.title,y),i.font=l.string,m(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?a+2:0,m(n,t=>{m(t.before,y),m(t.lines,y),m(t.after,y)}),_=0,i.font=h.string,m(t.footer,y),i.restore(),b+=f.width,{width:b,height:p}}function Vo(t,e,i,n){const{x:o,width:s}=i,{width:a,chartArea:{left:r,right:l}}=t;let c="center";return"center"===n?c=o<=(r+l)/2?"left":"right":o<=s/2?c="left":o>=a-s/2&&(c="right"),function(t,e,i,n){const{x:o,width:s}=n,a=i.caretSize+i.caretPadding;return"left"===t&&o+s+a>e.width||("right"===t&&o-s-a<0||void 0)}(c,t,e,i)&&(c="center"),c}function Bo(t,e,i){const n=e.yAlign||function(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:e.xAlign||Vo(t,e,i,n),yAlign:n}}function No(t,e,i,n){const{caretSize:o,caretPadding:s,cornerRadius:a}=t,{xAlign:r,yAlign:l}=i,c=o+s,h=a+s;let d=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,r);const u=function(t,e,i){let{y:n,height:o}=t;return"top"===e?n+=i:n-="bottom"===e?o+i:o/2,n}(e,l,c);return"center"===l?"left"===r?d+=c:"right"===r&&(d-=c):"left"===r?d-=h:"right"===r&&(d+=h),{x:G(d,0,n.width-e.width),y:G(u,0,n.height-e.height)}}function Wo(t,e,i){const n=ae(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function jo(t){return Eo([],Fo(t))}function Ho(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class $o extends Sn{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,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,e=t._cachedAnimations;if(e)return e;const i=t._chart,n=t.options.setContext(t.getContext()),o=n.enabled&&i.options.animation&&n.animations,s=new ui(t._chart,o);return o._cacheable&&(t._cachedAnimations=Object.freeze(s)),s}getContext(){const t=this;return t.$context||(t.$context=(e=t._chart.getContext(),i=t,n=t._tooltipItems,Object.assign(Object.create(e),{tooltip:i,tooltipItems:n,type:"tooltip"})));var e,i,n}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),o=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]);let a=[];return a=Eo(a,Fo(n)),a=Eo(a,Fo(o)),a=Eo(a,Fo(s)),a}getBeforeBody(t,e){return jo(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const i=this,{callbacks:n}=e,o=[];return m(t,t=>{const e={before:[],lines:[],after:[]},s=Ho(n,t);Eo(e.before,Fo(s.beforeLabel.call(i,t))),Eo(e.lines,s.label.call(i,t)),Eo(e.after,Fo(s.afterLabel.call(i,t))),o.push(e)}),o}getAfterBody(t,e){return jo(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),o=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]);let a=[];return a=Eo(a,Fo(n)),a=Eo(a,Fo(o)),a=Eo(a,Fo(s)),a}_createItems(t){const e=this,i=e._active,n=e._chart.data,o=[],s=[],a=[];let r,l,c=[];for(r=0,l=i.length;r<l;++r)c.push(Io(e._chart,i[r]));return t.filter&&(c=c.filter((e,i,o)=>t.filter(e,i,o,n))),t.itemSort&&(c=c.sort((e,i)=>t.itemSort(e,i,n))),m(c,i=>{const n=Ho(t.callbacks,i);o.push(n.labelColor.call(e,i)),s.push(n.labelPointStyle.call(e,i)),a.push(n.labelTextColor.call(e,i))}),e.labelColors=o,e.labelPointStyles=s,e.labelTextColors=a,e.dataPoints=c,c}update(t,e){const i=this,n=i.options.setContext(i.getContext()),o=i._active;let s,a=[];if(o.length){const t=Lo[n.position].call(i,o,i._eventPosition);a=i._createItems(n),i.title=i.getTitle(a,n),i.beforeBody=i.getBeforeBody(a,n),i.body=i.getBody(a,n),i.afterBody=i.getAfterBody(a,n),i.footer=i.getFooter(a,n);const e=i._size=zo(i,n),r=Object.assign({},t,e),l=Bo(i._chart,n,r),c=No(n,r,l,i._chart);i.xAlign=l.xAlign,i.yAlign=l.yAlign,s={opacity:1,x:c.x,y:c.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==i.opacity&&(s={opacity:0});i._tooltipItems=a,i.$context=void 0,s&&i._resolveAnimations().update(i,s),t&&n.external&&n.external.call(i,{chart:i._chart,tooltip:i,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{cornerRadius:s,caretSize:a}=i,{x:r,y:l}=t,{width:c,height:h}=e;let d,u,g,f,p,m;return"center"===o?(p=l+h/2,"left"===n?(d=r,u=d-a,f=p+a,m=p-a):(d=r+c,u=d+a,f=p-a,m=p+a),g=d):(u="left"===n?r+s+a:"right"===n?r+c-s-a:this.caretX,"top"===o?(f=l,p=f-a,d=u-a,g=u+a):(f=l+h,p=f+a,d=u+a,g=u-a),m=f),{x1:d,x2:u,x3:g,y1:f,y2:p,y3:m}}drawTitle(t,e,i){const n=this,o=n.title,s=o.length;let a,r,l;if(s){const c=Qe(i.rtl,n.x,n.width);for(t.x=Wo(n,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=re(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<s;++l)e.fillText(o[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===s&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,o){const s=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:r,boxWidth:l}=o,c=re(o.bodyFont),h=Wo(this,"left",o),d=n.x(h),u=r<c.lineHeight?(c.lineHeight-r)/2:0,g=e.y+u;if(o.usePointStyle){const e={radius:Math.min(l,r)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=n.leftForLtr(d,l)+l/2,c=g+r/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Yt(t,e,i,c),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Yt(t,e,i,c)}else{t.lineWidth=s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const e=n.leftForLtr(d,l),i=n.leftForLtr(n.xPlus(d,1),l-2),a=se(s.borderRadius);Object.values(a).some(t=>0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Jt(t,{x:e,y:g,w:l,h:r,radius:a}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Jt(t,{x:i,y:g+1,w:l-2,h:r-2,radius:a}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,g,l,r),t.strokeRect(e,g,l,r),t.fillStyle=s.backgroundColor,t.fillRect(i,g+1,l-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const n=this,{body:o}=n,{bodySpacing:s,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c}=i,h=re(i.bodyFont);let d=h.lineHeight,u=0;const g=Qe(i.rtl,n.x,n.width),f=function(i){e.fillText(i,g.x(t.x+u),t.y+d/2),t.y+=d+s},p=g.textAlign(a);let b,x,_,y,v,M,w;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Wo(n,p,i),e.fillStyle=i.bodyColor,m(n.beforeBody,f),u=r&&"right"!==p?"center"===a?c/2+1:c+2:0,y=0,M=o.length;y<M;++y){for(b=o[y],x=n.labelTextColors[y],e.fillStyle=x,m(b.before,f),_=b.lines,r&&_.length&&(n._drawColorBox(e,t,y,g,i),d=Math.max(h.lineHeight,l)),v=0,w=_.length;v<w;++v)f(_[v]),d=h.lineHeight;m(b.after,f)}u=0,d=h.lineHeight,m(n.afterBody,f),t.y-=s}drawFooter(t,e,i){const n=this,o=n.footer,s=o.length;let a,r;if(s){const l=Qe(i.rtl,n.x,n.width);for(t.x=Wo(n,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=re(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<s;++r)e.fillText(o[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:s}=this,{x:a,y:r}=t,{width:l,height:c}=i,h=n.cornerRadius;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+h,r),"top"===s&&this.drawCaret(t,e,i,n),e.lineTo(a+l-h,r),e.quadraticCurveTo(a+l,r,a+l,r+h),"center"===s&&"right"===o&&this.drawCaret(t,e,i,n),e.lineTo(a+l,r+c-h),e.quadraticCurveTo(a+l,r+c,a+l-h,r+c),"bottom"===s&&this.drawCaret(t,e,i,n),e.lineTo(a+h,r+c),e.quadraticCurveTo(a,r+c,a,r+c-h),"center"===s&&"left"===o&&this.drawCaret(t,e,i,n),e.lineTo(a,r+h),e.quadraticCurveTo(a,r,a+h,r),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this,i=e._chart,n=e.$animations,o=n&&n.x,s=n&&n.y;if(o||s){const n=Lo[t.position].call(e,e._active,e._eventPosition);if(!n)return;const a=e._size=zo(e,t),r=Object.assign({},n,e._size),l=Bo(i,t,r),c=No(t,r,l,i);o._to===c.x&&s._to===c.y||(e.xAlign=l.xAlign,e.yAlign=l.yAlign,e.width=a.width,e.height=a.height,e.caretX=n.x,e.caretY=n.y,e._resolveAnimations().update(e,c))}}draw(t){const e=this,i=e.options.setContext(e.getContext());let n=e.opacity;if(!n)return;e._updateAnimationTarget(i);const o={width:e.width,height:e.height},s={x:e.x,y:e.y};n=Math.abs(n)<.001?0:n;const a=ae(i.padding),r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;i.enabled&&r&&(t.save(),t.globalAlpha=n,e.drawBackground(s,t,o,i),Je(t,i.textDirection),s.y+=a.top,e.drawTitle(s,t,i),e.drawBody(s,t,i),e.drawFooter(s,t,i),ti(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this,n=i._active,o=t.map(({datasetIndex:t,index:e})=>{const n=i._chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}),s=!b(n,o),a=i._positionChanged(o,e);(s||a)&&(i._active=o,i._eventPosition=e,i.update(!0))}handleEvent(t,e){const i=this,n=i.options,o=i._active||[];let s=!1,a=[];"mouseout"!==t.type&&(a=i._chart.getElementsAtEventForMode(t,n.mode,n,e),n.reverse&&a.reverse());const r=i._positionChanged(a,t);return s=e||!b(a,o)||r,s&&(i._active=a,(n.enabled||n.external)&&(i._eventPosition={x:t.x,y:t.y},i.update(!0,e))),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,s=Lo[o.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}$o.positioners=Lo;function Yo(t,e,i){const n=t.indexOf(e);if(-1===n)return((t,e,i)=>"string"==typeof e?t.push(e)-1:isNaN(e)?null:i)(t,e,i);return n!==t.lastIndexOf(e)?i:n}class Uo extends In{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if(l(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:G(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Yo(i,t,g(e,t)),i.length-1)}determineDataLimits(){const t=this,{minDefined:e,maxDefined:i}=t.getUserBounds();let{min:n,max:o}=t.getMinMax(!0);"ticks"===t.options.bounds&&(e||(n=0),i||(o=t.getLabels().length-1)),t.min=n,t.max=o}buildTicks(){const t=this,e=t.min,i=t.max,n=t.options.offset,o=[];let s=t.getLabels();s=0===e&&i===s.length-1?s:s.slice(e,i+1),t._valueRange=Math.max(s.length-(n?0:1),1),t._startValue=t.min-(n?.5:0);for(let t=e;t<=i;t++)o.push({value:t});return o}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){const t=this;super.configure(),t.isHorizontal()||(t._reversePixels=!t._reversePixels)}getPixelForValue(t){const e=this;return"number"!=typeof t&&(t=e.parse(t)),null===t?NaN:e.getPixelForDecimal((t-e._startValue)/e._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Xo(t,e){const i=[],{bounds:n,step:o,min:s,max:a,precision:r,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=t,g=o||1,f=h-1,{min:p,max:m}=e,b=!l(s),x=!l(a),_=!l(c),y=(m-p)/(d+1);let v,M,w,k,S=B((m-p)/f/g)*g;if(S<1e-14&&!b&&!x)return[{value:p},{value:m}];k=Math.ceil(m/S)-Math.floor(p/S),k>f&&(S=B(k*S/f/g)*g),l(r)||(v=Math.pow(10,r),S=Math.ceil(S*v)/v),"ticks"===n?(M=Math.floor(p/S)*S,w=Math.ceil(m/S)*S):(M=p,w=m),b&&x&&o&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((a-s)/o,S/1e3)?(k=Math.round(Math.min((a-s)/S,h)),S=(a-s)/k,M=s,w=a):_?(M=b?s:M,w=x?a:w,k=c-1,S=(w-M)/k):(k=(w-M)/S,k=W(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const P=Math.max(Y(S),Y(M));v=Math.pow(10,l(r)?P:r),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let O=0;for(b&&(u&&M!==s?(i.push({value:s}),M<s&&O++,W(Math.round((M+O*S)*v)/v,s,qo(s,y,t))&&O++):M<s&&O++);O<k;++O)i.push({value:Math.round((M+O*S)*v)/v});return x&&u&&w!==a?W(i[i.length-1].value,a,qo(a,y,t))?i[i.length-1].value=a:i.push({value:a}):x&&w!==a||i.push({value:w}),i}function qo(t,e,{horizontal:i,minRotation:n}){const o=H(n),s=(i?Math.sin(o):Math.cos(o))||.001,a=.75*e*(""+t).length;return Math.min(e/s,a)}Uo.id="category",Uo.defaults={ticks:{callback:Uo.prototype.getLabelForValue}};class Ko extends In{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 l(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const t=this,{beginAtZero:e}=t.options,{minDefined:i,maxDefined:n}=t.getUserBounds();let{min:o,max:s}=t;const a=t=>o=i?o:t,r=t=>s=n?s:t;if(e){const t=V(o),e=V(s);t<0&&e<0?r(0):t>0&&e>0&&a(0)}if(o===s){let t=1;(s>=Number.MAX_SAFE_INTEGER||o<=Number.MIN_SAFE_INTEGER)&&(t=Math.abs(.05*s)),r(s+t),e||a(o-t)}t.min=o,t.max=s}getTickLimit(){const t=this,e=t.options.ticks;let i,{maxTicksLimit:n,stepSize:o}=e;return o?i=Math.ceil(t.max/o)-Math.floor(t.min/o)+1:(i=t.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this,e=t.options,i=e.ticks;let n=t.getTickLimit();n=Math.max(2,n);const o=Xo({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:t._maxDigits(),horizontal:t.isHorizontal(),minRotation:i.minRotation||0,includeBounds:!1!==i.includeBounds},t._range||t);return"ticks"===e.bounds&&j(o,t,"value"),e.reverse?(o.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),o}configure(){const t=this,e=t.ticks;let i=t.min,n=t.max;if(super.configure(),t.options.offset&&e.length){const t=(n-i)/Math.max(e.length-1,1)/2;i-=t,n+=t}t._startValue=i,t._endValue=n,t._valueRange=n-i}getLabelForValue(t){return Ze(t,this.chart.options.locale)}}class Go extends Ko{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=d(t)?t:0,this.max=d(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this,e=t.isHorizontal(),i=e?t.width:t.height,n=H(t.options.ticks.minRotation),o=(e?Math.sin(n):Math.cos(n))||.001,s=t._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,s.lineHeight/o))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Zo(t){return 1===t/Math.pow(10,Math.floor(z(t)))}Go.id="linear",Go.defaults={ticks:{callback:On.formatters.numeric}};class Qo extends In{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Ko.prototype.parse.apply(this,[t,e]);if(0!==i)return d(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const t=this,{min:e,max:i}=t.getMinMax(!0);t.min=d(e)?Math.max(0,e):null,t.max=d(i)?Math.max(0,i):null,t.options.beginAtZero&&(t._zero=!0),t.handleTickRangeOptions()}handleTickRangeOptions(){const t=this,{minDefined:e,maxDefined:i}=t.getUserBounds();let n=t.min,o=t.max;const s=t=>n=e?n:t,a=t=>o=i?o:t,r=(t,e)=>Math.pow(10,Math.floor(z(t))+e);n===o&&(n<=0?(s(1),a(10)):(s(r(n,-1)),a(r(o,1)))),n<=0&&s(r(o,-1)),o<=0&&a(r(n,1)),t._zero&&t.min!==t._suggestedMin&&n===r(t.min,0)&&s(r(n,-1)),t.min=n,t.max=o}buildTicks(){const t=this,e=t.options,i=function(t,e){const i=Math.floor(z(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),o=[];let s=u(t.min,Math.pow(10,Math.floor(z(e.min)))),a=Math.floor(z(s)),r=Math.floor(s/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{o.push({value:s,major:Zo(s)}),++r,10===r&&(r=1,++a,l=a>=0?1:l),s=Math.round(r*Math.pow(10,a)*l)/l}while(a<i||a===i&&r<n);const c=u(t.max,s);return o.push({value:c,major:Zo(s)}),o}({min:t._userMin,max:t._userMax},t);return"ticks"===e.bounds&&j(i,t,"value"),e.reverse?(i.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),i}getLabelForValue(t){return void 0===t?"0":Ze(t,this.chart.options.locale)}configure(){const t=this.min;super.configure(),this._startValue=z(t),this._valueRange=z(this.max)-z(t)}getPixelForValue(t){const e=this;return void 0!==t&&0!==t||(t=e.min),null===t||isNaN(t)?NaN:e.getPixelForDecimal(t===e.min?0:(z(t)-e._startValue)/e._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Jo(t){const e=t.ticks;if(e.display&&t.display){const t=ae(e.backdropPadding);return g(e.font&&e.font.size,Nt.font.size)+t.height}return 0}function ts(t,e,i,n,o){return t===n||t===o?{start:e-i/2,end:e+i/2}:t<n||t>o?{start:e-i,end:e}:{start:e,end:e+i}}function es(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},i={},n=[],o=[],s=t.getLabels().length;for(let h=0;h<s;h++){const s=t.options.pointLabels.setContext(t.getPointLabelContext(h));o[h]=s.padding;const d=t.getPointPosition(h,t.drawingArea+o[h]),u=re(s.font),g=(a=t.ctx,r=u,l=c(l=t._pointLabels[h])?l:[l],{w:jt(a,r.string,l),h:l.length*r.lineHeight});n[h]=g;const f=t.getIndexAngle(h),p=$(f),m=ts(p,d.x,g.w,0,180),b=ts(p,d.y,g.h,90,270);m.start<e.l&&(e.l=m.start,i.l=f),m.end>e.r&&(e.r=m.end,i.r=f),b.start<e.t&&(e.t=b.start,i.t=f),b.end>e.b&&(e.b=b.end,i.b=f)}var a,r,l;t._setReductions(t.drawingArea,e,i),t._pointLabelItems=function(t,e,i){const n=[],o=t.getLabels().length,s=t.options,a=Jo(s),r=t.getDistanceFromCenterForValue(s.ticks.reverse?t.min:t.max);for(let s=0;s<o;s++){const o=0===s?a/2:0,l=t.getPointPosition(s,r+o+i[s]),c=$(t.getIndexAngle(s)),h=e[s],d=os(l.y,h.h,c),u=is(c),g=ns(l.x,h.w,u);n.push({x:l.x,y:d,textAlign:u,left:g,top:d,right:g+h.w,bottom:d+h.h})}return n}(t,n,o)}function is(t){return 0===t||180===t?"center":t<180?"left":"right"}function ns(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function os(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function ss(t,e,i,n){const{ctx:o}=t;if(i)o.arc(t.xCenter,t.yCenter,e,0,T);else{let i=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(let s=1;s<n;s++)i=t.getPointPosition(s,e),o.lineTo(i.x,i.y)}}function as(t){return N(t)?t:0}Qo.id="logarithmic",Qo.defaults={ticks:{callback:On.formatters.logarithmic,major:{enabled:!0}}};class rs extends Ko{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Jo(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=d(t)&&!isNaN(t)?t:0,this.max=d(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Jo(this.options))}generateTickLabels(t){const e=this;Ko.prototype.generateTickLabels.call(e,t),e._pointLabels=e.getLabels().map((t,i)=>{const n=p(e.options.pointLabels.callback,[t,i],e);return n||0===n?n:""})}fit(){const t=this,e=t.options;e.display&&e.pointLabels.display?es(t):t.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){const n=this;let o=e.l/Math.sin(i.l),s=Math.max(e.r-n.width,0)/Math.sin(i.r),a=-e.t/Math.cos(i.t),r=-Math.max(e.b-(n.height-n.paddingTop),0)/Math.cos(i.b);o=as(o),s=as(s),a=as(a),r=as(r),n.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(o+s)/2),Math.floor(t-(a+r)/2))),n.setCenterPoint(o,s,a,r)}setCenterPoint(t,e,i,n){const o=this,s=o.width-e-o.drawingArea,a=t+o.drawingArea,r=i+o.drawingArea,l=o.height-o.paddingTop-n-o.drawingArea;o.xCenter=Math.floor((a+s)/2+o.left),o.yCenter=Math.floor((r+l)/2+o.top+o.paddingTop)}getIndexAngle(t){return q(t*(T/this.getLabels().length)+H(this.options.startAngle||0))}getDistanceFromCenterForValue(t){const e=this;if(l(t))return NaN;const i=e.drawingArea/(e.max-e.min);return e.options.reverse?(e.max-t)*i:(t-e.min)*i}getValueForDistanceFromCenter(t){if(l(t))return NaN;const e=this,i=t/(e.drawingArea/(e.max-e.min));return e.options.reverse?e.max-i:e.min+i}getPointLabelContext(t){const e=this,i=e._pointLabels||[];if(t>=0&&t<i.length){const n=i[t];return function(t,e,i){return Object.assign(Object.create(t),{label:i,index:e,type:"pointLabel"})}(e.getContext(),t,n)}}getPointPosition(t,e){const i=this.getIndexAngle(t)-E;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:o}}drawBackground(){const t=this,{backgroundColor:e,grid:{circular:i}}=t.options;if(e){const n=t.ctx;n.save(),n.beginPath(),ss(t,t.getDistanceFromCenterForValue(t._endValue),i,t.getLabels().length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const t=this,e=t.ctx,i=t.options,{angleLines:n,grid:o}=i,s=t.getLabels().length;let a,r,c;if(i.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(let o=e-1;o>=0;o--){const e=n.setContext(t.getPointLabelContext(o)),s=re(e.font),{x:a,y:r,textAlign:c,left:h,top:d,right:u,bottom:g}=t._pointLabelItems[o],{backdropColor:f}=e;if(!l(f)){const t=ae(e.backdropPadding);i.fillStyle=f,i.fillRect(h-t.left,d-t.top,u-h+t.width,g-d+t.height)}Zt(i,t._pointLabels[o],a,r+s.lineHeight/2,s,{color:e.color,textAlign:c,textBaseline:"middle"})}}(t,s),o.display&&t.ticks.forEach((e,i)=>{if(0!==i){r=t.getDistanceFromCenterForValue(e.value);const n=o.setContext(t.getContext(i-1));!function(t,e,i,n){const o=t.ctx,s=e.circular,{color:a,lineWidth:r}=e;!s&&!n||!a||!r||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=r,o.setLineDash(e.borderDash),o.lineDashOffset=e.borderDashOffset,o.beginPath(),ss(t,i,s,n),o.closePath(),o.stroke(),o.restore())}(t,n,r,s)}}),n.display){for(e.save(),a=t.getLabels().length-1;a>=0;a--){const o=n.setContext(t.getPointLabelContext(a)),{color:s,lineWidth:l}=o;l&&s&&(e.lineWidth=l,e.strokeStyle=s,e.setLineDash(o.borderDash),e.lineDashOffset=o.borderDashOffset,r=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max),c=t.getPointPosition(a,r),e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const t=this,e=t.ctx,i=t.options,n=i.ticks;if(!n.display)return;const o=t.getIndexAngle(0);let s,a;e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach((o,r)=>{if(0===r&&!i.reverse)return;const l=n.setContext(t.getContext(r)),c=re(l.font);if(s=t.getDistanceFromCenterForValue(t.ticks[r].value),l.showLabelBackdrop){e.font=c.string,a=e.measureText(o.label).width,e.fillStyle=l.backdropColor;const t=ae(l.backdropPadding);e.fillRect(-a/2-t.left,-s-c.size/2-t.top,a+t.width,c.size+t.height)}Zt(e,o.label,0,-s,c,{color:l.color})}),e.restore()}drawTitle(){}}rs.id="radialLinear",rs.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:On.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},rs.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},rs.descriptors={angleLines:{_fallback:"grid"}};const ls={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}},cs=Object.keys(ls);function hs(t,e){return t-e}function ds(t,e){if(l(e))return null;const i=t._adapter,{parser:n,round:o,isoWeekday:s}=t._parseOpts;let a=e;return"function"==typeof n&&(a=n(a)),d(a)||(a="string"==typeof n?i.parse(a,n):i.parse(a)),null===a?null:(o&&(a="week"!==o||!N(s)&&!0!==s?i.startOf(a,o):i.startOf(a,"isoWeek",s)),+a)}function us(t,e,i,n){const o=cs.length;for(let s=cs.indexOf(t);s<o-1;++s){const t=ls[cs[s]],o=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(o*t.size))<=n)return cs[s]}return cs[o-1]}function gs(t,e,i){if(i){if(i.length){const{lo:n,hi:o}=ce(i,e);t[i[n]>=e?i[n]:i[o]]=!0}}else t[e]=!0}function fs(t,e,i){const n=[],o={},s=e.length;let a,r;for(a=0;a<s;++a)r=e[a],o[r]=a,n.push({value:r,major:!1});return 0!==s&&i?function(t,e,i,n){const o=t._adapter,s=+o.startOf(e[0].value,n),a=e[e.length-1].value;let r,l;for(r=s;r<=a;r=+o.add(r,1,n))l=i[r],l>=0&&(e[l].major=!0);return e}(t,n,o,i):n}class ps extends In{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 i=t.time||(t.time={}),n=this._adapter=new ji._date(t.adapters.date);M(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ds(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this,e=t.options,i=t._adapter,n=e.time.unit||"day";let{min:o,max:s,minDefined:a,maxDefined:r}=t.getUserBounds();function l(t){a||isNaN(t.min)||(o=Math.min(o,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}a&&r||(l(t._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(t.getMinMax(!1))),o=d(o)&&!isNaN(o)?o:+i.startOf(Date.now(),n),s=d(s)&&!isNaN(s)?s:+i.endOf(Date.now(),n)+1,t.min=Math.min(o,s-1),t.max=Math.max(o+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this,e=t.options,i=e.time,n=e.ticks,o="labels"===n.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&o.length&&(t.min=t._userMin||o[0],t.max=t._userMax||o[o.length-1]);const s=t.min,a=function(t,e,i){let n=0,o=t.length;for(;n<o&&t[n]<e;)n++;for(;o>n&&t[o-1]>i;)o--;return n>0||o<t.length?t.slice(n,o):t}(o,s,t.max);return t._unit=i.unit||(n.autoSkip?us(i.minUnit,t.min,t.max,t._getLabelCapacity(s)):function(t,e,i,n,o){for(let s=cs.length-1;s>=cs.indexOf(i);s--){const i=cs[s];if(ls[i].common&&t._adapter.diff(o,n,i)>=e-1)return i}return cs[i?cs.indexOf(i):0]}(t,a.length,i.minUnit,t.min,t.max)),t._majorUnit=n.major.enabled&&"year"!==t._unit?function(t){for(let e=cs.indexOf(t)+1,i=cs.length;e<i;++e)if(ls[cs[e]].common)return cs[e]}(t._unit):void 0,t.initOffsets(o),e.reverse&&a.reverse(),fs(t,a,t._majorUnit)}initOffsets(t){const e=this;let i,n,o=0,s=0;e.options.offset&&t.length&&(i=e.getDecimalForValue(t[0]),o=1===t.length?1-i:(e.getDecimalForValue(t[1])-i)/2,n=e.getDecimalForValue(t[t.length-1]),s=1===t.length?n:(n-e.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;o=G(o,0,a),s=G(s,0,a),e._offsets={start:o,end:s,factor:1/(o+1+s)}}_generate(){const t=this,e=t._adapter,i=t.min,n=t.max,o=t.options,s=o.time,a=s.unit||us(s.minUnit,i,n,t._getLabelCapacity(i)),r=g(s.stepSize,1),l="week"===a&&s.isoWeekday,c=N(l)||!0===l,h={};let d,u,f=i;if(c&&(f=+e.startOf(f,"isoWeek",l)),f=+e.startOf(f,c?"day":a),e.diff(n,i,a)>1e5*r)throw new Error(i+" and "+n+" are too far apart with stepSize of "+r+" "+a);const p="data"===o.ticks.source&&t.getDataTimestamps();for(d=f,u=0;d<n;d=+e.add(d,r,a),u++)gs(h,d,p);return d!==n&&"ticks"!==o.bounds&&1!==u||gs(h,d,p),Object.keys(h).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const o=this,s=o.options,a=s.time.displayFormats,r=o._unit,l=o._majorUnit,c=r&&a[r],h=l&&a[l],d=i[e],u=l&&h&&d&&d.major,g=o._adapter.format(t,n||(u?h:c)),f=s.ticks.callback;return f?p(f,[g,e,i],o):g}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this,i=e._offsets,n=e.getDecimalForPixel(t)/i.factor-i.end;return e.min+n*(e.max-e.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=H(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),s=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*s,h:i*s+a*o}}_getLabelCapacity(t){const e=this,i=e.options.time,n=i.displayFormats,o=n[i.unit]||n.millisecond,s=e._tickFormatFunction(t,0,fs(e,[t],e._majorUnit),o),a=e._getLabelSize(s),r=Math.floor(e.isHorizontal()?e.width/a.w:e.height/a.h)-1;return r>0?r:1}getDataTimestamps(){const t=this;let e,i,n=t._cache.data||[];if(n.length)return n;const o=t.getMatchingVisibleMetas();if(t._normalized&&o.length)return t._cache.data=o[0].controller.getAllParsedValues(t);for(e=0,i=o.length;e<i;++e)n=n.concat(o[e].controller.getAllParsedValues(t));return t._cache.data=t.normalize(n)}getLabelTimestamps(){const t=this,e=t._cache.labels||[];let i,n;if(e.length)return e;const o=t.getLabels();for(i=0,n=o.length;i<n;++i)e.push(ds(t,o[i]));return t._cache.labels=t._normalized?e:t.normalize(e)}normalize(t){return fe(t.sort(hs))}}function ms(t,e,i){let n,o,s,a,r=0,l=t.length-1;i?(e>=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=he(t,"pos",e)),({pos:n,time:s}=t[r]),({pos:o,time:a}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=he(t,"time",e)),({time:n,pos:s}=t[r]),({time:o,pos:a}=t[l]));const c=o-n;return c?s+(a-s)*(e-n)/c:s}ps.id="time",ps.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class bs extends ps{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this,e=t._getTimestampsForTable(),i=t._table=t.buildLookupTable(e);t._minPos=ms(i,t.min),t._tableRange=ms(i,t.max)-t._minPos,super.initOffsets(e)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let s,a,r,l,c;for(s=0,a=t.length;s<a;++s)l=t[s],l>=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,a=n.length;s<a;++s)c=n[s+1],r=n[s-1],l=n[s],Math.round((c+r)/2)!==l&&o.push({time:l,pos:s/(a-1)});return o}_getTimestampsForTable(){const t=this;let e=t._cache.all||[];if(e.length)return e;const i=t.getDataTimestamps(),n=t.getLabelTimestamps();return e=i.length&&n.length?t.normalize(i.concat(n)):i.length?i:n,e=t._cache.all=e,e}getDecimalForValue(t){return(ms(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this,i=e._offsets,n=e.getDecimalForPixel(t)/i.factor-i.end;return ms(e._table,n*e._tableRange+e._minPos,!0)}}bs.id="timeseries",bs.defaults=ps.defaults}}]);
//# sourceMappingURL=18.js.map

Zerion Mini Shell 1.0