var ar=Object.defineProperty;var lr=(vt,nt,G)=>nt in vt?ar(vt,nt,{enumerable:!0,configurable:!0,writable:!0,value:G}):vt[nt]=G;var R=(vt,nt,G)=>(lr(vt,typeof nt!="symbol"?nt+"":nt,G),G);(self.webpackChunk=self.webpackChunk||[]).push([["contributors-graph-code-frequency-graph-recent-commits-graph"],{"./node_modules/dayjs/plugin/advancedFormat.js":function(vt){(function(nt,G){vt.exports=G()})(this,function(){"use strict";return function(nt,G){var d=G.prototype,W=d.format;d.format=function(X){var Q=this,ut=this.$locale();if(!this.isValid())return W.bind(this)(X);var j=this.$utils(),at=(X||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(K){switch(K){case"Q":return Math.ceil((Q.$M+1)/3);case"Do":return ut.ordinal(Q.$D);case"gggg":return Q.weekYear();case"GGGG":return Q.isoWeekYear();case"wo":return ut.ordinal(Q.week(),"W");case"w":case"ww":return j.s(Q.week(),K==="w"?1:2,"0");case"W":case"WW":return j.s(Q.isoWeek(),K==="W"?1:2,"0");case"k":case"kk":return j.s(String(Q.$H===0?24:Q.$H),K==="k"?1:2,"0");case"X":return Math.floor(Q.$d.getTime()/1e3);case"x":return Q.$d.getTime();case"z":return"["+Q.offsetName()+"]";case"zzz":return"["+Q.offsetName("long")+"]";default:return K}});return W.bind(this)(at)}}})},"./node_modules/dayjs/plugin/customParseFormat.js":function(vt){(function(nt,G){vt.exports=G()})(this,function(){"use strict";var nt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},G=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,d=/\d\d/,W=/\d\d?/,X=/\d*[^-_:/,()\s\d]+/,Q={},ut=function(z){return(z=+z)+(z>68?1900:2e3)},j=function(z){return function(q){this[z]=+q}},at=[/[+-]\d\d:?(\d\d)?|Z/,function(z){(this.zone||(this.zone={})).offset=function(q){if(!q||q==="Z")return 0;var ct=q.match(/([+-]|\d\d)/g),ht=60*ct[1]+(+ct[2]||0);return ht===0?0:ct[0]==="+"?-ht:ht}(z)}],K=function(z){var q=Q[z];return q&&(q.indexOf?q:q.s.concat(q.f))},lt=function(z,q){var ct,ht=Q.meridiem;if(ht){for(var Pt=1;Pt<=24;Pt+=1)if(z.indexOf(ht(Pt,0,q))>-1){ct=Pt>12;break}}else ct=z===(q?"pm":"PM");return ct},et={A:[X,function(z){this.afternoon=lt(z,!1)}],a:[X,function(z){this.afternoon=lt(z,!0)}],S:[/\d/,function(z){this.milliseconds=100*+z}],SS:[d,function(z){this.milliseconds=10*+z}],SSS:[/\d{3}/,function(z){this.milliseconds=+z}],s:[W,j("seconds")],ss:[W,j("seconds")],m:[W,j("minutes")],mm:[W,j("minutes")],H:[W,j("hours")],h:[W,j("hours")],HH:[W,j("hours")],hh:[W,j("hours")],D:[W,j("day")],DD:[d,j("day")],Do:[X,function(z){var q=Q.ordinal,ct=z.match(/\d+/);if(this.day=ct[0],q)for(var ht=1;ht<=31;ht+=1)q(ht).replace(/\[|\]/g,"")===z&&(this.day=ht)}],M:[W,j("month")],MM:[d,j("month")],MMM:[X,function(z){var q=K("months"),ct=(K("monthsShort")||q.map(function(ht){return ht.slice(0,3)})).indexOf(z)+1;if(ct<1)throw new Error;this.month=ct%12||ct}],MMMM:[X,function(z){var q=K("months").indexOf(z)+1;if(q<1)throw new Error;this.month=q%12||q}],Y:[/[+-]?\d+/,j("year")],YY:[d,function(z){this.year=ut(z)}],YYYY:[/\d{4}/,j("year")],Z:at,ZZ:at};function ft(z){var q,ct;q=z,ct=Q&&Q.formats;for(var ht=(z=q.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Tt,jt,Dt){var xt=Dt&&Dt.toUpperCase();return jt||ct[Dt]||nt[Dt]||ct[xt].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Vt,N,tt){return N||tt.slice(1)})})).match(G),Pt=ht.length,Bt=0;Bt-1)return new Date((wt==="X"?1e3:1)*st);var ot=ft(wt)(st),Lt=ot.year,Ht=ot.month,we=ot.day,Et=ot.hours,ne=ot.minutes,he=ot.seconds,Qt=ot.milliseconds,Nt=ot.zone,qt=new Date,St=we||(Lt||Ht?1:qt.getDate()),$t=Lt||qt.getFullYear(),Rt=0;Lt&&!Ht||(Rt=Ht>0?Ht-1:qt.getMonth());var Yt=Et||0,Mt=ne||0,Se=he||0,Zt=Qt||0;return Nt?new Date(Date.UTC($t,Rt,St,Yt,Mt,Se,Zt+60*Nt.offset*1e3)):bt?new Date(Date.UTC($t,Rt,St,Yt,Mt,Se,Zt)):new Date($t,Rt,St,Yt,Mt,Se,Zt)}catch{return new Date("")}}(Kt,At,Gt),this.init(),xt&&xt!==!0&&(this.$L=this.locale(xt).$L),Dt&&Kt!=this.format(At)&&(this.$d=new Date("")),Q={}}else if(At instanceof Array)for(var Vt=At.length,N=1;N<=Vt;N+=1){Wt[1]=At[N-1];var tt=ct.apply(this,Wt);if(tt.isValid()){this.$d=tt.$d,this.$L=tt.$L,this.init();break}N===Vt&&(this.$d=new Date(""))}else Pt.call(this,Bt)}}})},"./node_modules/dayjs/plugin/isoWeek.js":function(vt){(function(nt,G){vt.exports=G()})(this,function(){"use strict";var nt="day";return function(G,d,W){var X=function(j){return j.add(4-j.isoWeekday(),nt)},Q=d.prototype;Q.isoWeekYear=function(){return X(this).year()},Q.isoWeek=function(j){if(!this.$utils().u(j))return this.add(7*(j-this.isoWeek()),nt);var at,K,lt,et,ft=X(this),z=(at=this.isoWeekYear(),K=this.$u,lt=(K?W.utc:W)().year(at).startOf("year"),et=4-lt.isoWeekday(),lt.isoWeekday()>4&&(et+=7),lt.add(et,nt));return ft.diff(z,"week")+1},Q.isoWeekday=function(j){return this.$utils().u(j)?this.day()||7:this.day(this.day()%7?j:j-7)};var ut=Q.startOf;Q.startOf=function(j,at){var K=this.$utils(),lt=!!K.u(at)||at;return K.p(j)==="isoweek"?lt?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):ut.bind(this)(j,at)}}})},"./node_modules/dayjs/plugin/localizedFormat.js":function(vt){(function(nt,G){vt.exports=G()})(this,function(){"use strict";var nt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(G,d,W){var X=d.prototype,Q=X.format;W.en.formats=nt,X.format=function(ut){ut===void 0&&(ut="YYYY-MM-DDTHH:mm:ssZ");var j=this.$locale().formats,at=function(K,lt){return K.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(et,ft,z){var q=z&&z.toUpperCase();return ft||lt[z]||nt[z]||lt[q].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(ct,ht,Pt){return ht||Pt.slice(1)})})}(ut,j===void 0?{}:j);return Q.call(this,at)}}})},"./node_modules/dayjs/plugin/quarterOfYear.js":function(vt){(function(nt,G){vt.exports=G()})(this,function(){"use strict";var nt="month",G="quarter";return function(d,W){var X=W.prototype;X.quarter=function(j){return this.$utils().u(j)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(j-1))};var Q=X.add;X.add=function(j,at){return j=Number(j),this.$utils().p(at)===G?this.add(3*j,nt):Q.bind(this)(j,at)};var ut=X.startOf;X.startOf=function(j,at){var K=this.$utils(),lt=!!K.u(at)||at;if(K.p(j)===G){var et=this.quarter()-1;return lt?this.month(3*et).startOf(nt).startOf("day"):this.month(3*et+2).endOf(nt).endOf("day")}return ut.bind(this)(j,at)}}})},"./node_modules/chart.js/dist/chart.js":function(vt,nt,G){"use strict";G.d(nt,{A6:function(){return Yt},E8:function(){return pe},FN:function(){return Re},No:function(){return le},UA:function(){return fi},ZT:function(){return Pe},dN:function(){return pt},hE:function(){return co},ij:function(){return bi},kc:function(){return jn},m_:function(){return bo},s$:function(){return Fn},t1:function(){return fe}});var d=G("./node_modules/chart.js/dist/chunks/helpers.segment.js");class W{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],a=e.duration;o.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=d.r.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,l=!1,h;for(;a>=0;--a)h=o[a],h._active?(h._total>i.duration&&(i.duration=h._total),h.tick(t),l=!0):(o[a]=o[o.length-1],o.pop());l&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var X=new W;const Q="transparent",ut={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=(0,d.c)(s||Q),n=i.valid&&(0,d.c)(t||Q);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class j{constructor(t,e,i,n){const o=e[i];n=(0,d.a)([t.to,n,o,t.from]);const a=(0,d.a)([t.from,o,n]);this._active=!0,this._fn=t.fn||ut[t.type||typeof a],this._easing=d.e[t.easing]||d.e.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=(0,d.a)([t.to,e,n,t.from]),this._from=(0,d.a)([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,a=this._loop,l=this._to;let h;if(this._active=o!==l&&(a||e1?2-h:h,h=this._easing(Math.min(1,Math.max(0,h))),this._target[n]=this._fn(o,l,h)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n{const o=t[n];if(!(0,d.i)(o))return;const a={};for(const l of e)a[l]=o[l];((0,d.b)(o.properties)&&o.properties||[n]).forEach(l=>{(l===n||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,e){const i=e.options,n=lt(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&K(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let h;for(h=a.length-1;h>=0;--h){const u=a[h];if(u.charAt(0)==="$")continue;if(u==="options"){n.push(...this._animateOptions(t,e));continue}const p=e[u];let b=o[u];const _=i.get(u);if(b)if(_&&b.active()){b.update(_,p,l);continue}else b.cancel();if(!_||!_.duration){t[u]=p;continue}o[u]=b=new j(_,t,u,p),n.push(b)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return X.add(this._chart,i),!0}}function K(s,t){const e=[],i=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function At(s,t){const{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:l}=i,h=o.axis,u=a.axis,p=Bt(o,a,i),b=t.length;let _;for(let y=0;ye[i].axis===t).shift()}function jt(s,t){return(0,d.j)(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Dt(s,t,e){return(0,d.j)(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function xt(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(const n of t){const o=n._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const Vt=s=>s==="reset"||s==="none",N=(s,t)=>t?s:Object.assign({},s),tt=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:q(e,!0),values:null};class st{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Pt(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&&xt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(b,_,y,M)=>b==="x"?_:b==="r"?M:y,o=e.xAxisID=(0,d.v)(i.xAxisID,Tt(t,"x")),a=e.yAxisID=(0,d.v)(i.yAxisID,Tt(t,"y")),l=e.rAxisID=(0,d.v)(i.rAxisID,Tt(t,"r")),h=e.indexAxis,u=e.iAxisID=n(h,o,a,l),p=e.vAxisID=n(h,a,o,l);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(u),e.vScale=this.getScaleForId(p)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&(0,d.u)(this._data,this),t._stacked&&xt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,d.i)(e))this._data=ht(e);else if(i!==e){if(i){(0,d.u)(i,this);const n=this._cachedMeta;xt(n),n._parsed=[]}e&&Object.isExtensible(e)&&(0,d.l)(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Pt(e.vScale,e),e.stack!==i.stack&&(n=!0,xt(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&At(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:a}=i,l=o.axis;let h=t===0&&e===n.length?!0:i._sorted,u=t>0&&i._parsed[t-1],p,b,_;if(this._parsing===!1)i._parsed=n,i._sorted=!0,_=n;else{(0,d.b)(n[t])?_=this.parseArrayData(i,n,t,e):(0,d.i)(n[t])?_=this.parseObjectData(i,n,t,e):_=this.parsePrimitiveData(i,n,t,e);const y=()=>b[l]===null||u&&b[l]S||b=0;--_)if(!M()){this.updateRangeFromParsed(u,t,y,h);break}}return u}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,a;for(n=0,o=e.length;n=0&&tthis.getContext(i,n,e),S=u.resolveNamedOptions(_,y,M,b);return S.$shared&&(S.$shared=h,o[a]=Object.freeze(N(S,h))),S}_resolveAnimations(t,e,i){const n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,l=o[a];if(l)return l;let h;if(n.options.animation!==!1){const p=this.chart.config,b=p.datasetAnimationScopeKeys(this._type,e),_=p.getOptionScopes(this.getDataset(),b);h=p.createResolver(_,this.getContext(t,i,e))}const u=new at(n,h&&h.animations);return h&&h._cacheable&&(o[a]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Vt(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:a}}updateElement(t,e,i,n){Vt(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Vt(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[l,h,u]of this._syncList)this[l](h,u);this._syncList=[];const n=i.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o{for(u.length+=e,l=u.length-1;l>=a;l--)u[l]=u[l-e]};for(h(o),l=t;ln-o))}return s._cache.$bar}function bt(s){const t=s.iScale,e=wt(t,s.type);let i=t._length,n,o,a,l;const h=()=>{a===32767||a===-32768||((0,d.h)(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(n=0,o=e.length;n0?n[s-1]:null,l=sMath.abs(l)&&(h=l,u=a),t[e.axis]=u,t._custom={barStart:h,barEnd:u,start:n,end:o,min:a,max:l}}function we(s,t,e,i){return(0,d.b)(s)?Ht(s,t,e,i):t[e.axis]=e.parse(s,i),t}function Et(s,t,e,i){const n=s.iScale,o=s.vScale,a=n.getLabels(),l=n===o,h=[];let u,p,b,_;for(u=e,p=e+i;u=e?1:-1)}function Qt(s){let t,e,i,n,o;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.baseh.controller.options.grouped),o=i.options.stacked,a=[],l=h=>{const u=h.controller.getParsed(e),p=u&&u[h.vScale.axis];if((0,d.k)(p)||isNaN(p))return!0};for(const h of n)if(!(e!==void 0&&l(h))&&((o===!1||a.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let o,a;for(o=0,a=e.data.length;o=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:o}=e,a=this.getParsed(t),l=n.getLabelForValue(a.x),h=o.getLabelForValue(a.y),u=a._custom;return{label:i[t]||"",value:"("+l+", "+h+(u?", "+u:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const o=n==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,n),p=a.axis,b=l.axis;for(let _=e;_(0,d.p)(E,l,h,!0)?1:Math.max(L,L*e,A,A*e),M=(E,L,A)=>(0,d.p)(E,l,h,!0)?-1:Math.min(L,L*e,A,A*e),S=y(0,u,b),D=y(d.H,p,_),P=M(d.P,u,b),O=M(d.P+d.H,p,_);i=(S-P)/2,n=(D-O)/2,o=-(S+P)/2,a=-(D+O)/2}return{ratioX:i,ratioY:n,offsetX:o,offsetY:a}}class Zt extends st{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=i;else{let o=h=>+i[h];if((0,d.i)(i[t])){const{key:h="value"}=this._parsing;o=u=>+(0,d.f)(i[u],h)}let a,l;for(a=t,l=t+e;a0&&!isNaN(t)?d.T*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=(0,d.o)(e._parsed[t],i.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,o,a,l,h;if(!t){for(n=0,o=i.data.datasets.length;nt!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),R(Zt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map((o,a)=>{const h=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:h.backgroundColor,strokeStyle:h.borderColor,fontColor:n,lineWidth:h.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Pe extends st{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:l,count:h}=(0,d.q)(e,n,a);this._drawStart=l,this._drawCount=h,(0,d.w)(e)&&(l=0,h=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:u},t),this.updateElements(n,l,h,t)}updateElements(t,e,i,n){const o=n==="reset",{iScale:a,vScale:l,_stacked:h,_dataset:u}=this._cachedMeta,{sharedOptions:p,includeOptions:b}=this._getSharedOptions(e,n),_=a.axis,y=l.axis,{spanGaps:M,segment:S}=this.options,D=(0,d.x)(M)?M:Number.POSITIVE_INFINITY,P=this.chart._animationsDisabled||o||n==="none",O=e+i,E=t.length;let L=e>0&&this.getParsed(e-1);for(let A=0;A=O){I.skip=!0;continue}const B=this.getParsed(A),$=(0,d.k)(B[y]),Z=I[_]=a.getPixelForValue(B[_],A),J=I[y]=o||$?l.getBasePixel():l.getPixelForValue(h?this.applyStack(l,B,h):B[y],A);I.skip=isNaN(Z)||isNaN(J)||$,I.stop=A>0&&Math.abs(B[_]-L[_])>D,S&&(I.parsed=B,I.raw=u.data[A]),b&&(I.options=p||this.resolveDataElementOptions(A,F.active?"active":n)),P||this.updateElement(F,A,I,n),L=B}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}R(Pe,"id","line"),R(Pe,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(Pe,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class re extends st{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=(0,d.o)(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,i,n){return d.y.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(oe.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),l=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,i,n){const o=n==="reset",a=this.chart,h=a.options.animation,u=this._cachedMeta.rScale,p=u.xCenter,b=u.yCenter,_=u.getIndexAngle(0)-.5*d.P;let y=_,M;const S=360/this.countVisibleElements();for(M=0;M{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?(0,d.t)(this.resolveDataElementOptions(t,e).angle||i):0}}R(re,"id","polarArea"),R(re,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(re,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map((o,a)=>{const h=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:h.backgroundColor,strokeStyle:h.borderColor,fontColor:n,lineWidth:h.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Ft extends Zt{}R(Ft,"id","pie"),R(Ft,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class yt extends st{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return d.y.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(i.points=n,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===n.length,options:a};this.updateElement(i,void 0,l,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const o=this._cachedMeta.rScale,a=n==="reset";for(let l=e;l0&&this.getParsed(e-1);for(let L=e;L0&&Math.abs(F[y]-E[y])>P,D&&(I.parsed=F,I.raw=u.data[L]),_&&(I.options=b||this.resolveDataElementOptions(L,A.active?"active":n)),O||this.updateElement(A,L,I,n),E=F}this.updateSharedOptions(b,n,p)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let h=e.length-1;h>=0;--h)l=Math.max(l,e[h].size(this.resolveDataElementOptions(h))/2);return l>0&&l}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,a)/2}}R(De,"id","scatter"),R(De,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),R(De,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Yn=Object.freeze({__proto__:null,BarController:Yt,BubbleController:Mt,DoughnutController:Zt,LineController:Pe,PieController:Ft,PolarAreaController:re,RadarController:yt,ScatterController:De});function It(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class mi{constructor(t){R(this,"options");this.options=t||{}}static override(t){Object.assign(mi.prototype,t)}init(){}formats(){return It()}parse(){return It()}format(){return It()}add(){return It()}diff(){return It()}startOf(){return It()}endOf(){return It()}}var bi={_date:mi};function $n(s,t,e,i){const{controller:n,data:o,_sorted:a}=s,l=n._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&a&&o.length){const h=l._reversePixels?d.A:d.B;if(i){if(n._sharedOptions){const u=o[0],p=typeof u.getRange=="function"&&u.getRange(t);if(p){const b=h(o,t,e-p),_=h(o,t,e+p);return{lo:b.lo,hi:_.hi}}}}else return h(o,t,e)}return{lo:0,hi:o.length-1}}function Ie(s,t,e,i,n){const o=s.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,h=o.length;l{h[a](t[e],n)&&(o.push({element:h,datasetIndex:u,index:p}),l=l||h.inRange(t.x,t.y,n))}),i&&!l?[]:o}var Kn={evaluateInteractionItems:Ie,modes:{index(s,t,e,i){const n=(0,d.z)(t,s),o=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?Oe(s,n,o,i,a):xe(s,n,o,!1,i,a),h=[];return l.length?(s.getSortedVisibleDatasetMetas().forEach(u=>{const p=l[0].index,b=u.data[p];b&&!b.skip&&h.push({element:b,datasetIndex:u.index,index:p})}),h):[]},dataset(s,t,e,i){const n=(0,d.z)(t,s),o=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?Oe(s,n,o,i,a):xe(s,n,o,!1,i,a);if(l.length>0){const h=l[0].datasetIndex,u=s.getDatasetMeta(h).data;l=[];for(let p=0;pe.pos===t)}function Yi(s,t){return s.filter(e=>Gn.indexOf(e.pos)===-1&&e.box.axis===t)}function ze(s,t){return s.sort((e,i)=>{const n=t?i:e,o=t?e:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function xi(s){const t=[];let e,i,n,o,a,l;for(e=0,i=(s||[]).length;eu.box.fullSize),!0),i=ze(Ce(t,"left"),!0),n=ze(Ce(t,"right")),o=ze(Ce(t,"top"),!0),a=ze(Ce(t,"bottom")),l=Yi(t,"x"),h=Yi(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(h).concat(a).concat(l),chartArea:Ce(t,"chartArea"),vertical:i.concat(n).concat(h),horizontal:o.concat(a).concat(l)}}function $i(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function Ui(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function kt(s,t,e,i){const{pos:n,box:o}=e,a=s.maxPadding;if(!(0,d.i)(n)){e.size&&(s[n]-=e.size);const b=i[e.stack]||{size:0,count:1};b.size=Math.max(b.size,e.horizontal?o.height:o.width),e.size=b.size/b.count,s[n]+=e.size}o.getPadding&&Ui(a,o.getPadding());const l=Math.max(0,t.outerWidth-$i(a,s,"left","right")),h=Math.max(0,t.outerHeight-$i(a,s,"top","bottom")),u=l!==s.w,p=h!==s.h;return s.w=l,s.h=h,e.horizontal?{same:u,other:p}:{same:p,other:u}}function Jt(s){const t=s.maxPadding;function e(i){const n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function qn(s,t){const e=t.maxPadding;function i(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return i(s?["left","right"]:["top","bottom"])}function de(s,t,e,i){const n=[];let o,a,l,h,u,p;for(o=0,a=s.length,u=0;o{typeof S.beforeLayout=="function"&&S.beforeLayout()});const p=h.reduce((S,D)=>D.box.options&&D.box.options.display===!1?S:S+1,0)||1,b=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/p,hBoxMaxHeight:a/2}),_=Object.assign({},n);Ui(_,(0,d.E)(i));const y=Object.assign({maxPadding:_,w:o,h:a,x:n.left,y:n.top},n),M=Qn(h.concat(u),b);de(l.fullSize,y,b,M),de(h,y,b,M),de(u,y,b,M)&&de(h,y,b,M),Jt(y),te(l.leftAndTop,y,b,M),y.x+=y.w,y.y+=y.h,te(l.rightAndBottom,y,b,M),s.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},(0,d.F)(l.chartArea,S=>{const D=S.box;Object.assign(D,s.chartArea),D.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class vi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Qe extends vi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ae="$chartjs",Mi={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xi=s=>s===null||s==="";function Zn(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[Ae]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Xi(n)){const o=(0,d.J)(s,"width");o!==void 0&&(s.width=o)}if(Xi(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=(0,d.J)(s,"height");o!==void 0&&(s.height=o)}return s}const Ki=d.K?{passive:!0}:!1;function Jn(s,t,e){s&&s.addEventListener(t,e,Ki)}function ts(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,Ki)}function es(s,t){const e=Mi[s.type]||s.type,{x:i,y:n}=(0,d.z)(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function qe(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function is(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||qe(l.addedNodes,i),a=a&&!qe(l.removedNodes,i);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function ns(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||qe(l.removedNodes,i),a=a&&!qe(l.addedNodes,i);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const ye=new Map;let Gi=0;function se(){const s=window.devicePixelRatio;s!==Gi&&(Gi=s,ye.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Qi(s,t){ye.size||window.addEventListener("resize",se),ye.set(s,t)}function Ze(s){ye.delete(s),ye.size||window.removeEventListener("resize",se)}function ss(s,t,e){const i=s.canvas,n=i&&(0,d.I)(i);if(!n)return;const o=(0,d.L)((l,h)=>{const u=n.clientWidth;e(l,h),u{const h=l[0],u=h.contentRect.width,p=h.contentRect.height;u===0&&p===0||o(u,p)});return a.observe(n),Qi(s,o),a}function Je(s,t,e){e&&e.disconnect(),t==="resize"&&Ze(s)}function ki(s,t,e){const i=s.canvas,n=(0,d.L)(o=>{s.ctx!==null&&e(es(o,s))},s);return Jn(i,t,n),n}class We extends vi{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Zn(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ae])return!1;const i=e[Ae].initial;["height","width"].forEach(o=>{const a=i[o];(0,d.k)(a)?e.removeAttribute(o):e.setAttribute(o,a)});const n=i.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Ae],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:is,detach:ns,resize:ss}[e]||ki;n[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Je,detach:Je,resize:Je}[e]||ts)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return(0,d.G)(t,e,i,n)}isAttached(t){const e=(0,d.I)(t);return!!(e&&e.isConnected)}}function os(s){return!(0,d.M)()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?Qe:We}class ee{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,d.x)(this.x)&&(0,d.x)(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}}R(ee,"defaults",{}),R(ee,"defaultRoutes");function qi(s,t){const e=s.options.ticks,i=rs(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?ls(t):[],a=o.length,l=o[0],h=o[a-1],u=[];if(a>n)return lo(t,u,o,a/n),u;const p=as(o,t,n);if(a>0){let b,_;const y=a>1?Math.round((h-l)/(a-1)):null;for(je(t,u,p,(0,d.k)(y)?0:l-y,l),b=0,_=a-1;b<_;b++)je(t,u,p,o[b],o[b+1]);return je(t,u,p,h,(0,d.k)(y)?t.length:h+y),u}return je(t,u,p),u}function rs(s){const t=s.options.offset,e=s._tickSize(),i=s._length/e+(t?0:1),n=s._maxLength/e;return Math.floor(Math.min(i,n))}function as(s,t,e){const i=cs(s),n=t.length/e;if(!i)return Math.max(n,1);const o=(0,d.N)(i);for(let a=0,l=o.length-1;an)return h}return Math.max(n,1)}function ls(s){const t=[];let e,i;for(e=0,i=s.length;es==="left"?"right":s==="right"?"left":s,Zi=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,Ji=(s,t)=>Math.min(t||s,s);function tn(s,t){const e=[],i=s.length/t,n=s.length;let o=0;for(;oa+l)))return h}function us(s,t){(0,d.F)(s,e=>{const i=e.gc,n=i.length/2;let o;if(n>t){for(o=0;oi?i:e,i=n&&e>i?e:i,{min:(0,d.O)(e,(0,d.O)(i,e)),max:(0,d.O)(i,(0,d.O)(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,d.Q)(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=(0,d.R)(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=l=o||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const p=this._getLabelSizes(),b=p.widest.width,_=p.highest.height,y=(0,d.S)(this.chart.width-b,0,this.maxWidth);l=t.offset?this.maxWidth/i:y/(i-1),b+6>l&&(l=y/(i-(t.offset?.5:1)),h=this.maxHeight-ue(t.grid)-e.padding-wi(t.title,this.chart.options.font),u=Math.sqrt(b*b+_*_),a=(0,d.U)(Math.min(Math.asin((0,d.S)((p.highest.height+6)/l,-1,1)),Math.asin((0,d.S)(h/u,-1,1))-Math.asin((0,d.S)(_/u,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){(0,d.Q)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,d.Q)(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const h=wi(n,e.options.font);if(l?(t.width=this.maxWidth,t.height=ue(o)+h):(t.height=this.maxHeight,t.width=ue(o)+h),i.display&&this.ticks.length){const{first:u,last:p,widest:b,highest:_}=this._getLabelSizes(),y=i.padding*2,M=(0,d.t)(this.labelRotation),S=Math.cos(M),D=Math.sin(M);if(l){const P=i.mirror?0:D*b.width+S*_.height;t.height=Math.min(this.maxHeight,t.height+P+y)}else{const P=i.mirror?0:S*b.width+D*_.height;t.width=Math.min(this.maxWidth,t.width+P+y)}this._calculatePadding(u,p,D,S)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:o,padding:a},position:l}=this.options,h=this.labelRotation!==0,u=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const p=this.getPixelForTick(0)-this.left,b=this.right-this.getPixelForTick(this.ticks.length-1);let _=0,y=0;h?u?(_=n*t.width,y=i*e.height):(_=i*t.height,y=n*e.width):o==="start"?y=e.width:o==="end"?_=t.width:o!=="inner"&&(_=t.width/2,y=e.width/2),this.paddingLeft=Math.max((_-p+a)*this.width/(this.width-p),0),this.paddingRight=Math.max((y-b+a)*this.width/(this.width-b),0)}else{let p=e.height/2,b=t.height/2;o==="start"?(p=0,b=t.height):o==="end"&&(p=e.height,b=0),this.paddingTop=p+a,this.paddingBottom=b+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){(0,d.Q)(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e({width:a[$]||0,height:l[$]||0});return{first:B(0),last:B(e-1),widest:B(F),highest:B(I),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return(0,d.W)(this._alignToPixels?(0,d.X)(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tl*n?l/i:h/n:h*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:a,border:l}=n,h=o.offset,u=this.isHorizontal(),b=this.ticks.length+(h?1:0),_=ue(o),y=[],M=l.setContext(this.getContext()),S=M.display?M.width:0,D=S/2,P=function(mt){return(0,d.X)(i,mt,S)};let O,E,L,A,F,I,B,$,Z,J,it,Ct;if(a==="top")O=P(this.bottom),I=this.bottom-_,$=O-D,J=P(t.top)+D,Ct=t.bottom;else if(a==="bottom")O=P(this.top),J=t.top,Ct=P(t.bottom)-D,I=O+D,$=this.top+_;else if(a==="left")O=P(this.right),F=this.right-_,B=O-D,Z=P(t.left)+D,it=t.right;else if(a==="right")O=P(this.left),Z=t.left,it=P(t.right)-D,F=O+D,B=this.left+_;else if(e==="x"){if(a==="center")O=P((t.top+t.bottom)/2+.5);else if((0,d.i)(a)){const mt=Object.keys(a)[0],_t=a[mt];O=P(this.chart.scales[mt].getPixelForValue(_t))}J=t.top,Ct=t.bottom,I=O+D,$=I+_}else if(e==="y"){if(a==="center")O=P((t.left+t.right)/2);else if((0,d.i)(a)){const mt=Object.keys(a)[0],_t=a[mt];O=P(this.chart.scales[mt].getPixelForValue(_t))}F=O-D,B=F-_,Z=t.left,it=t.right}const ie=(0,d.v)(n.ticks.maxTicksLimit,b),dt=Math.max(1,Math.ceil(b/ie));for(E=0;E0&&(Ke-=Xe/2);break}Nn={left:Ke,top:Hi,width:Xe+pi.width,height:Vi+pi.height,color:dt.backdropColor}}D.push({label:L,font:$,textOffset:it,options:{rotation:S,color:_t,strokeColor:ce,strokeWidth:zt,textAlign:gi,textBaseline:Ct,translation:[A,F],backdrop:Nn}})}return D}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-(0,d.t)(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),l=t+o,h=a.widest.width;let u,p;return e==="left"?n?(p=this.right+o,i==="near"?u="left":i==="center"?(u="center",p+=h/2):(u="right",p+=h)):(p=this.right-l,i==="near"?u="right":i==="center"?(u="center",p-=h/2):(u="left",p=this.left)):e==="right"?n?(p=this.left+o,i==="near"?u="right":i==="center"?(u="center",p-=h/2):(u="left",p-=h)):(p=this.left+l,i==="near"?u="left":i==="center"?(u="center",p+=h/2):(u="right",p=this.right)):u="right",{textAlign:u,x:p}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const l=(h,u,p)=>{!p.width||!p.color||(i.save(),i.lineWidth=p.width,i.strokeStyle=p.color,i.setLineDash(p.borderDash||[]),i.lineDashOffset=p.borderDashOffset,i.beginPath(),i.moveTo(h.x,h.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(e.display)for(o=0,a=n.length;o{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,a;for(o=0,a=e.length;o{const i=e.split("."),n=i.pop(),o=[s].concat(i).join("."),a=t[e].split("."),l=a.pop(),h=a.join(".");d.d.route(o,n,h,l)})}function ms(s){return"id"in s&&"defaults"in s}class nn{constructor(){this.controllers=new ei(st,"datasets",!0),this.elements=new ei(ee,"elements"),this.plugins=new ei(Object,"plugins"),this.scales=new ei(ae,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):(0,d.F)(n,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,i){const n=(0,d.a5)(t);(0,d.Q)(i["before"+n],[],i),e[t](i),(0,d.Q)(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;eo.filter(l=>!a.some(h=>l.plugin.id===h.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function on(s){const t={},e=[],i=Object.keys(oe.plugins.items);for(let o=0;o1&&ni(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function ln(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function Pi(s,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return ln(s,"x",e[0])||ln(s,"y",e[0])}return{}}function ys(s,t){const e=d.a3[s.type]||{scales:{}},i=t.scales||{},n=ii(s.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!(0,d.i)(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const h=si(a,l,Pi(a,s),d.d.scales[l.type]),u=Ve(h,n),p=e.scales||{};o[a]=(0,d.ab)(Object.create(null),[{axis:h},l,p[h],p[u]])}),s.data.datasets.forEach(a=>{const l=a.type||s.type,h=a.indexAxis||ii(l,t),p=(d.a3[l]||{}).scales||{};Object.keys(p).forEach(b=>{const _=an(b,h),y=a[_+"AxisID"]||_;o[y]=o[y]||Object.create(null),(0,d.ab)(o[y],[{axis:_},i[y],p[b]])})}),Object.keys(o).forEach(a=>{const l=o[a];(0,d.ab)(l,[d.d.scales[l.type],d.d.scale])}),o}function cn(s){const t=s.options||(s.options={});t.plugins=(0,d.v)(t.plugins,{}),t.scales=ys(s,t)}function hn(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function vs(s){return s=s||{},s.data=hn(s.data),cn(s),s}const Di=new Map,oi=new Set;function ri(s,t){let e=Di.get(s);return e||(e=t(),Di.set(s,e),oi.add(e)),e}const He=(s,t,e)=>{const i=(0,d.f)(t,e);i!==void 0&&s.add(i)};class Ms{constructor(t){this._config=vs(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=hn(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(),cn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ri(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ri(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ri(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return ri(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,a=this._cachedScopes(t,i),l=a.get(e);if(l)return l;const h=new Set;e.forEach(p=>{t&&(h.add(t),p.forEach(b=>He(h,t,b))),p.forEach(b=>He(h,n,b)),p.forEach(b=>He(h,d.a3[o]||{},b)),p.forEach(b=>He(h,d.d,b)),p.forEach(b=>He(h,d.a6,b))});const u=Array.from(h);return u.length===0&&u.push(Object.create(null)),oi.has(e)&&a.set(e,u),u}chartOptionScopes(){const{options:t,type:e}=this;return[t,d.a3[e]||{},d.d.datasets[e]||{},{type:e},d.d,d.a6]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:l}=dn(this._resolverCache,t,n);let h=a;if(ws(a,e)){o.$shared=!1,i=(0,d.a7)(i)?i():i;const u=this.createResolver(t,i,l);h=(0,d.a8)(a,i,u)}for(const u of e)o[u]=h[u];return o}createResolver(t,e,i=[""],n){const{resolver:o}=dn(this._resolverCache,t,i);return(0,d.i)(e)?(0,d.a8)(o,e,void 0,n):o}}function dn(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));const n=e.join();let o=i.get(n);return o||(o={resolver:(0,d.a9)(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(n,o)),o}const ks=s=>(0,d.i)(s)&&Object.getOwnPropertyNames(s).some(t=>(0,d.a7)(s[t]));function ws(s,t){const{isScriptable:e,isIndexable:i}=(0,d.aa)(s);for(const n of t){const o=e(n),a=i(n),l=(a||o)&&s[n];if(o&&((0,d.a7)(l)||ks(l))||a&&(0,d.b)(l))return!0}return!1}var Ss="4.4.2";const Ps=["top","bottom","left","right","chartArea"];function un(s,t){return s==="top"||s==="bottom"||Ps.indexOf(s)===-1&&t==="x"}function fn(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function gn(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),(0,d.Q)(e&&e.onComplete,[s],t)}function Ds(s){const t=s.chart,e=t.options.animation;(0,d.Q)(e&&e.onProgress,[s],t)}function pn(s){return(0,d.M)()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const Te={},Oi=s=>{const t=pn(s);return Object.values(Te).filter(e=>e.canvas===t).pop()};function Os(s,t,e){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=t){const a=s[n];delete s[n],(e>0||o>t)&&(s[o+e]=a)}}}function Cs(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}function ai(s,t,e){return s.options.clip?s[e]:t[e]}function As(s,t){const{xScale:e,yScale:i}=s;return e&&i?{left:ai(e,t,"left"),right:ai(e,t,"right"),top:ai(i,t,"top"),bottom:ai(i,t,"bottom")}:t}class fe{static register(...t){oe.add(...t),Ci()}static unregister(...t){oe.remove(...t),Ci()}constructor(t,e){const i=this.config=new Ms(e),n=pn(t),o=Oi(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||os(n)),this.platform.updateConfig(i);const l=this.platform.acquireContext(n,a.aspectRatio),h=l&&l.canvas,u=h&&h.height,p=h&&h.width;if(this.id=(0,d.ac)(),this.ctx=l,this.canvas=h,this.width=p,this.height=u,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new sn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,d.ad)(b=>this.update(b),a.resizeDelay||0),this._dataChanges=[],Te[this.id]=this,!l||!h){console.error("Failed to create chart: can't acquire context from the given item");return}X.listen(this,"complete",gn),X.listen(this,"progress",Ds),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return(0,d.k)(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return oe}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,d.ae)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,d.af)(this.canvas,this.ctx),this}stop(){return X.stop(this),this}resize(t,e){X.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,(0,d.ae)(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),(0,d.Q)(i.onResize,[this,a],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};(0,d.F)(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const l=e[a],h=si(a,l),u=h==="r",p=h==="x";return{options:l,dposition:u?"chartArea":p?"bottom":"left",dtype:u?"radialLinear":p?"category":"linear"}}))),(0,d.F)(o,a=>{const l=a.options,h=l.id,u=si(h,l),p=(0,d.v)(l.type,a.dtype);(l.position===void 0||un(l.position,u)!==un(a.dposition))&&(l.position=a.dposition),n[h]=!0;let b=null;if(h in i&&i[h].type===p)b=i[h];else{const _=oe.getScale(p);b=new _({id:h,type:p,ctx:this.ctx,chart:this}),i[b.id]=b}b.init(l,t)}),(0,d.F)(n,(a,l)=>{a||delete i[l]}),(0,d.F)(i,a=>{gt.configure(this,a,a.options),gt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,o)=>n.index-o.index),i>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let u=0,p=this.data.datasets.length;u{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fn("z","_idx"));const{_active:l,_lastEvent:h}=this;h?this._eventHandler(h,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){(0,d.F)(this.scales,t=>{gt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!(0,d.ag)(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){const a=i==="_removeElements"?-o:o;Os(t,n,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),n=i(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;gt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,d.F)(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,o=As(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(n&&(0,d.Y)(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&(0,d.$)(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return(0,d.C)(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=Kn.modes[e];return typeof o=="function"?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=(0,d.j)(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);(0,d.h)(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(l=>l.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),X.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,a),t[o]=a},n=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};(0,d.F)(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(h,u)=>{e.addEventListener(this,h,u),t[h]=u},n=(h,u)=>{t[h]&&(e.removeEventListener(this,h,u),delete t[h])},o=(h,u)=>{this.canvas&&this.resize(h,u)};let a;const l=()=>{n("attach",l),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){(0,d.F)(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},(0,d.F)(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,a,l,h;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),l=0,h=t.length;l{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!(0,d.ah)(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const n=this.options.hover,o=(h,u)=>h.filter(p=>!u.some(b=>p.datasetIndex===b.datasetIndex&&p.index===b.index)),a=o(e,t),l=i?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),l.length&&n.mode&&this.updateHoverStyle(l,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,a=e,l=this._getActiveElements(t,n,i,a),h=(0,d.ai)(t),u=Cs(t,this._lastEvent,i,h);i&&(this._lastEvent=null,(0,d.Q)(o.onHover,[t,l,this],this),h&&(0,d.Q)(o.onClick,[t,l,this],this));const p=!(0,d.ah)(l,n);return(p||e)&&(this._active=l,this._updateHoverStyles(l,n,e)),this._lastEvent=u,p}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}R(fe,"defaults",d.d),R(fe,"instances",Te),R(fe,"overrides",d.a3),R(fe,"registry",oe),R(fe,"version",Ss),R(fe,"getChart",Oi);function Ci(){return(0,d.F)(fe.instances,s=>s._plugins.invalidate())}function Ai(s,t,e){const{startAngle:i,pixelMargin:n,x:o,y:a,outerRadius:l,innerRadius:h}=t;let u=n/l;s.beginPath(),s.arc(o,a,l,i-u,e+u),h>n?(u=n/h,s.arc(o,a,h,e+u,i-u,!0)):s.arc(o,a,n,e+d.H,i-d.H),s.closePath(),s.clip()}function Ne(s){return(0,d.ak)(s,["outerStart","outerEnd","innerStart","innerEnd"])}function mn(s,t,e,i){const n=Ne(s.options.borderRadius),o=(e-t)/2,a=Math.min(o,i*t/2),l=h=>{const u=(e-Math.min(o,h))*i/2;return(0,d.S)(h,0,Math.min(o,u))};return{outerStart:l(n.outerStart),outerEnd:l(n.outerEnd),innerStart:(0,d.S)(n.innerStart,0,a),innerEnd:(0,d.S)(n.innerEnd,0,a)}}function Le(s,t,e,i){return{x:e+s*Math.cos(t),y:i+s*Math.sin(t)}}function Ee(s,t,e,i,n,o){const{x:a,y:l,startAngle:h,pixelMargin:u,innerRadius:p}=t,b=Math.max(t.outerRadius+i+e-u,0),_=p>0?p+i+e+u:0;let y=0;const M=n-h;if(i){const dt=p>0?p-i:0,mt=b>0?b-i:0,_t=(dt+mt)/2,ce=_t!==0?M*_t/(_t+i):M;y=(M-ce)/2}const S=Math.max(.001,M*b-e/d.P)/b,D=(M-S)/2,P=h+D+y,O=n-D-y,{outerStart:E,outerEnd:L,innerStart:A,innerEnd:F}=mn(t,_,b,O-P),I=b-E,B=b-L,$=P+E/I,Z=O-L/B,J=_+A,it=_+F,Ct=P+A/J,ie=O-F/it;if(s.beginPath(),o){const dt=($+Z)/2;if(s.arc(a,l,b,$,dt),s.arc(a,l,b,dt,Z),L>0){const zt=Le(B,Z,a,l);s.arc(zt.x,zt.y,L,Z,O+d.H)}const mt=Le(it,O,a,l);if(s.lineTo(mt.x,mt.y),F>0){const zt=Le(it,ie,a,l);s.arc(zt.x,zt.y,F,O+d.H,ie+Math.PI)}const _t=(O-F/_+(P+A/_))/2;if(s.arc(a,l,_,O-F/_,_t,!0),s.arc(a,l,_,_t,P+A/_,!0),A>0){const zt=Le(J,Ct,a,l);s.arc(zt.x,zt.y,A,Ct+Math.PI,P-d.H)}const ce=Le(I,P,a,l);if(s.lineTo(ce.x,ce.y),E>0){const zt=Le(I,$,a,l);s.arc(zt.x,zt.y,E,P-d.H,$)}}else{s.moveTo(a,l);const dt=Math.cos($)*b+a,mt=Math.sin($)*b+l;s.lineTo(dt,mt);const _t=Math.cos(Z)*b+a,ce=Math.sin(Z)*b+l;s.lineTo(_t,ce)}s.closePath()}function bn(s,t,e,i,n){const{fullCircles:o,startAngle:a,circumference:l}=t;let h=t.endAngle;if(o){Ee(s,t,e,i,h,n);for(let u=0;u=d.T||(0,d.p)(a,h,u),D=(0,d.aj)(l,p+y,b+y);return S&&D}getCenterPoint(e){const{x:i,y:n,startAngle:o,endAngle:a,innerRadius:l,outerRadius:h}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:u,spacing:p}=this.options,b=(o+a)/2,_=(l+h+p+u)/2;return{x:i+Math.cos(b)*_,y:n+Math.sin(b)*_}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:n}=this,o=(i.offset||0)/4,a=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=n>d.T?Math.floor(n/d.T):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const h=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(h)*o,Math.sin(h)*o);const u=1-Math.sin(Math.min(d.P,n||0)),p=o*u;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,bn(e,this,p,a,l),Ts(e,this,p,a,l),e.restore()}}R(Ye,"id","arc"),R(Ye,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),R(Ye,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(Ye,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function _n(s,t,e=t){s.lineCap=(0,d.v)(e.borderCapStyle,t.borderCapStyle),s.setLineDash((0,d.v)(e.borderDash,t.borderDash)),s.lineDashOffset=(0,d.v)(e.borderDashOffset,t.borderDashOffset),s.lineJoin=(0,d.v)(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=(0,d.v)(e.borderWidth,t.borderWidth),s.strokeStyle=(0,d.v)(e.borderColor,t.borderColor)}function xn(s,t,e){s.lineTo(e.x,e.y)}function Ls(s){return s.stepped?d.ar:s.tension||s.cubicInterpolationMode==="monotone"?d.as:xn}function yn(s,t,e={}){const i=s.length,{start:n=0,end:o=i-1}=e,{start:a,end:l}=t,h=Math.max(n,a),u=Math.min(o,l),p=nl&&o>l;return{count:i,start:h,loop:t.loop,ilen:u(a+(u?l-L:L))%o,E=()=>{S!==D&&(s.lineTo(p,D),s.lineTo(p,S),s.lineTo(p,P))};for(h&&(y=n[O(0)],s.moveTo(y.x,y.y)),_=0;_<=l;++_){if(y=n[O(_)],y.skip)continue;const L=y.x,A=y.y,F=L|0;F===M?(AD&&(D=A),p=(b*p+L)/++b):(E(),s.lineTo(L,A),M=F,b=0,S=D=A),P=A}E()}function Li(s){const t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?vn:Ti}function Es(s){return s.stepped?d.ao:s.tension||s.cubicInterpolationMode==="monotone"?d.ap:d.aq}function Mn(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),_n(s,t.options),s.stroke(n)}function kn(s,t,e,i){const{segments:n,options:o}=t,a=Li(t);for(const l of n)_n(s,o,l.style),s.beginPath(),a(s,t,l,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}const Rs=typeof Path2D=="function";function Fs(s,t,e,i){Rs&&!t.options.segment?Mn(s,t,e,i):kn(s,t,e,i)}class le extends ee{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;(0,d.al)(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=(0,d.am)(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,a=(0,d.an)(this,{property:e,start:n,end:n});if(!a.length)return;const l=[],h=Es(i);let u,p;for(u=0,p=a.length;ut!=="borderDash"&&t!=="fill"});function ve(s,t,e,i){const n=s.options,{[e]:o}=s.getProps([e],i);return Math.abs(t-o)s.replace("rgb(","rgba(").replace(")",", 0.5)"));function me(s){return Ri[s%Ri.length]}function Dn(s){return Pn[s%Pn.length]}function Ws(s,t){return s.borderColor=me(t),s.backgroundColor=Dn(t),++t}function js(s,t){return s.backgroundColor=s.data.map(()=>me(t++)),t}function Vs(s,t){return s.backgroundColor=s.data.map(()=>Dn(t++)),t}function di(s){let t=0;return(e,i)=>{const n=s.getDatasetMeta(i).controller;n instanceof Zt?t=js(e,t):n instanceof re?t=Vs(e,t):n&&(t=Ws(e,t))}}function On(s){let t;for(t in s)if(s[t].borderColor||s[t].backgroundColor)return!0;return!1}function Hs(s){return s&&(s.borderColor||s.backgroundColor)}var Ns={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(s,t,e){if(!e.enabled)return;const{data:{datasets:i},options:n}=s.config,{elements:o}=n;if(!e.forceOverride&&(On(i)||Hs(n)||o&&On(o)))return;const a=di(s);i.forEach(a)}};function Ys(s,t,e,i,n){const o=n.samples||i;if(o>=e)return s.slice(t,t+e);const a=[],l=(e-2)/(o-2);let h=0;const u=t+e-1;let p=t,b,_,y,M,S;for(a[h++]=s[p],b=0;by&&(y=M,_=s[O],S=O);a[h++]=_,p=S}return a[h++]=s[u],a}function Me(s,t,e,i){let n=0,o=0,a,l,h,u,p,b,_,y,M,S;const D=[],P=t+e-1,O=s[t].x,L=s[P].x-O;for(a=t;aS&&(S=u,_=a),n=(o*n+l.x)/++o;else{const F=a-1;if(!(0,d.k)(b)&&!(0,d.k)(_)){const I=Math.min(b,_),B=Math.max(b,_);I!==y&&I!==F&&D.push({...s[I],x:n}),B!==y&&B!==F&&D.push({...s[B],x:n})}a>0&&F!==y&&D.push(s[F]),D.push(l),p=A,o=0,M=S=u,b=_=y=a}}return D}function Cn(s){if(s._decimated){const t=s._data;delete s._decimated,delete s._data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function An(s){s.data.datasets.forEach(t=>{Cn(t)})}function $s(s,t){const e=t.length;let i=0,n;const{iScale:o}=s,{min:a,max:l,minDefined:h,maxDefined:u}=o.getUserBounds();return h&&(i=(0,d.S)((0,d.B)(t,o.axis,a).lo,0,e-1)),u?n=(0,d.S)((0,d.B)(t,o.axis,l).hi+1,i,e)-i:n=e-i,{start:i,count:n}}var Us={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(s,t,e)=>{if(!e.enabled){An(s);return}const i=s.width;s.data.datasets.forEach((n,o)=>{const{_data:a,indexAxis:l}=n,h=s.getDatasetMeta(o),u=a||n.data;if((0,d.a)([l,s.options.indexAxis])==="y"||!h.controller.supportsDecimation)return;const p=s.scales[h.xAxisID];if(p.type!=="linear"&&p.type!=="time"||s.options.parsing)return;let{start:b,count:_}=$s(h,u);const y=e.threshold||4*i;if(_<=y){Cn(n);return}(0,d.k)(a)&&(n._data=u,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(S){this._data=S}}));let M;switch(e.algorithm){case"lttb":M=Ys(u,b,_,i,e);break;case"min-max":M=Me(u,b,_,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=M})},destroy(s){An(s)}};function Xs(s,t,e){const i=s.segments,n=s.points,o=t.points,a=[];for(const l of i){let{start:h,end:u}=l;u=ui(h,u,n);const p=Fi(e,n[h],n[u],l.loop);if(!t.segments){a.push({source:l,target:p,start:n[h],end:n[u]});continue}const b=(0,d.an)(t,p);for(const _ of b){const y=Fi(e,o[_.start],o[_.end],_.loop),M=(0,d.ax)(l,n,y);for(const S of M)a.push({source:S,target:_,start:{[e]:Ii(p,y,"start",Math.max)},end:{[e]:Ii(p,y,"end",Math.min)}})}}return a}function Fi(s,t,e,i){if(i)return;let n=t[s],o=e[s];return s==="angle"&&(n=(0,d.ay)(n),o=(0,d.ay)(o)),{property:s,start:n,end:o}}function Ks(s,t){const{x:e=null,y:i=null}=s||{},n=t.points,o=[];return t.segments.forEach(({start:a,end:l})=>{l=ui(a,l,n);const h=n[a],u=n[l];i!==null?(o.push({x:h.x,y:i}),o.push({x:u.x,y:i})):e!==null&&(o.push({x:e,y:h.y}),o.push({x:e,y:u.y}))}),o}function ui(s,t,e){for(;t>s;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Ii(s,t,e,i){return s&&t?i(s[e],t[e]):s?s[e]:t?t[e]:0}function Tn(s,t){let e=[],i=!1;return(0,d.b)(s)?(i=!0,e=s):e=Ks(s,t),e.length?new le({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function zi(s){return s&&s.fill!==!1}function Gs(s,t,e){let n=s[t].fill;const o=[t];let a;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!(0,d.g)(n))return n;if(a=s[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function Qs(s,t,e){const i=Js(s);if((0,d.i)(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return(0,d.g)(n)&&Math.floor(n)===n?qs(i[0],t,n,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function qs(s,t,e,i){return(s==="-"||s==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Zs(s,t){let e=null;return s==="start"?e=t.bottom:s==="end"?e=t.top:(0,d.i)(s)?e=t.getPixelForValue(s.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Ln(s,t,e){let i;return s==="start"?i=e:s==="end"?i=t.options.reverse?t.min:t.max:(0,d.i)(s)?i=s.value:i=t.getBaseValue(),i}function Js(s){const t=s.options,e=t.fill;let i=(0,d.v)(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function En(s){const{scale:t,index:e,line:i}=s,n=[],o=i.segments,a=i.points,l=to(t,e);l.push(Tn({x:null,y:t.bottom},i));for(let h=0;h=0;--a){const l=n[a].$filler;l&&(l.line.updateControlPoints(o,l.axis),i&&l.fill&&w(s.ctx,l,o))}},beforeDatasetsDraw(s,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=s.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){const o=i[n].$filler;zi(o)&&w(s.ctx,o,s.chartArea)}},beforeDatasetDraw(s,t,e){const i=t.meta.$filler;!zi(i)||e.drawTime!=="beforeDatasetDraw"||w(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const U=(s,t)=>{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},V=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index;class Ot extends ee{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=(0,d.Q)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,n=(0,d.a0)(i.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:h}=U(i,o);let u,p;e.font=n.string,this.isHorizontal()?(u=this.maxWidth,p=this._fitRows(a,o,l,h)+10):(p=this.maxHeight,u=this._fitCols(a,n,l,h)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(p,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:o,maxWidth:a,options:{labels:{padding:l}}}=this,h=this.legendHitBoxes=[],u=this.lineWidths=[0],p=n+l;let b=t;o.textAlign="left",o.textBaseline="middle";let _=-1,y=-p;return this.legendItems.forEach((M,S)=>{const D=i+e/2+o.measureText(M.text).width;(S===0||u[u.length-1]+D+2*l>a)&&(b+=p,u[u.length-(S>0?0:1)]=0,y+=p,_++),h[S]={left:0,top:y,row:_,width:D,height:n},u[u.length-1]+=D+l}),b}_fitCols(t,e,i,n){const{ctx:o,maxHeight:a,options:{labels:{padding:l}}}=this,h=this.legendHitBoxes=[],u=this.columnSizes=[],p=a-t;let b=l,_=0,y=0,M=0,S=0;return this.legendItems.forEach((D,P)=>{const{itemWidth:O,itemHeight:E}=Fe(i,e,o,D,n);P>0&&y+E+2*l>p&&(b+=_+l,u.push({width:_,height:y}),M+=_+l,S++,_=y=0),h[P]={left:M,top:y,col:S,width:O,height:E},_=Math.max(_,O),y+=E+l}),b+=_,u.push({width:_,height:y}),b}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,a=(0,d.az)(o,this.left,this.width);if(this.isHorizontal()){let l=0,h=(0,d.a2)(i,this.left+n,this.right-this.lineWidths[l]);for(const u of e)l!==u.row&&(l=u.row,h=(0,d.a2)(i,this.left+n,this.right-this.lineWidths[l])),u.top+=this.top+t+n,u.left=a.leftForLtr(a.x(h),u.width),h+=u.width+n}else{let l=0,h=(0,d.a2)(i,this.top+t+n,this.bottom-this.columnSizes[l].height);for(const u of e)u.col!==l&&(l=u.col,h=(0,d.a2)(i,this.top+t+n,this.bottom-this.columnSizes[l].height)),u.top=h,u.left+=this.left+n,u.left=a.leftForLtr(a.x(u.left),u.width),h+=u.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;(0,d.Y)(t,this),this._draw(),(0,d.$)(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:a}=t,l=d.d.color,h=(0,d.az)(t.rtl,this.left,this.width),u=(0,d.a0)(a.font),{padding:p}=a,b=u.size,_=b/2;let y;this.drawTitle(),n.textAlign=h.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=u.string;const{boxWidth:M,boxHeight:S,itemHeight:D}=U(a,b),P=function(F,I,B){if(isNaN(M)||M<=0||isNaN(S)||S<0)return;n.save();const $=(0,d.v)(B.lineWidth,1);if(n.fillStyle=(0,d.v)(B.fillStyle,l),n.lineCap=(0,d.v)(B.lineCap,"butt"),n.lineDashOffset=(0,d.v)(B.lineDashOffset,0),n.lineJoin=(0,d.v)(B.lineJoin,"miter"),n.lineWidth=$,n.strokeStyle=(0,d.v)(B.strokeStyle,l),n.setLineDash((0,d.v)(B.lineDash,[])),a.usePointStyle){const Z={radius:S*Math.SQRT2/2,pointStyle:B.pointStyle,rotation:B.rotation,borderWidth:$},J=h.xPlus(F,M/2),it=I+_;(0,d.aD)(n,Z,J,it,a.pointStyleWidth&&M)}else{const Z=I+Math.max((b-S)/2,0),J=h.leftForLtr(F,M),it=(0,d.aw)(B.borderRadius);n.beginPath(),Object.values(it).some(Ct=>Ct!==0)?(0,d.au)(n,{x:J,y:Z,w:M,h:S,radius:it}):n.rect(J,Z,M,S),n.fill(),$!==0&&n.stroke()}n.restore()},O=function(F,I,B){(0,d.Z)(n,B.text,F,I+D/2,u,{strikethrough:B.hidden,textAlign:h.textAlign(B.textAlign)})},E=this.isHorizontal(),L=this._computeTitleHeight();E?y={x:(0,d.a2)(o,this.left+p,this.right-i[0]),y:this.top+p+L,line:0}:y={x:this.left+p,y:(0,d.a2)(o,this.top+L+p,this.bottom-e[0].height),line:0},(0,d.aA)(this.ctx,t.textDirection);const A=D+p;this.legendItems.forEach((F,I)=>{n.strokeStyle=F.fontColor,n.fillStyle=F.fontColor;const B=n.measureText(F.text).width,$=h.textAlign(F.textAlign||(F.textAlign=a.textAlign)),Z=M+_+B;let J=y.x,it=y.y;h.setWidth(this.width),E?I>0&&J+Z+p>this.right&&(it=y.y+=A,y.line++,J=y.x=(0,d.a2)(o,this.left+p,this.right-i[y.line])):I>0&&it+A>this.bottom&&(J=y.x=J+e[y.line].width+p,y.line++,it=y.y=(0,d.a2)(o,this.top+L+p,this.bottom-e[y.line].height));const Ct=h.x(J);if(P(Ct,it,F),J=(0,d.aB)($,J+M+_,E?J+Z:this.right,t.rtl),O(h.x(J),it,F),E)y.x+=Z+p;else if(typeof F.text!="string"){const ie=u.lineHeight;y.y+=Rn(F,ie)+p}else y.y+=A}),(0,d.aC)(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=(0,d.a0)(e.font),n=(0,d.E)(e.padding);if(!e.display)return;const o=(0,d.az)(t.rtl,this.left,this.width),a=this.ctx,l=e.position,h=i.size/2,u=n.top+h;let p,b=this.left,_=this.width;if(this.isHorizontal())_=Math.max(...this.lineWidths),p=this.top+u,b=(0,d.a2)(t.align,b,this.right-_);else{const M=this.columnSizes.reduce((S,D)=>Math.max(S,D.height),0);p=u+(0,d.a2)(t.align,this.top,this.bottom-M-t.labels.padding-this._computeTitleHeight())}const y=(0,d.a2)(l,b,b+_);a.textAlign=o.textAlign((0,d.a1)(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,(0,d.Z)(a,e.text,y,p,i)}_computeTitleHeight(){const t=this.options.title,e=(0,d.a0)(t.font),i=(0,d.E)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if((0,d.aj)(t,this.left,this.right)&&(0,d.aj)(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;io.length>a.length?o:a)),t+e.size/2+i.measureText(n).width}function eo(s,t,e){let i=s;return typeof t.text!="string"&&(i=Rn(t,e)),i}function Rn(s,t){const e=s.text?s.text.length:0;return t*e}function io(s,t){return!!((s==="mousemove"||s==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(s==="click"||s==="mouseup"))}var Fn={id:"legend",_element:Ot,start(s,t,e){const i=s.legend=new Ot({ctx:s.ctx,options:e,chart:s});gt.configure(s,i,e),gt.addBox(s,i)},stop(s){gt.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,t,e){const i=s.legend;gt.configure(s,i,e),i.options=e},afterUpdate(s){const t=s.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(s,t){t.replay||s.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,t,e){const i=t.datasetIndex,n=e.chart;n.isDatasetVisible(i)?(n.hide(i),t.hidden=!0):(n.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){const t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:o,useBorderRadius:a,borderRadius:l}}=s.legend.options;return s._getSortedDatasetMetas().map(h=>{const u=h.controller.getStyle(e?0:void 0),p=(0,d.E)(u.borderWidth);return{text:t[h.index].label,fillStyle:u.backgroundColor,fontColor:o,hidden:!h.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(p.width+p.height)/4,strokeStyle:u.borderColor,pointStyle:i||u.pointStyle,rotation:u.rotation,textAlign:n||u.textAlign,borderRadius:a&&(l||u.borderRadius),datasetIndex:h.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}};class be extends ee{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=(0,d.b)(i.text)?i.text.length:1;this._padding=(0,d.E)(i.padding);const o=n*(0,d.a0)(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:a}=this,l=a.align;let h=0,u,p,b;return this.isHorizontal()?(p=(0,d.a2)(l,i,o),b=e+t,u=o-i):(a.position==="left"?(p=i+t,b=(0,d.a2)(l,n,e),h=d.P*-.5):(p=o-t,b=(0,d.a2)(l,e,n),h=d.P*.5),u=n-e),{titleX:p,titleY:b,maxWidth:u,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=(0,d.a0)(e.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:h,rotation:u}=this._drawArgs(o);(0,d.Z)(t,e.text,0,0,i,{color:e.color,maxWidth:h,rotation:u,textAlign:(0,d.a1)(e.align),textBaseline:"middle",translation:[a,l]})}}function In(s,t){const e=new be({ctx:s.ctx,options:t,chart:s});gt.configure(s,e,t),gt.addBox(s,e),s.titleBlock=e}var co={id:"title",_element:be,start(s,t,e){In(s,e)},stop(s){const t=s.titleBlock;gt.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){const i=s.titleBlock;gt.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const zn=new WeakMap;var Co={id:"subtitle",start(s,t,e){const i=new be({ctx:s.ctx,options:e,chart:s});gt.configure(s,i,e),gt.addBox(s,i),zn.set(s,i)},stop(s){gt.removeBox(s,zn.get(s)),zn.delete(s)},beforeUpdate(s,t,e){const i=zn.get(s);gt.configure(s,i,e),i.options=e},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 Bi={average(s){if(!s.length)return!1;let t,e,i=new Set,n=0,o=0;for(t=0,e=s.length;tl+h)/i.size,y:n/o}},nearest(s,t){if(!s.length)return!1;let e=t.x,i=t.y,n=Number.POSITIVE_INFINITY,o,a,l;for(o=0,a=s.length;o-1?s.split(` `):s}function Ao(s,t){const{element:e,datasetIndex:i,index:n}=t,o=s.getDatasetMeta(i).controller,{label:a,value:l}=o.getLabelAndValue(n);return{chart:s,label:a,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:l,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function ho(s,t){const e=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:a,boxHeight:l}=t,h=(0,d.a0)(t.bodyFont),u=(0,d.a0)(t.titleFont),p=(0,d.a0)(t.footerFont),b=o.length,_=n.length,y=i.length,M=(0,d.E)(t.padding);let S=M.height,D=0,P=i.reduce((L,A)=>L+A.before.length+A.lines.length+A.after.length,0);if(P+=s.beforeBody.length+s.afterBody.length,b&&(S+=b*u.lineHeight+(b-1)*t.titleSpacing+t.titleMarginBottom),P){const L=t.displayColors?Math.max(l,h.lineHeight):h.lineHeight;S+=y*L+(P-y)*h.lineHeight+(P-1)*t.bodySpacing}_&&(S+=t.footerMarginTop+_*p.lineHeight+(_-1)*t.footerSpacing);let O=0;const E=function(L){D=Math.max(D,e.measureText(L).width+O)};return e.save(),e.font=u.string,(0,d.F)(s.title,E),e.font=h.string,(0,d.F)(s.beforeBody.concat(s.afterBody),E),O=t.displayColors?a+2+t.boxPadding:0,(0,d.F)(i,L=>{(0,d.F)(L.before,E),(0,d.F)(L.lines,E),(0,d.F)(L.after,E)}),O=0,e.font=p.string,(0,d.F)(s.footer,E),e.restore(),D+=M.width,{width:D,height:S}}function To(s,t){const{y:e,height:i}=t;return es.height-i/2?"bottom":"center"}function Lo(s,t,e,i){const{x:n,width:o}=i,a=e.caretSize+e.caretPadding;if(s==="left"&&n+o+a>t.width||s==="right"&&n-o-a<0)return!0}function Eo(s,t,e,i){const{x:n,width:o}=e,{width:a,chartArea:{left:l,right:h}}=s;let u="center";return i==="center"?u=n<=(l+h)/2?"left":"right":n<=o/2?u="left":n>=a-o/2&&(u="right"),Lo(u,s,t,e)&&(u="center"),u}function uo(s,t,e){const i=e.yAlign||t.yAlign||To(s,e);return{xAlign:e.xAlign||t.xAlign||Eo(s,t,e,i),yAlign:i}}function Ro(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Fo(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function fo(s,t,e,i){const{caretSize:n,caretPadding:o,cornerRadius:a}=s,{xAlign:l,yAlign:h}=e,u=n+o,{topLeft:p,topRight:b,bottomLeft:_,bottomRight:y}=(0,d.aw)(a);let M=Ro(t,l);const S=Fo(t,h,u);return h==="center"?l==="left"?M+=u:l==="right"&&(M-=u):l==="left"?M-=Math.max(p,_)+n:l==="right"&&(M+=Math.max(b,y)+n),{x:(0,d.S)(M,0,i.width-t.width),y:(0,d.S)(S,0,i.height-t.height)}}function Bn(s,t,e){const i=(0,d.E)(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function go(s){return _e([],ke(s))}function Io(s,t,e){return(0,d.j)(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function po(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const mo={beforeTitle:d.aF,title(s){if(s.length>0){const t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?mo[t].call(e,i):n}class no extends ee{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,o=new at(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Io(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=Ut(i,"beforeTitle",this,t),o=Ut(i,"title",this,t),a=Ut(i,"afterTitle",this,t);let l=[];return l=_e(l,ke(n)),l=_e(l,ke(o)),l=_e(l,ke(a)),l}getBeforeBody(t,e){return go(Ut(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return(0,d.F)(t,o=>{const a={before:[],lines:[],after:[]},l=po(i,o);_e(a.before,ke(Ut(l,"beforeLabel",this,o))),_e(a.lines,Ut(l,"label",this,o)),_e(a.after,ke(Ut(l,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return go(Ut(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Ut(i,"beforeFooter",this,t),o=Ut(i,"footer",this,t),a=Ut(i,"afterFooter",this,t);let l=[];return l=_e(l,ke(n)),l=_e(l,ke(o)),l=_e(l,ke(a)),l}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],a=[];let l=[],h,u;for(h=0,u=e.length;ht.filter(p,b,_,i))),t.itemSort&&(l=l.sort((p,b)=>t.itemSort(p,b,i))),(0,d.F)(l,p=>{const b=po(t.callbacks,p);n.push(Ut(b,"labelColor",this,p)),o.push(Ut(b,"labelPointStyle",this,p)),a.push(Ut(b,"labelTextColor",this,p))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let o,a=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const l=Bi[i.position].call(this,n,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const h=this._size=ho(this,i),u=Object.assign({},l,h),p=uo(this.chart,i,u),b=fo(i,u,p,this.chart);this.xAlign=p.xAlign,this.yAlign=p.yAlign,o={opacity:1,x:b.x,y:b.y,width:h.width,height:h.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:h,topRight:u,bottomLeft:p,bottomRight:b}=(0,d.aw)(l),{x:_,y}=t,{width:M,height:S}=e;let D,P,O,E,L,A;return o==="center"?(L=y+S/2,n==="left"?(D=_,P=D-a,E=L+a,A=L-a):(D=_+M,P=D+a,E=L-a,A=L+a),O=D):(n==="left"?P=_+Math.max(h,p)+a:n==="right"?P=_+M-Math.max(u,b)-a:P=this.caretX,o==="top"?(E=y,L=E-a,D=P-a,O=P+a):(E=y+S,L=E+a,D=P+a,O=P-a),A=E),{x1:D,x2:P,x3:O,y1:E,y2:L,y3:A}}drawTitle(t,e,i){const n=this.title,o=n.length;let a,l,h;if(o){const u=(0,d.az)(i.rtl,this.x,this.width);for(t.x=Bn(this,i.titleAlign,i),e.textAlign=u.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,d.a0)(i.titleFont),l=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,h=0;hO!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,(0,d.au)(t,{x:S,y:M,w:u,h,radius:P}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),(0,d.au)(t,{x:D,y:M+1,w:u-2,h:h-2,radius:P}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(S,M,u,h),t.strokeRect(S,M,u,h),t.fillStyle=a.backgroundColor,t.fillRect(D,M+1,u-2,h-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:h,boxWidth:u,boxPadding:p}=i,b=(0,d.a0)(i.bodyFont);let _=b.lineHeight,y=0;const M=(0,d.az)(i.rtl,this.x,this.width),S=function(B){e.fillText(B,M.x(t.x+y),t.y+_/2),t.y+=_+o},D=M.textAlign(a);let P,O,E,L,A,F,I;for(e.textAlign=a,e.textBaseline="middle",e.font=b.string,t.x=Bn(this,D,i),e.fillStyle=i.bodyColor,(0,d.F)(this.beforeBody,S),y=l&&D!=="right"?a==="center"?u/2+p:u+2+p:0,L=0,F=n.length;L0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const a=Bi[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=ho(this,t),h=Object.assign({},a,this._size),u=uo(e,t,h),p=fo(t,h,u,e);(n._to!==p.x||o._to!==p.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,p))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=(0,d.E)(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),(0,d.aA)(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),(0,d.aC)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:l,index:h})=>{const u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[h],index:h}}),o=!(0,d.ah)(i,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,i),l=this._positionChanged(a,t),h=e||!(0,d.ah)(a,o)||l;return h&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),h}_getActiveElements(t,e,i,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,a=Bi[o.position].call(this,t,e);return a!==!1&&(i!==a.x||n!==a.y)}}R(no,"positioners",Bi);var bo={id:"tooltip",_element:no,positioners:Bi,afterInit(s,t,e){e&&(s.tooltip=new no({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){const t=s.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){const e=t.replay;s.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(s,t)=>t.bodyFont.size,boxWidth:(s,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:mo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},zo=Object.freeze({__proto__:null,Colors:Ns,Decimation:Us,Filler:pt,Legend:Fn,SubTitle:Co,Title:co,Tooltip:bo});const Bo=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Wo(s,t,e,i){const n=s.indexOf(t);if(n===-1)return Bo(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const jo=(s,t)=>s===null?null:(0,d.S)(Math.round(s),0,t);function _o(s){const t=this.getLabels();return s>=0&&se.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}R(so,"id","category"),R(so,"defaults",{ticks:{callback:_o}});function Vo(s,t){const e=[],{bounds:n,step:o,min:a,max:l,precision:h,count:u,maxTicks:p,maxDigits:b,includeBounds:_}=s,y=o||1,M=p-1,{min:S,max:D}=t,P=!(0,d.k)(a),O=!(0,d.k)(l),E=!(0,d.k)(u),L=(D-S)/(b+1);let A=(0,d.aH)((D-S)/M/y)*y,F,I,B,$;if(A<1e-14&&!P&&!O)return[{value:S},{value:D}];$=Math.ceil(D/A)-Math.floor(S/A),$>M&&(A=(0,d.aH)($*A/M/y)*y),(0,d.k)(h)||(F=Math.pow(10,h),A=Math.ceil(A*F)/F),n==="ticks"?(I=Math.floor(S/A)*A,B=Math.ceil(D/A)*A):(I=S,B=D),P&&O&&o&&(0,d.aI)((l-a)/o,A/1e3)?($=Math.round(Math.min((l-a)/A,p)),A=(l-a)/$,I=a,B=l):E?(I=P?a:I,B=O?l:B,$=u-1,A=(B-I)/$):($=(B-I)/A,(0,d.aJ)($,Math.round($),A/1e3)?$=Math.round($):$=Math.ceil($));const Z=Math.max((0,d.aK)(A),(0,d.aK)(I));F=Math.pow(10,(0,d.k)(h)?Z:h),I=Math.round(I*F)/F,B=Math.round(B*F)/F;let J=0;for(P&&(_&&I!==a?(e.push({value:a}),Il)break;e.push({value:it})}return O&&_&&B!==l?e.length&&(0,d.aJ)(e[e.length-1].value,l,xo(l,L,s))?e[e.length-1].value=l:e.push({value:l}):(!O||B===l)&&e.push({value:B}),e}function xo(s,t,{horizontal:e,minRotation:i}){const n=(0,d.t)(i),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+s).length;return Math.min(t/o,a)}class Wn extends ae{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return(0,d.k)(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const a=h=>n=e?n:h,l=h=>o=i?o:h;if(t){const h=(0,d.s)(n),u=(0,d.s)(o);h<0&&u<0?l(0):h>0&&u>0&&a(0)}if(n===o){let h=o===0?1:Math.abs(o*.05);l(o+h),t||a(n-h)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Vo(n,o);return t.bounds==="ticks"&&(0,d.aG)(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return(0,d.o)(t,this.chart.options.locale,this.options.ticks.format)}}class jn extends Wn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,d.g)(t)?t:0,this.max=(0,d.g)(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=(0,d.t)(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}R(jn,"id","linear"),R(jn,"defaults",{ticks:{callback:d.aL.formatters.numeric}});const Wi=s=>Math.floor((0,d.aM)(s)),Ue=(s,t)=>Math.pow(10,Wi(s)+t);function yo(s){return s/Math.pow(10,Wi(s))===1}function vo(s,t,e){const i=Math.pow(10,e),n=Math.floor(s/i);return Math.ceil(t/i)-n}function Ho(s,t){const e=t-s;let i=Wi(e);for(;vo(s,t,i)>10;)i++;for(;vo(s,t,i)<10;)i--;return Math.min(i,Wi(s))}function No(s,{min:t,max:e}){t=(0,d.O)(s.min,t);const i=[],n=Wi(t);let o=Ho(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),h=n>o?Math.pow(10,n):0,u=Math.round((t-h)*a)/a,p=Math.floor((t-h)/l/10)*l*10;let b=Math.floor((u-p)/Math.pow(10,o)),_=(0,d.O)(s.min,Math.round((h+p+b*Math.pow(10,o))*a)/a);for(;_=10?b=b<15?15:20:b++,b>=20&&(o++,b=2,a=o>=0?1:a),_=Math.round((h+p+b*Math.pow(10,o))*a)/a;const y=(0,d.O)(s.max,_);return i.push({value:y,major:yo(y),significand:b}),i}class oo extends ae{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Wn.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return(0,d.g)(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,d.g)(t)?Math.max(0,t):null,this.max=(0,d.g)(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!(0,d.g)(this._userMin)&&(this.min=t===Ue(this.min,0)?Ue(this.min,-1):Ue(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const o=l=>i=t?i:l,a=l=>n=e?n:l;i===n&&(i<=0?(o(1),a(10)):(o(Ue(i,-1)),a(Ue(n,1)))),i<=0&&o(Ue(n,-1)),n<=0&&a(Ue(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=No(e,this);return t.bounds==="ticks"&&(0,d.aG)(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":(0,d.o)(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=(0,d.aM)(t),this._valueRange=(0,d.aM)(this.max)-(0,d.aM)(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:((0,d.aM)(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}R(oo,"id","logarithmic"),R(oo,"defaults",{ticks:{callback:d.aL.formatters.logarithmic,major:{enabled:!0}}});function ro(s){const t=s.ticks;if(t.display&&s.display){const e=(0,d.E)(t.backdropPadding);return(0,d.v)(t.font&&t.font.size,d.d.font.size)+e.height}return 0}function Yo(s,t,e){return e=(0,d.b)(e)?e:[e],{w:(0,d.aN)(s,t.string,e),h:e.length*t.lineHeight}}function Mo(s,t,e,i,n){return s===i||s===n?{start:t-e/2,end:t+e/2}:sn?{start:t-e,end:t}:{start:t,end:t+e}}function $o(s){const t={l:s.left+s._padding.left,r:s.right-s._padding.right,t:s.top+s._padding.top,b:s.bottom-s._padding.bottom},e=Object.assign({},t),i=[],n=[],o=s._pointLabels.length,a=s.options.pointLabels,l=a.centerPointLabels?d.P/o:0;for(let h=0;ht.r&&(l=(i.end-t.r)/o,s.r=Math.max(s.r,t.r+l)),n.startt.b&&(h=(n.end-t.b)/a,s.b=Math.max(s.b,t.b+h))}function Xo(s,t,e){const i=s.drawingArea,{extra:n,additionalAngle:o,padding:a,size:l}=e,h=s.getPointPosition(t,i+n+a,o),u=Math.round((0,d.U)((0,d.ay)(h.angle+d.H))),p=Zo(h.y,l.h,u),b=Qo(u),_=qo(h.x,l.w,b);return{visible:!0,x:h.x,y:p,textAlign:b,left:_,top:p,right:_+l.w,bottom:p+l.h}}function Ko(s,t){if(!t)return!0;const{left:e,top:i,right:n,bottom:o}=s;return!((0,d.C)({x:e,y:i},t)||(0,d.C)({x:e,y:o},t)||(0,d.C)({x:n,y:i},t)||(0,d.C)({x:n,y:o},t))}function Go(s,t,e){const i=[],n=s._pointLabels.length,o=s.options,{centerPointLabels:a,display:l}=o.pointLabels,h={extra:ro(o)/2,additionalAngle:a?d.P/n:0};let u;for(let p=0;p270||e<90)&&(s-=t),s}function Jo(s,t,e){const{left:i,top:n,right:o,bottom:a}=e,{backdropColor:l}=t;if(!(0,d.k)(l)){const h=(0,d.aw)(t.borderRadius),u=(0,d.E)(t.backdropPadding);s.fillStyle=l;const p=i-u.left,b=n-u.top,_=o-i+u.width,y=a-n+u.height;Object.values(h).some(M=>M!==0)?(s.beginPath(),(0,d.au)(s,{x:p,y:b,w:_,h:y,radius:h}),s.fill()):s.fillRect(p,b,_,y)}}function tr(s,t){const{ctx:e,options:{pointLabels:i}}=s;for(let n=t-1;n>=0;n--){const o=s._pointLabelItems[n];if(!o.visible)continue;const a=i.setContext(s.getPointLabelContext(n));Jo(e,a,o);const l=(0,d.a0)(a.font),{x:h,y:u,textAlign:p}=o;(0,d.Z)(e,s._pointLabels[n],h,u+l.lineHeight/2,l,{color:a.color,textAlign:p,textBaseline:"middle"})}}function ko(s,t,e,i){const{ctx:n}=s;if(e)n.arc(s.xCenter,s.yCenter,t,0,d.T);else{let o=s.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let a=1;a{const n=(0,d.Q)(this.options.pointLabels.callback,[e,i],this);return n||n===0?n:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?$o(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){const e=d.T/(this._pointLabels.length||1),i=this.options.startAngle||0;return(0,d.ay)(t*e+(0,d.t)(i))}getDistanceFromCenterForValue(t){if((0,d.k)(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if((0,d.k)(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t{if(b!==0||b===0&&this.min<0){h=this.getDistanceFromCenterForValue(p.value);const _=this.getContext(b),y=n.setContext(_),M=o.setContext(_);er(this,y,h,a,M)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const p=i.setContext(this.getPointLabelContext(l)),{color:b,lineWidth:_}=p;!_||!b||(t.lineWidth=_,t.strokeStyle=b,t.setLineDash(p.borderDash),t.lineDashOffset=p.borderDashOffset,h=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),u=this.getPointPosition(l,h),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,h)=>{if(h===0&&this.min>=0&&!e.reverse)return;const u=i.setContext(this.getContext(h)),p=(0,d.a0)(u.font);if(o=this.getDistanceFromCenterForValue(this.ticks[h].value),u.showLabelBackdrop){t.font=p.string,a=t.measureText(l.label).width,t.fillStyle=u.backdropColor;const b=(0,d.E)(u.backdropPadding);t.fillRect(-a/2-b.left,-o-p.size/2-b.top,a+b.width,p.size+b.height)}(0,d.Z)(t,l.label,0,-o,p,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}R(ji,"id","radialLinear"),R(ji,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:d.aL.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),R(ji,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(ji,"descriptors",{angleLines:{_fallback:"grid"}});const Vn={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}},Xt=Object.keys(Vn);function wo(s,t){return s-t}function So(s,t){if((0,d.k)(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),(0,d.g)(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(n&&(a=n==="week"&&((0,d.x)(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function Po(s,t,e,i){const n=Xt.length;for(let o=Xt.indexOf(s);o=Xt.indexOf(e);o--){const a=Xt[o];if(Vn[a].common&&s._adapter.diff(n,i,a)>=t-1)return a}return Xt[e?Xt.indexOf(e):0]}function sr(s){for(let t=Xt.indexOf(s)+1,e=Xt.length;t=t?e[i]:e[n];s[o]=!0}}function or(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),a=t[t.length-1].value;let l,h;for(l=o;l<=a;l=+n.add(l,1,i))h=e[l],h>=0&&(t[h].major=!0);return t}function Oo(s,t,e){const i=[],n={},o=t.length;let a,l;for(a=0;a+t.value))}initOffsets(t=[]){let e=0,i=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=(0,d.S)(e,0,a),i=(0,d.S)(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,a=o.unit||Po(o.minUnit,e,i,this._getLabelCapacity(e)),l=(0,d.v)(n.ticks.stepSize,1),h=a==="week"?o.isoWeekday:!1,u=(0,d.x)(h)||h===!0,p={};let b=e,_,y;if(u&&(b=+t.startOf(b,"isoWeek",h)),b=+t.startOf(b,u?"day":a),t.diff(i,e,a)>1e5*l)throw new Error(e+" and "+i+" are too far apart with stepSize of "+l+" "+a);const M=n.ticks.source==="data"&&this.getDataTimestamps();for(_=b,y=0;_+S)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,a=e||n[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,n){const o=this.options,a=o.ticks.callback;if(a)return(0,d.Q)(a,[t,e,i],this);const l=o.time.displayFormats,h=this._unit,u=this._majorUnit,p=h&&l[h],b=u&&l[u],_=i[e],y=u&&b&&_&&_.major;return this._adapter.format(t,n||(y?b:p))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=(0,d.B)(s,"pos",t)),{pos:o,time:l}=s[i],{pos:a,time:h}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=(0,d.B)(s,"time",t)),{time:o,pos:l}=s[i],{time:a,pos:h}=s[n]);const u=a-o;return u?l+(h-l)*(t-o)/u:l}class ao extends fi{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Hn(e,this.min),this._tableRange=Hn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let a,l,h,u,p;for(a=0,l=t.length;a=e&&u<=i&&n.push(u);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,l=n.length;an-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Hn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Hn(this._table,i*this._tableRange+this._minPos,!0)}}R(ao,"id","timeseries"),R(ao,"defaults",fi.defaults);var rr=Object.freeze({__proto__:null,CategoryScale:so,LinearScale:jn,LogarithmicScale:oo,RadialLinearScale:ji,TimeScale:fi,TimeSeriesScale:ao});const cr=[Yn,hi,zo,rr]},"./node_modules/chart.js/dist/chunks/helpers.segment.js":function(vt,nt,G){"use strict";G.d(nt,{$:function(){return He},A:function(){return os},B:function(){return We},C:function(){return oi},D:function(){return ns},E:function(){return Cs},F:function(){return Ie},G:function(){return On},H:function(){return te},I:function(){return ci},J:function(){return Ys},K:function(){return Ns},L:function(){return cs},M:function(){return Sn},N:function(){return Zn},O:function(){return Yn},P:function(){return kt},Q:function(){return $n},R:function(){return fe},S:function(){return Ze},T:function(){return Jt},U:function(){return qe},V:function(){return Pi},W:function(){return ss},X:function(){return cn},Y:function(){return ri},Z:function(){return Ps},_:function(){return ls},a:function(){return As},a0:function(){return ai},a1:function(){return Zi},a2:function(){return Ji},a3:function(){return ii},a4:function(){return xe},a5:function(){return yi},a6:function(){return an},a7:function(){return Be},a8:function(){return Ne},a9:function(){return Ai},aA:function(){return Fi},aB:function(){return tn},aC:function(){return Ks},aD:function(){return Di},aE:function(){return ye},aF:function(){return Zt},aG:function(){return ts},aH:function(){return Xi},aI:function(){return Jn},aJ:function(){return Mi},aK:function(){return is},aL:function(){return rn},aM:function(){return Qe},aN:function(){return ys},aO:function(){return ee},aP:function(){return ki},aa:function(){return mn},ab:function(){return _i},ac:function(){return Pe},ad:function(){return hs},ae:function(){return Hs},af:function(){return hn},ag:function(){return $i},ah:function(){return Un},ai:function(){return Ui},aj:function(){return Je},ak:function(){return Te},al:function(){return Bs},am:function(){return Zs},an:function(){return Gs},ao:function(){return Cn},ap:function(){return An},aq:function(){return Me},ar:function(){return Ms},as:function(){return dn},at:function(){return vs},au:function(){return un},av:function(){return Oi},aw:function(){return Os},ax:function(){return zi},ay:function(){return se},az:function(){return Xs},b:function(){return Ft},c:function(){return fs},d:function(){return si},e:function(){return ti},f:function(){return xi},g:function(){return De},h:function(){return Qn},i:function(){return yt},j:function(){return Ci},k:function(){return re},l:function(){return rs},m:function(){return mi},n:function(){return bi},o:function(){return sn},p:function(){return Qi},q:function(){return ds},r:function(){return je},s:function(){return Ae},t:function(){return es},u:function(){return as},v:function(){return It},w:function(){return us},x:function(){return Ki},y:function(){return Fs},z:function(){return js}});function d(r){return r+.5|0}const W=(r,c,f)=>Math.max(Math.min(r,f),c);function X(r){return W(d(r*2.55),0,255)}function Q(r){return W(d(r/2.55),0,100)}function ut(r){return W(d(r*255),0,255)}function j(r){return W(d(r/2.55)/100,0,1)}function at(r){return W(d(r*100),0,100)}const K={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},lt=[..."0123456789ABCDEF"],et=r=>lt[r&15],ft=r=>lt[(r&240)>>4]+lt[r&15],z=r=>(r&240)>>4===(r&15),q=r=>z(r.r)&&z(r.g)&&z(r.b)&&z(r.a);function ct(r){var c=r.length,f;return r[0]==="#"&&(c===4||c===5?f={r:255&K[r[1]]*17,g:255&K[r[2]]*17,b:255&K[r[3]]*17,a:c===5?K[r[4]]*17:255}:(c===7||c===9)&&(f={r:K[r[1]]<<4|K[r[2]],g:K[r[3]]<<4|K[r[4]],b:K[r[5]]<<4|K[r[6]],a:c===9?K[r[7]]<<4|K[r[8]]:255})),f}const ht=(r,c)=>r<255?c(r):"";function Pt(r){var c=q(r)?et:ft;return r?"#"+c(r.r)+c(r.g)+c(r.b)+ht(r.a,c):void 0}const Bt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Kt(r,c,f){const g=c*Math.min(f,1-f),m=(x,v=(x+r/30)%12)=>f-g*Math.max(Math.min(v-3,9-v,1),-1);return[m(0),m(8),m(4)]}function Gt(r,c,f){const g=(m,x=(m+r/60)%6)=>f-f*c*Math.max(Math.min(x,4-x,1),0);return[g(5),g(3),g(1)]}function Wt(r,c,f){const g=Kt(r,1,.5);let m;for(c+f>1&&(m=1/(c+f),c*=m,f*=m),m=0;m<3;m++)g[m]*=1-c-f,g[m]+=c;return g}function At(r,c,f,g,m){return r===m?(c-f)/g+(c.5?T/(2-x-v):T/(x+v),w=At(f,g,m,T,x),w=w*60+.5),[w|0,C||0,k]}function jt(r,c,f,g){return(Array.isArray(c)?r(c[0],c[1],c[2]):r(c,f,g)).map(ut)}function Dt(r,c,f){return jt(Kt,r,c,f)}function xt(r,c,f){return jt(Wt,r,c,f)}function Vt(r,c,f){return jt(Gt,r,c,f)}function N(r){return(r%360+360)%360}function tt(r){const c=Bt.exec(r);let f=255,g;if(!c)return;c[5]!==g&&(f=c[6]?X(+c[5]):ut(+c[5]));const m=N(+c[2]),x=+c[3]/100,v=+c[4]/100;return c[1]==="hwb"?g=xt(m,x,v):c[1]==="hsv"?g=Vt(m,x,v):g=Dt(m,x,v),{r:g[0],g:g[1],b:g[2],a:f}}function st(r,c){var f=Tt(r);f[0]=N(f[0]+c),f=Dt(f),r.r=f[0],r.g=f[1],r.b=f[2]}function wt(r){if(!r)return;const c=Tt(r),f=c[0],g=at(c[1]),m=at(c[2]);return r.a<255?`hsla(${f}, ${g}%, ${m}%, ${j(r.a)})`:`hsl(${f}, ${g}%, ${m}%)`}const bt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ot={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Lt(){const r={},c=Object.keys(ot),f=Object.keys(bt);let g,m,x,v,k;for(g=0;g>16&255,x>>8&255,x&255]}return r}let Ht;function we(r){Ht||(Ht=Lt(),Ht.transparent=[0,0,0,0]);const c=Ht[r.toLowerCase()];return c&&{r:c[0],g:c[1],b:c[2],a:c.length===4?c[3]:255}}const Et=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ne(r){const c=Et.exec(r);let f=255,g,m,x;if(c){if(c[7]!==g){const v=+c[7];f=c[8]?X(v):W(v*255,0,255)}return g=+c[1],m=+c[3],x=+c[5],g=255&(c[2]?X(g):W(g,0,255)),m=255&(c[4]?X(m):W(m,0,255)),x=255&(c[6]?X(x):W(x,0,255)),{r:g,g:m,b:x,a:f}}}function he(r){return r&&(r.a<255?`rgba(${r.r}, ${r.g}, ${r.b}, ${j(r.a)})`:`rgb(${r.r}, ${r.g}, ${r.b})`)}const Qt=r=>r<=.0031308?r*12.92:Math.pow(r,1/2.4)*1.055-.055,Nt=r=>r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4);function qt(r,c,f){const g=Nt(j(r.r)),m=Nt(j(r.g)),x=Nt(j(r.b));return{r:ut(Qt(g+f*(Nt(j(c.r))-g))),g:ut(Qt(m+f*(Nt(j(c.g))-m))),b:ut(Qt(x+f*(Nt(j(c.b))-x))),a:r.a+f*(c.a-r.a)}}function St(r,c,f){if(r){let g=Tt(r);g[c]=Math.max(0,Math.min(g[c]+g[c]*f,c===0?360:1)),g=Dt(g),r.r=g[0],r.g=g[1],r.b=g[2]}}function $t(r,c){return r&&Object.assign(c||{},r)}function Rt(r){var c={r:0,g:0,b:0,a:255};return Array.isArray(r)?r.length>=3&&(c={r:r[0],g:r[1],b:r[2],a:255},r.length>3&&(c.a=ut(r[3]))):(c=$t(r,{r:0,g:0,b:0,a:1}),c.a=ut(c.a)),c}function Yt(r){return r.charAt(0)==="r"?ne(r):tt(r)}class Mt{constructor(c){if(c instanceof Mt)return c;const f=typeof c;let g;f==="object"?g=Rt(c):f==="string"&&(g=ct(c)||we(c)||Yt(c)),this._rgb=g,this._valid=!!g}get valid(){return this._valid}get rgb(){var c=$t(this._rgb);return c&&(c.a=j(c.a)),c}set rgb(c){this._rgb=Rt(c)}rgbString(){return this._valid?he(this._rgb):void 0}hexString(){return this._valid?Pt(this._rgb):void 0}hslString(){return this._valid?wt(this._rgb):void 0}mix(c,f){if(c){const g=this.rgb,m=c.rgb;let x;const v=f===x?.5:f,k=2*v-1,w=g.a-m.a,C=((k*w===-1?k:(k+w)/(1+k*w))+1)/2;x=1-C,g.r=255&C*g.r+x*m.r+.5,g.g=255&C*g.g+x*m.g+.5,g.b=255&C*g.b+x*m.b+.5,g.a=v*g.a+(1-v)*m.a,this.rgb=g}return this}interpolate(c,f){return c&&(this._rgb=qt(this._rgb,c._rgb,f)),this}clone(){return new Mt(this.rgb)}alpha(c){return this._rgb.a=ut(c),this}clearer(c){const f=this._rgb;return f.a*=1-c,this}greyscale(){const c=this._rgb,f=d(c.r*.3+c.g*.59+c.b*.11);return c.r=c.g=c.b=f,this}opaquer(c){const f=this._rgb;return f.a*=1+c,this}negate(){const c=this._rgb;return c.r=255-c.r,c.g=255-c.g,c.b=255-c.b,this}lighten(c){return St(this._rgb,2,c),this}darken(c){return St(this._rgb,2,-c),this}saturate(c){return St(this._rgb,1,c),this}desaturate(c){return St(this._rgb,1,-c),this}rotate(c){return st(this._rgb,c),this}}function Se(r){return new Mt(r)}function Zt(){}const Pe=(()=>{let r=0;return()=>r++})();function re(r){return r===null||typeof r>"u"}function Ft(r){if(Array.isArray&&Array.isArray(r))return!0;const c=Object.prototype.toString.call(r);return c.slice(0,7)==="[object"&&c.slice(-6)==="Array]"}function yt(r){return r!==null&&Object.prototype.toString.call(r)==="[object Object]"}function De(r){return(typeof r=="number"||r instanceof Number)&&isFinite(+r)}function Yn(r,c){return De(r)?r:c}function It(r,c){return typeof r>"u"?c:r}const mi=(r,c)=>typeof r=="string"&&r.endsWith("%")?parseFloat(r)/100:+r/c,bi=(r,c)=>typeof r=="string"&&r.endsWith("%")?parseFloat(r)/100*c:+r;function $n(r,c,f){if(r&&typeof r.call=="function")return r.apply(f,c)}function Ie(r,c,f,g){let m,x,v;if(Ft(r))if(x=r.length,g)for(m=x-1;m>=0;m--)c.call(f,r[m],m);else for(m=0;mr,x:r=>r.x,y:r=>r.y};function Yi(r){const c=r.split("."),f=[];let g="";for(const m of c)g+=m,g.endsWith("\\")?g=g.slice(0,-1)+".":(f.push(g),g="");return f}function ze(r){const c=Yi(r);return f=>{for(const g of c){if(g==="")break;f=f&&f[g]}return f}}function xi(r,c){return(Ce[c]||(Ce[c]=ze(c)))(r)}function yi(r){return r.charAt(0).toUpperCase()+r.slice(1)}const Qn=r=>typeof r<"u",Be=r=>typeof r=="function",$i=(r,c)=>{if(r.size!==c.size)return!1;for(const f of r)if(!c.has(f))return!1;return!0};function Ui(r){return r.type==="mouseup"||r.type==="click"||r.type==="contextmenu"}const kt=Math.PI,Jt=2*kt,qn=Jt+kt,de=Number.POSITIVE_INFINITY,Ge=kt/180,te=kt/2,gt=kt/4,vi=kt*2/3,Qe=Math.log10,Ae=Math.sign;function Mi(r,c,f){return Math.abs(r-c)m-x).pop(),c}function Ki(r){return!isNaN(parseFloat(r))&&isFinite(r)}function Jn(r,c){const f=Math.round(r);return f-c<=r&&f+c>=r}function ts(r,c,f){let g,m,x;for(g=0,m=r.length;gw&&C=Math.min(c,f)-g&&r<=Math.max(c,f)+g}function ki(r,c,f){f=f||(v=>r[v]1;)x=m+g>>1,f(x)?m=x:g=x;return{lo:m,hi:g}}const We=(r,c,f,g)=>ki(r,f,g?m=>{const x=r[m][c];return xr[m][c]ki(r,f,g=>r[g][c]>=f);function ee(r,c,f){let g=0,m=r.length;for(;gg&&r[m-1]>f;)m--;return g>0||m{const g="_onData"+yi(f),m=r[f];Object.defineProperty(r,f,{configurable:!0,enumerable:!1,value(...x){const v=m.apply(this,x);return r._chartjs.listeners.forEach(k=>{typeof k[g]=="function"&&k[g](...x)}),v}})})}function as(r,c){const f=r._chartjs;if(!f)return;const g=f.listeners,m=g.indexOf(c);m!==-1&&g.splice(m,1),!(g.length>0)&&(qi.forEach(x=>{delete r[x]}),delete r._chartjs)}function ls(r){const c=new Set(r);return c.size===r.length?r:Array.from(c)}function lo(r,c,f){return c+" "+r+"px "+f}const je=function(){return typeof window>"u"?function(r){return r()}:window.requestAnimationFrame}();function cs(r,c){let f=[],g=!1;return function(...m){f=m,g||(g=!0,je.call(window,()=>{g=!1,r.apply(c,f)}))}}function hs(r,c){let f;return function(...g){return c?(clearTimeout(f),f=setTimeout(r,c,g)):r.apply(this,g),c}}const Zi=r=>r==="start"?"left":r==="end"?"right":"center",Ji=(r,c,f)=>r==="start"?c:r==="end"?f:(c+f)/2,tn=(r,c,f,g)=>r===(g?"left":"right")?f:r==="center"?(c+f)/2:c;function ds(r,c,f){const g=c.length;let m=0,x=g;if(r._sorted){const{iScale:v,_parsed:k}=r,w=v.axis,{min:C,max:T,minDefined:H,maxDefined:Y}=v.getUserBounds();H&&(m=Ze(Math.min(We(k,w,C).lo,f?g:We(c,w,v.getPixelForValue(C)).lo),0,g-1)),Y?x=Ze(Math.max(We(k,v.axis,T,!0).hi+1,f?0:We(c,w,v.getPixelForValue(T),!0).hi+1),m,g)-m:x=g-m}return{start:m,count:x}}function us(r){const{xScale:c,yScale:f,_scaleRanges:g}=r,m={xmin:c.min,xmax:c.max,ymin:f.min,ymax:f.max};if(!g)return r._scaleRanges=m,!0;const x=g.xmin!==c.min||g.xmax!==c.max||g.ymin!==f.min||g.ymax!==f.max;return Object.assign(g,m),x}const ue=r=>r===0||r===1,wi=(r,c,f)=>-(Math.pow(2,10*(r-=1))*Math.sin((r-c)*Jt/f)),en=(r,c,f)=>Math.pow(2,-10*r)*Math.sin((r-c)*Jt/f)+1,ti={linear:r=>r,easeInQuad:r=>r*r,easeOutQuad:r=>-r*(r-2),easeInOutQuad:r=>(r/=.5)<1?.5*r*r:-.5*(--r*(r-2)-1),easeInCubic:r=>r*r*r,easeOutCubic:r=>(r-=1)*r*r+1,easeInOutCubic:r=>(r/=.5)<1?.5*r*r*r:.5*((r-=2)*r*r+2),easeInQuart:r=>r*r*r*r,easeOutQuart:r=>-((r-=1)*r*r*r-1),easeInOutQuart:r=>(r/=.5)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2),easeInQuint:r=>r*r*r*r*r,easeOutQuint:r=>(r-=1)*r*r*r*r+1,easeInOutQuint:r=>(r/=.5)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2),easeInSine:r=>-Math.cos(r*te)+1,easeOutSine:r=>Math.sin(r*te),easeInOutSine:r=>-.5*(Math.cos(kt*r)-1),easeInExpo:r=>r===0?0:Math.pow(2,10*(r-1)),easeOutExpo:r=>r===1?1:-Math.pow(2,-10*r)+1,easeInOutExpo:r=>ue(r)?r:r<.5?.5*Math.pow(2,10*(r*2-1)):.5*(-Math.pow(2,-10*(r*2-1))+2),easeInCirc:r=>r>=1?r:-(Math.sqrt(1-r*r)-1),easeOutCirc:r=>Math.sqrt(1-(r-=1)*r),easeInOutCirc:r=>(r/=.5)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1),easeInElastic:r=>ue(r)?r:wi(r,.075,.3),easeOutElastic:r=>ue(r)?r:en(r,.075,.3),easeInOutElastic(r){return ue(r)?r:r<.5?.5*wi(r*2,.1125,.45):.5+.5*en(r*2-1,.1125,.45)},easeInBack(r){return r*r*((1.70158+1)*r-1.70158)},easeOutBack(r){return(r-=1)*r*((1.70158+1)*r+1.70158)+1},easeInOutBack(r){let c=1.70158;return(r/=.5)<1?.5*(r*r*(((c*=1.525)+1)*r-c)):.5*((r-=2)*r*(((c*=1.525)+1)*r+c)+2)},easeInBounce:r=>1-ti.easeOutBounce(1-r),easeOutBounce(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},easeInOutBounce:r=>r<.5?ti.easeInBounce(r*2)*.5:ti.easeOutBounce(r*2-1)*.5+.5};function Si(r){if(r&&typeof r=="object"){const c=r.toString();return c==="[object CanvasPattern]"||c==="[object CanvasGradient]"}return!1}function fs(r){return Si(r)?r:new Mt(r)}function ae(r){return Si(r)?r:new Mt(r).saturate(.5).darken(.1).hexString()}const ei=["x","y","borderWidth","radius","tension"],gs=["color","borderColor","backgroundColor"];function ps(r){r.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),r.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:c=>c!=="onProgress"&&c!=="onComplete"&&c!=="fn"}),r.set("animations",{colors:{type:"color",properties:gs},numbers:{type:"number",properties:ei}}),r.describe("animations",{_fallback:"animation"}),r.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:c=>c|0}}}})}function ms(r){r.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const nn=new Map;function oe(r,c){c=c||{};const f=r+JSON.stringify(c);let g=nn.get(f);return g||(g=new Intl.NumberFormat(r,c),nn.set(f,g)),g}function sn(r,c,f){return oe(c,f).format(r)}const on={values(r){return Ft(r)?r:""+r},numeric(r,c,f){if(r===0)return"0";const g=this.chart.options.locale;let m,x=r;if(f.length>1){const C=Math.max(Math.abs(f[0].value),Math.abs(f[f.length-1].value));(C<1e-4||C>1e15)&&(m="scientific"),x=bs(r,f)}const v=Qe(Math.abs(x)),k=isNaN(v)?1:Math.max(Math.min(-1*Math.floor(v),20),0),w={notation:m,minimumFractionDigits:k,maximumFractionDigits:k};return Object.assign(w,this.options.ticks.format),sn(r,g,w)},logarithmic(r,c,f){if(r===0)return"0";const g=f[c].significand||r/Math.pow(10,Math.floor(Qe(r)));return[1,2,3,5,10,15].includes(g)||c>.8*f.length?on.numeric.call(this,r,c,f):""}};function bs(r,c){let f=c.length>3?c[2].value-c[1].value:c[1].value-c[0].value;return Math.abs(f)>=1&&r!==Math.floor(r)&&(f=r-Math.floor(r)),f}var rn={formatters:on};function _s(r){r.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(c,f)=>f.lineWidth,tickColor:(c,f)=>f.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:rn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),r.route("scale.ticks","color","","color"),r.route("scale.grid","color","","borderColor"),r.route("scale.border","color","","borderColor"),r.route("scale.title","color","","color"),r.describe("scale",{_fallback:!1,_scriptable:c=>!c.startsWith("before")&&!c.startsWith("after")&&c!=="callback"&&c!=="parser",_indexable:c=>c!=="borderDash"&&c!=="tickBorderDash"&&c!=="dash"}),r.describe("scales",{_fallback:"scale"}),r.describe("scale.ticks",{_scriptable:c=>c!=="backdropPadding"&&c!=="callback",_indexable:c=>c!=="backdropPadding"})}const ii=Object.create(null),an=Object.create(null);function Ve(r,c){if(!c)return r;const f=c.split(".");for(let g=0,m=f.length;gg.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(g,m)=>ae(m.backgroundColor),this.hoverBorderColor=(g,m)=>ae(m.borderColor),this.hoverColor=(g,m)=>ae(m.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(c),this.apply(f)}set(c,f){return ni(this,c,f)}get(c){return Ve(this,c)}describe(c,f){return ni(an,c,f)}override(c,f){return ni(ii,c,f)}route(c,f,g,m){const x=Ve(this,c),v=Ve(this,g),k="_"+f;Object.defineProperties(x,{[k]:{value:x[f],writable:!0},[f]:{enumerable:!0,get(){const w=this[k],C=v[m];return yt(w)?Object.assign({},C,w):It(w,C)},set(w){this[k]=w}}})}apply(c){c.forEach(f=>f(this))}}var si=new xs({_scriptable:r=>!r.startsWith("on"),_indexable:r=>r!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ps,ms,_s]);function ln(r){return!r||re(r.size)||re(r.family)?null:(r.style?r.style+" ":"")+(r.weight?r.weight+" ":"")+r.size+"px "+r.family}function Pi(r,c,f,g,m){let x=c[m];return x||(x=c[m]=r.measureText(m).width,f.push(m)),x>g&&(g=x),g}function ys(r,c,f,g){g=g||{};let m=g.data=g.data||{},x=g.garbageCollect=g.garbageCollect||[];g.font!==c&&(m=g.data={},x=g.garbageCollect=[],g.font=c),r.save(),r.font=c;let v=0;const k=f.length;let w,C,T,H,Y;for(w=0;wf.length){for(w=0;w0&&r.stroke()}}function oi(r,c,f){return f=f||.5,!c||r&&r.x>c.left-f&&r.xc.top-f&&r.y0&&x.strokeColor!=="";let w,C;for(r.save(),r.font=m.string,ks(r,x),w=0;w+r||0;function Te(r,c){const f={},g=yt(c),m=g?Object.keys(c):c,x=yt(r)?g?v=>It(r[v],r[c[v]]):v=>r[v]:()=>r;for(const v of m)f[v]=pn(x(v));return f}function Oi(r){return Te(r,{top:"y",right:"x",bottom:"y",left:"x"})}function Os(r){return Te(r,["topLeft","topRight","bottomLeft","bottomRight"])}function Cs(r){const c=Oi(r);return c.width=c.left+c.right,c.height=c.top+c.bottom,c}function ai(r,c){r=r||{},c=c||si.font;let f=It(r.size,c.size);typeof f=="string"&&(f=parseInt(f,10));let g=It(r.style,c.style);g&&!(""+g).match(gn)&&(console.warn('Invalid font style specified: "'+g+'"'),g=void 0);const m={family:It(r.family,c.family),lineHeight:Ds(It(r.lineHeight,c.lineHeight),f),size:f,style:g,weight:It(r.weight,c.weight),string:""};return m.string=ln(m),m}function As(r,c,f,g){let m=!0,x,v,k;for(x=0,v=r.length;xf&&k===0?0:k+w;return{min:v(g,-Math.abs(x)),max:v(m,x)}}function Ci(r,c){return Object.assign(Object.create(r),c)}function Ai(r,c=[""],f,g,m=()=>r[0]){const x=f||r;typeof g>"u"&&(g=Mn("_fallback",r));const v={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:r,_rootScopes:x,_fallback:g,_getTarget:m,override:k=>Ai([k,...r],c,x,g)};return new Proxy(v,{deleteProperty(k,w){return delete k[w],delete k._keys,delete r[0][w],!0},get(k,w){return bn(k,w,()=>Es(w,c,r,k))},getOwnPropertyDescriptor(k,w){return Reflect.getOwnPropertyDescriptor(k._scopes[0],w)},getPrototypeOf(){return Reflect.getPrototypeOf(r[0])},has(k,w){return kn(k).includes(w)},ownKeys(k){return kn(k)},set(k,w,C){const T=k._storage||(k._storage=m());return k[w]=T[w]=C,delete k._keys,!0}})}function Ne(r,c,f,g){const m={_cacheable:!1,_proxy:r,_context:c,_subProxy:f,_stack:new Set,_descriptors:mn(r,g),setContext:x=>Ne(r,x,f,g),override:x=>Ne(r.override(x),c,f,g)};return new Proxy(m,{deleteProperty(x,v){return delete x[v],delete r[v],!0},get(x,v,k){return bn(x,v,()=>Ts(x,v,k))},getOwnPropertyDescriptor(x,v){return x._descriptors.allKeys?Reflect.has(r,v)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(r,v)},getPrototypeOf(){return Reflect.getPrototypeOf(r)},has(x,v){return Reflect.has(r,v)},ownKeys(){return Reflect.ownKeys(r)},set(x,v,k){return r[v]=k,delete x[v],!0}})}function mn(r,c={scriptable:!0,indexable:!0}){const{_scriptable:f=c.scriptable,_indexable:g=c.indexable,_allKeys:m=c.allKeys}=r;return{allKeys:m,scriptable:f,indexable:g,isScriptable:Be(f)?f:()=>f,isIndexable:Be(g)?g:()=>g}}const Le=(r,c)=>r?r+yi(c):c,Ee=(r,c)=>yt(c)&&r!=="adapters"&&(Object.getPrototypeOf(c)===null||c.constructor===Object);function bn(r,c,f){if(Object.prototype.hasOwnProperty.call(r,c))return r[c];const g=f();return r[c]=g,g}function Ts(r,c,f){const{_proxy:g,_context:m,_subProxy:x,_descriptors:v}=r;let k=g[c];return Be(k)&&v.isScriptable(c)&&(k=Ye(c,k,r,f)),Ft(k)&&k.length&&(k=_n(c,k,r,v.isIndexable)),Ee(c,k)&&(k=Ne(k,m,x&&x[c],v)),k}function Ye(r,c,f,g){const{_proxy:m,_context:x,_subProxy:v,_stack:k}=f;if(k.has(r))throw new Error("Recursion detected: "+Array.from(k).join("->")+"->"+r);k.add(r);let w=c(x,v||g);return k.delete(r),Ee(r,w)&&(w=Ti(m._scopes,m,r,w)),w}function _n(r,c,f,g){const{_proxy:m,_context:x,_subProxy:v,_descriptors:k}=f;if(typeof x.index<"u"&&g(r))return c[x.index%c.length];if(yt(c[0])){const w=c,C=m._scopes.filter(T=>T!==w);c=[];for(const T of w){const H=Ti(C,m,r,T);c.push(Ne(H,x,v&&v[r],k))}}return c}function xn(r,c,f){return Be(r)?r(c,f):r}const Ls=(r,c)=>r===!0?c:typeof r=="string"?xi(c,r):void 0;function yn(r,c,f,g,m){for(const x of c){const v=Ls(f,x);if(v){r.add(v);const k=xn(v._fallback,f,m);if(typeof k<"u"&&k!==f&&k!==g)return k}else if(v===!1&&typeof g<"u"&&f!==g)return null}return!1}function Ti(r,c,f,g){const m=c._rootScopes,x=xn(c._fallback,f,g),v=[...r,...m],k=new Set;k.add(g);let w=vn(k,v,f,x||f,g);return w===null||typeof x<"u"&&x!==f&&(w=vn(k,v,x,w,g),w===null)?!1:Ai(Array.from(k),[""],m,x,()=>Li(c,f,g))}function vn(r,c,f,g,m){for(;f;)f=yn(r,c,f,g,m);return f}function Li(r,c,f){const g=r._getTarget();c in g||(g[c]={});const m=g[c];return Ft(m)&&yt(f)?f:m||{}}function Es(r,c,f,g){let m;for(const x of c)if(m=Mn(Le(x,r),f),typeof m<"u")return Ee(r,m)?Ti(f,g,r,m):m}function Mn(r,c){for(const f of c){if(!f)continue;const g=f[r];if(typeof g<"u")return g}}function kn(r){let c=r._keys;return c||(c=r._keys=Rs(r._scopes)),c}function Rs(r){const c=new Set;for(const f of r)for(const g of Object.keys(f).filter(m=>!m.startsWith("_")))c.add(g);return Array.from(c)}function Fs(r,c,f,g){const{iScale:m}=r,{key:x="r"}=this._parsing,v=new Array(g);let k,w,C,T;for(k=0,w=g;kcr==="x"?"y":"x";function wn(r,c,f,g){const m=r.skip?c:r,x=c,v=f.skip?c:f,k=ye(x,m),w=ye(v,x);let C=k/(k+w),T=w/(k+w);C=isNaN(C)?0:C,T=isNaN(T)?0:T;const H=g*C,Y=g*T;return{previous:{x:x.x-H*(v.x-m.x),y:x.y-H*(v.y-m.y)},next:{x:x.x+Y*(v.x-m.x),y:x.y+Y*(v.y-m.y)}}}function ge(r,c,f){const g=r.length;let m,x,v,k,w,C=ve(r,0);for(let T=0;T!C.skip)),c.cubicInterpolationMode==="monotone")zs(r,m);else{let C=g?r[r.length-1]:r[0];for(x=0,v=r.length;xr.ownerDocument.defaultView.getComputedStyle(r,null);function Ri(r,c){return hi(r).getPropertyValue(c)}const Pn=["top","right","bottom","left"];function me(r,c,f){const g={};f=f?"-"+f:"";for(let m=0;m<4;m++){const x=Pn[m];g[x]=parseFloat(r[c+"-"+x+f])||0}return g.width=g.left+g.right,g.height=g.top+g.bottom,g}const Dn=(r,c,f)=>(r>0||c>0)&&(!f||!f.shadowRoot);function Ws(r,c){const f=r.touches,g=f&&f.length?f[0]:r,{offsetX:m,offsetY:x}=g;let v=!1,k,w;if(Dn(m,x,r.target))k=m,w=x;else{const C=c.getBoundingClientRect();k=g.clientX-C.left,w=g.clientY-C.top,v=!0}return{x:k,y:w,box:v}}function js(r,c){if("native"in r)return r;const{canvas:f,currentDevicePixelRatio:g}=c,m=hi(f),x=m.boxSizing==="border-box",v=me(m,"padding"),k=me(m,"border","width"),{x:w,y:C,box:T}=Ws(r,f),H=v.left+(T&&k.left),Y=v.top+(T&&k.top);let{width:rt,height:pt}=c;return x&&(rt-=v.width+k.width,pt-=v.height+k.height),{x:Math.round((w-H)/rt*f.width/g),y:Math.round((C-Y)/pt*f.height/g)}}function Vs(r,c,f){let g,m;if(c===void 0||f===void 0){const x=ci(r);if(!x)c=r.clientWidth,f=r.clientHeight;else{const v=x.getBoundingClientRect(),k=hi(x),w=me(k,"border","width"),C=me(k,"padding");c=v.width-C.width-w.width,f=v.height-C.height-w.height,g=pe(k.maxWidth,x,"clientWidth"),m=pe(k.maxHeight,x,"clientHeight")}}return{width:c,height:f,maxWidth:g||de,maxHeight:m||de}}const di=r=>Math.round(r*10)/10;function On(r,c,f,g){const m=hi(r),x=me(m,"margin"),v=pe(m.maxWidth,r,"clientWidth")||de,k=pe(m.maxHeight,r,"clientHeight")||de,w=Vs(r,c,f);let{width:C,height:T}=w;if(m.boxSizing==="content-box"){const Y=me(m,"border","width"),rt=me(m,"padding");C-=rt.width+Y.width,T-=rt.height+Y.height}return C=Math.max(0,C-x.width),T=Math.max(0,g?C/g:T-x.height),C=di(Math.min(C,v,w.maxWidth)),T=di(Math.min(T,k,w.maxHeight)),C&&!T&&(T=di(C/2)),(c!==void 0||f!==void 0)&&g&&w.height&&T>w.height&&(T=w.height,C=di(Math.floor(T*g))),{width:C,height:T}}function Hs(r,c,f){const g=c||1,m=Math.floor(r.height*g),x=Math.floor(r.width*g);r.height=Math.floor(r.height),r.width=Math.floor(r.width);const v=r.canvas;return v.style&&(f||!v.style.height&&!v.style.width)&&(v.style.height=`${r.height}px`,v.style.width=`${r.width}px`),r.currentDevicePixelRatio!==g||v.height!==m||v.width!==x?(r.currentDevicePixelRatio=g,v.height=m,v.width=x,r.ctx.setTransform(g,0,0,g,0,0),!0):!1}const Ns=function(){let r=!1;try{const c={get passive(){return r=!0,!1}};Sn()&&(window.addEventListener("test",null,c),window.removeEventListener("test",null,c))}catch{}return r}();function Ys(r,c){const f=Ri(r,c),g=f&&f.match(/^(\d+)(\.\d+)?px$/);return g?+g[1]:void 0}function Me(r,c,f,g){return{x:r.x+f*(c.x-r.x),y:r.y+f*(c.y-r.y)}}function Cn(r,c,f,g){return{x:r.x+f*(c.x-r.x),y:g==="middle"?f<.5?r.y:c.y:g==="after"?f<1?r.y:c.y:f>0?c.y:r.y}}function An(r,c,f,g){const m={x:r.cp2x,y:r.cp2y},x={x:c.cp1x,y:c.cp1y},v=Me(r,m,f),k=Me(m,x,f),w=Me(x,c,f),C=Me(v,k,f),T=Me(k,w,f);return Me(C,T,f)}const $s=function(r,c){return{x(f){return r+r+c-f},setWidth(f){c=f},textAlign(f){return f==="center"?f:f==="right"?"left":"right"},xPlus(f,g){return f-g},leftForLtr(f,g){return f-g}}},Us=function(){return{x(r){return r},setWidth(r){},textAlign(r){return r},xPlus(r,c){return r+c},leftForLtr(r,c){return r}}};function Xs(r,c,f){return r?$s(c,f):Us()}function Fi(r,c){let f,g;(c==="ltr"||c==="rtl")&&(f=r.canvas.style,g=[f.getPropertyValue("direction"),f.getPropertyPriority("direction")],f.setProperty("direction",c,"important"),r.prevTextDirection=g)}function Ks(r,c){c!==void 0&&(delete r.prevTextDirection,r.canvas.style.setProperty("direction",c[0],c[1]))}function ui(r){return r==="angle"?{between:Qi,compare:Gi,normalize:se}:{between:Je,compare:(c,f)=>c-f,normalize:c=>c}}function Ii({start:r,end:c,count:f,loop:g,style:m}){return{start:r%f,end:c%f,loop:g&&(c-r+1)%f===0,style:m}}function Tn(r,c,f){const{property:g,start:m,end:x}=f,{between:v,normalize:k}=ui(g),w=c.length;let{start:C,end:T,loop:H}=r,Y,rt;if(H){for(C+=w,T+=w,Y=0,rt=w;Yw(m,$e,Ot)&&k(m,$e)!==0,Rn=()=>k(x,Ot)===0||w(x,$e,Ot),io=()=>U||eo(),Fn=()=>!U||Rn();for(let be=T,In=T;be<=H;++be)Fe=c[be%v],!Fe.skip&&(Ot=C(Fe[g]),Ot!==$e&&(U=w(Ot,m,x),V===null&&io()&&(V=k(Ot,m)===0?be:In),V!==null&&Fn()&&(pt.push(Ii({start:V,end:be,loop:Y,count:v,style:rt})),V=null),In=be,$e=Ot));return V!==null&&pt.push(Ii({start:V,end:H,loop:Y,count:v,style:rt})),pt}function Gs(r,c){const f=[],g=r.segments;for(let m=0;mm&&r[x%c].skip;)x--;return x%=c,{start:m,end:x}}function qs(r,c,f,g){const m=r.length,x=[];let v=c,k=r[c],w;for(w=c+1;w<=f;++w){const C=r[w%m];C.skip||C.stop?k.skip||(g=!1,x.push({start:c%m,end:(w-1)%m,loop:g}),c=v=C.stop?w:null):(v=w,k.skip&&(c=w)),k=C}return v!==null&&x.push({start:c%m,end:v%m,loop:g}),x}function Zs(r,c){const f=r.points,g=r.options.spanGaps,m=f.length;if(!m)return[];const x=!!r._loop,{start:v,end:k}=Qs(f,m,x,g);if(g===!0)return Ln(r,[{start:v,end:k,loop:x}],f,c);const w=k0&&z<7?z:1;return W(et).isoWeekday(q).startOf("day").valueOf()}return W(et).startOf(ft).valueOf()},endOf:function(et,ft){return W(et).endOf(ft).valueOf()}})},"./node_modules/vue-chartjs/dist/index.js":function(vt,nt,G){"use strict";G.d(nt,{N1:function(){return At},yP:function(){return Gt}});var d=G("./node_modules/chart.js/dist/chart.js"),W=G("./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"),X=G("./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");const Q={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},j={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Q,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},at=W.rE[0]==="2"?(N,tt)=>Object.assign(N,{attrs:tt}):(N,tt)=>Object.assign(N,tt);function K(N){return(0,X.ju)(N)?(0,X.ux)(N):N}function lt(N){let tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:N;return(0,X.ju)(tt)?new Proxy(N,{}):N}function et(N,tt){const st=N.options;st&&tt&&Object.assign(st,tt)}function ft(N,tt){N.labels=tt}function z(N,tt,st){const wt=[];N.datasets=tt.map(bt=>{const ot=N.datasets.find(Lt=>Lt[st]===bt[st]);return!ot||!bt.data||wt.includes(ot)?{...bt}:(wt.push(ot),Object.assign(ot,bt),ot)})}function q(N,tt){const st={labels:[],datasets:[]};return ft(st,N.labels),z(st,N.datasets,tt),st}function ct(N,tt){return N.getElementsAtEventForMode(tt,"dataset",{intersect:!0},!1)}function ht(N,tt){return N.getElementsAtEventForMode(tt,"nearest",{intersect:!0},!1)}function Pt(N,tt){return N.getElementsAtEventForMode(tt,"index",{intersect:!0},!1)}const Bt=(0,W.pM)({props:j,setup(N,tt){let{expose:st,slots:wt}=tt;const bt=(0,X.KR)(null),ot=(0,X.IJ)(null);st({chart:ot});const Lt=()=>{if(!bt.value)return;const{type:Et,data:ne,options:he,plugins:Qt,datasetIdKey:Nt}=N,qt=q(ne,Nt),St=lt(qt,ne);ot.value=new d.t1(bt.value,{type:Et,data:St,options:{...he},plugins:Qt})},Ht=()=>{const Et=(0,X.ux)(ot.value);Et&&(N.destroyDelay>0?setTimeout(()=>{Et.destroy(),ot.value=null},N.destroyDelay):(Et.destroy(),ot.value=null))},we=Et=>{Et.update(N.updateMode)};return(0,W.sV)(Lt),(0,W.hi)(Ht),(0,W.wB)([()=>N.options,()=>N.data],(Et,ne)=>{let[he,Qt]=Et,[Nt,qt]=ne;const St=(0,X.ux)(ot.value);if(!St)return;let $t=!1;if(he){const Rt=K(he),Yt=K(Nt);Rt&&Rt!==Yt&&(et(St,Rt),$t=!0)}if(Qt){const Rt=K(Qt.labels),Yt=K(qt.labels),Mt=K(Qt.datasets),Se=K(qt.datasets);Rt!==Yt&&(ft(St.config.data,Rt),$t=!0),Mt&&Mt!==Se&&(z(St.config.data,Mt,N.datasetIdKey),$t=!0)}$t&&(0,W.dY)(()=>{we(St)})},{deep:!0}),()=>(0,W.h)("canvas",{role:"img",ariaLabel:N.ariaLabel,ariaDescribedby:N.ariaDescribedby,ref:bt},[(0,W.h)("p",{},[wt.default?wt.default():""])])}});function Kt(N,tt){return d.t1.register(tt),(0,W.pM)({props:Q,setup(st,wt){let{expose:bt}=wt;const ot=(0,X.IJ)(null),Lt=Ht=>{ot.value=Ht?.chart};return bt({chart:ot}),()=>(0,W.h)(Bt,at({ref:Lt},{type:N,...st}))}})}const Gt=Kt("bar",d.A6),Wt=null,At=Kt("line",d.ZT),Tt=null,jt=null,Dt=null,xt=null,Vt=null}}]);