From f8e26cd7804759b702cfe6c8b8325b7ae3990c59 Mon Sep 17 00:00:00 2001 From: Devin Baeten <71613313+devinbaeten@users.noreply.github.com> Date: Sun, 4 Aug 2024 19:19:29 -0500 Subject: [PATCH] Rebuilt --- .../{index-a27d29bb.js => index-1740703f.js} | 2 +- docs/index.html | 58 ++++++++++++++----- 2 files changed, 44 insertions(+), 16 deletions(-) rename docs/assets/{index-a27d29bb.js => index-1740703f.js} (99%) diff --git a/docs/assets/index-a27d29bb.js b/docs/assets/index-1740703f.js similarity index 99% rename from docs/assets/index-a27d29bb.js rename to docs/assets/index-1740703f.js index 55b88ce..6adac27 100644 --- a/docs/assets/index-a27d29bb.js +++ b/docs/assets/index-1740703f.js @@ -73,4 +73,4 @@ c0.version="2.29.4";RL(b1);c0.fn=i0;c0.min=ay;c0.max=Oy;c0.now=dy;c0.utc=oe;c0.u * Released under the MIT License */class uv{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,o,n,i){const p=o.listeners[i],M=o.duration;p.forEach(b=>b({chart:t,initial:o.initial,numSteps:M,currentStep:Math.min(n-o.start,M)}))}_refresh(){this._request||(this._running=!0,this._request=yl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let o=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const p=n.items;let M=p.length-1,b=!1,s;for(;M>=0;--M)s=p[M],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(t),b=!0):(p[M]=p[p.length-1],p.pop());b&&(i.draw(),this._notify(i,n,t,"progress")),p.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),o+=p.length}),this._lastDate=t,o===0&&(this._running=!1)}_getAnims(t){const o=this._charts;let n=o.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(t,n)),n}listen(t,o,n){this._getAnims(t).listeners[o].push(n)}add(t,o){!o||!o.length||this._getAnims(t).items.push(...o)}has(t){return this._getAnims(t).items.length>0}start(t){const o=this._charts.get(t);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((n,i)=>Math.max(n,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const o=this._charts.get(t);return!(!o||!o.running||!o.items.length)}stop(t){const o=this._charts.get(t);if(!o||!o.items.length)return;const n=o.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();o.items=[],this._notify(t,o,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ce=new uv;const OO="transparent",fv={boolean(e,t,o){return o>.5?t:e},color(e,t,o){const n=nO(e||OO),i=n.valid&&nO(t||OO);return i&&i.valid?i.mix(n,o).hexString():t},number(e,t,o){return e+(t-e)*o}};class qv{constructor(t,o,n,i){const p=o[n];i=An([t.to,i,p,t.from]);const M=An([t.from,p,i]);this._active=!0,this._fn=t.fn||fv[t.type||typeof M],this._easing=Sn[t.easing]||Sn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=o,this._prop=n,this._from=M,this._to=i,this._promises=void 0}active(){return this._active}update(t,o,n){if(this._active){this._notify(!1);const i=this._target[this._prop],p=n-this._start,M=this._duration-p;this._start=n,this._duration=Math.floor(Math.max(M,t.duration)),this._total+=p,this._loop=!!t.loop,this._to=An([t.to,o,i,t.from]),this._from=An([t.from,i,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const o=t-this._start,n=this._duration,i=this._prop,p=this._from,M=this._loop,b=this._to;let s;if(this._active=p!==b&&(M||o1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[i]=this._fn(p,b,s)}wait(){const t=this._promises||(this._promises=[]);return new Promise((o,n)=>{t.push({res:o,rej:n})})}_notify(t){const o=t?"res":"rej",n=this._promises||[];for(let i=0;i{const p=t[i];if(!S0(p))return;const M={};for(const b of o)M[b]=p[b];(p1(p.properties)&&p.properties||[i]).forEach(b=>{(b===i||!n.has(b))&&n.set(b,M)})})}_animateOptions(t,o){const n=o.options,i=Wv(t,n);if(!i)return[];const p=this._createAnimations(i,n);return n.$shared&&hv(t.options.$animations,n).then(()=>{t.options=n},()=>{}),p}_createAnimations(t,o){const n=this._properties,i=[],p=t.$animations||(t.$animations={}),M=Object.keys(o),b=Date.now();let s;for(s=M.length-1;s>=0;--s){const r=M[s];if(r.charAt(0)==="$")continue;if(r==="options"){i.push(...this._animateOptions(t,o));continue}const a=o[r];let A=p[r];const u=n.get(r);if(A)if(u&&A.active()){A.update(u,a,b);continue}else A.cancel();if(!u||!u.duration){t[r]=a;continue}p[r]=A=new qv(u,t,r,a),i.push(A)}return i}update(t,o){if(this._properties.size===0){Object.assign(t,o);return}const n=this._createAnimations(t,o);if(n.length)return ce.add(this._chart,n),!0}}function hv(e,t){const o=[],n=Object.keys(t);for(let i=0;i0||!o&&p<0)return i.index}return null}function fO(e,t){const{chart:o,_cachedMeta:n}=e,i=o._stacks||(o._stacks={}),{iScale:p,vScale:M,index:b}=n,s=p.axis,r=M.axis,a=Rv(p,M,n),A=t.length;let u;for(let f=0;fo[n].axis===t).shift()}function Nv(e,t){return b2(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Bv(e,t,o){return b2(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:o,index:t,mode:"default",type:"data"})}function bn(e,t){const o=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(const i of t){const p=i._stacks;if(!p||p[n]===void 0||p[n][o]===void 0)return;delete p[n][o],p[n]._visualValues!==void 0&&p[n]._visualValues[o]!==void 0&&delete p[n]._visualValues[o]}}}const $b=e=>e==="reset"||e==="none",qO=(e,t)=>t?e:Object.assign({},e),vv=(e,t,o)=>e&&!t.hidden&&t._stacked&&{keys:Gl(o,!0),values:null};class Pt{constructor(t,o){this.chart=t,this._ctx=t.ctx,this.index=o,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=lO(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&&bn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,o=this._cachedMeta,n=this.getDataset(),i=(A,u,f,W)=>A==="x"?u:A==="r"?W:f,p=o.xAxisID=B0(n.xAxisID,Yb(t,"x")),M=o.yAxisID=B0(n.yAxisID,Yb(t,"y")),b=o.rAxisID=B0(n.rAxisID,Yb(t,"r")),s=o.indexAxis,r=o.iAxisID=i(s,p,M,b),a=o.vAxisID=i(s,M,p,b);o.xScale=this.getScaleForId(p),o.yScale=this.getScaleForId(M),o.rScale=this.getScaleForId(b),o.iScale=this.getScaleForId(r),o.vScale=this.getScaleForId(a)}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 o=this._cachedMeta;return t===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&tO(this._data,this),t._stacked&&bn(t)}_dataCheck(){const t=this.getDataset(),o=t.data||(t.data=[]),n=this._data;if(S0(o))this._data=mv(o);else if(n!==o){if(n){tO(n,this);const i=this._cachedMeta;bn(i),i._parsed=[]}o&&Object.isExtensible(o)&&AB(o,this),this._syncList=[],this._data=o}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const o=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const p=o._stacked;o._stacked=lO(o.vScale,o),o.stack!==n.stack&&(i=!0,bn(o),o.stack=n.stack),this._resyncElements(t),(i||p!==o._stacked)&&fO(this,o._parsed)}configure(){const t=this.chart.config,o=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),o,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,o){const{_cachedMeta:n,_data:i}=this,{iScale:p,_stacked:M}=n,b=p.axis;let s=t===0&&o===i.length?!0:n._sorted,r=t>0&&n._parsed[t-1],a,A,u;if(this._parsing===!1)n._parsed=i,n._sorted=!0,u=i;else{p1(i[t])?u=this.parseArrayData(n,i,t,o):S0(i[t])?u=this.parseObjectData(n,i,t,o):u=this.parsePrimitiveData(n,i,t,o);const f=()=>A[b]===null||r&&A[b]_||A<_}for(u=0;u=0;--u)if(!W()){this.updateRangeFromParsed(r,t,f,s);break}}return r}getAllParsedValues(t){const o=this._cachedMeta._parsed,n=[];let i,p,M;for(i=0,p=o.length;i=0&&tthis.getContext(n,i,o),_=r.resolveNamedOptions(u,f,W,A);return _.$shared&&(_.$shared=s,p[M]=Object.freeze(qO(_,s))),_}_resolveAnimations(t,o,n){const i=this.chart,p=this._cachedDataOpts,M=`animation-${o}`,b=p[M];if(b)return b;let s;if(i.options.animation!==!1){const a=this.chart.config,A=a.datasetAnimationScopeKeys(this._type,o),u=a.getOptionScopes(this.getDataset(),A);s=a.createResolver(u,this.getContext(t,n,o))}const r=new $l(i,s&&s.animations);return s&&s._cacheable&&(p[M]=Object.freeze(r)),r}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,o){return!o||$b(t)||this.chart._animationsDisabled}_getSharedOptions(t,o){const n=this.resolveDataElementOptions(t,o),i=this._sharedOptions,p=this.getSharedOptions(n),M=this.includeOptions(o,p)||p!==i;return this.updateSharedOptions(p,o,n),{sharedOptions:p,includeOptions:M}}updateElement(t,o,n,i){$b(i)?Object.assign(t,n):this._resolveAnimations(o,i).update(t,n)}updateSharedOptions(t,o,n){t&&!$b(o)&&this._resolveAnimations(void 0,o).update(t,n)}_setStyle(t,o,n,i){t.active=i;const p=this.getStyle(o,i);this._resolveAnimations(o,n,i).update(t,{options:!i&&this.getSharedOptions(p)||p})}removeHoverStyle(t,o,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,o,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const o=this._data,n=this._cachedMeta.data;for(const[b,s,r]of this._syncList)this[b](s,r);this._syncList=[];const i=n.length,p=o.length,M=Math.min(p,i);M&&this.parse(0,M),p>i?this._insertElements(i,p-i,t):p{for(r.length+=o,b=r.length-1;b>=M;b--)r[b]=r[b-o]};for(s(p),b=t;bi-p))}return e._cache.$bar}function Ev(e){const t=e.iScale,o=Tv(t,e.type);let n=t._length,i,p,M,b;const s=()=>{M===32767||M===-32768||(Tt(b)&&(n=Math.min(n,Math.abs(M-b)||n)),b=M)};for(i=0,p=o.length;i0?i[e-1]:null,b=eMath.abs(b)&&(s=b,r=M),t[o.axis]=r,t._custom={barStart:s,barEnd:r,start:i,end:p,min:M,max:b}}function Vl(e,t,o,n){return p1(e)?xv(e,t,o,n):t[o.axis]=o.parse(e,n),t}function hO(e,t,o,n){const i=e.iScale,p=e.vScale,M=i.getLabels(),b=i===p,s=[];let r,a,A,u;for(r=o,a=o+n;r=o?1:-1)}function kv(e){let t,o,n,i,p;return e.horizontal?(t=e.base>e.x,o="left",n="right"):(t=e.bases.controller.options.grouped),p=n.options.stacked,M=[],b=s=>{const r=s.controller.getParsed(o),a=r&&r[s.vScale.axis];if(k0(a)||isNaN(a))return!0};for(const s of i)if(!(o!==void 0&&b(s))&&((p===!1||M.indexOf(s.stack)===-1||p===void 0&&s.stack===void 0)&&M.push(s.stack),s.index===t))break;return M.length||M.push(void 0),M}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,o,n){const i=this._getStacks(t,n),p=o!==void 0?i.indexOf(o):-1;return p===-1?i.length-1:p}_getRuler(){const t=this.options,o=this._cachedMeta,n=o.iScale,i=[];let p,M;for(p=0,M=o.data.length;p=0;--n)o=Math.max(o,t[n].size(this.resolveDataElementOptions(n))/2);return o>0&&o}getLabelAndValue(t){const o=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:p}=o,M=this.getParsed(t),b=i.getLabelForValue(M.x),s=p.getLabelForValue(M.y),r=M._custom;return{label:n[t]||"",value:"("+b+", "+s+(r?", "+r:"")+")"}}update(t){const o=this._cachedMeta.data;this.updateElements(o,0,o.length,t)}updateElements(t,o,n,i){const p=i==="reset",{iScale:M,vScale:b}=this._cachedMeta,{sharedOptions:s,includeOptions:r}=this._getSharedOptions(o,i),a=M.axis,A=b.axis;for(let u=o;uQn(k,b,s,!0)?1:Math.max(w,w*o,T,T*o),W=(k,w,T)=>Qn(k,b,s,!0)?-1:Math.min(w,w*o,T,T*o),_=f(0,r,A),R=f(q1,a,u),L=W(d1,r,A),E=W(d1+q1,a,u);n=(_-L)/2,i=(R-E)/2,p=-(_+L)/2,M=-(R+E)/2}return{ratioX:n,ratioY:i,offsetX:p,offsetY:M}}class N2 extends Pt{constructor(t,o){super(t,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,o){const n=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=n;else{let p=s=>+n[s];if(S0(n[t])){const{key:s="value"}=this._parsing;p=r=>+o2(n[r],s)}let M,b;for(M=t,b=t+o;M0&&!isNaN(t)?M1*(Math.abs(t)/o):0}getLabelAndValue(t){const o=this._cachedMeta,n=this.chart,i=n.data.labels||[],p=qi(o._parsed[t],n.options.locale);return{label:i[t]||"",value:p}}getMaxBorderWidth(t){let o=0;const n=this.chart;let i,p,M,b,s;if(!t){for(i=0,p=n.data.datasets.length;it!=="spacing",_indexable:t=>t!=="spacing"}),a0(N2,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const o=t.data;if(o.labels.length&&o.datasets.length){const{labels:{pointStyle:n,color:i}}=t.legend.options;return o.labels.map((p,M)=>{const s=t.getDatasetMeta(0).controller.getStyle(M);return{text:p,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:i,lineWidth:s.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(M),index:M}})}return[]}},onClick(t,o,n){n.chart.toggleDataVisibility(o.index),n.chart.update()}}}});class yp extends Pt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const o=this._cachedMeta,{dataset:n,data:i=[],_dataset:p}=o,M=this.chart._animationsDisabled;let{start:b,count:s}=Bl(o,i,M);this._drawStart=b,this._drawCount=s,vl(o)&&(b=0,s=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!p._decimated,n.points=i;const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0),r.segment=this.options.segment,this.updateElement(n,void 0,{animated:!M,options:r},t),this.updateElements(i,b,s,t)}updateElements(t,o,n,i){const p=i==="reset",{iScale:M,vScale:b,_stacked:s,_dataset:r}=this._cachedMeta,{sharedOptions:a,includeOptions:A}=this._getSharedOptions(o,i),u=M.axis,f=b.axis,{spanGaps:W,segment:_}=this.options,R=xo(W)?W:Number.POSITIVE_INFINITY,L=this.chart._animationsDisabled||p||i==="none",E=o+n,k=t.length;let w=o>0&&this.getParsed(o-1);for(let T=0;T=E){I.skip=!0;continue}const D=this.getParsed(T),J=k0(D[f]),G=I[u]=M.getPixelForValue(D[u],T),K=I[f]=p||J?b.getBasePixel():b.getPixelForValue(s?this.applyStack(b,D,s):D[f],T);I.skip=isNaN(G)||isNaN(K)||J,I.stop=T>0&&Math.abs(D[u]-w[u])>R,_&&(I.parsed=D,I.raw=r.data[T]),A&&(I.options=a||this.resolveDataElementOptions(T,d.active?"active":i)),L||this.updateElement(d,T,I,i),w=D}}getMaxOverflow(){const t=this._cachedMeta,o=t.dataset,n=o.options&&o.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const p=i[0].size(this.resolveDataElementOptions(0)),M=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,p,M)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}a0(yp,"id","line"),a0(yp,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),a0(yp,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class xn extends Pt{constructor(t,o){super(t,o),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const o=this._cachedMeta,n=this.chart,i=n.data.labels||[],p=qi(o._parsed[t].r,n.options.locale);return{label:i[t]||"",value:p}}parseObjectData(t,o,n,i){return Dl.bind(this)(t,o,n,i)}update(t){const o=this._cachedMeta.data;this._updateRadius(),this.updateElements(o,0,o.length,t)}getMinMax(){const t=this._cachedMeta,o={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,i)=>{const p=this.getParsed(i).r;!isNaN(p)&&this.chart.getDataVisibility(i)&&(po.max&&(o.max=p))}),o}_updateRadius(){const t=this.chart,o=t.chartArea,n=t.options,i=Math.min(o.right-o.left,o.bottom-o.top),p=Math.max(i/2,0),M=Math.max(n.cutoutPercentage?p/100*n.cutoutPercentage:1,0),b=(p-M)/t.getVisibleDatasetCount();this.outerRadius=p-b*this.index,this.innerRadius=this.outerRadius-b}updateElements(t,o,n,i){const p=i==="reset",M=this.chart,s=M.options.animation,r=this._cachedMeta.rScale,a=r.xCenter,A=r.yCenter,u=r.getIndexAngle(0)-.5*d1;let f=u,W;const _=360/this.countVisibleElements();for(W=0;W{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&o++}),o}_computeAngle(t,o,n){return this.chart.getDataVisibility(t)?Ct(this.resolveDataElementOptions(t,o).angle||n):0}}a0(xn,"id","polarArea"),a0(xn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),a0(xn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const o=t.data;if(o.labels.length&&o.datasets.length){const{labels:{pointStyle:n,color:i}}=t.legend.options;return o.labels.map((p,M)=>{const s=t.getDatasetMeta(0).controller.getStyle(M);return{text:p,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:i,lineWidth:s.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(M),index:M}})}return[]}},onClick(t,o,n){n.chart.toggleDataVisibility(o.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Us extends N2{}a0(Us,"id","pie"),a0(Us,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Np extends Pt{getLabelAndValue(t){const o=this._cachedMeta.vScale,n=this.getParsed(t);return{label:o.getLabels()[t],value:""+o.getLabelForValue(n[o.axis])}}parseObjectData(t,o,n,i){return Dl.bind(this)(t,o,n,i)}update(t){const o=this._cachedMeta,n=o.dataset,i=o.data||[],p=o.iScale.getLabels();if(n.points=i,t!=="resize"){const M=this.resolveDatasetElementOptions(t);this.options.showLine||(M.borderWidth=0);const b={_loop:!0,_fullLoop:p.length===i.length,options:M};this.updateElement(n,void 0,b,t)}this.updateElements(i,0,i.length,t)}updateElements(t,o,n,i){const p=this._cachedMeta.rScale,M=i==="reset";for(let b=o;b0&&this.getParsed(o-1);for(let w=o;w0&&Math.abs(d[f]-k[f])>L,R&&(I.parsed=d,I.raw=r.data[w]),u&&(I.options=A||this.resolveDataElementOptions(w,T.active?"active":i)),E||this.updateElement(T,w,I,i),k=d}this.updateSharedOptions(A,i,a)}getMaxOverflow(){const t=this._cachedMeta,o=t.data||[];if(!this.options.showLine){let b=0;for(let s=o.length-1;s>=0;--s)b=Math.max(b,o[s].size(this.resolveDataElementOptions(s))/2);return b>0&&b}const n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!o.length)return i;const p=o[0].size(this.resolveDataElementOptions(0)),M=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(i,p,M)/2}}a0(Bp,"id","scatter"),a0(Bp,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),a0(Bp,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Fv=Object.freeze({__proto__:null,BarController:Rp,BubbleController:Lp,DoughnutController:N2,LineController:yp,PolarAreaController:xn,PieController:Us,RadarController:Np,ScatterController:Bp});function q2(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Wr{static override(t){Object.assign(Wr.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return q2()}parse(){return q2()}format(){return q2()}add(){return q2()}diff(){return q2()}startOf(){return q2()}endOf(){return q2()}}var Hv={_date:Wr};function Uv(e,t,o,n){const{controller:i,data:p,_sorted:M}=e,b=i._cachedMeta.iScale;if(b&&t===b.axis&&t!=="r"&&M&&p.length){const s=b._reversePixels?OB:qe;if(n){if(i._sharedOptions){const r=p[0],a=typeof r.getRange=="function"&&r.getRange(t);if(a){const A=s(p,t,o-a),u=s(p,t,o+a);return{lo:A.lo,hi:u.hi}}}}else return s(p,t,o)}return{lo:0,hi:p.length-1}}function hi(e,t,o,n,i){const p=e.getSortedVisibleDatasetMetas(),M=o[t];for(let b=0,s=p.length;b{s[M](t[o],i)&&(p.push({element:s,datasetIndex:r,index:a}),b=b||s.inRange(t.x,t.y,i))}),n&&!b?[]:p}var Gv={evaluateInteractionItems:hi,modes:{index(e,t,o,n){const i=W2(t,e),p=o.axis||"x",M=o.includeInvisible||!1,b=o.intersect?Vb(e,i,p,n,M):Kb(e,i,p,!1,n,M),s=[];return b.length?(e.getSortedVisibleDatasetMetas().forEach(r=>{const a=b[0].index,A=r.data[a];A&&!A.skip&&s.push({element:A,datasetIndex:r.index,index:a})}),s):[]},dataset(e,t,o,n){const i=W2(t,e),p=o.axis||"xy",M=o.includeInvisible||!1;let b=o.intersect?Vb(e,i,p,n,M):Kb(e,i,p,!1,n,M);if(b.length>0){const s=b[0].datasetIndex,r=e.getDatasetMeta(s).data;b=[];for(let a=0;ao.pos===t)}function mO(e,t){return e.filter(o=>Kl.indexOf(o.pos)===-1&&o.box.axis===t)}function cn(e,t){return e.sort((o,n)=>{const i=t?n:o,p=t?o:n;return i.weight===p.weight?i.index-p.index:i.weight-p.weight})}function Vv(e){const t=[];let o,n,i,p,M,b;for(o=0,n=(e||[]).length;or.box.fullSize),!0),n=cn(sn(t,"left"),!0),i=cn(sn(t,"right")),p=cn(sn(t,"top"),!0),M=cn(sn(t,"bottom")),b=mO(t,"x"),s=mO(t,"y");return{fullSize:o,leftAndTop:n.concat(p),rightAndBottom:i.concat(s).concat(M).concat(b),chartArea:sn(t,"chartArea"),vertical:n.concat(i).concat(s),horizontal:p.concat(M).concat(b)}}function RO(e,t,o,n){return Math.max(e[o],t[o])+Math.max(e[n],t[n])}function Ql(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Zv(e,t,o,n){const{pos:i,box:p}=o,M=e.maxPadding;if(!S0(i)){o.size&&(e[i]-=o.size);const A=n[o.stack]||{size:0,count:1};A.size=Math.max(A.size,o.horizontal?p.height:p.width),o.size=A.size/A.count,e[i]+=o.size}p.getPadding&&Ql(M,p.getPadding());const b=Math.max(0,t.outerWidth-RO(M,e,"left","right")),s=Math.max(0,t.outerHeight-RO(M,e,"top","bottom")),r=b!==e.w,a=s!==e.h;return e.w=b,e.h=s,o.horizontal?{same:r,other:a}:{same:a,other:r}}function tT(e){const t=e.maxPadding;function o(n){const i=Math.max(t[n]-e[n],0);return e[n]+=i,i}e.y+=o("top"),e.x+=o("left"),o("right"),o("bottom")}function eT(e,t){const o=t.maxPadding;function n(i){const p={left:0,top:0,right:0,bottom:0};return i.forEach(M=>{p[M]=Math.max(t[M],o[M])}),p}return n(e?["left","right"]:["top","bottom"])}function ln(e,t,o,n){const i=[];let p,M,b,s,r,a;for(p=0,M=e.length,r=0;p{typeof _.beforeLayout=="function"&&_.beforeLayout()});const a=s.reduce((_,R)=>R.box.options&&R.box.options.display===!1?_:_+1,0)||1,A=Object.freeze({outerWidth:t,outerHeight:o,padding:i,availableWidth:p,availableHeight:M,vBoxMaxWidth:p/2/a,hBoxMaxHeight:M/2}),u=Object.assign({},i);Ql(u,$1(n));const f=Object.assign({maxPadding:u,w:p,h:M,x:i.left,y:i.top},i),W=Qv(s.concat(r),A);ln(b.fullSize,f,A,W),ln(s,f,A,W),ln(r,f,A,W)&&ln(s,f,A,W),tT(f),LO(b.leftAndTop,f,A,W),f.x+=f.w,f.y+=f.h,LO(b.rightAndBottom,f,A,W),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},H0(b.chartArea,_=>{const R=_.box;Object.assign(R,e.chartArea),R.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Jl{acquireContext(t,o){}releaseContext(t){return!1}addEventListener(t,o,n){}removeEventListener(t,o,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,o,n,i){return o=Math.max(0,o||t.width),n=n||t.height,{width:o,height:Math.max(0,i?Math.floor(o/i):n)}}isAttached(t){return!0}updateConfig(t){}}class oT extends Jl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const vp="$chartjs",nT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},yO=e=>e===null||e==="";function iT(e,t){const o=e.style,n=e.getAttribute("height"),i=e.getAttribute("width");if(e[vp]={initial:{height:n,width:i,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",yO(i)){const p=cO(e,"width");p!==void 0&&(e.width=p)}if(yO(n))if(e.style.height==="")e.height=e.width/(t||2);else{const p=cO(e,"height");p!==void 0&&(e.height=p)}return e}const Zl=Mv?{passive:!0}:!1;function pT(e,t,o){e.addEventListener(t,o,Zl)}function MT(e,t,o){e.canvas.removeEventListener(t,o,Zl)}function bT(e,t){const o=nT[e.type]||e.type,{x:n,y:i}=W2(e,t);return{type:o,chart:t,native:e,x:n!==void 0?n:null,y:i!==void 0?i:null}}function rM(e,t){for(const o of e)if(o===t||o.contains(t))return!0}function sT(e,t,o){const n=e.canvas,i=new MutationObserver(p=>{let M=!1;for(const b of p)M=M||rM(b.addedNodes,n),M=M&&!rM(b.removedNodes,n);M&&o()});return i.observe(document,{childList:!0,subtree:!0}),i}function cT(e,t,o){const n=e.canvas,i=new MutationObserver(p=>{let M=!1;for(const b of p)M=M||rM(b.removedNodes,n),M=M&&!rM(b.addedNodes,n);M&&o()});return i.observe(document,{childList:!0,subtree:!0}),i}const ti=new Map;let NO=0;function tu(){const e=window.devicePixelRatio;e!==NO&&(NO=e,ti.forEach((t,o)=>{o.currentDevicePixelRatio!==e&&t()}))}function rT(e,t){ti.size||window.addEventListener("resize",tu),ti.set(e,t)}function zT(e){ti.delete(e),ti.size||window.removeEventListener("resize",tu)}function aT(e,t,o){const n=e.canvas,i=n&&hr(n);if(!i)return;const p=Nl((b,s)=>{const r=i.clientWidth;o(b,s),r{const s=b[0],r=s.contentRect.width,a=s.contentRect.height;r===0&&a===0||p(r,a)});return M.observe(i),rT(e,p),M}function Qb(e,t,o){o&&o.disconnect(),t==="resize"&&zT(e)}function OT(e,t,o){const n=e.canvas,i=Nl(p=>{e.ctx!==null&&o(bT(p,e))},e);return pT(n,t,i),i}class dT extends Jl{acquireContext(t,o){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(iT(t,o),n):null}releaseContext(t){const o=t.canvas;if(!o[vp])return!1;const n=o[vp].initial;["height","width"].forEach(p=>{const M=n[p];k0(M)?o.removeAttribute(p):o.setAttribute(p,M)});const i=n.style||{};return Object.keys(i).forEach(p=>{o.style[p]=i[p]}),o.width=o.width,delete o[vp],!0}addEventListener(t,o,n){this.removeEventListener(t,o);const i=t.$proxies||(t.$proxies={}),M={attach:sT,detach:cT,resize:aT}[o]||OT;i[o]=M(t,o,n)}removeEventListener(t,o){const n=t.$proxies||(t.$proxies={}),i=n[o];if(!i)return;({attach:Qb,detach:Qb,resize:Qb}[o]||MT)(t,o,i),n[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,n,i){return pv(t,o,n,i)}isAttached(t){const o=hr(t);return!!(o&&o.isConnected)}}function AT(e){return!Il()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?oT:dT}var Op;let Be=(Op=class{constructor(){a0(this,"active",!1)}tooltipPosition(t){const{x:o,y:n}=this.getProps(["x","y"],t);return{x:o,y:n}}hasValue(){return xo(this.x)&&xo(this.y)}getProps(t,o){const n=this.$animations;if(!o||!n)return this;const i={};return t.forEach(p=>{i[p]=n[p]&&n[p].active()?n[p]._to:this[p]}),i}},a0(Op,"defaults",{}),a0(Op,"defaultRoutes"),Op);function lT(e,t){const o=e.options.ticks,n=uT(e),i=Math.min(o.maxTicksLimit||n,n),p=o.major.enabled?qT(t):[],M=p.length,b=p[0],s=p[M-1],r=[];if(M>i)return hT(t,r,p,M/i),r;const a=fT(p,t,i);if(M>0){let A,u;const f=M>1?Math.round((s-b)/(M-1)):null;for(bp(t,r,a,k0(f)?0:b-f,b),A=0,u=M-1;Ai)return s}return Math.max(i,1)}function qT(e){const t=[];let o,n;for(o=0,n=e.length;oe==="left"?"right":e==="right"?"left":e,BO=(e,t,o)=>t==="top"||t==="left"?e[t]+o:e[t]-o,vO=(e,t)=>Math.min(t||e,e);function TO(e,t){const o=[],n=e.length/t,i=e.length;let p=0;for(;pM+b)))return s}function mT(e,t){H0(e,o=>{const n=o.gc,i=n.length/2;let p;if(i>t){for(p=0;pn?n:o,n=i&&o>n?o:n,{min:dt(o,dt(n,o)),max:dt(n,dt(o,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){n1(this.options.beforeUpdate,[this])}update(t,o,n){const{beginAtZero:i,grace:p,ticks:M}=this.options,b=M.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=o,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=kB(this,p,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=b=p||n<=1||!this.isHorizontal()){this.labelRotation=i;return}const a=this._getLabelSizes(),A=a.widest.width,u=a.highest.height,f=X1(this.chart.width-A,0,this.maxWidth);b=t.offset?this.maxWidth/n:f/(n-1),A+6>b&&(b=f/(n-(t.offset?.5:1)),s=this.maxHeight-rn(t.grid)-o.padding-EO(t.title,this.chart.options.font),r=Math.sqrt(A*A+u*u),M=Or(Math.min(Math.asin(X1((a.highest.height+6)/b,-1,1)),Math.asin(X1(s/r,-1,1))-Math.asin(X1(u/r,-1,1)))),M=Math.max(i,Math.min(p,M))),this.labelRotation=M}afterCalculateLabelRotation(){n1(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){n1(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:o,options:{ticks:n,title:i,grid:p}}=this,M=this._isVisible(),b=this.isHorizontal();if(M){const s=EO(i,o.options.font);if(b?(t.width=this.maxWidth,t.height=rn(p)+s):(t.height=this.maxHeight,t.width=rn(p)+s),n.display&&this.ticks.length){const{first:r,last:a,widest:A,highest:u}=this._getLabelSizes(),f=n.padding*2,W=Ct(this.labelRotation),_=Math.cos(W),R=Math.sin(W);if(b){const L=n.mirror?0:R*A.width+_*u.height;t.height=Math.min(this.maxHeight,t.height+L+f)}else{const L=n.mirror?0:_*A.width+R*u.height;t.width=Math.min(this.maxWidth,t.width+L+f)}this._calculatePadding(r,a,R,_)}}this._handleMargins(),b?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,o,n,i){const{ticks:{align:p,padding:M},position:b}=this.options,s=this.labelRotation!==0,r=b!=="top"&&this.axis==="x";if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,A=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;s?r?(u=i*t.width,f=n*o.height):(u=n*t.height,f=i*o.width):p==="start"?f=o.width:p==="end"?u=t.width:p!=="inner"&&(u=t.width/2,f=o.width/2),this.paddingLeft=Math.max((u-a+M)*this.width/(this.width-a),0),this.paddingRight=Math.max((f-A+M)*this.width/(this.width-A),0)}else{let a=o.height/2,A=t.height/2;p==="start"?(a=0,A=t.height):p==="end"&&(a=o.height,A=0),this.paddingTop=a+M,this.paddingBottom=A+M}}_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(){n1(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:o}=this.options;return o==="top"||o==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let o,n;for(o=0,n=t.length;o({width:M[J]||0,height:b[J]||0});return{first:D(0),last:D(o-1),widest:D(d),highest:D(I),widths:M,heights:b}}getLabelForValue(t){return t}getPixelForValue(t,o){return NaN}getValueForPixel(t){}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const o=this._startPixel+t*this._length;return aB(this._alignToPixels?f2(this.chart,o,0):o)}getDecimalForPixel(t){const o=(t-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:o}=this;return t<0&&o<0?o:t>0&&o>0?t:0}getContext(t){const o=this.ticks||[];if(t>=0&&tb*i?b/n:s/i:s*i0}_computeGridLineItems(t){const o=this.axis,n=this.chart,i=this.options,{grid:p,position:M,border:b}=i,s=p.offset,r=this.isHorizontal(),A=this.ticks.length+(s?1:0),u=rn(p),f=[],W=b.setContext(this.getContext()),_=W.display?W.width:0,R=_/2,L=function(l0){return f2(n,l0,_)};let E,k,w,T,d,I,D,J,G,K,n0,e0;if(M==="top")E=L(this.bottom),I=this.bottom-u,J=E-R,K=L(t.top)+R,e0=t.bottom;else if(M==="bottom")E=L(this.top),K=t.top,e0=L(t.bottom)-R,I=E+R,J=this.top+u;else if(M==="left")E=L(this.right),d=this.right-u,D=E-R,G=L(t.left)+R,n0=t.right;else if(M==="right")E=L(this.left),G=t.left,n0=L(t.right)-R,d=E+R,D=this.left+u;else if(o==="x"){if(M==="center")E=L((t.top+t.bottom)/2+.5);else if(S0(M)){const l0=Object.keys(M)[0],m0=M[l0];E=L(this.chart.scales[l0].getPixelForValue(m0))}K=t.top,e0=t.bottom,I=E+R,J=I+u}else if(o==="y"){if(M==="center")E=L((t.left+t.right)/2);else if(S0(M)){const l0=Object.keys(M)[0],m0=M[l0];E=L(this.chart.scales[l0].getPixelForValue(m0))}d=E-R,D=d-u,G=t.left,n0=t.right}const O0=B0(i.ticks.maxTicksLimit,A),M0=Math.max(1,Math.ceil(A/O0));for(k=0;kp.value===t);return i>=0?o.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const o=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let p,M;const b=(s,r,a)=>{!a.width||!a.color||(n.save(),n.lineWidth=a.width,n.strokeStyle=a.color,n.setLineDash(a.borderDash||[]),n.lineDashOffset=a.borderDashOffset,n.beginPath(),n.moveTo(s.x,s.y),n.lineTo(r.x,r.y),n.stroke(),n.restore())};if(o.display)for(p=0,M=i.length;p{this.draw(p)}}]:[{z:n,draw:p=>{this.drawBackground(),this.drawGrid(p),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:o,draw:p=>{this.drawLabels(p)}}]}getMatchingVisibleMetas(t){const o=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let p,M;for(p=0,M=o.length;p{const n=o.split("."),i=n.pop(),p=[e].concat(n).join("."),M=t[o].split("."),b=M.pop(),s=M.join(".");W1.route(p,i,s,b)})}function TT(e){return"id"in e&&"defaults"in e}class ET{constructor(){this.controllers=new sp(Pt,"datasets",!0),this.elements=new sp(Be,"elements"),this.plugins=new sp(Object,"plugins"),this.scales=new sp(H2,"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,o,n){[...o].forEach(i=>{const p=n||this._getRegistryForType(i);n||p.isForType(i)||p===this.plugins&&i.id?this._exec(t,p,i):H0(i,M=>{const b=n||this._getRegistryForType(M);this._exec(t,b,M)})})}_exec(t,o,n){const i=ar(t);n1(n["before"+i],[],n),o[t](n),n1(n["after"+i],[],n)}_getRegistryForType(t){for(let o=0;op.filter(b=>!M.some(s=>b.plugin.id===s.plugin.id));this._notify(i(o,n),t,"stop"),this._notify(i(n,o),t,"start")}}function wT(e){const t={},o=[],n=Object.keys(Gt.plugins.items);for(let p=0;p1&&zM(e[0].toLowerCase(),t),e))return e;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function IT(e,t){const o=C2[e.type]||{scales:{}},n=t.scales||{},i=js(e.type,t),p=Object.create(null);return Object.keys(n).forEach(M=>{const b=n[M];if(!S0(b))return console.error(`Invalid scale configuration for scale: ${M}`);if(b._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${M}`);const s=zM(M,b),r=DT(s,i),a=o.scales||{};p[M]=Tn(Object.create(null),[{axis:s},b,a[s],a[r]])}),e.data.datasets.forEach(M=>{const b=M.type||e.type,s=M.indexAxis||js(b,t),a=(C2[b]||{}).scales||{};Object.keys(a).forEach(A=>{const u=CT(A,s),f=M[u+"AxisID"]||u;p[f]=p[f]||Object.create(null),Tn(p[f],[{axis:u},n[f],a[A]])})}),Object.keys(p).forEach(M=>{const b=p[M];Tn(b,[W1.scales[b.type],W1.scale])}),p}function eu(e){const t=e.options||(e.options={});t.plugins=B0(t.plugins,{}),t.scales=IT(e,t)}function ou(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function FT(e){return e=e||{},e.data=ou(e.data),eu(e),e}const SO=new Map,nu=new Set;function cp(e,t){let o=SO.get(e);return o||(o=t(),SO.set(e,o),nu.add(o)),o}const zn=(e,t,o)=>{const n=o2(t,o);n!==void 0&&e.add(n)};class HT{constructor(t){this._config=FT(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=ou(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(),eu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return cp(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return cp(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return cp(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){const o=t.id,n=this.type;return cp(`${n}-plugin-${o}`,()=>[[`plugins.${o}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,o){const n=this._scopeCache;let i=n.get(t);return(!i||o)&&(i=new Map,n.set(t,i)),i}getOptionScopes(t,o,n){const{options:i,type:p}=this,M=this._cachedScopes(t,n),b=M.get(o);if(b)return b;const s=new Set;o.forEach(a=>{t&&(s.add(t),a.forEach(A=>zn(s,t,A))),a.forEach(A=>zn(s,i,A)),a.forEach(A=>zn(s,C2[p]||{},A)),a.forEach(A=>zn(s,W1,A)),a.forEach(A=>zn(s,Fs,A))});const r=Array.from(s);return r.length===0&&r.push(Object.create(null)),nu.has(o)&&M.set(o,r),r}chartOptionScopes(){const{options:t,type:o}=this;return[t,C2[o]||{},W1.datasets[o]||{},{type:o},W1,Fs]}resolveNamedOptions(t,o,n,i=[""]){const p={$shared:!0},{resolver:M,subPrefixes:b}=wO(this._resolverCache,t,i);let s=M;if(jT(M,o)){p.$shared=!1,n=n2(n)?n():n;const r=this.createResolver(t,n,b);s=Xo(M,n,r)}for(const r of o)p[r]=s[r];return p}createResolver(t,o,n=[""],i){const{resolver:p}=wO(this._resolverCache,t,n);return S0(o)?Xo(p,o,void 0,i):p}}function wO(e,t,o){let n=e.get(t);n||(n=new Map,e.set(t,n));const i=o.join();let p=n.get(i);return p||(p={resolver:ur(t,o),subPrefixes:o.filter(b=>!b.toLowerCase().includes("hover"))},n.set(i,p)),p}const UT=e=>S0(e)&&Object.getOwnPropertyNames(e).reduce((t,o)=>t||n2(e[o]),!1);function jT(e,t){const{isScriptable:o,isIndexable:n}=xl(e);for(const i of t){const p=o(i),M=n(i),b=(M||p)&&e[i];if(p&&(n2(b)||UT(b))||M&&p1(b))return!0}return!1}var YT="4.2.1";const $T=["top","bottom","left","right","chartArea"];function xO(e,t){return e==="top"||e==="bottom"||$T.indexOf(e)===-1&&t==="x"}function XO(e,t){return function(o,n){return o[e]===n[e]?o[t]-n[t]:o[e]-n[e]}}function kO(e){const t=e.chart,o=t.options.animation;t.notifyPlugins("afterRender"),n1(o&&o.onComplete,[e],t)}function GT(e){const t=e.chart,o=t.options.animation;n1(o&&o.onProgress,[e],t)}function iu(e){return Il()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Tp={},CO=e=>{const t=iu(e);return Object.values(Tp).filter(o=>o.canvas===t).pop()};function VT(e,t,o){const n=Object.keys(e);for(const i of n){const p=+i;if(p>=t){const M=e[i];delete e[i],(o>0||p>t)&&(e[p+o]=M)}}}function KT(e,t,o,n){return!o||e.type==="mouseout"?null:n?t:e}function QT(e){const{xScale:t,yScale:o}=e;if(t&&o)return{left:t.left,right:t.right,top:o.top,bottom:o.bottom}}class yt{static register(...t){Gt.add(...t),DO()}static unregister(...t){Gt.remove(...t),DO()}constructor(t,o){const n=this.config=new HT(o),i=iu(t),p=CO(i);if(p)throw new Error("Canvas is already in use. Chart with ID '"+p.id+"' must be destroyed before the canvas with ID '"+p.canvas.id+"' can be reused.");const M=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||AT(i)),this.platform.updateConfig(n);const b=this.platform.acquireContext(i,M.aspectRatio),s=b&&b.canvas,r=s&&s.height,a=s&&s.width;if(this.id=tB(),this.ctx=b,this.canvas=s,this.width=a,this.height=r,this._options=M,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 ST,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=lB(A=>this.update(A),M.resizeDelay||0),this._dataChanges=[],Tp[this.id]=this,!b||!s){console.error("Failed to create chart: can't acquire context from the given item");return}ce.listen(this,"complete",kO),ce.listen(this,"progress",GT),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:o},width:n,height:i,_aspectRatio:p}=this;return k0(t)?o&&p?p:i?n/i: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 Gt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():sO(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return pO(this.canvas,this.ctx),this}stop(){return ce.stop(this),this}resize(t,o){ce.running(this)?this._resizeBeforeDraw={width:t,height:o}:this._resize(t,o)}_resize(t,o){const n=this.options,i=this.canvas,p=n.maintainAspectRatio&&this.aspectRatio,M=this.platform.getMaximumSize(i,t,o,p),b=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=M.width,this.height=M.height,this._aspectRatio=this.aspectRatio,sO(this,b,!0)&&(this.notifyPlugins("resize",{size:M}),n1(n.onResize,[this,M],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};H0(o,(n,i)=>{n.id=i})}buildOrUpdateScales(){const t=this.options,o=t.scales,n=this.scales,i=Object.keys(n).reduce((M,b)=>(M[b]=!1,M),{});let p=[];o&&(p=p.concat(Object.keys(o).map(M=>{const b=o[M],s=zM(M,b),r=s==="r",a=s==="x";return{options:b,dposition:r?"chartArea":a?"bottom":"left",dtype:r?"radialLinear":a?"category":"linear"}}))),H0(p,M=>{const b=M.options,s=b.id,r=zM(s,b),a=B0(b.type,M.dtype);(b.position===void 0||xO(b.position,r)!==xO(M.dposition))&&(b.position=M.dposition),i[s]=!0;let A=null;if(s in n&&n[s].type===a)A=n[s];else{const u=Gt.getScale(a);A=new u({id:s,type:a,ctx:this.ctx,chart:this}),n[A.id]=A}A.init(b,t)}),H0(i,(M,b)=>{M||delete n[b]}),H0(n,M=>{j1.configure(this,M,M.options),j1.addBox(this,M)})}_updateMetasets(){const t=this._metasets,o=this.data.datasets.length,n=t.length;if(t.sort((i,p)=>i.index-p.index),n>o){for(let i=o;io.length&&delete this._stacks,t.forEach((n,i)=>{o.filter(p=>p===n._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],o=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=o.length;n{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const o=this.config;o.update();const n=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const p=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let M=0;for(let r=0,a=this.data.datasets.length;r{r.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(XO("z","_idx"));const{_active:b,_lastEvent:s}=this;s?this._eventHandler(s,!0):b.length&&this._updateHoverStyles(b,b,!0),this.render()}_updateScales(){H0(this.scales,t=>{j1.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,o=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Ka(o,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,o=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:p}of o){const M=n==="_removeElements"?-p:p;VT(t,i,M)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const o=this.data.datasets.length,n=p=>new Set(t.filter(M=>M[0]===p).map((M,b)=>b+","+M.splice(1).join(","))),i=n(0);for(let p=1;pp.split(",")).map(p=>({method:p[1],start:+p[2],count:+p[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;j1.update(this,this.width,this.height,t);const o=this.chartArea,n=o.width<=0||o.height<=0;this._layers=[],H0(this.boxes,i=>{n&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,p)=>{i._idx=p}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let o=0,n=this.data.datasets.length;o=0;--o)this._drawDataset(t[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const o=this.ctx,n=t._clip,i=!n.disabled,p=QT(t)||this.chartArea,M={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",M)!==!1&&(i&&$M(o,{left:n.left===!1?0:p.left-n.left,right:n.right===!1?this.width:p.right+n.right,top:n.top===!1?0:p.top-n.top,bottom:n.bottom===!1?this.height:p.bottom+n.bottom}),t.controller.draw(),i&&GM(o),M.cancelable=!1,this.notifyPlugins("afterDatasetDraw",M))}isPointInArea(t){return Jn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,o,n,i){const p=Gv.modes[o];return typeof p=="function"?p(this,t,n,i):[]}getDatasetMeta(t){const o=this.data.datasets[t],n=this._metasets;let i=n.filter(p=>p&&p._dataset===o).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:t,_dataset:o,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=b2(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const o=this.data.datasets[t];if(!o)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!o.hidden}setDatasetVisibility(t,o){const n=this.getDatasetMeta(t);n.hidden=!o}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,o,n){const i=n?"show":"hide",p=this.getDatasetMeta(t),M=p.controller._resolveAnimations(void 0,i);Tt(o)?(p.data[o].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),M.update(p,{visible:n}),this.update(b=>b.datasetIndex===t?i:void 0))}hide(t,o){this._updateVisibility(t,o,!1)}show(t,o){this._updateVisibility(t,o,!0)}_destroyDatasetMeta(t){const o=this._metasets[t];o&&o.controller&&o.controller._destroy(),delete this._metasets[t]}_stop(){let t,o;for(this.stop(),ce.remove(this),t=0,o=this.data.datasets.length;t{o.addEventListener(this,p,M),t[p]=M},i=(p,M,b)=>{p.offsetX=M,p.offsetY=b,this._eventHandler(p)};H0(this.options.events,p=>n(p,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,o=this.platform,n=(s,r)=>{o.addEventListener(this,s,r),t[s]=r},i=(s,r)=>{t[s]&&(o.removeEventListener(this,s,r),delete t[s])},p=(s,r)=>{this.canvas&&this.resize(s,r)};let M;const b=()=>{i("attach",b),this.attached=!0,this.resize(),n("resize",p),n("detach",M)};M=()=>{this.attached=!1,i("resize",p),this._stop(),this._resize(0,0),n("attach",b)},o.isAttached(this.canvas)?b():M()}unbindEvents(){H0(this._listeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._listeners={},H0(this._responsiveListeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,o,n){const i=n?"set":"remove";let p,M,b,s;for(o==="dataset"&&(p=this.getDatasetMeta(t[0].datasetIndex),p.controller["_"+i+"DatasetHoverStyle"]()),b=0,s=t.length;b{const b=this.getDatasetMeta(p);if(!b)throw new Error("No dataset found at index "+p);return{datasetIndex:p,element:b.data[M],index:M}});!pM(n,o)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,o))}notifyPlugins(t,o,n){return this._plugins.notify(this,t,o,n)}isPluginEnabled(t){return this._plugins._cache.filter(o=>o.plugin.id===t).length===1}_updateHoverStyles(t,o,n){const i=this.options.hover,p=(s,r)=>s.filter(a=>!r.some(A=>a.datasetIndex===A.datasetIndex&&a.index===A.index)),M=p(o,t),b=n?t:p(t,o);M.length&&this.updateHoverStyle(M,i.mode,!1),b.length&&i.mode&&this.updateHoverStyle(b,i.mode,!0)}_eventHandler(t,o){const n={event:t,replay:o,cancelable:!0,inChartArea:this.isPointInArea(t)},i=M=>(M.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,i)===!1)return;const p=this._handleEvent(t,o,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(p||n.changed)&&this.render(),this}_handleEvent(t,o,n){const{_active:i=[],options:p}=this,M=o,b=this._getActiveElements(t,i,n,M),s=MB(t),r=KT(t,this._lastEvent,n,s);n&&(this._lastEvent=null,n1(p.onHover,[t,b,this],this),s&&n1(p.onClick,[t,b,this],this));const a=!pM(b,i);return(a||o)&&(this._active=b,this._updateHoverStyles(b,i,o)),this._lastEvent=r,a}_getActiveElements(t,o,n,i){if(t.type==="mouseout")return[];if(!n)return o;const p=this.options.hover;return this.getElementsAtEventForMode(t,p.mode,p,i)}}a0(yt,"defaults",W1),a0(yt,"instances",Tp),a0(yt,"overrides",C2),a0(yt,"registry",Gt),a0(yt,"version",YT),a0(yt,"getChart",CO);function DO(){return H0(yt.instances,e=>e._plugins.invalidate())}function JT(e,t,o){const{startAngle:n,pixelMargin:i,x:p,y:M,outerRadius:b,innerRadius:s}=t;let r=i/b;e.beginPath(),e.arc(p,M,b,n-r,o+r),s>i?(r=i/s,e.arc(p,M,s,o+r,n-r,!0)):e.arc(p,M,i,o+q1,n-q1),e.closePath(),e.clip()}function ZT(e){return lr(e,["outerStart","outerEnd","innerStart","innerEnd"])}function tE(e,t,o,n){const i=ZT(e.options.borderRadius),p=(o-t)/2,M=Math.min(p,n*t/2),b=s=>{const r=(o-Math.min(p,s))*n/2;return X1(s,0,Math.min(p,r))};return{outerStart:b(i.outerStart),outerEnd:b(i.outerEnd),innerStart:X1(i.innerStart,0,M),innerEnd:X1(i.innerEnd,0,M)}}function eo(e,t,o,n){return{x:o+e*Math.cos(t),y:n+e*Math.sin(t)}}function aM(e,t,o,n,i,p){const{x:M,y:b,startAngle:s,pixelMargin:r,innerRadius:a}=t,A=Math.max(t.outerRadius+n+o-r,0),u=a>0?a+n+o+r:0;let f=0;const W=i-s;if(n){const M0=a>0?a-n:0,l0=A>0?A-n:0,m0=(M0+l0)/2,c1=m0!==0?W*m0/(m0+n):W;f=(W-c1)/2}const _=Math.max(.001,W*A-o/d1)/A,R=(W-_)/2,L=s+R+f,E=i-R-f,{outerStart:k,outerEnd:w,innerStart:T,innerEnd:d}=tE(t,u,A,E-L),I=A-k,D=A-w,J=L+k/I,G=E-w/D,K=u+T,n0=u+d,e0=L+T/K,O0=E-d/n0;if(e.beginPath(),p){const M0=(J+G)/2;if(e.arc(M,b,A,J,M0),e.arc(M,b,A,M0,G),w>0){const C0=eo(D,G,M,b);e.arc(C0.x,C0.y,w,G,E+q1)}const l0=eo(n0,E,M,b);if(e.lineTo(l0.x,l0.y),d>0){const C0=eo(n0,O0,M,b);e.arc(C0.x,C0.y,d,E+q1,O0+Math.PI)}const m0=(E-d/u+(L+T/u))/2;if(e.arc(M,b,u,E-d/u,m0,!0),e.arc(M,b,u,m0,L+T/u,!0),T>0){const C0=eo(K,e0,M,b);e.arc(C0.x,C0.y,T,e0+Math.PI,L-q1)}const c1=eo(I,L,M,b);if(e.lineTo(c1.x,c1.y),k>0){const C0=eo(I,J,M,b);e.arc(C0.x,C0.y,k,L-q1,J)}}else{e.moveTo(M,b);const M0=Math.cos(J)*A+M,l0=Math.sin(J)*A+b;e.lineTo(M0,l0);const m0=Math.cos(G)*A+M,c1=Math.sin(G)*A+b;e.lineTo(m0,c1)}e.closePath()}function eE(e,t,o,n,i){const{fullCircles:p,startAngle:M,circumference:b}=t;let s=t.endAngle;if(p){aM(e,t,o,n,s,i);for(let r=0;r=M1||Qn(p,b,s),_=fe(M,r+u,a+u);return W&&_}getCenterPoint(t){const{x:o,y:n,startAngle:i,endAngle:p,innerRadius:M,outerRadius:b}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:s,spacing:r}=this.options,a=(i+p)/2,A=(M+b+r+s)/2;return{x:o+Math.cos(a)*A,y:n+Math.sin(a)*A}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:o,circumference:n}=this,i=(o.offset||0)/4,p=(o.spacing||0)/2,M=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=n>M1?Math.floor(n/M1):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const b=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(b)*i,Math.sin(b)*i);const s=1-Math.sin(Math.min(d1,n||0)),r=i*s;t.fillStyle=o.backgroundColor,t.strokeStyle=o.borderColor,eE(t,this,r,p,M),oE(t,this,r,p,M),t.restore()}}a0(Ep,"id","arc"),a0(Ep,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),a0(Ep,"defaultRoutes",{backgroundColor:"backgroundColor"});function pu(e,t,o=t){e.lineCap=B0(o.borderCapStyle,t.borderCapStyle),e.setLineDash(B0(o.borderDash,t.borderDash)),e.lineDashOffset=B0(o.borderDashOffset,t.borderDashOffset),e.lineJoin=B0(o.borderJoinStyle,t.borderJoinStyle),e.lineWidth=B0(o.borderWidth,t.borderWidth),e.strokeStyle=B0(o.borderColor,t.borderColor)}function nE(e,t,o){e.lineTo(o.x,o.y)}function iE(e){return e.stepped?NB:e.tension||e.cubicInterpolationMode==="monotone"?BB:nE}function Mu(e,t,o={}){const n=e.length,{start:i=0,end:p=n-1}=o,{start:M,end:b}=t,s=Math.max(i,M),r=Math.min(p,b),a=ib&&p>b;return{count:n,start:s,loop:t.loop,ilen:r(M+(r?b-w:w))%p,k=()=>{_!==R&&(e.lineTo(a,R),e.lineTo(a,_),e.lineTo(a,L))};for(s&&(f=i[E(0)],e.moveTo(f.x,f.y)),u=0;u<=b;++u){if(f=i[E(u)],f.skip)continue;const w=f.x,T=f.y,d=w|0;d===W?(T<_?_=T:T>R&&(R=T),a=(A*a+w)/++A):(k(),e.lineTo(w,T),W=d,A=0,_=R=T),L=T}k()}function Ys(e){const t=e.options,o=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?ME:pE}function bE(e){return e.stepped?bv:e.tension||e.cubicInterpolationMode==="monotone"?sv:g2}function sE(e,t,o,n){let i=t._path;i||(i=t._path=new Path2D,t.path(i,o,n)&&i.closePath()),pu(e,t.options),e.stroke(i)}function cE(e,t,o,n){const{segments:i,options:p}=t,M=Ys(t);for(const b of i)pu(e,p,b.style),e.beginPath(),M(e,t,b,{start:o,end:o+n-1})&&e.closePath(),e.stroke()}const rE=typeof Path2D=="function";function zE(e,t,o,n){rE&&!t.options.segment?sE(e,t,o,n):cE(e,t,o,n)}class He extends Be{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,o){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;ZB(this._points,n,t,i,o),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=dv(this,this.options.segment))}first(){const t=this.segments,o=this.points;return t.length&&o[t[0].start]}last(){const t=this.segments,o=this.points,n=t.length;return n&&o[t[n-1].end]}interpolate(t,o){const n=this.options,i=t[o],p=this.points,M=Yl(this,{property:o,start:i,end:i});if(!M.length)return;const b=[],s=bE(n);let r,a;for(r=0,a=M.length;rt!=="borderDash"&&t!=="fill"});function PO(e,t,o,n){const i=e.options,{[o]:p}=e.getProps([o],n);return Math.abs(t-p)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function su(e){return $s[e%$s.length]}function cu(e){return IO[e%IO.length]}function fE(e,t){return e.borderColor=su(t),e.backgroundColor=cu(t),++t}function qE(e,t){return e.backgroundColor=e.data.map(()=>su(t++)),t}function hE(e,t){return e.backgroundColor=e.data.map(()=>cu(t++)),t}function WE(e){let t=0;return(o,n)=>{const i=e.getDatasetMeta(n).controller;i instanceof N2?t=qE(o,t):i instanceof xn?t=hE(o,t):i&&(t=fE(o,t))}}function FO(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function gE(e){return e&&(e.borderColor||e.backgroundColor)}var _E={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,o){if(!o.enabled)return;const{data:{datasets:n},options:i}=e.config,{elements:p}=i;if(!o.forceOverride&&(FO(n)||gE(i)||p&&FO(p)))return;const M=WE(e);n.forEach(M)}};function mE(e,t,o,n,i){const p=i.samples||n;if(p>=o)return e.slice(t,t+o);const M=[],b=(o-2)/(p-2);let s=0;const r=t+o-1;let a=t,A,u,f,W,_;for(M[s++]=e[a],A=0;Af&&(f=W,u=e[E],_=E);M[s++]=u,a=_}return M[s++]=e[r],M}function RE(e,t,o,n){let i=0,p=0,M,b,s,r,a,A,u,f,W,_;const R=[],L=t+o-1,E=e[t].x,w=e[L].x-E;for(M=t;M_&&(_=r,u=M),i=(p*i+b.x)/++p;else{const d=M-1;if(!k0(A)&&!k0(u)){const I=Math.min(A,u),D=Math.max(A,u);I!==f&&I!==d&&R.push({...e[I],x:i}),D!==f&&D!==d&&R.push({...e[D],x:i})}M>0&&d!==f&&R.push(e[d]),R.push(b),a=T,p=0,W=_=r,A=u=f=M}}return R}function ru(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function HO(e){e.data.datasets.forEach(t=>{ru(t)})}function LE(e,t){const o=t.length;let n=0,i;const{iScale:p}=e,{min:M,max:b,minDefined:s,maxDefined:r}=p.getUserBounds();return s&&(n=X1(qe(t,p.axis,M).lo,0,o-1)),r?i=X1(qe(t,p.axis,b).hi+1,n,o)-n:i=o-n,{start:n,count:i}}var yE={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,o)=>{if(!o.enabled){HO(e);return}const n=e.width;e.data.datasets.forEach((i,p)=>{const{_data:M,indexAxis:b}=i,s=e.getDatasetMeta(p),r=M||i.data;if(An([b,e.options.indexAxis])==="y"||!s.controller.supportsDecimation)return;const a=e.scales[s.xAxisID];if(a.type!=="linear"&&a.type!=="time"||e.options.parsing)return;let{start:A,count:u}=LE(s,r);const f=o.threshold||4*n;if(u<=f){ru(i);return}k0(M)&&(i._data=r,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(_){this._data=_}}));let W;switch(o.algorithm){case"lttb":W=mE(r,A,u,n,o);break;case"min-max":W=RE(r,A,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${o.algorithm}'`)}i._decimated=W})},destroy(e){HO(e)}};function NE(e,t,o){const n=e.segments,i=e.points,p=t.points,M=[];for(const b of n){let{start:s,end:r}=b;r=gr(s,r,i);const a=Gs(o,i[s],i[r],b.loop);if(!t.segments){M.push({source:b,target:a,start:i[s],end:i[r]});continue}const A=Yl(t,a);for(const u of A){const f=Gs(o,p[u.start],p[u.end],u.loop),W=jl(b,i,f);for(const _ of W)M.push({source:_,target:u,start:{[o]:UO(a,f,"start",Math.max)},end:{[o]:UO(a,f,"end",Math.min)}})}}return M}function Gs(e,t,o,n){if(n)return;let i=t[e],p=o[e];return e==="angle"&&(i=At(i),p=At(p)),{property:e,start:i,end:p}}function BE(e,t){const{x:o=null,y:n=null}=e||{},i=t.points,p=[];return t.segments.forEach(({start:M,end:b})=>{b=gr(M,b,i);const s=i[M],r=i[b];n!==null?(p.push({x:s.x,y:n}),p.push({x:r.x,y:n})):o!==null&&(p.push({x:o,y:s.y}),p.push({x:o,y:r.y}))}),p}function gr(e,t,o){for(;t>e;t--){const n=o[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function UO(e,t,o,n){return e&&t?n(e[o],t[o]):e?e[o]:t?t[o]:0}function zu(e,t){let o=[],n=!1;return p1(e)?(n=!0,o=e):o=BE(e,t),o.length?new He({points:o,options:{tension:0},_loop:n,_fullLoop:n}):null}function jO(e){return e&&e.fill!==!1}function vE(e,t,o){let i=e[t].fill;const p=[t];let M;if(!o)return i;for(;i!==!1&&p.indexOf(i)===-1;){if(!f1(i))return i;if(M=e[i],!M)return!1;if(M.visible)return i;p.push(i),i=M.fill}return!1}function TE(e,t,o){const n=xE(e);if(S0(n))return isNaN(n.value)?!1:n;let i=parseFloat(n);return f1(i)&&Math.floor(i)===i?EE(n[0],t,i,o):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function EE(e,t,o,n){return(e==="-"||e==="+")&&(o=t+o),o===t||o<0||o>=n?!1:o}function SE(e,t){let o=null;return e==="start"?o=t.bottom:e==="end"?o=t.top:S0(e)?o=t.getPixelForValue(e.value):t.getBasePixel&&(o=t.getBasePixel()),o}function wE(e,t,o){let n;return e==="start"?n=o:e==="end"?n=t.options.reverse?t.min:t.max:S0(e)?n=e.value:n=t.getBaseValue(),n}function xE(e){const t=e.options,o=t.fill;let n=B0(o&&o.target,o);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function XE(e){const{scale:t,index:o,line:n}=e,i=[],p=n.segments,M=n.points,b=kE(t,o);b.push(zu({x:null,y:t.bottom},n));for(let s=0;s=0;--M){const b=i[M].$filler;b&&(b.line.updateControlPoints(p,b.axis),n&&b.fill&&ts(e.ctx,b,p))}},beforeDatasetsDraw(e,t,o){if(o.drawTime!=="beforeDatasetsDraw")return;const n=e.getSortedVisibleDatasetMetas();for(let i=n.length-1;i>=0;--i){const p=n[i].$filler;jO(p)&&ts(e.ctx,p,e.chartArea)}},beforeDatasetDraw(e,t,o){const n=t.meta.$filler;!jO(n)||o.drawTime!=="beforeDatasetDraw"||ts(e.ctx,n,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const VO=(e,t)=>{let{boxHeight:o=t,boxWidth:n=t}=e;return e.usePointStyle&&(o=Math.min(o,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:o,itemHeight:Math.max(t,o)}},GE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class KO extends Be{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,o,n){this.maxWidth=t,this.maxHeight=o,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let o=n1(t.generateLabels,[this.chart],this)||[];t.filter&&(o=o.filter(n=>t.filter(n,this.chart.data))),t.sort&&(o=o.sort((n,i)=>t.sort(n,i,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:t,ctx:o}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,i=S1(n.font),p=i.size,M=this._computeTitleHeight(),{boxWidth:b,itemHeight:s}=VO(n,p);let r,a;o.font=i.string,this.isHorizontal()?(r=this.maxWidth,a=this._fitRows(M,p,b,s)+10):(a=this.maxHeight,r=this._fitCols(M,i,b,s)+10),this.width=Math.min(r,t.maxWidth||this.maxWidth),this.height=Math.min(a,t.maxHeight||this.maxHeight)}_fitRows(t,o,n,i){const{ctx:p,maxWidth:M,options:{labels:{padding:b}}}=this,s=this.legendHitBoxes=[],r=this.lineWidths=[0],a=i+b;let A=t;p.textAlign="left",p.textBaseline="middle";let u=-1,f=-a;return this.legendItems.forEach((W,_)=>{const R=n+o/2+p.measureText(W.text).width;(_===0||r[r.length-1]+R+2*b>M)&&(A+=a,r[r.length-(_>0?0:1)]=0,f+=a,u++),s[_]={left:0,top:f,row:u,width:R,height:i},r[r.length-1]+=R+b}),A}_fitCols(t,o,n,i){const{ctx:p,maxHeight:M,options:{labels:{padding:b}}}=this,s=this.legendHitBoxes=[],r=this.columnSizes=[],a=M-t;let A=b,u=0,f=0,W=0,_=0;return this.legendItems.forEach((R,L)=>{const{itemWidth:E,itemHeight:k}=VE(n,o,p,R,i);L>0&&f+k+2*b>a&&(A+=u+b,r.push({width:u,height:f}),W+=u+b,_++,u=f=0),s[L]={left:W,top:f,col:_,width:E,height:k},u=Math.max(u,E),f+=k+b}),A+=u,r.push({width:u,height:f}),A}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:n,labels:{padding:i},rtl:p}}=this,M=ho(p,this.left,this.width);if(this.isHorizontal()){let b=0,s=H1(n,this.left+i,this.right-this.lineWidths[b]);for(const r of o)b!==r.row&&(b=r.row,s=H1(n,this.left+i,this.right-this.lineWidths[b])),r.top+=this.top+t+i,r.left=M.leftForLtr(M.x(s),r.width),s+=r.width+i}else{let b=0,s=H1(n,this.top+t+i,this.bottom-this.columnSizes[b].height);for(const r of o)r.col!==b&&(b=r.col,s=H1(n,this.top+t+i,this.bottom-this.columnSizes[b].height)),r.top=s,r.left+=this.left+i,r.left=M.leftForLtr(M.x(r.left),r.width),s+=r.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;$M(t,this),this._draw(),GM(t)}}_draw(){const{options:t,columnSizes:o,lineWidths:n,ctx:i}=this,{align:p,labels:M}=t,b=W1.color,s=ho(t.rtl,this.left,this.width),r=S1(M.font),{padding:a}=M,A=r.size,u=A/2;let f;this.drawTitle(),i.textAlign=s.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=r.string;const{boxWidth:W,boxHeight:_,itemHeight:R}=VO(M,A),L=function(d,I,D){if(isNaN(W)||W<=0||isNaN(_)||_<0)return;i.save();const J=B0(D.lineWidth,1);if(i.fillStyle=B0(D.fillStyle,b),i.lineCap=B0(D.lineCap,"butt"),i.lineDashOffset=B0(D.lineDashOffset,0),i.lineJoin=B0(D.lineJoin,"miter"),i.lineWidth=J,i.strokeStyle=B0(D.strokeStyle,b),i.setLineDash(B0(D.lineDash,[])),M.usePointStyle){const G={radius:_*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:J},K=s.xPlus(d,W/2),n0=I+u;Sl(i,G,K,n0,M.pointStyleWidth&&W)}else{const G=I+Math.max((A-_)/2,0),K=s.leftForLtr(d,W),n0=T2(D.borderRadius);i.beginPath(),Object.values(n0).some(e0=>e0!==0)?Zn(i,{x:K,y:G,w:W,h:_,radius:n0}):i.rect(K,G,W,_),i.fill(),J!==0&&i.stroke()}i.restore()},E=function(d,I,D){D2(i,D.text,d,I+R/2,r,{strikethrough:D.hidden,textAlign:s.textAlign(D.textAlign)})},k=this.isHorizontal(),w=this._computeTitleHeight();k?f={x:H1(p,this.left+a,this.right-n[0]),y:this.top+a+w,line:0}:f={x:this.left+a,y:H1(p,this.top+w+a,this.bottom-o[0].height),line:0},Fl(this.ctx,t.textDirection);const T=R+a;this.legendItems.forEach((d,I)=>{i.strokeStyle=d.fontColor,i.fillStyle=d.fontColor;const D=i.measureText(d.text).width,J=s.textAlign(d.textAlign||(d.textAlign=M.textAlign)),G=W+u+D;let K=f.x,n0=f.y;s.setWidth(this.width),k?I>0&&K+G+a>this.right&&(n0=f.y+=T,f.line++,K=f.x=H1(p,this.left+a,this.right-n[f.line])):I>0&&n0+T>this.bottom&&(K=f.x=K+o[f.line].width+a,f.line++,n0=f.y=H1(p,this.top+w+a,this.bottom-o[f.line].height));const e0=s.x(K);if(L(e0,n0,d),K=uB(J,K+W+u,k?K+G:this.right,t.rtl),E(s.x(K),n0,d),k)f.x+=G+a;else if(typeof d.text!="string"){const O0=r.lineHeight;f.y+=Ou(d,O0)}else f.y+=T}),Hl(this.ctx,t.textDirection)}drawTitle(){const t=this.options,o=t.title,n=S1(o.font),i=$1(o.padding);if(!o.display)return;const p=ho(t.rtl,this.left,this.width),M=this.ctx,b=o.position,s=n.size/2,r=i.top+s;let a,A=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),a=this.top+r,A=H1(t.align,A,this.right-u);else{const W=this.columnSizes.reduce((_,R)=>Math.max(_,R.height),0);a=r+H1(t.align,this.top,this.bottom-W-t.labels.padding-this._computeTitleHeight())}const f=H1(b,A,A+u);M.textAlign=p.textAlign(Ar(b)),M.textBaseline="middle",M.strokeStyle=o.color,M.fillStyle=o.color,M.font=n.string,D2(M,o.text,f,a,n)}_computeTitleHeight(){const t=this.options.title,o=S1(t.font),n=$1(t.padding);return t.display?o.lineHeight+n.height:0}_getLegendItemAt(t,o){let n,i,p;if(fe(t,this.left,this.right)&&fe(o,this.top,this.bottom)){for(p=this.legendHitBoxes,n=0;np.length>M.length?p:M)),t+o.size/2+n.measureText(i).width}function QE(e,t,o){let n=e;return typeof t.text!="string"&&(n=Ou(t,o)),n}function Ou(e,t){const o=e.text?e.text.length+.5:0;return t*o}function JE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var ZE={id:"legend",_element:KO,start(e,t,o){const n=e.legend=new KO({ctx:e.ctx,options:o,chart:e});j1.configure(e,n,o),j1.addBox(e,n)},stop(e){j1.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,o){const n=e.legend;j1.configure(e,n,o),n.options=o},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,o){const n=t.datasetIndex,i=o.chart;i.isDatasetVisible(n)?(i.hide(n),t.hidden=!0):(i.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:o,pointStyle:n,textAlign:i,color:p,useBorderRadius:M,borderRadius:b}}=e.legend.options;return e._getSortedDatasetMetas().map(s=>{const r=s.controller.getStyle(o?0:void 0),a=$1(r.borderWidth);return{text:t[s.index].label,fillStyle:r.backgroundColor,fontColor:p,hidden:!s.visible,lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:(a.width+a.height)/4,strokeStyle:r.borderColor,pointStyle:n||r.pointStyle,rotation:r.rotation,textAlign:i||r.textAlign,borderRadius:M&&(b||r.borderRadius),datasetIndex:s.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class _r extends Be{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,o){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=o;const i=p1(n.text)?n.text.length:1;this._padding=$1(n.padding);const p=i*S1(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=p:this.width=p}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:o,left:n,bottom:i,right:p,options:M}=this,b=M.align;let s=0,r,a,A;return this.isHorizontal()?(a=H1(b,n,p),A=o+t,r=p-n):(M.position==="left"?(a=n+t,A=H1(b,i,o),s=d1*-.5):(a=p-t,A=H1(b,o,i),s=d1*.5),r=i-o),{titleX:a,titleY:A,maxWidth:r,rotation:s}}draw(){const t=this.ctx,o=this.options;if(!o.display)return;const n=S1(o.font),p=n.lineHeight/2+this._padding.top,{titleX:M,titleY:b,maxWidth:s,rotation:r}=this._drawArgs(p);D2(t,o.text,0,0,n,{color:o.color,maxWidth:s,rotation:r,textAlign:Ar(o.align),textBaseline:"middle",translation:[M,b]})}}function tS(e,t){const o=new _r({ctx:e.ctx,options:t,chart:e});j1.configure(e,o,t),j1.addBox(e,o),e.titleBlock=o}var eS={id:"title",_element:_r,start(e,t,o){tS(e,o)},stop(e){const t=e.titleBlock;j1.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,o){const n=e.titleBlock;j1.configure(e,n,o),n.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const rp=new WeakMap;var oS={id:"subtitle",start(e,t,o){const n=new _r({ctx:e.ctx,options:o,chart:e});j1.configure(e,n,o),j1.addBox(e,n),rp.set(e,n)},stop(e){j1.removeBox(e,rp.get(e)),rp.delete(e)},beforeUpdate(e,t,o){const n=rp.get(e);j1.configure(e,n,o),n.options=o},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const un={average(e){if(!e.length)return!1;let t,o,n=0,i=0,p=0;for(t=0,o=e.length;t-1?e.split(` -`):e}function nS(e,t){const{element:o,datasetIndex:n,index:i}=t,p=e.getDatasetMeta(n).controller,{label:M,value:b}=p.getLabelAndValue(i);return{chart:e,label:M,parsed:p.getParsed(i),raw:e.data.datasets[n].data[i],formattedValue:b,dataset:p.getDataset(),dataIndex:i,datasetIndex:n,element:o}}function QO(e,t){const o=e.chart.ctx,{body:n,footer:i,title:p}=e,{boxWidth:M,boxHeight:b}=t,s=S1(t.bodyFont),r=S1(t.titleFont),a=S1(t.footerFont),A=p.length,u=i.length,f=n.length,W=$1(t.padding);let _=W.height,R=0,L=n.reduce((w,T)=>w+T.before.length+T.lines.length+T.after.length,0);if(L+=e.beforeBody.length+e.afterBody.length,A&&(_+=A*r.lineHeight+(A-1)*t.titleSpacing+t.titleMarginBottom),L){const w=t.displayColors?Math.max(b,s.lineHeight):s.lineHeight;_+=f*w+(L-f)*s.lineHeight+(L-1)*t.bodySpacing}u&&(_+=t.footerMarginTop+u*a.lineHeight+(u-1)*t.footerSpacing);let E=0;const k=function(w){R=Math.max(R,o.measureText(w).width+E)};return o.save(),o.font=r.string,H0(e.title,k),o.font=s.string,H0(e.beforeBody.concat(e.afterBody),k),E=t.displayColors?M+2+t.boxPadding:0,H0(n,w=>{H0(w.before,k),H0(w.lines,k),H0(w.after,k)}),E=0,o.font=a.string,H0(e.footer,k),o.restore(),R+=W.width,{width:R,height:_}}function iS(e,t){const{y:o,height:n}=t;return oe.height-n/2?"bottom":"center"}function pS(e,t,o,n){const{x:i,width:p}=n,M=o.caretSize+o.caretPadding;if(e==="left"&&i+p+M>t.width||e==="right"&&i-p-M<0)return!0}function MS(e,t,o,n){const{x:i,width:p}=o,{width:M,chartArea:{left:b,right:s}}=e;let r="center";return n==="center"?r=i<=(b+s)/2?"left":"right":i<=p/2?r="left":i>=M-p/2&&(r="right"),pS(r,e,t,o)&&(r="center"),r}function JO(e,t,o){const n=o.yAlign||t.yAlign||iS(e,o);return{xAlign:o.xAlign||t.xAlign||MS(e,t,o,n),yAlign:n}}function bS(e,t){let{x:o,width:n}=e;return t==="right"?o-=n:t==="center"&&(o-=n/2),o}function sS(e,t,o){let{y:n,height:i}=e;return t==="top"?n+=o:t==="bottom"?n-=i+o:n-=i/2,n}function ZO(e,t,o,n){const{caretSize:i,caretPadding:p,cornerRadius:M}=e,{xAlign:b,yAlign:s}=o,r=i+p,{topLeft:a,topRight:A,bottomLeft:u,bottomRight:f}=T2(M);let W=bS(t,b);const _=sS(t,s,r);return s==="center"?b==="left"?W+=r:b==="right"&&(W-=r):b==="left"?W-=Math.max(a,u)+i:b==="right"&&(W+=Math.max(A,f)+i),{x:X1(W,0,n.width-t.width),y:X1(_,0,n.height-t.height)}}function zp(e,t,o){const n=$1(o.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function t3(e){return Yt([],re(e))}function cS(e,t,o){return b2(e,{tooltip:t,tooltipItems:o,type:"tooltip"})}function e3(e,t){const o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?e.override(o):e}const du={beforeTitle:se,title(e){if(e.length>0){const t=e[0],o=t.chart.data.labels,n=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex"u"?du[t].call(o,n):i}class Vs extends Be{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const o=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&o.options.animation&&n.animations,p=new $l(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(p)),p}getContext(){return this.$context||(this.$context=cS(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,o){const{callbacks:n}=o,i=it(n,"beforeTitle",this,t),p=it(n,"title",this,t),M=it(n,"afterTitle",this,t);let b=[];return b=Yt(b,re(i)),b=Yt(b,re(p)),b=Yt(b,re(M)),b}getBeforeBody(t,o){return t3(it(o.callbacks,"beforeBody",this,t))}getBody(t,o){const{callbacks:n}=o,i=[];return H0(t,p=>{const M={before:[],lines:[],after:[]},b=e3(n,p);Yt(M.before,re(it(b,"beforeLabel",this,p))),Yt(M.lines,it(b,"label",this,p)),Yt(M.after,re(it(b,"afterLabel",this,p))),i.push(M)}),i}getAfterBody(t,o){return t3(it(o.callbacks,"afterBody",this,t))}getFooter(t,o){const{callbacks:n}=o,i=it(n,"beforeFooter",this,t),p=it(n,"footer",this,t),M=it(n,"afterFooter",this,t);let b=[];return b=Yt(b,re(i)),b=Yt(b,re(p)),b=Yt(b,re(M)),b}_createItems(t){const o=this._active,n=this.chart.data,i=[],p=[],M=[];let b=[],s,r;for(s=0,r=o.length;st.filter(a,A,u,n))),t.itemSort&&(b=b.sort((a,A)=>t.itemSort(a,A,n))),H0(b,a=>{const A=e3(t.callbacks,a);i.push(it(A,"labelColor",this,a)),p.push(it(A,"labelPointStyle",this,a)),M.push(it(A,"labelTextColor",this,a))}),this.labelColors=i,this.labelPointStyles=p,this.labelTextColors=M,this.dataPoints=b,b}update(t,o){const n=this.options.setContext(this.getContext()),i=this._active;let p,M=[];if(!i.length)this.opacity!==0&&(p={opacity:0});else{const b=un[n.position].call(this,i,this._eventPosition);M=this._createItems(n),this.title=this.getTitle(M,n),this.beforeBody=this.getBeforeBody(M,n),this.body=this.getBody(M,n),this.afterBody=this.getAfterBody(M,n),this.footer=this.getFooter(M,n);const s=this._size=QO(this,n),r=Object.assign({},b,s),a=JO(this.chart,n,r),A=ZO(n,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,p={opacity:1,x:A.x,y:A.y,width:s.width,height:s.height,caretX:b.x,caretY:b.y}}this._tooltipItems=M,this.$context=void 0,p&&this._resolveAnimations().update(this,p),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(t,o,n,i){const p=this.getCaretPosition(t,n,i);o.lineTo(p.x1,p.y1),o.lineTo(p.x2,p.y2),o.lineTo(p.x3,p.y3)}getCaretPosition(t,o,n){const{xAlign:i,yAlign:p}=this,{caretSize:M,cornerRadius:b}=n,{topLeft:s,topRight:r,bottomLeft:a,bottomRight:A}=T2(b),{x:u,y:f}=t,{width:W,height:_}=o;let R,L,E,k,w,T;return p==="center"?(w=f+_/2,i==="left"?(R=u,L=R-M,k=w+M,T=w-M):(R=u+W,L=R+M,k=w-M,T=w+M),E=R):(i==="left"?L=u+Math.max(s,a)+M:i==="right"?L=u+W-Math.max(r,A)-M:L=this.caretX,p==="top"?(k=f,w=k-M,R=L-M,E=L+M):(k=f+_,w=k+M,R=L+M,E=L-M),T=k),{x1:R,x2:L,x3:E,y1:k,y2:w,y3:T}}drawTitle(t,o,n){const i=this.title,p=i.length;let M,b,s;if(p){const r=ho(n.rtl,this.x,this.width);for(t.x=zp(this,n.titleAlign,n),o.textAlign=r.textAlign(n.titleAlign),o.textBaseline="middle",M=S1(n.titleFont),b=n.titleSpacing,o.fillStyle=n.titleColor,o.font=M.string,s=0;sk!==0)?(t.beginPath(),t.fillStyle=p.multiKeyBackground,Zn(t,{x:R,y:_,w:r,h:s,radius:E}),t.fill(),t.stroke(),t.fillStyle=M.backgroundColor,t.beginPath(),Zn(t,{x:L,y:_+1,w:r-2,h:s-2,radius:E}),t.fill()):(t.fillStyle=p.multiKeyBackground,t.fillRect(R,_,r,s),t.strokeRect(R,_,r,s),t.fillStyle=M.backgroundColor,t.fillRect(L,_+1,r-2,s-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,o,n){const{body:i}=this,{bodySpacing:p,bodyAlign:M,displayColors:b,boxHeight:s,boxWidth:r,boxPadding:a}=n,A=S1(n.bodyFont);let u=A.lineHeight,f=0;const W=ho(n.rtl,this.x,this.width),_=function(D){o.fillText(D,W.x(t.x+f),t.y+u/2),t.y+=u+p},R=W.textAlign(M);let L,E,k,w,T,d,I;for(o.textAlign=M,o.textBaseline="middle",o.font=A.string,t.x=zp(this,R,n),o.fillStyle=n.bodyColor,H0(this.beforeBody,_),f=b&&R!=="right"?M==="center"?r/2+a:r+2+a:0,w=0,d=i.length;w0&&o.stroke()}_updateAnimationTarget(t){const o=this.chart,n=this.$animations,i=n&&n.x,p=n&&n.y;if(i||p){const M=un[t.position].call(this,this._active,this._eventPosition);if(!M)return;const b=this._size=QO(this,t),s=Object.assign({},M,this._size),r=JO(o,t,s),a=ZO(t,s,r,o);(i._to!==a.x||p._to!==a.y)&&(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=b.width,this.height=b.height,this.caretX=M.x,this.caretY=M.y,this._resolveAnimations().update(this,a))}}_willRender(){return!!this.opacity}draw(t){const o=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(o);const i={width:this.width,height:this.height},p={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const M=$1(o.padding),b=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&b&&(t.save(),t.globalAlpha=n,this.drawBackground(p,t,i,o),Fl(t,o.textDirection),p.y+=M.top,this.drawTitle(p,t,o),this.drawBody(p,t,o),this.drawFooter(p,t,o),Hl(t,o.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,o){const n=this._active,i=t.map(({datasetIndex:b,index:s})=>{const r=this.chart.getDatasetMeta(b);if(!r)throw new Error("Cannot find a dataset at index "+b);return{datasetIndex:b,element:r.data[s],index:s}}),p=!pM(n,i),M=this._positionChanged(i,o);(p||M)&&(this._active=i,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,o,n=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,p=this._active||[],M=this._getActiveElements(t,p,o,n),b=this._positionChanged(M,t),s=o||!pM(M,p)||b;return s&&(this._active=M,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,o))),s}_getActiveElements(t,o,n,i){const p=this.options;if(t.type==="mouseout")return[];if(!i)return o;const M=this.chart.getElementsAtEventForMode(t,p.mode,p,n);return p.reverse&&M.reverse(),M}_positionChanged(t,o){const{caretX:n,caretY:i,options:p}=this,M=un[p.position].call(this,t,o);return M!==!1&&(n!==M.x||i!==M.y)}}a0(Vs,"positioners",un);var rS={id:"tooltip",_element:Vs,positioners:un,afterInit(e,t,o){o&&(e.tooltip=new Vs({chart:e,options:o}))},beforeUpdate(e,t,o){e.tooltip&&e.tooltip.initialize(o)},reset(e,t,o){e.tooltip&&e.tooltip.initialize(o)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const o={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",o)}},afterEvent(e,t){if(e.tooltip){const o=t.replay;e.tooltip.handleEvent(t.event,o,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:du},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},zS=Object.freeze({__proto__:null,Colors:_E,Decimation:yE,Filler:$E,Legend:ZE,SubTitle:oS,Title:eS,Tooltip:rS});const aS=(e,t,o,n)=>(typeof t=="string"?(o=e.push(t)-1,n.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function OS(e,t,o,n){const i=e.indexOf(t);if(i===-1)return aS(e,t,o,n);const p=e.lastIndexOf(t);return i!==p?o:i}const dS=(e,t)=>e===null?null:X1(Math.round(e),0,t);function o3(e){const t=this.getLabels();return e>=0&&eo.length-1?null:this.getPixelForValue(o[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}a0(Ks,"id","category"),a0(Ks,"defaults",{ticks:{callback:o3}});function AS(e,t){const o=[],{bounds:i,step:p,min:M,max:b,precision:s,count:r,maxTicks:a,maxDigits:A,includeBounds:u}=e,f=p||1,W=a-1,{min:_,max:R}=t,L=!k0(M),E=!k0(b),k=!k0(r),w=(R-_)/(A+1);let T=Ja((R-_)/W/f)*f,d,I,D,J;if(T<1e-14&&!L&&!E)return[{value:_},{value:R}];J=Math.ceil(R/T)-Math.floor(_/T),J>W&&(T=Ja(J*T/W/f)*f),k0(s)||(d=Math.pow(10,s),T=Math.ceil(T*d)/d),i==="ticks"?(I=Math.floor(_/T)*T,D=Math.ceil(R/T)*T):(I=_,D=R),L&&E&&p&&rB((b-M)/p,T/1e3)?(J=Math.round(Math.min((b-M)/T,a)),T=(b-M)/J,I=M,D=b):k?(I=L?M:I,D=E?b:D,J=r-1,T=(D-I)/J):(J=(D-I)/T,En(J,Math.round(J),T/1e3)?J=Math.round(J):J=Math.ceil(J));const G=Math.max(Za(T),Za(I));d=Math.pow(10,k0(s)?G:s),I=Math.round(I*d)/d,D=Math.round(D*d)/d;let K=0;for(L&&(u&&I!==M?(o.push({value:M}),Ii=o?i:s,b=s=>p=n?p:s;if(t){const s=Zt(i),r=Zt(p);s<0&&r<0?b(0):s>0&&r>0&&M(0)}if(i===p){let s=p===0?1:Math.abs(p*.05);b(p+s),t||M(i-s)}this.min=i,this.max=p}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:o,stepSize:n}=t,i;return n?(i=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),o=o||11),o&&(i=Math.min(o,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,o=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},p=this._range||this,M=AS(i,p);return t.bounds==="ticks"&&_l(M,this,"value"),t.reverse?(M.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),M}configure(){const t=this.ticks;let o=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-o)/Math.max(t.length-1,1)/2;o-=i,n+=i}this._startValue=o,this._endValue=n,this._valueRange=n-o}getLabelForValue(t){return qi(t,this.chart.options.locale,this.options.ticks.format)}}class Qs extends OM{determineDataLimits(){const{min:t,max:o}=this.getMinMax(!0);this.min=f1(t)?t:0,this.max=f1(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),o=t?this.width:this.height,n=Ct(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,p=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,p.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}a0(Qs,"id","linear"),a0(Qs,"defaults",{ticks:{callback:YM.formatters.numeric}});const ei=e=>Math.floor(Fe(e)),h2=(e,t)=>Math.pow(10,ei(e)+t);function i3(e){return e/Math.pow(10,ei(e))===1}function p3(e,t,o){const n=Math.pow(10,o),i=Math.floor(e/n);return Math.ceil(t/n)-i}function lS(e,t){const o=t-e;let n=ei(o);for(;p3(e,t,n)>10;)n++;for(;p3(e,t,n)<10;)n--;return Math.min(n,ei(e))}function uS(e,{min:t,max:o}){t=dt(e.min,t);const n=[],i=ei(t);let p=lS(t,o),M=p<0?Math.pow(10,Math.abs(p)):1;const b=Math.pow(10,p),s=i>p?Math.pow(10,i):0,r=Math.round((t-s)*M)/M,a=Math.floor((t-s)/b/10)*b*10;let A=Math.floor((r-a)/Math.pow(10,p)),u=dt(e.min,Math.round((s+a+A*Math.pow(10,p))*M)/M);for(;u=10?A=A<15?15:20:A++,A>=20&&(p++,A=2,M=p>=0?1:M),u=Math.round((s+a+A*Math.pow(10,p))*M)/M;const f=dt(e.max,u);return n.push({value:f,major:i3(f),significand:A}),n}class Js extends H2{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,o){const n=OM.prototype.parse.apply(this,[t,o]);if(n===0){this._zero=!0;return}return f1(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:o}=this.getMinMax(!0);this.min=f1(t)?Math.max(0,t):null,this.max=f1(o)?Math.max(0,o):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!f1(this._userMin)&&(this.min=t===h2(this.min,0)?h2(this.min,-1):h2(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:o}=this.getUserBounds();let n=this.min,i=this.max;const p=b=>n=t?n:b,M=b=>i=o?i:b;n===i&&(n<=0?(p(1),M(10)):(p(h2(n,-1)),M(h2(i,1)))),n<=0&&p(h2(i,-1)),i<=0&&M(h2(n,1)),this.min=n,this.max=i}buildTicks(){const t=this.options,o={min:this._userMin,max:this._userMax},n=uS(o,this);return t.bounds==="ticks"&&_l(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":qi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Fe(t),this._valueRange=Fe(this.max)-Fe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Fe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const o=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+o*this._valueRange)}}a0(Js,"id","logarithmic"),a0(Js,"defaults",{ticks:{callback:YM.formatters.logarithmic,major:{enabled:!0}}});function Zs(e){const t=e.ticks;if(t.display&&e.display){const o=$1(t.backdropPadding);return B0(t.font&&t.font.size,W1.font.size)+o.height}return 0}function fS(e,t,o){return o=p1(o)?o:[o],{w:yB(e,t.string,o),h:o.length*t.lineHeight}}function M3(e,t,o,n,i){return e===n||e===i?{start:t-o/2,end:t+o/2}:ei?{start:t-o,end:t}:{start:t,end:t+o}}function qS(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},o=Object.assign({},t),n=[],i=[],p=e._pointLabels.length,M=e.options.pointLabels,b=M.centerPointLabels?d1/p:0;for(let s=0;st.r&&(b=(n.end-t.r)/p,e.r=Math.max(e.r,t.r+b)),i.startt.b&&(s=(i.end-t.b)/M,e.b=Math.max(e.b,t.b+s))}function WS(e,t,o){const n=[],i=e._pointLabels.length,p=e.options,M=Zs(p)/2,b=e.drawingArea,s=p.pointLabels.centerPointLabels?d1/i:0;for(let r=0;r270||o<90)&&(e-=t),e}function RS(e,t){const{ctx:o,options:{pointLabels:n}}=e;for(let i=t-1;i>=0;i--){const p=n.setContext(e.getPointLabelContext(i)),M=S1(p.font),{x:b,y:s,textAlign:r,left:a,top:A,right:u,bottom:f}=e._pointLabelItems[i],{backdropColor:W}=p;if(!k0(W)){const _=T2(p.borderRadius),R=$1(p.backdropPadding);o.fillStyle=W;const L=a-R.left,E=A-R.top,k=u-a+R.width,w=f-A+R.height;Object.values(_).some(T=>T!==0)?(o.beginPath(),Zn(o,{x:L,y:E,w:k,h:w,radius:_}),o.fill()):o.fillRect(L,E,k,w)}D2(o,e._pointLabels[i],b,s+M.lineHeight/2,M,{color:p.color,textAlign:r,textBaseline:"middle"})}}function Au(e,t,o,n){const{ctx:i}=e;if(o)i.arc(e.xCenter,e.yCenter,t,0,M1);else{let p=e.getPointPosition(0,t);i.moveTo(p.x,p.y);for(let M=1;M{const i=n1(this.options.pointLabels.callback,[o,n],this);return i||i===0?i:""}).filter((o,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?qS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,o,n,i){this.xCenter+=Math.floor((t-o)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,o,n,i))}getIndexAngle(t){const o=M1/(this._pointLabels.length||1),n=this.options.startAngle||0;return At(t*o+Ct(n))}getDistanceFromCenterForValue(t){if(k0(t))return NaN;const o=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*o:(t-this.min)*o}getValueForDistanceFromCenter(t){if(k0(t))return NaN;const o=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-o:this.min+o}getPointLabelContext(t){const o=this._pointLabels||[];if(t>=0&&t{if(A!==0){s=this.getDistanceFromCenterForValue(a.value);const u=this.getContext(A),f=i.setContext(u),W=p.setContext(u);LS(this,f,s,M,W)}}),n.display){for(t.save(),b=M-1;b>=0;b--){const a=n.setContext(this.getPointLabelContext(b)),{color:A,lineWidth:u}=a;!u||!A||(t.lineWidth=u,t.strokeStyle=A,t.setLineDash(a.borderDash),t.lineDashOffset=a.borderDashOffset,s=this.getDistanceFromCenterForValue(o.ticks.reverse?this.min:this.max),r=this.getPointPosition(b,s),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(r.x,r.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,o=this.options,n=o.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let p,M;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((b,s)=>{if(s===0&&!o.reverse)return;const r=n.setContext(this.getContext(s)),a=S1(r.font);if(p=this.getDistanceFromCenterForValue(this.ticks[s].value),r.showLabelBackdrop){t.font=a.string,M=t.measureText(b.label).width,t.fillStyle=r.backdropColor;const A=$1(r.backdropPadding);t.fillRect(-M/2-A.left,-p-a.size/2-A.top,M+A.width,a.size+A.height)}D2(t,b.label,0,-p,a,{color:r.color})}),t.restore()}drawTitle(){}}a0(fn,"id","radialLinear"),a0(fn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:YM.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),a0(fn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),a0(fn,"descriptors",{angleLines:{_fallback:"grid"}});const KM={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}},bt=Object.keys(KM);function NS(e,t){return e-t}function b3(e,t){if(k0(t))return null;const o=e._adapter,{parser:n,round:i,isoWeekday:p}=e._parseOpts;let M=t;return typeof n=="function"&&(M=n(M)),f1(M)||(M=typeof n=="string"?o.parse(M,n):o.parse(M)),M===null?null:(i&&(M=i==="week"&&(xo(p)||p===!0)?o.startOf(M,"isoWeek",p):o.startOf(M,i)),+M)}function s3(e,t,o,n){const i=bt.length;for(let p=bt.indexOf(e);p=bt.indexOf(o);p--){const M=bt[p];if(KM[M].common&&e._adapter.diff(i,n,M)>=t-1)return M}return bt[o?bt.indexOf(o):0]}function vS(e){for(let t=bt.indexOf(e)+1,o=bt.length;t=t?o[n]:o[i];e[p]=!0}}function TS(e,t,o,n){const i=e._adapter,p=+i.startOf(t[0].value,n),M=t[t.length-1].value;let b,s;for(b=p;b<=M;b=+i.add(b,1,n))s=o[b],s>=0&&(t[s].major=!0);return t}function r3(e,t,o){const n=[],i={},p=t.length;let M,b;for(M=0;M+t.value))}initOffsets(t=[]){let o=0,n=0,i,p;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?o=1-i:o=(this.getDecimalForValue(t[1])-i)/2,p=this.getDecimalForValue(t[t.length-1]),t.length===1?n=p:n=(p-this.getDecimalForValue(t[t.length-2]))/2);const M=t.length<3?.5:.25;o=X1(o,0,M),n=X1(n,0,M),this._offsets={start:o,end:n,factor:1/(o+1+n)}}_generate(){const t=this._adapter,o=this.min,n=this.max,i=this.options,p=i.time,M=p.unit||s3(p.minUnit,o,n,this._getLabelCapacity(o)),b=B0(i.ticks.stepSize,1),s=M==="week"?p.isoWeekday:!1,r=xo(s)||s===!0,a={};let A=o,u,f;if(r&&(A=+t.startOf(A,"isoWeek",s)),A=+t.startOf(A,r?"day":M),t.diff(n,o,M)>1e5*b)throw new Error(o+" and "+n+" are too far apart with stepSize of "+b+" "+M);const W=i.ticks.source==="data"&&this.getDataTimestamps();for(u=A,f=0;u_-R).map(_=>+_)}getLabelForValue(t){const o=this._adapter,n=this.options.time;return n.tooltipFormat?o.format(t,n.tooltipFormat):o.format(t,n.displayFormats.datetime)}format(t,o){const i=this.options.time.displayFormats,p=this._unit,M=o||i[p];return this._adapter.format(t,M)}_tickFormatFunction(t,o,n,i){const p=this.options,M=p.ticks.callback;if(M)return n1(M,[t,o,n],this);const b=p.time.displayFormats,s=this._unit,r=this._majorUnit,a=s&&b[s],A=r&&b[r],u=n[o],f=r&&A&&u&&u.major;return this._adapter.format(t,i||(f?A:a))}generateTickLabels(t){let o,n,i;for(o=0,n=t.length;o0?b:1}getDataTimestamps(){let t=this._cache.data||[],o,n;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(o=0,n=i.length;o=e[n].pos&&t<=e[i].pos&&({lo:n,hi:i}=qe(e,"pos",t)),{pos:p,time:b}=e[n],{pos:M,time:s}=e[i]):(t>=e[n].time&&t<=e[i].time&&({lo:n,hi:i}=qe(e,"time",t)),{time:p,pos:b}=e[n],{time:M,pos:s}=e[i]);const r=M-p;return r?b+(s-b)*(t-p)/r:b}class tc extends oi{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(t);this._minPos=ap(o,this.min),this._tableRange=ap(o,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:o,max:n}=this,i=[],p=[];let M,b,s,r,a;for(M=0,b=t.length;M=o&&r<=n&&i.push(r);if(i.length<2)return[{time:o,pos:0},{time:n,pos:1}];for(M=0,b=i.length;M",{value:r0.tz.guess(),text:`Local (${r0.tz.guess()})`})),C.ajax({url:"https://apis.devinbaeten.com/timezones",type:"GET",crossDomain:!0,dataType:"json",success:function(e){C.each(e,function(t,o){C("#timezoneSelect").append(C("