/*! For license information please see 7514.685fae6aee82518a9737.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]="6d11afd3-f95d-4d4a-aed1-e7616fefa324",t._sentryDebugIdIdentifier="sentry-dbid-6d11afd3-f95d-4d4a-aed1-e7616fefa324")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"6845f9ce010d5a446e5d4a40f17204cb8341a07a"},(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 ht._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(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!(to&&i>o||er&&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:rs&&(e=dt(s,{x:t,y:e},i),t=s),eo&&(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{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(ni&&t.splice(i,n-i);return t}(e.elements,a);for(let n=0;nEt(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){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 Ce},FB:function(){return si},FK:function(){return l},IQ:function(){return E},ST:function(){return A},W_:function(){return bt},ZL:function(){return ke},f$:function(){return Qe},jn:function(){return ge},kL:function(){return se},od:function(){return xe},u:function(){return He},uw:function(){return $e},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||e1?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{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{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;s0||!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;fi[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;n0&&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]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=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=0&&tthis.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{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;rt-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;sMath.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;lt.x,i="left",n="right"):(e=t.baset.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=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=t0&&this.getParsed(e-1);for(let v=0;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{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;tt.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{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;ot.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{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;io)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;so)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"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(;or+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;ns?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=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{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({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&&ta*s?a/i:h/s:h*s0}_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;be.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{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{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;et.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)}}}class se{static defaults=n.d;static instances=ee;static overrides=n.a3;static registry=At;static version="4.3.3";static getChart=ie;static register(...t){At.add(...t),oe()}static unregister(...t){At.remove(...t),oe()}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;te.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{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{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;ot.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=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,o=function(t){const{xScale:e,yScale:i}=t;if(e&&i)return{left:e.left,right:e.right,top:i.top,bottom:i.bottom}}(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.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{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 oe(){return(0,n.F)(se.instances,(t=>t._plugins.invalidate()))}function re(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 ae(t,e,i){t.lineTo(i.x,i.y)}function he(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=sa&&o>a;return{count:n,start:h,loop:e.loop,ilen:l(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?(ig&&(g=i),x=(m*x+e)/++m):(y(),t.lineTo(e,i),u=n,m=0,f=g=i),p=i}y()}function de(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i?ce:le}const ue="function"===typeof Path2D;function fe(t,e,i,n){ue&&!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()),re(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=de(e);for(const a of s)re(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 ge 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{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 Se 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}=Me(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=Pe(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}=Me(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+=Pe(_,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;it.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 De={average(t){if(!t.length)return!1;let e,i,n=0,s=0,o=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Ae(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 Le(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 Ie(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 Ee(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Ie(t,e,i,n),yAlign:n}}function Re(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 ze(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 Fe(t){return Oe([],Te(t))}function je(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const We={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{const e={before:[],lines:[],after:[]},n=je(i,t);Oe(e.before,Te(Be(n,"beforeLabel",this,t))),Oe(e.lines,Be(n,"label",this,t)),Oe(e.after,Te(Be(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return Fe(Be(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Be(i,"beforeFooter",this,t),s=Be(i,"footer",this,t),o=Be(i,"afterFooter",this,t);let r=[];return r=Oe(r,Te(n)),r=Oe(r,Te(s)),r=Oe(r,Te(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;at.filter(e,n,s,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),(0,n.F)(l,(e=>{const i=je(t.callbacks,e);s.push(Be(i,"labelColor",this,e)),o.push(Be(i,"labelPointStyle",this,e)),r.push(Be(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=De[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=Le(this,i),r=Object.assign({},t,e),a=Ee(this.chart,i,r),h=Re(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=ze(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;h0!==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=ze(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;_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=De[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Le(this,t),r=Object.assign({},i,this._size),a=Ee(e,t,r),h=Re(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=De[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var He={id:"tooltip",_element:Ve,positioners:De,afterInit(t,e,i){i&&(t.tooltip=new Ve({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:We},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 Ne(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 Ye(t){const e=this.getLabels();return t>=0&&tnull===t?null:(0,n.S)(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Ne(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 Ye.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 Xe(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 Ue 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}),wa)break;i.push({value:t})}return b&&u&&k!==a?i.length&&(0,n.aJ)(i[i.length-1].value,a,Xe(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 Ue{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 qe 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=Ue.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 Ke extends Ue{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){Ue.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=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 Je={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}},Ze=Object.keys(Je);function Ge(t,e){return t-e}function ti(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 ei(t,e,i,n){const s=Ze.length;for(let o=Ze.indexOf(t);o=e?i[s]:i[o]]=!0}}else t[e]=!0}function ni(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r=0&&(e[h].major=!0);return e}(t,n,s,i):n}class si 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:ti(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?ei(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(t,e,i,n,s){for(let o=Ze.length-1;o>=Ze.indexOf(i);o--){const i=Ze[o];if(Je[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Ze[i?Ze.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=Ze.indexOf(t)+1,i=Ze.length;e+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||ei(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+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;e0?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;tMath.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>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;st,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)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;nh&&l=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function Rt(t,e,i){i=i||(i=>t[i]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 st[n][e]Rt(t,i,(n=>t[n][e]>=i));function jt(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s{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;nt.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",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;hi.length){for(h=0;h0&&t.stroke()}}function we(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==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+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;si&&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;ae"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!t.skip))),"monotone"===e.cubicInterpolationMode)ai(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;ot.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;lb||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;ss&&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,a2&&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)}}]);