0}_computeGridLineItems(e){const t=this.axis,i=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,d=this.isHorizontal(),p=this.ticks.length+(l?1:0),m=getTickMarkLength(o),v=[],y=a.setContext(this.getContext()),b=y.display?y.width:0,S=b/2,E=function($){return _alignPixel(i,$,b)};let T,R,A,D,x,M,I,V,z,B,K,J;if(r==="top")T=E(this.bottom),M=this.bottom-m,V=T-S,B=E(e.top)+S,J=e.bottom;else if(r==="bottom")T=E(this.top),B=e.top,J=E(e.bottom)-S,M=T+S,V=this.top+m;else if(r==="left")T=E(this.right),x=this.right-m,I=T-S,z=E(e.left)+S,K=e.right;else if(r==="right")T=E(this.left),z=e.left,K=E(e.right)-S,x=T+S,I=this.left+m;else if(t==="x"){if(r==="center")T=E((e.top+e.bottom)/2+.5);else if(isObject(r)){const $=Object.keys(r)[0],Y=r[$];T=E(this.chart.scales[$].getPixelForValue(Y))}B=e.top,J=e.bottom,M=T+S,V=M+m}else if(t==="y"){if(r==="center")T=E((e.left+e.right)/2);else if(isObject(r)){const $=Object.keys(r)[0],Y=r[$];T=E(this.chart.scales[$].getPixelForValue(Y))}x=T-S,I=x-m,z=e.left,K=e.right}const Z=valueOrDefault(n.ticks.maxTicksLimit,p),F=Math.max(1,Math.ceil(p/Z));for(R=0;R0&&(te-=oe/2);break}se={left:te,top:ie,width:oe+pe.width,height:ae+pe.height,color:F.backdropColor}}S.push({label:A,font:V,textOffset:K,options:{rotation:b,color:Y,strokeColor:W,strokeWidth:X,textAlign:U,textBaseline:J,translation:[D,x],backdrop:se}})}return S}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-toRadians(this.labelRotation))return e==="top"?"left":"right";let n="center";return t.align==="start"?n="left":t.align==="end"?n="right":t.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=e+o,l=r.widest.width;let d,h;return t==="left"?n?(h=this.right+o,i==="near"?d="left":i==="center"?(d="center",h+=l/2):(d="right",h+=l)):(h=this.right-a,i==="near"?d="right":i==="center"?(d="center",h-=l/2):(d="left",h=this.left)):t==="right"?n?(h=this.left+o,i==="near"?d="right":i==="center"?(d="center",h-=l/2):(d="left",h-=l)):(h=this.left+a,i==="near"?d="left":i==="center"?(d="center",h+=l/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:n,width:o,height:r}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,n,o,r),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex(o=>o.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,r;const a=(l,d,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(t.display)for(o=0,r=n.length;o{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=t.length;o{const i=t.split("."),n=i.pop(),o=[s].concat(i).join("."),r=e[t].split("."),a=r.pop(),l=r.join(".");defaults.route(o,n,l,a)})}function isIChartComponent(s){return"id"in s&&"defaults"in s}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$1,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(e,o,n):each(n,r=>{const a=i||this._getRegistryForType(r);this._exec(e,a,r)})})}_exec(e,t,i){const n=_capitalize(e);callback(i["before"+n],[],i),t[e](i),callback(i["after"+n],[],i)}_getRegistryForType(e){for(let t=0;to.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(t,i),e,"stop"),this._notify(n(i,t),e,"start")}}function allPlugins(s){const e={},t=[],i=Object.keys(registry.plugins.items);for(let o=0;o1&&idMatchesAxis(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(s,e,t){if(t[e+"AxisID"]===s)return{axis:e}}function retrieveAxisFromDatasets(s,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(t.length)return getAxisFromDataset(s,"x",t[0])||getAxisFromDataset(s,"y",t[0])}return{}}function mergeScaleConfig(s,e){const t=overrides[s.type]||{scales:{}},i=e.scales||{},n=getIndexAxis(s.type,e),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!isObject(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=determineAxis(r,a,retrieveAxisFromDatasets(r,s),defaults.scales[a.type]),d=getDefaultScaleIDFromAxis(l,n),h=t.scales||{};o[r]=mergeIf(Object.create(null),[{axis:l},a,h[l],h[d]])}),s.data.datasets.forEach(r=>{const a=r.type||s.type,l=r.indexAxis||getIndexAxis(a,e),h=(overrides[a]||{}).scales||{};Object.keys(h).forEach(p=>{const m=getAxisFromDefaultScaleID(p,l),v=r[m+"AxisID"]||m;o[v]=o[v]||Object.create(null),mergeIf(o[v],[{axis:m},i[v],h[p]])})}),Object.keys(o).forEach(r=>{const a=o[r];mergeIf(a,[defaults.scales[a.type],defaults.scale])}),o}function initOptions(s){const e=s.options||(s.options={});e.plugins=valueOrDefault(e.plugins,{}),e.scales=mergeScaleConfig(s,e)}function initData(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function initConfig(s){return s=s||{},s.data=initData(s.data),initOptions(s),s}const keyCache=new Map,keysCached=new Set;function cachedKeys(s,e){let t=keyCache.get(s);return t||(t=e(),keyCache.set(s,t),keysCached.add(t)),t}const addIfFound=(s,e,t)=>{const i=resolveObjectKey(e,t);i!==void 0&&s.add(i)};class Config{constructor(e){this._config=initConfig(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=initData(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),initOptions(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return cachedKeys(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return cachedKeys(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return cachedKeys(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return cachedKeys(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let n=i.get(e);return(!n||t)&&(n=new Map,i.set(e,n)),n}getOptionScopes(e,t,i){const{options:n,type:o}=this,r=this._cachedScopes(e,i),a=r.get(t);if(a)return a;const l=new Set;t.forEach(h=>{e&&(l.add(e),h.forEach(p=>addIfFound(l,e,p))),h.forEach(p=>addIfFound(l,n,p)),h.forEach(p=>addIfFound(l,overrides[o]||{},p)),h.forEach(p=>addIfFound(l,defaults,p)),h.forEach(p=>addIfFound(l,descriptors,p))});const d=Array.from(l);return d.length===0&&d.push(Object.create(null)),keysCached.has(t)&&r.set(t,d),d}chartOptionScopes(){const{options:e,type:t}=this;return[e,overrides[t]||{},defaults.datasets[t]||{},{type:t},defaults,descriptors]}resolveNamedOptions(e,t,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=getResolver(this._resolverCache,e,n);let l=r;if(needContext(r,t)){o.$shared=!1,i=isFunction$1(i)?i():i;const d=this.createResolver(e,i,a);l=_attachContext(r,i,d)}for(const d of t)o[d]=l[d];return o}createResolver(e,t,i=[""],n){const{resolver:o}=getResolver(this._resolverCache,e,i);return isObject(t)?_attachContext(o,t,void 0,n):o}}function getResolver(s,e,t){let i=s.get(e);i||(i=new Map,s.set(e,i));const n=t.join();let o=i.get(n);return o||(o={resolver:_createResolver(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,o)),o}const hasFunction=s=>isObject(s)&&Object.getOwnPropertyNames(s).some(e=>isFunction$1(s[e]));function needContext(s,e){const{isScriptable:t,isIndexable:i}=_descriptors(s);for(const n of e){const o=t(n),r=i(n),a=(r||o)&&s[n];if(o&&(isFunction$1(a)||hasFunction(a))||r&&isArray(a))return!0}return!1}var version="4.4.2";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(s,e){return s==="top"||s==="bottom"||KNOWN_POSITIONS.indexOf(s)===-1&&e==="x"}function compare2Level(s,e){return function(t,i){return t[s]===i[s]?t[e]-i[e]:t[s]-i[s]}}function onAnimationsComplete(s){const e=s.chart,t=e.options.animation;e.notifyPlugins("afterRender"),callback(t&&t.onComplete,[s],e)}function onAnimationProgress(s){const e=s.chart,t=e.options.animation;callback(t&&t.onProgress,[s],e)}function getCanvas(s){return _isDomSupported()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const instances={},getChart=s=>{const e=getCanvas(s);return Object.values(instances).filter(t=>t.canvas===e).pop()};function moveNumericKeys(s,e,t){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=e){const r=s[n];delete s[n],(t>0||o>e)&&(s[o+t]=r)}}}function determineLastEvent(s,e,t,i){return!t||s.type==="mouseout"?null:i?e:s}function getSizeForArea(s,e,t){return s.options.clip?s[t]:e[t]}function getDatasetArea(s,e){const{xScale:t,yScale:i}=s;return t&&i?{left:getSizeForArea(t,e,"left"),right:getSizeForArea(t,e,"right"),top:getSizeForArea(i,e,"top"),bottom:getSizeForArea(i,e,"bottom")}:e}class Chart{static register(...e){registry.add(...e),invalidatePlugins()}static unregister(...e){registry.remove(...e),invalidatePlugins()}constructor(e,t){const i=this.config=new Config(t),n=getCanvas(e),o=getChart(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||_detectPlatform(n)),this.platform.updateConfig(i);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,d=l&&l.height,h=l&&l.width;if(this.id=uid(),this.ctx=a,this.canvas=l,this.width=h,this.height=d,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce$3(p=>this.update(p),r.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:n,_aspectRatio:o}=this;return isNullOrUndef(e)?t&&o?o:n?i/n:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(e,t){animator.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,e,t,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,retinaScale(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),callback(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};each(t,(i,n)=>{i.id=n})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,n=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];t&&(o=o.concat(Object.keys(t).map(r=>{const a=t[r],l=determineAxis(r,a),d=l==="r",h=l==="x";return{options:a,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),each(o,r=>{const a=r.options,l=a.id,d=determineAxis(l,a),h=valueOrDefault(a.type,r.dtype);(a.position===void 0||positionIsHorizontal(a.position,d)!==positionIsHorizontal(r.dposition))&&(a.position=r.dposition),n[l]=!0;let p=null;if(l in i&&i[l].type===h)p=i[l];else{const m=registry.getScale(h);p=new m({id:l,type:h,ctx:this.ctx,chart:this}),i[p.id]=p}p.init(a,e)}),each(n,(r,a)=>{r||delete i[a]}),each(i,r=>{layouts.configure(this,r,r.options),layouts.addBox(this,r)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((n,o)=>n.index-o.index),i>t){for(let n=t;nt.length&&delete this._stacks,e.forEach((i,n)=>{t.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let d=0,h=this.data.datasets.length;d{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(compare2Level("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){each(this.scales,e=>{layouts.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!setsEqual(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of t){const r=i==="_removeElements"?-o:o;moveNumericKeys(e,n,r)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=o=>new Set(e.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=i(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;layouts.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],each(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,n=!i.disabled,o=getDatasetArea(e,this.chartArea),r={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&clipArea(t,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),e.controller.draw(),n&&unclipArea(t),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return _isPointInArea(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,n){const o=Interaction.modes[t];return typeof o=="function"?o(this,e,i,n):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let n=i.filter(o=>o&&o._dataset===t).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const n=i?"show":"hide",o=this.getDatasetMeta(e),r=o.controller._resolveAnimations(void 0,n);defined$1(t)?(o.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===e?n:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),animator.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,o,r),e[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};each(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(l,d)=>{t.addEventListener(this,l,d),e[l]=d},n=(l,d)=>{e[l]&&(t.removeEventListener(this,l,d),delete e[l])},o=(l,d)=>{this.canvas&&this.resize(l,d)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",a)},t.isAttached(this.canvas)?a():r()}unbindEvents(){each(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},each(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const n=i?"set":"remove";let o,r,a,l;for(t==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=e.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!_elementsEqual(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const n=this.options.hover,o=(l,d)=>l.filter(h=>!d.some(p=>h.datasetIndex===p.datasetIndex&&h.index===p.index)),r=o(t,e),a=i?e:o(e,t);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},n=r=>(r.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const o=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:n=[],options:o}=this,r=t,a=this._getActiveElements(e,n,i,r),l=_isClickEvent(e),d=determineLastEvent(e,this._lastEvent,i,l);i&&(this._lastEvent=null,callback(o.onHover,[e,a,this],this),l&&callback(o.onClick,[e,a,this],this));const h=!_elementsEqual(a,n);return(h||t)&&(this._active=a,this._updateHoverStyles(a,n,t)),this._lastEvent=d,h}_getActiveElements(e,t,i,n){if(e.type==="mouseout")return[];if(!i)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,n)}}G(Chart,"defaults",defaults),G(Chart,"instances",instances),G(Chart,"overrides",overrides),G(Chart,"registry",registry),G(Chart,"version",version),G(Chart,"getChart",getChart);function invalidatePlugins(){return each(Chart.instances,s=>s._plugins.invalidate())}function clipArc(s,e,t){const{startAngle:i,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=e;let d=n/a;s.beginPath(),s.arc(o,r,a,i-d,t+d),l>n?(d=n/l,s.arc(o,r,l,t+d,i-d,!0)):s.arc(o,r,n,t+HALF_PI,i-HALF_PI),s.closePath(),s.clip()}function toRadiusCorners(s){return _readValueToProps(s,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(s,e,t,i){const n=toRadiusCorners(s.options.borderRadius),o=(t-e)/2,r=Math.min(o,i*e/2),a=l=>{const d=(t-Math.min(o,l))*i/2;return _limitValue(l,0,Math.min(o,d))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:_limitValue(n.innerStart,0,r),innerEnd:_limitValue(n.innerEnd,0,r)}}function rThetaToXY(s,e,t,i){return{x:t+s*Math.cos(e),y:i+s*Math.sin(e)}}function pathArc(s,e,t,i,n,o){const{x:r,y:a,startAngle:l,pixelMargin:d,innerRadius:h}=e,p=Math.max(e.outerRadius+i+t-d,0),m=h>0?h+i+t+d:0;let v=0;const y=n-l;if(i){const F=h>0?h-i:0,$=p>0?p-i:0,Y=(F+$)/2,W=Y!==0?y*Y/(Y+i):y;v=(y-W)/2}const b=Math.max(.001,y*p-t/PI)/p,S=(y-b)/2,E=l+S+v,T=n-S-v,{outerStart:R,outerEnd:A,innerStart:D,innerEnd:x}=parseBorderRadius$1(e,m,p,T-E),M=p-R,I=p-A,V=E+R/M,z=T-A/I,B=m+D,K=m+x,J=E+D/B,Z=T-x/K;if(s.beginPath(),o){const F=(V+z)/2;if(s.arc(r,a,p,V,F),s.arc(r,a,p,F,z),A>0){const X=rThetaToXY(I,z,r,a);s.arc(X.x,X.y,A,z,T+HALF_PI)}const $=rThetaToXY(K,T,r,a);if(s.lineTo($.x,$.y),x>0){const X=rThetaToXY(K,Z,r,a);s.arc(X.x,X.y,x,T+HALF_PI,Z+Math.PI)}const Y=(T-x/m+(E+D/m))/2;if(s.arc(r,a,m,T-x/m,Y,!0),s.arc(r,a,m,Y,E+D/m,!0),D>0){const X=rThetaToXY(B,J,r,a);s.arc(X.x,X.y,D,J+Math.PI,E-HALF_PI)}const W=rThetaToXY(M,E,r,a);if(s.lineTo(W.x,W.y),R>0){const X=rThetaToXY(M,V,r,a);s.arc(X.x,X.y,R,E-HALF_PI,V)}}else{s.moveTo(r,a);const F=Math.cos(V)*p+r,$=Math.sin(V)*p+a;s.lineTo(F,$);const Y=Math.cos(z)*p+r,W=Math.sin(z)*p+a;s.lineTo(Y,W)}s.closePath()}function drawArc(s,e,t,i,n){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){pathArc(s,e,t,i,l,n);for(let d=0;d=TAU||_angleBetween(r,l,d),S=_isBetween(a,h+v,p+v);return b&&S}getCenterPoint(t){const{x:i,y:n,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:d,spacing:h}=this.options,p=(o+r)/2,m=(a+l+h+d)/2;return{x:i+Math.cos(p)*m,y:n+Math.sin(p)*m}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:i,circumference:n}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=n>TAU?Math.floor(n/TAU):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*o,Math.sin(l)*o);const d=1-Math.sin(Math.min(PI,n||0)),h=o*d;t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,drawArc(t,this,h,r,a),drawBorder(t,this,h,r,a),t.restore()}}G(ArcElement,"id","arc"),G(ArcElement,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),G(ArcElement,"defaultRoutes",{backgroundColor:"backgroundColor"}),G(ArcElement,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"});function setStyle$1(s,e,t=e){s.lineCap=valueOrDefault(t.borderCapStyle,e.borderCapStyle),s.setLineDash(valueOrDefault(t.borderDash,e.borderDash)),s.lineDashOffset=valueOrDefault(t.borderDashOffset,e.borderDashOffset),s.lineJoin=valueOrDefault(t.borderJoinStyle,e.borderJoinStyle),s.lineWidth=valueOrDefault(t.borderWidth,e.borderWidth),s.strokeStyle=valueOrDefault(t.borderColor,e.borderColor)}function lineTo(s,e,t){s.lineTo(t.x,t.y)}function getLineMethod(s){return s.stepped?_steppedLineTo:s.tension||s.cubicInterpolationMode==="monotone"?_bezierCurveTo:lineTo}function pathVars(s,e,t={}){const i=s.length,{start:n=0,end:o=i-1}=t,{start:r,end:a}=e,l=Math.max(n,r),d=Math.min(o,a),h=na&&o>a;return{count:i,start:l,loop:e.loop,ilen:d(r+(d?a-A:A))%o,R=()=>{b!==S&&(s.lineTo(h,S),s.lineTo(h,b),s.lineTo(h,E))};for(l&&(v=n[T(0)],s.moveTo(v.x,v.y)),m=0;m<=a;++m){if(v=n[T(m)],v.skip)continue;const A=v.x,D=v.y,x=A|0;x===y?(DS&&(S=D),h=(p*h+A)/++p):(R(),s.lineTo(A,D),y=x,p=0,b=S=D),E=D}R()}function _getSegmentMethod(s){const e=s.options,t=e.borderDash&&e.borderDash.length;return!s._decimated&&!s._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?fastPathSegment:pathSegment}function _getInterpolationMethod(s){return s.stepped?_steppedInterpolation:s.tension||s.cubicInterpolationMode==="monotone"?_bezierInterpolation:_pointInLine}function strokePathWithCache(s,e,t,i){let n=e._path;n||(n=e._path=new Path2D,e.path(n,t,i)&&n.closePath()),setStyle$1(s,e.options),s.stroke(n)}function strokePathDirect(s,e,t,i){const{segments:n,options:o}=e,r=_getSegmentMethod(e);for(const a of n)setStyle$1(s,o,a.style),s.beginPath(),r(s,e,a,{start:t,end:t+i-1})&&s.closePath(),s.stroke()}const usePath2D=typeof Path2D=="function";function draw(s,e,t,i){usePath2D&&!e.options.segment?strokePathWithCache(s,e,t,i):strokePathDirect(s,e,t,i)}class LineElement extends Element$1{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,i,e,n,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,n=e[t],o=this.points,r=_boundSegments(this,{property:t,start:n,end:n});if(!r.length)return;const a=[],l=_getInterpolationMethod(i);let d,h;for(d=0,h=r.length;de!=="borderDash"&&e!=="fill"});function inRange$1(s,e,t,i){const n=s.options,{[t]:o}=s.getProps([t],i);return Math.abs(e-o)s.replace("rgb(","rgba(").replace(")",", 0.5)"));function getBorderColor(s){return BORDER_COLORS[s%BORDER_COLORS.length]}function getBackgroundColor(s){return BACKGROUND_COLORS[s%BACKGROUND_COLORS.length]}function colorizeDefaultDataset(s,e){return s.borderColor=getBorderColor(e),s.backgroundColor=getBackgroundColor(e),++e}function colorizeDoughnutDataset(s,e){return s.backgroundColor=s.data.map(()=>getBorderColor(e++)),e}function colorizePolarAreaDataset(s,e){return s.backgroundColor=s.data.map(()=>getBackgroundColor(e++)),e}function getColorizer(s){let e=0;return(t,i)=>{const n=s.getDatasetMeta(i).controller;n instanceof DoughnutController?e=colorizeDoughnutDataset(t,e):n instanceof PolarAreaController?e=colorizePolarAreaDataset(t,e):n&&(e=colorizeDefaultDataset(t,e))}}function containsColorsDefinitions(s){let e;for(e in s)if(s[e].borderColor||s[e].backgroundColor)return!0;return!1}function containsColorsDefinition(s){return s&&(s.borderColor||s.backgroundColor)}var plugin_colors={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(s,e,t){if(!t.enabled)return;const{data:{datasets:i},options:n}=s.config,{elements:o}=n;if(!t.forceOverride&&(containsColorsDefinitions(i)||containsColorsDefinition(n)||o&&containsColorsDefinitions(o)))return;const r=getColorizer(s);i.forEach(r)}};function _segments(s,e,t){const i=s.segments,n=s.points,o=e.points,r=[];for(const a of i){let{start:l,end:d}=a;d=_findSegmentEnd(l,d,n);const h=_getBounds(t,n[l],n[d],a.loop);if(!e.segments){r.push({source:a,target:h,start:n[l],end:n[d]});continue}const p=_boundSegments(e,h);for(const m of p){const v=_getBounds(t,o[m.start],o[m.end],m.loop),y=_boundSegment(a,n,v);for(const b of y)r.push({source:b,target:m,start:{[t]:_getEdge(h,v,"start",Math.max)},end:{[t]:_getEdge(h,v,"end",Math.min)}})}}return r}function _getBounds(s,e,t,i){if(i)return;let n=e[s],o=t[s];return s==="angle"&&(n=_normalizeAngle(n),o=_normalizeAngle(o)),{property:s,start:n,end:o}}function _pointsFromSegments(s,e){const{x:t=null,y:i=null}=s||{},n=e.points,o=[];return e.segments.forEach(({start:r,end:a})=>{a=_findSegmentEnd(r,a,n);const l=n[r],d=n[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:d.x,y:i})):t!==null&&(o.push({x:t,y:l.y}),o.push({x:t,y:d.y}))}),o}function _findSegmentEnd(s,e,t){for(;e>s;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function _getEdge(s,e,t,i){return s&&e?i(s[t],e[t]):s?s[t]:e?e[t]:0}function _createBoundaryLine(s,e){let t=[],i=!1;return isArray(s)?(i=!0,t=s):t=_pointsFromSegments(s,e),t.length?new LineElement({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function _shouldApplyFill(s){return s&&s.fill!==!1}function _resolveTarget(s,e,t){let n=s[e].fill;const o=[e];let r;if(!t)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!isNumberFinite(n))return n;if(r=s[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function _decodeFill(s,e,t){const i=parseFillOption(s);if(isObject(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return isNumberFinite(n)&&Math.floor(n)===n?decodeTargetIndex(i[0],e,n,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function decodeTargetIndex(s,e,t,i){return(s==="-"||s==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function _getTargetPixel(s,e){let t=null;return s==="start"?t=e.bottom:s==="end"?t=e.top:isObject(s)?t=e.getPixelForValue(s.value):e.getBasePixel&&(t=e.getBasePixel()),t}function _getTargetValue(s,e,t){let i;return s==="start"?i=t:s==="end"?i=e.options.reverse?e.min:e.max:isObject(s)?i=s.value:i=e.getBaseValue(),i}function parseFillOption(s){const e=s.options,t=e.fill;let i=valueOrDefault(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function _buildStackLine(s){const{scale:e,index:t,line:i}=s,n=[],o=i.segments,r=i.points,a=getLinesBelow(e,t);a.push(_createBoundaryLine({x:null,y:e.bottom},i));for(let l=0;l=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&_drawfill(s.ctx,a,o))}},beforeDatasetsDraw(s,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=s.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){const o=i[n].$filler;_shouldApplyFill(o)&&_drawfill(s.ctx,o,s.chartArea)}},beforeDatasetDraw(s,e,t){const i=e.meta.$filler;!_shouldApplyFill(i)||t.drawTime!=="beforeDatasetDraw"||_drawfill(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=(s,e)=>{let{boxHeight:t=e,boxWidth:i=e}=s;return s.usePointStyle&&(t=Math.min(t,e),i=s.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:t,itemHeight:Math.max(e,t)}},itemsEqual=(s,e)=>s!==null&&e!==null&&s.datasetIndex===e.datasetIndex&&s.index===e.index;class Legend extends Element$1{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t,i){this.maxWidth=e,this.maxHeight=t,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 t=callback(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(i=>e.filter(i,this.chart.data))),e.sort&&(t=t.sort((i,n)=>e.sort(i,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}const i=e.labels,n=toFont(i.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=getBoxSize(i,o);let d,h;t.font=n.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,d=this._fitCols(r,n,a,l)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(h,e.maxHeight||this.maxHeight)}_fitRows(e,t,i,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],d=this.lineWidths=[0],h=n+a;let p=e;o.textAlign="left",o.textBaseline="middle";let m=-1,v=-h;return this.legendItems.forEach((y,b)=>{const S=i+t/2+o.measureText(y.text).width;(b===0||d[d.length-1]+S+2*a>r)&&(p+=h,d[d.length-(b>0?0:1)]=0,v+=h,m++),l[b]={left:0,top:v,row:m,width:S,height:n},d[d.length-1]+=S+a}),p}_fitCols(e,t,i,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],d=this.columnSizes=[],h=r-e;let p=a,m=0,v=0,y=0,b=0;return this.legendItems.forEach((S,E)=>{const{itemWidth:T,itemHeight:R}=calculateItemSize(i,t,o,S,n);E>0&&v+R+2*a>h&&(p+=m+a,d.push({width:m,height:v}),y+=m+a,b++,m=v=0),l[E]={left:y,top:v,col:b,width:T,height:R},m=Math.max(m,T),v+=R+a}),p+=m,d.push({width:m,height:v}),p}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:i,labels:{padding:n},rtl:o}}=this,r=getRtlAdapter(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=_alignStartEnd(i,this.left+n,this.right-this.lineWidths[a]);for(const d of t)a!==d.row&&(a=d.row,l=_alignStartEnd(i,this.left+n,this.right-this.lineWidths[a])),d.top+=this.top+e+n,d.left=r.leftForLtr(r.x(l),d.width),l+=d.width+n}else{let a=0,l=_alignStartEnd(i,this.top+e+n,this.bottom-this.columnSizes[a].height);for(const d of t)d.col!==a&&(a=d.col,l=_alignStartEnd(i,this.top+e+n,this.bottom-this.columnSizes[a].height)),d.top=l,d.left+=this.left+n,d.left=r.leftForLtr(r.x(d.left),d.width),l+=d.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;clipArea(e,this),this._draw(),unclipArea(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:i,ctx:n}=this,{align:o,labels:r}=e,a=defaults.color,l=getRtlAdapter(e.rtl,this.left,this.width),d=toFont(r.font),{padding:h}=r,p=d.size,m=p/2;let v;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=d.string;const{boxWidth:y,boxHeight:b,itemHeight:S}=getBoxSize(r,p),E=function(x,M,I){if(isNaN(y)||y<=0||isNaN(b)||b<0)return;n.save();const V=valueOrDefault(I.lineWidth,1);if(n.fillStyle=valueOrDefault(I.fillStyle,a),n.lineCap=valueOrDefault(I.lineCap,"butt"),n.lineDashOffset=valueOrDefault(I.lineDashOffset,0),n.lineJoin=valueOrDefault(I.lineJoin,"miter"),n.lineWidth=V,n.strokeStyle=valueOrDefault(I.strokeStyle,a),n.setLineDash(valueOrDefault(I.lineDash,[])),r.usePointStyle){const z={radius:b*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:V},B=l.xPlus(x,y/2),K=M+m;drawPointLegend(n,z,B,K,r.pointStyleWidth&&y)}else{const z=M+Math.max((p-b)/2,0),B=l.leftForLtr(x,y),K=toTRBLCorners(I.borderRadius);n.beginPath(),Object.values(K).some(J=>J!==0)?addRoundedRectPath(n,{x:B,y:z,w:y,h:b,radius:K}):n.rect(B,z,y,b),n.fill(),V!==0&&n.stroke()}n.restore()},T=function(x,M,I){renderText(n,I.text,x,M+S/2,d,{strikethrough:I.hidden,textAlign:l.textAlign(I.textAlign)})},R=this.isHorizontal(),A=this._computeTitleHeight();R?v={x:_alignStartEnd(o,this.left+h,this.right-i[0]),y:this.top+h+A,line:0}:v={x:this.left+h,y:_alignStartEnd(o,this.top+A+h,this.bottom-t[0].height),line:0},overrideTextDirection(this.ctx,e.textDirection);const D=S+h;this.legendItems.forEach((x,M)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;const I=n.measureText(x.text).width,V=l.textAlign(x.textAlign||(x.textAlign=r.textAlign)),z=y+m+I;let B=v.x,K=v.y;l.setWidth(this.width),R?M>0&&B+z+h>this.right&&(K=v.y+=D,v.line++,B=v.x=_alignStartEnd(o,this.left+h,this.right-i[v.line])):M>0&&K+D>this.bottom&&(B=v.x=B+t[v.line].width+h,v.line++,K=v.y=_alignStartEnd(o,this.top+A+h,this.bottom-t[v.line].height));const J=l.x(B);if(E(J,K,x),B=_textX(V,B+y+m,R?B+z:this.right,e.rtl),T(l.x(B),K,x),R)v.x+=z+h;else if(typeof x.text!="string"){const Z=d.lineHeight;v.y+=calculateLegendItemHeight(x,Z)+h}else v.y+=D}),restoreTextDirection(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,i=toFont(t.font),n=toPadding(t.padding);if(!t.display)return;const o=getRtlAdapter(e.rtl,this.left,this.width),r=this.ctx,a=t.position,l=i.size/2,d=n.top+l;let h,p=this.left,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),h=this.top+d,p=_alignStartEnd(e.align,p,this.right-m);else{const y=this.columnSizes.reduce((b,S)=>Math.max(b,S.height),0);h=d+_alignStartEnd(e.align,this.top,this.bottom-y-e.labels.padding-this._computeTitleHeight())}const v=_alignStartEnd(a,p,p+m);r.textAlign=o.textAlign(_toLeftRightCenter(a)),r.textBaseline="middle",r.strokeStyle=t.color,r.fillStyle=t.color,r.font=i.string,renderText(r,t.text,v,h,i)}_computeTitleHeight(){const e=this.options.title,t=toFont(e.font),i=toPadding(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,n,o;if(_isBetween(e,this.left,this.right)&&_isBetween(t,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;io.length>r.length?o:r)),e+t.size/2+i.measureText(n).width}function calculateItemHeight(s,e,t){let i=s;return typeof e.text!="string"&&(i=calculateLegendItemHeight(e,t)),i}function calculateLegendItemHeight(s,e){const t=s.text?s.text.length:0;return e*t}function isListened(s,e){return!!((s==="mousemove"||s==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(s==="click"||s==="mouseup"))}var plugin_legend={id:"legend",_element:Legend,start(s,e,t){const i=s.legend=new Legend({ctx:s.ctx,options:t,chart:s});layouts.configure(s,i,t),layouts.addBox(s,i)},stop(s){layouts.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,e,t){const i=s.legend;layouts.configure(s,i,t),i.options=t},afterUpdate(s){const e=s.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(s,e){e.replay||s.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,e,t){const i=e.datasetIndex,n=t.chart;n.isDatasetVisible(i)?(n.hide(i),e.hidden=!0):(n.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){const e=s.data.datasets,{labels:{usePointStyle:t,pointStyle:i,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{const d=l.controller.getStyle(t?0:void 0),h=toPadding(d.borderWidth);return{text:e[l.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:n||d.textAlign,borderRadius:r&&(a||d.borderRadius),datasetIndex:l.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}};const positioners={average(s){if(!s.length)return!1;let e,t,i=new Set,n=0,o=0;for(e=0,t=s.length;ea+l)/i.size,y:n/o}},nearest(s,e){if(!s.length)return!1;let t=e.x,i=e.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=s.length;o-1?s.split(`
-`):s}function createTooltipItem(s,e){const{element:t,datasetIndex:i,index:n}=e,o=s.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:s,label:r,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:t}}function getTooltipSize(s,e){const t=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:r,boxHeight:a}=e,l=toFont(e.bodyFont),d=toFont(e.titleFont),h=toFont(e.footerFont),p=o.length,m=n.length,v=i.length,y=toPadding(e.padding);let b=y.height,S=0,E=i.reduce((A,D)=>A+D.before.length+D.lines.length+D.after.length,0);if(E+=s.beforeBody.length+s.afterBody.length,p&&(b+=p*d.lineHeight+(p-1)*e.titleSpacing+e.titleMarginBottom),E){const A=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=v*A+(E-v)*l.lineHeight+(E-1)*e.bodySpacing}m&&(b+=e.footerMarginTop+m*h.lineHeight+(m-1)*e.footerSpacing);let T=0;const R=function(A){S=Math.max(S,t.measureText(A).width+T)};return t.save(),t.font=d.string,each(s.title,R),t.font=l.string,each(s.beforeBody.concat(s.afterBody),R),T=e.displayColors?r+2+e.boxPadding:0,each(i,A=>{each(A.before,R),each(A.lines,R),each(A.after,R)}),T=0,t.font=h.string,each(s.footer,R),t.restore(),S+=y.width,{width:S,height:b}}function determineYAlign(s,e){const{y:t,height:i}=e;return ts.height-i/2?"bottom":"center"}function doesNotFitWithAlign(s,e,t,i){const{x:n,width:o}=i,r=t.caretSize+t.caretPadding;if(s==="left"&&n+o+r>e.width||s==="right"&&n-o-r<0)return!0}function determineXAlign(s,e,t,i){const{x:n,width:o}=t,{width:r,chartArea:{left:a,right:l}}=s;let d="center";return i==="center"?d=n<=(a+l)/2?"left":"right":n<=o/2?d="left":n>=r-o/2&&(d="right"),doesNotFitWithAlign(d,s,e,t)&&(d="center"),d}function determineAlignment(s,e,t){const i=t.yAlign||e.yAlign||determineYAlign(s,t);return{xAlign:t.xAlign||e.xAlign||determineXAlign(s,e,t,i),yAlign:i}}function alignX(s,e){let{x:t,width:i}=s;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function alignY(s,e,t){let{y:i,height:n}=s;return e==="top"?i+=t:e==="bottom"?i-=n+t:i-=n/2,i}function getBackgroundPoint(s,e,t,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=s,{xAlign:a,yAlign:l}=t,d=n+o,{topLeft:h,topRight:p,bottomLeft:m,bottomRight:v}=toTRBLCorners(r);let y=alignX(e,a);const b=alignY(e,l,d);return l==="center"?a==="left"?y+=d:a==="right"&&(y-=d):a==="left"?y-=Math.max(h,m)+n:a==="right"&&(y+=Math.max(p,v)+n),{x:_limitValue(y,0,i.width-e.width),y:_limitValue(b,0,i.height-e.height)}}function getAlignedX(s,e,t){const i=toPadding(t.padding);return e==="center"?s.x+s.width/2:e==="right"?s.x+s.width-i.right:s.x+i.left}function getBeforeAfterBodyLines(s){return pushOrConcat([],splitNewlines(s))}function createTooltipContext(s,e,t){return createContext(s,{tooltip:e,tooltipItems:t,type:"tooltip"})}function overrideCallbacks(s,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?s.override(t):s}const defaultCallbacks={beforeTitle:noop$1,title(s){if(s.length>0){const e=s[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?defaultCallbacks[e].call(t,i):n}class Tooltip extends Element$1{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&t.options.animation&&i.animations,o=new Animations(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,n=invokeCallbackWithFallback(i,"beforeTitle",this,e),o=invokeCallbackWithFallback(i,"title",this,e),r=invokeCallbackWithFallback(i,"afterTitle",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(n)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(r)),a}getBeforeBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,n=[];return each(e,o=>{const r={before:[],lines:[],after:[]},a=overrideCallbacks(i,o);pushOrConcat(r.before,splitNewlines(invokeCallbackWithFallback(a,"beforeLabel",this,o))),pushOrConcat(r.lines,invokeCallbackWithFallback(a,"label",this,o)),pushOrConcat(r.after,splitNewlines(invokeCallbackWithFallback(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,n=invokeCallbackWithFallback(i,"beforeFooter",this,e),o=invokeCallbackWithFallback(i,"footer",this,e),r=invokeCallbackWithFallback(i,"afterFooter",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(n)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(r)),a}_createItems(e){const t=this._active,i=this.chart.data,n=[],o=[],r=[];let a=[],l,d;for(l=0,d=t.length;le.filter(h,p,m,i))),e.itemSort&&(a=a.sort((h,p)=>e.itemSort(h,p,i))),each(a,h=>{const p=overrideCallbacks(e.callbacks,h);n.push(invokeCallbackWithFallback(p,"labelColor",this,h)),o.push(invokeCallbackWithFallback(p,"labelPointStyle",this,h)),r.push(invokeCallbackWithFallback(p,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(e,t){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=positioners[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=getTooltipSize(this,i),d=Object.assign({},a,l),h=determineAlignment(this.chart,i,d),p=getBackgroundPoint(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:p.x,y:p.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,n){const o=this.getCaretPosition(e,i,n);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:d,bottomLeft:h,bottomRight:p}=toTRBLCorners(a),{x:m,y:v}=e,{width:y,height:b}=t;let S,E,T,R,A,D;return o==="center"?(A=v+b/2,n==="left"?(S=m,E=S-r,R=A+r,D=A-r):(S=m+y,E=S+r,R=A-r,D=A+r),T=S):(n==="left"?E=m+Math.max(l,h)+r:n==="right"?E=m+y-Math.max(d,p)-r:E=this.caretX,o==="top"?(R=v,A=R-r,S=E-r,T=E+r):(R=v+b,A=R+r,S=E+r,T=E-r),D=R),{x1:S,x2:E,x3:T,y1:R,y2:A,y3:D}}drawTitle(e,t,i){const n=this.title,o=n.length;let r,a,l;if(o){const d=getRtlAdapter(i.rtl,this.x,this.width);for(e.x=getAlignedX(this,i.titleAlign,i),t.textAlign=d.textAlign(i.titleAlign),t.textBaseline="middle",r=toFont(i.titleFont),a=i.titleSpacing,t.fillStyle=i.titleColor,t.font=r.string,l=0;lT!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,addRoundedRectPath(e,{x:b,y,w:d,h:l,radius:E}),e.fill(),e.stroke(),e.fillStyle=r.backgroundColor,e.beginPath(),addRoundedRectPath(e,{x:S,y:y+1,w:d-2,h:l-2,radius:E}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(b,y,d,l),e.strokeRect(b,y,d,l),e.fillStyle=r.backgroundColor,e.fillRect(S,y+1,d-2,l-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:d,boxPadding:h}=i,p=toFont(i.bodyFont);let m=p.lineHeight,v=0;const y=getRtlAdapter(i.rtl,this.x,this.width),b=function(I){t.fillText(I,y.x(e.x+v),e.y+m/2),e.y+=m+o},S=y.textAlign(r);let E,T,R,A,D,x,M;for(t.textAlign=r,t.textBaseline="middle",t.font=p.string,e.x=getAlignedX(this,S,i),t.fillStyle=i.bodyColor,each(this.beforeBody,b),v=a&&S!=="right"?r==="center"?d/2+h:d+2+h:0,A=0,x=n.length;A0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const r=positioners[e.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=getTooltipSize(this,e),l=Object.assign({},r,this._size),d=determineAlignment(t,e,l),h=getBackgroundPoint(e,l,d,t);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=toPadding(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,n,t),overrideTextDirection(e,t.textDirection),o.y+=r.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),restoreTextDirection(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,n=e.map(({datasetIndex:a,index:l})=>{const d=this.chart.getDatasetMeta(a);if(!d)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:d.data[l],index:l}}),o=!_elementsEqual(i,n),r=this._positionChanged(n,t);(o||r)&&(this._active=n,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(e,o,t,i),a=this._positionChanged(r,e),l=t||!_elementsEqual(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),l}_getActiveElements(e,t,i,n){const o=this.options;if(e.type==="mouseout")return[];if(!n)return t.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(e,t){const{caretX:i,caretY:n,options:o}=this,r=positioners[o.position].call(this,e,t);return r!==!1&&(i!==r.x||n!==r.y)}}G(Tooltip,"positioners",positioners);var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(s,e,t){t&&(s.tooltip=new Tooltip({chart:s,options:t}))},beforeUpdate(s,e,t){s.tooltip&&s.tooltip.initialize(t)},reset(s,e,t){s.tooltip&&s.tooltip.initialize(t)},afterDraw(s){const e=s.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(s.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",t)}},afterEvent(s,e){if(s.tooltip){const t=e.replay;s.tooltip.handleEvent(e.event,t,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:(s,e)=>e.bodyFont.size,boxWidth:(s,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:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=(s,e,t,i)=>(typeof e=="string"?(t=s.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function findOrAddLabel(s,e,t,i){const n=s.indexOf(e);if(n===-1)return addIfString(s,e,t,i);const o=s.lastIndexOf(e);return n!==o?t:n}const validIndex=(s,e)=>s===null?null:_limitValue(Math.round(s),0,e);function _getLabelForValue(s){const e=this.getLabels();return s>=0&&st.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}G(CategoryScale,"id","category"),G(CategoryScale,"defaults",{ticks:{callback:_getLabelForValue}});function generateTicks$1(s,e){const t=[],{bounds:n,step:o,min:r,max:a,precision:l,count:d,maxTicks:h,maxDigits:p,includeBounds:m}=s,v=o||1,y=h-1,{min:b,max:S}=e,E=!isNullOrUndef(r),T=!isNullOrUndef(a),R=!isNullOrUndef(d),A=(S-b)/(p+1);let D=niceNum((S-b)/y/v)*v,x,M,I,V;if(D<1e-14&&!E&&!T)return[{value:b},{value:S}];V=Math.ceil(S/D)-Math.floor(b/D),V>y&&(D=niceNum(V*D/y/v)*v),isNullOrUndef(l)||(x=Math.pow(10,l),D=Math.ceil(D*x)/x),n==="ticks"?(M=Math.floor(b/D)*D,I=Math.ceil(S/D)*D):(M=b,I=S),E&&T&&o&&almostWhole((a-r)/o,D/1e3)?(V=Math.round(Math.min((a-r)/D,h)),D=(a-r)/V,M=r,I=a):R?(M=E?r:M,I=T?a:I,V=d-1,D=(I-M)/V):(V=(I-M)/D,almostEquals(V,Math.round(V),D/1e3)?V=Math.round(V):V=Math.ceil(V));const z=Math.max(_decimalPlaces(D),_decimalPlaces(M));x=Math.pow(10,isNullOrUndef(l)?z:l),M=Math.round(M*x)/x,I=Math.round(I*x)/x;let B=0;for(E&&(m&&M!==r?(t.push({value:r}),Ma)break;t.push({value:K})}return T&&m&&I!==a?t.length&&almostEquals(t[t.length-1].value,a,relativeLabelSize(a,A,s))?t[t.length-1].value=a:t.push({value:a}):(!T||I===a)&&t.push({value:I}),t}function relativeLabelSize(s,e,{horizontal:t,minRotation:i}){const n=toRadians(i),o=(t?Math.sin(n):Math.cos(n))||.001,r=.75*e*(""+s).length;return Math.min(e/o,r)}class LinearScaleBase extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return isNullOrUndef(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=t?n:l,a=l=>o=i?o:l;if(e){const l=sign(n),d=sign(o);l<0&&d<0?a(0):l>0&&d>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),e||r(n-l)}this.min=n,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),t=t||11),t&&(n=Math.min(t,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,r=generateTicks$1(n,o);return e.bounds==="ticks"&&_setMinAndMaxByKey(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const n=(i-t)/Math.max(e.length-1,1)/2;t-=n,i+=n}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return formatNumber(e,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=isNumberFinite(e)?e:0,this.max=isNumberFinite(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=toRadians(this.options.ticks.minRotation),n=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/n))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}G(LinearScale,"id","linear"),G(LinearScale,"defaults",{ticks:{callback:Ticks.formatters.numeric}});const log10Floor=s=>Math.floor(log10(s)),changeExponent=(s,e)=>Math.pow(10,log10Floor(s)+e);function isMajor(s){return s/Math.pow(10,log10Floor(s))===1}function steps(s,e,t){const i=Math.pow(10,t),n=Math.floor(s/i);return Math.ceil(e/i)-n}function startExp(s,e){const t=e-s;let i=log10Floor(t);for(;steps(s,e,i)>10;)i++;for(;steps(s,e,i)<10;)i--;return Math.min(i,log10Floor(s))}function generateTicks(s,{min:e,max:t}){e=finiteOrDefault(s.min,e);const i=[],n=log10Floor(e);let o=startExp(e,t),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,d=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let p=Math.floor((d-h)/Math.pow(10,o)),m=finiteOrDefault(s.min,Math.round((l+h+p*Math.pow(10,o))*r)/r);for(;m=10?p=p<15?15:20:p++,p>=20&&(o++,p=2,r=o>=0?1:r),m=Math.round((l+h+p*Math.pow(10,o))*r)/r;const v=finiteOrDefault(s.max,m);return i.push({value:v,major:isMajor(v),significand:p}),i}class LogarithmicScale extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=LinearScaleBase.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return isNumberFinite(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=isNumberFinite(e)?Math.max(0,e):null,this.max=isNumberFinite(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!isNumberFinite(this._userMin)&&(this.min=e===changeExponent(this.min,0)?changeExponent(this.min,-1):changeExponent(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,n=this.max;const o=a=>i=e?i:a,r=a=>n=t?n:a;i===n&&(i<=0?(o(1),r(10)):(o(changeExponent(i,-1)),r(changeExponent(n,1)))),i<=0&&o(changeExponent(n,-1)),n<=0&&r(changeExponent(i,1)),this.min=i,this.max=n}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=generateTicks(t,this);return e.bounds==="ticks"&&_setMinAndMaxByKey(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 e===void 0?"0":formatNumber(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=log10(e),this._valueRange=log10(this.max)-log10(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(log10(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}G(LogarithmicScale,"id","logarithmic"),G(LogarithmicScale,"defaults",{ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}});function getTickBackdropHeight(s){const e=s.ticks;if(e.display&&s.display){const t=toPadding(e.backdropPadding);return valueOrDefault(e.font&&e.font.size,defaults.font.size)+t.height}return 0}function measureLabelSize(s,e,t){return t=isArray(t)?t:[t],{w:_longestText(s,e.string,t),h:t.length*e.lineHeight}}function determineLimits(s,e,t,i,n){return s===i||s===n?{start:e-t/2,end:e+t/2}:sn?{start:e-t,end:e}:{start:e,end:e+t}}function fitWithPointLabels(s){const e={l:s.left+s._padding.left,r:s.right-s._padding.right,t:s.top+s._padding.top,b:s.bottom-s._padding.bottom},t=Object.assign({},e),i=[],n=[],o=s._pointLabels.length,r=s.options.pointLabels,a=r.centerPointLabels?PI/o:0;for(let l=0;le.r&&(a=(i.end-e.r)/o,s.r=Math.max(s.r,e.r+a)),n.starte.b&&(l=(n.end-e.b)/r,s.b=Math.max(s.b,e.b+l))}function createPointLabelItem(s,e,t){const i=s.drawingArea,{extra:n,additionalAngle:o,padding:r,size:a}=t,l=s.getPointPosition(e,i+n+r,o),d=Math.round(toDegrees(_normalizeAngle(l.angle+HALF_PI))),h=yForAngle(l.y,a.h,d),p=getTextAlignForAngle(d),m=leftForTextAlign(l.x,a.w,p);return{visible:!0,x:l.x,y:h,textAlign:p,left:m,top:h,right:m+a.w,bottom:h+a.h}}function isNotOverlapped(s,e){if(!e)return!0;const{left:t,top:i,right:n,bottom:o}=s;return!(_isPointInArea({x:t,y:i},e)||_isPointInArea({x:t,y:o},e)||_isPointInArea({x:n,y:i},e)||_isPointInArea({x:n,y:o},e))}function buildPointLabelItems(s,e,t){const i=[],n=s._pointLabels.length,o=s.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:getTickBackdropHeight(o)/2,additionalAngle:r?PI/n:0};let d;for(let h=0;h270||t<90)&&(s-=e),s}function drawPointLabelBox(s,e,t){const{left:i,top:n,right:o,bottom:r}=t,{backdropColor:a}=e;if(!isNullOrUndef(a)){const l=toTRBLCorners(e.borderRadius),d=toPadding(e.backdropPadding);s.fillStyle=a;const h=i-d.left,p=n-d.top,m=o-i+d.width,v=r-n+d.height;Object.values(l).some(y=>y!==0)?(s.beginPath(),addRoundedRectPath(s,{x:h,y:p,w:m,h:v,radius:l}),s.fill()):s.fillRect(h,p,m,v)}}function drawPointLabels(s,e){const{ctx:t,options:{pointLabels:i}}=s;for(let n=e-1;n>=0;n--){const o=s._pointLabelItems[n];if(!o.visible)continue;const r=i.setContext(s.getPointLabelContext(n));drawPointLabelBox(t,r,o);const a=toFont(r.font),{x:l,y:d,textAlign:h}=o;renderText(t,s._pointLabels[n],l,d+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function pathRadiusLine(s,e,t,i){const{ctx:n}=s;if(t)n.arc(s.xCenter,s.yCenter,e,0,TAU);else{let o=s.getPointPosition(0,e);n.moveTo(o.x,o.y);for(let r=1;r{const n=callback(this.options.pointLabels.callback,[t,i],this);return n||n===0?n:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,n){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,n))}getIndexAngle(e){const t=TAU/(this._pointLabels.length||1),i=this.options.startAngle||0;return _normalizeAngle(e*t+toRadians(i))}getDistanceFromCenterForValue(e){if(isNullOrUndef(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(isNullOrUndef(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(p!==0){l=this.getDistanceFromCenterForValue(h.value);const m=this.getContext(p),v=n.setContext(m),y=o.setContext(m);drawRadiusLine(this,v,l,r,y)}}),i.display){for(e.save(),a=r-1;a>=0;a--){const h=i.setContext(this.getPointLabelContext(a)),{color:p,lineWidth:m}=h;!m||!p||(e.lineWidth=m,e.strokeStyle=p,e.setLineDash(h.borderDash),e.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),d=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let o,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!t.reverse)return;const d=i.setContext(this.getContext(l)),h=toFont(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),d.showLabelBackdrop){e.font=h.string,r=e.measureText(a.label).width,e.fillStyle=d.backdropColor;const p=toPadding(d.backdropPadding);e.fillRect(-r/2-p.left,-o-h.size/2-p.top,r+p.width,h.size+p.height)}renderText(e,a.label,0,-o,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}G(RadialLinearScale,"id","radialLinear"),G(RadialLinearScale,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),G(RadialLinearScale,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),G(RadialLinearScale,"descriptors",{angleLines:{_fallback:"grid"}});const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(s,e){return s-e}function parse(s,e){if(isNullOrUndef(e))return null;const t=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=e;return typeof i=="function"&&(r=i(r)),isNumberFinite(r)||(r=typeof i=="string"?t.parse(r,i):t.parse(r)),r===null?null:(n&&(r=n==="week"&&(isNumber(o)||o===!0)?t.startOf(r,"isoWeek",o):t.startOf(r,n)),+r)}function determineUnitForAutoTicks(s,e,t,i){const n=UNITS.length;for(let o=UNITS.indexOf(s);o=UNITS.indexOf(t);o--){const r=UNITS[o];if(INTERVALS[r].common&&s._adapter.diff(n,i,r)>=e-1)return r}return UNITS[t?UNITS.indexOf(t):0]}function determineMajorUnit(s){for(let e=UNITS.indexOf(s)+1,t=UNITS.length;e=e?t[i]:t[n];s[o]=!0}}function setMajorTicks(s,e,t,i){const n=s._adapter,o=+n.startOf(e[0].value,i),r=e[e.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,i))l=t[a],l>=0&&(e[l].major=!0);return e}function ticksFromTimestamps(s,e,t){const i=[],n={},o=e.length;let r,a;for(r=0;r+e.value))}initOffsets(e=[]){let t=0,i=0,n,o;this.options.offset&&e.length&&(n=this.getDecimalForValue(e[0]),e.length===1?t=1-n:t=(this.getDecimalForValue(e[1])-n)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;t=_limitValue(t,0,r),i=_limitValue(i,0,r),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||determineUnitForAutoTicks(o.minUnit,t,i,this._getLabelCapacity(t)),a=valueOrDefault(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,d=isNumber(l)||l===!0,h={};let p=t,m,v;if(d&&(p=+e.startOf(p,"isoWeek",l)),p=+e.startOf(p,d?"day":r),e.diff(i,t,r)>1e5*a)throw new Error(t+" and "+i+" are too far apart with stepSize of "+a+" "+r);const y=n.ticks.source==="data"&&this.getDataTimestamps();for(m=p,v=0;m+b)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,o=this._unit,r=t||n[o];return this._adapter.format(e,r)}_tickFormatFunction(e,t,i,n){const o=this.options,r=o.ticks.callback;if(r)return callback(r,[e,t,i],this);const a=o.time.displayFormats,l=this._unit,d=this._majorUnit,h=l&&a[l],p=d&&a[d],m=i[t],v=d&&p&&m&&m.major;return this._adapter.format(e,n||(v?p:h))}generateTickLabels(e){let t,i,n;for(t=0,i=e.length;t0?a:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,i=n.length;t=s[i].pos&&e<=s[n].pos&&({lo:i,hi:n}=_lookupByKey(s,"pos",e)),{pos:o,time:a}=s[i],{pos:r,time:l}=s[n]):(e>=s[i].time&&e<=s[n].time&&({lo:i,hi:n}=_lookupByKey(s,"time",e)),{time:o,pos:a}=s[i],{time:r,pos:l}=s[n]);const d=r-o;return d?a+(l-a)*(e-o)/d:a}class TimeSeriesScale extends TimeScale{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=interpolate(t,this.min),this._tableRange=interpolate(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,n=[],o=[];let r,a,l,d,h;for(r=0,a=e.length;r=t&&d<=i&&n.push(d);if(n.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(interpolate(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return interpolate(this._table,i*this._tableRange+this._minPos,!0)}}G(TimeSeriesScale,"id","timeseries"),G(TimeSeriesScale,"defaults",TimeScale.defaults);/*!
+`):s}function createTooltipItem(s,e){const{element:t,datasetIndex:i,index:n}=e,o=s.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:s,label:r,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:t}}function getTooltipSize(s,e){const t=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:r,boxHeight:a}=e,l=toFont(e.bodyFont),d=toFont(e.titleFont),h=toFont(e.footerFont),p=o.length,m=n.length,v=i.length,y=toPadding(e.padding);let b=y.height,S=0,E=i.reduce((A,D)=>A+D.before.length+D.lines.length+D.after.length,0);if(E+=s.beforeBody.length+s.afterBody.length,p&&(b+=p*d.lineHeight+(p-1)*e.titleSpacing+e.titleMarginBottom),E){const A=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=v*A+(E-v)*l.lineHeight+(E-1)*e.bodySpacing}m&&(b+=e.footerMarginTop+m*h.lineHeight+(m-1)*e.footerSpacing);let T=0;const R=function(A){S=Math.max(S,t.measureText(A).width+T)};return t.save(),t.font=d.string,each(s.title,R),t.font=l.string,each(s.beforeBody.concat(s.afterBody),R),T=e.displayColors?r+2+e.boxPadding:0,each(i,A=>{each(A.before,R),each(A.lines,R),each(A.after,R)}),T=0,t.font=h.string,each(s.footer,R),t.restore(),S+=y.width,{width:S,height:b}}function determineYAlign(s,e){const{y:t,height:i}=e;return ts.height-i/2?"bottom":"center"}function doesNotFitWithAlign(s,e,t,i){const{x:n,width:o}=i,r=t.caretSize+t.caretPadding;if(s==="left"&&n+o+r>e.width||s==="right"&&n-o-r<0)return!0}function determineXAlign(s,e,t,i){const{x:n,width:o}=t,{width:r,chartArea:{left:a,right:l}}=s;let d="center";return i==="center"?d=n<=(a+l)/2?"left":"right":n<=o/2?d="left":n>=r-o/2&&(d="right"),doesNotFitWithAlign(d,s,e,t)&&(d="center"),d}function determineAlignment(s,e,t){const i=t.yAlign||e.yAlign||determineYAlign(s,t);return{xAlign:t.xAlign||e.xAlign||determineXAlign(s,e,t,i),yAlign:i}}function alignX(s,e){let{x:t,width:i}=s;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function alignY(s,e,t){let{y:i,height:n}=s;return e==="top"?i+=t:e==="bottom"?i-=n+t:i-=n/2,i}function getBackgroundPoint(s,e,t,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=s,{xAlign:a,yAlign:l}=t,d=n+o,{topLeft:h,topRight:p,bottomLeft:m,bottomRight:v}=toTRBLCorners(r);let y=alignX(e,a);const b=alignY(e,l,d);return l==="center"?a==="left"?y+=d:a==="right"&&(y-=d):a==="left"?y-=Math.max(h,m)+n:a==="right"&&(y+=Math.max(p,v)+n),{x:_limitValue(y,0,i.width-e.width),y:_limitValue(b,0,i.height-e.height)}}function getAlignedX(s,e,t){const i=toPadding(t.padding);return e==="center"?s.x+s.width/2:e==="right"?s.x+s.width-i.right:s.x+i.left}function getBeforeAfterBodyLines(s){return pushOrConcat([],splitNewlines(s))}function createTooltipContext(s,e,t){return createContext(s,{tooltip:e,tooltipItems:t,type:"tooltip"})}function overrideCallbacks(s,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?s.override(t):s}const defaultCallbacks={beforeTitle:noop$1,title(s){if(s.length>0){const e=s[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?defaultCallbacks[e].call(t,i):n}class Tooltip extends Element$1{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&t.options.animation&&i.animations,o=new Animations(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,n=invokeCallbackWithFallback(i,"beforeTitle",this,e),o=invokeCallbackWithFallback(i,"title",this,e),r=invokeCallbackWithFallback(i,"afterTitle",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(n)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(r)),a}getBeforeBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,n=[];return each(e,o=>{const r={before:[],lines:[],after:[]},a=overrideCallbacks(i,o);pushOrConcat(r.before,splitNewlines(invokeCallbackWithFallback(a,"beforeLabel",this,o))),pushOrConcat(r.lines,invokeCallbackWithFallback(a,"label",this,o)),pushOrConcat(r.after,splitNewlines(invokeCallbackWithFallback(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,n=invokeCallbackWithFallback(i,"beforeFooter",this,e),o=invokeCallbackWithFallback(i,"footer",this,e),r=invokeCallbackWithFallback(i,"afterFooter",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(n)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(r)),a}_createItems(e){const t=this._active,i=this.chart.data,n=[],o=[],r=[];let a=[],l,d;for(l=0,d=t.length;le.filter(h,p,m,i))),e.itemSort&&(a=a.sort((h,p)=>e.itemSort(h,p,i))),each(a,h=>{const p=overrideCallbacks(e.callbacks,h);n.push(invokeCallbackWithFallback(p,"labelColor",this,h)),o.push(invokeCallbackWithFallback(p,"labelPointStyle",this,h)),r.push(invokeCallbackWithFallback(p,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(e,t){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=positioners[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=getTooltipSize(this,i),d=Object.assign({},a,l),h=determineAlignment(this.chart,i,d),p=getBackgroundPoint(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:p.x,y:p.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,n){const o=this.getCaretPosition(e,i,n);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:d,bottomLeft:h,bottomRight:p}=toTRBLCorners(a),{x:m,y:v}=e,{width:y,height:b}=t;let S,E,T,R,A,D;return o==="center"?(A=v+b/2,n==="left"?(S=m,E=S-r,R=A+r,D=A-r):(S=m+y,E=S+r,R=A-r,D=A+r),T=S):(n==="left"?E=m+Math.max(l,h)+r:n==="right"?E=m+y-Math.max(d,p)-r:E=this.caretX,o==="top"?(R=v,A=R-r,S=E-r,T=E+r):(R=v+b,A=R+r,S=E+r,T=E-r),D=R),{x1:S,x2:E,x3:T,y1:R,y2:A,y3:D}}drawTitle(e,t,i){const n=this.title,o=n.length;let r,a,l;if(o){const d=getRtlAdapter(i.rtl,this.x,this.width);for(e.x=getAlignedX(this,i.titleAlign,i),t.textAlign=d.textAlign(i.titleAlign),t.textBaseline="middle",r=toFont(i.titleFont),a=i.titleSpacing,t.fillStyle=i.titleColor,t.font=r.string,l=0;lT!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,addRoundedRectPath(e,{x:b,y,w:d,h:l,radius:E}),e.fill(),e.stroke(),e.fillStyle=r.backgroundColor,e.beginPath(),addRoundedRectPath(e,{x:S,y:y+1,w:d-2,h:l-2,radius:E}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(b,y,d,l),e.strokeRect(b,y,d,l),e.fillStyle=r.backgroundColor,e.fillRect(S,y+1,d-2,l-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:d,boxPadding:h}=i,p=toFont(i.bodyFont);let m=p.lineHeight,v=0;const y=getRtlAdapter(i.rtl,this.x,this.width),b=function(I){t.fillText(I,y.x(e.x+v),e.y+m/2),e.y+=m+o},S=y.textAlign(r);let E,T,R,A,D,x,M;for(t.textAlign=r,t.textBaseline="middle",t.font=p.string,e.x=getAlignedX(this,S,i),t.fillStyle=i.bodyColor,each(this.beforeBody,b),v=a&&S!=="right"?r==="center"?d/2+h:d+2+h:0,A=0,x=n.length;A0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const r=positioners[e.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=getTooltipSize(this,e),l=Object.assign({},r,this._size),d=determineAlignment(t,e,l),h=getBackgroundPoint(e,l,d,t);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=toPadding(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,n,t),overrideTextDirection(e,t.textDirection),o.y+=r.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),restoreTextDirection(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,n=e.map(({datasetIndex:a,index:l})=>{const d=this.chart.getDatasetMeta(a);if(!d)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:d.data[l],index:l}}),o=!_elementsEqual(i,n),r=this._positionChanged(n,t);(o||r)&&(this._active=n,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(e,o,t,i),a=this._positionChanged(r,e),l=t||!_elementsEqual(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),l}_getActiveElements(e,t,i,n){const o=this.options;if(e.type==="mouseout")return[];if(!n)return t.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(e,t){const{caretX:i,caretY:n,options:o}=this,r=positioners[o.position].call(this,e,t);return r!==!1&&(i!==r.x||n!==r.y)}}G(Tooltip,"positioners",positioners);var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(s,e,t){t&&(s.tooltip=new Tooltip({chart:s,options:t}))},beforeUpdate(s,e,t){s.tooltip&&s.tooltip.initialize(t)},reset(s,e,t){s.tooltip&&s.tooltip.initialize(t)},afterDraw(s){const e=s.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(s.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",t)}},afterEvent(s,e){if(s.tooltip){const t=e.replay;s.tooltip.handleEvent(e.event,t,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:(s,e)=>e.bodyFont.size,boxWidth:(s,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:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=(s,e,t,i)=>(typeof e=="string"?(t=s.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function findOrAddLabel(s,e,t,i){const n=s.indexOf(e);if(n===-1)return addIfString(s,e,t,i);const o=s.lastIndexOf(e);return n!==o?t:n}const validIndex=(s,e)=>s===null?null:_limitValue(Math.round(s),0,e);function _getLabelForValue(s){const e=this.getLabels();return s>=0&&st.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}G(CategoryScale,"id","category"),G(CategoryScale,"defaults",{ticks:{callback:_getLabelForValue}});function generateTicks$1(s,e){const t=[],{bounds:n,step:o,min:r,max:a,precision:l,count:d,maxTicks:h,maxDigits:p,includeBounds:m}=s,v=o||1,y=h-1,{min:b,max:S}=e,E=!isNullOrUndef(r),T=!isNullOrUndef(a),R=!isNullOrUndef(d),A=(S-b)/(p+1);let D=niceNum((S-b)/y/v)*v,x,M,I,V;if(D<1e-14&&!E&&!T)return[{value:b},{value:S}];V=Math.ceil(S/D)-Math.floor(b/D),V>y&&(D=niceNum(V*D/y/v)*v),isNullOrUndef(l)||(x=Math.pow(10,l),D=Math.ceil(D*x)/x),n==="ticks"?(M=Math.floor(b/D)*D,I=Math.ceil(S/D)*D):(M=b,I=S),E&&T&&o&&almostWhole((a-r)/o,D/1e3)?(V=Math.round(Math.min((a-r)/D,h)),D=(a-r)/V,M=r,I=a):R?(M=E?r:M,I=T?a:I,V=d-1,D=(I-M)/V):(V=(I-M)/D,almostEquals(V,Math.round(V),D/1e3)?V=Math.round(V):V=Math.ceil(V));const z=Math.max(_decimalPlaces(D),_decimalPlaces(M));x=Math.pow(10,isNullOrUndef(l)?z:l),M=Math.round(M*x)/x,I=Math.round(I*x)/x;let B=0;for(E&&(m&&M!==r?(t.push({value:r}),Ma)break;t.push({value:K})}return T&&m&&I!==a?t.length&&almostEquals(t[t.length-1].value,a,relativeLabelSize(a,A,s))?t[t.length-1].value=a:t.push({value:a}):(!T||I===a)&&t.push({value:I}),t}function relativeLabelSize(s,e,{horizontal:t,minRotation:i}){const n=toRadians(i),o=(t?Math.sin(n):Math.cos(n))||.001,r=.75*e*(""+s).length;return Math.min(e/o,r)}class LinearScaleBase extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return isNullOrUndef(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=t?n:l,a=l=>o=i?o:l;if(e){const l=sign(n),d=sign(o);l<0&&d<0?a(0):l>0&&d>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),e||r(n-l)}this.min=n,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),t=t||11),t&&(n=Math.min(t,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,r=generateTicks$1(n,o);return e.bounds==="ticks"&&_setMinAndMaxByKey(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const n=(i-t)/Math.max(e.length-1,1)/2;t-=n,i+=n}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return formatNumber(e,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=isNumberFinite(e)?e:0,this.max=isNumberFinite(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=toRadians(this.options.ticks.minRotation),n=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/n))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}G(LinearScale,"id","linear"),G(LinearScale,"defaults",{ticks:{callback:Ticks.formatters.numeric}});const log10Floor=s=>Math.floor(log10(s)),changeExponent=(s,e)=>Math.pow(10,log10Floor(s)+e);function isMajor(s){return s/Math.pow(10,log10Floor(s))===1}function steps(s,e,t){const i=Math.pow(10,t),n=Math.floor(s/i);return Math.ceil(e/i)-n}function startExp(s,e){const t=e-s;let i=log10Floor(t);for(;steps(s,e,i)>10;)i++;for(;steps(s,e,i)<10;)i--;return Math.min(i,log10Floor(s))}function generateTicks(s,{min:e,max:t}){e=finiteOrDefault(s.min,e);const i=[],n=log10Floor(e);let o=startExp(e,t),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,d=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let p=Math.floor((d-h)/Math.pow(10,o)),m=finiteOrDefault(s.min,Math.round((l+h+p*Math.pow(10,o))*r)/r);for(;m=10?p=p<15?15:20:p++,p>=20&&(o++,p=2,r=o>=0?1:r),m=Math.round((l+h+p*Math.pow(10,o))*r)/r;const v=finiteOrDefault(s.max,m);return i.push({value:v,major:isMajor(v),significand:p}),i}class LogarithmicScale extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=LinearScaleBase.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return isNumberFinite(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=isNumberFinite(e)?Math.max(0,e):null,this.max=isNumberFinite(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!isNumberFinite(this._userMin)&&(this.min=e===changeExponent(this.min,0)?changeExponent(this.min,-1):changeExponent(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,n=this.max;const o=a=>i=e?i:a,r=a=>n=t?n:a;i===n&&(i<=0?(o(1),r(10)):(o(changeExponent(i,-1)),r(changeExponent(n,1)))),i<=0&&o(changeExponent(n,-1)),n<=0&&r(changeExponent(i,1)),this.min=i,this.max=n}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=generateTicks(t,this);return e.bounds==="ticks"&&_setMinAndMaxByKey(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 e===void 0?"0":formatNumber(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=log10(e),this._valueRange=log10(this.max)-log10(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(log10(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}G(LogarithmicScale,"id","logarithmic"),G(LogarithmicScale,"defaults",{ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}});function getTickBackdropHeight(s){const e=s.ticks;if(e.display&&s.display){const t=toPadding(e.backdropPadding);return valueOrDefault(e.font&&e.font.size,defaults.font.size)+t.height}return 0}function measureLabelSize(s,e,t){return t=isArray(t)?t:[t],{w:_longestText(s,e.string,t),h:t.length*e.lineHeight}}function determineLimits(s,e,t,i,n){return s===i||s===n?{start:e-t/2,end:e+t/2}:sn?{start:e-t,end:e}:{start:e,end:e+t}}function fitWithPointLabels(s){const e={l:s.left+s._padding.left,r:s.right-s._padding.right,t:s.top+s._padding.top,b:s.bottom-s._padding.bottom},t=Object.assign({},e),i=[],n=[],o=s._pointLabels.length,r=s.options.pointLabels,a=r.centerPointLabels?PI/o:0;for(let l=0;le.r&&(a=(i.end-e.r)/o,s.r=Math.max(s.r,e.r+a)),n.starte.b&&(l=(n.end-e.b)/r,s.b=Math.max(s.b,e.b+l))}function createPointLabelItem(s,e,t){const i=s.drawingArea,{extra:n,additionalAngle:o,padding:r,size:a}=t,l=s.getPointPosition(e,i+n+r,o),d=Math.round(toDegrees(_normalizeAngle(l.angle+HALF_PI))),h=yForAngle(l.y,a.h,d),p=getTextAlignForAngle(d),m=leftForTextAlign(l.x,a.w,p);return{visible:!0,x:l.x,y:h,textAlign:p,left:m,top:h,right:m+a.w,bottom:h+a.h}}function isNotOverlapped(s,e){if(!e)return!0;const{left:t,top:i,right:n,bottom:o}=s;return!(_isPointInArea({x:t,y:i},e)||_isPointInArea({x:t,y:o},e)||_isPointInArea({x:n,y:i},e)||_isPointInArea({x:n,y:o},e))}function buildPointLabelItems(s,e,t){const i=[],n=s._pointLabels.length,o=s.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:getTickBackdropHeight(o)/2,additionalAngle:r?PI/n:0};let d;for(let h=0;h270||t<90)&&(s-=e),s}function drawPointLabelBox(s,e,t){const{left:i,top:n,right:o,bottom:r}=t,{backdropColor:a}=e;if(!isNullOrUndef(a)){const l=toTRBLCorners(e.borderRadius),d=toPadding(e.backdropPadding);s.fillStyle=a;const h=i-d.left,p=n-d.top,m=o-i+d.width,v=r-n+d.height;Object.values(l).some(y=>y!==0)?(s.beginPath(),addRoundedRectPath(s,{x:h,y:p,w:m,h:v,radius:l}),s.fill()):s.fillRect(h,p,m,v)}}function drawPointLabels(s,e){const{ctx:t,options:{pointLabels:i}}=s;for(let n=e-1;n>=0;n--){const o=s._pointLabelItems[n];if(!o.visible)continue;const r=i.setContext(s.getPointLabelContext(n));drawPointLabelBox(t,r,o);const a=toFont(r.font),{x:l,y:d,textAlign:h}=o;renderText(t,s._pointLabels[n],l,d+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function pathRadiusLine(s,e,t,i){const{ctx:n}=s;if(t)n.arc(s.xCenter,s.yCenter,e,0,TAU);else{let o=s.getPointPosition(0,e);n.moveTo(o.x,o.y);for(let r=1;r{const n=callback(this.options.pointLabels.callback,[t,i],this);return n||n===0?n:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,n){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,n))}getIndexAngle(e){const t=TAU/(this._pointLabels.length||1),i=this.options.startAngle||0;return _normalizeAngle(e*t+toRadians(i))}getDistanceFromCenterForValue(e){if(isNullOrUndef(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(isNullOrUndef(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(p!==0||p===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const m=this.getContext(p),v=n.setContext(m),y=o.setContext(m);drawRadiusLine(this,v,l,r,y)}}),i.display){for(e.save(),a=r-1;a>=0;a--){const h=i.setContext(this.getPointLabelContext(a)),{color:p,lineWidth:m}=h;!m||!p||(e.lineWidth=m,e.strokeStyle=p,e.setLineDash(h.borderDash),e.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),d=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let o,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;const d=i.setContext(this.getContext(l)),h=toFont(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),d.showLabelBackdrop){e.font=h.string,r=e.measureText(a.label).width,e.fillStyle=d.backdropColor;const p=toPadding(d.backdropPadding);e.fillRect(-r/2-p.left,-o-h.size/2-p.top,r+p.width,h.size+p.height)}renderText(e,a.label,0,-o,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}G(RadialLinearScale,"id","radialLinear"),G(RadialLinearScale,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),G(RadialLinearScale,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),G(RadialLinearScale,"descriptors",{angleLines:{_fallback:"grid"}});const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(s,e){return s-e}function parse(s,e){if(isNullOrUndef(e))return null;const t=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=e;return typeof i=="function"&&(r=i(r)),isNumberFinite(r)||(r=typeof i=="string"?t.parse(r,i):t.parse(r)),r===null?null:(n&&(r=n==="week"&&(isNumber(o)||o===!0)?t.startOf(r,"isoWeek",o):t.startOf(r,n)),+r)}function determineUnitForAutoTicks(s,e,t,i){const n=UNITS.length;for(let o=UNITS.indexOf(s);o=UNITS.indexOf(t);o--){const r=UNITS[o];if(INTERVALS[r].common&&s._adapter.diff(n,i,r)>=e-1)return r}return UNITS[t?UNITS.indexOf(t):0]}function determineMajorUnit(s){for(let e=UNITS.indexOf(s)+1,t=UNITS.length;e=e?t[i]:t[n];s[o]=!0}}function setMajorTicks(s,e,t,i){const n=s._adapter,o=+n.startOf(e[0].value,i),r=e[e.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,i))l=t[a],l>=0&&(e[l].major=!0);return e}function ticksFromTimestamps(s,e,t){const i=[],n={},o=e.length;let r,a;for(r=0;r+e.value))}initOffsets(e=[]){let t=0,i=0,n,o;this.options.offset&&e.length&&(n=this.getDecimalForValue(e[0]),e.length===1?t=1-n:t=(this.getDecimalForValue(e[1])-n)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;t=_limitValue(t,0,r),i=_limitValue(i,0,r),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||determineUnitForAutoTicks(o.minUnit,t,i,this._getLabelCapacity(t)),a=valueOrDefault(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,d=isNumber(l)||l===!0,h={};let p=t,m,v;if(d&&(p=+e.startOf(p,"isoWeek",l)),p=+e.startOf(p,d?"day":r),e.diff(i,t,r)>1e5*a)throw new Error(t+" and "+i+" are too far apart with stepSize of "+a+" "+r);const y=n.ticks.source==="data"&&this.getDataTimestamps();for(m=p,v=0;m+b)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,o=this._unit,r=t||n[o];return this._adapter.format(e,r)}_tickFormatFunction(e,t,i,n){const o=this.options,r=o.ticks.callback;if(r)return callback(r,[e,t,i],this);const a=o.time.displayFormats,l=this._unit,d=this._majorUnit,h=l&&a[l],p=d&&a[d],m=i[t],v=d&&p&&m&&m.major;return this._adapter.format(e,n||(v?p:h))}generateTickLabels(e){let t,i,n;for(t=0,i=e.length;t0?a:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,i=n.length;t=s[i].pos&&e<=s[n].pos&&({lo:i,hi:n}=_lookupByKey(s,"pos",e)),{pos:o,time:a}=s[i],{pos:r,time:l}=s[n]):(e>=s[i].time&&e<=s[n].time&&({lo:i,hi:n}=_lookupByKey(s,"time",e)),{time:o,pos:a}=s[i],{time:r,pos:l}=s[n]);const d=r-o;return d?a+(l-a)*(e-o)/d:a}class TimeSeriesScale extends TimeScale{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=interpolate(t,this.min),this._tableRange=interpolate(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,n=[],o=[];let r,a,l,d,h;for(r=0,a=e.length;r=t&&d<=i&&n.push(d);if(n.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(interpolate(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return interpolate(this._table,i*this._tableRange+this._minPos,!0)}}G(TimeSeriesScale,"id","timeseries"),G(TimeSeriesScale,"defaults",TimeScale.defaults);/*!
* chartjs-chart-sankey v0.12.0
* https://github.com/kurkle/chartjs-chart-sankey#readme
* (c) 2022 Jukka Kurkela
diff --git a/public/build/manifest.json b/public/build/manifest.json
index e46e139243..390507980e 100644
--- a/public/build/manifest.json
+++ b/public/build/manifest.json
@@ -1,57 +1,57 @@
{
- "_create-empty-split-224dd5cc.js": {
- "file": "assets/create-empty-split-224dd5cc.js",
+ "_create-empty-split-81f71b2e.js": {
+ "file": "assets/create-empty-split-81f71b2e.js",
"imports": [
- "_vendor-29d868f9.js"
+ "_vendor-50e42c6c.js"
],
- "integrity": "sha384-Fe4EFJyqGnKJtlPnsEmK9bgqfm3ME+peYLok4zFWW2E8Jw/DFrfWPutOuy51zo7k"
+ "integrity": "sha384-iCRJ+fmYZVSXY4L5+Q8vhQKqcjSi6lnglG7yW8deRAjJwiVaANm0EzriQPOAgQMS"
},
- "_format-money-0eadc9a5.js": {
- "file": "assets/format-money-0eadc9a5.js",
+ "_format-money-2e5851ad.js": {
+ "file": "assets/format-money-2e5851ad.js",
"imports": [
- "_vendor-29d868f9.js"
+ "_vendor-50e42c6c.js"
],
- "integrity": "sha384-V+tvR2m7nSG2M4f1nCws0Vblszq/fUzQP/4WHGwxTjPiT4Bx7Yp5joFuQqHtvCZc"
+ "integrity": "sha384-kzF0fVkQWinHDsR1R190XjenILJ0VYvD2H1rQJW23dJvcA18qRrGRyb9q+3RADZU"
},
- "_get-e91a7549.js": {
- "file": "assets/get-e91a7549.js",
+ "_get-28b9aa25.js": {
+ "file": "assets/get-28b9aa25.js",
"imports": [
- "_format-money-0eadc9a5.js"
+ "_format-money-2e5851ad.js"
],
- "integrity": "sha384-taM3BY7w0UYLnnDkW+yUjJ0mjVGevf/nQX0aF1QLp/29bjEoZG9FIwIQmiob+dV/"
+ "integrity": "sha384-pKOfaG0JCi2+ROk2Tt8poQvr+uMK7u4BUCUKRcvEU/bREr4YReZnqSNBWtvdP3dW"
},
- "_get-eb14a1e7.js": {
- "file": "assets/get-eb14a1e7.js",
+ "_get-e0a81c64.js": {
+ "file": "assets/get-e0a81c64.js",
"imports": [
- "_format-money-0eadc9a5.js"
+ "_format-money-2e5851ad.js"
],
- "integrity": "sha384-oOTTX2GJ9favH5eEgKdLByQFPLOL+uEV8YuDB0G2Fr+VkTXWvAm+wTPPNRoeSBna"
+ "integrity": "sha384-3OBZFmOXNyobpHvnLUfs5EdHG9fjwBAhQRszBlMtAO55MsE+OrB0/xnuNfMN+R7N"
},
- "_parse-downloaded-splits-c84e4e72.js": {
- "file": "assets/parse-downloaded-splits-c84e4e72.js",
+ "_parse-downloaded-splits-83822d1b.js": {
+ "file": "assets/parse-downloaded-splits-83822d1b.js",
"imports": [
- "_create-empty-split-224dd5cc.js",
- "_vendor-29d868f9.js"
+ "_create-empty-split-81f71b2e.js",
+ "_vendor-50e42c6c.js"
],
- "integrity": "sha384-GyxMGgAOGUGeGS8GopF2E91A4aYAxkCOrEUGzaTmo7TR7DexiJaMU1hBtEKW0Zrg"
+ "integrity": "sha384-dPB0/W3hHYE/2m/HPqibSEe2N2XD7wMTePDsRd6fv03fKwgFu6mwOjUx1t3q6Gn6"
},
- "_put-79877c04.js": {
- "file": "assets/put-79877c04.js",
+ "_put-bb9ad93a.js": {
+ "file": "assets/put-bb9ad93a.js",
"imports": [
- "_format-money-0eadc9a5.js"
+ "_format-money-2e5851ad.js"
],
- "integrity": "sha384-nSv+7TrBp3yUaWf50t2s5NVoNKUbc0K5BXhYuEtemv1hmKdmdfg2XTAxlCwsER5h"
+ "integrity": "sha384-jk8bB684G+XotWRFO6k57GF1QGy6BUgFBb55JPsvU3clT6DBNA42ELW8vPyX9HbB"
},
- "_splice-errors-into-transactions-cff36293.js": {
- "file": "assets/splice-errors-into-transactions-cff36293.js",
+ "_splice-errors-into-transactions-6727b386.js": {
+ "file": "assets/splice-errors-into-transactions-6727b386.js",
"imports": [
- "_format-money-0eadc9a5.js",
- "_get-eb14a1e7.js",
- "_vendor-29d868f9.js"
+ "_format-money-2e5851ad.js",
+ "_get-28b9aa25.js",
+ "_vendor-50e42c6c.js"
],
- "integrity": "sha384-O1jAp6eMTgnWh9y/37DmSdkXmSPqn+yuOI9GNkKst2LXoQdNuSXXsUYdlY/XQ++B"
+ "integrity": "sha384-x5WY5RRt7J6TLl+7nLZi1TBBKgUmjNokUh2ezaofCTQp0sEkHQrmJYAGUX/ZwPY4"
},
- "_vendor-29d868f9.js": {
+ "_vendor-50e42c6c.js": {
"assets": [
"assets/layers-1dbbe9d0.png",
"assets/layers-2x-066daca8.png",
@@ -60,8 +60,8 @@
"css": [
"assets/vendor-6fbf50c2.css"
],
- "file": "assets/vendor-29d868f9.js",
- "integrity": "sha384-b6NeUOA/F71YH766Rxtqtj4DCc+ZvbSVfDKd7vnZR9LilLr3wu/7SaEQn6wnqZ2f"
+ "file": "assets/vendor-50e42c6c.js",
+ "integrity": "sha384-dsSpdnRISp7bIdL3fpyygvNfUizujkwhA11RPZehiEUvEt52ESLYt+Hlp3c9/iZp"
},
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf": {
"file": "assets/fa-brands-400-5656d596.ttf",
@@ -109,45 +109,45 @@
"integrity": "sha384-wg83fCOXjBtqzFAWhTL9Sd9vmLUNhfEEzfmNUX9zwv2igKlz/YQbdapF4ObdxF+R"
},
"resources/assets/v2/pages/dashboard/dashboard.js": {
- "file": "assets/dashboard-79f411ba.js",
+ "file": "assets/dashboard-5f195194.js",
"imports": [
- "_format-money-0eadc9a5.js",
- "_vendor-29d868f9.js",
- "_get-e91a7549.js",
- "_get-eb14a1e7.js"
+ "_format-money-2e5851ad.js",
+ "_vendor-50e42c6c.js",
+ "_get-e0a81c64.js",
+ "_get-28b9aa25.js"
],
"isEntry": true,
"src": "resources/assets/v2/pages/dashboard/dashboard.js",
- "integrity": "sha384-GwYZ6LoKmasmU8xSqpuaHMVc7pD9gcb0k3eoeHhfdYh2ZLbPqfAV0aFKMSUfDb/T"
+ "integrity": "sha384-/MzTdILeI9XL/Q9uFEP734/m9XlPpRFcLFQxe8i+di4fuU218Q4W+NSG3DGcKQ11"
},
"resources/assets/v2/pages/transactions/create.js": {
- "file": "assets/create-865d3a86.js",
+ "file": "assets/create-5a4939e8.js",
"imports": [
- "_format-money-0eadc9a5.js",
- "_create-empty-split-224dd5cc.js",
- "_splice-errors-into-transactions-cff36293.js",
- "_vendor-29d868f9.js",
- "_get-eb14a1e7.js"
+ "_format-money-2e5851ad.js",
+ "_create-empty-split-81f71b2e.js",
+ "_splice-errors-into-transactions-6727b386.js",
+ "_vendor-50e42c6c.js",
+ "_get-28b9aa25.js"
],
"isEntry": true,
"src": "resources/assets/v2/pages/transactions/create.js",
- "integrity": "sha384-oZDLG4pTlcJE3tQVXKsnfuCVGg8b4NwbrJWN969rtIymjNU8EyvS3ZavT5dOsq/n"
+ "integrity": "sha384-o9vKV/iUV+9XIsX8rG9jk8bMPSxuV827U7ScOca2b6I6f/lyJBUDmzoMqMIfaqce"
},
"resources/assets/v2/pages/transactions/edit.js": {
- "file": "assets/edit-5b2f31e3.js",
+ "file": "assets/edit-4c7ba005.js",
"imports": [
- "_format-money-0eadc9a5.js",
- "_get-e91a7549.js",
- "_parse-downloaded-splits-c84e4e72.js",
- "_splice-errors-into-transactions-cff36293.js",
- "_vendor-29d868f9.js",
- "_create-empty-split-224dd5cc.js",
- "_put-79877c04.js",
- "_get-eb14a1e7.js"
+ "_format-money-2e5851ad.js",
+ "_get-e0a81c64.js",
+ "_parse-downloaded-splits-83822d1b.js",
+ "_splice-errors-into-transactions-6727b386.js",
+ "_vendor-50e42c6c.js",
+ "_create-empty-split-81f71b2e.js",
+ "_put-bb9ad93a.js",
+ "_get-28b9aa25.js"
],
"isEntry": true,
"src": "resources/assets/v2/pages/transactions/edit.js",
- "integrity": "sha384-0cKgNr169FUfm4fZWDchcbD4iUvaJvudytdMpwy2XcV89r8OS1kDIiiTdDr8rnuo"
+ "integrity": "sha384-MOmzHUGTHwnuic0yw3wUp8MJO+Y9iLdXGy+V5iWtiZLpG2ts8z8R8Ms9Gp9L7Rc0"
},
"resources/assets/v2/pages/transactions/index.css": {
"file": "assets/index-badb0a41.css",
@@ -158,16 +158,16 @@
"css": [
"assets/index-badb0a41.css"
],
- "file": "assets/index-914edd04.js",
+ "file": "assets/index-90222973.js",
"imports": [
- "_format-money-0eadc9a5.js",
- "_vendor-29d868f9.js",
- "_put-79877c04.js",
- "_get-e91a7549.js"
+ "_format-money-2e5851ad.js",
+ "_vendor-50e42c6c.js",
+ "_put-bb9ad93a.js",
+ "_get-e0a81c64.js"
],
"isEntry": true,
"src": "resources/assets/v2/pages/transactions/index.js",
- "integrity": "sha384-I1nmsMl3NamObjMGO9FejfgfHD9YH4MTbwyemaQMk6s87pWgY5Y5PeWtTLmnAubR"
+ "integrity": "sha384-Sl6bKzSJxtyjnJoamDiBSZwdCi+AA8ZV/s40dXKFznm6RfYLiBLSS2qmQMlrVPZT"
},
"resources/assets/v2/pages/transactions/show.css": {
"file": "assets/show-8b1429e5.css",
@@ -178,17 +178,17 @@
"css": [
"assets/show-8b1429e5.css"
],
- "file": "assets/show-9c7036f1.js",
+ "file": "assets/show-3ef1a32a.js",
"imports": [
- "_format-money-0eadc9a5.js",
- "_vendor-29d868f9.js",
- "_get-e91a7549.js",
- "_parse-downloaded-splits-c84e4e72.js",
- "_create-empty-split-224dd5cc.js"
+ "_format-money-2e5851ad.js",
+ "_vendor-50e42c6c.js",
+ "_get-e0a81c64.js",
+ "_parse-downloaded-splits-83822d1b.js",
+ "_create-empty-split-81f71b2e.js"
],
"isEntry": true,
"src": "resources/assets/v2/pages/transactions/show.js",
- "integrity": "sha384-2XV3HPlPXYyJzcBmOQ3rTFIRpCxSeFpkdpGCCZyAShCgQO2JgR5wZpbo5qdLoyti"
+ "integrity": "sha384-SbD7zS5YgCmKGz4yqp3mEIvEye39FouSpd2+WCld8l7Wij23HCUdfGgF/cD+b21y"
},
"resources/assets/v2/sass/app.scss": {
"file": "assets/app-fb7b26ec.css",
diff --git a/resources/lang/bg_BG/firefly.php b/resources/lang/bg_BG/firefly.php
index f481a3389d..e676399137 100644
--- a/resources/lang/bg_BG/firefly.php
+++ b/resources/lang/bg_BG/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Тази транзакция вече е теглене',
diff --git a/resources/lang/ca_ES/firefly.php b/resources/lang/ca_ES/firefly.php
index 3bb188cdf0..28cdbb9538 100644
--- a/resources/lang/ca_ES/firefly.php
+++ b/resources/lang/ca_ES/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Opcions de tramesa',
'apply_rules_checkbox' => 'Aplicar regles',
'fire_webhooks_checkbox' => 'Disparar webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Aquesta transacció ja és una retirada',
diff --git a/resources/lang/cs_CZ/firefly.php b/resources/lang/cs_CZ/firefly.php
index 678c3652ba..8f6ea41fc6 100644
--- a/resources/lang/cs_CZ/firefly.php
+++ b/resources/lang/cs_CZ/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Tato transakce už je výběrem',
diff --git a/resources/lang/da_DK/firefly.php b/resources/lang/da_DK/firefly.php
index 8603b419c7..c8a82f6c52 100644
--- a/resources/lang/da_DK/firefly.php
+++ b/resources/lang/da_DK/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Denne transaktion er allerede en udbetaling',
diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php
index 2d8d6ab492..e1c0f29edb 100644
--- a/resources/lang/de_DE/firefly.php
+++ b/resources/lang/de_DE/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Übermittlungsoptionen',
'apply_rules_checkbox' => 'Regeln anwenden',
'fire_webhooks_checkbox' => 'Webhooks abfeuern',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Diese Buchung ist bereits eine Ausgabe',
diff --git a/resources/lang/el_GR/firefly.php b/resources/lang/el_GR/firefly.php
index 0e21cbe47e..edc8ecd9d5 100644
--- a/resources/lang/el_GR/firefly.php
+++ b/resources/lang/el_GR/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Ενεργοποίηση των webhook',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Αυτή η συναλλαγή είναι ήδη μία ανάληψη',
diff --git a/resources/lang/en_GB/firefly.php b/resources/lang/en_GB/firefly.php
index 386865ff7e..f3e1e11391 100644
--- a/resources/lang/en_GB/firefly.php
+++ b/resources/lang/en_GB/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'This transaction is already a withdrawal',
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index f700910810..f70126cbb0 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -1541,8 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
- 'select_source_account' => 'Please select or type a valid source account name',
- 'select_dest_account' => 'Please select or type a valid destination account name',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'This transaction is already a withdrawal',
diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php
index 4e36a3fb56..a8cf735c0c 100644
--- a/resources/lang/es_ES/firefly.php
+++ b/resources/lang/es_ES/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Opciones de envío',
'apply_rules_checkbox' => 'Aplicar reglas',
'fire_webhooks_checkbox' => 'Disparar webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Esta transferencia ya es un gasto',
diff --git a/resources/lang/fi_FI/firefly.php b/resources/lang/fi_FI/firefly.php
index e7e071f14c..5c1ee64e77 100644
--- a/resources/lang/fi_FI/firefly.php
+++ b/resources/lang/fi_FI/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Tämä tapahtuma on jo nosto',
diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php
index 49f4a49f01..94770d0f25 100644
--- a/resources/lang/fr_FR/firefly.php
+++ b/resources/lang/fr_FR/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Options de soumission',
'apply_rules_checkbox' => 'Appliquer les règles',
'fire_webhooks_checkbox' => 'Lancer les webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Cette opération est déjà une dépense',
diff --git a/resources/lang/hu_HU/firefly.php b/resources/lang/hu_HU/firefly.php
index a37105e1bb..5e0a1005c4 100644
--- a/resources/lang/hu_HU/firefly.php
+++ b/resources/lang/hu_HU/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Ez a tranzakció már egy költség',
diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php
index ad308f711f..ab40187dc0 100644
--- a/resources/lang/id_ID/firefly.php
+++ b/resources/lang/id_ID/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Transaksi ini sudah menjadi penarikan',
diff --git a/resources/lang/it_IT/firefly.php b/resources/lang/it_IT/firefly.php
index 71a1fdaa1e..bf72a240af 100644
--- a/resources/lang/it_IT/firefly.php
+++ b/resources/lang/it_IT/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Opzioni di invio',
'apply_rules_checkbox' => 'Applica le regole',
'fire_webhooks_checkbox' => 'Esegui webhook',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Questa transazione è già un\'uscita',
diff --git a/resources/lang/ja_JP/firefly.php b/resources/lang/ja_JP/firefly.php
index f54db53365..28110f3590 100644
--- a/resources/lang/ja_JP/firefly.php
+++ b/resources/lang/ja_JP/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => '送信オプション',
'apply_rules_checkbox' => 'ルールを適用',
'fire_webhooks_checkbox' => 'Webhookを実行',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'この取引はすでに出金です',
diff --git a/resources/lang/ko_KR/firefly.php b/resources/lang/ko_KR/firefly.php
index a9e53aab8e..9f2d5e8f8b 100644
--- a/resources/lang/ko_KR/firefly.php
+++ b/resources/lang/ko_KR/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => '제출 옵션',
'apply_rules_checkbox' => '규칙 적용',
'fire_webhooks_checkbox' => '웹훅 실행',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => '이 거래는 이미 출금되었습니다',
diff --git a/resources/lang/nb_NO/firefly.php b/resources/lang/nb_NO/firefly.php
index 480718b1bc..b52f1dd8fa 100644
--- a/resources/lang/nb_NO/firefly.php
+++ b/resources/lang/nb_NO/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Alternativer for innsending',
'apply_rules_checkbox' => 'Bruk regler',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Denne transaksjonen er allerede et uttak',
diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php
index 89f37168a8..04ceedc1fb 100644
--- a/resources/lang/nl_NL/firefly.php
+++ b/resources/lang/nl_NL/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Inzending opties',
'apply_rules_checkbox' => 'Regels toepassen',
'fire_webhooks_checkbox' => 'Webhooks starten',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Deze transactie is al een uitgave',
diff --git a/resources/lang/nn_NO/firefly.php b/resources/lang/nn_NO/firefly.php
index ce88fb7f14..511b2cfe92 100644
--- a/resources/lang/nn_NO/firefly.php
+++ b/resources/lang/nn_NO/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Alternativer for innsending',
'apply_rules_checkbox' => 'Bruk reglar',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Denne transaksjonen er allereie eit uttak',
diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php
index 4a3c7e844f..269b73696c 100644
--- a/resources/lang/pl_PL/firefly.php
+++ b/resources/lang/pl_PL/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Opcje zapisu',
'apply_rules_checkbox' => 'Zastosuj reguły',
'fire_webhooks_checkbox' => 'Uruchom webhooki',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Ta transakcja jest już wypłatą',
diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php
index ca8a35bc37..366592710f 100644
--- a/resources/lang/pt_BR/firefly.php
+++ b/resources/lang/pt_BR/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Opções de envio',
'apply_rules_checkbox' => 'Aplicar regras',
'fire_webhooks_checkbox' => 'Acionar webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Esta transação já é uma saída',
diff --git a/resources/lang/pt_PT/firefly.php b/resources/lang/pt_PT/firefly.php
index 82fd5dfa8e..81e1be5275 100644
--- a/resources/lang/pt_PT/firefly.php
+++ b/resources/lang/pt_PT/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Opções de submissão',
'apply_rules_checkbox' => 'Aplicar regras',
'fire_webhooks_checkbox' => 'Ativar webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Esta transação já e um levantamento',
diff --git a/resources/lang/ro_RO/firefly.php b/resources/lang/ro_RO/firefly.php
index 81f2448389..f23abadb3c 100644
--- a/resources/lang/ro_RO/firefly.php
+++ b/resources/lang/ro_RO/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Această tranzacție este deja o retragere',
diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php
index 1b4132e942..f822eb35f9 100644
--- a/resources/lang/ru_RU/firefly.php
+++ b/resources/lang/ru_RU/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Опции отправки',
'apply_rules_checkbox' => 'Применить правила',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Эта транзакция уже является расходом',
diff --git a/resources/lang/sk_SK/firefly.php b/resources/lang/sk_SK/firefly.php
index c0719f688b..8ce8b2c749 100644
--- a/resources/lang/sk_SK/firefly.php
+++ b/resources/lang/sk_SK/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Tato transakcia už je výber',
diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php
index abb18abe25..94b63abd52 100644
--- a/resources/lang/sl_SI/firefly.php
+++ b/resources/lang/sl_SI/firefly.php
@@ -1526,7 +1526,7 @@ return [
'delete_attachment' => 'Izbriši prilogo ":name"',
'attachment_deleted' => 'Priloga ":name" izbrisana',
'liabilities_deleted' => 'Izbrisana odgovornost ":name"',
- 'attachment_updated' => 'Priloga ":name" je posodobljenaj',
+ 'attachment_updated' => 'Priloga ":name" je posodobljena',
'upload_max_file_size' => 'Največja velikost datoteke: :size',
'list_all_attachments' => 'Seznam vseh prilog',
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Možnosti oddaje',
'apply_rules_checkbox' => 'Uporabite pravila',
'fire_webhooks_checkbox' => 'Sprožite Webhooke',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Ta transakcija je že odliv',
diff --git a/resources/lang/sv_SE/firefly.php b/resources/lang/sv_SE/firefly.php
index 9caae382df..20d28d18a9 100644
--- a/resources/lang/sv_SE/firefly.php
+++ b/resources/lang/sv_SE/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Transaktionen är redan ett uttag',
diff --git a/resources/lang/th_TH/firefly.php b/resources/lang/th_TH/firefly.php
index d1262eb301..9f7754dee2 100644
--- a/resources/lang/th_TH/firefly.php
+++ b/resources/lang/th_TH/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'This transaction is already a withdrawal',
diff --git a/resources/lang/tr_TR/firefly.php b/resources/lang/tr_TR/firefly.php
index 6d3a9c883e..4de85dcca6 100644
--- a/resources/lang/tr_TR/firefly.php
+++ b/resources/lang/tr_TR/firefly.php
@@ -1542,6 +1542,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Bu işlem zaten bir para çekme işlemidir',
diff --git a/resources/lang/uk_UA/firefly.php b/resources/lang/uk_UA/firefly.php
index 533a400cbc..ec874d9be6 100644
--- a/resources/lang/uk_UA/firefly.php
+++ b/resources/lang/uk_UA/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Застосувати правила',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Ця транзакція вже є витратою',
diff --git a/resources/lang/vi_VN/firefly.php b/resources/lang/vi_VN/firefly.php
index 31ea0d0dcb..52bd7a8e2b 100644
--- a/resources/lang/vi_VN/firefly.php
+++ b/resources/lang/vi_VN/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => 'Giao dịch này đã được rút tiền',
diff --git a/resources/lang/zh_CN/firefly.php b/resources/lang/zh_CN/firefly.php
index f5a06a7398..26e8dbdd32 100644
--- a/resources/lang/zh_CN/firefly.php
+++ b/resources/lang/zh_CN/firefly.php
@@ -1542,6 +1542,8 @@ return [
'submission_options' => '提交选项',
'apply_rules_checkbox' => '应用规则',
'fire_webhooks_checkbox' => '触发 webhook',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => '此交易已经为支出',
diff --git a/resources/lang/zh_TW/firefly.php b/resources/lang/zh_TW/firefly.php
index 91d12b3c0c..4ad3cbc675 100644
--- a/resources/lang/zh_TW/firefly.php
+++ b/resources/lang/zh_TW/firefly.php
@@ -1541,6 +1541,8 @@ return [
'submission_options' => 'Submission options',
'apply_rules_checkbox' => 'Apply rules',
'fire_webhooks_checkbox' => 'Fire webhooks',
+ 'select_source_account' => 'Please select or type a valid source account name',
+ 'select_dest_account' => 'Please select or type a valid destination account name',
// convert stuff:
'convert_is_already_type_Withdrawal' => '此交易已是一筆提款',