summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/7514.ea3b186181ecff7f8ae5.chunk.js
blob: 577fa2b2b72931fbd4ffcbabd4ef4439eb95c722 (plain)
1
2
/*! For license information please see 7514.ea3b186181ecff7f8ae5.chunk.js.LICENSE.txt */
!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="2a79afa0-d3f9-41d7-a839-a3058c86a796",t._sentryDebugIdIdentifier="sentry-dbid-2a79afa0-d3f9-41d7-a839-a3058c86a796")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8b7b01b6c705cf50f8050ce0fb8fc6b58fe68567"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[7514],{36337:function(t,e,i){i.d(e,{Z:function(){return Xt}});var n=i(23148),s=i(50713);const o={modes:{point(t,e){return a(t,e,{intersect:!0})},nearest(t,e,i){return function(t,e,i){let n=Number.POSITIVE_INFINITY;return a(t,e,i).reduce(((t,o)=>{const r=o.getCenterPoint(),a=function(t,e,i){if("x"===i)return{x:t.x,y:e.y};if("y"===i)return{x:e.x,y:t.y};return e}(e,r,i.axis),h=(0,s.aE)(e,a);return h<n?(t=[o],n=h):h===n&&t.push(o),t}),[]).sort(((t,e)=>t._index-e._index)).slice(0,1)}(t,e,i)},x(t,e,i){return a(t,e,{intersect:i.intersect,axis:"x"})},y(t,e,i){return a(t,e,{intersect:i.intersect,axis:"y"})}}};function r(t,e,i){return(o.modes[i.mode]||o.modes.nearest)(t,e,i)}function a(t,e,i){return t.visibleElements.filter((t=>i.intersect?t.inRange(e.x,e.y):function(t,e,i){return"x"!==i&&"y"!==i?t.inRange(e.x,e.y,"x",!0)||t.inRange(e.x,e.y,"y",!0):t.inRange(e.x,e.y,i,!0)}(t,e,i.axis)))}const h=(t,e)=>e>t||t.length>e.length&&t.slice(0,e.length)===e,l=.001,c=(t,e,i)=>Math.min(i,Math.max(e,t));function d(t,e,i){for(const n of Object.keys(t))t[n]=c(t[n],e,i);return t}function u(t,{x:e,y:i,x2:n,y2:s},o,r){const a=r/2,h=t.x>=e-a-l&&t.x<=n+a+l,c=t.y>=i-a-l&&t.y<=s+a+l;return"x"===o?h:("y"===o||h)&&c}function f(t,e){const{centerX:i,centerY:n}=t.getProps(["centerX","centerY"],e);return{x:i,y:n}}const g=t=>"string"===typeof t&&t.endsWith("%"),p=t=>parseFloat(t)/100,x=t=>c(p(t),0,1);function m(t,e){return"start"===e?0:"end"===e?t:g(e)?x(e)*t:t/2}function b(t,e,i=!0){return"number"===typeof e?e:g(e)?(i?x(e):p(e))*t:t}function y(t,e="center"){return(0,s.i)(t)?{x:(0,s.v)(t.x,e),y:(0,s.v)(t.y,e)}:{x:t=(0,s.v)(t,e),y:t}}function _(t){return t&&((0,s.h)(t.xValue)||(0,s.h)(t.yValue))}function v(t,e,i,n=!1){const o=i.init;if(o)return!0===o?k(e,n):function(t,e,i){if(!0===i)return k(t,e);if((0,s.i)(i))return i}(e,n,(0,s.Q)(o,[{chart:t,properties:e,options:i}]))}function w(t,e,i){let n=!1;return e.forEach((e=>{(0,s.a7)(t[e])?(n=!0,i[e]=t[e]):(0,s.h)(i[e])&&delete i[e]})),n}function k({centerX:t,centerY:e},i){return i?{centerX:t,centerY:e,radius:0,width:0,height:0}:{x:t,y:e,x2:t,y2:e,width:0,height:0}}const M=new Map,S=t=>t.reduce((function(t,e){return t+=e.string}),"");function P(t){if(t&&"object"===typeof t){const e=t.toString();return"[object HTMLImageElement]"===e||"[object HTMLCanvasElement]"===e}}function C(t,{x:e,y:i},n){n&&(t.translate(e,i),t.rotate((0,s.t)(n)),t.translate(-e,-i))}function D(t,e){if(e&&e.borderWidth)return t.lineCap=e.borderCapStyle,t.setLineDash(e.borderDash),t.lineDashOffset=e.borderDashOffset,t.lineJoin=e.borderJoinStyle,t.lineWidth=e.borderWidth,t.strokeStyle=e.borderColor,!0}function O(t,e){t.shadowColor=e.backgroundShadowColor,t.shadowBlur=e.shadowBlur,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY}function T(t,e){const i=e.content;if(P(i))return{width:b(i.width,e.width),height:b(i.height,e.height)};const n=e.font,o=(0,s.b)(n)?n.map((t=>(0,s.a0)(t))):[(0,s.a0)(n)],r=e.textStrokeWidth,a=(0,s.b)(i)?i:[i],h=a.join()+S(o)+r+(t._measureText?"-spriting":"");return M.has(h)||M.set(h,function(t,e,i,n){t.save();const s=e.length;let o=0,r=n;for(let a=0;a<s;a++){const s=i[Math.min(a,i.length-1)];t.font=s.string;const h=e[a];o=Math.max(o,t.measureText(h).width+n),r+=s.lineHeight}return t.restore(),{width:o,height:r}}(t,a,o,r)),M.get(h)}function A(t,e,i){const{x:n,y:o,width:r,height:a}=e;t.save(),O(t,i);const h=D(t,i);t.fillStyle=i.backgroundColor,t.beginPath(),(0,s.au)(t,{x:n,y:o,w:r,h:a,radius:d((0,s.aw)(i.borderRadius),0,Math.min(r,a)/2)}),t.closePath(),t.fill(),h&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}function L(t,e,i){const n=i.content;if(P(n))return t.save(),t.globalAlpha=function(t,e){const i=(0,s.x)(t)?t:e;return(0,s.x)(i)?c(i,0,1):1}(i.opacity,n.style.opacity),t.drawImage(n,e.x,e.y,e.width,e.height),void t.restore();const o=(0,s.b)(n)?n:[n],r=i.font,a=(0,s.b)(r)?r.map((t=>(0,s.a0)(t))):[(0,s.a0)(r)],h=i.color,l=(0,s.b)(h)?h:[h],d=function(t,e){const{x:i,width:n}=t,s=e.textAlign;return"center"===s?i+n/2:"end"===s||"right"===s?i+n:i}(e,i),u=e.y+i.textStrokeWidth/2;t.save(),t.textBaseline="middle",t.textAlign=i.textAlign,function(t,e){if(e.textStrokeWidth>0)return t.lineJoin="round",t.miterLimit=2,t.lineWidth=e.textStrokeWidth,t.strokeStyle=e.textStrokeColor,!0}(t,i)&&function(t,{x:e,y:i},n,s){t.beginPath();let o=0;n.forEach((function(n,r){const a=s[Math.min(r,s.length-1)],h=a.lineHeight;t.font=a.string,t.strokeText(n,e,i+h/2+o),o+=h})),t.stroke()}(t,{x:d,y:u},o,a),function(t,{x:e,y:i},n,{fonts:s,colors:o}){let r=0;n.forEach((function(n,a){const h=o[Math.min(a,o.length-1)],l=s[Math.min(a,s.length-1)],c=l.lineHeight;t.beginPath(),t.font=l.string,t.fillStyle=h,t.fillText(n,e,i+c/2+r),r+=c,t.fill()}))}(t,{x:d,y:u},o,{fonts:a,colors:l}),t.restore()}function I(t,e,i,n){const{radius:o,options:r}=e,a=r.pointStyle,h=r.rotation;let l=(h||0)*s.b3;if(P(a))return t.save(),t.translate(i,n),t.rotate(l),t.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),void t.restore();(t=>isNaN(t)||t<=0)(o)||function(t,{x:e,y:i,radius:n,rotation:o,style:r,rad:a}){let h,l,c,d;switch(t.beginPath(),r){default:t.arc(e,i,n,0,s.T),t.closePath();break;case"triangle":t.moveTo(e+Math.sin(a)*n,i-Math.cos(a)*n),a+=s.b5,t.lineTo(e+Math.sin(a)*n,i-Math.cos(a)*n),a+=s.b5,t.lineTo(e+Math.sin(a)*n,i-Math.cos(a)*n),t.closePath();break;case"rectRounded":d=.516*n,c=n-d,h=Math.cos(a+s.b4)*c,l=Math.sin(a+s.b4)*c,t.arc(e-h,i-l,d,a-s.P,a-s.H),t.arc(e+l,i-h,d,a-s.H,a),t.arc(e+h,i+l,d,a,a+s.H),t.arc(e-l,i+h,d,a+s.H,a+s.P),t.closePath();break;case"rect":if(!o){c=Math.SQRT1_2*n,t.rect(e-c,i-c,2*c,2*c);break}a+=s.b4;case"rectRot":h=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-h,i-l),t.lineTo(e+l,i-h),t.lineTo(e+h,i+l),t.lineTo(e-l,i+h),t.closePath();break;case"crossRot":a+=s.b4;case"cross":h=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-h,i-l),t.lineTo(e+h,i+l),t.moveTo(e+l,i-h),t.lineTo(e-l,i+h);break;case"star":h=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-h,i-l),t.lineTo(e+h,i+l),t.moveTo(e+l,i-h),t.lineTo(e-l,i+h),a+=s.b4,h=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-h,i-l),t.lineTo(e+h,i+l),t.moveTo(e+l,i-h),t.lineTo(e-l,i+h);break;case"line":h=Math.cos(a)*n,l=Math.sin(a)*n,t.moveTo(e-h,i-l),t.lineTo(e+h,i+l);break;case"dash":t.moveTo(e,i),t.lineTo(e+Math.cos(a)*n,i+Math.sin(a)*n)}t.fill()}(t,{x:i,y:n,radius:o,rotation:h,style:a,rad:l})}const E={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function R(t,e,i){return e="number"===typeof e?e:t.parse(e),(0,s.g)(e)?t.getPixelForValue(e):i}function z(t,e,i){const n=e[i];if(n||"scaleID"===i)return n;const s=i.charAt(0),o=Object.values(t).filter((t=>t.axis&&t.axis===s));return o.length?o[0].id:s}function F(t,e){if(t){const i=t.options.reverse;return{start:R(t,e.min,i?e.end:e.start),end:R(t,e.max,i?e.start:e.end)}}}function j(t,e){const{chartArea:i,scales:n}=t,s=n[z(n,e,"xScaleID")],o=n[z(n,e,"yScaleID")];let r=i.width/2,a=i.height/2;return s&&(r=R(s,e.xValue,s.left+s.width/2)),o&&(a=R(o,e.yValue,o.top+o.height/2)),{x:r,y:a}}function W(t,e){const i=t.scales,n=i[z(i,e,"xScaleID")],s=i[z(i,e,"yScaleID")];if(!n&&!s)return{};let{left:o,right:r}=n||t.chartArea,{top:a,bottom:h}=s||t.chartArea;const l=N(n,{min:e.xMin,max:e.xMax,start:o,end:r});o=l.start,r=l.end;const c=N(s,{min:e.yMin,max:e.yMax,start:h,end:a});return a=c.start,h=c.end,{x:o,y:a,x2:r,y2:h,width:r-o,height:h-a,centerX:o+(r-o)/2,centerY:a+(h-a)/2}}function B(t,e){if(!_(e)){const i=W(t,e);let n=e.radius;n&&!isNaN(n)||(n=Math.min(i.width,i.height)/2,e.radius=n);const s=2*n,o=i.centerX+e.xAdjust,r=i.centerY+e.yAdjust;return{x:o-n,y:r-n,x2:o+n,y2:r+n,centerX:o,centerY:r,width:s,height:s,radius:n}}return function(t,e){const i=j(t,e),n=2*e.radius;return{x:i.x-e.radius+e.xAdjust,y:i.y-e.radius+e.yAdjust,x2:i.x+e.radius+e.xAdjust,y2:i.y+e.radius+e.yAdjust,centerX:i.x+e.xAdjust,centerY:i.y+e.yAdjust,radius:e.radius,width:n,height:n}}(t,e)}function V(t,e){const{scales:i,chartArea:n}=t,s=i[e.scaleID],o={x:n.left,y:n.top,x2:n.right,y2:n.bottom};return s?function(t,e,i){const n=R(t,i.value,NaN),s=R(t,i.endValue,n);t.isHorizontal()?(e.x=n,e.x2=s):(e.y=n,e.y2=s)}(s,o,e):function(t,e,i){for(const n of Object.keys(E)){const s=t[z(t,i,n)];if(s){const{min:t,max:o,start:r,end:a,startProp:h,endProp:l}=E[n],c=F(s,{min:i[t],max:i[o],start:s[r],end:s[a]});e[h]=c.start,e[l]=c.end}}}(i,o,e),o}function H(t,e,i){const n=W(t,e);return n.initProperties=v(t,n,e,i),n.elements=[{type:"label",optionScope:"label",properties:$(t,n,e),initProperties:n.initProperties}],n}function N(t,e){const i=F(t,e)||e;return{start:Math.min(i.start,i.end),end:Math.max(i.start,i.end)}}function Y(t,e){const{start:i,end:n,borderWidth:s}=t,{position:o,padding:{start:r,end:a},adjust:h}=e;return i+s/2+h+m(n-s-i-r-a-e.size,o)}function $(t,e,i){const n=i.label;n.backgroundColor="transparent",n.callout.display=!1;const o=y(n.position),r=(0,s.E)(n.padding),a=T(t.ctx,n),h=function({properties:t,options:e},i,n,s){const{x:o,x2:r,width:a}=t;return Y({start:o,end:r,size:a,borderWidth:e.borderWidth},{position:n.x,padding:{start:s.left,end:s.right},adjust:e.label.xAdjust,size:i.width})}({properties:e,options:i},a,o,r),l=function({properties:t,options:e},i,n,s){const{y:o,y2:r,height:a}=t;return Y({start:o,end:r,size:a,borderWidth:e.borderWidth},{position:n.y,padding:{start:s.top,end:s.bottom},adjust:e.label.yAdjust,size:i.height})}({properties:e,options:i},a,o,r),c=a.width+r.width,d=a.height+r.height;return{x:h,y:l,x2:h+c,y2:l+d,width:c,height:d,centerX:h+c/2,centerY:l+d/2,rotation:n.rotation}}function X(t,e,i){const n=Math.cos(i),s=Math.sin(i),o=e.x,r=e.y;return{x:o+n*(t.x-o)-s*(t.y-r),y:r+s*(t.x-o)+n*(t.y-r)}}const U=["enter","leave"],Q=U.concat("click");function q(t,e,i){if(t.listened)switch(e.type){case"mousemove":case"mouseout":return function(t,e,i){if(!t.moveListened)return;let n;n="mousemove"===e.type?r(t,e,i.interaction):[];const s=t.hovered;t.hovered=n;const o={state:t,event:e};let a=K(o,"leave",s,n);return K(o,"enter",n,s)||a}(t,e,i);case"click":return function(t,e,i){const n=t.listeners,s=r(t,e,i.interaction);let o;for(const r of s)o=J(r.options.click||n.click,r,e)||o;return o}(t,e,i)}}function K({state:t,event:e},i,n,s){let o;for(const r of n)s.indexOf(r)<0&&(o=J(r.options[i]||t.listeners[i],r,e)||o);return o}function J(t,e,i){return!0===(0,s.Q)(t,[e.$context,i])}const Z=["afterDraw","beforeDraw"];function G(t,e,i){if(t.hooked){const n=e.options[i]||t.hooks[i];return(0,s.Q)(n,[e.$context])}}function tt(t,e,i){const n=function(t,e,i){const n=e.axis,o=e.id,r=n+"ScaleID",a={min:(0,s.v)(e.min,Number.NEGATIVE_INFINITY),max:(0,s.v)(e.max,Number.POSITIVE_INFINITY)};for(const s of i)s.scaleID===o?st(s,e,["value","endValue"],a):z(t,s,r)===o&&st(s,e,[n+"Min",n+"Max",n+"Value"],a);return a}(t.scales,e,i);let o=et(e,n,"min","suggestedMin");o=et(e,n,"max","suggestedMax")||o,o&&(0,s.a7)(e.handleTickRangeOptions)&&e.handleTickRangeOptions()}function et(t,e,i,n){if((0,s.g)(e[i])&&!function(t,e,i){return(0,s.h)(t[e])||(0,s.h)(t[i])}(t.options,i,n)){const n=t[i]!==e[i];return t[i]=e[i],n}}function it(t,e){for(const i of["scaleID","xScaleID","yScaleID"]){const n=z(e,t,i);n&&!e[n]&&nt(t,i)&&console.warn(`No scale found with id '${n}' for annotation '${t.id}'`)}}function nt(t,e){if("scaleID"===e)return!0;const i=e.charAt(0);for(const n of["Min","Max","Value"])if((0,s.h)(t[i+n]))return!0;return!1}function st(t,e,i,n){for(const o of i){const i=t[o];if((0,s.h)(i)){const t=e.parse(i);n.min=Math.min(n.min,t),n.max=Math.max(n.max,t)}}}class ot extends n.W_{inRange(t,e,i,n){const{x:o,y:r}=X({x:t,y:e},this.getCenterPoint(n),(0,s.t)(-this.options.rotation));return u({x:o,y:r},this.getProps(["x","y","x2","y2"],n),i,this.options.borderWidth)}getCenterPoint(t){return f(this,t)}draw(t){t.save(),C(t,this.getCenterPoint(),this.options.rotation),A(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return H(t,e)}}ot.id="boxAnnotation",ot.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ot.defaultRoutes={borderColor:"color",backgroundColor:"color"},ot.descriptors={label:{_fallback:!0}};const rt=["left","bottom","top","right"];class at extends n.W_{inRange(t,e,i,n){const{x:o,y:r}=X({x:t,y:e},this.getCenterPoint(n),(0,s.t)(-this.rotation));return u({x:o,y:r},this.getProps(["x","y","x2","y2"],n),i,this.options.borderWidth)}getCenterPoint(t){return f(this,t)}draw(t){const e=this.options,i=!(0,s.h)(this._visible)||this._visible;e.display&&e.content&&i&&(t.save(),C(t,this.getCenterPoint(),this.rotation),function(t,e){const{pointX:i,pointY:n,options:o}=e,r=o.callout,a=r&&r.display&&function(t,e){const i=e.position;if(rt.includes(i))return i;return function(t,e){const{x:i,y:n,x2:o,y2:r,width:a,height:h,pointX:l,pointY:c,centerX:d,centerY:u,rotation:f}=t,g={x:d,y:u},p=e.start,x=b(a,p),m=b(h,p),y=[i,i+x,i+x,o],_=[n+m,r,n,r],v=[];for(let b=0;b<4;b++){const t=X({x:y[b],y:_[b]},g,(0,s.t)(f));v.push({position:rt[b],distance:(0,s.aE)(t,{x:l,y:c})})}return v.sort(((t,e)=>t.distance-e.distance))[0].position}(t,e)}(e,r);if(!a||function(t,e,i){const{pointX:n,pointY:s}=t,o=e.margin;let r=n,a=s;"left"===i?r+=o:"right"===i?r-=o:"top"===i?a+=o:"bottom"===i&&(a-=o);return t.inRange(r,a)}(e,r,a))return;t.save(),t.beginPath();const h=D(t,r);if(!h)return t.restore();const{separatorStart:l,separatorEnd:c}=function(t,e){const{x:i,y:n,x2:s,y2:o}=t,r=function(t,e){const{width:i,height:n,options:s}=t,o=s.callout.margin+s.borderWidth/2;if("right"===e)return i+o;if("bottom"===e)return n+o;return-o}(t,e);let a,h;"left"===e||"right"===e?(a={x:i+r,y:n},h={x:a.x,y:o}):(a={x:i,y:n+r},h={x:s,y:a.y});return{separatorStart:a,separatorEnd:h}}(e,a),{sideStart:d,sideEnd:u}=function(t,e,i){const{y:n,width:s,height:o,options:r}=t,a=r.callout.start,h=function(t,e){const i=e.side;if("left"===t||"top"===t)return-i;return i}(e,r.callout);let l,c;"left"===e||"right"===e?(l={x:i.x,y:n+b(o,a)},c={x:l.x+h,y:l.y}):(l={x:i.x+b(s,a),y:i.y},c={x:l.x,y:l.y+h});return{sideStart:l,sideEnd:c}}(e,a,l);(r.margin>0||0===o.borderWidth)&&(t.moveTo(l.x,l.y),t.lineTo(c.x,c.y));t.moveTo(d.x,d.y),t.lineTo(u.x,u.y);const f=X({x:i,y:n},e.getCenterPoint(),(0,s.t)(-e.rotation));t.lineTo(f.x,f.y),t.stroke(),t.restore()}(t,this),A(t,this,e),L(t,function({x:t,y:e,width:i,height:n,options:o}){const r=o.borderWidth/2,a=(0,s.E)(o.padding);return{x:t+a.left+r,y:e+a.top+r,width:i-a.left-a.right-o.borderWidth,height:n-a.top-a.bottom-o.borderWidth}}(this),e),t.restore())}resolveElementProperties(t,e){let i;if(_(e))i=j(t,e);else{const{centerX:n,centerY:s}=W(t,e);i={x:n,y:s}}const n=(0,s.E)(e.padding),o=function(t,e,i,n){const s=e.width+n.width+i.borderWidth,o=e.height+n.height+i.borderWidth,r=y(i.position,"center"),a=ht(t.x,s,i.xAdjust,r.x),h=ht(t.y,o,i.yAdjust,r.y);return{x:a,y:h,x2:a+s,y2:h+o,width:s,height:o,centerX:a+s/2,centerY:h+o/2}}(i,T(t.ctx,e),e,n);return{initProperties:v(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}function ht(t,e,i=0,n){return t-m(e,n)+i}at.id="labelAnnotation",at.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},at.defaultRoutes={borderColor:"color"};const lt=(t,e,i)=>({x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}),ct=(t,e,i)=>lt(e,i,Math.abs((t-e.y)/(i.y-e.y))).x,dt=(t,e,i)=>lt(e,i,Math.abs((t-e.x)/(i.x-e.x))).y,ut=t=>t*t,ft=(t,e,i,n)=>(1-n)*(1-n)*t+2*(1-n)*n*e+n*n*i,gt=(t,e,i,n)=>({x:ft(t.x,e.x,i.x,n),y:ft(t.y,e.y,i.y,n)}),pt=(t,e,i,n)=>2*(1-n)*(e-t)+2*n*(i-e),xt=(t,e,i,n)=>-Math.atan2(pt(t.x,e.x,i.x,n),pt(t.y,e.y,i.y,n))+.5*s.P;class mt extends n.W_{inRange(t,e,i,n){const s=this.options.borderWidth/2;if("x"!==i&&"y"!==i){const i={mouseX:t,mouseY:e},{path:o,ctx:r}=this;if(o){D(r,this.options);const{chart:s}=this.$context,a=t*s.currentDevicePixelRatio,h=e*s.currentDevicePixelRatio,l=r.isPointInStroke(o,a,h)||_t(this,i,n);return r.restore(),l}return function(t,{mouseX:e,mouseY:i},n=l,s){const{x:o,y:r,x2:a,y2:h}=t.getProps(["x","y","x2","y2"],s),c=a-o,d=h-r,u=ut(c)+ut(d),f=0===u?-1:((e-o)*c+(i-r)*d)/u;let g,p;f<0?(g=o,p=r):f>1?(g=a,p=h):(g=o+f*c,p=r+f*d);return ut(e-g)+ut(i-p)<=n}(this,i,ut(s),n)||_t(this,i,n)}return function(t,{mouseX:e,mouseY:i},n,{hBorderWidth:s,useFinalPosition:o}){const r=((t,e,{x:i,y:n,x2:s,y2:o},r)=>"y"===r?{start:Math.min(n,o),end:Math.max(n,o),value:e}:{start:Math.min(i,s),end:Math.max(i,s),value:t})(e,i,t.getProps(["x","y","x2","y2"],o),n);return r.value>=r.start-s&&r.value<=r.end+s||_t(t,{mouseX:e,mouseY:i},o,n)}(this,{mouseX:t,mouseY:e},i,{hBorderWidth:s,useFinalPosition:n})}getCenterPoint(t){return f(this,t)}draw(t){const{x:e,y:i,x2:n,y2:o,cp:r,options:a}=this;if(t.save(),!D(t,a))return t.restore();O(t,a);const h=Math.sqrt(Math.pow(n-e,2)+Math.pow(o-i,2));if(a.curve&&r)return function(t,e,i,n){const{x:o,y:r,x2:a,y2:h,options:l}=e,{startOpts:c,endOpts:d,startAdjust:u,endAdjust:f}=kt(e),g={x:o,y:r},p={x:a,y:h},x=xt(g,i,p,0),m=xt(g,i,p,1)-s.P,b=gt(g,i,p,u/n),y=gt(g,i,p,1-f/n),_=new Path2D;t.beginPath(),_.moveTo(b.x,b.y),_.quadraticCurveTo(i.x,i.y,y.x,y.y),t.shadowColor=l.borderShadowColor,t.stroke(_),e.path=_,e.ctx=t,Pt(t,b,{angle:x,adjust:u},c),Pt(t,y,{angle:m,adjust:f},d)}(t,this,r,h),t.restore();const{startOpts:l,endOpts:c,startAdjust:d,endAdjust:u}=kt(this),f=Math.atan2(o-i,n-e);t.translate(e,i),t.rotate(f),t.beginPath(),t.moveTo(0+d,0),t.lineTo(h-u,0),t.shadowColor=a.borderShadowColor,t.stroke(),St(t,0,d,l),St(t,h,-u,c),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=V(t,e),{x:n,y:o,x2:r,y2:a}=i,h=function({x:t,y:e,x2:i,y2:n},{top:s,right:o,bottom:r,left:a}){return!(t<a&&i<a||t>o&&i>o||e<s&&n<s||e>r&&n>r)}(i,t.chartArea),l=h?function(t,e,i){const{x:n,y:s}=yt(t,e,i),{x:o,y:r}=yt(e,t,i);return{x:n,y:s,x2:o,y2:r,width:Math.abs(o-n),height:Math.abs(r-s)}}({x:n,y:o},{x:r,y:a},t.chartArea):{x:n,y:o,x2:r,y2:a,width:Math.abs(r-n),height:Math.abs(a-o)};if(l.centerX=(r+n)/2,l.centerY=(a+o)/2,l.initProperties=v(t,l,e),e.curve){const t={x:l.x,y:l.y},i={x:l.x2,y:l.y2};l.cp=function(t,e,i){const{x:n,y:s,x2:o,y2:r,centerX:a,centerY:h}=t,l=Math.atan2(r-s,o-n),c=y(e.controlPoint,0);return X({x:a+b(i,c.x,!1),y:h+b(i,c.y,!1)},{x:a,y:h},l)}(l,e,(0,s.aE)(t,i))}const c=function(t,e,i){const n=i.borderWidth,o=(0,s.E)(i.padding),r=T(t.ctx,i),a=r.width+o.width+n,h=r.height+o.height+n;return function(t,e,i,n){const{width:o,height:r,padding:a}=i,{xAdjust:h,yAdjust:l}=e,c={x:t.x,y:t.y},d={x:t.x2,y:t.y2},u="auto"===e.rotation?function(t){const{x:e,y:i,x2:n,y2:o}=t,r=Math.atan2(o-i,n-e);return r>s.P/2?r-s.P:r<s.P/-2?r+s.P:r}(t):(0,s.t)(e.rotation),f=function(t,e,i){const n=Math.cos(i),s=Math.sin(i);return{w:Math.abs(t*n)+Math.abs(e*s),h:Math.abs(t*s)+Math.abs(e*n)}}(o,r,u),g=function(t,e,i,n){let s;const o=function(t,e){const{x:i,x2:n,y:s,y2:o}=t,r=Math.min(s,o)-e.top,a=Math.min(i,n)-e.left,h=e.bottom-Math.max(s,o),l=e.right-Math.max(i,n);return{x:Math.min(a,l),y:Math.min(r,h),dx:a<=l?1:-1,dy:r<=h?1:-1}}(t,n);s="start"===e.position?vt({w:t.x2-t.x,h:t.y2-t.y},i,e,o):"end"===e.position?1-vt({w:t.x-t.x2,h:t.y-t.y2},i,e,o):m(1,e.position);return s}(t,e,{labelSize:f,padding:a},n),p=t.cp?gt(c,t.cp,d,g):lt(c,d,g),x={size:f.w,min:n.left,max:n.right,padding:a.left},b={size:f.h,min:n.top,max:n.bottom,padding:a.top},y=wt(p.x,x)+h,_=wt(p.y,b)+l;return{x:y-o/2,y:_-r/2,x2:y+o/2,y2:_+r/2,centerX:y,centerY:_,pointX:p.x,pointY:p.y,width:o,height:r,rotation:(0,s.U)(u)}}(e,i,{width:a,height:h,padding:o},t.chartArea)}(t,l,e.label);return c._visible=h,l.elements=[{type:"label",optionScope:"label",properties:c,initProperties:l.initProperties}],l}}mt.id="lineAnnotation";const bt={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};function yt({x:t,y:e},i,{top:n,right:s,bottom:o,left:r}){return t<r&&(e=dt(r,{x:t,y:e},i),t=r),t>s&&(e=dt(s,{x:t,y:e},i),t=s),e<n&&(t=ct(n,{x:t,y:e},i),e=n),e>o&&(t=ct(o,{x:t,y:e},i),e=o),{x:t,y:e}}function _t(t,{mouseX:e,mouseY:i},n,s){const o=t.label;return o.options.display&&o.inRange(e,i,s,n)}function vt(t,e,i,n){const{labelSize:s,padding:o}=e,r=t.w*n.dx,a=t.h*n.dy,h=r>0&&(s.w/2+o.left-n.x)/r,l=a>0&&(s.h/2+o.top-n.y)/a;return c(Math.max(h,l),0,.25)}function wt(t,e){const{size:i,min:n,max:s,padding:o}=e,r=i/2;return i>s-n?(s+n)/2:(n>=t-o-r&&(t=n+o+r),s<=t+o+r&&(t=s-o-r),t)}function kt(t){const e=t.options,i=e.arrowHeads&&e.arrowHeads.start,n=e.arrowHeads&&e.arrowHeads.end;return{startOpts:i,endOpts:n,startAdjust:Mt(t,i),endAdjust:Mt(t,n)}}function Mt(t,e){if(!e||!e.display)return 0;const{length:i,width:n}=e,s=t.options.borderWidth/2,o={x:i,y:n+s},r={x:0,y:s};return Math.abs(ct(0,o,r))}function St(t,e,i,n){if(!n||!n.display)return;const{length:s,width:o,fill:r,backgroundColor:a,borderColor:h}=n,l=Math.abs(e-s)+i;t.beginPath(),O(t,n),D(t,n),t.moveTo(l,-o),t.lineTo(e+i,0),t.lineTo(l,o),!0===r?(t.fillStyle=a||h,t.closePath(),t.fill(),t.shadowColor="transparent"):t.shadowColor=n.borderShadowColor,t.stroke()}function Pt(t,{x:e,y:i},{angle:n,adjust:s},o){o&&o.display&&(t.save(),t.translate(e,i),t.rotate(n),St(t,0,-s,o),t.restore())}mt.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},bt),fill:!1,length:12,start:Object.assign({},bt),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},at.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},mt.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},mt.defaultRoutes={borderColor:"color"};class Ct extends n.W_{inRange(t,e,i,n){const o=this.options.rotation,r=this.options.borderWidth;if("x"!==i&&"y"!==i)return function(t,e,i,n){const{width:o,height:r,centerX:a,centerY:h}=e,l=o/2,c=r/2;if(l<=0||c<=0)return!1;const d=(0,s.t)(i||0),u=n/2||0,f=Math.cos(d),g=Math.sin(d),p=Math.pow(f*(t.x-a)+g*(t.y-h),2),x=Math.pow(g*(t.x-a)-f*(t.y-h),2);return p/Math.pow(l+u,2)+x/Math.pow(c+u,2)<=1.0001}({x:t,y:e},this.getProps(["width","height","centerX","centerY"],n),o,r);const{x:a,y:h,x2:c,y2:d}=this.getProps(["x","y","x2","y2"],n),u=r/2,f="y"===i?{start:h,end:d}:{start:a,end:c},g=X({x:t,y:e},this.getCenterPoint(n),(0,s.t)(-o));return g[i]>=f.start-u-l&&g[i]<=f.end+u+l}getCenterPoint(t){return f(this,t)}draw(t){const{width:e,height:i,centerX:n,centerY:o,options:r}=this;t.save(),C(t,this.getCenterPoint(),r.rotation),O(t,this.options),t.beginPath(),t.fillStyle=r.backgroundColor;const a=D(t,r);t.ellipse(n,o,i/2,e/2,s.P/2,0,2*s.P),t.fill(),a&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return H(t,e,!0)}}Ct.id="ellipseAnnotation",Ct.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},ot.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Ct.defaultRoutes={borderColor:"color",backgroundColor:"color"},Ct.descriptors={label:{_fallback:!0}};class Dt extends n.W_{inRange(t,e,i,n){const{x:s,y:o,x2:r,y2:a,width:h}=this.getProps(["x","y","x2","y2","width"],n),l=this.options.borderWidth;if("x"!==i&&"y"!==i)return function(t,e,i,n){if(!t||!e||i<=0)return!1;const s=n/2;return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(i+s,2)}({x:t,y:e},this.getCenterPoint(n),h/2,l);const c=l/2,d="y"===i?{start:o,end:a,value:e}:{start:s,end:r,value:t};return d.value>=d.start-c&&d.value<=d.end+c}getCenterPoint(t){return f(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,O(t,e);const n=D(t,e);I(t,this,this.centerX,this.centerY),n&&!P(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=B(t,e);return i.initProperties=v(t,i,e,!0),i}}Dt.id="pointAnnotation",Dt.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Dt.defaultRoutes={borderColor:"color",backgroundColor:"color"};class Ot extends n.W_{inRange(t,e,i,n){if("x"!==i&&"y"!==i)return this.options.radius>=.1&&this.elements.length>1&&function(t,e,i,n){let s=!1,o=t[t.length-1].getProps(["bX","bY"],n);for(const r of t){const t=r.getProps(["bX","bY"],n);t.bY>i!==o.bY>i&&e<(o.bX-t.bX)*(i-t.bY)/(o.bY-t.bY)+t.bX&&(s=!s),o=t}return s}(this.elements,t,e,n);const o=X({x:t,y:e},this.getCenterPoint(n),(0,s.t)(-this.options.rotation)),r=this.elements.map((t=>"y"===i?t.bY:t.bX)),a=Math.min(...r),h=Math.max(...r);return o[i]>=a&&o[i]<=h}getCenterPoint(t){return f(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,O(t,i);const n=D(t,i);let s=!0;for(const o of e)s?(t.moveTo(o.x,o.y),s=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),n&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=B(t,e),{sides:n,rotation:o}=e,r=[],a=2*s.P/n;let h=o*s.b3;for(let s=0;s<n;s++,h+=a){const n=Tt(i,e,h);n.initProperties=v(t,i,e),r.push(n)}return i.elements=r,i}}function Tt({centerX:t,centerY:e},{radius:i,borderWidth:n},s){const o=n/2,r=Math.sin(s),a=Math.cos(s),h={x:t+r*i,y:e-a*i};return{type:"point",optionScope:"point",properties:{x:h.x,y:h.y,centerX:h.x,centerY:h.y,bX:t+r*(i+o),bY:e-a*(i+o)}}}Ot.id="polygonAnnotation",Ot.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Ot.defaultRoutes={borderColor:"color",backgroundColor:"color"};const At={box:ot,ellipse:Ct,label:at,line:mt,point:Dt,polygon:Ot};Object.keys(At).forEach((t=>{s.d.describe(`elements.${At[t].id}`,{_fallback:"plugins.annotation.common"})}));const Lt={update:Object.assign},It=Q.concat(Z),Et=(t,e)=>(0,s.i)(e)?Ht(t,e):t,Rt=t=>"color"===t||"font"===t;function zt(t="line"){return At[t]?t:(console.warn(`Unknown annotation type: '${t}', defaulting to 'line'`),"line")}function Ft(t,e,i,o){const r=function(t,e,i){if("reset"===i||"none"===i||"resize"===i)return Lt;return new n.FK(t,e)}(t,i.animations,o),a=e.annotations,h=function(t,e){const i=e.length,n=t.length;if(n<i){const e=i-n;t.splice(n,0,...new Array(e))}else n>i&&t.splice(i,n-i);return t}(e.elements,a);for(let n=0;n<a.length;n++){const e=a[n],i=Bt(h,n,e.type),o=e.setContext(Nt(t,i,e)),l=i.resolveElementProperties(t,o);l.skip=jt(l),"elements"in l&&(Wt(i,l.elements,o,r),delete l.elements),(0,s.h)(i.x)||Object.assign(i,l),Object.assign(i,l.initProperties),l.options=Vt(o),r.update(i,l)}}function jt(t){return isNaN(t.x)||isNaN(t.y)}function Wt(t,e,i,n){const s=t.elements||(t.elements=[]);s.length=e.length;for(let o=0;o<e.length;o++){const t=e[o],r=t.properties,a=Bt(s,o,t.type,t.initProperties),h=i[t.optionScope].override(t);r.options=Vt(h),n.update(a,r)}}function Bt(t,e,i,n){const s=At[zt(i)];let o=t[e];return o&&o instanceof s||(o=t[e]=new s,Object.assign(o,n)),o}function Vt(t){const e=At[zt(t.type)],i={};i.id=t.id,i.type=t.type,i.drawTime=t.drawTime,Object.assign(i,Ht(t,e.defaults),Ht(t,e.defaultRoutes));for(const n of It)i[n]=t[n];return i}function Ht(t,e){const i={};for(const n of Object.keys(e)){const o=e[n],r=t[n];Rt(n)&&(0,s.b)(r)?i[n]=r.map((t=>Et(t,o))):i[n]=Et(r,o)}return i}function Nt(t,e,i){return e.$context||(e.$context=Object.assign(Object.create(t.getContext()),{element:e,id:i.id,type:"annotation"}))}const Yt=new Map,$t=Q.concat(Z);var Xt={id:"annotation",version:"2.2.1",beforeRegister(){!function(t,e,i,n=!0){const s=i.split(".");let o=0;for(const r of e.split(".")){const a=s[o++];if(parseInt(r,10)<parseInt(a,10))break;if(h(a,r)){if(n)throw new Error(`${t} v${i} is not supported. v${e} or newer is required.`);return!1}}}("chart.js","3.7",n.kL.version)},afterRegister(){n.kL.register(At)},afterUnregister(){n.kL.unregister(At)},beforeInit(t){Yt.set(t,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(t,e,i){const n=Yt.get(t).annotations=[];let o=i.annotations;(0,s.i)(o)?Object.keys(o).forEach((t=>{const e=o[t];(0,s.i)(e)&&(e.id=t,n.push(e))})):(0,s.b)(o)&&n.push(...o),function(t,e){for(const i of t)it(i,e)}(n,t.scales)},afterDataLimits(t,e){const i=Yt.get(t);tt(t,e.scale,i.annotations.filter((t=>t.display&&t.adjustScaleRange)))},afterUpdate(t,e,i){const n=Yt.get(t);!function(t,e,i){e.listened=w(i,Q,e.listeners),e.moveListened=!1,e._getElements=r,U.forEach((t=>{(0,s.a7)(i[t])&&(e.moveListened=!0)})),e.listened&&e.moveListened||e.annotations.forEach((t=>{!e.listened&&(0,s.a7)(t.click)&&(e.listened=!0),e.moveListened||U.forEach((i=>{(0,s.a7)(t[i])&&(e.listened=!0,e.moveListened=!0)}))}))}(0,n,i),Ft(t,n,i,e.mode),n.visibleElements=n.elements.filter((t=>!t.skip&&t.options.display)),function(t,e,i){const n=e.visibleElements;e.hooked=w(i,Z,e.hooks),e.hooked||n.forEach((t=>{e.hooked||Z.forEach((i=>{(0,s.a7)(t.options[i])&&(e.hooked=!0)}))}))}(0,n,i)},beforeDatasetsDraw(t,e,i){Ut(t,"beforeDatasetsDraw",i.clip)},afterDatasetsDraw(t,e,i){Ut(t,"afterDatasetsDraw",i.clip)},beforeDraw(t,e,i){Ut(t,"beforeDraw",i.clip)},afterDraw(t,e,i){Ut(t,"afterDraw",i.clip)},beforeEvent(t,e,i){q(Yt.get(t),e.event,i)&&(e.changed=!0)},afterDestroy(t){Yt.delete(t)},_getState(t){return Yt.get(t)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:t=>!$t.includes(t)&&"init"!==t,annotations:{_allKeys:!1,_fallback:(t,e)=>`elements.${At[zt(e.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Rt,_fallback:!0},_indexable:Rt}},additionalOptionScopes:[""]};function Ut(t,e,i){const{ctx:n,chartArea:o}=t,r=Yt.get(t);i&&(0,s.Y)(n,o);const a=function(t,e){const i=[];for(const n of t)if(n.options.drawTime===e&&i.push({element:n,main:!0}),n.elements&&n.elements.length)for(const t of n.elements)t.options.display&&t.options.drawTime===e&&i.push({element:t});return i}(r.visibleElements,e).sort(((t,e)=>t.element.options.z-e.element.options.z));for(const s of a)Qt(n,o,r,s);i&&(0,s.$)(n)}function Qt(t,e,i,n){const s=n.element;n.main?(G(i,s,"beforeDraw"),s.draw(t,e),G(i,s,"afterDraw")):s.draw(t,e)}},52262:function(t,e,i){var n=i(82109),s=i(47908),o=i(26244),r=i(19303),a=i(51223);n({target:"Array",proto:!0},{at:function(t){var e=s(this),i=o(e),n=r(t),a=n>=0?n:i+n;return a<0||a>=i?void 0:e[a]}}),a("at")},69810:function(t,e,i){i(52262)},86035:function(t,e,i){var n=i(82109),s=i(28710).charAt,o=i(84488),r=i(19303),a=i(41340);n({target:"String",proto:!0,forced:!0},{at:function(t){var e=a(o(this)),i=e.length,n=r(t),h=n>=0?n:i+n;return h<0||h>=i?void 0:s(e,h)}})},23148:function(t,e,i){i.d(e,{De:function(){return De},FB:function(){return oi},FK:function(){return l},IQ:function(){return E},ST:function(){return A},W_:function(){return bt},ZL:function(){return Me},f$:function(){return qe},jn:function(){return pe},kL:function(){return oe},od:function(){return me},u:function(){return Ne},uw:function(){return Xe},vn:function(){return T}});var n=i(50713);class s{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const s=e.listeners[n],o=e.duration;s.forEach((n=>n({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=n.r.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length})),this._lastDate=t,0===e&&(this._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)}}var o=new s;const r="transparent",a={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const s=(0,n.c)(t||r),o=s.valid&&(0,n.c)(e||r);return o&&o.valid?o.mix(s,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class h{constructor(t,e,i,s){const o=e[i];s=(0,n.a)([t.to,s,o,t.from]);const r=(0,n.a)([t.from,o,s]);this._active=!0,this._fn=t.fn||a[t.type||typeof r],this._easing=n.e[t.easing]||n.e.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=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=(0,n.a)([t.to,e,s,t.from]),this._from=(0,n.a)([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e<i),!this._active)return this._target[n]=r,void this._notify(!0);e<0?this._target[n]=s:(a=e/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}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 n=0;n<i.length;n++)i[n][e]()}}class l{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,n.i)(t))return;const e=Object.keys(n.d.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((s=>{const o=t[s];if(!(0,n.i)(o))return;const r={};for(const t of e)r[t]=o[t];((0,n.b)(o.properties)&&o.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,r)}))}))}_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 s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let s=0;s<n.length;s++){const e=t[n[s]];e&&e.active()&&i.push(e.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let d=s[l];const u=i.get(l);if(d){if(u&&d.active()){d.update(u,c,r);continue}d.cancel()}u&&u.duration?(s[l]=d=new h(u,t,l,c),n.push(d)):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?(o.add(this._chart,i),!0):void 0}}function c(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function d(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function u(t,e,i,s={}){const o=t.keys,r="single"===s.mode;let a,h,l,c;if(null!==e){for(a=0,h=o.length;a<h;++a){if(l=+o[a],l===i){if(s.all)continue;break}c=t.values[l],(0,n.g)(c)&&(r||0===e||(0,n.s)(e)===(0,n.s)(c))&&(e+=c)}return e}}function f(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function g(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function p(t,e,i,n){for(const s of e.getMatchingVisibleMetas(n).reverse()){const e=t[s.index];if(i&&e>0||!i&&e<0)return s.index}return null}function x(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,h=o.axis,l=r.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,n),d=e.length;let u;for(let f=0;f<d;++f){const t=e[f],{[h]:i,[l]:o}=t;u=(t._stacks||(t._stacks={}))[l]=g(s,c,i),u[a]=o,u._top=p(u,r,!0,n.type),u._bottom=p(u,r,!1,n.type);(u._visualValues||(u._visualValues={}))[a]=o}}function m(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function b(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],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const y=t=>"reset"===t||"none"===t,_=(t,e)=>e?t:Object.assign({},t);class v{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=f(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&b(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,o=e.xAxisID=(0,n.v)(i.xAxisID,m(t,"x")),r=e.yAxisID=(0,n.v)(i.yAxisID,m(t,"y")),a=e.rAxisID=(0,n.v)(i.rAxisID,m(t,"r")),h=e.indexAxis,l=e.iAxisID=s(h,o,r,a),c=e.vAxisID=s(h,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}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&&(0,n.u)(this._data,this),t._stacked&&b(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,n.i)(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,s,o;for(n=0,s=e.length;n<s;++n)o=e[n],i[n]={x:o,y:t[o]};return i}(e);else if(i!==e){if(i){(0,n.u)(i,this);const t=this._cachedMeta;b(t),t._parsed=[]}e&&Object.isExtensible(e)&&(0,n.l)(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=f(e.vScale,e),e.stack!==i.stack&&(n=!0,b(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&x(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let h,l,c,d=0===t&&e===s.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,c=s;else{c=(0,n.b)(s[t])?this.parseArrayData(i,s,t,e):(0,n.i)(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const o=()=>null===l[a]||u&&l[a]<u[a];for(h=0;h<e;++h)i._parsed[h+t]=l=c[h],d&&(o()&&(d=!1),u=l);i._sorted=d}r&&x(this,c)}parsePrimitiveData(t,e,i,n){const{iScale:s,vScale:o}=t,r=s.axis,a=o.axis,h=s.getLabels(),l=s===o,c=new Array(n);let d,u,f;for(d=0,u=n;d<u;++d)f=d+i,c[d]={[r]:l||s.parse(h[f],f),[a]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,n){const{xScale:s,yScale:o}=t,r=new Array(n);let a,h,l,c;for(a=0,h=n;a<h;++a)l=a+i,c=e[l],r[a]={x:s.parse(c[0],l),y:o.parse(c[1],l)};return r}parseObjectData(t,e,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:h="y"}=this._parsing,l=new Array(s);let c,d,u,f;for(c=0,d=s;c<d;++c)u=c+i,f=e[u],l[c]={x:o.parse((0,n.f)(f,a),u),y:r.parse((0,n.f)(f,h),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,s=this._cachedMeta,o=e[t.axis];return u({keys:d(n,!0),values:e._stacks[t.axis]._visualValues},o,s.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const s=i[e.axis];let o=null===s?NaN:s;const r=n&&i._stacks[e.axis];n&&r&&(n.values=r,o=u(n,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),h=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:d(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(a);let f,g;function p(){g=s[f];const e=g[a.axis];return!(0,n.g)(g[t.axis])||c>e||u<e}for(f=0;f<r&&(p()||(this.updateRangeFromParsed(l,t,g,h),!o));++f);if(o)for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(l,t,g,h);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],(0,n.g)(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:n?""+n.getLabelForValue(s[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,o;return(0,n.i)(t)?(e=t.top,i=t.right,s=t.bottom,o=t.left):e=i=s=o=t,{top:e,right:i,bottom:s,left:o,disabled:!1===t}}((0,n.v)(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=c(t,i),s=c(e,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],s=e.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||n.length-r,h=this.options.drawActiveElementsOnTop;let l;for(i.dataset&&i.dataset.draw(t,s,r,a),l=r;l<r+a;++l){const e=n[l];e.hidden||(e.active&&h?o.push(e):e.draw(t,s))}for(l=0;l<o.length;++l)o[l].draw(t,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 s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];o=e.$context||(e.$context=function(t,e,i){return(0,n.j)(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=function(t,e){return(0,n.j)(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,o=this._cachedDataOpts,r=t+"-"+e,a=o[r],h=this.enableOptionSharing&&(0,n.h)(i);if(a)return _(a,h);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),c),f=Object.keys(n.d.elements[t]),g=l.resolveNamedOptions(u,f,(()=>this.getContext(i,s,e)),d);return g.$shared&&(g.$shared=h,o[r]=Object.freeze(_(g,h))),g}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const h=new l(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||y(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){y(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!y(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}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._data,i=this._cachedMeta.data;for(const[r,a,h]of this._syncList)this[r](a,h);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s<n&&this._removeElements(s,n-s)}_insertElements(t,e,i=!0){const n=this._cachedMeta,s=n.data,o=t+e;let r;const a=t=>{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;r<o;++r)s[r]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.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&&b(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)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function w(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=(0,n._)(s.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let s,o,r,a,h=e._length;const l=()=>{32767!==r&&-32768!==r&&((0,n.h)(a)&&(h=Math.min(h,Math.abs(r-a)||h)),a=r)};for(s=0,o=i.length;s<o;++s)r=e.getPixelForValue(i[s]),l();for(a=void 0,s=0,o=e.ticks.length;s<o;++s)r=e.getPixelForTick(s),l();return h}function k(t,e,i,s){return(0,n.b)(t)?function(t,e,i,n){const s=i.parse(t[0],n),o=i.parse(t[1],n),r=Math.min(s,o),a=Math.max(s,o);let h=r,l=a;Math.abs(r)>Math.abs(a)&&(h=a,l=r),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:s,end:o,min:r,max:a}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function M(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,h=[];let l,c,d,u;for(l=i,c=i+n;l<c;++l)u=e[l],d={},d[s.axis]=a||s.parse(r[l],l),h.push(k(u,d,o,l));return h}function S(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function P(t,e,i,n){let s=e.borderSkipped;const o={};if(!s)return void(t.borderSkipped=o);if(!0===s)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:r,end:a,reverse:h,top:l,bottom:c}=function(t){let e,i,n,s,o;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(s="end",o="start"):(s="start",o="end"),{start:i,end:n,reverse:e,top:s,bottom:o}}(t);"middle"===s&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?s=l:(i._bottom||0)===n?s=c:(o[C(c,r,a,h)]=!0,s=l)),o[C(s,r,a,h)]=!0,t.borderSkipped=o}function C(t,e,i,n){var s,o,r;return n?(r=i,t=D(t=(s=t)===(o=e)?r:s===r?o:s,i,e)):t=D(t,e,i),t}function D(t,e,i){return"start"===t?e:"end"===t?i:t}function O(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class T extends v{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return M(t,e,i,n)}parseArrayData(t,e,i,n){return M(t,e,i,n)}parseObjectData(t,e,i,s){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:h="y"}=this._parsing,l="x"===o.axis?a:h,c="x"===r.axis?a:h,d=[];let u,f,g,p;for(u=i,f=i+s;u<f;++u)p=e[u],g={},g[o.axis]=o.parse((0,n.f)(p,l),u),d.push(k((0,n.f)(p,c),g,r,u));return d}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,s=this.getParsed(t),o=s._custom,r=S(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(s[n.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:r}}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,s){const o="reset"===s,{index:r,_cachedMeta:{vScale:a}}=this,h=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,s);for(let f=e;f<e+i;f++){const e=this.getParsed(f),i=o||(0,n.k)(e[a.axis])?{base:h,head:h}:this._calculateBarValuePixels(f),g=this._calculateBarIndexPixels(f,c),p=(e._stacks||{})[a.axis],x={horizontal:l,base:i.base,enableBorderRadius:!p||S(e._custom)||r===p._top||r===p._bottom,x:l?i.head:g.center,y:l?g.center:i.head,height:l?g.size:Math.abs(i.size),width:l?Math.abs(i.size):g.size};u&&(x.options=d||this.resolveDataElementOptions(f,t[f].active?"active":s));const m=x.options||t[f].options;P(x,m,p,r),O(x,m,c.ratio),this.updateElement(t[f],f,x,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),o=i.options.stacked,r=[],a=t=>{const i=t.controller.getParsed(e),s=i&&i[t.vScale.axis];if((0,n.k)(s)||isNaN(s))return!0};for(const n of s)if((void 0===e||!a(n))&&((!1===o||-1===r.indexOf(n.stack)||void 0===o&&void 0===n.stack)&&r.push(n.stack),n.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s<o;++s)n.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const r=t.barThickness;return{min:r||w(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,h=this.getParsed(t),l=h._custom,c=S(l);let d,u,f=h[e.axis],g=0,p=i?this.applyStack(e,h,i):f;p!==f&&(g=p-f,p=f),c&&(f=l.barStart,p=l.barEnd-l.barStart,0!==f&&(0,n.s)(f)!==(0,n.s)(l.barEnd)&&(g=0),g+=f);const x=(0,n.k)(o)||c?g:o;let m=e.getPixelForValue(x);if(d=this.chart.getDataVisibility(t)?e.getPixelForValue(g+p):m,u=d-m,Math.abs(u)<r){u=function(t,e,i){return 0!==t?(0,n.s)(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(u,e,a)*r,f===a&&(m-=u/2);const t=e.getPixelForDecimal(0),o=e.getPixelForDecimal(1),l=Math.min(t,o),g=Math.max(t,o);m=Math.max(Math.min(m,g),l),d=m+u,i&&!c&&(h._stacks[e.axis]._visualValues[s]=e.getValueForPixel(d)-e.getValueForPixel(m))}if(m===e.getPixelForValue(a)){const t=(0,n.s)(u)*e.getLineWidthForValue(a)/2;m+=t,u-=t}return{size:u,base:m,head:d,center:d+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,r=(0,n.v)(s.maxBarThickness,1/0);let a,h;if(e.grouped){const i=o?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?function(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t<s.length-1?s[t+1]:null;const h=i.categoryPercentage;null===r&&(r=o-(null===a?e.end-e.start:a-o)),null===a&&(a=o+o-r);const l=o-(o-Math.min(r,a))/2*h;return{chunk:Math.abs(a-r)/2*h/n,ratio:i.barPercentage,start:l}}(t,e,s,i):function(t,e,i,s){const o=i.barThickness;let r,a;return(0,n.k)(o)?(r=e.min*i.categoryPercentage,a=i.barPercentage):(r=o*s,a=1),{chunk:r/s,ratio:a,start:e.pixels[t]-r/2}}(t,e,s,i),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=l.start+l.chunk*c+l.chunk/2,h=Math.min(r,l.chunk*l.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),h=Math.min(r,e.min*e.ratio);return{base:a-h/2,head:a+h/2,center:a,size:h}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let s=0;for(;s<n;++s)null!==this.getParsed(s)[e.axis]&&i[s].draw(this._ctx)}}class A extends v{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:h}=(0,n.q)(e,s,r);this._drawStart=a,this._drawCount=h,(0,n.w)(e)&&(a=0,h=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(s,a,h,t)}updateElements(t,e,i,s){const o="reset"===s,{iScale:r,vScale:a,_stacked:h,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,s),u=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,x=(0,n.x)(g)?g:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||o||"none"===s,b=e+i,y=t.length;let _=e>0&&this.getParsed(e-1);for(let v=0;v<y;++v){const i=t[v],g=m?i:{};if(v<e||v>=b){g.skip=!0;continue}const y=this.getParsed(v),w=(0,n.k)(y[f]),k=g[u]=r.getPixelForValue(y[u],v),M=g[f]=o||w?a.getBasePixel():a.getPixelForValue(h?this.applyStack(a,y,h):y[f],v);g.skip=isNaN(k)||isNaN(M)||w,g.stop=v>0&&Math.abs(y[u]-_[u])>x,p&&(g.parsed=y,g.raw=l.data[v]),d&&(g.options=c||this.resolveDataElementOptions(v,i.active?"active":s)),m||this.updateElement(i,v,g,s),_=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function L(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class I{static override(t){Object.assign(I.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return L()}parse(){return L()}format(){return L()}add(){return L()}diff(){return L()}startOf(){return L()}endOf(){return L()}}var E={_date:I};function R(t,e,i,s){const{controller:o,data:r,_sorted:a}=t,h=o._cachedMeta.iScale;if(h&&e===h.axis&&"r"!==e&&a&&r.length){const t=h._reversePixels?n.A:n.B;if(!s)return t(r,e,i);if(o._sharedOptions){const n=r[0],s="function"===typeof n.getRange&&n.getRange(e);if(s){const n=t(r,e,i-s),o=t(r,e,i+s);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function z(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let a=0,h=o.length;a<h;++a){const{index:t,data:i}=o[a],{lo:h,hi:l}=R(o[a],e,r,s);for(let e=h;e<=l;++e){const s=i[e];s.skip||n(s,t,e)}}}function F(t,e,i,s,o){const r=[];if(!o&&!t.isPointInArea(e))return r;return z(t,i,e,(function(i,a,h){(o||(0,n.C)(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&r.push({element:i,datasetIndex:a,index:h})}),!0),r}function j(t,e,i,n,s,o){let r=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const s=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}(i);let h=Number.POSITIVE_INFINITY;return z(t,i,e,(function(i,l,c){const d=i.inRange(e.x,e.y,s);if(n&&!d)return;const u=i.getCenterPoint(s);if(!(!!o||t.isPointInArea(u))&&!d)return;const f=a(e,u);f<h?(r=[{element:i,datasetIndex:l,index:c}],h=f):f===h&&r.push({element:i,datasetIndex:l,index:c})})),r}function W(t,e,i,s,o,r){return r||t.isPointInArea(e)?"r"!==i||s?j(t,e,i,s,o,r):function(t,e,i,s){let o=[];return z(t,i,e,(function(t,i,r){const{startAngle:a,endAngle:h}=t.getProps(["startAngle","endAngle"],s),{angle:l}=(0,n.D)(t,{x:e.x,y:e.y});(0,n.p)(l,a,h)&&o.push({element:t,datasetIndex:i,index:r})})),o}(t,e,i,o):[]}function B(t,e,i,n,s){const o=[],r="x"===i?"inXRange":"inYRange";let a=!1;return z(t,i,e,((t,n,h)=>{t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:h}),a=a||t.inRange(e.x,e.y,s))})),n&&!a?[]:o}var V={evaluateInteractionItems:z,modes:{index(t,e,i,s){const o=(0,n.z)(e,t),r=i.axis||"x",a=i.includeInvisible||!1,h=i.intersect?F(t,o,r,s,a):W(t,o,r,!1,s,a),l=[];return h.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=h[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const o=(0,n.z)(e,t),r=i.axis||"xy",a=i.includeInvisible||!1;let h=i.intersect?F(t,o,r,s,a):W(t,o,r,!1,s,a);if(h.length>0){const e=h[0].datasetIndex,i=t.getDatasetMeta(e).data;h=[];for(let t=0;t<i.length;++t)h.push({element:i[t],datasetIndex:e,index:t})}return h},point(t,e,i,s){return F(t,(0,n.z)(e,t),i.axis||"xy",s,i.includeInvisible||!1)},nearest(t,e,i,s){const o=(0,n.z)(e,t),r=i.axis||"xy",a=i.includeInvisible||!1;return W(t,o,r,i.intersect,s,a)},x(t,e,i,s){return B(t,(0,n.z)(e,t),"x",i.intersect,s)},y(t,e,i,s){return B(t,(0,n.z)(e,t),"y",i.intersect,s)}}};const H=["left","top","right","bottom"];function N(t,e){return t.filter((t=>t.pos===e))}function Y(t,e){return t.filter((t=>-1===H.indexOf(t.pos)&&t.box.axis===e))}function $(t,e){return t.sort(((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight}))}function X(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!H.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o<r;++o){a=t[o];const{fullSize:r}=a.box,h=i[a.stack],l=h&&a.stackWeight/h.weight;a.horizontal?(a.width=l?l*n:r&&e.availableWidth,a.height=s):(a.width=n,a.height=l?l*s:r&&e.availableHeight)}return i}function U(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function Q(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 q(t,e,i,s){const{pos:o,box:r}=i,a=t.maxPadding;if(!(0,n.i)(o)){i.size&&(t[o]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[o]+=i.size}r.getPadding&&Q(a,r.getPadding());const h=Math.max(0,e.outerWidth-U(a,t,"left","right")),l=Math.max(0,e.outerHeight-U(a,t,"top","bottom")),c=h!==t.w,d=l!==t.h;return t.w=h,t.h=l,i.horizontal?{same:c,other:d}:{same:d,other:c}}function K(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 J(t,e,i,n){const s=[];let o,r,a,h,l,c;for(o=0,r=t.length,l=0;o<r;++o){a=t[o],h=a.box,h.update(a.width||e.w,a.height||e.h,K(a.horizontal,e));const{same:r,other:d}=q(e,i,a,n);l|=r&&s.length,c=c||d,h.fullSize||s.push(a)}return l&&J(s,e,i,n)||c}function Z(t,e,i,n,s){t.top=i,t.left=e,t.right=e+n,t.bottom=i+s,t.width=n,t.height=s}function G(t,e,i,s){const o=i.padding;let{x:r,y:a}=e;for(const h of t){const t=h.box,l=s[h.stack]||{count:1,placed:0,weight:1},c=h.stackWeight/l.weight||1;if(h.horizontal){const s=e.w*c,r=l.size||t.height;(0,n.h)(l.start)&&(a=l.start),t.fullSize?Z(t,o.left,a,i.outerWidth-o.right-o.left,r):Z(t,e.left+l.placed,a,s,r),l.start=a,l.placed+=s,a=t.bottom}else{const s=e.h*c,a=l.size||t.width;(0,n.h)(l.start)&&(r=l.start),t.fullSize?Z(t,r,o.top,a,i.outerHeight-o.bottom-o.top):Z(t,r,e.top+l.placed,a,s),l.start=r,l.placed+=s,r=t.right}}e.x=r,e.y=a}var tt={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,s){if(!t)return;const o=(0,n.E)(t.options.layout.padding),r=Math.max(e-o.width,0),a=Math.max(i-o.height,0),h=function(t){const e=function(t){const e=[];let i,n,s,o,r,a;for(i=0,n=(t||[]).length;i<n;++i)s=t[i],({position:o,options:{stack:r,stackWeight:a=1}}=s),e.push({index:i,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return e}(t),i=$(e.filter((t=>t.box.fullSize)),!0),n=$(N(e,"left"),!0),s=$(N(e,"right")),o=$(N(e,"top"),!0),r=$(N(e,"bottom")),a=Y(e,"x"),h=Y(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(h).concat(r).concat(a),chartArea:N(e,"chartArea"),vertical:n.concat(s).concat(h),horizontal:o.concat(r).concat(a)}}(t.boxes),l=h.vertical,c=h.horizontal;(0,n.F)(t.boxes,(t=>{"function"===typeof t.beforeLayout&&t.beforeLayout()}));const d=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},o);Q(f,(0,n.E)(s));const g=Object.assign({maxPadding:f,w:r,h:a,x:o.left,y:o.top},o),p=X(l.concat(c),u);J(h.fullSize,g,u,p),J(l,g,u,p),J(c,g,u,p)&&J(l,g,u,p),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),G(h.leftAndTop,g,u,p),g.x+=g.w,g.y+=g.h,G(h.rightAndBottom,g,u,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},(0,n.F)(h.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})}))}};class et{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}updateConfig(t){}}class it extends et{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const nt="$chartjs",st={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ot=t=>null===t||""===t;const rt=!!n.K&&{passive:!0};function at(t,e,i){t.canvas.removeEventListener(e,i,rt)}function ht(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function lt(t,e,i){const n=t.canvas,s=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ht(i.addedNodes,n),e=e&&!ht(i.removedNodes,n);e&&i()}));return s.observe(document,{childList:!0,subtree:!0}),s}function ct(t,e,i){const n=t.canvas,s=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ht(i.removedNodes,n),e=e&&!ht(i.addedNodes,n);e&&i()}));return s.observe(document,{childList:!0,subtree:!0}),s}const dt=new Map;let ut=0;function ft(){const t=window.devicePixelRatio;t!==ut&&(ut=t,dt.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function gt(t,e,i){const s=t.canvas,o=s&&(0,n.I)(s);if(!o)return;const r=(0,n.L)(((t,e)=>{const n=o.clientWidth;i(t,e),n<o.clientWidth&&i()}),window),a=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)}));return a.observe(o),function(t,e){dt.size||window.addEventListener("resize",ft),dt.set(t,e)}(t,r),a}function pt(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){dt.delete(t),dt.size||window.removeEventListener("resize",ft)}(t)}function xt(t,e,i){const s=t.canvas,o=(0,n.L)((e=>{null!==t.ctx&&i(function(t,e){const i=st[t.type]||t.type,{x:s,y:o}=(0,n.z)(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==o?o:null}}(e,t))}),t);return function(t,e,i){t.addEventListener(e,i,rt)}(s,e,o),o}class mt extends et{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),o=t.getAttribute("width");if(t[nt]={initial:{height:s,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",ot(o)){const e=(0,n.J)(t,"width");void 0!==e&&(t.width=e)}if(ot(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=(0,n.J)(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[nt])return!1;const i=e[nt].initial;["height","width"].forEach((t=>{const s=i[t];(0,n.k)(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e[nt],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:lt,detach:ct,resize:gt}[e]||xt;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:pt,detach:pt,resize:pt}[e]||at)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return(0,n.G)(t,e,i,s)}isAttached(t){const e=(0,n.I)(t);return!(!e||!e.isConnected)}}class bt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,n.x)(this.x)&&(0,n.x)(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}function yt(t,e){const i=t.options.ticks,s=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}(t),o=Math.min(i.maxTicksLimit||s,s),r=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):[],a=r.length,h=r[0],l=r[a-1],c=[];if(a>o)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;s<t.length;s++)s===r&&(e.push(t[s]),o++,r=i[o*n])}(e,c,r,a/o),c;const d=function(t,e,i){const s=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(!s)return Math.max(o,1);const r=(0,n.N)(s);for(let n=0,a=r.length-1;n<a;n++){const t=r[n];if(t>o)return t}return Math.max(o,1)}(r,e,o);if(a>0){let t,i;const s=a>1?Math.round((l-h)/(a-1)):null;for(_t(e,c,d,(0,n.k)(s)?0:h-s,h),t=0,i=a-1;t<i;t++)_t(e,c,d,r[t],r[t+1]);return _t(e,c,d,l,(0,n.k)(s)?e.length:l+s),c}return _t(e,c,d),c}function _t(t,e,i,s,o){const r=(0,n.v)(s,0),a=Math.min((0,n.v)(o,t.length),t.length);let h,l,c,d=0;for(i=Math.ceil(i),o&&(h=o-s,i=h/Math.floor(h/i)),c=r;c<0;)d++,c=Math.round(r+d*i);for(l=Math.max(r,0);l<a;l++)l===c&&(e.push(t[l]),d++,c=Math.round(r+d*i))}const vt=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,wt=(t,e)=>Math.min(e||t,t);function kt(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;o<s;o+=n)i.push(t[Math.floor(o)]);return i}function Mt(t,e,i){const n=t.ticks.length,s=Math.min(e,n-1),o=t._startPixel,r=t._endPixel,a=1e-6;let h,l=t.getPixelForTick(s);if(!(i&&(h=1===n?Math.max(l-o,r-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(s-1))/2,l+=s<e?h:-h,l<o-a||l>r+a)))return l}function St(t){return t.drawTicks?t.tickLength:0}function Pt(t,e){if(!t.display)return 0;const i=(0,n.a0)(t.font,e),s=(0,n.E)(t.padding);return((0,n.b)(t.text)?t.text.length:1)*i.lineHeight+s.height}function Ct(t,e,i){let s=(0,n.a1)(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Dt extends bt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=(0,n.O)(t,Number.POSITIVE_INFINITY),e=(0,n.O)(e,Number.NEGATIVE_INFINITY),i=(0,n.O)(i,Number.POSITIVE_INFINITY),s=(0,n.O)(s,Number.NEGATIVE_INFINITY),{min:(0,n.O)(t,i),max:(0,n.O)(e,s),minDefined:(0,n.g)(t),maxDefined:(0,n.g)(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();if(o&&r)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let n=0,h=a.length;n<h;++n)e=a[n].controller.getMinMax(this,t),o||(i=Math.min(i,e.min)),r||(s=Math.max(s,e.max));return i=r&&i>s?s:i,s=o&&i>s?i:s,{min:(0,n.O)(i,(0,n.O)(s,i)),max:(0,n.O)(s,(0,n.O)(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,n.Q)(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=(0,n.R)(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=a<this.ticks.length;this._convertTicksToLabels(h?kt(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=yt(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),h&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){(0,n.Q)(this.options.afterUpdate,[this])}beforeSetDimensions(){(0,n.Q)(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){(0,n.Q)(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),(0,n.Q)(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){(0,n.Q)(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=(0,n.Q)(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){(0,n.Q)(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){(0,n.Q)(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=wt(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let r,a,h,l=s;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,f=(0,n.S)(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/i:f/(i-1),d+6>r&&(r=f/(i-(t.offset?.5:1)),a=this.maxHeight-St(t.grid)-e.padding-Pt(t.title,this.chart.options.font),h=Math.sqrt(d*d+u*u),l=(0,n.U)(Math.min(Math.asin((0,n.S)((c.highest.height+6)/r,-1,1)),Math.asin((0,n.S)(a/h,-1,1))-Math.asin((0,n.S)(u/h,-1,1)))),l=Math.max(s,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){(0,n.Q)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,n.Q)(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const r=Pt(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=St(o)+r):(t.height=this.maxHeight,t.width=St(o)+r),i.display&&this.ticks.length){const{first:e,last:s,widest:o,highest:r}=this._getLabelSizes(),h=2*i.padding,l=(0,n.t)(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(a){const e=i.mirror?0:d*o.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+h)}else{const e=i.mirror?0:c*o.width+d*r.height;t.width=Math.min(this.maxWidth,t.width+e+h)}this._calculatePadding(e,s,d,c)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,h="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;a?h?(c=n*t.width,d=i*e.height):(c=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?c=t.width:"inner"!==s&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),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),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){(0,n.Q)(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++)(0,n.k)(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=kt(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],h=Math.floor(e/wt(e,i));let l,c,d,u,f,g,p,x,m,b,y,_=0,v=0;for(l=0;l<e;l+=h){if(u=t[l].label,f=this._resolveTickFontOptions(l),s.font=g=f.string,p=o[g]=o[g]||{data:{},gc:[]},x=f.lineHeight,m=b=0,(0,n.k)(u)||(0,n.b)(u)){if((0,n.b)(u))for(c=0,d=u.length;c<d;++c)y=u[c],(0,n.k)(y)||(0,n.b)(y)||(m=(0,n.V)(s,p.data,p.gc,m,y),b+=x)}else m=(0,n.V)(s,p.data,p.gc,m,u),b=x;r.push(m),a.push(b),_=Math.max(m,_),v=Math.max(b,v)}!function(t,e){(0,n.F)(t,(t=>{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s<n;++s)delete t.data[i[s]];i.splice(0,n)}}))}(o,e);const w=r.indexOf(_),k=a.indexOf(v),M=t=>({width:r[t]||0,height:a[t]||0});return{first:M(0),last:M(e-1),widest:M(w),highest:M(k),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return(0,n.W)(this._alignToPixels?(0,n.X)(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return(0,n.j)(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=(i=this.chart.getContext(),s=this,(0,n.j)(i,{scale:s,type:"scale"})));var i,s}_tickSize(){const t=this.options.ticks,e=(0,n.t)(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,h=o?o.highest.height+r:0;return this.isHorizontal()?h*i>a*s?a/i:h/s:h*s<a*i?h/i:a/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,h=o.offset,l=this.isHorizontal(),c=this.ticks.length+(h?1:0),d=St(o),u=[],f=a.setContext(this.getContext()),g=f.display?f.width:0,p=g/2,x=function(t){return(0,n.X)(i,t,g)};let m,b,y,_,v,w,k,M,S,P,C,D;if("top"===r)m=x(this.bottom),w=this.bottom-d,M=m-p,P=x(t.top)+p,D=t.bottom;else if("bottom"===r)m=x(this.top),P=t.top,D=x(t.bottom)-p,w=m+p,M=this.top+d;else if("left"===r)m=x(this.right),v=this.right-d,k=m-p,S=x(t.left)+p,C=t.right;else if("right"===r)m=x(this.left),S=t.left,C=x(t.right)-p,v=m+p,k=this.left+d;else if("x"===e){if("center"===r)m=x((t.top+t.bottom)/2+.5);else if((0,n.i)(r)){const t=Object.keys(r)[0],e=r[t];m=x(this.chart.scales[t].getPixelForValue(e))}P=t.top,D=t.bottom,w=m+p,M=w+d}else if("y"===e){if("center"===r)m=x((t.left+t.right)/2);else if((0,n.i)(r)){const t=Object.keys(r)[0],e=r[t];m=x(this.chart.scales[t].getPixelForValue(e))}v=m-p,k=v-d,S=t.left,C=t.right}const O=(0,n.v)(s.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/O));for(b=0;b<c;b+=T){const t=this.getContext(b),e=o.setContext(t),s=a.setContext(t),r=e.lineWidth,c=e.color,d=s.dash||[],f=s.dashOffset,g=e.tickWidth,p=e.tickColor,x=e.tickBorderDash||[],m=e.tickBorderDashOffset;y=Mt(this,b,h),void 0!==y&&(_=(0,n.X)(i,y,r),l?v=k=S=C=_:w=M=P=D=_,u.push({tx1:v,ty1:w,tx2:k,ty2:M,x1:S,y1:P,x2:C,y2:D,width:r,color:c,borderDash:d,borderDashOffset:f,tickWidth:g,tickColor:p,tickBorderDash:x,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:h,crossAlign:l,padding:c,mirror:d}=o,u=St(i.grid),f=u+c,g=d?-c:f,p=-(0,n.t)(this.labelRotation),x=[];let m,b,y,_,v,w,k,M,S,P,C,D,O="middle";if("top"===s)w=this.bottom-g,k=this._getXAxisLabelAlignment();else if("bottom"===s)w=this.top+g,k=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(u);k=t.textAlign,v=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(u);k=t.textAlign,v=t.x}else if("x"===e){if("center"===s)w=(t.top+t.bottom)/2+f;else if((0,n.i)(s)){const t=Object.keys(s)[0],e=s[t];w=this.chart.scales[t].getPixelForValue(e)+f}k=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)v=(t.left+t.right)/2-f;else if((0,n.i)(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)}k=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===h?O="top":"end"===h&&(O="bottom"));const T=this._getLabelSizes();for(m=0,b=a.length;m<b;++m){y=a[m],_=y.label;const t=o.setContext(this.getContext(m));M=this.getPixelForTick(m)+o.labelOffset,S=this._resolveTickFontOptions(m),P=S.lineHeight,C=(0,n.b)(_)?_.length:1;const e=C/2,i=t.color,h=t.textStrokeColor,c=t.textStrokeWidth;let u,f=k;if(r?(v=M,"inner"===k&&(f=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),D="top"===s?"near"===l||0!==p?-C*P+P/2:"center"===l?-T.highest.height/2-e*P+P:-T.highest.height+P/2:"near"===l||0!==p?P/2:"center"===l?T.highest.height/2-e*P:T.highest.height-C*P,d&&(D*=-1),0===p||t.showLabelBackdrop||(v+=P/2*Math.sin(p))):(w=M,D=(1-C)*P/2),t.showLabelBackdrop){const e=(0,n.E)(t.backdropPadding),i=T.heights[m],s=T.widths[m];let o=D-e.top,r=0-e.left;switch(O){case"middle":o-=i/2;break;case"bottom":o-=i}switch(k){case"center":r-=s/2;break;case"right":r-=s}u={left:r,top:o,width:s+e.width,height:i+e.height,color:t.backdropColor}}x.push({label:_,font:S,textOffset:D,options:{rotation:p,color:i,strokeColor:h,strokeWidth:c,textAlign:f,textBaseline:O,translation:[v,w],backdrop:u}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-(0,n.t)(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=t+s,r=this._getLabelSizes().widest.width;let a,h;return"left"===e?n?(h=this.right+s,"near"===i?a="left":"center"===i?(a="center",h+=r/2):(a="right",h+=r)):(h=this.right-o,"near"===i?a="right":"center"===i?(a="center",h-=r/2):(a="left",h=this.left)):"right"===e?n?(h=this.left+s,"near"===i?a="right":"center"===i?(a="center",h-=r/2):(a="left",h-=r)):(h=this.left+o,"near"===i?a="left":"center"===i?(a="center",h+=r/2):(a="right",h=this.right)):a="right",{textAlign:a,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s<o;++s){const t=n[s];e.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.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{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,h=this._borderValue;let l,c,d,u;this.isHorizontal()?(l=(0,n.X)(t,this.left,r)-r/2,c=(0,n.X)(t,this.right,a)+a/2,d=u=h):(d=(0,n.X)(t,this.top,r)-r/2,u=(0,n.X)(t,this.bottom,a)+a/2,l=c=h),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(l,d),e.lineTo(c,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&(0,n.Y)(e,i);const s=this.getLabelItems(t);for(const o of s){const t=o.options,i=o.font,s=o.label,r=o.textOffset;(0,n.Z)(e,s,0,r,i,t)}i&&(0,n.$)(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=(0,n.a0)(i.font),r=(0,n.E)(i.padding),a=i.align;let h=o.lineHeight/2;"bottom"===e||"center"===e||(0,n.i)(e)?(h+=r.bottom,(0,n.b)(i.text)&&(h+=o.lineHeight*(i.text.length-1))):h+=r.top;const{titleX:l,titleY:c,maxWidth:d,rotation:u}=function(t,e,i,s){const{top:o,left:r,bottom:a,right:h,chart:l}=t,{chartArea:c,scales:d}=l;let u,f,g,p=0;const x=a-o,m=h-r;if(t.isHorizontal()){if(f=(0,n.a2)(s,r,h),(0,n.i)(i)){const t=Object.keys(i)[0],n=i[t];g=d[t].getPixelForValue(n)+x-e}else g="center"===i?(c.bottom+c.top)/2+x-e:vt(t,i,e);u=h-r}else{if((0,n.i)(i)){const t=Object.keys(i)[0],n=i[t];f=d[t].getPixelForValue(n)-m+e}else f="center"===i?(c.left+c.right)/2-m+e:vt(t,i,e);g=(0,n.a2)(s,a,o),p="left"===i?-n.H:n.H}return{titleX:f,titleY:g,maxWidth:u,rotation:p}}(this,h,e,a);(0,n.Z)(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:Ct(a,e,s),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=(0,n.v)(t.grid&&t.grid.z,-1),s=(0,n.v)(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Dt.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s<o;++s){const o=e[s];o[i]!==this.id||t&&o.type!==t||n.push(o)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return(0,n.a0)(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ot{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=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,function(t,e,i){const s=(0,n.a4)(Object.create(null),[i?n.d.get(i):{},n.d.get(e),t.defaults]);n.d.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),o=s.pop(),r=[t].concat(s).join("."),a=e[i].split("."),h=a.pop(),l=a.join(".");n.d.route(r,o,l,h)}))}(e,t.defaultRoutes);t.descriptors&&n.d.describe(e,t.descriptors)}(t,r,i),this.override&&n.d.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in n.d[s]&&(delete n.d[s][i],this.override&&delete n.a3[i])}}class Tt{constructor(){this.controllers=new Ot(v,"datasets",!0),this.elements=new Ot(bt,"elements"),this.plugins=new Ot(Object,"plugins"),this.scales=new Ot(Dt,"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){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):(0,n.F)(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const s=(0,n.a5)(t);(0,n.Q)(i["before"+s],[],i),e[t](i),(0,n.Q)(i["after"+s],[],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}}var At=new Tt;class Lt{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(s,t,e,i);return"afterDestroy"===e&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const o of t){const t=o.plugin,r=t[i],a=[e,s,o.options];if(!1===(0,n.Q)(r,a,t)&&s.cancelable)return!1}return!0}invalidate(){(0,n.k)(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,s=(0,n.v)(i.options&&i.options.plugins,{}),o=function(t){const e={},i=[],n=Object.keys(At.plugins.items);for(let o=0;o<n.length;o++)i.push(At.getPlugin(n[o]));const s=t.plugins||[];for(let o=0;o<s.length;o++){const t=s[o];-1===i.indexOf(t)&&(i.push(t),e[t.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},n,s){const o=[],r=t.getContext();for(const a of e){const e=a.id,h=It(n[e],s);null!==h&&o.push({plugin:a,options:Et(t.config,{plugin:a,local:i[e]},h,r)})}return o}(t,o,s,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 It(t,e){return e||!1!==t?!0===t?{}:t:null}function Et(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Rt(t,e){const i=n.d.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function zt(t){if("x"===t||"y"===t||"r"===t)return t}function Ft(t,...e){if(zt(t))return t;for(const n of e){const e=n.axis||("top"===(i=n.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&zt(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function jt(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Wt(t,e){const i=n.a3[t.type]||{scales:{}},s=e.scales||{},o=Rt(t.type,e),r=Object.create(null);return Object.keys(s).forEach((e=>{const a=s[e];if(!(0,n.i)(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const h=Ft(e,a,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return jt(t,"x",i[0])||jt(t,"y",i[0])}return{}}(e,t),n.d.scales[a.type]),l=function(t,e){return t===e?"_index_":"_value_"}(h,o),c=i.scales||{};r[e]=(0,n.ab)(Object.create(null),[{axis:h},a,c[h],c[l]])})),t.data.datasets.forEach((i=>{const o=i.type||t.type,a=i.indexAxis||Rt(o,e),h=(n.a3[o]||{}).scales||{};Object.keys(h).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),o=i[e+"AxisID"]||e;r[o]=r[o]||Object.create(null),(0,n.ab)(r[o],[{axis:e},s[o],h[t]])}))})),Object.keys(r).forEach((t=>{const e=r[t];(0,n.ab)(e,[n.d.scales[e.type],n.d.scale])})),r}function Bt(t){const e=t.options||(t.options={});e.plugins=(0,n.v)(e.plugins,{}),e.scales=Wt(t,e)}function Vt(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ht=new Map,Nt=new Set;function Yt(t,e){let i=Ht.get(t);return i||(i=e(),Ht.set(t,i),Nt.add(i)),i}const $t=(t,e,i)=>{const s=(0,n.f)(e,i);void 0!==s&&t.add(s)};class Xt{constructor(t){this._config=function(t){return(t=t||{}).data=Vt(t.data),Bt(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=Vt(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(),Bt(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Yt(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Yt(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Yt(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Yt(`${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:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const h=new Set;e.forEach((e=>{t&&(h.add(t),e.forEach((e=>$t(h,t,e)))),e.forEach((t=>$t(h,s,t))),e.forEach((t=>$t(h,n.a3[o]||{},t))),e.forEach((t=>$t(h,n.d,t))),e.forEach((t=>$t(h,n.a6,t)))}));const l=Array.from(h);return 0===l.length&&l.push(Object.create(null)),Nt.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,n.a3[e]||{},n.d.datasets[e]||{},{type:e},n.d,n.a6]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ut(this._resolverCache,t,s);let h=r;if(function(t,e){const{isScriptable:i,isIndexable:s}=(0,n.aa)(t);for(const o of e){const e=i(o),r=s(o),a=(r||e)&&t[o];if(e&&((0,n.a7)(a)||Qt(a))||r&&(0,n.b)(a))return!0}return!1}(r,e)){o.$shared=!1,i=(0,n.a7)(i)?i():i;const e=this.createResolver(t,i,a);h=(0,n.a8)(r,i,e)}for(const n of e)o[n]=h[n];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Ut(this._resolverCache,t,i);return(0,n.i)(e)?(0,n.a8)(o,e,void 0,s):o}}function Ut(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const o=i.join();let r=s.get(o);if(!r){r={resolver:(0,n.a9)(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(o,r)}return r}const Qt=t=>(0,n.i)(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||(0,n.a7)(t[i])),!1);const qt=["top","bottom","left","right","chartArea"];function Kt(t,e){return"top"===t||"bottom"===t||-1===qt.indexOf(t)&&"x"===e}function Jt(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Zt(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),(0,n.Q)(i&&i.onComplete,[t],e)}function Gt(t){const e=t.chart,i=e.options.animation;(0,n.Q)(i&&i.onProgress,[t],e)}function te(t){return(0,n.M)()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ee={},ie=t=>{const e=te(t);return Object.values(ee).filter((t=>t.canvas===e)).pop()};function ne(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}function se(t,e,i){return t.options.clip?t[i]:e[i]}class oe{static defaults=n.d;static instances=ee;static overrides=n.a3;static registry=At;static version="4.4.0";static getChart=ie;static register(...t){At.add(...t),re()}static unregister(...t){At.remove(...t),re()}constructor(t,e){const i=this.config=new Xt(e),s=te(t),r=ie(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!(0,n.M)()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?it:mt}(s)),this.platform.updateConfig(i);const h=this.platform.acquireContext(s,a.aspectRatio),l=h&&h.canvas,c=l&&l.height,d=l&&l.width;this.id=(0,n.ac)(),this.ctx=h,this.canvas=l,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Lt,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,n.ad)((t=>this.update(t)),a.resizeDelay||0),this._dataChanges=[],ee[this.id]=this,h&&l?(o.listen(this,"complete",Zt),o.listen(this,"progress",Gt),this._initialize(),this.attached&&this.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:s,_aspectRatio:o}=this;return(0,n.k)(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return At}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,n.ae)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,n.af)(this.canvas,this.ctx),this}stop(){return o.stop(this),this}resize(t,e){o.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,(0,n.ae)(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),(0,n.Q)(i.onResize,[this,r],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};(0,n.F)(t,((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let o=[];e&&(o=o.concat(Object.keys(e).map((t=>{const i=e[t],n=Ft(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}})))),(0,n.F)(o,(e=>{const o=e.options,r=o.id,a=Ft(r,o),h=(0,n.v)(o.type,e.dtype);void 0!==o.position&&Kt(o.position,a)===Kt(e.dposition)||(o.position=e.dposition),s[r]=!0;let l=null;if(r in i&&i[r].type===h)l=i[r];else{l=new(At.getScale(h))({id:r,type:h,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(o,t)})),(0,n.F)(s,((t,e)=>{t||delete i[e]})),(0,n.F)(i,(t=>{tt.configure(this,t,t.options),tt.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Jt("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let o=this.getDatasetMeta(i);const r=s.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=s.indexAxis||Rt(r,this.options),o.order=s.order||0,o.index=i,o.label=""+s.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const e=At.getController(r),{datasetElementType:s,dataElementType:a}=n.d.datasets[r];Object.assign(e,{dataElementType:At.getElement(a),datasetElementType:s&&At.getElement(s)}),o.controller=new e(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){(0,n.F)(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let n=0,l=this.data.datasets.length;n<l;n++){const{controller:t}=this.getDatasetMeta(n),e=!s&&-1===o.indexOf(t);t.buildOrUpdateElements(e),r=Math.max(+t.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||(0,n.F)(o,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Jt("z","_idx"));const{_active:a,_lastEvent:h}=this;h?this._eventHandler(h,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){(0,n.F)(this.scales,(t=>{tt.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(0,n.ag)(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){ne(t,n,"_removeElements"===i?-s:s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let o=1;o<e;o++)if(!(0,n.ag)(s,i(o)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;tt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,n.F)(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,(0,n.a7)(t)?t({datasetIndex:e}):t);this.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(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(o.has(this)?this.attached&&!o.running(this)&&o.start(this):(this.draw(),Zt({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,s;for(n=0,s=e.length;n<s;++n){const s=e[n];t&&!s.visible||i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,o=function(t,e){const{xScale:i,yScale:n}=t;return i&&n?{left:se(i,e,"left"),right:se(i,e,"right"),top:se(n,e,"top"),bottom:se(n,e,"bottom")}:e}(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(s&&(0,n.Y)(e,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?this.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&(0,n.$)(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return(0,n.C)(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=V.modes[e];return"function"===typeof s?s(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=(0,n.j)(null,{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 s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);(0,n.h)(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),o.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),(0,n.af)(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ee[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};(0,n.F)(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){(0,n.F)(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},(0,n.F)(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r<a;++r){o=t[r];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!(0,n.ah)(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),h=(0,n.ai)(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,h);i&&(this._lastEvent=null,(0,n.Q)(o.onHover,[t,a,this],this),h&&(0,n.Q)(o.onClick,[t,a,this],this));const c=!(0,n.ah)(a,s);return(c||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function re(){return(0,n.F)(oe.instances,(t=>t._plugins.invalidate()))}function ae(t,e,i=e){t.lineCap=(0,n.v)(i.borderCapStyle,e.borderCapStyle),t.setLineDash((0,n.v)(i.borderDash,e.borderDash)),t.lineDashOffset=(0,n.v)(i.borderDashOffset,e.borderDashOffset),t.lineJoin=(0,n.v)(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=(0,n.v)(i.borderWidth,e.borderWidth),t.strokeStyle=(0,n.v)(i.borderColor,e.borderColor)}function he(t,e,i){t.lineTo(i.x,i.y)}function le(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,h=Math.max(s,r),l=Math.min(o,a),c=s<r&&o<r||s>a&&o>a;return{count:n,start:h,loop:e.loop,ilen:l<h&&!c?n+l-h:l-h}}function ce(t,e,i,s){const{points:o,options:r}=e,{count:a,start:h,loop:l,ilen:c}=le(o,i,s),d=function(t){return t.stepped?n.ar:t.tension||"monotone"===t.cubicInterpolationMode?n.as:he}(r);let u,f,g,{move:p=!0,reverse:x}=s||{};for(u=0;u<=c;++u)f=o[(h+(x?c-u:u))%a],f.skip||(p?(t.moveTo(f.x,f.y),p=!1):d(t,g,f,x,r.stepped),g=f);return l&&(f=o[(h+(x?c:0))%a],d(t,g,f,x,r.stepped)),!!l}function de(t,e,i,n){const s=e.points,{count:o,start:r,ilen:a}=le(s,i,n),{move:h=!0,reverse:l}=n||{};let c,d,u,f,g,p,x=0,m=0;const b=t=>(r+(l?a-t:t))%o,y=()=>{f!==g&&(t.lineTo(x,g),t.lineTo(x,f),t.lineTo(x,p))};for(h&&(d=s[b(0)],t.moveTo(d.x,d.y)),c=0;c<=a;++c){if(d=s[b(c)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(i<f?f=i:i>g&&(g=i),x=(m*x+e)/++m):(y(),t.lineTo(e,i),u=n,m=0,f=g=i),p=i}y()}function ue(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i?de:ce}const fe="function"===typeof Path2D;function ge(t,e,i,n){fe&&!e.options.segment?function(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),ae(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=ue(e);for(const a of s)ae(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class pe extends bt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;(0,n.al)(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=(0,n.am)(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,s=t[e],o=this.points,r=(0,n.an)(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],h=function(t){return t.stepped?n.ao:t.tension||"monotone"===t.cubicInterpolationMode?n.ap:n.aq}(i);let l,c;for(l=0,c=r.length;l<c;++l){const{start:n,end:c}=r[l],d=o[n],u=o[c];if(d===u){a.push(d);continue}const f=h(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],a.push(f)}return 1===a.length?a[0]:a}pathSegment(t,e,i){return ue(this)(t,this,e,i)}path(t,e,i){const n=this.segments,s=ue(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const r of n)o&=s(t,this,r,{start:e,end:e+i-1});return!!o}draw(t,e,i,n){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),ge(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function xe(t,e,i,n){const s=t.options,{[i]:o}=t.getProps([i],n);return Math.abs(e-o)<s.radius+s.hitRadius}class me extends bt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-o,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return xe(this,t,"x",e)}inYRange(t,e){return xe(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.options;this.skip||i.radius<.1||!(0,n.C)(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,(0,n.at)(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function be(t,e){const{x:i,y:n,base:s,width:o,height:r}=t.getProps(["x","y","base","width","height"],e);let a,h,l,c,d;return t.horizontal?(d=r/2,a=Math.min(i,s),h=Math.max(i,s),l=n-d,c=n+d):(d=o/2,a=i-d,h=i+d,l=Math.min(n,s),c=Math.max(n,s)),{left:a,top:l,right:h,bottom:c}}function ye(t,e,i,s){return t?0:(0,n.S)(e,i,s)}function _e(t){const e=be(t),i=e.right-e.left,s=e.bottom-e.top,o=function(t,e,i){const s=t.options.borderWidth,o=t.borderSkipped,r=(0,n.av)(s);return{t:ye(o.top,r.top,0,i),r:ye(o.right,r.right,0,e),b:ye(o.bottom,r.bottom,0,i),l:ye(o.left,r.left,0,e)}}(t,i/2,s/2),r=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,r=(0,n.aw)(o),a=Math.min(e,i),h=t.borderSkipped,l=s||(0,n.i)(o);return{topLeft:ye(!l||h.top||h.left,r.topLeft,0,a),topRight:ye(!l||h.top||h.right,r.topRight,0,a),bottomLeft:ye(!l||h.bottom||h.left,r.bottomLeft,0,a),bottomRight:ye(!l||h.bottom||h.right,r.bottomRight,0,a)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:r},inner:{x:e.left+o.l,y:e.top+o.t,w:i-o.l-o.r,h:s-o.t-o.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,r.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(o.b,o.r))}}}}function ve(t,e,i,s){const o=null===e,r=null===i,a=t&&!(o&&r)&&be(t,s);return a&&(o||(0,n.aj)(e,a.left,a.right))&&(r||(0,n.aj)(i,a.top,a.bottom))}function we(t,e){t.rect(e.x,e.y,e.w,e.h)}function ke(t,e,i={}){const n=t.x!==i.x?-e:0,s=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-n,r=(t.y+t.h!==i.y+i.h?e:0)-s;return{x:t.x+n,y:t.y+s,w:t.w+o,h:t.h+r,radius:t.radius}}class Me extends bt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:r}=_e(this),a=(h=r.radius).topLeft||h.topRight||h.bottomLeft||h.bottomRight?n.au:we;var h;t.save(),r.w===o.w&&r.h===o.h||(t.beginPath(),a(t,ke(r,e,o)),t.clip(),a(t,ke(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ke(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ve(this,t,e,i)}inXRange(t,e){return ve(this,t,null,e)}inYRange(t,e){return ve(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+n)/2:e,y:s?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}const Se=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class Pe extends bt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=(0,n.Q)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=(0,n.a0)(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:h}=Se(i,o);let l,c;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(r,o,a,h)+10):(c=this.maxHeight,l=this._fitCols(r,s,a,h)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],h=this.lineWidths=[0],l=n+r;let c=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-l;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+s.measureText(t.text).width;(0===f||h[h.length-1]+g+2*r>o)&&(c+=l,h[h.length-(f>0?0:1)]=0,u+=l,d++),a[f]={left:0,top:u,row:d,width:g,height:n},h[h.length-1]+=g+r})),c}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],h=this.columnSizes=[],l=o-t;let c=r,d=0,u=0,f=0,g=0;return this.legendItems.forEach(((t,o)=>{const{itemWidth:p,itemHeight:x}=function(t,e,i,n,s){const o=function(t,e,i,n){let s=t.text;s&&"string"!==typeof s&&(s=s.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+n.measureText(s).width}(n,t,e,i),r=function(t,e,i){let n=t;"string"!==typeof e.text&&(n=Ce(e,i));return n}(s,n,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,s,t,n);o>0&&u+x+2*r>l&&(c+=d+r,h.push({width:d,height:u}),f+=d+r,g++,d=u=0),a[o]={left:f,top:u,col:g,width:p,height:x},d=Math.max(d,p),u+=x+r})),c+=d,h.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=(0,n.az)(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=(0,n.a2)(i,this.left+s,this.right-this.lineWidths[o]);for(const h of e)o!==h.row&&(o=h.row,a=(0,n.a2)(i,this.left+s,this.right-this.lineWidths[o])),h.top+=this.top+t+s,h.left=r.leftForLtr(r.x(a),h.width),a+=h.width+s}else{let o=0,a=(0,n.a2)(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const h of e)h.col!==o&&(o=h.col,a=(0,n.a2)(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),h.top=a,h.left+=this.left+s,h.left=r.leftForLtr(r.x(h.left),h.width),a+=h.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;(0,n.Y)(t,this),this._draw(),(0,n.$)(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=n.d.color,h=(0,n.az)(t.rtl,this.left,this.width),l=(0,n.a0)(r.font),{padding:c}=r,d=l.size,u=d/2;let f;this.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:g,boxHeight:p,itemHeight:x}=Se(r,d),m=this.isHorizontal(),b=this._computeTitleHeight();f=m?{x:(0,n.a2)(o,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:(0,n.a2)(o,this.top+b+c,this.bottom-e[0].height),line:0},(0,n.aA)(this.ctx,t.textDirection);const y=x+c;this.legendItems.forEach(((_,v)=>{s.strokeStyle=_.fontColor,s.fillStyle=_.fontColor;const w=s.measureText(_.text).width,k=h.textAlign(_.textAlign||(_.textAlign=r.textAlign)),M=g+u+w;let S=f.x,P=f.y;h.setWidth(this.width),m?v>0&&S+M+c>this.right&&(P=f.y+=y,f.line++,S=f.x=(0,n.a2)(o,this.left+c,this.right-i[f.line])):v>0&&P+y>this.bottom&&(S=f.x=S+e[f.line].width+c,f.line++,P=f.y=(0,n.a2)(o,this.top+b+c,this.bottom-e[f.line].height));if(function(t,e,i){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const o=(0,n.v)(i.lineWidth,1);if(s.fillStyle=(0,n.v)(i.fillStyle,a),s.lineCap=(0,n.v)(i.lineCap,"butt"),s.lineDashOffset=(0,n.v)(i.lineDashOffset,0),s.lineJoin=(0,n.v)(i.lineJoin,"miter"),s.lineWidth=o,s.strokeStyle=(0,n.v)(i.strokeStyle,a),s.setLineDash((0,n.v)(i.lineDash,[])),r.usePointStyle){const a={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:o},l=h.xPlus(t,g/2),c=e+u;(0,n.aD)(s,a,l,c,r.pointStyleWidth&&g)}else{const r=e+Math.max((d-p)/2,0),a=h.leftForLtr(t,g),l=(0,n.aw)(i.borderRadius);s.beginPath(),Object.values(l).some((t=>0!==t))?(0,n.au)(s,{x:a,y:r,w:g,h:p,radius:l}):s.rect(a,r,g,p),s.fill(),0!==o&&s.stroke()}s.restore()}(h.x(S),P,_),S=(0,n.aB)(k,S+g+u,m?S+M:this.right,t.rtl),function(t,e,i){(0,n.Z)(s,i.text,t,e+x/2,l,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})}(h.x(S),P,_),m)f.x+=M+c;else if("string"!==typeof _.text){const t=l.lineHeight;f.y+=Ce(_,t)+c}else f.y+=y})),(0,n.aC)(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=(0,n.a0)(e.font),s=(0,n.E)(e.padding);if(!e.display)return;const o=(0,n.az)(t.rtl,this.left,this.width),r=this.ctx,a=e.position,h=i.size/2,l=s.top+h;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+l,d=(0,n.a2)(t.align,d,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+(0,n.a2)(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=(0,n.a2)(a,d,d+u);r.textAlign=o.textAlign((0,n.a1)(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,(0,n.Z)(r,e.text,f,c,i)}_computeTitleHeight(){const t=this.options.title,e=(0,n.a0)(t.font),i=(0,n.E)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if((0,n.aj)(t,this.left,this.right)&&(0,n.aj)(e,this.top,this.bottom))for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],(0,n.aj)(t,s.left,s.left+s.width)&&(0,n.aj)(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const r=this._hoveredItem,a=(o=i,null!==(s=r)&&null!==o&&s.datasetIndex===o.datasetIndex&&s.index===o.index);r&&!a&&(0,n.Q)(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!a&&(0,n.Q)(e.onHover,[t,i,this],this)}else i&&(0,n.Q)(e.onClick,[t,i,this],this);var s,o}}function Ce(t,e){return e*(t.text?t.text.length:0)}var De={id:"legend",_element:Pe,start(t,e,i){const n=t.legend=new Pe({ctx:t.ctx,options:i,chart:t});tt.configure(t,n,i),tt.addBox(t,n)},stop(t){tt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;tt.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),e.hidden=!0):(s.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:o,color:r,useBorderRadius:a,borderRadius:h}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),c=(0,n.E)(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:o||l.textAlign,borderRadius:a&&(h||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};new WeakMap;const Oe={average(t){if(!t.length)return!1;let e,i,n=0,s=0,o=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,s+=t.y,++o}}return{x:n/o,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,s,o,r=e.x,a=e.y,h=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=s.getCenterPoint(),i=(0,n.aE)(e,t);i<h&&(h=i,o=s)}}if(o){const t=o.tooltipPosition();r=t.x,a=t.y}return{x:r,y:a}}};function Te(t,e){return e&&((0,n.b)(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ae(t){return("string"===typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Le(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Ie(t,e){const i=t.chart.ctx,{body:s,footer:o,title:r}=t,{boxWidth:a,boxHeight:h}=e,l=(0,n.a0)(e.bodyFont),c=(0,n.a0)(e.titleFont),d=(0,n.a0)(e.footerFont),u=r.length,f=o.length,g=s.length,p=(0,n.E)(e.padding);let x=p.height,m=0,b=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(x+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){x+=g*(e.displayColors?Math.max(h,l.lineHeight):l.lineHeight)+(b-g)*l.lineHeight+(b-1)*e.bodySpacing}f&&(x+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let y=0;const _=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=c.string,(0,n.F)(t.title,_),i.font=l.string,(0,n.F)(t.beforeBody.concat(t.afterBody),_),y=e.displayColors?a+2+e.boxPadding:0,(0,n.F)(s,(t=>{(0,n.F)(t.before,_),(0,n.F)(t.lines,_),(0,n.F)(t.after,_)})),y=0,i.font=d.string,(0,n.F)(t.footer,_),i.restore(),m+=p.width,{width:m,height:x}}function Ee(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:h}}=t;let l="center";return"center"===n?l=s<=(a+h)/2?"left":"right":s<=o/2?l="left":s>=r-o/2&&(l="right"),function(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||"right"===t&&s-o-r<0||void 0}(l,t,e,i)&&(l="center"),l}function Re(t,e,i){const n=i.yAlign||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:i.xAlign||e.xAlign||Ee(t,e,i,n),yAlign:n}}function ze(t,e,i,s){const{caretSize:o,caretPadding:r,cornerRadius:a}=t,{xAlign:h,yAlign:l}=i,c=o+r,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=(0,n.aw)(a);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,h);const x=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===h?p+=c:"right"===h&&(p-=c):"left"===h?p-=Math.max(d,f)+o:"right"===h&&(p+=Math.max(u,g)+o),{x:(0,n.S)(p,0,s.width-e.width),y:(0,n.S)(x,0,s.height-e.height)}}function Fe(t,e,i){const s=(0,n.E)(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function je(t){return Te([],Ae(t))}function We(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Be={beforeTitle:n.aF,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:n.aF,beforeBody:n.aF,beforeLabel:n.aF,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return(0,n.k)(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:n.aF,afterBody:n.aF,beforeFooter:n.aF,footer:n.aF,afterFooter:n.aF};function Ve(t,e,i,n){const s=t[e].call(i,n);return"undefined"===typeof s?Be[e].call(i,n):s}class He extends bt{static positioners=Oe;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new l(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,(0,n.j)(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,n=Ve(i,"beforeTitle",this,t),s=Ve(i,"title",this,t),o=Ve(i,"afterTitle",this,t);let r=[];return r=Te(r,Ae(n)),r=Te(r,Ae(s)),r=Te(r,Ae(o)),r}getBeforeBody(t,e){return je(Ve(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return(0,n.F)(t,(t=>{const e={before:[],lines:[],after:[]},n=We(i,t);Te(e.before,Ae(Ve(n,"beforeLabel",this,t))),Te(e.lines,Ve(n,"label",this,t)),Te(e.after,Ae(Ve(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return je(Ve(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Ve(i,"beforeFooter",this,t),s=Ve(i,"footer",this,t),o=Ve(i,"afterFooter",this,t);let r=[];return r=Te(r,Ae(n)),r=Te(r,Ae(s)),r=Te(r,Ae(o)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],r=[];let a,h,l=[];for(a=0,h=e.length;a<h;++a)l.push(Le(this.chart,e[a]));return t.filter&&(l=l.filter(((e,n,s)=>t.filter(e,n,s,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),(0,n.F)(l,(e=>{const i=We(t.callbacks,e);s.push(Ve(i,"labelColor",this,e)),o.push(Ve(i,"labelPointStyle",this,e)),r.push(Ve(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Oe[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Ie(this,i),r=Object.assign({},t,e),a=Re(this.chart,i,r),h=ze(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:h,topRight:l,bottomLeft:c,bottomRight:d}=(0,n.aw)(a),{x:u,y:f}=t,{width:g,height:p}=e;let x,m,b,y,_,v;return"center"===o?(_=f+p/2,"left"===s?(x=u,m=x-r,y=_+r,v=_-r):(x=u+g,m=x+r,y=_-r,v=_+r),b=x):(m="left"===s?u+Math.max(h,c)+r:"right"===s?u+g-Math.max(l,d)-r:this.caretX,"top"===o?(y=f,_=y-r,x=m-r,b=m+r):(y=f+p,_=y+r,x=m+r,b=m-r),v=y),{x1:x,x2:m,x3:b,y1:y,y2:_,y3:v}}drawTitle(t,e,i){const s=this.title,o=s.length;let r,a,h;if(o){const l=(0,n.az)(i.rtl,this.x,this.width);for(t.x=Fe(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=(0,n.a0)(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,h=0;h<o;++h)e.fillText(s[h],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,h+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:h,boxWidth:l}=o,c=(0,n.a0)(o.bodyFont),d=Fe(this,"left",o),u=s.x(d),f=h<c.lineHeight?(c.lineHeight-h)/2:0,g=e.y+f;if(o.usePointStyle){const e={radius:Math.min(l,h)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=s.leftForLtr(u,l)+l/2,c=g+h/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,(0,n.at)(t,e,i,c),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,(0,n.at)(t,e,i,c)}else{t.lineWidth=(0,n.i)(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const e=s.leftForLtr(u,l),i=s.leftForLtr(s.xPlus(u,1),l-2),a=(0,n.aw)(r.borderRadius);Object.values(a).some((t=>0!==t))?(t.beginPath(),t.fillStyle=o.multiKeyBackground,(0,n.au)(t,{x:e,y:g,w:l,h:h,radius:a}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),(0,n.au)(t,{x:i,y:g+1,w:l-2,h:h-2,radius:a}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,g,l,h),t.strokeRect(e,g,l,h),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,l-2,h-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:h,boxWidth:l,boxPadding:c}=i,d=(0,n.a0)(i.bodyFont);let u=d.lineHeight,f=0;const g=(0,n.az)(i.rtl,this.x,this.width),p=function(i){e.fillText(i,g.x(t.x+f),t.y+u/2),t.y+=u+o},x=g.textAlign(r);let m,b,y,_,v,w,k;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Fe(this,x,i),e.fillStyle=i.bodyColor,(0,n.F)(this.beforeBody,p),f=a&&"right"!==x?"center"===r?l/2+c:l+2+c:0,_=0,w=s.length;_<w;++_){for(m=s[_],b=this.labelTextColors[_],e.fillStyle=b,(0,n.F)(m.before,p),y=m.lines,a&&y.length&&(this._drawColorBox(e,t,_,g,i),u=Math.max(d.lineHeight,h)),v=0,k=y.length;v<k;++v)p(y[v]),u=d.lineHeight;(0,n.F)(m.after,p)}f=0,u=d.lineHeight,(0,n.F)(this.afterBody,p),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let r,a;if(o){const h=(0,n.az)(i.rtl,this.x,this.width);for(t.x=Fe(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=h.textAlign(i.footerAlign),e.textBaseline="middle",r=(0,n.a0)(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:h}=t,{width:l,height:c}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=(0,n.aw)(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,h),"top"===r&&this.drawCaret(t,e,i,s),e.lineTo(a+l-u,h),e.quadraticCurveTo(a+l,h,a+l,h+u),"center"===r&&"right"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+l,h+c-g),e.quadraticCurveTo(a+l,h+c,a+l-g,h+c),"bottom"===r&&this.drawCaret(t,e,i,s),e.lineTo(a+f,h+c),e.quadraticCurveTo(a,h+c,a,h+c-f),"center"===r&&"left"===o&&this.drawCaret(t,e,i,s),e.lineTo(a,h+d),e.quadraticCurveTo(a,h,a+d,h),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Oe[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Ie(this,t),r=Object.assign({},i,this._size),a=Re(e,t,r),h=ze(t,r,a,e);n._to===h.x&&s._to===h.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=(0,n.E)(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),(0,n.aA)(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),(0,n.aC)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),o=!(0,n.ah)(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),h=e||!(0,n.ah)(r,o)||a;return h&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),h}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Oe[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var Ne={id:"tooltip",_element:He,positioners:Oe,afterInit(t,e,i){i&&(t.tooltip=new He({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Be},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function Ye(t,e,i,n){const s=t.indexOf(e);if(-1===s)return((t,e,i,n)=>("string"===typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return s!==t.lastIndexOf(e)?i:s}function $e(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Xe extends Dt{static id="category";static defaults={ticks:{callback:$e}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if((0,n.k)(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:(0,n.S)(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Ye(i,t,(0,n.v)(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){return $e.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!==typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Ue(t,e,{horizontal:i,minRotation:s}){const o=(0,n.t)(s),r=(i?Math.sin(o):Math.cos(o))||.001,a=.75*e*(""+t).length;return Math.min(e/r,a)}class Qe extends Dt{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(0,n.k)(t)||("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=t=>s=e?s:t,a=t=>o=i?o:t;if(t){const t=(0,n.s)(s),e=(0,n.s)(o);t<0&&e<0?a(0):t>0&&e>0&&r(0)}if(s===o){let e=0===o?1:Math.abs(.05*o);a(o+e),t||r(s-e)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:o,min:r,max:a,precision:h,count:l,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=o||1,g=c-1,{min:p,max:x}=e,m=!(0,n.k)(r),b=!(0,n.k)(a),y=!(0,n.k)(l),_=(x-p)/(d+1);let v,w,k,M,S=(0,n.aH)((x-p)/g/f)*f;if(S<1e-14&&!m&&!b)return[{value:p},{value:x}];M=Math.ceil(x/S)-Math.floor(p/S),M>g&&(S=(0,n.aH)(M*S/g/f)*f),(0,n.k)(h)||(v=Math.pow(10,h),S=Math.ceil(S*v)/v),"ticks"===s?(w=Math.floor(p/S)*S,k=Math.ceil(x/S)*S):(w=p,k=x),m&&b&&o&&(0,n.aI)((a-r)/o,S/1e3)?(M=Math.round(Math.min((a-r)/S,c)),S=(a-r)/M,w=r,k=a):y?(w=m?r:w,k=b?a:k,M=l-1,S=(k-w)/M):(M=(k-w)/S,M=(0,n.aJ)(M,Math.round(M),S/1e3)?Math.round(M):Math.ceil(M));const P=Math.max((0,n.aK)(S),(0,n.aK)(w));v=Math.pow(10,(0,n.k)(h)?P:h),w=Math.round(w*v)/v,k=Math.round(k*v)/v;let C=0;for(m&&(u&&w!==r?(i.push({value:r}),w<r&&C++,(0,n.aJ)(Math.round((w+C*S)*v)/v,r,Ue(r,_,t))&&C++):w<r&&C++);C<M;++C){const t=Math.round((w+C*S)*v)/v;if(b&&t>a)break;i.push({value:t})}return b&&u&&k!==a?i.length&&(0,n.aJ)(i[i.length-1].value,a,Ue(a,_,t))?i[i.length-1].value=a:i.push({value:a}):b&&k!==a||i.push({value:k}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&(0,n.aG)(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return(0,n.o)(t,this.chart.options.locale,this.options.ticks.format)}}class qe extends Qe{static id="linear";static defaults={ticks:{callback:n.aL.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,n.g)(t)?t:0,this.max=(0,n.g)(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=(0,n.t)(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}class Ke extends Dt{static id="logarithmic";static defaults={ticks:{callback:n.aL.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Qe.prototype.parse.apply(this,[t,e]);if(0!==i)return(0,n.g)(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,n.g)(t)?Math.max(0,t):null,this.max=(0,n.g)(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!(0,n.g)(this._userMin)&&(this.min=t===changeExponent(this.min,0)?changeExponent(this.min,-1):changeExponent(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>t?i:e,o=t=>e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(changeExponent(i,-1)),o(changeExponent(n,1)))),i<=0&&s(changeExponent(n,-1)),n<=0&&o(changeExponent(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=generateTicks({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&(0,n.aG)(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":(0,n.o)(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=(0,n.aM)(t),this._valueRange=(0,n.aM)(this.max)-(0,n.aM)(t)}getPixelForValue(t){return void 0!==t&&0!==t||this.min,null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:((0,n.aM)(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}class Je extends Qe{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:n.aL.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=(0,n.E)(getTickBackdropHeight(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=(0,n.g)(t)&&!isNaN(t)?t:0,this.max=(0,n.g)(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))}generateTickLabels(t){Qe.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=(0,n.Q)(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){const e=n.T/(this._pointLabels.length||1),i=this.options.startAngle||0;return(0,n.ay)(t*e+(0,n.t)(i))}getDistanceFromCenterForValue(t){if((0,n.k)(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if((0,n.k)(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return(0,n.j)(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-n.H+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),pathRadiusLine(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length;let a,h,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let o=e-1;o>=0;o--){const e=t._pointLabelItems[o];if(!e.visible)continue;const r=s.setContext(t.getPointLabelContext(o));drawPointLabelBox(i,r,e);const a=(0,n.a0)(r.font),{x:h,y:l,textAlign:c}=e;(0,n.Z)(i,t._pointLabels[o],h,l+a.lineHeight/2,a,{color:r.color,textAlign:c,textBaseline:"middle"})}}(this,r),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e){this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),n=s.setContext(i),a=o.setContext(i);!function(t,e,i,n,s){const o=t.ctx,r=e.circular,{color:a,lineWidth:h}=e;!r&&!n||!a||!h||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=h,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),pathRadiusLine(t,i,r,n),o.closePath(),o.stroke(),o.restore())}(this,n,h,r,a)}})),i.display){for(t.save(),r-1;a>=0;a--){const n=i.setContext(this.getPointLabelContext(a)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),this.getPointPosition(a,h),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,a)=>{if(0===a&&!e.reverse)return;const h=i.setContext(this.getContext(a)),l=(0,n.a0)(h.font);if(this.getDistanceFromCenterForValue(this.ticks[a].value),h.showLabelBackdrop){t.font=l.string,t.measureText(s.label).width,t.fillStyle=h.backdropColor;const e=(0,n.E)(h.backdropPadding);t.fillRect(-r/2-e.left,-o-l.size/2-e.top,r+e.width,l.size+e.height)}(0,n.Z)(t,s.label,0,-o,l,{color:h.color,strokeColor:h.textStrokeColor,strokeWidth:h.textStrokeWidth})})),t.restore()}drawTitle(){}}const Ze={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}},Ge=Object.keys(Ze);function ti(t,e){return t-e}function ei(t,e){if((0,n.k)(e))return null;const i=t._adapter,{parser:s,round:o,isoWeekday:r}=t._parseOpts;let a=e;return"function"===typeof s&&(a=s(a)),(0,n.g)(a)||(a="string"===typeof s?i.parse(a,s):i.parse(a)),null===a?null:(o&&(a="week"!==o||!(0,n.x)(r)&&!0!==r?i.startOf(a,o):i.startOf(a,"isoWeek",r)),+a)}function ii(t,e,i,n){const s=Ge.length;for(let o=Ge.indexOf(t);o<s-1;++o){const t=Ze[Ge[o]],s=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(s*t.size))<=n)return Ge[o]}return Ge[s-1]}function ni(t,e,i){if(i){if(i.length){const{lo:s,hi:o}=(0,n.aP)(i,e);t[i[s]>=e?i[s]:i[o]]=!0}}else t[e]=!0}function si(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r<o;++r)a=e[r],s[a]=r,n.push({value:a,major:!1});return 0!==o&&i?function(t,e,i,n){const s=t._adapter,o=+s.startOf(e[0].value,n),r=e[e.length-1].value;let a,h;for(a=o;a<=r;a=+s.add(a,1,n))h=i[a],h>=0&&(e[h].major=!0);return e}(t,n,s,i):n}class oi extends Dt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new E._date(t.adapters.date);s.init(e),(0,n.ab)(i.displayFormats,s.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:ei(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function h(t){r||isNaN(t.min)||(s=Math.min(s,t.min)),a||isNaN(t.max)||(o=Math.max(o,t.max))}r&&a||(h(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||h(this.getMinMax(!1))),s=(0,n.g)(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=(0,n.g)(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=(0,n.aO)(s,o,r);return this._unit=e.unit||(i.autoSkip?ii(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(t,e,i,n,s){for(let o=Ge.length-1;o>=Ge.indexOf(i);o--){const i=Ge[o];if(Ze[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Ge[i?Ge.indexOf(i):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Ge.indexOf(t)+1,i=Ge.length;e<i;++e)if(Ze[Ge[e]].common)return Ge[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&a.reverse(),si(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,i,s=0,o=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),o=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;s=(0,n.S)(s,0,r),o=(0,n.S)(o,0,r),this._offsets={start:s,end:o,factor:1/(s+1+o)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||ii(o.minUnit,e,i,this._getLabelCapacity(e)),a=(0,n.v)(s.ticks.stepSize,1),h="week"===r&&o.isoWeekday,l=(0,n.x)(h)||!0===h,c={};let d,u,f=e;if(l&&(f=+t.startOf(f,"isoWeek",h)),f=+t.startOf(f,l?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g="data"===s.ticks.source&&this.getDataTimestamps();for(d=f,u=0;d<i;d=+t.add(d,a,r),u++)ni(c,d,g);return d!==i&&"ticks"!==s.bounds&&1!==u||ni(c,d,g),Object.keys(c).sort(ti).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)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,s=e||i[n];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,s){const o=this.options,r=o.ticks.callback;if(r)return(0,n.Q)(r,[t,e,i],this);const a=o.time.displayFormats,h=this._unit,l=this._majorUnit,c=h&&a[h],d=l&&a[l],u=i[e],f=l&&d&&u&&u.major;return this._adapter.format(t,s||(f?d:c))}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._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=(0,n.t)(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,si(this,[t],this._majorUnit),n),o=this._getLabelSize(s),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(ei(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return(0,n._)(t.sort(ti))}}},50713:function(t,e,i){function n(t){return t+.5|0}i.d(e,{$:function(){return Me},A:function(){return Ft},B:function(){return zt},C:function(){return we},D:function(){return Ct},E:function(){return je},F:function(){return U},G:function(){return yi},H:function(){return ft},I:function(){return di},J:function(){return wi},K:function(){return vi},L:function(){return Yt},M:function(){return ci},N:function(){return _t},O:function(){return H},P:function(){return ht},Q:function(){return X},R:function(){return Ve},S:function(){return Lt},T:function(){return lt},U:function(){return St},V:function(){return xe},W:function(){return It},X:function(){return be},Y:function(){return ke},Z:function(){return Oe},_:function(){return Ht},a:function(){return Be},a0:function(){return We},a1:function(){return Xt},a2:function(){return Ut},a3:function(){return ce},a4:function(){return Z},a5:function(){return nt},a6:function(){return de},a7:function(){return ot},a8:function(){return Ye},a9:function(){return Ne},aA:function(){return Oi},aB:function(){return Qt},aC:function(){return Ti},aD:function(){return ve},aE:function(){return Dt},aF:function(){return z},aG:function(){return kt},aH:function(){return yt},aI:function(){return wt},aJ:function(){return bt},aK:function(){return Pt},aL:function(){return le},aM:function(){return xt},aN:function(){return me},aO:function(){return jt},aP:function(){return Rt},aa:function(){return $e},ab:function(){return G},ac:function(){return F},ad:function(){return $t},ae:function(){return _i},af:function(){return ye},ag:function(){return rt},ah:function(){return Q},ai:function(){return at},aj:function(){return Et},ak:function(){return Re},al:function(){return li},am:function(){return Ri},an:function(){return Ei},ao:function(){return Mi},ap:function(){return Si},aq:function(){return ki},ar:function(){return Se},as:function(){return Pe},at:function(){return _e},au:function(){return Te},av:function(){return ze},aw:function(){return Fe},ax:function(){return Ii},ay:function(){return Tt},az:function(){return Di},b:function(){return W},b3:function(){return ut},b4:function(){return gt},b5:function(){return pt},c:function(){return ie},d:function(){return pe},e:function(){return te},f:function(){return it},g:function(){return V},h:function(){return st},i:function(){return B},j:function(){return He},k:function(){return j},l:function(){return Bt},m:function(){return Y},n:function(){return $},o:function(){return ae},p:function(){return At},q:function(){return qt},r:function(){return Nt},s:function(){return mt},t:function(){return Mt},u:function(){return Vt},v:function(){return N},w:function(){return Kt},x:function(){return vt},y:function(){return ii},z:function(){return mi}});const s=(t,e,i)=>Math.max(Math.min(t,i),e);function o(t){return s(n(2.55*t),0,255)}function r(t){return s(n(255*t),0,255)}function a(t){return s(n(t/2.55)/100,0,1)}function h(t){return s(n(100*t),0,100)}const l={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},c=[..."0123456789ABCDEF"],d=t=>c[15&t],u=t=>c[(240&t)>>4]+c[15&t],f=t=>(240&t)>>4===(15&t);function g(t){var e=(t=>f(t.r)&&f(t.g)&&f(t.b)&&f(t.a))(t)?d:u;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const p=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function x(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function m(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function b(t,e,i){const n=x(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function y(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),r=(s+o)/2;let a,h,l;return s!==o&&(l=s-o,h=r>.5?l/(2-s-o):l/(s+o),a=function(t,e,i,n,s){return t===s?(e-i)/n+(e<i?6:0):e===s?(i-t)/n+2:(t-e)/n+4}(e,i,n,l,s),a=60*a+.5),[0|a,h||0,r]}function _(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(r)}function v(t,e,i){return _(x,t,e,i)}function w(t){return(t%360+360)%360}function k(t){const e=p.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?o(+e[5]):r(+e[5]));const s=w(+e[2]),a=+e[3]/100,h=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return _(b,t,e,i)}(s,a,h):"hsv"===e[1]?function(t,e,i){return _(m,t,e,i)}(s,a,h):v(s,a,h),{r:i[0],g:i[1],b:i[2],a:n}}const M={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"},S={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 P;function C(t){P||(P=function(){const t={},e=Object.keys(S),i=Object.keys(M);let n,s,o,r,a;for(n=0;n<e.length;n++){for(r=a=e[n],s=0;s<i.length;s++)o=i[s],a=a.replace(o,M[o]);o=parseInt(S[r],16),t[a]=[o>>16&255,o>>8&255,255&o]}return t}(),P.transparent=[0,0,0,0]);const e=P[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const D=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const O=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,T=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function A(t,e,i){if(t){let n=y(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=v(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function L(t,e){return t?Object.assign(e||{},t):t}function I(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=r(t[3]))):(e=L(t,{r:0,g:0,b:0,a:1})).a=r(e.a),e}function E(t){return"r"===t.charAt(0)?function(t){const e=D.exec(t);let i,n,r,a=255;if(e){if(e[7]!==i){const t=+e[7];a=e[8]?o(t):s(255*t,0,255)}return i=+e[1],n=+e[3],r=+e[5],i=255&(e[2]?o(i):s(i,0,255)),n=255&(e[4]?o(n):s(n,0,255)),r=255&(e[6]?o(r):s(r,0,255)),{r:i,g:n,b:r,a:a}}}(t):k(t)}class R{constructor(t){if(t instanceof R)return t;const e=typeof t;let i;"object"===e?i=I(t):"string"===e&&(i=function(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*l[t[1]],g:255&17*l[t[2]],b:255&17*l[t[3]],a:5===i?17*l[t[4]]:255}:7!==i&&9!==i||(e={r:l[t[1]]<<4|l[t[2]],g:l[t[3]]<<4|l[t[4]],b:l[t[5]]<<4|l[t[6]],a:9===i?l[t[7]]<<4|l[t[8]]:255})),e}(t)||C(t)||E(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=L(this._rgb);return t&&(t.a=a(t.a)),t}set rgb(t){this._rgb=I(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${a(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?g(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=y(t),i=e[0],n=h(e[1]),s=h(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${a(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,h=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-h,i.r=255&h*i.r+s*n.r+.5,i.g=255&h*i.g+s*n.g+.5,i.b=255&h*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=T(a(t.r)),s=T(a(t.g)),o=T(a(t.b));return{r:r(O(n+i*(T(a(e.r))-n))),g:r(O(s+i*(T(a(e.g))-s))),b:r(O(o+i*(T(a(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new R(this.rgb)}alpha(t){return this._rgb.a=r(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=n(.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 A(this._rgb,2,t),this}darken(t){return A(this._rgb,2,-t),this}saturate(t){return A(this._rgb,1,t),this}desaturate(t){return A(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=y(t);i[0]=w(i[0]+e),i=v(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function z(){}const F=(()=>{let t=0;return()=>t++})();function j(t){return null===t||"undefined"===typeof t}function W(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function B(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function V(t){return("number"===typeof t||t instanceof Number)&&isFinite(+t)}function H(t,e){return V(t)?t:e}function N(t,e){return"undefined"===typeof t?e:t}const Y=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,$=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function X(t,e,i){if(t&&"function"===typeof t.call)return t.apply(i,e)}function U(t,e,i,n){let s,o,r;if(W(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;s<o;s++)e.call(i,t[s],s);else if(B(t))for(r=Object.keys(t),o=r.length,s=0;s<o;s++)e.call(i,t[r[s]],r[s])}function Q(t,e){let i,n,s,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(s=t[i],o=e[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function q(t){if(W(t))return t.map(q);if(B(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let s=0;for(;s<n;++s)e[i[s]]=q(t[i[s]]);return e}return t}function K(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function J(t,e,i,n){if(!K(t))return;const s=e[t],o=i[t];B(s)&&B(o)?Z(s,o,n):e[t]=q(o)}function Z(t,e,i){const n=W(e)?e:[e],s=n.length;if(!B(t))return t;const o=(i=i||{}).merger||J;let r;for(let a=0;a<s;++a){if(r=n[a],!B(r))continue;const e=Object.keys(r);for(let n=0,s=e.length;n<s;++n)o(e[n],t,r,i)}return t}function G(t,e){return Z(t,e,{merger:tt})}function tt(t,e,i){if(!K(t))return;const n=e[t],s=i[t];B(n)&&B(s)?G(n,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=q(s))}const et={"":t=>t,x:t=>t.x,y:t=>t.y};function it(t,e){const i=et[e]||(et[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const s of e)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function nt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const st=t=>"undefined"!==typeof t,ot=t=>"function"===typeof t,rt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function at(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const ht=Math.PI,lt=2*ht,ct=lt+ht,dt=Number.POSITIVE_INFINITY,ut=ht/180,ft=ht/2,gt=ht/4,pt=2*ht/3,xt=Math.log10,mt=Math.sign;function bt(t,e,i){return Math.abs(t-e)<i}function yt(t){const e=Math.round(t);t=bt(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(xt(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function _t(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}function vt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function wt(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function kt(t,e,i){let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Mt(t){return t*(ht/180)}function St(t){return t*(180/ht)}function Pt(t){if(!V(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function Ct(t,e){const i=e.x-t.x,n=e.y-t.y,s=Math.sqrt(i*i+n*n);let o=Math.atan2(n,i);return o<-.5*ht&&(o+=lt),{angle:o,distance:s}}function Dt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ot(t,e){return(t-e+ct)%lt-ht}function Tt(t){return(t%lt+lt)%lt}function At(t,e,i,n){const s=Tt(t),o=Tt(e),r=Tt(i),a=Tt(o-s),h=Tt(r-s),l=Tt(s-o),c=Tt(s-r);return s===o||s===r||n&&o===r||a>h&&l<c}function Lt(t,e,i){return Math.max(e,Math.min(i,t))}function It(t){return Lt(t,-32768,32767)}function Et(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function Rt(t,e,i){i=i||(i=>t[i]<e);let n,s=t.length-1,o=0;for(;s-o>1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const zt=(t,e,i,n)=>Rt(t,i,n?n=>{const s=t[n][e];return s<i||s===i&&t[n+1][e]===i}:n=>t[n][e]<i),Ft=(t,e,i)=>Rt(t,i,(n=>t[n][e]>=i));function jt(t,e,i){let n=0,s=t.length;for(;n<s&&t[n]<e;)n++;for(;s>n&&t[s-1]>i;)s--;return n>0||s<t.length?t.slice(n,s):t}const Wt=["push","pop","shift","splice","unshift"];function Bt(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Wt.forEach((e=>{const i="_onData"+nt(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const s=n.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"===typeof t[i]&&t[i](...e)})),s}})})))}function Vt(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(Wt.forEach((e=>{delete t[e]})),delete t._chartjs)}function Ht(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Nt="undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame;function Yt(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Nt.call(window,(()=>{n=!1,t.apply(e,i)})))}}function $t(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}const Xt=t=>"start"===t?"left":"end"===t?"right":"center",Ut=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,Qt=(t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e;function qt(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,_parsed:a}=t,h=r.axis,{min:l,max:c,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(s=Lt(Math.min(zt(a,h,l).lo,i?n:zt(e,h,r.getPixelForValue(l)).lo),0,n-1)),o=u?Lt(Math.max(zt(a,r.axis,c,!0).hi+1,i?0:zt(e,h,r.getPixelForValue(c),!0).hi+1),s,n)-s:n-s}return{start:s,count:o}}function Kt(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const Jt=t=>0===t||1===t,Zt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*lt/i),Gt=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*lt/i)+1,te={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*ft),easeOutSine:t=>Math.sin(t*ft),easeInOutSine:t=>-.5*(Math.cos(ht*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=>Jt(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=>Jt(t)?t:Zt(t,.075,.3),easeOutElastic:t=>Jt(t)?t:Gt(t,.075,.3),easeInOutElastic(t){const e=.1125;return Jt(t)?t:t<.5?.5*Zt(2*t,e,.45):.5+.5*Gt(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-te.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*te.easeInBounce(2*t):.5*te.easeOutBounce(2*t-1)+.5};function ee(t){if(t&&"object"===typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function ie(t){return ee(t)?t:new R(t)}function ne(t){return ee(t)?t:new R(t).saturate(.5).darken(.1).hexString()}const se=["x","y","borderWidth","radius","tension"],oe=["color","borderColor","backgroundColor"];const re=new Map;function ae(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=re.get(i);return n||(n=new Intl.NumberFormat(t,e),re.set(i,n)),n}(e,i).format(t)}const he={values(t){return W(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=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)&&(s="scientific"),o=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 r=xt(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),h={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(h,this.options.ticks.format),ae(t,n,h)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(xt(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?he.numeric.call(this,t,e,i):""}};var le={formatters:he};const ce=Object.create(null),de=Object.create(null);function ue(t,e){if(!e)return t;const i=e.split(".");for(let n=0,s=i.length;n<s;++n){const e=i[n];t=t[e]||(t[e]=Object.create(null))}return t}function fe(t,e,i){return"string"===typeof e?Z(ue(t,e),i):Z(ue(t,""),e)}class ge{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=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)=>ne(e.backgroundColor),this.hoverBorderColor=(t,e)=>ne(e.borderColor),this.hoverColor=(t,e)=>ne(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return fe(this,t,e)}get(t){return ue(this,t)}describe(t,e){return fe(de,t,e)}override(t,e){return fe(ce,t,e)}route(t,e,i,n){const s=ue(this,t),o=ue(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return B(t)?Object.assign({},e,t):N(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach((t=>t(this)))}}var pe=new ge({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:oe},numbers:{type:"number",properties:se}}),t.describe("animations",{_fallback:"animation"}),t.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}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:le.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function xe(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function me(t,e,i,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let h,l,c,d,u;for(h=0;h<a;h++)if(d=i[h],void 0===d||null===d||W(d)){if(W(d))for(l=0,c=d.length;l<c;l++)u=d[l],void 0===u||null===u||W(u)||(r=xe(t,s,o,r,u))}else r=xe(t,s,o,r,d);t.restore();const f=o.length/2;if(f>i.length){for(h=0;h<f;h++)delete s[o[h]];o.splice(0,f)}return r}function be(t,e,i){const n=t.currentDevicePixelRatio,s=0!==i?Math.max(i/2,.5):0;return Math.round((e-s)*n)/n+s}function ye(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function _e(t,e,i,n){ve(t,e,i,n,null)}function ve(t,e,i,n,s){let o,r,a,h,l,c,d,u;const f=e.pointStyle,g=e.rotation,p=e.radius;let x=(g||0)*ut;if(f&&"object"===typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,n),t.rotate(x),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(p)||p<=0)){switch(t.beginPath(),f){default:s?t.ellipse(i,n,s/2,p,0,0,lt):t.arc(i,n,p,0,lt),t.closePath();break;case"triangle":c=s?s/2:p,t.moveTo(i+Math.sin(x)*c,n-Math.cos(x)*p),x+=pt,t.lineTo(i+Math.sin(x)*c,n-Math.cos(x)*p),x+=pt,t.lineTo(i+Math.sin(x)*c,n-Math.cos(x)*p),t.closePath();break;case"rectRounded":l=.516*p,h=p-l,r=Math.cos(x+gt)*h,d=Math.cos(x+gt)*(s?s/2-l:h),a=Math.sin(x+gt)*h,u=Math.sin(x+gt)*(s?s/2-l:h),t.arc(i-d,n-a,l,x-ht,x-ft),t.arc(i+u,n-r,l,x-ft,x),t.arc(i+d,n+a,l,x,x+ft),t.arc(i-u,n+r,l,x+ft,x+ht),t.closePath();break;case"rect":if(!g){h=Math.SQRT1_2*p,c=s?s/2:h,t.rect(i-c,n-h,2*c,2*h);break}x+=gt;case"rectRot":d=Math.cos(x)*(s?s/2:p),r=Math.cos(x)*p,a=Math.sin(x)*p,u=Math.sin(x)*(s?s/2:p),t.moveTo(i-d,n-a),t.lineTo(i+u,n-r),t.lineTo(i+d,n+a),t.lineTo(i-u,n+r),t.closePath();break;case"crossRot":x+=gt;case"cross":d=Math.cos(x)*(s?s/2:p),r=Math.cos(x)*p,a=Math.sin(x)*p,u=Math.sin(x)*(s?s/2:p),t.moveTo(i-d,n-a),t.lineTo(i+d,n+a),t.moveTo(i+u,n-r),t.lineTo(i-u,n+r);break;case"star":d=Math.cos(x)*(s?s/2:p),r=Math.cos(x)*p,a=Math.sin(x)*p,u=Math.sin(x)*(s?s/2:p),t.moveTo(i-d,n-a),t.lineTo(i+d,n+a),t.moveTo(i+u,n-r),t.lineTo(i-u,n+r),x+=gt,d=Math.cos(x)*(s?s/2:p),r=Math.cos(x)*p,a=Math.sin(x)*p,u=Math.sin(x)*(s?s/2:p),t.moveTo(i-d,n-a),t.lineTo(i+d,n+a),t.moveTo(i+u,n-r),t.lineTo(i-u,n+r);break;case"line":r=s?s/2:Math.cos(x)*p,a=Math.sin(x)*p,t.moveTo(i-r,n-a),t.lineTo(i+r,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(x)*(s?s/2:p),n+Math.sin(x)*p);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function we(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 ke(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Me(t){t.restore()}function Se(t,e,i,n,s){if(!e)return t.lineTo(i.x,i.y);if("middle"===s){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===s!==!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Pe(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 Ce(t,e,i,n,s){if(s.strikethrough||s.underline){const o=t.measureText(n),r=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,h=i-o.actualBoundingBoxAscent,l=i+o.actualBoundingBoxDescent,c=s.strikethrough?(h+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(r,c),t.lineTo(a,c),t.stroke()}}function De(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Oe(t,e,i,n,s,o={}){const r=W(e)?e:[e],a=o.strokeWidth>0&&""!==o.strokeColor;let h,l;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),j(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,o),h=0;h<r.length;++h)l=r[h],o.backdrop&&De(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),j(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(l,i,n,o.maxWidth)),t.fillText(l,i,n,o.maxWidth),Ce(t,i,n,l,o),n+=Number(s.lineHeight);t.restore()}function Te(t,e){const{x:i,y:n,w:s,h:o,radius:r}=e;t.arc(i+r.topLeft,n+r.topLeft,r.topLeft,1.5*ht,ht,!0),t.lineTo(i,n+o-r.bottomLeft),t.arc(i+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,ht,ft,!0),t.lineTo(i+s-r.bottomRight,n+o),t.arc(i+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,ft,0,!0),t.lineTo(i+s,n+r.topRight),t.arc(i+s-r.topRight,n+r.topRight,r.topRight,0,-ft,!0),t.lineTo(i+r.topLeft,n)}const Ae=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Le=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ie(t,e){const i=(""+t).match(Ae);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}const Ee=t=>+t||0;function Re(t,e){const i={},n=B(e),s=n?Object.keys(e):e,o=B(t)?n?i=>N(t[i],t[e[i]]):e=>t[e]:()=>t;for(const r of s)i[r]=Ee(o(r));return i}function ze(t){return Re(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Fe(t){return Re(t,["topLeft","topRight","bottomLeft","bottomRight"])}function je(t){const e=ze(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function We(t,e){t=t||{},e=e||pe.font;let i=N(t.size,e.size);"string"===typeof i&&(i=parseInt(i,10));let n=N(t.style,e.style);n&&!(""+n).match(Le)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:N(t.family,e.family),lineHeight:Ie(N(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:N(t.weight,e.weight),string:""};return s.string=function(t){return!t||j(t.size)||j(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function Be(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;s<o;++s)if(r=t[s],void 0!==r&&(void 0!==e&&"function"===typeof r&&(r=r(e),a=!1),void 0!==i&&W(r)&&(r=r[i%r.length],a=!1),void 0!==r))return n&&!a&&(n.cacheable=!1),r}function Ve(t,e,i){const{min:n,max:s}=t,o=$(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function He(t,e){return Object.assign(Object.create(t),e)}function Ne(t,e=[""],i,n,s=(()=>t[0])){const o=i||t;"undefined"===typeof n&&(n=ti("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>Ne([i,...t],e,o,n)};return new Proxy(r,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,n){return Qe(i,n,(()=>function(t,e,i,n){let s;for(const o of e)if(s=ti(Xe(o,t),i),"undefined"!==typeof s)return Ue(t,s)?Ze(i,n,t,s):s}(n,e,t,i)))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return ei(t).includes(e)},ownKeys(t){return ei(t)},set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Ye(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:$e(t,n),setContext:e=>Ye(t,e,i,n),override:s=>Ye(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return Qe(t,e,(()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];ot(a)&&r.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let h=e(o,r||n);a.delete(t),Ue(t,h)&&(h=Ze(s._scopes,s,t,h));return h}(e,a,t,i));W(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if("undefined"!==typeof o.index&&n(t))return e[o.index%e.length];if(B(e[0])){const i=e,n=s._scopes.filter((t=>t!==i));e=[];for(const h of i){const i=Ze(n,s,t,h);e.push(Ye(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable));Ue(e,a)&&(a=Ye(a,s,o&&o[e],r));return a}(t,e,i)))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,n){return t[i]=n,delete e[i],!0}})}function $e(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:ot(i)?i:()=>i,isIndexable:ot(n)?n:()=>n}}const Xe=(t,e)=>t?t+nt(e):e,Ue=(t,e)=>B(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Qe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function qe(t,e,i){return ot(t)?t(e,i):t}const Ke=(t,e)=>!0===t?e:"string"===typeof t?it(e,t):void 0;function Je(t,e,i,n,s){for(const o of e){const e=Ke(i,o);if(e){t.add(e);const o=qe(e._fallback,i,s);if("undefined"!==typeof o&&o!==i&&o!==n)return o}else if(!1===e&&"undefined"!==typeof n&&i!==n)return null}return!1}function Ze(t,e,i,n){const s=e._rootScopes,o=qe(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let h=Ge(a,r,i,o||i,n);return null!==h&&(("undefined"===typeof o||o===i||(h=Ge(a,r,o,h,n),null!==h))&&Ne(Array.from(a),[""],s,o,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];if(W(s)&&B(i))return i;return s||{}}(e,i,n))))}function Ge(t,e,i,n,s){for(;i;)i=Je(t,e,i,n,s);return i}function ti(t,e){for(const i of e){if(!i)continue;const e=i[t];if("undefined"!==typeof e)return e}}function ei(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}function ii(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,h,l,c;for(a=0,h=n;a<h;++a)l=a+i,c=e[l],r[a]={r:s.parse(it(c,o),l)};return r}const ni=Number.EPSILON||1e-14,si=(t,e)=>e<t.length&&!t[e].skip&&t[e],oi=t=>"x"===t?"y":"x";function ri(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=Dt(o,s),h=Dt(r,o);let l=a/(a+h),c=h/(a+h);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const d=n*l,u=n*c;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function ai(t,e="x"){const i=oi(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,h,l=si(t,0);for(r=0;r<n;++r)if(a=h,h=l,l=si(t,r+1),h){if(l){const t=l[e]-h[e];s[r]=0!==t?(l[i]-h[i])/t:0}o[r]=a?l?mt(s[r-1])!==mt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}!function(t,e,i){const n=t.length;let s,o,r,a,h,l=si(t,0);for(let c=0;c<n-1;++c)h=l,l=si(t,c+1),h&&l&&(bt(e[c],0,ni)?i[c]=i[c+1]=0:(s=i[c]/e[c],o=i[c+1]/e[c],a=Math.pow(s,2)+Math.pow(o,2),a<=9||(r=3/Math.sqrt(a),i[c]=s*r*e[c],i[c+1]=o*r*e[c])))}(t,s,o),function(t,e,i="x"){const n=oi(i),s=t.length;let o,r,a,h=si(t,0);for(let l=0;l<s;++l){if(r=a,a=h,h=si(t,l+1),!a)continue;const s=a[i],c=a[n];r&&(o=(s-r[i])/3,a[`cp1${i}`]=s-o,a[`cp1${n}`]=c-o*e[l]),h&&(o=(h[i]-s)/3,a[`cp2${i}`]=s+o,a[`cp2${n}`]=c+o*e[l])}}(t,o,e)}function hi(t,e,i){return Math.max(Math.min(t,i),e)}function li(t,e,i,n,s){let o,r,a,h;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)ai(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)a=t[o],h=ri(i,a,t[Math.min(o+1,r-(n?0:1))%r],e.tension),a.cp1x=h.previous.x,a.cp1y=h.previous.y,a.cp2x=h.next.x,a.cp2y=h.next.y,i=a}e.capBezierPoints&&function(t,e){let i,n,s,o,r,a=we(t[0],e);for(i=0,n=t.length;i<n;++i)r=o,o=a,a=i<n-1&&we(t[i+1],e),o&&(s=t[i],r&&(s.cp1x=hi(s.cp1x,e.left,e.right),s.cp1y=hi(s.cp1y,e.top,e.bottom)),a&&(s.cp2x=hi(s.cp2x,e.left,e.right),s.cp2y=hi(s.cp2y,e.top,e.bottom)))}(t,i)}function ci(){return"undefined"!==typeof window&&"undefined"!==typeof document}function di(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ui(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 fi=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);const gi=["top","right","bottom","left"];function pi(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=gi[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const xi=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function mi(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=fi(i),o="border-box"===s.boxSizing,r=pi(s,"padding"),a=pi(s,"border","width"),{x:h,y:l,box:c}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,h=!1;if(xi(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,h=!0}return{x:r,y:a,box:h}}(t,i),d=r.left+(c&&a.left),u=r.top+(c&&a.top);let{width:f,height:g}=e;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((h-d)/f*i.width/n),y:Math.round((l-u)/g*i.height/n)}}const bi=t=>Math.round(10*t)/10;function yi(t,e,i,n){const s=fi(t),o=pi(s,"margin"),r=ui(s.maxWidth,t,"clientWidth")||dt,a=ui(s.maxHeight,t,"clientHeight")||dt,h=function(t,e,i){let n,s;if(void 0===e||void 0===i){const o=di(t);if(o){const t=o.getBoundingClientRect(),r=fi(o),a=pi(r,"border","width"),h=pi(r,"padding");e=t.width-h.width-a.width,i=t.height-h.height-a.height,n=ui(r.maxWidth,o,"clientWidth"),s=ui(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||dt,maxHeight:s||dt}}(t,e,i);let{width:l,height:c}=h;if("content-box"===s.boxSizing){const t=pi(s,"border","width"),e=pi(s,"padding");l-=e.width+t.width,c-=e.height+t.height}l=Math.max(0,l-o.width),c=Math.max(0,n?l/n:c-o.height),l=bi(Math.min(l,r,h.maxWidth)),c=bi(Math.min(c,a,h.maxHeight)),l&&!c&&(c=bi(l/2));return(void 0!==e||void 0!==i)&&n&&h.height&&c>h.height&&(c=h.height,l=bi(Math.floor(c*n))),{width:l,height:c}}function _i(t,e,i){const n=e||1,s=Math.floor(t.height*n),o=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const vi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function wi(t,e){const i=function(t,e){return fi(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ki(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Mi(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 Si(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=ki(t,s,i),a=ki(s,o,i),h=ki(o,e,i),l=ki(r,a,i),c=ki(a,h,i);return ki(l,c,i)}const Pi=function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}},Ci=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Di(t,e,i){return t?Pi(e,i):Ci()}function Oi(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 Ai(t){return"angle"===t?{between:At,compare:Ot,normalize:Tt}:{between:Et,compare:(t,e)=>t-e,normalize:t=>t}}function Li({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i===0,style:s}}function Ii(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:h,normalize:l}=Ai(n),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=Ai(n),h=e.length;let l,c,{start:d,end:u,loop:f}=t;if(f){for(d+=h,u+=h,l=0,c=h;l<c&&r(a(e[d%h][n]),s,o);++l)d--,u--;d%=h,u%=h}return u<d&&(u+=h),{start:d,end:u,loop:f,style:t.style}}(t,e,i),g=[];let p,x,m,b=!1,y=null;const _=()=>b||h(s,m,p)&&0!==a(s,m),v=()=>!b||0===a(o,p)||h(o,m,p);for(let w=c,k=c;w<=d;++w)x=e[w%r],x.skip||(p=l(x[n]),p!==m&&(b=h(p,s,o),null===y&&_()&&(y=0===a(p,s)?w:k),null!==y&&v()&&(g.push(Li({start:y,end:w,loop:u,count:r,style:f})),y=null),k=w,m=p));return null!==y&&g.push(Li({start:y,end:d,loop:u,count:r,style:f})),g}function Ei(t,e){const i=[],n=t.segments;for(let s=0;s<n.length;s++){const o=Ii(n[s],t.points,e);o.length&&i.push(...o)}return i}function Ri(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,n){let s=0,o=e-1;if(i&&!n)for(;s<e&&!t[s].skip;)s++;for(;s<e&&t[s].skip;)s++;for(s%=e,i&&(o+=s);o>s&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}(i,s,o,n);if(!0===n)return zi(t,[{start:r,end:a,loop:o}],i,e);return zi(t,function(t,e,i,n){const s=t.length,o=[];let r,a=e,h=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?h.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,h.skip&&(e=r)),h=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}(i,r,a<r?a+s:a,!!t._fullLoop&&0===r&&a===s-1),i,e)}function zi(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const s=t._chart.getContext(),o=Fi(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,h=i.length,l=[];let c=o,d=e[0].start,u=d;function f(t,e,n,s){const o=a?-1:1;if(t!==e){for(t+=h;i[t%h].skip;)t-=o;for(;i[e%h].skip;)e+=o;t%h!==e%h&&(l.push({start:t%h,end:e%h,loop:n,style:s}),c=s,d=e%h)}}for(const g of e){d=a?d:g.start;let t,e=i[d%h];for(u=d+1;u<=g.end;u++){const o=i[u%h];t=Fi(n.setContext(He(s,{type:"segment",p0:e,p1:o,p0DataIndex:(u-1)%h,p1DataIndex:u%h,datasetIndex:r}))),ji(t,c)&&f(d,u-1,g.loop,c),e=o,c=t}d<u-1&&f(d,u-1,g.loop,c)}return l}(t,e,i,n):e}function Fi(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function ji(t,e){if(!e)return!1;const i=[],n=function(t,e){return ee(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,n)!==JSON.stringify(e,n)}},26495:function(t,e,i){i.d(e,{$Q:function(){return f},kL:function(){return d}});var n=i(67294),s=i(23148);const o="label";function r(t,e){"function"===typeof t?t(e):t&&(t.current=e)}function a(t,e){t.labels=e}function h(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;const n=[];t.datasets=e.map((e=>{const s=t.datasets.find((t=>t[i]===e[i]));return s&&e.data&&!n.includes(s)?(n.push(s),Object.assign(s,e),s):{...e}}))}function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const i={labels:[],datasets:[]};return a(i,t.labels),h(i,t.datasets,e),i}function c(t,e){const{height:i=150,width:o=300,redraw:c=!1,datasetIdKey:d,type:u,data:f,options:g,plugins:p=[],fallbackContent:x,updateMode:m,...b}=t,y=(0,n.useRef)(null),_=(0,n.useRef)(),v=()=>{y.current&&(_.current=new s.kL(y.current,{type:u,data:l(f,d),options:g&&{...g},plugins:p}),r(e,_.current))},w=()=>{r(e,null),_.current&&(_.current.destroy(),_.current=null)};return(0,n.useEffect)((()=>{!c&&_.current&&g&&function(t,e){const i=t.options;i&&e&&Object.assign(i,e)}(_.current,g)}),[c,g]),(0,n.useEffect)((()=>{!c&&_.current&&a(_.current.config.data,f.labels)}),[c,f.labels]),(0,n.useEffect)((()=>{!c&&_.current&&f.datasets&&h(_.current.config.data,f.datasets,d)}),[c,f.datasets]),(0,n.useEffect)((()=>{_.current&&(c?(w(),setTimeout(v)):_.current.update(m))}),[c,g,f.labels,f.datasets,m]),(0,n.useEffect)((()=>{_.current&&(w(),setTimeout(v))}),[u]),(0,n.useEffect)((()=>(v(),()=>w())),[]),n.createElement("canvas",Object.assign({ref:y,role:"img",height:i,width:o},b),x)}const d=(0,n.forwardRef)(c);function u(t,e){return s.kL.register(e),(0,n.forwardRef)(((e,i)=>n.createElement(d,Object.assign({},e,{ref:i,type:t}))))}const f=u("bar",s.vn)}}]);