@bikdotai/bik-component-library 0.0.627 → 0.0.628-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Funnel/Funnel.d.ts +7 -0
  7. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  8. package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
  9. package/dist/cjs/components/checkBox/CheckBox.d.ts +1 -0
  10. package/dist/cjs/components/checkBox/CheckBox.js +1 -1
  11. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  12. package/dist/cjs/components/dropdown/type.d.ts +1 -0
  13. package/dist/cjs/components/radioButton/RadioButton.d.ts +1 -0
  14. package/dist/cjs/components/radioButton/RadioButton.js +1 -1
  15. package/dist/cjs/node_modules/@kurkle/color/dist/color.esm.js +8 -0
  16. package/dist/cjs/node_modules/chart.js/auto/auto.js +1 -0
  17. package/dist/cjs/node_modules/chart.js/dist/chart.js +7 -0
  18. package/dist/cjs/node_modules/chart.js/dist/chunks/helpers.segment.js +7 -0
  19. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  20. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  21. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  22. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  23. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  24. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Funnel/Funnel.d.ts +7 -0
  25. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  26. package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
  27. package/dist/esm/components/checkBox/CheckBox.d.ts +1 -0
  28. package/dist/esm/components/checkBox/CheckBox.js +1 -1
  29. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  30. package/dist/esm/components/dropdown/type.d.ts +1 -0
  31. package/dist/esm/components/radioButton/RadioButton.d.ts +1 -0
  32. package/dist/esm/components/radioButton/RadioButton.js +1 -1
  33. package/dist/esm/node_modules/@kurkle/color/dist/color.esm.js +7 -0
  34. package/dist/esm/node_modules/chart.js/auto/auto.js +1 -0
  35. package/dist/esm/node_modules/chart.js/dist/chart.js +7 -0
  36. package/dist/esm/node_modules/chart.js/dist/chunks/helpers.segment.js +7 -0
  37. package/package.json +3 -2
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./chunks/helpers.segment.js");
2
+ /*!
3
+ * Chart.js v4.4.7
4
+ * https://www.chartjs.org
5
+ * (c) 2024 Chart.js Contributors
6
+ * Released under the MIT License
7
+ */class e{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=t.r.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var i=new e;const s="transparent",n={boolean:(t,e,i)=>i>.5?e:t,color(e,i,n){const o=t.c(e||s),a=o.valid&&t.c(i||s);return a&&a.valid?a.mix(o,n).hexString():i},number:(t,e,i)=>t+(e-t)*i};class o{constructor(e,i,s,o){const a=i[s];o=t.a([e.to,o,a,e.from]);const r=t.a([e.from,a,o]);this._active=!0,this._fn=e.fn||n[e.type||typeof r],this._easing=t.e[e.easing]||t.e.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=i,this._prop=s,this._from=r,this._to=o,this._promises=void 0}active(){return this._active}update(e,i,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=t.a([e.to,i,n,e.from]),this._from=t.a([e.from,n,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e<i),!this._active)return this._target[s]=a,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class a{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(e){if(!t.i(e))return;const i=Object.keys(t.d.animation),s=this._properties;Object.getOwnPropertyNames(e).forEach((n=>{const o=e[n];if(!t.i(o))return;const a={};for(const t of i)a[t]=o[t];(t.b(o.properties)&&o.properties||[n]).forEach((t=>{t!==n&&s.has(t)||s.set(t,a)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let h;for(h=a.length-1;h>=0;--h){const l=a[h];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const c=e[l];let d=n[l];const u=i.get(l);if(d){if(u&&d.active()){d.update(u,c,r);continue}d.cancel()}u&&u.duration?(n[l]=d=new o(u,t,l,c),s.push(d)):t[l]=c}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const s=this._createAnimations(t,e);return s.length?(i.add(this._chart,s),!0):void 0}}function r(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function h(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function l(e,i,s,n={}){const o=e.keys,a="single"===n.mode;let r,h,l,c;if(null===i)return;let d=!1;for(r=0,h=o.length;r<h;++r){if(l=+o[r],l===s){if(d=!0,n.all)continue;break}c=e.values[l],t.g(c)&&(a||0===i||t.s(i)===t.s(c))&&(i+=c)}return d||n.all?i:0}function c(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function d(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function u(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function g(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,h=o.axis,l=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),g=e.length;let p;for(let t=0;t<g;++t){const i=e[t],{[h]:o,[l]:g}=i;p=(i._stacks||(i._stacks={}))[l]=d(n,c,o),p[r]=g,p._top=u(p,a,!0,s.type),p._bottom=u(p,a,!1,s.type);(p._visualValues||(p._visualValues={}))[r]=g}}function p(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function f(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const m=t=>"reset"===t||"none"===t,x=(t,e)=>e?t:Object.assign({},t);class b{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=c(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&&f(this._cachedMeta),this.index=t}linkScales(){const e=this.chart,i=this._cachedMeta,s=this.getDataset(),n=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,o=i.xAxisID=t.v(s.xAxisID,p(e,"x")),a=i.yAxisID=t.v(s.yAxisID,p(e,"y")),r=i.rAxisID=t.v(s.rAxisID,p(e,"r")),h=i.indexAxis,l=i.iAxisID=n(h,o,a,r),c=i.vAxisID=n(h,a,o,r);i.xScale=this.getScaleForId(o),i.yScale=this.getScaleForId(a),i.rScale=this.getScaleForId(r),i.iScale=this.getScaleForId(l),i.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&t.u(this._data,this),e._stacked&&f(e)}_dataCheck(){const e=this.getDataset(),i=e.data||(e.data=[]),s=this._data;if(t.i(i)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let h,l,c;for(h=0,l=a.length;h<l;++h)c=a[h],r[h]={[n]:c,[o]:t[c]};return r}(i,t)}else if(s!==i){if(s){t.u(s,this);const e=this._cachedMeta;f(e),e._parsed=[]}i&&Object.isExtensible(i)&&t.l(i,this),this._syncList=[],this._data=i}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=c(e.vScale,e),e.stack!==i.stack&&(s=!0,f(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(g(this,e._parsed),e._stacked=c(e.vScale,e))}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(e,i){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:a}=s,r=o.axis;let h,l,c,d=0===e&&i===n.length||s._sorted,u=e>0&&s._parsed[e-1];if(!1===this._parsing)s._parsed=n,s._sorted=!0,c=n;else{c=t.b(n[e])?this.parseArrayData(s,n,e,i):t.i(n[e])?this.parseObjectData(s,n,e,i):this.parsePrimitiveData(s,n,e,i);const o=()=>null===l[r]||u&&l[r]<u[r];for(h=0;h<i;++h)s._parsed[h+e]=l=c[h],d&&(o()&&(d=!1),u=l);s._sorted=d}a&&g(this,c)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,a=n.axis,r=o.axis,h=n.getLabels(),l=n===o,c=new Array(s);let d,u,g;for(d=0,u=s;d<u;++d)g=d+i,c[d]={[a]:l||n.parse(h[g],g),[r]:o.parse(e[g],g)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,a=new Array(s);let r,h,l,c;for(r=0,h=s;r<h;++r)l=r+i,c=e[l],a[r]={x:n.parse(c[0],l),y:o.parse(c[1],l)};return a}parseObjectData(e,i,s,n){const{xScale:o,yScale:a}=e,{xAxisKey:r="x",yAxisKey:h="y"}=this._parsing,l=new Array(n);let c,d,u,g;for(c=0,d=n;c<d;++c)u=c+s,g=i[u],l[c]={x:o.parse(t.f(g,r),u),y:a.parse(t.f(g,h),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return l({keys:h(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=l(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(e,i){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&e===s.iScale,a=n.length,r=this._getOtherScale(e),l=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:h(i,!0),values:null})(i,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let g,p;function f(){p=n[g];const i=p[r.axis];return!t.g(p[e.axis])||d>i||u<i}for(g=0;g<a&&(f()||(this.updateRangeFromParsed(c,e,p,l),!o));++g);if(o)for(g=a-1;g>=0;--g)if(!f()){this.updateRangeFromParsed(c,e,p,l);break}return c}getAllParsedValues(e){const i=this._cachedMeta._parsed,s=[];let n,o,a;for(n=0,o=i.length;n<o;++n)a=i[n][e.axis],t.g(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(e){const i=this._cachedMeta;this.update(e||"default"),i._clip=function(e){let i,s,n,o;return t.i(e)?(i=e.top,s=e.right,n=e.bottom,o=e.left):i=s=n=o=e,{top:i,right:s,bottom:n,left:o,disabled:!1===e}}(t.v(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=r(t,i),n=r(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,h=this.options.drawActiveElementsOnTop;let l;for(i.dataset&&i.dataset.draw(t,n,a,r),l=a;l<a+r;++l){const e=s[l];e.hidden||(e.active&&h?o.push(e):e.draw(t,n))}for(l=0;l<o.length;++l)o[l].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(e,i,s){const n=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const i=this._cachedMeta.data[e];o=i.$context||(i.$context=function(e,i,s){return t.j(e,{active:!1,dataIndex:i,parsed:void 0,raw:void 0,element:s,index:i,mode:"default",type:"data"})}(this.getContext(),e,i)),o.parsed=this.getParsed(e),o.raw=n.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=function(e,i){return t.j(e,{active:!1,dataset:void 0,datasetIndex:i,index:i,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!i,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(e,i="default",s){const n="active"===i,o=this._cachedDataOpts,a=e+"-"+i,r=o[a],h=this.enableOptionSharing&&t.h(s);if(r)return x(r,h);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),d=n?[`${e}Hover`,"hover",e,""]:[e,""],u=l.getOptionScopes(this.getDataset(),c),g=Object.keys(t.d.elements[e]),p=l.resolveNamedOptions(u,g,(()=>this.getContext(s,n,i)),d);return p.$shared&&(p.$shared=h,o[a]=Object.freeze(x(p,h))),p}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,r=n[o];if(r)return r;let h;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);h=s.createResolver(o,this.getContext(t,i,e))}const l=new a(s,h&&h.animations);return h&&h._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||m(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){m(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!m(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}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[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&f(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function _(e){const i=e.iScale,s=function(e,i){if(!e._cache.$bar){const s=e.getMatchingVisibleMetas(i);let n=[];for(let t=0,i=s.length;t<i;t++)n=n.concat(s[t].controller.getAllParsedValues(e));e._cache.$bar=t._(n.sort(((t,e)=>t-e)))}return e._cache.$bar}(i,e.type);let n,o,a,r,h=i._length;const l=()=>{32767!==a&&-32768!==a&&(t.h(r)&&(h=Math.min(h,Math.abs(a-r)||h)),r=a)};for(n=0,o=s.length;n<o;++n)a=i.getPixelForValue(s[n]),l();for(r=void 0,n=0,o=i.ticks.length;n<o;++n)a=i.getPixelForTick(n),l();return h}function y(e,i,s,n){return t.b(e)?function(t,e,i,s){const n=i.parse(t[0],s),o=i.parse(t[1],s),a=Math.min(n,o),r=Math.max(n,o);let h=a,l=r;Math.abs(a)>Math.abs(r)&&(h=r,l=a),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:n,end:o,min:a,max:r}}(e,i,s,n):i[s.axis]=s.parse(e,n),i}function v(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,h=[];let l,c,d,u;for(l=i,c=i+s;l<c;++l)u=e[l],d={},d[n.axis]=r||n.parse(a[l],l),h.push(y(u,d,o,l));return h}function M(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function w(t,e,i,s){let n=e.borderSkipped;const o={};if(!n)return void(t.borderSkipped=o);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:r,reverse:h,top:l,bottom:c}=function(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",o="start"):(n="start",o="end"),{start:i,end:s,reverse:e,top:n,bottom:o}}(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=l:(i._bottom||0)===s?n=c:(o[k(c,a,r,h)]=!0,n=l)),o[k(n,a,r,h)]=!0,t.borderSkipped=o}function k(t,e,i,s){var n,o,a;return s?(a=i,t=S(t=(n=t)===(o=e)?a:n===a?o:n,i,e)):t=S(t,e,i),t}function S(t,e,i){return"start"===t?e:"end"===t?i:t}function D(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class P extends b{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return v(t,e,i,s)}parseArrayData(t,e,i,s){return v(t,e,i,s)}parseObjectData(e,i,s,n){const{iScale:o,vScale:a}=e,{xAxisKey:r="x",yAxisKey:h="y"}=this._parsing,l="x"===o.axis?r:h,c="x"===a.axis?r:h,d=[];let u,g,p,f;for(u=s,g=s+n;u<g;++u)f=i[u],p={},p[o.axis]=o.parse(t.f(f,l),u),d.push(y(t.f(f,c),p,a,u));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),o=n._custom,a=M(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(e,i,s,n){const o="reset"===n,{index:a,_cachedMeta:{vScale:r}}=this,h=r.getBasePixel(),l=r.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(i,n);for(let g=i;g<i+s;g++){const i=this.getParsed(g),s=o||t.k(i[r.axis])?{base:h,head:h}:this._calculateBarValuePixels(g),p=this._calculateBarIndexPixels(g,c),f=(i._stacks||{})[r.axis],m={horizontal:l,base:s.base,enableBorderRadius:!f||M(i._custom)||a===f._top||a===f._bottom,x:l?s.head:p.center,y:l?p.center:s.head,height:l?p.size:Math.abs(s.size),width:l?Math.abs(s.size):p.size};u&&(m.options=d||this.resolveDataElementOptions(g,e[g].active?"active":n));const x=m.options||e[g].options;w(m,x,f,a),D(m,x,c.ratio),this.updateElement(e[g],g,m,n)}}_getStacks(e,i){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),o=s.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(i),h=r&&r[s.axis],l=e=>{const i=e._parsed.find((t=>t[s.axis]===h)),n=i&&i[e.vScale.axis];if(t.k(n)||isNaN(n))return!0};for(const t of n)if((void 0===i||!l(t))&&((!1===o||-1===a.indexOf(t.stack)||void 0===o&&void 0===t.stack)&&a.push(t.stack),t.index===e))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n<o;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const a=t.barThickness;return{min:a||_(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:i,_stacked:s,index:n},options:{base:o,minBarLength:a}}=this,r=o||0,h=this.getParsed(e),l=h._custom,c=M(l);let d,u,g=h[i.axis],p=0,f=s?this.applyStack(i,h,s):g;f!==g&&(p=f-g,f=g),c&&(g=l.barStart,f=l.barEnd-l.barStart,0!==g&&t.s(g)!==t.s(l.barEnd)&&(p=0),p+=g);const m=t.k(o)||c?p:o;let x=i.getPixelForValue(m);if(d=this.chart.getDataVisibility(e)?i.getPixelForValue(p+f):x,u=d-x,Math.abs(u)<a){u=function(e,i,s){return 0!==e?t.s(e):(i.isHorizontal()?1:-1)*(i.min>=s?1:-1)}(u,i,r)*a,g===r&&(x-=u/2);const e=i.getPixelForDecimal(0),o=i.getPixelForDecimal(1),l=Math.min(e,o),p=Math.max(e,o);x=Math.max(Math.min(x,p),l),d=x+u,s&&!c&&(h._stacks[i.axis]._visualValues[n]=i.getValueForPixel(d)-i.getValueForPixel(x))}if(x===i.getPixelForValue(r)){const e=t.s(u)*i.getLineWidthForValue(r)/2;x+=e,u-=e}return{size:u,base:x,head:d,center:d+u/2}}_calculateBarIndexPixels(e,i){const s=i.scale,n=this.options,o=n.skipNull,a=t.v(n.maxBarThickness,1/0);let r,h;if(i.grouped){const s=o?this._getStackCount(e):i.stackCount,l="flex"===n.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const h=i.categoryPercentage;null===a&&(a=o-(null===r?e.end-e.start:r-o)),null===r&&(r=o+o-a);const l=o-(o-Math.min(a,r))/2*h;return{chunk:Math.abs(r-a)/2*h/s,ratio:i.barPercentage,start:l}}(e,i,n,s):function(e,i,s,n){const o=s.barThickness;let a,r;return t.k(o)?(a=i.min*s.categoryPercentage,r=s.barPercentage):(a=o*n,r=1),{chunk:a/n,ratio:r,start:i.pixels[e]-a/2}}(e,i,n,s),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);r=l.start+l.chunk*c+l.chunk/2,h=Math.min(a,l.chunk*l.ratio)}else r=s.getPixelForValue(this.getParsed(e)[s.axis],e),h=Math.min(a,i.min*i.ratio);return{base:r-h/2,head:r+h/2,center:r,size:h}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null===this.getParsed(n)[e.axis]||i[n].hidden||i[n].draw(this._ctx)}}class C extends b{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<n.length;t++)n[t]._custom=this.resolveDataElementOptions(t+i).radius;return n}parseArrayData(e,i,s,n){const o=super.parseArrayData(e,i,s,n);for(let e=0;e<o.length;e++){const n=i[s+e];o[e]._custom=t.v(n[2],this.resolveDataElementOptions(e+s).radius)}return o}parseObjectData(e,i,s,n){const o=super.parseObjectData(e,i,s,n);for(let e=0;e<o.length;e++){const n=i[s+e];o[e]._custom=t.v(n&&n.r&&+n.r,this.resolveDataElementOptions(e+s).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=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:s,yScale:n}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y),h=o._custom;return{label:i[t]||"",value:"("+a+", "+r+(h?", "+h:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:r,includeOptions:h}=this._getSharedOptions(e,s),l=o.axis,c=a.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!n&&this.getParsed(d),u={},g=u[l]=n?o.getPixelForDecimal(.5):o.getPixelForValue(i[l]),p=u[c]=n?a.getBasePixel():a.getPixelForValue(i[c]);u.skip=isNaN(g)||isNaN(p),h&&(u.options=r||this.resolveDataElementOptions(d,e.active?"active":s),n&&(u.options.radius=0)),this.updateElement(e,d,u,s)}}resolveDataElementOptions(e,i){const s=this.getParsed(e);let n=super.resolveDataElementOptions(e,i);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const o=n.radius;return"active"!==i&&(n.radius=0),n.radius+=t.v(s&&s._custom,o),n}}class A extends b{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};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(e,i){const s=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=s;else{let o,a,r=t=>+s[t];if(t.i(s[e])){const{key:e="value"}=this._parsing;r=i=>+t.f(s[i],e)}for(o=e,a=e+i;o<a;++o)n._parsed[o]=r(o)}}_getRotation(){return t.t(this.options.rotation-90)}_getCircumference(){return t.t(this.options.circumference)}_getRotationExtents(){let e=t.T,i=-t.T;for(let t=0;t<this.chart.data.datasets.length;++t)if(this.chart.isDatasetVisible(t)&&this.chart.getDatasetMeta(t).type===this._type){const s=this.chart.getDatasetMeta(t).controller,n=s._getRotation(),o=s._getCircumference();e=Math.min(e,n),i=Math.max(i,n+o)}return{rotation:e,circumference:i-e}}update(e){const i=this.chart,{chartArea:s}=i,n=this._cachedMeta,o=n.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(s.width,s.height)-a)/2,0),h=Math.min(t.m(this.options.cutout,r),1),l=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:g,offsetX:p,offsetY:f}=function(e,i,s){let n=1,o=1,a=0,r=0;if(i<t.T){const h=e,l=h+i,c=Math.cos(h),d=Math.sin(h),u=Math.cos(l),g=Math.sin(l),p=(e,i,n)=>t.p(e,h,l,!0)?1:Math.max(i,i*s,n,n*s),f=(e,i,n)=>t.p(e,h,l,!0)?-1:Math.min(i,i*s,n,n*s),m=p(0,c,u),x=p(t.H,d,g),b=f(t.P,c,u),_=f(t.P+t.H,d,g);n=(m-b)/2,o=(x-_)/2,a=-(m+b)/2,r=-(x+_)/2}return{ratioX:n,ratioY:o,offsetX:a,offsetY:r}}(d,c,h),m=(s.width-a)/u,x=(s.height-a)/g,b=Math.max(Math.min(m,x)/2,0),_=t.n(this.options.radius,b),y=(_-Math.max(_*h,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=f*_,n.total=this.calculateTotal(),this.outerRadius=_-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(o,0,o.length,e)}_circumference(e,i){const s=this.options,n=this._cachedMeta,o=this._getCircumference();return i&&s.animation.animateRotate||!this.chart.getDataVisibility(e)||null===n._parsed[e]||n.data[e].hidden?0:this.calculateCircumference(n._parsed[e]*o/t.T)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,h=(a.left+a.right)/2,l=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,s);let f,m=this._getRotation();for(f=0;f<e;++f)m+=this._circumference(f,n);for(f=e;f<e+i;++f){const e=this._circumference(f,n),i=t[f],o={x:h+this.offsetX,y:l+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:u,innerRadius:d};p&&(o.options=g||this.resolveDataElementOptions(f,i.active?"active":s)),m+=e,this.updateElement(i,f,o,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(e){const i=this._cachedMeta.total;return i>0&&!isNaN(e)?t.T*(Math.abs(e)/i):0}getLabelAndValue(e){const i=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=t.o(i._parsed[e],s.options.locale);return{label:n[e]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)r=a.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(e){return Math.max(t.v(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class L extends b{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const i=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=i,a=this.chart._animationsDisabled;let{start:r,count:h}=t.q(i,n,a);this._drawStart=r,this._drawCount=h,t.w(i)&&(r=0,h=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:l},e),this.updateElements(n,r,h,e)}updateElements(e,i,s,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:h,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(i,n),u=a.axis,g=r.axis,{spanGaps:p,segment:f}=this.options,m=t.x(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===n,b=i+s,_=e.length;let y=i>0&&this.getParsed(i-1);for(let s=0;s<_;++s){const p=e[s],_=x?p:{};if(s<i||s>=b){_.skip=!0;continue}const v=this.getParsed(s),M=t.k(v[g]),w=_[u]=a.getPixelForValue(v[u],s),k=_[g]=o||M?r.getBasePixel():r.getPixelForValue(h?this.applyStack(r,v,h):v[g],s);_.skip=isNaN(w)||isNaN(k)||M,_.stop=s>0&&Math.abs(v[u]-y[u])>m,f&&(_.parsed=v,_.raw=l.data[s]),d&&(_.options=c||this.resolveDataElementOptions(s,p.active?"active":n)),x||this.updateElement(p,s,_,n),y=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class O extends b{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}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}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const i=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=t.o(i._parsed[e].r,s.options.locale);return{label:n[e]||"",value:o}}parseObjectData(e,i,s,n){return t.y.bind(this)(e,i,s,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(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(e,i,s,n){const o="reset"===n,a=this.chart,r=a.options.animation,h=this._cachedMeta.rScale,l=h.xCenter,c=h.yCenter,d=h.getIndexAngle(0)-.5*t.P;let u,g=d;const p=360/this.countVisibleElements();for(u=0;u<i;++u)g+=this._computeAngle(u,n,p);for(u=i;u<i+s;u++){const t=e[u];let i=g,s=g+this._computeAngle(u,n,p),f=a.getDataVisibility(u)?h.getDistanceFromCenterForValue(this.getParsed(u).r):0;g=s,o&&(r.animateScale&&(f=0),r.animateRotate&&(i=s=d));const m={x:l,y:c,innerRadius:0,outerRadius:f,startAngle:i,endAngle:s,options:this.resolveDataElementOptions(u,t.active?"active":n)};this.updateElement(t,u,m,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(e,i,s){return this.chart.getDataVisibility(e)?t.t(this.resolveDataElementOptions(e,i).angle||s):0}}class E extends A{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class T extends b{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(e,i,s,n){return t.y.bind(this)(e,i,s,n)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,o="reset"===s;for(let a=e;a<e+i;a++){const e=t[a],i=this.resolveDataElementOptions(a,e.active?"active":s),r=n.getPointPositionForValue(a,this.getParsed(a).r),h=o?n.xCenter:r.x,l=o?n.yCenter:r.y,c={x:h,y:l,angle:r.angle,skip:isNaN(h)||isNaN(l),options:i};this.updateElement(e,a,c,s)}}}class z extends b{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+r+")"}}update(e){const i=this._cachedMeta,{data:s=[]}=i,n=this.chart._animationsDisabled;let{start:o,count:a}=t.q(i,s,n);if(this._drawStart=o,this._drawCount=a,t.w(i)&&(o=0,a=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:t,_dataset:o}=i;t._chart=this.chart,t._datasetIndex=this.index,t._decimated=!!o._decimated,t.points=s;const a=this.resolveDatasetElementOptions(e);a.segment=this.options.segment,this.updateElement(t,void 0,{animated:!n,options:a},e)}else this.datasetElementType&&(delete i.dataset,this.datasetElementType=!1);this.updateElements(s,o,a,e)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,i,s,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:h,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(i,n),d=this.getSharedOptions(c),u=this.includeOptions(n,d),g=a.axis,p=r.axis,{spanGaps:f,segment:m}=this.options,x=t.x(f)?f:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||"none"===n;let _=i>0&&this.getParsed(i-1);for(let c=i;c<i+s;++c){const i=e[c],s=this.getParsed(c),f=b?i:{},y=t.k(s[p]),v=f[g]=a.getPixelForValue(s[g],c),M=f[p]=o||y?r.getBasePixel():r.getPixelForValue(h?this.applyStack(r,s,h):s[p],c);f.skip=isNaN(v)||isNaN(M)||y,f.stop=c>0&&Math.abs(s[g]-_[g])>x,m&&(f.parsed=s,f.raw=l.data[c]),u&&(f.options=d||this.resolveDataElementOptions(c,i.active?"active":n)),b||this.updateElement(i,c,f,n),_=s}this.updateSharedOptions(d,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,n,o)/2}}var R=Object.freeze({__proto__:null,BarController:P,BubbleController:C,DoughnutController:A,LineController:L,PieController:E,PolarAreaController:O,RadarController:T,ScatterController:z});function F(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class I{static override(t){Object.assign(I.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return F()}parse(){return F()}format(){return F()}add(){return F()}diff(){return F()}startOf(){return F()}endOf(){return F()}}var V={_date:I};function B(e,i,s,n){const{controller:o,data:a,_sorted:r}=e,h=o._cachedMeta.iScale;if(h&&i===h.axis&&"r"!==i&&r&&a.length){const e=h._reversePixels?t.A:t.B;if(!n)return e(a,i,s);if(o._sharedOptions){const t=a[0],n="function"==typeof t.getRange&&t.getRange(i);if(n){const t=e(a,i,s-n),o=e(a,i,s+n);return{lo:t.lo,hi:o.hi}}}}return{lo:0,hi:a.length-1}}function H(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:r}=o[t],{lo:h,hi:l}=B(o[t],e,a,n);for(let t=h;t<=l;++t){const e=r[t];e.skip||s(e,i,t)}}}function N(e,i,s,n,o){const a=[];if(!o&&!e.isPointInArea(i))return a;return H(e,s,i,(function(s,r,h){(o||t.C(s,e.chartArea,0))&&s.inRange(i.x,i.y,n)&&a.push({element:s,datasetIndex:r,index:h})}),!0),a}function W(t,e,i,s,n,o){let a=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let h=Number.POSITIVE_INFINITY;return H(t,i,e,(function(i,l,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!(!!o||t.isPointInArea(u))&&!d)return;const g=r(e,u);g<h?(a=[{element:i,datasetIndex:l,index:c}],h=g):g===h&&a.push({element:i,datasetIndex:l,index:c})})),a}function j(e,i,s,n,o,a){return a||e.isPointInArea(i)?"r"!==s||n?W(e,i,s,n,o,a):function(e,i,s,n){let o=[];return H(e,s,i,(function(e,s,a){const{startAngle:r,endAngle:h}=e.getProps(["startAngle","endAngle"],n),{angle:l}=t.D(e,{x:i.x,y:i.y});t.p(l,r,h)&&o.push({element:e,datasetIndex:s,index:a})})),o}(e,i,s,o):[]}function $(t,e,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return H(t,i,e,((t,s,h)=>{t[a]&&t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:h}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var U={evaluateInteractionItems:H,modes:{index(e,i,s,n){const o=t.z(i,e),a=s.axis||"x",r=s.includeInvisible||!1,h=s.intersect?N(e,o,a,n,r):j(e,o,a,!1,n,r),l=[];return h.length?(e.getSortedVisibleDatasetMetas().forEach((t=>{const e=h[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(e,i,s,n){const o=t.z(i,e),a=s.axis||"xy",r=s.includeInvisible||!1;let h=s.intersect?N(e,o,a,n,r):j(e,o,a,!1,n,r);if(h.length>0){const t=h[0].datasetIndex,i=e.getDatasetMeta(t).data;h=[];for(let e=0;e<i.length;++e)h.push({element:i[e],datasetIndex:t,index:e})}return h},point:(e,i,s,n)=>N(e,t.z(i,e),s.axis||"xy",n,s.includeInvisible||!1),nearest(e,i,s,n){const o=t.z(i,e),a=s.axis||"xy",r=s.includeInvisible||!1;return j(e,o,a,s.intersect,n,r)},x:(e,i,s,n)=>$(e,t.z(i,e),"x",s.intersect,n),y:(e,i,s,n)=>$(e,t.z(i,e),"y",s.intersect,n)}};const Y=["left","top","right","bottom"];function X(t,e){return t.filter((t=>t.pos===e))}function Q(t,e){return t.filter((t=>-1===Y.indexOf(t.pos)&&t.box.axis===e))}function G(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function K(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!Y.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,h=i[r.stack],l=h&&r.stackWeight/h.weight;r.horizontal?(r.width=l?l*s:a&&e.availableWidth,r.height=n):(r.width=s,r.height=l?l*n:a&&e.availableHeight)}return i}function q(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function J(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Z(e,i,s,n){const{pos:o,box:a}=s,r=e.maxPadding;if(!t.i(o)){s.size&&(e[o]-=s.size);const t=n[s.stack]||{size:0,count:1};t.size=Math.max(t.size,s.horizontal?a.height:a.width),s.size=t.size/t.count,e[o]+=s.size}a.getPadding&&J(r,a.getPadding());const h=Math.max(0,i.outerWidth-q(r,e,"left","right")),l=Math.max(0,i.outerHeight-q(r,e,"top","bottom")),c=h!==e.w,d=l!==e.h;return e.w=h,e.h=l,s.horizontal?{same:c,other:d}:{same:d,other:c}}function tt(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function et(t,e,i,s){const n=[];let o,a,r,h,l,c;for(o=0,a=t.length,l=0;o<a;++o){r=t[o],h=r.box,h.update(r.width||e.w,r.height||e.h,tt(r.horizontal,e));const{same:a,other:d}=Z(e,i,r,s);l|=a&&n.length,c=c||d,h.fullSize||n.push(r)}return l&&et(n,e,i,s)||c}function it(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function st(e,i,s,n){const o=s.padding;let{x:a,y:r}=i;for(const h of e){const e=h.box,l=n[h.stack]||{count:1,placed:0,weight:1},c=h.stackWeight/l.weight||1;if(h.horizontal){const n=i.w*c,a=l.size||e.height;t.h(l.start)&&(r=l.start),e.fullSize?it(e,o.left,r,s.outerWidth-o.right-o.left,a):it(e,i.left+l.placed,r,n,a),l.start=r,l.placed+=n,r=e.bottom}else{const n=i.h*c,r=l.size||e.width;t.h(l.start)&&(a=l.start),e.fullSize?it(e,a,o.top,r,s.outerHeight-o.bottom-o.top):it(e,a,i.top+l.placed,r,n),l.start=a,l.placed+=n,a=e.right}}i.x=a,i.y=r}var nt={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(e,i,s,n){if(!e)return;const o=t.E(e.options.layout.padding),a=Math.max(i-o.width,0),r=Math.max(s-o.height,0),h=function(t){const e=function(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}(t),i=G(e.filter((t=>t.box.fullSize)),!0),s=G(X(e,"left"),!0),n=G(X(e,"right")),o=G(X(e,"top"),!0),a=G(X(e,"bottom")),r=Q(e,"x"),h=Q(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(a).concat(r),chartArea:X(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(a).concat(r)}}(e.boxes),l=h.vertical,c=h.horizontal;t.F(e.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const d=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:i,outerHeight:s,padding:o,availableWidth:a,availableHeight:r,vBoxMaxWidth:a/2/d,hBoxMaxHeight:r/2}),g=Object.assign({},o);J(g,t.E(n));const p=Object.assign({maxPadding:g,w:a,h:r,x:o.left,y:o.top},o),f=K(l.concat(c),u);et(h.fullSize,p,u,f),et(l,p,u,f),et(c,p,u,f)&&et(l,p,u,f),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),st(h.leftAndTop,p,u,f),p.x+=p.w,p.y+=p.h,st(h.rightAndBottom,p,u,f),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},t.F(h.chartArea,(t=>{const i=t.box;Object.assign(i,e.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class ot{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class at extends ot{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const rt="$chartjs",ht={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},lt=t=>null===t||""===t;const ct=!!t.K&&{passive:!0};function dt(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,ct)}function ut(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function gt(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ut(i.addedNodes,s),e=e&&!ut(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function pt(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ut(i.removedNodes,s),e=e&&!ut(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const ft=new Map;let mt=0;function xt(){const t=window.devicePixelRatio;t!==mt&&(mt=t,ft.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function bt(e,i,s){const n=e.canvas,o=n&&t.I(n);if(!o)return;const a=t.L(((t,e)=>{const i=o.clientWidth;s(t,e),i<o.clientWidth&&s()}),window),r=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)}));return r.observe(o),function(t,e){ft.size||window.addEventListener("resize",xt),ft.set(t,e)}(e,a),r}function _t(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){ft.delete(t),ft.size||window.removeEventListener("resize",xt)}(t)}function yt(e,i,s){const n=e.canvas,o=t.L((i=>{null!==e.ctx&&s(function(e,i){const s=ht[e.type]||e.type,{x:n,y:o}=t.z(e,i);return{type:s,chart:i,native:e,x:void 0!==n?n:null,y:void 0!==o?o:null}}(i,e))}),e);return function(t,e,i){t&&t.addEventListener(e,i,ct)}(n,i,o),o}class vt extends ot{acquireContext(e,i){const s=e&&e.getContext&&e.getContext("2d");return s&&s.canvas===e?(function(e,i){const s=e.style,n=e.getAttribute("height"),o=e.getAttribute("width");if(e[rt]={initial:{height:n,width:o,style:{display:s.display,height:s.height,width:s.width}}},s.display=s.display||"block",s.boxSizing=s.boxSizing||"border-box",lt(o)){const i=t.J(e,"width");void 0!==i&&(e.width=i)}if(lt(n))if(""===e.style.height)e.height=e.width/(i||2);else{const i=t.J(e,"height");void 0!==i&&(e.height=i)}}(e,i),s):null}releaseContext(e){const i=e.canvas;if(!i[rt])return!1;const s=i[rt].initial;["height","width"].forEach((e=>{const n=s[e];t.k(n)?i.removeAttribute(e):i.setAttribute(e,n)}));const n=s.style||{};return Object.keys(n).forEach((t=>{i.style[t]=n[t]})),i.width=i.width,delete i[rt],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:gt,detach:pt,resize:bt}[e]||yt;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:_t,detach:_t,resize:_t}[e]||dt)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,i,s,n){return t.G(e,i,s,n)}isAttached(e){const i=e&&t.I(e);return!(!i||!i.isConnected)}}function Mt(e){return!t.M()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?at:vt}class wt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return t.x(this.x)&&t.x(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function kt(e,i){const s=e.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(e),o=Math.min(s.maxTicksLimit||n,n),a=s.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(i):[],r=a.length,h=a[0],l=a[r-1],c=[];if(r>o)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===a&&(e.push(t[n]),o++,a=i[o*s])}(i,c,a,r/o),c;const d=function(e,i,s){const n=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(e),o=i.length/s;if(!n)return Math.max(o,1);const a=t.N(n);for(let t=0,e=a.length-1;t<e;t++){const e=a[t];if(e>o)return e}return Math.max(o,1)}(a,i,o);if(r>0){let e,s;const n=r>1?Math.round((l-h)/(r-1)):null;for(St(i,c,d,t.k(n)?0:h-n,h),e=0,s=r-1;e<s;e++)St(i,c,d,a[e],a[e+1]);return St(i,c,d,l,t.k(n)?i.length:l+n),c}return St(i,c,d),c}function St(e,i,s,n,o){const a=t.v(n,0),r=Math.min(t.v(o,e.length),e.length);let h,l,c,d=0;for(s=Math.ceil(s),o&&(h=o-n,s=h/Math.floor(h/s)),c=a;c<0;)d++,c=Math.round(a+d*s);for(l=Math.max(a,0);l<r;l++)l===c&&(i.push(e[l]),d++,c=Math.round(a+d*s))}const Dt=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,Pt=(t,e)=>Math.min(e||t,t);function Ct(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function At(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,a=t._endPixel,r=1e-6;let h,l=t.getPixelForTick(n);if(!(i&&(h=1===s?Math.max(l-o,a-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(n-1))/2,l+=n<e?h:-h,l<o-r||l>a+r)))return l}function Lt(t){return t.drawTicks?t.tickLength:0}function Ot(e,i){if(!e.display)return 0;const s=t.a0(e.font,i),n=t.E(e.padding);return(t.b(e.text)?e.text.length:1)*s.lineHeight+n.height}function Et(e,i,s){let n=t.a1(e);return(s&&"right"!==i||!s&&"right"===i)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Tt extends wt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:e,_userMax:i,_suggestedMin:s,_suggestedMax:n}=this;return e=t.O(e,Number.POSITIVE_INFINITY),i=t.O(i,Number.NEGATIVE_INFINITY),s=t.O(s,Number.POSITIVE_INFINITY),n=t.O(n,Number.NEGATIVE_INFINITY),{min:t.O(e,s),max:t.O(i,n),minDefined:t.g(e),maxDefined:t.g(i)}}getMinMax(e){let i,{min:s,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:s,max:n};const r=this.getMatchingVisibleMetas();for(let t=0,h=r.length;t<h;++t)i=r[t].controller.getMinMax(this,e),o||(s=Math.min(s,i.min)),a||(n=Math.max(n,i.max));return s=a&&s>n?n:s,n=o&&s>n?s:n,{min:t.O(s,t.O(n,s)),max:t.O(n,t.O(s,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){t.Q(this.options.beforeUpdate,[this])}update(e,i,s){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=i,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=t.R(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=r<this.ticks.length;this._convertTicksToLabels(h?Ct(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=kt(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),h&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){t.Q(this.options.afterUpdate,[this])}beforeSetDimensions(){t.Q(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){t.Q(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),t.Q(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){t.Q(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const i=this.options.ticks;let s,n,o;for(s=0,n=e.length;s<n;s++)o=e[s],o.label=t.Q(i.callback,[o.value,s,e],this)}afterTickToLabelConversion(){t.Q(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){t.Q(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,i=e.ticks,s=Pt(this.ticks.length,e.ticks.maxTicksLimit),n=i.minRotation||0,o=i.maxRotation;let a,r,h,l=n;if(!this._isVisible()||!i.display||n>=o||s<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,g=t.S(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/s:g/(s-1),d+6>a&&(a=g/(s-(e.offset?.5:1)),r=this.maxHeight-Lt(e.grid)-i.padding-Ot(e.title,this.chart.options.font),h=Math.sqrt(d*d+u*u),l=t.U(Math.min(Math.asin(t.S((c.highest.height+6)/a,-1,1)),Math.asin(t.S(r/h,-1,1))-Math.asin(t.S(u/h,-1,1)))),l=Math.max(n,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){t.Q(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){t.Q(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:i,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const a=Ot(n,i.options.font);if(r?(e.width=this.maxWidth,e.height=Lt(o)+a):(e.height=this.maxHeight,e.width=Lt(o)+a),s.display&&this.ticks.length){const{first:i,last:n,widest:o,highest:a}=this._getLabelSizes(),h=2*s.padding,l=t.t(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(r){const t=s.mirror?0:d*o.width+c*a.height;e.height=Math.min(this.maxHeight,e.height+t+h)}else{const t=s.mirror?0:c*o.width+d*a.height;e.width=Math.min(this.maxWidth,e.width+t+h)}this._calculatePadding(i,n,d,c)}}this._handleMargins(),r?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?h?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){t.Q(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let i,s;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),i=0,s=e.length;i<s;i++)t.k(e[i].label)&&(e.splice(i,1),s--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Ct(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(e,i,s){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],h=Math.floor(i/Pt(i,s));let l,c,d,u,g,p,f,m,x,b,_,y=0,v=0;for(l=0;l<i;l+=h){if(u=e[l].label,g=this._resolveTickFontOptions(l),n.font=p=g.string,f=o[p]=o[p]||{data:{},gc:[]},m=g.lineHeight,x=b=0,t.k(u)||t.b(u)){if(t.b(u))for(c=0,d=u.length;c<d;++c)_=u[c],t.k(_)||t.b(_)||(x=t.V(n,f.data,f.gc,x,_),b+=m)}else x=t.V(n,f.data,f.gc,x,u),b=m;a.push(x),r.push(b),y=Math.max(x,y),v=Math.max(b,v)}!function(e,i){t.F(e,(t=>{const e=t.gc,s=e.length/2;let n;if(s>i){for(n=0;n<s;++n)delete t.data[e[n]];e.splice(0,s)}}))}(o,i);const M=a.indexOf(y),w=r.indexOf(v),k=t=>({width:a[t]||0,height:r[t]||0});return{first:k(0),last:k(i-1),widest:k(M),highest:k(w),widths:a,heights:r}}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(e){this._reversePixels&&(e=1-e);const i=this._startPixel+e*this._length;return t.W(this._alignToPixels?t.X(this.chart,i,0):i)}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(e){const i=this.ticks||[];if(e>=0&&e<i.length){const s=i[e];return s.$context||(s.$context=function(e,i,s){return t.j(e,{tick:s,index:i,type:"tick"})}(this.getContext(),e,s))}return this.$context||(this.$context=(s=this.chart.getContext(),n=this,t.j(s,{scale:n,type:"scale"})));var s,n}_tickSize(){const e=this.options.ticks,i=t.t(this.labelRotation),s=Math.abs(Math.cos(i)),n=Math.abs(Math.sin(i)),o=this._getLabelSizes(),a=e.autoSkipPadding||0,r=o?o.widest.width+a:0,h=o?o.highest.height+a:0;return this.isHorizontal()?h*s>r*n?r/s:h/n:h*n<r*s?h/s:r/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const i=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,h=o.offset,l=this.isHorizontal(),c=this.ticks.length+(h?1:0),d=Lt(o),u=[],g=r.setContext(this.getContext()),p=g.display?g.width:0,f=p/2,m=function(e){return t.X(s,e,p)};let x,b,_,y,v,M,w,k,S,D,P,C;if("top"===a)x=m(this.bottom),M=this.bottom-d,k=x-f,D=m(e.top)+f,C=e.bottom;else if("bottom"===a)x=m(this.top),D=e.top,C=m(e.bottom)-f,M=x+f,k=this.top+d;else if("left"===a)x=m(this.right),v=this.right-d,w=x-f,S=m(e.left)+f,P=e.right;else if("right"===a)x=m(this.left),S=e.left,P=m(e.right)-f,v=x+f,w=this.left+d;else if("x"===i){if("center"===a)x=m((e.top+e.bottom)/2+.5);else if(t.i(a)){const t=Object.keys(a)[0],e=a[t];x=m(this.chart.scales[t].getPixelForValue(e))}D=e.top,C=e.bottom,M=x+f,k=M+d}else if("y"===i){if("center"===a)x=m((e.left+e.right)/2);else if(t.i(a)){const t=Object.keys(a)[0],e=a[t];x=m(this.chart.scales[t].getPixelForValue(e))}v=x-f,w=v-d,S=e.left,P=e.right}const A=t.v(n.ticks.maxTicksLimit,c),L=Math.max(1,Math.ceil(c/A));for(b=0;b<c;b+=L){const e=this.getContext(b),i=o.setContext(e),n=r.setContext(e),a=i.lineWidth,c=i.color,d=n.dash||[],g=n.dashOffset,p=i.tickWidth,f=i.tickColor,m=i.tickBorderDash||[],x=i.tickBorderDashOffset;_=At(this,b,h),void 0!==_&&(y=t.X(s,_,a),l?v=w=S=P=y:M=k=D=C=y,u.push({tx1:v,ty1:M,tx2:w,ty2:k,x1:S,y1:D,x2:P,y2:C,width:a,color:c,borderDash:d,borderDashOffset:g,tickWidth:p,tickColor:f,tickBorderDash:m,tickBorderDashOffset:x}))}return this._ticksLength=c,this._borderValue=x,u}_computeLabelItems(e){const i=this.axis,s=this.options,{position:n,ticks:o}=s,a=this.isHorizontal(),r=this.ticks,{align:h,crossAlign:l,padding:c,mirror:d}=o,u=Lt(s.grid),g=u+c,p=d?-c:g,f=-t.t(this.labelRotation),m=[];let x,b,_,y,v,M,w,k,S,D,P,C,A="middle";if("top"===n)M=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===n)M=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("x"===i){if("center"===n)M=(e.top+e.bottom)/2+g;else if(t.i(n)){const t=Object.keys(n)[0],e=n[t];M=this.chart.scales[t].getPixelForValue(e)+g}w=this._getXAxisLabelAlignment()}else if("y"===i){if("center"===n)v=(e.left+e.right)/2-g;else if(t.i(n)){const t=Object.keys(n)[0],e=n[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(u).textAlign}"y"===i&&("start"===h?A="top":"end"===h&&(A="bottom"));const L=this._getLabelSizes();for(x=0,b=r.length;x<b;++x){_=r[x],y=_.label;const e=o.setContext(this.getContext(x));k=this.getPixelForTick(x)+o.labelOffset,S=this._resolveTickFontOptions(x),D=S.lineHeight,P=t.b(y)?y.length:1;const i=P/2,s=e.color,h=e.textStrokeColor,c=e.textStrokeWidth;let u,g=w;if(a?(v=k,"inner"===w&&(g=x===b-1?this.options.reverse?"left":"right":0===x?this.options.reverse?"right":"left":"center"),C="top"===n?"near"===l||0!==f?-P*D+D/2:"center"===l?-L.highest.height/2-i*D+D:-L.highest.height+D/2:"near"===l||0!==f?D/2:"center"===l?L.highest.height/2-i*D:L.highest.height-P*D,d&&(C*=-1),0===f||e.showLabelBackdrop||(v+=D/2*Math.sin(f))):(M=k,C=(1-P)*D/2),e.showLabelBackdrop){const i=t.E(e.backdropPadding),s=L.heights[x],n=L.widths[x];let o=C-i.top,a=0-i.left;switch(A){case"middle":o-=s/2;break;case"bottom":o-=s}switch(w){case"center":a-=n/2;break;case"right":a-=n;break;case"inner":x===b-1?a-=n:x>0&&(a-=n/2)}u={left:a,top:o,width:n+i.width,height:s+i.height,color:e.backdropColor}}m.push({label:y,font:S,textOffset:C,options:{rotation:f,color:s,strokeColor:h,strokeWidth:c,textAlign:g,textBaseline:A,translation:[v,M],backdrop:u}})}return m}_getXAxisLabelAlignment(){const{position:e,ticks:i}=this.options;if(-t.t(this.labelRotation))return"top"===e?"left":"right";let s="center";return"start"===i.align?s="left":"end"===i.align?s="right":"inner"===i.align&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,h;return"left"===e?s?(h=this.right+n,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h+=a)):(h=this.right-o,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h=this.left)):"right"===e?s?(h=this.left+n,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h-=a)):(h=this.left+o,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h=this.right)):r="right",{textAlign:r,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:i,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,h=this._borderValue;let l,c,d,u;this.isHorizontal()?(l=t.X(e,this.left,a)-a/2,c=t.X(e,this.right,r)+r/2,d=u=h):(d=t.X(e,this.top,a)-a/2,u=t.X(e,this.bottom,r)+r/2,l=c=h),i.save(),i.lineWidth=o.width,i.strokeStyle=o.color,i.beginPath(),i.moveTo(l,d),i.lineTo(c,u),i.stroke(),i.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&t.Y(i,s);const n=this.getLabelItems(e);for(const e of n){const s=e.options,n=e.font,o=e.label,a=e.textOffset;t.Z(i,o,0,a,n,s)}s&&t.$(i)}drawTitle(){const{ctx:e,options:{position:i,title:s,reverse:n}}=this;if(!s.display)return;const o=t.a0(s.font),a=t.E(s.padding),r=s.align;let h=o.lineHeight/2;"bottom"===i||"center"===i||t.i(i)?(h+=a.bottom,t.b(s.text)&&(h+=o.lineHeight*(s.text.length-1))):h+=a.top;const{titleX:l,titleY:c,maxWidth:d,rotation:u}=function(e,i,s,n){const{top:o,left:a,bottom:r,right:h,chart:l}=e,{chartArea:c,scales:d}=l;let u,g,p,f=0;const m=r-o,x=h-a;if(e.isHorizontal()){if(g=t.a2(n,a,h),t.i(s)){const t=Object.keys(s)[0],e=s[t];p=d[t].getPixelForValue(e)+m-i}else p="center"===s?(c.bottom+c.top)/2+m-i:Dt(e,s,i);u=h-a}else{if(t.i(s)){const t=Object.keys(s)[0],e=s[t];g=d[t].getPixelForValue(e)-x+i}else g="center"===s?(c.left+c.right)/2-x+i:Dt(e,s,i);p=t.a2(n,r,o),f="left"===s?-t.H:t.H}return{titleX:g,titleY:p,maxWidth:u,rotation:f}}(this,h,i,r);t.Z(e,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:u,textAlign:Et(r,i,n),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const e=this.options,i=e.ticks&&e.ticks.z||0,s=t.v(e.grid&&e.grid.z,-1),n=t.v(e.border&&e.border.z,0);return this._isVisible()&&this.draw===Tt.prototype.draw?[{z:s,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:i,draw:t=>{this.drawLabels(t)}}]:[{z:i,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(e){const i=this.options.ticks.setContext(this.getContext(e));return t.a0(i.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class zt{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(e){const i=Object.getPrototypeOf(e);let s;(function(t){return"id"in t&&"defaults"in t})(i)&&(s=this.register(i));const n=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in n||(n[o]=e,function(e,i,s){const n=t.a4(Object.create(null),[s?t.d.get(s):{},t.d.get(i),e.defaults]);t.d.set(i,n),e.defaultRoutes&&function(e,i){Object.keys(i).forEach((s=>{const n=s.split("."),o=n.pop(),a=[e].concat(n).join("."),r=i[s].split("."),h=r.pop(),l=r.join(".");t.d.route(a,o,l,h)}))}(i,e.defaultRoutes);e.descriptors&&t.d.describe(i,e.descriptors)}(e,a,s),this.override&&t.d.override(e.id,e.overrides)),a}get(t){return this.items[t]}unregister(e){const i=this.items,s=e.id,n=this.scope;s in i&&delete i[s],n&&s in t.d[n]&&(delete t.d[n][s],this.override&&delete t.a3[s])}}class Rt{constructor(){this.controllers=new zt(b,"datasets",!0),this.elements=new zt(wt,"elements"),this.plugins=new zt(Object,"plugins"),this.scales=new zt(Tt,"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(e,i,s){[...i].forEach((i=>{const n=s||this._getRegistryForType(i);s||n.isForType(i)||n===this.plugins&&i.id?this._exec(e,n,i):t.F(i,(t=>{const i=s||this._getRegistryForType(t);this._exec(e,i,t)}))}))}_exec(e,i,s){const n=t.a5(e);t.Q(s["before"+n],[],s),i[e](s),t.Q(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ft=new Rt;class It{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(e,i,s,n){n=n||{};for(const o of e){const e=o.plugin,a=e[s],r=[i,n,o.options];if(!1===t.Q(a,r,e)&&n.cancelable)return!1}return!0}invalidate(){t.k(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(e,i){const s=e&&e.config,n=t.v(s.options&&s.options.plugins,{}),o=function(t){const e={},i=[],s=Object.keys(Ft.plugins.items);for(let t=0;t<s.length;t++)i.push(Ft.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(s);return!1!==n||i?function(t,{plugins:e,localIds:i},s,n){const o=[],a=t.getContext();for(const r of e){const e=r.id,h=Vt(s[e],n);null!==h&&o.push({plugin:r,options:Bt(t.config,{plugin:r,local:i[e]},h,a)})}return o}(e,o,n,i):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Vt(t,e){return e||!1!==t?!0===t?{}:t:null}function Bt(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ht(e,i){const s=t.d.datasets[e]||{};return((i.datasets||{})[e]||{}).indexAxis||i.indexAxis||s.indexAxis||"x"}function Nt(t){if("x"===t||"y"===t||"r"===t)return t}function Wt(t,...e){if(Nt(t))return t;for(const s of e){const e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&Nt(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function jt(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function $t(e,i){const s=t.a3[e.type]||{scales:{}},n=i.scales||{},o=Ht(e.type,i),a=Object.create(null);return Object.keys(n).forEach((i=>{const r=n[i];if(!t.i(r))return console.error(`Invalid scale configuration for scale: ${i}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const h=Wt(i,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return jt(t,"x",i[0])||jt(t,"y",i[0])}return{}}(i,e),t.d.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(h,o),c=s.scales||{};a[i]=t.ab(Object.create(null),[{axis:h},r,c[h],c[l]])})),e.data.datasets.forEach((s=>{const o=s.type||e.type,r=s.indexAxis||Ht(o,i),h=(t.a3[o]||{}).scales||{};Object.keys(h).forEach((e=>{const i=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(e,r),o=s[i+"AxisID"]||i;a[o]=a[o]||Object.create(null),t.ab(a[o],[{axis:i},n[o],h[e]])}))})),Object.keys(a).forEach((e=>{const i=a[e];t.ab(i,[t.d.scales[i.type],t.d.scale])})),a}function Ut(e){const i=e.options||(e.options={});i.plugins=t.v(i.plugins,{}),i.scales=$t(e,i)}function Yt(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Xt=new Map,Qt=new Set;function Gt(t,e){let i=Xt.get(t);return i||(i=e(),Xt.set(t,i),Qt.add(i)),i}const Kt=(e,i,s)=>{const n=t.f(i,s);void 0!==n&&e.add(n)};class qt{constructor(t){this._config=function(t){return(t=t||{}).data=Yt(t.data),Ut(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Yt(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(),Ut(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Gt(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Gt(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Gt(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Gt(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(e,i,s){const{options:n,type:o}=this,a=this._cachedScopes(e,s),r=a.get(i);if(r)return r;const h=new Set;i.forEach((i=>{e&&(h.add(e),i.forEach((t=>Kt(h,e,t)))),i.forEach((t=>Kt(h,n,t))),i.forEach((e=>Kt(h,t.a3[o]||{},e))),i.forEach((e=>Kt(h,t.d,e))),i.forEach((e=>Kt(h,t.a6,e)))}));const l=Array.from(h);return 0===l.length&&l.push(Object.create(null)),Qt.has(i)&&a.set(i,l),l}chartOptionScopes(){const{options:e,type:i}=this;return[e,t.a3[i]||{},t.d.datasets[i]||{},{type:i},t.d,t.a6]}resolveNamedOptions(e,i,s,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Jt(this._resolverCache,e,n);let h=a;if(function(e,i){const{isScriptable:s,isIndexable:n}=t.aa(e);for(const o of i){const i=s(o),a=n(o),r=(a||i)&&e[o];if(i&&(t.a7(r)||Zt(r))||a&&t.b(r))return!0}return!1}(a,i)){o.$shared=!1,s=t.a7(s)?s():s;const i=this.createResolver(e,s,r);h=t.a8(a,s,i)}for(const t of i)o[t]=h[t];return o}createResolver(e,i,s=[""],n){const{resolver:o}=Jt(this._resolverCache,e,s);return t.i(i)?t.a8(o,i,void 0,n):o}}function Jt(e,i,s){let n=e.get(i);n||(n=new Map,e.set(i,n));const o=s.join();let a=n.get(o);if(!a){a={resolver:t.a9(i,s),subPrefixes:s.filter((t=>!t.toLowerCase().includes("hover")))},n.set(o,a)}return a}const Zt=e=>t.i(e)&&Object.getOwnPropertyNames(e).some((i=>t.a7(e[i])));const te=["top","bottom","left","right","chartArea"];function ee(t,e){return"top"===t||"bottom"===t||-1===te.indexOf(t)&&"x"===e}function ie(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function se(e){const i=e.chart,s=i.options.animation;i.notifyPlugins("afterRender"),t.Q(s&&s.onComplete,[e],i)}function ne(e){const i=e.chart,s=i.options.animation;t.Q(s&&s.onProgress,[e],i)}function oe(e){return t.M()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ae={},re=t=>{const e=oe(t);return Object.values(ae).filter((t=>t.canvas===e)).pop()};function he(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}function le(t,e,i){return t.options.clip?t[i]:e[i]}class ce{static defaults=t.d;static instances=ae;static overrides=t.a3;static registry=Ft;static version="4.4.7";static getChart=re;static register(...t){Ft.add(...t),de()}static unregister(...t){Ft.remove(...t),de()}constructor(e,s){const n=this.config=new qt(s),o=oe(e),a=re(o);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Mt(o)),this.platform.updateConfig(n);const h=this.platform.acquireContext(o,r.aspectRatio),l=h&&h.canvas,c=l&&l.height,d=l&&l.width;this.id=t.ac(),this.ctx=h,this.canvas=l,this.width=d,this.height=c,this._options=r,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 It,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=t.ad((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],ae[this.id]=this,h&&l?(i.listen(this,"complete",se),i.listen(this,"progress",ne),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:i},width:s,height:n,_aspectRatio:o}=this;return t.k(e)?i&&o?o:n?s/n:null:e}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 Ft}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():t.ae(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return t.af(this.canvas,this.ctx),this}stop(){return i.stop(this),this}resize(t,e){i.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(e,i){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,e,i,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,t.ae(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),t.Q(s.onResize,[this,a],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};t.F(e,((t,e)=>{t.id=e}))}buildOrUpdateScales(){const e=this.options,i=e.scales,s=this.scales,n=Object.keys(s).reduce(((t,e)=>(t[e]=!1,t)),{});let o=[];i&&(o=o.concat(Object.keys(i).map((t=>{const e=i[t],s=Wt(t,e),n="r"===s,o="x"===s;return{options:e,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),t.F(o,(i=>{const o=i.options,a=o.id,r=Wt(a,o),h=t.v(o.type,i.dtype);void 0!==o.position&&ee(o.position,r)===ee(i.dposition)||(o.position=i.dposition),n[a]=!0;let l=null;if(a in s&&s[a].type===h)l=s[a];else{l=new(Ft.getScale(h))({id:a,type:h,ctx:this.ctx,chart:this}),s[l.id]=l}l.init(o,e)})),t.F(n,((t,e)=>{t||delete s[e]})),t.F(s,(t=>{nt.configure(this,t,t.options),nt.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(ie("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const e=[],i=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=i.length;s<n;s++){const n=i[s];let o=this.getDatasetMeta(s);const a=n.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(s),o=this.getDatasetMeta(s)),o.type=a,o.indexAxis=n.indexAxis||Ht(a,this.options),o.order=n.order||0,o.index=s,o.label=""+n.label,o.visible=this.isDatasetVisible(s),o.controller)o.controller.updateIndex(s),o.controller.linkScales();else{const i=Ft.getController(a),{datasetElementType:n,dataElementType:r}=t.d.datasets[a];Object.assign(i,{dataElementType:Ft.getElement(r),datasetElementType:n&&Ft.getElement(n)}),o.controller=new i(this,s),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){t.F(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const i=this.config;i.update();const s=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!n&&-1===o.indexOf(e);e.buildOrUpdateElements(i),a=Math.max(+e.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),n||t.F(o,(t=>{t.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(ie("z","_idx"));const{_active:r,_lastEvent:h}=this;h?this._eventHandler(h,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){t.F(this.scales,(t=>{nt.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,i=new Set(Object.keys(this._listeners)),s=new Set(e.events);t.ag(i,s)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){he(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const i=this.data.datasets.length,s=t=>new Set(e.filter((e=>e[0]===t)).map(((t,e)=>e+","+t.splice(1).join(",")))),n=s(0);for(let e=1;e<i;e++)if(!t.ag(n,s(e)))return;return Array.from(n).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;nt.update(this,this.width,this.height,e);const i=this.chartArea,s=i.width<=0||i.height<=0;this._layers=[],t.F(this.boxes,(t=>{s&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let i=0,s=this.data.datasets.length;i<s;++i)this._updateDataset(i,t.a7(e)?e({datasetIndex:i}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(i.has(this)?this.attached&&!i.running(this)&&i.start(this):(this.draw(),se({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const i=this.ctx,s=e._clip,n=!s.disabled,o=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:le(i,e,"left"),right:le(i,e,"right"),top:le(s,e,"top"),bottom:le(s,e,"bottom")}:e}(e,this.chartArea),a={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(n&&t.Y(i,{left:!1===s.left?0:o.left-s.left,right:!1===s.right?this.width:o.right+s.right,top:!1===s.top?0:o.top-s.top,bottom:!1===s.bottom?this.height:o.bottom+s.bottom}),e.controller.draw(),n&&t.$(i),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return t.C(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=U.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=t.j(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(e,i,s){const n=s?"show":"hide",o=this.getDatasetMeta(e),a=o.controller._resolveAnimations(void 0,n);t.h(i)?(o.data[i].hidden=!s,this.update()):(this.setDatasetVisibility(e,s),a.update(o,{visible:s}),this.update((t=>t.datasetIndex===e?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(),i.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:i}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),t.af(e,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete ae[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,i=this.platform,s=(t,s)=>{i.addEventListener(this,t,s),e[t]=s},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};t.F(this.options.events,(t=>s(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){t.F(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},t.F(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const i=this._active||[],s=e.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!t.ah(s,i)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,i))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(e,i,s){const{_active:n=[],options:o}=this,a=i,r=this._getActiveElements(e,n,s,a),h=t.ai(e),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(e,this._lastEvent,s,h);s&&(this._lastEvent=null,t.Q(o.onHover,[e,r,this],this),h&&t.Q(o.onClick,[e,r,this],this));const c=!t.ah(r,n);return(c||i)&&(this._active=r,this._updateHoverStyles(r,n,i)),this._lastEvent=l,c}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function de(){return t.F(ce.instances,(t=>t._plugins.invalidate()))}function ue(e,i,s,n){const o=(a=e.options.borderRadius,t.ak(a,["outerStart","outerEnd","innerStart","innerEnd"]));var a;const r=(s-i)/2,h=Math.min(r,n*i/2),l=e=>{const i=(s-Math.min(r,e))*n/2;return t.S(e,0,Math.min(r,i))};return{outerStart:l(o.outerStart),outerEnd:l(o.outerEnd),innerStart:t.S(o.innerStart,0,h),innerEnd:t.S(o.innerEnd,0,h)}}function ge(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function pe(e,i,s,n,o,a){const{x:r,y:h,startAngle:l,pixelMargin:c,innerRadius:d}=i,u=Math.max(i.outerRadius+n+s-c,0),g=d>0?d+n+s+c:0;let p=0;const f=o-l;if(n){const t=((d>0?d-n:0)+(u>0?u-n:0))/2;p=(f-(0!==t?f*t/(t+n):f))/2}const m=(f-Math.max(.001,f*u-s/t.P)/u)/2,x=l+m+p,b=o-m-p,{outerStart:_,outerEnd:y,innerStart:v,innerEnd:M}=ue(i,g,u,b-x),w=u-_,k=u-y,S=x+_/w,D=b-y/k,P=g+v,C=g+M,A=x+v/P,L=b-M/C;if(e.beginPath(),a){const i=(S+D)/2;if(e.arc(r,h,u,S,i),e.arc(r,h,u,i,D),y>0){const i=ge(k,D,r,h);e.arc(i.x,i.y,y,D,b+t.H)}const s=ge(C,b,r,h);if(e.lineTo(s.x,s.y),M>0){const i=ge(C,L,r,h);e.arc(i.x,i.y,M,b+t.H,L+Math.PI)}const n=(b-M/g+(x+v/g))/2;if(e.arc(r,h,g,b-M/g,n,!0),e.arc(r,h,g,n,x+v/g,!0),v>0){const i=ge(P,A,r,h);e.arc(i.x,i.y,v,A+Math.PI,x-t.H)}const o=ge(w,x,r,h);if(e.lineTo(o.x,o.y),_>0){const i=ge(w,S,r,h);e.arc(i.x,i.y,_,x-t.H,S)}}else{e.moveTo(r,h);const t=Math.cos(S)*u+r,i=Math.sin(S)*u+h;e.lineTo(t,i);const s=Math.cos(D)*u+r,n=Math.sin(D)*u+h;e.lineTo(s,n)}e.closePath()}function fe(e,i,s,n,o){const{fullCircles:a,startAngle:r,circumference:h,options:l}=i,{borderWidth:c,borderJoinStyle:d,borderDash:u,borderDashOffset:g}=l,p="inner"===l.borderAlign;if(!c)return;e.setLineDash(u||[]),e.lineDashOffset=g,p?(e.lineWidth=2*c,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let f=i.endAngle;if(a){pe(e,i,s,n,f,o);for(let t=0;t<a;++t)e.stroke();isNaN(h)||(f=r+(h%t.T||t.T))}p&&function(e,i,s){const{startAngle:n,pixelMargin:o,x:a,y:r,outerRadius:h,innerRadius:l}=i;let c=o/h;e.beginPath(),e.arc(a,r,h,n-c,s+c),l>o?(c=o/l,e.arc(a,r,l,s+c,n-c,!0)):e.arc(a,r,o,s+t.H,n-t.H),e.closePath(),e.clip()}(e,i,f),a||(pe(e,i,s,n,f,o),e.stroke())}class me extends wt{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(e,i,s){const n=this.getProps(["x","y"],s),{angle:o,distance:a}=t.D(n,{x:e,y:i}),{startAngle:r,endAngle:h,innerRadius:l,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),u=(this.options.spacing+this.options.borderWidth)/2,g=t.v(d,h-r),p=t.p(o,r,h)&&r!==h,f=g>=t.T||p,m=t.aj(a,l+u,c+u);return f&&m}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:h}=this.options,l=(s+n)/2,c=(o+a+h+r)/2;return{x:e+Math.cos(l)*c,y:i+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(e){const{options:i,circumference:s}=this,n=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin="inner"===i.borderAlign?.33:0,this.fullCircles=s>t.T?Math.floor(s/t.T):0,0===s||this.innerRadius<0||this.outerRadius<0)return;e.save();const r=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(r)*n,Math.sin(r)*n);const h=n*(1-Math.sin(Math.min(t.P,s||0)));e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,function(e,i,s,n,o){const{fullCircles:a,startAngle:r,circumference:h}=i;let l=i.endAngle;if(a){pe(e,i,s,n,l,o);for(let t=0;t<a;++t)e.fill();isNaN(h)||(l=r+(h%t.T||t.T))}pe(e,i,s,n,l,o),e.fill()}(e,this,h,o,a),fe(e,this,h,o,a),e.restore()}}function xe(e,i,s=i){e.lineCap=t.v(s.borderCapStyle,i.borderCapStyle),e.setLineDash(t.v(s.borderDash,i.borderDash)),e.lineDashOffset=t.v(s.borderDashOffset,i.borderDashOffset),e.lineJoin=t.v(s.borderJoinStyle,i.borderJoinStyle),e.lineWidth=t.v(s.borderWidth,i.borderWidth),e.strokeStyle=t.v(s.borderColor,i.borderColor)}function be(t,e,i){t.lineTo(i.x,i.y)}function _e(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,h=Math.max(n,a),l=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:h,loop:e.loop,ilen:l<h&&!c?s+l-h:l-h}}function ye(e,i,s,n){const{points:o,options:a}=i,{count:r,start:h,loop:l,ilen:c}=_e(o,s,n),d=function(e){return e.stepped?t.ar:e.tension||"monotone"===e.cubicInterpolationMode?t.as:be}(a);let u,g,p,{move:f=!0,reverse:m}=n||{};for(u=0;u<=c;++u)g=o[(h+(m?c-u:u))%r],g.skip||(f?(e.moveTo(g.x,g.y),f=!1):d(e,p,g,m,a.stepped),p=g);return l&&(g=o[(h+(m?c:0))%r],d(e,p,g,m,a.stepped)),!!l}function ve(t,e,i,s){const n=e.points,{count:o,start:a,ilen:r}=_e(n,i,s),{move:h=!0,reverse:l}=s||{};let c,d,u,g,p,f,m=0,x=0;const b=t=>(a+(l?r-t:t))%o,_=()=>{g!==p&&(t.lineTo(m,p),t.lineTo(m,g),t.lineTo(m,f))};for(h&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<g?g=i:i>p&&(p=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,g=p=i),f=i}_()}function Me(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?ve:ye}const we="function"==typeof Path2D;function ke(t,e,i,s){we&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),xe(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=Me(e);for(const r of n)xe(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class Se extends wt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(e,i){const s=this.options;if((s.tension||"monotone"===s.cubicInterpolationMode)&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;t.al(this._points,s,e,n,i),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=t.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(e,i){const s=this.options,n=e[i],o=this.points,a=t.an(this,{property:i,start:n,end:n});if(!a.length)return;const r=[],h=function(e){return e.stepped?t.ao:e.tension||"monotone"===e.cubicInterpolationMode?t.ap:t.aq}(s);let l,c;for(l=0,c=a.length;l<c;++l){const{start:t,end:c}=a[l],d=o[t],u=o[c];if(d===u){r.push(d);continue}const g=h(d,u,Math.abs((n-d[i])/(u[i]-d[i])),s.stepped);g[i]=e[i],r.push(g)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return Me(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=Me(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=n(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),ke(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function De(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}class Pe extends wt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return De(this,t,"x",e)}inYRange(t,e){return De(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(e,i){const s=this.options;this.skip||s.radius<.1||!t.C(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,t.at(e,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Ce(t,e){const{x:i,y:s,base:n,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let r,h,l,c,d;return t.horizontal?(d=a/2,r=Math.min(i,n),h=Math.max(i,n),l=s-d,c=s+d):(d=o/2,r=i-d,h=i+d,l=Math.min(s,n),c=Math.max(s,n)),{left:r,top:l,right:h,bottom:c}}function Ae(e,i,s,n){return e?0:t.S(i,s,n)}function Le(e){const i=Ce(e),s=i.right-i.left,n=i.bottom-i.top,o=function(e,i,s){const n=e.options.borderWidth,o=e.borderSkipped,a=t.av(n);return{t:Ae(o.top,a.top,0,s),r:Ae(o.right,a.right,0,i),b:Ae(o.bottom,a.bottom,0,s),l:Ae(o.left,a.left,0,i)}}(e,s/2,n/2),a=function(e,i,s){const{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,a=t.aw(o),r=Math.min(i,s),h=e.borderSkipped,l=n||t.i(o);return{topLeft:Ae(!l||h.top||h.left,a.topLeft,0,r),topRight:Ae(!l||h.top||h.right,a.topRight,0,r),bottomLeft:Ae(!l||h.bottom||h.left,a.bottomLeft,0,r),bottomRight:Ae(!l||h.bottom||h.right,a.bottomRight,0,r)}}(e,s/2,n/2);return{outer:{x:i.left,y:i.top,w:s,h:n,radius:a},inner:{x:i.left+o.l,y:i.top+o.t,w:s-o.l-o.r,h:n-o.t-o.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,a.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(o.b,o.r))}}}}function Oe(e,i,s,n){const o=null===i,a=null===s,r=e&&!(o&&a)&&Ce(e,n);return r&&(o||t.aj(i,r.left,r.right))&&(a||t.aj(s,r.top,r.bottom))}function Ee(t,e){t.rect(e.x,e.y,e.w,e.h)}function Te(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+a,radius:t.radius}}class ze extends wt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(e){const{inflateAmount:i,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:a}=Le(this),r=(h=a.radius).topLeft||h.topRight||h.bottomLeft||h.bottomRight?t.au:Ee;var h;e.save(),a.w===o.w&&a.h===o.h||(e.beginPath(),r(e,Te(a,i,o)),e.clip(),r(e,Te(o,-i,a)),e.fillStyle=s,e.fill("evenodd")),e.beginPath(),r(e,Te(o,i)),e.fillStyle=n,e.fill(),e.restore()}inRange(t,e,i){return Oe(this,t,e,i)}inXRange(t,e){return Oe(this,t,null,e)}inYRange(t,e){return Oe(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}var Re=Object.freeze({__proto__:null,ArcElement:me,BarElement:ze,LineElement:Se,PointElement:Pe});const Fe=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Ie=Fe.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function Ve(t){return Fe[t%Fe.length]}function Be(t){return Ie[t%Ie.length]}function He(t){let e=0;return(i,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof A?e=function(t,e){return t.backgroundColor=t.data.map((()=>Ve(e++))),e}(i,e):n instanceof O?e=function(t,e){return t.backgroundColor=t.data.map((()=>Be(e++))),e}(i,e):n&&(e=function(t,e){return t.borderColor=Ve(e),t.backgroundColor=Be(e),++e}(i,e))}}function Ne(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var We={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,i,s){if(!s.enabled)return;const{data:{datasets:n},options:o}=e.config,{elements:a}=o,r=Ne(n)||(h=o)&&(h.borderColor||h.backgroundColor)||a&&Ne(a)||"rgba(0,0,0,0.1)"!==t.d.borderColor||"rgba(0,0,0,0.1)"!==t.d.backgroundColor;var h;if(!s.forceOverride&&r)return;const l=He(e);n.forEach(l)}};function je(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function $e(t){t.data.datasets.forEach((t=>{je(t)}))}var Ue={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,i,s)=>{if(!s.enabled)return void $e(e);const n=e.width;e.data.datasets.forEach(((i,o)=>{const{_data:a,indexAxis:r}=i,h=e.getDatasetMeta(o),l=a||i.data;if("y"===t.a([r,e.options.indexAxis]))return;if(!h.controller.supportsDecimation)return;const c=e.scales[h.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(e.options.parsing)return;let{start:d,count:u}=function(e,i){const s=i.length;let n,o=0;const{iScale:a}=e,{min:r,max:h,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(o=t.S(t.B(i,a.axis,r).lo,0,s-1)),n=c?t.S(t.B(i,a.axis,h).hi+1,o,s)-o:s-o,{start:o,count:n}}(h,l);if(u<=(s.threshold||4*n))return void je(i);let g;switch(t.k(a)&&(i._data=l,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),s.algorithm){case"lttb":g=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let h=0;const l=e+i-1;let c,d,u,g,p,f=e;for(a[h++]=t[f],c=0;c<o-2;c++){let s,n=0,o=0;const l=Math.floor((c+1)*r)+1+e,m=Math.min(Math.floor((c+2)*r)+1,i)+e,x=m-l;for(s=l;s<m;s++)n+=t[s].x,o+=t[s].y;n/=x,o/=x;const b=Math.floor(c*r)+1+e,_=Math.min(Math.floor((c+1)*r)+1,i)+e,{x:y,y:v}=t[f];for(u=g=-1,s=b;s<_;s++)g=.5*Math.abs((y-n)*(t[s].y-v)-(y-t[s].x)*(o-v)),g>u&&(u=g,d=t[s],p=s);a[h++]=d,f=p}return a[h++]=t[l],a}(l,d,u,n,s);break;case"min-max":g=function(e,i,s,n){let o,a,r,h,l,c,d,u,g,p,f=0,m=0;const x=[],b=i+s-1,_=e[i].x,y=e[b].x-_;for(o=i;o<i+s;++o){a=e[o],r=(a.x-_)/y*n,h=a.y;const i=0|r;if(i===l)h<g?(g=h,c=o):h>p&&(p=h,d=o),f=(m*f+a.x)/++m;else{const s=o-1;if(!t.k(c)&&!t.k(d)){const t=Math.min(c,d),i=Math.max(c,d);t!==u&&t!==s&&x.push({...e[t],x:f}),i!==u&&i!==s&&x.push({...e[i],x:f})}o>0&&s!==u&&x.push(e[s]),x.push(a),l=i,m=0,g=p=h,c=d=u=o}}return x}(l,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${s.algorithm}'`)}i._decimated=g}))},destroy(t){$e(t)}};function Ye(e,i,s,n){if(n)return;let o=i[e],a=s[e];return"angle"===e&&(o=t.ay(o),a=t.ay(a)),{property:e,start:o,end:a}}function Xe(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Qe(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function Ge(e,i){let s=[],n=!1;return t.b(e)?(n=!0,s=e):s=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=Xe(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(e,i),s.length?new Se({points:s,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ke(t){return t&&!1!==t.fill}function qe(e,i,s){let n=e[i].fill;const o=[i];let a;if(!s)return n;for(;!1!==n&&-1===o.indexOf(n);){if(!t.g(n))return n;if(a=e[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function Je(e,i,s){const n=function(e){const i=e.options,s=i.fill;let n=t.v(s&&s.target,s);void 0===n&&(n=!!i.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(e);if(t.i(n))return!isNaN(n.value)&&n;let o=parseFloat(n);return t.g(o)&&Math.floor(o)===o?function(t,e,i,s){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=s)return!1;return i}(n[0],i,o,s):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Ze(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:h}=ti(o,e,"x");if(!(!h||a&&r))if(a)s.unshift(h);else if(t.push(h),!r)break}t.push(...s)}function ti(e,i,s){const n=e.interpolate(i,s);if(!n)return{};const o=n[s],a=e.segments,r=e.points;let h=!1,l=!1;for(let e=0;e<a.length;e++){const i=a[e],n=r[i.start][s],c=r[i.end][s];if(t.aj(o,n,c)){h=o===n,l=o===c;break}}return{first:h,last:l,point:n}}class ei{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(e,i,s){const{x:n,y:o,radius:a}=this;return i=i||{start:0,end:t.T},e.arc(n,o,a,i.end,i.start,!0),!s.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function ii(e){const{chart:i,fill:s,line:n}=e;if(t.g(s))return function(t,e){const i=t.getDatasetMeta(e),s=i&&t.isDatasetVisible(e);return s?i.dataset:null}(i,s);if("stack"===s)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(Ge({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)Ze(n,a[t],r)}return new Se({points:n,options:{}})}(e);if("shape"===s)return!0;const o=function(e){const i=e.scale||{};if(i.getPointPositionForValue)return function(e){const{scale:i,fill:s}=e,n=i.options,o=i.getLabels().length,a=n.reverse?i.max:i.min,r=function(e,i,s){let n;return n="start"===e?s:"end"===e?i.options.reverse?i.min:i.max:t.i(e)?e.value:i.getBaseValue(),n}(s,i,a),h=[];if(n.grid.circular){const t=i.getPointPositionForValue(0,a);return new ei({x:t.x,y:t.y,radius:i.getDistanceFromCenterForValue(r)})}for(let t=0;t<o;++t)h.push(i.getPointPositionForValue(t,r));return h}(e);return function(e){const{scale:i={},fill:s}=e,n=function(e,i){let s=null;return"start"===e?s=i.bottom:"end"===e?s=i.top:t.i(e)?s=i.getPixelForValue(e.value):i.getBasePixel&&(s=i.getBasePixel()),s}(s,i);if(t.g(n)){const t=i.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(e)}(e);return o instanceof ei?o:Ge(o,n)}function si(e,i,s){const n=ii(i),{line:o,scale:a,axis:r}=i,h=o.options,l=h.fill,c=h.backgroundColor,{above:d=c,below:u=c}=l||{};n&&o.points.length&&(t.Y(e,s),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r}=e,h=i._loop?"angle":e.axis;t.save(),"x"===h&&o!==n&&(ni(t,s,a.top),oi(t,{line:i,target:s,color:n,scale:r,property:h}),t.restore(),t.save(),ni(t,s,a.bottom));oi(t,{line:i,target:s,color:o,scale:r,property:h}),t.restore()}(e,{line:o,target:n,above:d,below:u,area:s,scale:a,axis:r}),t.$(e))}function ni(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:h}=r,l=n[s],c=n[Xe(s,h,n)];o?(t.moveTo(l.x,l.y),o=!1):(t.lineTo(l.x,i),t.lineTo(l.x,l.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function oi(e,i){const{line:s,target:n,property:o,color:a,scale:r}=i,h=function(e,i,s){const n=e.segments,o=e.points,a=i.points,r=[];for(const e of n){let{start:n,end:h}=e;h=Xe(n,h,o);const l=Ye(s,o[n],o[h],e.loop);if(!i.segments){r.push({source:e,target:l,start:o[n],end:o[h]});continue}const c=t.an(i,l);for(const i of c){const n=Ye(s,a[i.start],a[i.end],i.loop),h=t.ax(e,o,n);for(const t of h)r.push({source:t,target:i,start:{[s]:Qe(l,n,"start",Math.max)},end:{[s]:Qe(l,n,"end",Math.min)}})}}return r}(s,n,o);for(const{source:t,target:i,start:l,end:c}of h){const{style:{backgroundColor:h=a}={}}=t,d=!0!==n;e.save(),e.fillStyle=h,ai(e,r,d&&Ye(o,l,c)),e.beginPath();const u=!!s.pathSegment(e,t);let g;if(d){u?e.closePath():ri(e,n,c,o);const t=!!n.pathSegment(e,i,{move:u,reverse:!0});g=u&&t,g||ri(e,n,l,o)}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore()}}function ai(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:o,start:a,end:r}=i||{};"x"===o&&(t.beginPath(),t.rect(a,s,r-a,n-s),t.clip())}function ri(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var hi={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,h;for(a=0;a<s;++a)o=t.getDatasetMeta(a),r=o.dataset,h=null,r&&r.options&&r instanceof Se&&(h={visible:t.isDatasetVisible(a),index:a,fill:Je(r,a,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=h,n.push(h);for(a=0;a<s;++a)h=n[a],h&&!1!==h.fill&&(h.fill=qe(n,a,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&si(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;Ke(i)&&si(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;Ke(s)&&"beforeDatasetDraw"===i.drawTime&&si(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const li=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class ci extends wt{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 e=this.options.labels||{};let i=t.Q(e.generateLabels,[this.chart],this)||[];e.filter&&(i=i.filter((t=>e.filter(t,this.chart.data)))),e.sort&&(i=i.sort(((t,i)=>e.sort(t,i,this.chart.data)))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){const{options:e,ctx:i}=this;if(!e.display)return void(this.width=this.height=0);const s=e.labels,n=t.a0(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:h}=li(s,o);let l,c;i.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(a,o,r,h)+10):(c=this.maxHeight,l=this._fitCols(a,n,r,h)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],h=this.lineWidths=[0],l=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-l;return this.legendItems.forEach(((t,g)=>{const p=i+e/2+n.measureText(t.text).width;(0===g||h[h.length-1]+p+2*a>o)&&(c+=l,h[h.length-(g>0?0:1)]=0,u+=l,d++),r[g]={left:0,top:u,row:d,width:p,height:s},h[h.length-1]+=p+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],h=this.columnSizes=[],l=o-t;let c=a,d=0,u=0,g=0,p=0;return this.legendItems.forEach(((t,o)=>{const{itemWidth:f,itemHeight:m}=function(t,e,i,s,n){const o=function(t,e,i,s){let n=t.text;n&&"string"!=typeof n&&(n=n.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+s.measureText(n).width}(s,t,e,i),a=function(t,e,i){let s=t;"string"!=typeof e.text&&(s=di(e,i));return s}(n,s,e.lineHeight);return{itemWidth:o,itemHeight:a}}(i,e,n,t,s);o>0&&u+m+2*a>l&&(c+=d+a,h.push({width:d,height:u}),g+=d+a,p++,d=u=0),r[o]={left:g,top:u,col:p,width:f,height:m},d=Math.max(d,f),u+=m+a})),c+=d,h.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:s,labels:{padding:n},rtl:o}}=this,a=t.az(o,this.left,this.width);if(this.isHorizontal()){let o=0,r=t.a2(s,this.left+n,this.right-this.lineWidths[o]);for(const h of i)o!==h.row&&(o=h.row,r=t.a2(s,this.left+n,this.right-this.lineWidths[o])),h.top+=this.top+e+n,h.left=a.leftForLtr(a.x(r),h.width),r+=h.width+n}else{let o=0,r=t.a2(s,this.top+e+n,this.bottom-this.columnSizes[o].height);for(const h of i)h.col!==o&&(o=h.col,r=t.a2(s,this.top+e+n,this.bottom-this.columnSizes[o].height)),h.top=r,h.left+=this.left+n,h.left=a.leftForLtr(a.x(h.left),h.width),r+=h.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;t.Y(e,this),this._draw(),t.$(e)}}_draw(){const{options:e,columnSizes:i,lineWidths:s,ctx:n}=this,{align:o,labels:a}=e,r=t.d.color,h=t.az(e.rtl,this.left,this.width),l=t.a0(a.font),{padding:c}=a,d=l.size,u=d/2;let g;this.drawTitle(),n.textAlign=h.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=li(a,d),x=this.isHorizontal(),b=this._computeTitleHeight();g=x?{x:t.a2(o,this.left+c,this.right-s[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:t.a2(o,this.top+b+c,this.bottom-i[0].height),line:0},t.aA(this.ctx,e.textDirection);const _=m+c;this.legendItems.forEach(((y,v)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const M=n.measureText(y.text).width,w=h.textAlign(y.textAlign||(y.textAlign=a.textAlign)),k=p+u+M;let S=g.x,D=g.y;h.setWidth(this.width),x?v>0&&S+k+c>this.right&&(D=g.y+=_,g.line++,S=g.x=t.a2(o,this.left+c,this.right-s[g.line])):v>0&&D+_>this.bottom&&(S=g.x=S+i[g.line].width+c,g.line++,D=g.y=t.a2(o,this.top+b+c,this.bottom-i[g.line].height));if(function(e,i,s){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;n.save();const o=t.v(s.lineWidth,1);if(n.fillStyle=t.v(s.fillStyle,r),n.lineCap=t.v(s.lineCap,"butt"),n.lineDashOffset=t.v(s.lineDashOffset,0),n.lineJoin=t.v(s.lineJoin,"miter"),n.lineWidth=o,n.strokeStyle=t.v(s.strokeStyle,r),n.setLineDash(t.v(s.lineDash,[])),a.usePointStyle){const r={radius:f*Math.SQRT2/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:o},l=h.xPlus(e,p/2),c=i+u;t.aD(n,r,l,c,a.pointStyleWidth&&p)}else{const a=i+Math.max((d-f)/2,0),r=h.leftForLtr(e,p),l=t.aw(s.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?t.au(n,{x:r,y:a,w:p,h:f,radius:l}):n.rect(r,a,p,f),n.fill(),0!==o&&n.stroke()}n.restore()}(h.x(S),D,y),S=t.aB(w,S+p+u,x?S+k:this.right,e.rtl),function(e,i,s){t.Z(n,s.text,e,i+m/2,l,{strikethrough:s.hidden,textAlign:h.textAlign(s.textAlign)})}(h.x(S),D,y),x)g.x+=k+c;else if("string"!=typeof y.text){const t=l.lineHeight;g.y+=di(y,t)+c}else g.y+=_})),t.aC(this.ctx,e.textDirection)}drawTitle(){const e=this.options,i=e.title,s=t.a0(i.font),n=t.E(i.padding);if(!i.display)return;const o=t.az(e.rtl,this.left,this.width),a=this.ctx,r=i.position,h=s.size/2,l=n.top+h;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+l,d=t.a2(e.align,d,this.right-u);else{const i=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+t.a2(e.align,this.top,this.bottom-i-e.labels.padding-this._computeTitleHeight())}const g=t.a2(r,d,d+u);a.textAlign=o.textAlign(t.a1(r)),a.textBaseline="middle",a.strokeStyle=i.color,a.fillStyle=i.color,a.font=s.string,t.Z(a,i.text,g,c,s)}_computeTitleHeight(){const e=this.options.title,i=t.a0(e.font),s=t.E(e.padding);return e.display?i.lineHeight+s.height:0}_getLegendItemAt(e,i){let s,n,o;if(t.aj(e,this.left,this.right)&&t.aj(i,this.top,this.bottom))for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],t.aj(e,n.left,n.left+n.width)&&t.aj(i,n.top,n.top+n.height))return this.legendItems[s];return null}handleEvent(e){const i=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(e.type,i))return;const s=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const a=this._hoveredItem,r=(o=s,null!==(n=a)&&null!==o&&n.datasetIndex===o.datasetIndex&&n.index===o.index);a&&!r&&t.Q(i.onLeave,[e,a,this],this),this._hoveredItem=s,s&&!r&&t.Q(i.onHover,[e,s,this],this)}else s&&t.Q(i.onClick,[e,s,this],this);var n,o}}function di(t,e){return e*(t.text?t.text.length:0)}var ui={id:"legend",_element:ci,start(t,e,i){const s=t.legend=new ci({ctx:t.ctx,options:i,chart:t});nt.configure(t,s,i),nt.addBox(t,s)},stop(t){nt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;nt.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const i=e.data.datasets,{labels:{usePointStyle:s,pointStyle:n,textAlign:o,color:a,useBorderRadius:r,borderRadius:h}}=e.legend.options;return e._getSortedDatasetMetas().map((e=>{const l=e.controller.getStyle(s?0:void 0),c=t.E(l.borderWidth);return{text:i[e.index].label,fillStyle:l.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:o||l.textAlign,borderRadius:r&&(h||l.borderRadius),datasetIndex:e.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class gi extends wt{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(e,i){const s=this.options;if(this.left=0,this.top=0,!s.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=i;const n=t.b(s.text)?s.text.length:1;this._padding=t.E(s.padding);const o=n*t.a0(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(e){const{top:i,left:s,bottom:n,right:o,options:a}=this,r=a.align;let h,l,c,d=0;return this.isHorizontal()?(l=t.a2(r,s,o),c=i+e,h=o-s):("left"===a.position?(l=s+e,c=t.a2(r,n,i),d=-.5*t.P):(l=o-e,c=t.a2(r,i,n),d=.5*t.P),h=n-i),{titleX:l,titleY:c,maxWidth:h,rotation:d}}draw(){const e=this.ctx,i=this.options;if(!i.display)return;const s=t.a0(i.font),n=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:h}=this._drawArgs(n);t.Z(e,i.text,0,0,s,{color:i.color,maxWidth:r,rotation:h,textAlign:t.a1(i.align),textBaseline:"middle",translation:[o,a]})}}var pi={id:"title",_element:gi,start(t,e,i){!function(t,e){const i=new gi({ctx:t.ctx,options:e,chart:t});nt.configure(t,i,e),nt.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;nt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;nt.configure(t,s,i),s.options=i},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 fi=new WeakMap;var mi={id:"subtitle",start(t,e,i){const s=new gi({ctx:t.ctx,options:i,chart:t});nt.configure(t,s,i),nt.addBox(t,s),fi.set(t,s)},stop(t){nt.removeBox(t,fi.get(t)),fi.delete(t)},beforeUpdate(t,e,i){const s=fi.get(t);nt.configure(t,s,i),s.options=i},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 xi={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s.add(t.x),n+=t.y,++o}}if(0===o||0===s.size)return!1;return{x:[...s].reduce(((t,e)=>t+e))/s.size,y:n/o}},nearest(e,i){if(!e.length)return!1;let s,n,o,a=i.x,r=i.y,h=Number.POSITIVE_INFINITY;for(s=0,n=e.length;s<n;++s){const n=e[s].element;if(n&&n.hasValue()){const e=n.getCenterPoint(),s=t.aE(i,e);s<h&&(h=s,o=n)}}if(o){const t=o.tooltipPosition();a=t.x,r=t.y}return{x:a,y:r}}};function bi(e,i){return i&&(t.b(i)?Array.prototype.push.apply(e,i):e.push(i)),e}function _i(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function yi(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function vi(e,i){const s=e.chart.ctx,{body:n,footer:o,title:a}=e,{boxWidth:r,boxHeight:h}=i,l=t.a0(i.bodyFont),c=t.a0(i.titleFont),d=t.a0(i.footerFont),u=a.length,g=o.length,p=n.length,f=t.E(i.padding);let m=f.height,x=0,b=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=e.beforeBody.length+e.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*i.titleSpacing+i.titleMarginBottom),b){m+=p*(i.displayColors?Math.max(h,l.lineHeight):l.lineHeight)+(b-p)*l.lineHeight+(b-1)*i.bodySpacing}g&&(m+=i.footerMarginTop+g*d.lineHeight+(g-1)*i.footerSpacing);let _=0;const y=function(t){x=Math.max(x,s.measureText(t).width+_)};return s.save(),s.font=c.string,t.F(e.title,y),s.font=l.string,t.F(e.beforeBody.concat(e.afterBody),y),_=i.displayColors?r+2+i.boxPadding:0,t.F(n,(e=>{t.F(e.before,y),t.F(e.lines,y),t.F(e.after,y)})),_=0,s.font=d.string,t.F(e.footer,y),s.restore(),x+=f.width,{width:x,height:m}}function Mi(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:h}}=t;let l="center";return"center"===s?l=n<=(r+h)/2?"left":"right":n<=o/2?l="left":n>=a-o/2&&(l="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(l,t,e,i)&&(l="center"),l}function wi(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Mi(t,e,i,s),yAlign:s}}function ki(e,i,s,n){const{caretSize:o,caretPadding:a,cornerRadius:r}=e,{xAlign:h,yAlign:l}=s,c=o+a,{topLeft:d,topRight:u,bottomLeft:g,bottomRight:p}=t.aw(r);let f=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(i,h);const m=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(i,l,c);return"center"===l?"left"===h?f+=c:"right"===h&&(f-=c):"left"===h?f-=Math.max(d,g)+o:"right"===h&&(f+=Math.max(u,p)+o),{x:t.S(f,0,n.width-i.width),y:t.S(m,0,n.height-i.height)}}function Si(e,i,s){const n=t.E(s.padding);return"center"===i?e.x+e.width/2:"right"===i?e.x+e.width-n.right:e.x+n.left}function Di(t){return bi([],_i(t))}function Pi(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Ci={beforeTitle:t.aF,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:t.aF,beforeBody:t.aF,beforeLabel:t.aF,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let i=e.dataset.label||"";i&&(i+=": ");const s=e.formattedValue;return t.k(s)||(i+=s),i},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:t.aF,afterBody:t.aF,beforeFooter:t.aF,footer:t.aF,afterFooter:t.aF};function Ai(t,e,i,s){const n=t[e].call(i,s);return void 0===n?Ci[e].call(i,s):n}class Li extends wt{static positioners=xi;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()),s=i.enabled&&e.options.animation&&i.animations,n=new a(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(e=this.chart.getContext(),i=this,s=this._tooltipItems,t.j(e,{tooltip:i,tooltipItems:s,type:"tooltip"})));var e,i,s}getTitle(t,e){const{callbacks:i}=e,s=Ai(i,"beforeTitle",this,t),n=Ai(i,"title",this,t),o=Ai(i,"afterTitle",this,t);let a=[];return a=bi(a,_i(s)),a=bi(a,_i(n)),a=bi(a,_i(o)),a}getBeforeBody(t,e){return Di(Ai(e.callbacks,"beforeBody",this,t))}getBody(e,i){const{callbacks:s}=i,n=[];return t.F(e,(t=>{const e={before:[],lines:[],after:[]},i=Pi(s,t);bi(e.before,_i(Ai(i,"beforeLabel",this,t))),bi(e.lines,Ai(i,"label",this,t)),bi(e.after,_i(Ai(i,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return Di(Ai(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Ai(i,"beforeFooter",this,t),n=Ai(i,"footer",this,t),o=Ai(i,"afterFooter",this,t);let a=[];return a=bi(a,_i(s)),a=bi(a,_i(n)),a=bi(a,_i(o)),a}_createItems(e){const i=this._active,s=this.chart.data,n=[],o=[],a=[];let r,h,l=[];for(r=0,h=i.length;r<h;++r)l.push(yi(this.chart,i[r]));return e.filter&&(l=l.filter(((t,i,n)=>e.filter(t,i,n,s)))),e.itemSort&&(l=l.sort(((t,i)=>e.itemSort(t,i,s)))),t.F(l,(t=>{const i=Pi(e.callbacks,t);n.push(Ai(i,"labelColor",this,t)),o.push(Ai(i,"labelPointStyle",this,t)),a.push(Ai(i,"labelTextColor",this,t))})),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=xi[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=vi(this,i),a=Object.assign({},t,e),r=wi(this.chart,i,a),h=ki(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(e,i,s){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:h,topRight:l,bottomLeft:c,bottomRight:d}=t.aw(r),{x:u,y:g}=e,{width:p,height:f}=i;let m,x,b,_,y,v;return"center"===o?(y=g+f/2,"left"===n?(m=u,x=m-a,_=y+a,v=y-a):(m=u+p,x=m+a,_=y-a,v=y+a),b=m):(x="left"===n?u+Math.max(h,c)+a:"right"===n?u+p-Math.max(l,d)-a:this.caretX,"top"===o?(_=g,y=_-a,m=x-a,b=x+a):(_=g+f,y=_+a,m=x+a,b=x-a),v=_),{x1:m,x2:x,x3:b,y1:_,y2:y,y3:v}}drawTitle(e,i,s){const n=this.title,o=n.length;let a,r,h;if(o){const l=t.az(s.rtl,this.x,this.width);for(e.x=Si(this,s.titleAlign,s),i.textAlign=l.textAlign(s.titleAlign),i.textBaseline="middle",a=t.a0(s.titleFont),r=s.titleSpacing,i.fillStyle=s.titleColor,i.font=a.string,h=0;h<o;++h)i.fillText(n[h],l.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+r,h+1===o&&(e.y+=s.titleMarginBottom-r)}}_drawColorBox(e,i,s,n,o){const a=this.labelColors[s],r=this.labelPointStyles[s],{boxHeight:h,boxWidth:l}=o,c=t.a0(o.bodyFont),d=Si(this,"left",o),u=n.x(d),g=h<c.lineHeight?(c.lineHeight-h)/2:0,p=i.y+g;if(o.usePointStyle){const i={radius:Math.min(l,h)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},s=n.leftForLtr(u,l)+l/2,c=p+h/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,t.at(e,i,s,c),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,t.at(e,i,s,c)}else{e.lineWidth=t.i(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const i=n.leftForLtr(u,l),s=n.leftForLtr(n.xPlus(u,1),l-2),r=t.aw(a.borderRadius);Object.values(r).some((t=>0!==t))?(e.beginPath(),e.fillStyle=o.multiKeyBackground,t.au(e,{x:i,y:p,w:l,h:h,radius:r}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),t.au(e,{x:s,y:p+1,w:l-2,h:h-2,radius:r}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(i,p,l,h),e.strokeRect(i,p,l,h),e.fillStyle=a.backgroundColor,e.fillRect(s,p+1,l-2,h-2))}e.fillStyle=this.labelTextColors[s]}drawBody(e,i,s){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:h,boxWidth:l,boxPadding:c}=s,d=t.a0(s.bodyFont);let u=d.lineHeight,g=0;const p=t.az(s.rtl,this.x,this.width),f=function(t){i.fillText(t,p.x(e.x+g),e.y+u/2),e.y+=u+o},m=p.textAlign(a);let x,b,_,y,v,M,w;for(i.textAlign=a,i.textBaseline="middle",i.font=d.string,e.x=Si(this,m,s),i.fillStyle=s.bodyColor,t.F(this.beforeBody,f),g=r&&"right"!==m?"center"===a?l/2+c:l+2+c:0,y=0,M=n.length;y<M;++y){for(x=n[y],b=this.labelTextColors[y],i.fillStyle=b,t.F(x.before,f),_=x.lines,r&&_.length&&(this._drawColorBox(i,e,y,p,s),u=Math.max(d.lineHeight,h)),v=0,w=_.length;v<w;++v)f(_[v]),u=d.lineHeight;t.F(x.after,f)}g=0,u=d.lineHeight,t.F(this.afterBody,f),e.y-=o}drawFooter(e,i,s){const n=this.footer,o=n.length;let a,r;if(o){const h=t.az(s.rtl,this.x,this.width);for(e.x=Si(this,s.footerAlign,s),e.y+=s.footerMarginTop,i.textAlign=h.textAlign(s.footerAlign),i.textBaseline="middle",a=t.a0(s.footerFont),i.fillStyle=s.footerColor,i.font=a.string,r=0;r<o;++r)i.fillText(n[r],h.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+s.footerSpacing}}drawBackground(e,i,s,n){const{xAlign:o,yAlign:a}=this,{x:r,y:h}=e,{width:l,height:c}=s,{topLeft:d,topRight:u,bottomLeft:g,bottomRight:p}=t.aw(n.cornerRadius);i.fillStyle=n.backgroundColor,i.strokeStyle=n.borderColor,i.lineWidth=n.borderWidth,i.beginPath(),i.moveTo(r+d,h),"top"===a&&this.drawCaret(e,i,s,n),i.lineTo(r+l-u,h),i.quadraticCurveTo(r+l,h,r+l,h+u),"center"===a&&"right"===o&&this.drawCaret(e,i,s,n),i.lineTo(r+l,h+c-p),i.quadraticCurveTo(r+l,h+c,r+l-p,h+c),"bottom"===a&&this.drawCaret(e,i,s,n),i.lineTo(r+g,h+c),i.quadraticCurveTo(r,h+c,r,h+c-g),"center"===a&&"left"===o&&this.drawCaret(e,i,s,n),i.lineTo(r,h+d),i.quadraticCurveTo(r,h,r+d,h),i.closePath(),i.fill(),n.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=xi[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=vi(this,t),a=Object.assign({},i,this._size),r=wi(e,t,a),h=ki(t,a,r,e);s._to===h.x&&n._to===h.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(e){const i=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(i);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=t.E(i.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&r&&(e.save(),e.globalAlpha=s,this.drawBackground(o,e,n,i),t.aA(e,i.textDirection),o.y+=a.top,this.drawTitle(o,e,i),this.drawBody(o,e,i),this.drawFooter(o,e,i),t.aC(e,i.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,i){const s=this._active,n=e.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),o=!t.ah(s,n),a=this._positionChanged(n,i);(o||a)&&(this._active=n,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,i,s=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(e,o,i,s),r=this._positionChanged(a,e),h=i||!t.ah(a,o)||r;return h&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,i))),h}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=xi[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Oi={id:"tooltip",_element:Li,positioners:xi,afterInit(t,e,i){i&&(t.tooltip=new Li({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ci},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ei=Object.freeze({__proto__:null,Colors:We,Decimation:Ue,Filler:hi,Legend:ui,SubTitle:mi,Title:pi,Tooltip:Oi});function Ti(t,e,i,s){const n=t.indexOf(e);if(-1===n)return((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}function zi(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Ri extends Tt{static id="category";static defaults={ticks:{callback:zi}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(e,i){if(t.k(e))return null;const s=this.getLabels();return((e,i)=>null===e?null:t.S(Math.round(e),0,i))(i=isFinite(i)&&s[i]===e?i:Ti(s,e,t.v(i,e),this._addedLabels),s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return zi.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Fi(e,i,{horizontal:s,minRotation:n}){const o=t.t(n),a=(s?Math.sin(o):Math.cos(o))||.001,r=.75*i*(""+e).length;return Math.min(i/a,r)}class Ii extends Tt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,i){return t.k(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:i,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const a=t=>n=i?n:t,r=t=>o=s?o:t;if(e){const e=t.s(n),i=t.s(o);e<0&&i<0?r(0):e>0&&i>0&&a(0)}if(n===o){let t=0===o?1:Math.abs(.05*o);r(o+t),e||a(n-t)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,i=e.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n=function(e,i){const s=[],{bounds:n,step:o,min:a,max:r,precision:h,count:l,maxTicks:c,maxDigits:d,includeBounds:u}=e,g=o||1,p=c-1,{min:f,max:m}=i,x=!t.k(a),b=!t.k(r),_=!t.k(l),y=(m-f)/(d+1);let v,M,w,k,S=t.aH((m-f)/p/g)*g;if(S<1e-14&&!x&&!b)return[{value:f},{value:m}];k=Math.ceil(m/S)-Math.floor(f/S),k>p&&(S=t.aH(k*S/p/g)*g),t.k(h)||(v=Math.pow(10,h),S=Math.ceil(S*v)/v),"ticks"===n?(M=Math.floor(f/S)*S,w=Math.ceil(m/S)*S):(M=f,w=m),x&&b&&o&&t.aI((r-a)/o,S/1e3)?(k=Math.round(Math.min((r-a)/S,c)),S=(r-a)/k,M=a,w=r):_?(M=x?a:M,w=b?r:w,k=l-1,S=(w-M)/k):(k=(w-M)/S,k=t.aJ(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const D=Math.max(t.aK(S),t.aK(M));v=Math.pow(10,t.k(h)?D:h),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let P=0;for(x&&(u&&M!==a?(s.push({value:a}),M<a&&P++,t.aJ(Math.round((M+P*S)*v)/v,a,Fi(a,y,e))&&P++):M<a&&P++);P<k;++P){const t=Math.round((M+P*S)*v)/v;if(b&&t>r)break;s.push({value:t})}return b&&u&&w!==r?s.length&&t.aJ(s[s.length-1].value,r,Fi(r,y,e))?s[s.length-1].value=r:s.push({value:r}):b&&w!==r||s.push({value:w}),s}({maxTicks:s,bounds:e.bounds,min:e.min,max:e.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:!1!==i.includeBounds},this._range||this);return"ticks"===e.bounds&&t.aG(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(e){return t.o(e,this.chart.options.locale,this.options.ticks.format)}}class Vi extends Ii{static id="linear";static defaults={ticks:{callback:t.aL.formatters.numeric}};determineDataLimits(){const{min:e,max:i}=this.getMinMax(!0);this.min=t.g(e)?e:0,this.max=t.g(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),i=e?this.width:this.height,s=t.t(this.options.ticks.minRotation),n=(e?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Bi=e=>Math.floor(t.aM(e)),Hi=(t,e)=>Math.pow(10,Bi(t)+e);function Ni(t){return 1===t/Math.pow(10,Bi(t))}function Wi(t,e,i){const s=Math.pow(10,i),n=Math.floor(t/s);return Math.ceil(e/s)-n}function ji(e,{min:i,max:s}){i=t.O(e.min,i);const n=[],o=Bi(i);let a=function(t,e){let i=Bi(e-t);for(;Wi(t,e,i)>10;)i++;for(;Wi(t,e,i)<10;)i--;return Math.min(i,Bi(t))}(i,s),r=a<0?Math.pow(10,Math.abs(a)):1;const h=Math.pow(10,a),l=o>a?Math.pow(10,o):0,c=Math.round((i-l)*r)/r,d=Math.floor((i-l)/h/10)*h*10;let u=Math.floor((c-d)/Math.pow(10,a)),g=t.O(e.min,Math.round((l+d+u*Math.pow(10,a))*r)/r);for(;g<s;)n.push({value:g,major:Ni(g),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(a++,u=2,r=a>=0?1:r),g=Math.round((l+d+u*Math.pow(10,a))*r)/r;const p=t.O(e.max,g);return n.push({value:p,major:Ni(p),significand:u}),n}class $i extends Tt{static id="logarithmic";static defaults={ticks:{callback:t.aL.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,i){const s=Ii.prototype.parse.apply(this,[e,i]);if(0!==s)return t.g(s)&&s>0?s:null;this._zero=!0}determineDataLimits(){const{min:e,max:i}=this.getMinMax(!0);this.min=t.g(e)?Math.max(0,e):null,this.max=t.g(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!t.g(this._userMin)&&(this.min=e===Hi(this.min,0)?Hi(this.min,-1):Hi(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t;i===s&&(i<=0?(n(1),o(10)):(n(Hi(i,-1)),o(Hi(s,1)))),i<=0&&n(Hi(s,-1)),s<=0&&o(Hi(i,1)),this.min=i,this.max=s}buildTicks(){const e=this.options,i=ji({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&t.aG(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return void 0===e?"0":t.o(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=t.aM(e),this._valueRange=t.aM(this.max)-t.aM(e)}getPixelForValue(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(t.aM(e)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Ui(e){const i=e.ticks;if(i.display&&e.display){const e=t.E(i.backdropPadding);return t.v(i.font&&i.font.size,t.d.font.size)+e.height}return 0}function Yi(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function Xi(e){const i={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},s=Object.assign({},i),n=[],o=[],a=e._pointLabels.length,r=e.options.pointLabels,h=r.centerPointLabels?t.P/a:0;for(let u=0;u<a;u++){const a=r.setContext(e.getPointLabelContext(u));o[u]=a.padding;const g=e.getPointPosition(u,e.drawingArea+o[u],h),p=t.a0(a.font),f=(l=e.ctx,c=p,d=e._pointLabels[u],d=t.b(d)?d:[d],{w:t.aN(l,c.string,d),h:d.length*c.lineHeight});n[u]=f;const m=t.ay(e.getIndexAngle(u)+h),x=Math.round(t.U(m));Qi(s,i,m,Yi(x,g.x,f.w,0,180),Yi(x,g.y,f.h,90,270))}var l,c,d;e.setCenterPoint(i.l-s.l,s.r-i.r,i.t-s.t,s.b-i.b),e._pointLabelItems=function(e,i,s){const n=[],o=e._pointLabels.length,a=e.options,{centerPointLabels:r,display:h}=a.pointLabels,l={extra:Ui(a)/2,additionalAngle:r?t.P/o:0};let c;for(let t=0;t<o;t++){l.padding=s[t],l.size=i[t];const o=Gi(e,t,l);n.push(o),"auto"===h&&(o.visible=Ki(o,c),o.visible&&(c=o))}return n}(e,n,o)}function Qi(t,e,i,s,n){const o=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i));let r=0,h=0;s.start<e.l?(r=(e.l-s.start)/o,t.l=Math.min(t.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),n.start<e.t?(h=(e.t-n.start)/a,t.t=Math.min(t.t,e.t-h)):n.end>e.b&&(h=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+h))}function Gi(e,i,s){const n=e.drawingArea,{extra:o,additionalAngle:a,padding:r,size:h}=s,l=e.getPointPosition(i,n+o+r,a),c=Math.round(t.U(t.ay(l.angle+t.H))),d=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,h.h,c),u=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),g=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,h.w,u);return{visible:!0,x:l.x,y:d,textAlign:u,left:g,top:d,right:g+h.w,bottom:d+h.h}}function Ki(e,i){if(!i)return!0;const{left:s,top:n,right:o,bottom:a}=e;return!(t.C({x:s,y:n},i)||t.C({x:s,y:a},i)||t.C({x:o,y:n},i)||t.C({x:o,y:a},i))}function qi(e,i,s){const{left:n,top:o,right:a,bottom:r}=s,{backdropColor:h}=i;if(!t.k(h)){const s=t.aw(i.borderRadius),l=t.E(i.backdropPadding);e.fillStyle=h;const c=n-l.left,d=o-l.top,u=a-n+l.width,g=r-o+l.height;Object.values(s).some((t=>0!==t))?(e.beginPath(),t.au(e,{x:c,y:d,w:u,h:g,radius:s}),e.fill()):e.fillRect(c,d,u,g)}}function Ji(e,i,s,n){const{ctx:o}=e;if(s)o.arc(e.xCenter,e.yCenter,i,0,t.T);else{let t=e.getPointPosition(0,i);o.moveTo(t.x,t.y);for(let s=1;s<n;s++)t=e.getPointPosition(s,i),o.lineTo(t.x,t.y)}}class Zi extends Ii{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:t.aL.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=t.E(Ui(this.options)/2),i=this.width=this.maxWidth-e.width,s=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+i/2+e.left),this.yCenter=Math.floor(this.top+s/2+e.top),this.drawingArea=Math.floor(Math.min(i,s)/2)}determineDataLimits(){const{min:e,max:i}=this.getMinMax(!1);this.min=t.g(e)&&!isNaN(e)?e:0,this.max=t.g(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ui(this.options))}generateTickLabels(e){Ii.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map(((e,i)=>{const s=t.Q(this.options.pointLabels.callback,[e,i],this);return s||0===s?s:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?Xi(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(e){const i=t.T/(this._pointLabels.length||1),s=this.options.startAngle||0;return t.ay(e*i+t.t(s))}getDistanceFromCenterForValue(e){if(t.k(e))return NaN;const i=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*i:(e-this.min)*i}getValueForDistanceFromCenter(e){if(t.k(e))return NaN;const i=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-i:this.min+i}getPointLabelContext(e){const i=this._pointLabels||[];if(e>=0&&e<i.length){const s=i[e];return function(e,i,s){return t.j(e,{label:s,index:i,type:"pointLabel"})}(this.getContext(),e,s)}}getPointPosition(e,i,s=0){const n=this.getIndexAngle(e)-t.H+s;return{x:Math.cos(n)*i+this.xCenter,y:Math.sin(n)*i+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Ji(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,i=this.options,{angleLines:s,grid:n,border:o}=i,a=this._pointLabels.length;let r,h,l;if(i.pointLabels.display&&function(e,i){const{ctx:s,options:{pointLabels:n}}=e;for(let o=i-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const a=n.setContext(e.getPointLabelContext(o));qi(s,a,i);const r=t.a0(a.font),{x:h,y:l,textAlign:c}=i;t.Z(s,e._pointLabels[o],h,l+r.lineHeight/2,r,{color:a.color,textAlign:c,textBaseline:"middle"})}}(this,a),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){h=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),s=n.setContext(i),r=o.setContext(i);!function(t,e,i,s,n){const o=t.ctx,a=e.circular,{color:r,lineWidth:h}=e;!a&&!s||!r||!h||i<0||(o.save(),o.strokeStyle=r,o.lineWidth=h,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),Ji(t,i,a,s),o.closePath(),o.stroke(),o.restore())}(this,s,h,a,r)}})),s.display){for(e.save(),r=a-1;r>=0;r--){const t=s.setContext(this.getPointLabelContext(r)),{color:n,lineWidth:o}=t;o&&n&&(e.lineWidth=o,e.strokeStyle=n,e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,h=this.getDistanceFromCenterForValue(i.reverse?this.min:this.max),l=this.getPointPosition(r,h),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,i=this.options,s=i.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let o,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach(((n,r)=>{if(0===r&&this.min>=0&&!i.reverse)return;const h=s.setContext(this.getContext(r)),l=t.a0(h.font);if(o=this.getDistanceFromCenterForValue(this.ticks[r].value),h.showLabelBackdrop){e.font=l.string,a=e.measureText(n.label).width,e.fillStyle=h.backdropColor;const i=t.E(h.backdropPadding);e.fillRect(-a/2-i.left,-o-l.size/2-i.top,a+i.width,l.size+i.height)}t.Z(e,n.label,0,-o,l,{color:h.color,strokeColor:h.textStrokeColor,strokeWidth:h.textStrokeWidth})})),e.restore()}drawTitle(){}}const ts={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}},es=Object.keys(ts);function is(t,e){return t-e}function ss(e,i){if(t.k(i))return null;const s=e._adapter,{parser:n,round:o,isoWeekday:a}=e._parseOpts;let r=i;return"function"==typeof n&&(r=n(r)),t.g(r)||(r="string"==typeof n?s.parse(r,n):s.parse(r)),null===r?null:(o&&(r="week"!==o||!t.x(a)&&!0!==a?s.startOf(r,o):s.startOf(r,"isoWeek",a)),+r)}function ns(t,e,i,s){const n=es.length;for(let o=es.indexOf(t);o<n-1;++o){const t=ts[es[o]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return es[o]}return es[n-1]}function os(e,i,s){if(s){if(s.length){const{lo:n,hi:o}=t.aP(s,i);e[s[n]>=i?s[n]:s[o]]=!0}}else e[i]=!0}function as(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a<o;++a)r=e[a],n[r]=a,s.push({value:r,major:!1});return 0!==o&&i?function(t,e,i,s){const n=t._adapter,o=+n.startOf(e[0].value,s),a=e[e.length-1].value;let r,h;for(r=o;r<=a;r=+n.add(r,1,s))h=i[r],h>=0&&(e[h].major=!0);return e}(t,s,n,i):s}class rs extends Tt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,i={}){const s=e.time||(e.time={}),n=this._adapter=new V._date(e.adapters.date);n.init(i),t.ab(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(e),this._normalized=i.normalized}parse(t,e){return void 0===t?null:ss(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,i=this._adapter,s=e.time.unit||"day";let{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function h(t){a||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(o=Math.max(o,t.max))}a&&r||(h(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||h(this.getMinMax(!1))),n=t.g(n)&&!isNaN(n)?n:+i.startOf(Date.now(),s),o=t.g(o)&&!isNaN(o)?o:+i.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const e=this.options,i=e.time,s=e.ticks,n="labels"===s.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,a=this.max,r=t.aO(n,o,a);return this._unit=i.unit||(s.autoSkip?ns(i.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(t,e,i,s,n){for(let o=es.length-1;o>=es.indexOf(i);o--){const i=es[o];if(ts[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return es[i?es.indexOf(i):0]}(this,r.length,i.minUnit,this.min,this.max)),this._majorUnit=s.major.enabled&&"year"!==this._unit?function(t){for(let e=es.indexOf(t)+1,i=es.length;e<i;++e)if(ts[es[e]].common)return es[e]}(this._unit):void 0,this.initOffsets(n),e.reverse&&r.reverse(),as(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(e=[]){let i,s,n=0,o=0;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),n=1===e.length?1-i:(this.getDecimalForValue(e[1])-i)/2,s=this.getDecimalForValue(e[e.length-1]),o=1===e.length?s:(s-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;n=t.S(n,0,a),o=t.S(o,0,a),this._offsets={start:n,end:o,factor:1/(n+1+o)}}_generate(){const e=this._adapter,i=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||ns(o.minUnit,i,s,this._getLabelCapacity(i)),r=t.v(n.ticks.stepSize,1),h="week"===a&&o.isoWeekday,l=t.x(h)||!0===h,c={};let d,u,g=i;if(l&&(g=+e.startOf(g,"isoWeek",h)),g=+e.startOf(g,l?"day":a),e.diff(s,i,a)>1e5*r)throw new Error(i+" and "+s+" are too far apart with stepSize of "+r+" "+a);const p="data"===n.ticks.source&&this.getDataTimestamps();for(d=g,u=0;d<s;d=+e.add(d,r,a),u++)os(c,d,p);return d!==s&&"ticks"!==n.bounds&&1!==u||os(c,d,p),Object.keys(c).sort(is).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,s=this._unit,n=e||i[s];return this._adapter.format(t,n)}_tickFormatFunction(e,i,s,n){const o=this.options,a=o.ticks.callback;if(a)return t.Q(a,[e,i,s],this);const r=o.time.displayFormats,h=this._unit,l=this._majorUnit,c=h&&r[h],d=l&&r[l],u=s[i],g=l&&d&&u&&u.major;return this._adapter.format(e,n||(g?d:c))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const i=this.options.ticks,s=this.ctx.measureText(e).width,n=t.t(this.isHorizontal()?i.maxRotation:i.minRotation),o=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:s*o+r*a,h:s*a+r*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,as(this,[t],this._majorUnit),s),o=this._getLabelSize(n),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(ss(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(e){return t._(e.sort(is))}}function hs(e,i,s){let n,o,a,r,h=0,l=e.length-1;s?(i>=e[h].pos&&i<=e[l].pos&&({lo:h,hi:l}=t.B(e,"pos",i)),({pos:n,time:a}=e[h]),({pos:o,time:r}=e[l])):(i>=e[h].time&&i<=e[l].time&&({lo:h,hi:l}=t.B(e,"time",i)),({time:n,pos:a}=e[h]),({time:o,pos:r}=e[l]));const c=o-n;return c?a+(r-a)*(i-n)/c:a}class ls extends rs{static id="timeseries";static defaults=rs.defaults;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=hs(e,this.min),this._tableRange=hs(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,h,l;for(o=0,a=t.length;o<a;++o)h=t[o],h>=e&&h<=i&&s.push(h);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)l=s[o+1],r=s[o-1],h=s[o],Math.round((l+r)/2)!==h&&n.push({time:h,pos:o/(a-1)});return n}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort(((t,e)=>t-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(hs(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return hs(this._table,i*this._tableRange+this._minPos,!0)}}var cs=Object.freeze({__proto__:null,CategoryScale:Ri,LinearScale:Vi,LogarithmicScale:$i,RadialLinearScale:Zi,TimeScale:rs,TimeSeriesScale:ls});const ds=[R,Re,Ei,cs];exports.Ticks=t.aL,exports.defaults=t.d,exports.Animation=o,exports.Animations=a,exports.ArcElement=me,exports.BarController=P,exports.BarElement=ze,exports.BasePlatform=ot,exports.BasicPlatform=at,exports.BubbleController=C,exports.CategoryScale=Ri,exports.Chart=ce,exports.Colors=We,exports.DatasetController=b,exports.Decimation=Ue,exports.DomPlatform=vt,exports.DoughnutController=A,exports.Element=wt,exports.Filler=hi,exports.Interaction=U,exports.Legend=ui,exports.LineController=L,exports.LineElement=Se,exports.LinearScale=Vi,exports.LogarithmicScale=$i,exports.PieController=E,exports.PointElement=Pe,exports.PolarAreaController=O,exports.RadarController=T,exports.RadialLinearScale=Zi,exports.Scale=Tt,exports.ScatterController=z,exports.SubTitle=mi,exports.TimeScale=rs,exports.TimeSeriesScale=ls,exports.Title=pi,exports.Tooltip=Oi,exports._adapters=V,exports._detectPlatform=Mt,exports.animator=i,exports.controllers=R,exports.elements=Re,exports.layouts=nt,exports.plugins=Ei,exports.registerables=ds,exports.registry=Ft,exports.scales=cs;
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../@kurkle/color/dist/color.esm.js");
2
+ /*!
3
+ * Chart.js v4.4.7
4
+ * https://www.chartjs.org
5
+ * (c) 2024 Chart.js Contributors
6
+ * Released under the MIT License
7
+ */const e=(()=>{let t=0;return()=>t++})();function o(t){return null==t}function n(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function r(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function i(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function s(t,e){return void 0===t?e:t}const a=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function c(t){if(n(t))return t.map(c);if(r(t)){const e=Object.create(null),o=Object.keys(t),n=o.length;let r=0;for(;r<n;++r)e[o[r]]=c(t[o[r]]);return e}return t}function l(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function u(t,e,o,n){if(!l(t))return;const i=e[t],s=o[t];r(i)&&r(s)?h(i,s,n):e[t]=c(s)}function h(t,e,o){const i=n(e)?e:[e],s=i.length;if(!r(t))return t;const a=(o=o||{}).merger||u;let c;for(let e=0;e<s;++e){if(c=i[e],!r(c))continue;const n=Object.keys(c);for(let e=0,r=n.length;e<r;++e)a(n[e],t,c,o)}return t}function p(t,e){return h(t,e,{merger:f})}function f(t,e,o){if(!l(t))return;const n=e[t],i=o[t];r(n)&&r(i)?p(n,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=c(i))}const d={"":t=>t,x:t=>t.x,y:t=>t.y};function x(t){const e=t.split("."),o=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(o.push(n),n="");return o}function g(t,e){const o=d[e]||(d[e]=function(t){const e=x(t);return t=>{for(const o of e){if(""===o)break;t=t&&t[o]}return t}}(e));return o(t)}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}const b=t=>"function"==typeof t;const m=Math.PI,v=2*m,M=v+m,w=Number.POSITIVE_INFINITY,k=m/180,_=m/2,O=m/4,P=2*m/3,T=Math.log10,C=Math.sign;function S(t,e,o){return Math.abs(t-e)<o}function j(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function I(t,e){return(t-e+M)%v-m}function R(t){return(t%v+v)%v}function W(t,e,o,n){const r=R(t),i=R(e),s=R(o),a=R(i-r),c=R(s-r),l=R(r-i),u=R(r-s);return r===i||r===s||n&&i===s||a>c&&l<u}function B(t,e,o){return Math.max(e,Math.min(o,t))}function A(t,e,o,n=1e-6){return t>=Math.min(e,o)-n&&t<=Math.max(e,o)+n}function D(t,e,o){o=o||(o=>t[o]<e);let n,r=t.length-1,i=0;for(;r-i>1;)n=i+r>>1,o(n)?i=n:r=n;return{lo:i,hi:r}}const N=(t,e,o,n)=>D(t,o,n?n=>{const r=t[n][e];return r<o||r===o&&t[n+1][e]===o}:n=>t[n][e]<o);const L=["push","pop","shift","splice","unshift"];const z="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;const E=t=>0===t||1===t,H=(t,e,o)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*v/o),F=(t,e,o)=>Math.pow(2,-10*t)*Math.sin((t-e)*v/o)+1,q={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*_),easeOutSine:t=>Math.sin(t*_),easeInOutSine:t=>-.5*(Math.cos(m*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>E(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>E(t)?t:H(t,.075,.3),easeOutElastic:t=>E(t)?t:F(t,.075,.3),easeInOutElastic(t){const e=.1125;return E(t)?t:t<.5?.5*H(2*t,e,.45):.5+.5*F(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-q.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,o=2.75;return t<1/o?e*t*t:t<2/o?e*(t-=1.5/o)*t+.75:t<2.5/o?e*(t-=2.25/o)*t+.9375:e*(t-=2.625/o)*t+.984375},easeInOutBounce:t=>t<.5?.5*q.easeInBounce(2*t):.5*q.easeOutBounce(2*t-1)+.5};function Q(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function $(e){return Q(e)?e:new t.Color(e).saturate(.5).darken(.1).hexString()}const K=["x","y","borderWidth","radius","tension"],J=["color","borderColor","backgroundColor"];const V=new Map;function G(t,e,o){return function(t,e){e=e||{};const o=t+JSON.stringify(e);let n=V.get(o);return n||(n=new Intl.NumberFormat(t,e),V.set(o,n)),n}(e,o).format(t)}const Y={values:t=>n(t)?t:""+t,numeric(t,e,o){if(0===t)return"0";const n=this.chart.options.locale;let r,i=t;if(o.length>1){const e=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),i=function(t,e){let o=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(o)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t));return o}(t,o)}const s=T(Math.abs(i)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),c={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),G(t,n,c)},logarithmic(t,e,o){if(0===t)return"0";const n=o[e].significand||t/Math.pow(10,Math.floor(T(t)));return[1,2,3,5,10,15].includes(n)||e>.8*o.length?Y.numeric.call(this,t,e,o):""}};var U={formatters:Y};const X=Object.create(null),Z=Object.create(null);function tt(t,e){if(!e)return t;const o=e.split(".");for(let e=0,n=o.length;e<n;++e){const n=o[e];t=t[n]||(t[n]=Object.create(null))}return t}function et(t,e,o){return"string"==typeof e?h(tt(t,e),o):h(tt(t,""),e)}class ot{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>$(e.backgroundColor),this.hoverBorderColor=(t,e)=>$(e.borderColor),this.hoverColor=(t,e)=>$(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return et(this,t,e)}get(t){return tt(this,t)}describe(t,e){return et(Z,t,e)}override(t,e){return et(X,t,e)}route(t,e,o,n){const i=tt(this,t),a=tt(this,o),c="_"+e;Object.defineProperties(i,{[c]:{value:i[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[c],e=a[n];return r(t)?Object.assign({},e,t):s(t,e)},set(t){this[c]=t}}})}apply(t){t.forEach((t=>t(this)))}}var nt=new ot({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:J},numbers:{type:"number",properties:K}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:U.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function rt(t){return!t||o(t.size)||o(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function it(t,e,o,n,r){let i=e[r];return i||(i=e[r]=t.measureText(r).width,o.push(r)),i>n&&(n=i),n}function st(t,e,o,n,r){let i,s,a,c,l,u,h,p;const f=e.pointStyle,d=e.rotation,x=e.radius;let g=(d||0)*k;if(f&&"object"==typeof f&&(i=f.toString(),"[object HTMLImageElement]"===i||"[object HTMLCanvasElement]"===i))return t.save(),t.translate(o,n),t.rotate(g),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(x)||x<=0)){switch(t.beginPath(),f){default:r?t.ellipse(o,n,r/2,x,0,0,v):t.arc(o,n,x,0,v),t.closePath();break;case"triangle":u=r?r/2:x,t.moveTo(o+Math.sin(g)*u,n-Math.cos(g)*x),g+=P,t.lineTo(o+Math.sin(g)*u,n-Math.cos(g)*x),g+=P,t.lineTo(o+Math.sin(g)*u,n-Math.cos(g)*x),t.closePath();break;case"rectRounded":l=.516*x,c=x-l,s=Math.cos(g+O)*c,h=Math.cos(g+O)*(r?r/2-l:c),a=Math.sin(g+O)*c,p=Math.sin(g+O)*(r?r/2-l:c),t.arc(o-h,n-a,l,g-m,g-_),t.arc(o+p,n-s,l,g-_,g),t.arc(o+h,n+a,l,g,g+_),t.arc(o-p,n+s,l,g+_,g+m),t.closePath();break;case"rect":if(!d){c=Math.SQRT1_2*x,u=r?r/2:c,t.rect(o-u,n-c,2*u,2*c);break}g+=O;case"rectRot":h=Math.cos(g)*(r?r/2:x),s=Math.cos(g)*x,a=Math.sin(g)*x,p=Math.sin(g)*(r?r/2:x),t.moveTo(o-h,n-a),t.lineTo(o+p,n-s),t.lineTo(o+h,n+a),t.lineTo(o-p,n+s),t.closePath();break;case"crossRot":g+=O;case"cross":h=Math.cos(g)*(r?r/2:x),s=Math.cos(g)*x,a=Math.sin(g)*x,p=Math.sin(g)*(r?r/2:x),t.moveTo(o-h,n-a),t.lineTo(o+h,n+a),t.moveTo(o+p,n-s),t.lineTo(o-p,n+s);break;case"star":h=Math.cos(g)*(r?r/2:x),s=Math.cos(g)*x,a=Math.sin(g)*x,p=Math.sin(g)*(r?r/2:x),t.moveTo(o-h,n-a),t.lineTo(o+h,n+a),t.moveTo(o+p,n-s),t.lineTo(o-p,n+s),g+=O,h=Math.cos(g)*(r?r/2:x),s=Math.cos(g)*x,a=Math.sin(g)*x,p=Math.sin(g)*(r?r/2:x),t.moveTo(o-h,n-a),t.lineTo(o+h,n+a),t.moveTo(o+p,n-s),t.lineTo(o-p,n+s);break;case"line":s=r?r/2:Math.cos(g)*x,a=Math.sin(g)*x,t.moveTo(o-s,n-a),t.lineTo(o+s,n+a);break;case"dash":t.moveTo(o,n),t.lineTo(o+Math.cos(g)*(r?r/2:x),n+Math.sin(g)*x);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function at(t,e,o){return o=o||.5,!e||t&&t.x>e.left-o&&t.x<e.right+o&&t.y>e.top-o&&t.y<e.bottom+o}function ct(t,e,o,n,r){if(r.strikethrough||r.underline){const i=t.measureText(n),s=e-i.actualBoundingBoxLeft,a=e+i.actualBoundingBoxRight,c=o-i.actualBoundingBoxAscent,l=o+i.actualBoundingBoxDescent,u=r.strikethrough?(c+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(s,u),t.lineTo(a,u),t.stroke()}}function lt(t,e){const o=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=o}const ut=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ht=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pt(t,e){const o=(""+t).match(ut);if(!o||"normal"===o[1])return 1.2*e;switch(t=+o[2],o[3]){case"px":return t;case"%":t/=100}return e*t}const ft=t=>+t||0;function dt(t,e){const o={},n=r(e),i=n?Object.keys(e):e,a=r(t)?n?o=>s(t[o],t[e[o]]):e=>t[e]:()=>t;for(const t of i)o[t]=ft(a(t));return o}function xt(t){return dt(t,{top:"y",right:"x",bottom:"y",left:"x"})}function gt(t,e){return Object.assign(Object.create(t),e)}function yt(t,e=[""],o,n,r=(()=>t[0])){const i=o||t;void 0===n&&(n=Ct("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:o=>yt([o,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,o)=>(delete e[o],delete e._keys,delete t[0][o],!0),get:(o,n)=>wt(o,n,(()=>function(t,e,o,n){let r;for(const i of e)if(r=Ct(vt(i,t),o),void 0!==r)return Mt(t,r)?Pt(o,n,t,r):r}(n,e,t,o))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>St(t).includes(e),ownKeys:t=>St(t),set(t,e,o){const n=t._storage||(t._storage=r());return t[e]=n[e]=o,delete t._keys,!0}})}function bt(t,e,o,i){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:o,_stack:new Set,_descriptors:mt(t,i),setContext:e=>bt(t,e,o,i),override:n=>bt(t.override(n),e,o,i)};return new Proxy(s,{deleteProperty:(e,o)=>(delete e[o],delete t[o],!0),get:(t,e,o)=>wt(t,e,(()=>function(t,e,o){const{_proxy:i,_context:s,_subProxy:a,_descriptors:c}=t;let l=i[e];b(l)&&c.isScriptable(e)&&(l=function(t,e,o,n){const{_proxy:r,_context:i,_subProxy:s,_stack:a}=o;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let c=e(i,s||n);a.delete(t),Mt(t,c)&&(c=Pt(r._scopes,r,t,c));return c}(e,l,t,o));n(l)&&l.length&&(l=function(t,e,o,n){const{_proxy:i,_context:s,_subProxy:a,_descriptors:c}=o;if(void 0!==s.index&&n(t))return e[s.index%e.length];if(r(e[0])){const o=e,n=i._scopes.filter((t=>t!==o));e=[];for(const r of o){const o=Pt(n,i,t,r);e.push(bt(o,s,a&&a[t],c))}}return e}(e,l,t,c.isIndexable));Mt(e,l)&&(l=bt(l,s,a&&a[e],c));return l}(t,e,o))),getOwnPropertyDescriptor:(e,o)=>e._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,o)=>Reflect.has(t,o),ownKeys:()=>Reflect.ownKeys(t),set:(e,o,n)=>(t[o]=n,delete e[o],!0)})}function mt(t,e={scriptable:!0,indexable:!0}){const{_scriptable:o=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:o,indexable:n,isScriptable:b(o)?o:()=>o,isIndexable:b(n)?n:()=>n}}const vt=(t,e)=>t?t+y(e):e,Mt=(t,e)=>r(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function wt(t,e,o){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=o();return t[e]=n,n}function kt(t,e,o){return b(t)?t(e,o):t}const _t=(t,e)=>!0===t?e:"string"==typeof t?g(e,t):void 0;function Ot(t,e,o,n,r){for(const i of e){const e=_t(o,i);if(e){t.add(e);const i=kt(e._fallback,o,r);if(void 0!==i&&i!==o&&i!==n)return i}else if(!1===e&&void 0!==n&&o!==n)return null}return!1}function Pt(t,e,o,i){const s=e._rootScopes,a=kt(e._fallback,o,i),c=[...t,...s],l=new Set;l.add(i);let u=Tt(l,c,o,a||o,i);return null!==u&&((void 0===a||a===o||(u=Tt(l,c,a,u,i),null!==u))&&yt(Array.from(l),[""],s,a,(()=>function(t,e,o){const i=t._getTarget();e in i||(i[e]={});const s=i[e];if(n(s)&&r(o))return o;return s||{}}(e,o,i))))}function Tt(t,e,o,n,r){for(;o;)o=Ot(t,e,o,n,r);return o}function Ct(t,e){for(const o of e){if(!o)continue;const e=o[t];if(void 0!==e)return e}}function St(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const o of t)for(const t of Object.keys(o).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const jt=Number.EPSILON||1e-14,It=(t,e)=>e<t.length&&!t[e].skip&&t[e],Rt=t=>"x"===t?"y":"x";function Wt(t,e,o,n){const r=t.skip?e:t,i=e,s=o.skip?e:o,a=j(i,r),c=j(s,i);let l=a/(a+c),u=c/(a+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const h=n*l,p=n*u;return{previous:{x:i.x-h*(s.x-r.x),y:i.y-h*(s.y-r.y)},next:{x:i.x+p*(s.x-r.x),y:i.y+p*(s.y-r.y)}}}function Bt(t,e="x"){const o=Rt(e),n=t.length,r=Array(n).fill(0),i=Array(n);let s,a,c,l=It(t,0);for(s=0;s<n;++s)if(a=c,c=l,l=It(t,s+1),c){if(l){const t=l[e]-c[e];r[s]=0!==t?(l[o]-c[o])/t:0}i[s]=a?l?C(r[s-1])!==C(r[s])?0:(r[s-1]+r[s])/2:r[s-1]:r[s]}!function(t,e,o){const n=t.length;let r,i,s,a,c,l=It(t,0);for(let u=0;u<n-1;++u)c=l,l=It(t,u+1),c&&l&&(S(e[u],0,jt)?o[u]=o[u+1]=0:(r=o[u]/e[u],i=o[u+1]/e[u],a=Math.pow(r,2)+Math.pow(i,2),a<=9||(s=3/Math.sqrt(a),o[u]=r*s*e[u],o[u+1]=i*s*e[u])))}(t,r,i),function(t,e,o="x"){const n=Rt(o),r=t.length;let i,s,a,c=It(t,0);for(let l=0;l<r;++l){if(s=a,a=c,c=It(t,l+1),!a)continue;const r=a[o],u=a[n];s&&(i=(r-s[o])/3,a[`cp1${o}`]=r-i,a[`cp1${n}`]=u-i*e[l]),c&&(i=(c[o]-r)/3,a[`cp2${o}`]=r+i,a[`cp2${n}`]=u+i*e[l])}}(t,i,e)}function At(t,e,o){return Math.max(Math.min(t,o),e)}function Dt(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Nt(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Lt(t,e,o){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[o])):n=t,n}const zt=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Et(t,e){return zt(t).getPropertyValue(e)}const Ht=["top","right","bottom","left"];function Ft(t,e,o){const n={};o=o?"-"+o:"";for(let r=0;r<4;r++){const i=Ht[r];n[i]=parseFloat(t[e+"-"+i+o])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const qt=(t,e,o)=>(t>0||e>0)&&(!o||!o.shadowRoot);const Qt=t=>Math.round(10*t)/10;const $t=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Dt()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Kt(t,e,o,n){return{x:t.x+o*(e.x-t.x),y:t.y+o*(e.y-t.y)}}function Jt(t){return"angle"===t?{between:W,compare:I,normalize:R}:{between:A,compare:(t,e)=>t-e,normalize:t=>t}}function Vt({start:t,end:e,count:o,loop:n,style:r}){return{start:t%o,end:e%o,loop:n&&(e-t+1)%o==0,style:r}}function Gt(t,e,o){if(!o)return[t];const{property:n,start:r,end:i}=o,s=e.length,{compare:a,between:c,normalize:l}=Jt(n),{start:u,end:h,loop:p,style:f}=function(t,e,o){const{property:n,start:r,end:i}=o,{between:s,normalize:a}=Jt(n),c=e.length;let l,u,{start:h,end:p,loop:f}=t;if(f){for(h+=c,p+=c,l=0,u=c;l<u&&s(a(e[h%c][n]),r,i);++l)h--,p--;h%=c,p%=c}return p<h&&(p+=c),{start:h,end:p,loop:f,style:t.style}}(t,e,o),d=[];let x,g,y,b=!1,m=null;const v=()=>b||c(r,y,x)&&0!==a(r,y),M=()=>!b||0===a(i,x)||c(i,y,x);for(let t=u,o=u;t<=h;++t)g=e[t%s],g.skip||(x=l(g[n]),x!==y&&(b=c(x,r,i),null===m&&v()&&(m=0===a(x,r)?t:o),null!==m&&M()&&(d.push(Vt({start:m,end:t,loop:p,count:s,style:f})),m=null),o=t,y=x));return null!==m&&d.push(Vt({start:m,end:h,loop:p,count:s,style:f})),d}function Yt(t,e,o,n){return n&&n.setContext&&o?function(t,e,o,n){const r=t._chart.getContext(),i=Ut(t.options),{_datasetIndex:s,options:{spanGaps:a}}=t,c=o.length,l=[];let u=i,h=e[0].start,p=h;function f(t,e,n,r){const i=a?-1:1;if(t!==e){for(t+=c;o[t%c].skip;)t-=i;for(;o[e%c].skip;)e+=i;t%c!=e%c&&(l.push({start:t%c,end:e%c,loop:n,style:r}),u=r,h=e%c)}}for(const t of e){h=a?h:t.start;let e,i=o[h%c];for(p=h+1;p<=t.end;p++){const a=o[p%c];e=Ut(n.setContext(gt(r,{type:"segment",p0:i,p1:a,p0DataIndex:(p-1)%c,p1DataIndex:p%c,datasetIndex:s}))),Xt(e,u)&&f(h,p-1,t.loop,u),i=a,u=e}h<p-1&&f(h,p-1,t.loop,u)}return l}(t,e,o,n):e}function Ut(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Xt(t,e){if(!e)return!1;const o=[],n=function(t,e){return Q(e)?(o.includes(e)||o.push(e),o.indexOf(e)):e};return JSON.stringify(t,n)!==JSON.stringify(e,n)}exports.$=function(t){t.restore()},exports.A=(t,e,o)=>D(t,o,(n=>t[n][e]>=o)),exports.B=N,exports.C=at,exports.D=function(t,e){const o=e.x-t.x,n=e.y-t.y,r=Math.sqrt(o*o+n*n);let i=Math.atan2(n,o);return i<-.5*m&&(i+=v),{angle:i,distance:r}},exports.E=function(t){const e=xt(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e},exports.F=function(t,e,o,i){let s,a,c;if(n(t))if(a=t.length,i)for(s=a-1;s>=0;s--)e.call(o,t[s],s);else for(s=0;s<a;s++)e.call(o,t[s],s);else if(r(t))for(c=Object.keys(t),a=c.length,s=0;s<a;s++)e.call(o,t[c[s]],c[s])},exports.G=function(t,e,o,n){const r=zt(t),i=Ft(r,"margin"),s=Lt(r.maxWidth,t,"clientWidth")||w,a=Lt(r.maxHeight,t,"clientHeight")||w,c=function(t,e,o){let n,r;if(void 0===e||void 0===o){const i=t&&Nt(t);if(i){const t=i.getBoundingClientRect(),s=zt(i),a=Ft(s,"border","width"),c=Ft(s,"padding");e=t.width-c.width-a.width,o=t.height-c.height-a.height,n=Lt(s.maxWidth,i,"clientWidth"),r=Lt(s.maxHeight,i,"clientHeight")}else e=t.clientWidth,o=t.clientHeight}return{width:e,height:o,maxWidth:n||w,maxHeight:r||w}}(t,e,o);let{width:l,height:u}=c;if("content-box"===r.boxSizing){const t=Ft(r,"border","width"),e=Ft(r,"padding");l-=e.width+t.width,u-=e.height+t.height}return l=Math.max(0,l-i.width),u=Math.max(0,n?l/n:u-i.height),l=Qt(Math.min(l,s,c.maxWidth)),u=Qt(Math.min(u,a,c.maxHeight)),l&&!u&&(u=Qt(l/2)),(void 0!==e||void 0!==o)&&n&&c.height&&u>c.height&&(u=c.height,l=Qt(Math.floor(u*n))),{width:l,height:u}},exports.H=_,exports.I=Nt,exports.J=function(t,e){const o=Et(t,e),n=o&&o.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0},exports.K=$t,exports.L=function(t,e){let o=[],n=!1;return function(...r){o=r,n||(n=!0,z.call(window,(()=>{n=!1,t.apply(e,o)})))}},exports.M=Dt,exports.N=function(t){const e=[],o=Math.sqrt(t);let n;for(n=1;n<o;n++)t%n==0&&(e.push(n),e.push(t/n));return o===(0|o)&&e.push(o),e.sort(((t,e)=>t-e)).pop(),e},exports.O=function(t,e){return i(t)?t:e},exports.P=m,exports.Q=function(t,e,o){if(t&&"function"==typeof t.call)return t.apply(o,e)},exports.R=function(t,e,o){const{min:n,max:r}=t,i=a(e,(r-n)/2),s=(t,e)=>o&&0===t?0:t+e;return{min:s(n,-Math.abs(i)),max:s(r,i)}},exports.S=B,exports.T=v,exports.U=function(t){return t*(180/m)},exports.V=it,exports.W=function(t){return B(t,-32768,32767)},exports.X=function(t,e,o){const n=t.currentDevicePixelRatio,r=0!==o?Math.max(o/2,.5):0;return Math.round((e-r)*n)/n+r},exports.Y=function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},exports.Z=function(t,e,r,i,s,a={}){const c=n(e)?e:[e],l=a.strokeWidth>0&&""!==a.strokeColor;let u,h;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),o(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,a),u=0;u<c.length;++u)h=c[u],a.backdrop&&lt(t,a.backdrop),l&&(a.strokeColor&&(t.strokeStyle=a.strokeColor),o(a.strokeWidth)||(t.lineWidth=a.strokeWidth),t.strokeText(h,r,i,a.maxWidth)),t.fillText(h,r,i,a.maxWidth),ct(t,r,i,h,a),i+=Number(s.lineHeight);t.restore()},exports._=function(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)},exports.a=function(t,e,o,r){let i,s,a,c=!0;for(i=0,s=t.length;i<s;++i)if(a=t[i],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),c=!1),void 0!==o&&n(a)&&(a=a[o%a.length],c=!1),void 0!==a))return r&&!c&&(r.cacheable=!1),a},exports.a0=function(t,e){t=t||{},e=e||nt.font;let o=s(t.size,e.size);"string"==typeof o&&(o=parseInt(o,10));let n=s(t.style,e.style);n&&!(""+n).match(ht)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:s(t.family,e.family),lineHeight:pt(s(t.lineHeight,e.lineHeight),o),size:o,style:n,weight:s(t.weight,e.weight),string:""};return r.string=rt(r),r},exports.a1=t=>"start"===t?"left":"end"===t?"right":"center",exports.a2=(t,e,o)=>"start"===t?e:"end"===t?o:(e+o)/2,exports.a3=X,exports.a4=h,exports.a5=y,exports.a6=Z,exports.a7=b,exports.a8=bt,exports.a9=yt,exports.aA=function(t,e){let o,n;"ltr"!==e&&"rtl"!==e||(o=t.canvas.style,n=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",e,"important"),t.prevTextDirection=n)},exports.aB=(t,e,o,n)=>t===(n?"left":"right")?o:"center"===t?(e+o)/2:e,exports.aC=function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))},exports.aD=st,exports.aE=j,exports.aF=function(){},exports.aG=function(t,e,o){let n,r,i;for(n=0,r=t.length;n<r;n++)i=t[n][o],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))},exports.aH=function(t){const e=Math.round(t);t=S(t,e,t/1e3)?e:t;const o=Math.pow(10,Math.floor(T(t))),n=t/o;return(n<=1?1:n<=2?2:n<=5?5:10)*o},exports.aI=function(t,e){const o=Math.round(t);return o-e<=t&&o+e>=t},exports.aJ=S,exports.aK=function(t){if(!i(t))return;let e=1,o=0;for(;Math.round(t*e)/e!==t;)e*=10,o++;return o},exports.aL=U,exports.aM=T,exports.aN=function(t,e,o,r){let i=(r=r||{}).data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(i=r.data={},s=r.garbageCollect=[],r.font=e),t.save(),t.font=e;let a=0;const c=o.length;let l,u,h,p,f;for(l=0;l<c;l++)if(p=o[l],null==p||n(p)){if(n(p))for(u=0,h=p.length;u<h;u++)f=p[u],null==f||n(f)||(a=it(t,i,s,a,f))}else a=it(t,i,s,a,p);t.restore();const d=s.length/2;if(d>o.length){for(l=0;l<d;l++)delete i[s[l]];s.splice(0,d)}return a},exports.aO=function(t,e,o){let n=0,r=t.length;for(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>o;)r--;return n>0||r<t.length?t.slice(n,r):t},exports.aP=D,exports.aQ=Q,exports.aR=$,exports.aS=c,exports.aT=u,exports.aU=f,exports.aW=x,exports.aX=rt,exports.aY=Wt,exports.aZ=Bt,exports.a_=Et,exports.aa=mt,exports.ab=p,exports.ac=e,exports.ad=function(t,e){let o;return function(...n){return e?(clearTimeout(o),o=setTimeout(t,e,n)):t.apply(this,n),e}},exports.ae=function(t,e,o){const n=e||1,r=Math.floor(t.height*n),i=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const s=t.canvas;return s.style&&(o||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||s.height!==r||s.width!==i)&&(t.currentDevicePixelRatio=n,s.height=r,s.width=i,t.ctx.setTransform(n,0,0,n,0,0),!0)},exports.af=function(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())},exports.ag=(t,e)=>{if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0},exports.ah=function(t,e){let o,n,r,i;if(!t||!e||t.length!==e.length)return!1;for(o=0,n=t.length;o<n;++o)if(r=t[o],i=e[o],r.datasetIndex!==i.datasetIndex||r.index!==i.index)return!1;return!0},exports.ai=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type},exports.aj=A,exports.ak=dt,exports.al=function(t,e,o,n,r){let i,s,a,c;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)Bt(t,r);else{let o=n?t[t.length-1]:t[0];for(i=0,s=t.length;i<s;++i)a=t[i],c=Wt(o,a,t[Math.min(i+1,s-(n?0:1))%s],e.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,o=a}e.capBezierPoints&&function(t,e){let o,n,r,i,s,a=at(t[0],e);for(o=0,n=t.length;o<n;++o)s=i,i=a,a=o<n-1&&at(t[o+1],e),i&&(r=t[o],s&&(r.cp1x=At(r.cp1x,e.left,e.right),r.cp1y=At(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=At(r.cp2x,e.left,e.right),r.cp2y=At(r.cp2y,e.top,e.bottom)))}(t,o)},exports.am=function(t,e){const o=t.points,n=t.options.spanGaps,r=o.length;if(!r)return[];const i=!!t._loop,{start:s,end:a}=function(t,e,o,n){let r=0,i=e-1;if(o&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,o&&(i+=r);i>r&&t[i%e].skip;)i--;return i%=e,{start:r,end:i}}(o,r,i,n);return Yt(t,!0===n?[{start:s,end:a,loop:i}]:function(t,e,o,n){const r=t.length,i=[];let s,a=e,c=t[e];for(s=e+1;s<=o;++s){const o=t[s%r];o.skip||o.stop?c.skip||(n=!1,i.push({start:e%r,end:(s-1)%r,loop:n}),e=a=o.stop?s:null):(a=s,c.skip&&(e=s)),c=o}return null!==a&&i.push({start:e%r,end:a%r,loop:n}),i}(o,s,a<s?a+r:a,!!t._fullLoop&&0===s&&a===r-1),o,e)},exports.an=function(t,e){const o=[],n=t.segments;for(let r=0;r<n.length;r++){const i=Gt(n[r],t.points,e);i.length&&o.push(...i)}return o},exports.ao=function(t,e,o,n){return{x:t.x+o*(e.x-t.x),y:"middle"===n?o<.5?t.y:e.y:"after"===n?o<1?t.y:e.y:o>0?e.y:t.y}},exports.ap=function(t,e,o,n){const r={x:t.cp2x,y:t.cp2y},i={x:e.cp1x,y:e.cp1y},s=Kt(t,r,o),a=Kt(r,i,o),c=Kt(i,e,o),l=Kt(s,a,o),u=Kt(a,c,o);return Kt(l,u,o)},exports.aq=Kt,exports.ar=function(t,e,o,n,r){if(!e)return t.lineTo(o.x,o.y);if("middle"===r){const n=(e.x+o.x)/2;t.lineTo(n,e.y),t.lineTo(n,o.y)}else"after"===r!=!!n?t.lineTo(e.x,o.y):t.lineTo(o.x,e.y);t.lineTo(o.x,o.y)},exports.as=function(t,e,o,n){if(!e)return t.lineTo(o.x,o.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?o.cp2x:o.cp1x,n?o.cp2y:o.cp1y,o.x,o.y)},exports.at=function(t,e,o,n){st(t,e,o,n,null)},exports.au=function(t,e){const{x:o,y:n,w:r,h:i,radius:s}=e;t.arc(o+s.topLeft,n+s.topLeft,s.topLeft,1.5*m,m,!0),t.lineTo(o,n+i-s.bottomLeft),t.arc(o+s.bottomLeft,n+i-s.bottomLeft,s.bottomLeft,m,_,!0),t.lineTo(o+r-s.bottomRight,n+i),t.arc(o+r-s.bottomRight,n+i-s.bottomRight,s.bottomRight,_,0,!0),t.lineTo(o+r,n+s.topRight),t.arc(o+r-s.topRight,n+s.topRight,s.topRight,0,-_,!0),t.lineTo(o+s.topLeft,n)},exports.av=xt,exports.aw=function(t){return dt(t,["topLeft","topRight","bottomLeft","bottomRight"])},exports.ax=Gt,exports.ay=R,exports.az=function(t,e,o){return t?function(t,e){return{x:o=>t+t+e-o,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,o):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}},exports.b=n,exports.b0=pt,exports.b1=M,exports.b2=w,exports.b3=k,exports.b4=O,exports.b5=P,exports.b6=I,exports.c=function(e){return Q(e)?e:new t.Color(e)},exports.d=nt,exports.e=q,exports.f=g,exports.g=i,exports.h=t=>void 0!==t,exports.i=r,exports.j=gt,exports.k=o,exports.l=function(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),L.forEach((e=>{const o="_onData"+y(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const r=n.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[o]&&t[o](...e)})),r}})})))},exports.m=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,exports.n=a,exports.o=G,exports.p=W,exports.q=function(t,e,o){const n=e.length;let r=0,i=n;if(t._sorted){const{iScale:s,_parsed:a}=t,c=s.axis,{min:l,max:u,minDefined:h,maxDefined:p}=s.getUserBounds();h&&(r=B(Math.min(N(a,c,l).lo,o?n:N(e,c,s.getPixelForValue(l)).lo),0,n-1)),i=p?B(Math.max(N(a,s.axis,u,!0).hi+1,o?0:N(e,c,s.getPixelForValue(u),!0).hi+1),r,n)-r:n-r}return{start:r,count:i}},exports.r=z,exports.s=C,exports.t=function(t){return t*(m/180)},exports.u=function(t,e){const o=t._chartjs;if(!o)return;const n=o.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),n.length>0||(L.forEach((e=>{delete t[e]})),delete t._chartjs)},exports.v=s,exports.w=function(t){const{xScale:e,yScale:o,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:o.min,ymax:o.max};if(!n)return t._scaleRanges=r,!0;const i=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==o.min||n.ymax!==o.max;return Object.assign(n,r),i},exports.x=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},exports.y=function(t,e,o,n){const{iScale:r}=t,{key:i="r"}=this._parsing,s=new Array(n);let a,c,l,u;for(a=0,c=n;a<c;++a)l=a+o,u=e[l],s[a]={r:r.parse(g(u,i),l)};return s},exports.z=function(t,e){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:n}=e,r=zt(o),i="border-box"===r.boxSizing,s=Ft(r,"padding"),a=Ft(r,"border","width"),{x:c,y:l,box:u}=function(t,e){const o=t.touches,n=o&&o.length?o[0]:t,{offsetX:r,offsetY:i}=n;let s,a,c=!1;if(qt(r,i,t.target))s=r,a=i;else{const t=e.getBoundingClientRect();s=n.clientX-t.left,a=n.clientY-t.top,c=!0}return{x:s,y:a,box:c}}(t,o),h=s.left+(u&&a.left),p=s.top+(u&&a.top);let{width:f,height:d}=e;return i&&(f-=s.width+a.width,d-=s.height+a.height),{x:Math.round((c-h)/f*o.width/n),y:Math.round((l-p)/d*o.height/n)}};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare const Funnel: React.FC<{
3
+ labels: string[];
4
+ funnelData: number[];
5
+ funnelBackgroundColor?: string[];
6
+ }>;
7
+ export default Funnel;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as o,CategoryScale as r,LinearScale as n,PointElement as i,BarElement as a,LineElement as s,ArcElement as d,Filler as c,Title as u,Tooltip as p,Legend as g}from"chart.js";import{useState as b,useRef as y,useEffect as m}from"react";import{Line as v}from"react-chartjs-2";import{BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as f}from"../../../../constants/Theme.js";import{truncateValueToK as x}from"../utils/calcPercentage.js";import{LegendWrapper as k,LegendContainer as C,LegendColor as j}from"./LineChart.styled.js";o.register(r,n,i,a,s,d,c,u,p,g);const w=o=>{let{scaleText:r,labels:n,canvasHeight:i,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:u,isZeroState:p,tension:g,isNewStyles:w,prefixCurrencyInYAxis:B,pointRadius:O,useKFormat:S,lineThickness:z,ticksLabelCallback:T,labelCallback:$,afterBodyCallBack:F,titleTooltipCallback:R}=o;var q,A,D;const[L,I]=b(null),P=y();m((()=>{var e,t,l,o;if(null===(o=null===(l=null===(t=null===(e=P.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===o?void 0:o.length){const e=38*P.current.scales.y.ticks.length;I(e)}}),[P]);const E=a.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?f.content.placeholder:f.background.brand,square:e.squareLegends}))),W={labels:n,datasets:a.map(((e,t)=>{var l,o,r;return Object.assign(Object.assign({tension:null!=g?g:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?f.content.placeholder:f.background.brand)};return w?Object.assign({pointStyle:"circle",pointRadius:O||(n&&n.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?f.content.placeholder:f.background.brand)},l):Object.assign({pointRadius:null!=O?O:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(o=null!==(l=e.lineWidth)&&void 0!==l?l:z)&&void 0!==o?o:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,L?L-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(r=e.backgroundColor)&&void 0!==r?r:"transparent",legend:e.legend})}))},Z={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=w&&w,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>f.content.primaryInverse,backgroundColor:f.content.primary,callbacks:{labelTextColor:()=>f.content.primaryInverse,title:R,label:$,afterBody:F},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:p?0:c,max:p?10:u,ticks:{color:f.content.secondary,callback:e=>{var t,l;return S?`${null!==(t=null==r?void 0:r.yPrefix)&&void 0!==t?t:""}${x(e)}${null!=B?B:""}`:`${null!==(l=null==r?void 0:r.yPrefix)&&void 0!==l?l:""}${e}${null!=B?B:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:p?1:d,padding:w?24:0},title:{display:!!(null==r?void 0:r.y),text:null==r?void 0:r.y},grid:{color:f.background.base,drawBorder:null===(q=null==r?void 0:r.yDrawBorder)||void 0===q||q}},x:{ticks:{callback:T,color:f.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==r?void 0:r.x),text:null==r?void 0:r.x},grid:{display:!1,drawBorder:null!==(A=null==r?void 0:r.xDrawBorder)&&void 0!==A&&A}}}};return e("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(D=null!=i?i:L)&&void 0!==D?D:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[t(k,{children:E.map(((o,r)=>{let{text:n,color:i,square:a}=o;return n?e(C,{children:[t(j,{color:i,square:a,newStyle:w}),t(h,Object.assign({color:"#667085"},{children:n}))]},r):t(l,{})}))}),t("div",Object.assign({style:{flex:1}},{children:t(v,{ref:P,options:Z,data:W})}))]}))};export{w as LineChart};
1
+ import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{CategoryScale as o,LinearScale as r,PointElement as i,BarElement as n,LineElement as a,ArcElement as s,Filler as d,Title as c,Tooltip as u,Legend as p}from"chart.js";import"../../../../node_modules/chart.js/auto/auto.js";import{useState as g,useRef as m,useEffect as y}from"react";import{Line as b}from"react-chartjs-2";import{BodyTiny as v}from"../../../TypographyStyle.js";import{COLORS as h}from"../../../../constants/Theme.js";import{truncateValueToK as f}from"../utils/calcPercentage.js";import{LegendWrapper as x,LegendContainer as k,LegendColor as j}from"./LineChart.styled.js";import{Chart as C}from"../../../../node_modules/chart.js/dist/chart.js";C.register(o,r,i,n,a,s,d,c,u,p);const w=o=>{let{scaleText:r,labels:i,canvasHeight:n,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:u,isZeroState:p,tension:C,isNewStyles:w,prefixCurrencyInYAxis:B,pointRadius:O,useKFormat:S,lineThickness:z,ticksLabelCallback:T,labelCallback:$,afterBodyCallBack:F,titleTooltipCallback:R}=o;var q,A,D;const[L,I]=g(null),P=m();y((()=>{var e,t,l,o;if(null===(o=null===(l=null===(t=null===(e=P.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===o?void 0:o.length){const e=38*P.current.scales.y.ticks.length;I(e)}}),[P]);const E=a.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?h.content.placeholder:h.background.brand,square:e.squareLegends}))),W={labels:i,datasets:a.map(((e,t)=>{var l,o,r;return Object.assign(Object.assign({tension:null!=C?C:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?h.content.placeholder:h.background.brand)};return w?Object.assign({pointStyle:"circle",pointRadius:O||(i&&i.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?h.content.placeholder:h.background.brand)},l):Object.assign({pointRadius:null!=O?O:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(o=null!==(l=e.lineWidth)&&void 0!==l?l:z)&&void 0!==o?o:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,L?L-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(r=e.backgroundColor)&&void 0!==r?r:"transparent",legend:e.legend})}))},Z={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=w&&w,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>h.content.primaryInverse,backgroundColor:h.content.primary,callbacks:{labelTextColor:()=>h.content.primaryInverse,title:R,label:$,afterBody:F},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{type:"linear",beginAtZero:!0,min:p?0:c,max:p?10:u,ticks:{color:h.content.secondary,callback:e=>{var t,l;return S?`${null!==(t=null==r?void 0:r.yPrefix)&&void 0!==t?t:""}${f(e)}${null!=B?B:""}`:`${null!==(l=null==r?void 0:r.yPrefix)&&void 0!==l?l:""}${e}${null!=B?B:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:p?1:d,padding:w?24:0},title:{display:!!(null==r?void 0:r.y),text:null==r?void 0:r.y},grid:{color:h.background.base,drawBorder:null===(q=null==r?void 0:r.yDrawBorder)||void 0===q||q}},x:{type:"category",ticks:{callback:T,color:h.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==r?void 0:r.x),text:null==r?void 0:r.x},grid:{display:!1,drawBorder:null!==(A=null==r?void 0:r.xDrawBorder)&&void 0!==A&&A}}}};return e("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(D=null!=n?n:L)&&void 0!==D?D:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[t(x,{children:E.map(((o,r)=>{let{text:i,color:n,square:a}=o;return i?e(k,{children:[t(j,{color:n,square:a,newStyle:w}),t(v,Object.assign({color:"#667085"},{children:i}))]},r):t(l,{})}))}),t("div",Object.assign({style:{flex:1}},{children:t(b,{ref:P,options:Z,data:W})}))]}))};export{w as LineChart};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;