From 1b27e42dbb16b33318aa57a0435c7ef6a58d5701 Mon Sep 17 00:00:00 2001 From: Owncast Date: Wed, 1 Dec 2021 01:49:08 +0000 Subject: [PATCH] Update admin to 6c515b598ff68e92c90b290b75b80a4173fec405 --- static/admin/404/index.html | 2 +- .../_buildManifest.js | 2 +- .../_middlewareManifest.js | 0 .../_ssgManifest.js | 0 static/admin/_next/static/chunks/36bcf0ca-b2199dd596aa4b16.js | 1 + static/admin/_next/static/chunks/36bcf0ca-f48a13ba32e9b52e.js | 1 - static/admin/_next/static/chunks/958-7b78919540497aff.js | 1 + static/admin/_next/static/chunks/958-b630d89bec73c792.js | 1 - static/admin/access-tokens/index.html | 2 +- static/admin/actions/index.html | 2 +- static/admin/chat/messages/index.html | 2 +- static/admin/chat/users/index.html | 2 +- static/admin/config-chat/index.html | 2 +- static/admin/config-public-details/index.html | 2 +- static/admin/config-server-details/index.html | 2 +- static/admin/config-social-items/index.html | 2 +- static/admin/config-storage/index.html | 2 +- static/admin/config-video/index.html | 2 +- static/admin/hardware-info/index.html | 4 ++-- static/admin/help/index.html | 2 +- static/admin/index.html | 2 +- static/admin/logs/index.html | 2 +- static/admin/upgrade/index.html | 2 +- static/admin/viewer-info/index.html | 2 +- static/admin/webhooks/index.html | 2 +- 25 files changed, 22 insertions(+), 22 deletions(-) rename static/admin/_next/static/{qL1tQ8vNXBJRxAKIeQ22A => BBtsP-bp_Fhh9Bg5NH9dg}/_buildManifest.js (81%) rename static/admin/_next/static/{qL1tQ8vNXBJRxAKIeQ22A => BBtsP-bp_Fhh9Bg5NH9dg}/_middlewareManifest.js (100%) rename static/admin/_next/static/{qL1tQ8vNXBJRxAKIeQ22A => BBtsP-bp_Fhh9Bg5NH9dg}/_ssgManifest.js (100%) create mode 100644 static/admin/_next/static/chunks/36bcf0ca-b2199dd596aa4b16.js delete mode 100644 static/admin/_next/static/chunks/36bcf0ca-f48a13ba32e9b52e.js create mode 100644 static/admin/_next/static/chunks/958-7b78919540497aff.js delete mode 100644 static/admin/_next/static/chunks/958-b630d89bec73c792.js diff --git a/static/admin/404/index.html b/static/admin/404/index.html index e5e454508..765404129 100644 --- a/static/admin/404/index.html +++ b/static/admin/404/index.html @@ -1 +1 @@ -404: This page could not be found

What is your stream about today?

What is your stream about today?
Offline

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

What is your stream about today?

What is your stream about today?
Offline

404

This page could not be found.

\ No newline at end of file diff --git a/static/admin/_next/static/qL1tQ8vNXBJRxAKIeQ22A/_buildManifest.js b/static/admin/_next/static/BBtsP-bp_Fhh9Bg5NH9dg/_buildManifest.js similarity index 81% rename from static/admin/_next/static/qL1tQ8vNXBJRxAKIeQ22A/_buildManifest.js rename to static/admin/_next/static/BBtsP-bp_Fhh9Bg5NH9dg/_buildManifest.js index b4c328a65..7b91869a7 100644 --- a/static/admin/_next/static/qL1tQ8vNXBJRxAKIeQ22A/_buildManifest.js +++ b/static/admin/_next/static/BBtsP-bp_Fhh9Bg5NH9dg/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,f,d,h,o,g,u,b){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,a,e,t,i,f,"static/chunks/59-bb3486f7473684cf.js","static/chunks/pages/index-4d5ca370f5d2e820.js"],"/_error":["static/chunks/pages/_error-a3f18418a2205cb8.js"],"/access-tokens":[s,c,a,"static/chunks/pages/access-tokens-8ab04343bdf73124.js"],"/actions":[s,c,"static/chunks/pages/actions-4e648761889c23e5.js"],"/chat/messages":[d,s,c,a,i,h,"static/chunks/pages/chat/messages-945377167eed396f.js"],"/chat/users":[d,s,c,a,e,i,h,"static/chunks/pages/chat/users-3fafc5c5ca06039f.js"],"/config-chat":["static/chunks/pages/config-chat-00377015dc5f7622.js"],"/config-public-details":[s,c,n,"static/css/325160c29fde2de0.css","static/chunks/142-428a66fa3368b6f8.js",o,"static/chunks/pages/config-public-details-2e34343b51b52e4f.js"],"/config-server-details":[g,"static/chunks/pages/config-server-details-bf4e05a70deedfae.js"],"/config-social-items":[s,c,o,"static/chunks/pages/config-social-items-20e5d437c6559a00.js"],"/config-storage":["static/chunks/473-2f8a49a631089460.js","static/chunks/pages/config-storage-7ff1038872a3ca18.js"],"/config-video":[s,c,g,"static/chunks/556-bbfb134a84808c78.js","static/chunks/pages/config-video-32b520dff5444303.js"],"/hardware-info":[u,a,e,t,n,b,"static/chunks/pages/hardware-info-5c7933a2fc8e439b.js"],"/help":[e,"static/chunks/92-105a4d93a0bda1f9.js","static/chunks/pages/help-c7fc342e125a5d6b.js"],"/logs":[s,a,f,"static/chunks/pages/logs-992bb93ef15eb1c3.js"],"/upgrade":[s,"static/chunks/275-35d1a6aef8ecf26a.js","static/chunks/pages/upgrade-455b3ea722ce4dd6.js"],"/viewer-info":[u,a,e,t,n,b,"static/chunks/pages/viewer-info-2fd6ee53e3a146a5.js"],"/webhooks":[s,c,"static/chunks/pages/webhooks-347989374968ddba.js"],sortedPages:["/","/_app","/_error","/access-tokens","/actions","/chat/messages","/chat/users","/config-chat","/config-public-details","/config-server-details","/config-social-items","/config-storage","/config-video","/hardware-info","/help","/logs","/upgrade","/viewer-info","/webhooks"]}}("static/chunks/355-ee12fd455f95ac1f.js","static/chunks/516-7e3214ec30e2dcd2.js","static/chunks/91-af53fa87313ffd15.js","static/chunks/903-44fc07da62e11585.js","static/chunks/102-3bc0d7c9186e3845.js","static/chunks/533-2f63c37b8986cca1.js","static/chunks/8-c94a1d68c52ddd4a.js","static/chunks/429-613793ce22468b22.js","static/chunks/29107295-2c3ce868677a27a4.js","static/chunks/371-814cf16bf0e11916.js","static/chunks/17-a17fee5c4b40129f.js","static/chunks/578-243e65c094c02e3b.js","static/chunks/36bcf0ca-f48a13ba32e9b52e.js","static/chunks/958-b630d89bec73c792.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s,c,a,e,t,i,f,n,d,h,o,g,u,k){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,a,e,t,i,n,"static/chunks/59-bb3486f7473684cf.js","static/chunks/pages/index-4d5ca370f5d2e820.js"],"/_error":["static/chunks/pages/_error-a3f18418a2205cb8.js"],"/access-tokens":[s,c,a,"static/chunks/pages/access-tokens-8ab04343bdf73124.js"],"/actions":[s,c,"static/chunks/pages/actions-4e648761889c23e5.js"],"/chat/messages":[d,s,c,a,i,h,"static/chunks/pages/chat/messages-945377167eed396f.js"],"/chat/users":[d,s,c,a,e,i,h,"static/chunks/pages/chat/users-3fafc5c5ca06039f.js"],"/config-chat":["static/chunks/pages/config-chat-00377015dc5f7622.js"],"/config-public-details":[s,c,f,"static/css/325160c29fde2de0.css","static/chunks/142-428a66fa3368b6f8.js",o,"static/chunks/pages/config-public-details-2e34343b51b52e4f.js"],"/config-server-details":[g,"static/chunks/pages/config-server-details-bf4e05a70deedfae.js"],"/config-social-items":[s,c,o,"static/chunks/pages/config-social-items-20e5d437c6559a00.js"],"/config-storage":["static/chunks/473-2f8a49a631089460.js","static/chunks/pages/config-storage-7ff1038872a3ca18.js"],"/config-video":[s,c,g,"static/chunks/556-bbfb134a84808c78.js","static/chunks/pages/config-video-32b520dff5444303.js"],"/hardware-info":[u,a,e,t,f,k,"static/chunks/pages/hardware-info-5c7933a2fc8e439b.js"],"/help":[e,"static/chunks/92-105a4d93a0bda1f9.js","static/chunks/pages/help-c7fc342e125a5d6b.js"],"/logs":[s,a,n,"static/chunks/pages/logs-992bb93ef15eb1c3.js"],"/upgrade":[s,"static/chunks/275-35d1a6aef8ecf26a.js","static/chunks/pages/upgrade-455b3ea722ce4dd6.js"],"/viewer-info":[u,a,e,t,f,k,"static/chunks/pages/viewer-info-2fd6ee53e3a146a5.js"],"/webhooks":[s,c,"static/chunks/pages/webhooks-347989374968ddba.js"],sortedPages:["/","/_app","/_error","/access-tokens","/actions","/chat/messages","/chat/users","/config-chat","/config-public-details","/config-server-details","/config-social-items","/config-storage","/config-video","/hardware-info","/help","/logs","/upgrade","/viewer-info","/webhooks"]}}("static/chunks/355-ee12fd455f95ac1f.js","static/chunks/516-7e3214ec30e2dcd2.js","static/chunks/91-af53fa87313ffd15.js","static/chunks/903-44fc07da62e11585.js","static/chunks/102-3bc0d7c9186e3845.js","static/chunks/533-2f63c37b8986cca1.js","static/chunks/8-c94a1d68c52ddd4a.js","static/chunks/429-613793ce22468b22.js","static/chunks/29107295-2c3ce868677a27a4.js","static/chunks/371-814cf16bf0e11916.js","static/chunks/17-a17fee5c4b40129f.js","static/chunks/578-243e65c094c02e3b.js","static/chunks/36bcf0ca-b2199dd596aa4b16.js","static/chunks/958-7b78919540497aff.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/static/admin/_next/static/qL1tQ8vNXBJRxAKIeQ22A/_middlewareManifest.js b/static/admin/_next/static/BBtsP-bp_Fhh9Bg5NH9dg/_middlewareManifest.js similarity index 100% rename from static/admin/_next/static/qL1tQ8vNXBJRxAKIeQ22A/_middlewareManifest.js rename to static/admin/_next/static/BBtsP-bp_Fhh9Bg5NH9dg/_middlewareManifest.js diff --git a/static/admin/_next/static/qL1tQ8vNXBJRxAKIeQ22A/_ssgManifest.js b/static/admin/_next/static/BBtsP-bp_Fhh9Bg5NH9dg/_ssgManifest.js similarity index 100% rename from static/admin/_next/static/qL1tQ8vNXBJRxAKIeQ22A/_ssgManifest.js rename to static/admin/_next/static/BBtsP-bp_Fhh9Bg5NH9dg/_ssgManifest.js diff --git a/static/admin/_next/static/chunks/36bcf0ca-b2199dd596aa4b16.js b/static/admin/_next/static/chunks/36bcf0ca-b2199dd596aa4b16.js new file mode 100644 index 000000000..139135e78 --- /dev/null +++ b/static/admin/_next/static/chunks/36bcf0ca-b2199dd596aa4b16.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[570],{53328:function(t,e,i){i.d(e,{kL:function(){return re},zX:function(){return Ki}});var s=i(3940);var n=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=s.r.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const o="transparent",a={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=(0,s.c)(t||o),a=n.valid&&(0,s.c)(e||o);return a&&a.valid?a.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class r{constructor(t,e,i,n){const o=e[i];n=(0,s.a)([t.to,n,o,t.from]);const r=(0,s.a)([t.from,o,n]);this._active=!0,this._fn=t.fn||a[t.type||typeof r],this._easing=s.e[t.easing]||s.e.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=(0,s.a)([t.to,e,n,t.from]),this._from=(0,s.a)([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),s.d.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),s.d.describe("animations",{_fallback:"animation"}),s.d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class l{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,s.i)(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const n=t[i];if(!(0,s.i)(n))return;const o={};for(const t of h)o[t]=n[t];((0,s.b)(n.properties)&&n.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let n=0;n{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let h;for(h=o.length-1;h>=0;--h){const l=o[h];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const c=e[l];let d=n[l];const u=i.get(l);if(d){if(u&&d.active()){d.update(u,c,a);continue}d.cancel()}u&&u.duration?(n[l]=d=new r(u,t,l,c),s.push(d)):t[l]=c}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(n.add(this._chart,i),!0):void 0}}function c(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function d(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n0||!i&&e<0)return n.index}return null}function m(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,h=o.axis,l=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let g=0;gi[t].axis===e)).shift()}function b(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i]}}}const _=t=>"reset"===t||"none"===t,y=(t,e)=>e?t:Object.assign({},t);class v{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=g(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&b(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,o=e.xAxisID=(0,s.v)(i.xAxisID,x(t,"x")),a=e.yAxisID=(0,s.v)(i.yAxisID,x(t,"y")),r=e.rAxisID=(0,s.v)(i.rAxisID,x(t,"r")),h=e.indexAxis,l=e.iAxisID=n(h,o,a,r),c=e.vAxisID=n(h,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&(0,s.u)(this._data,this),t._stacked&&b(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,s.i)(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let s,n,o;for(s=0,n=e.length;s0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=(0,s.b)(n[t])?this.parseArrayData(i,n,t,e):(0,s.i)(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const o=()=>null===l[r]||u&&l[r]t&&!e.hidden&&e._stacked&&{keys:d(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let g,p;function f(){p=n[g];const e=p[r.axis];return!(0,s.g)(p[t.axis])||c>e||u=0;--g)if(!f()){this.updateRangeFromParsed(l,t,p,h);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,a;for(n=0,o=e.length;n=0&&tthis.getContext(i,n)),d);return p.$shared&&(p.$shared=h,o[a]=Object.freeze(y(p,h))),p}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const h=new l(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||_(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){_(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!_(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,r,h]of this._syncList)this[a](r,h);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;at-e)))}return t._cache.$bar}(e,t.type);let n,o,a,r,h=e._length;const l=()=>{32767!==a&&-32768!==a&&((0,s.j)(r)&&(h=Math.min(h,Math.abs(a-r)||h)),r=a)};for(n=0,o=i.length;nMath.abs(r)&&(h=r,l=a),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:n,end:o,min:a,max:r}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function k(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,h=[];let l,c,d,u;for(l=i,c=i+s;lt.x,i="left",s="right"):(e=t.base=i?1:-1)}(d,e,a)*o,u===a&&(m-=d/2),c=m+d),m===e.getPixelForValue(a)){const t=(0,s.s)(d)*e.getLineWidthForValue(a)/2;m+=t,d-=t}return{size:d,base:m,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,o=n.skipNull,a=(0,s.v)(n.maxBarThickness,1/0);let r,h;if(e.grouped){const i=o?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,n=this.getParsed(t),o=i.getLabelForValue(n.x),a=s.getLabelForValue(n.y),r=n._custom;return{label:e.label,value:"("+o+", "+a+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,r=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(r),l=this.includeOptions(s,h),c=o.axis,d=a.axis;for(let u=e;u""}}}};class O extends v{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let o,a,r=t=>+i[t];if((0,s.i)(i[t])){const{key:t="value"}=this._parsing;r=e=>+(0,s.f)(i[e],t)}for(o=t,a=t+e;o(0,s.p)(t,h,l,!0)?1:Math.max(e,e*i,n,n*i),f=(t,e,n)=>(0,s.p)(t,h,l,!0)?-1:Math.min(e,e*i,n,n*i),m=p(0,c,u),x=p(s.H,d,g),b=f(s.P,c,u),_=f(s.P+s.H,d,g);n=(m-b)/2,o=(x-_)/2,a=-(m+b)/2,r=-(x+_)/2}return{ratioX:n,ratioY:o,offsetX:a,offsetY:r}}(d,c,h),m=(i.width-a)/u,x=(i.height-a)/g,b=Math.max(Math.min(m,x)/2,0),_=(0,s.n)(this.options.radius,b),y=(_-Math.max(_*h,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=f*_,n.total=this.calculateTotal(),this.outerRadius=_-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/s.T)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,h=(a.left+a.right)/2,l=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,g=this.resolveDataElementOptions(e,s),p=this.getSharedOptions(g),f=this.includeOptions(s,p);let m,x=this._getRotation();for(m=0;m0&&!isNaN(t)?s.T*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=(0,s.o)(e._parsed[t],i.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s"spacing"!==t,_indexable:t=>"spacing"!==t},O.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return(0,s.b)(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class E extends v{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:h}=function(t,e,i){const n=e.length;let o=0,a=n;if(t._sorted){const{iScale:r,_parsed:h}=t,l=r.axis,{min:c,max:d,minDefined:u,maxDefined:g}=r.getUserBounds();u&&(o=(0,s.w)(Math.min((0,s.x)(h,r.axis,c).lo,i?n:(0,s.x)(e,l,r.getPixelForValue(c)).lo),0,n-1)),a=g?(0,s.w)(Math.max((0,s.x)(h,r.axis,d).hi+1,i?0:(0,s.x)(e,l,r.getPixelForValue(d)).hi+1),o,n)-o:n-o}return{start:o,count:a}}(e,n,a);this._drawStart=r,this._drawCount=h,function(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(e)&&(r=0,h=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:l},t),this.updateElements(n,r,h,t)}updateElements(t,e,i,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:h,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(c),u=this.includeOptions(n,d),g=a.axis,p=r.axis,{spanGaps:f,segment:m}=this.options,x=(0,s.q)(f)?f:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||"none"===n;let _=e>0&&this.getParsed(e-1);for(let y=e;y0&&i[g]-_[g]>x,m&&(c.parsed=i,c.raw=l.data[y]),u&&(c.options=d||this.resolveDataElementOptions(y,e.active?"active":n)),b||this.updateElement(e,y,c,n),_=i}this.updateSharedOptions(d,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}E.id="line",E.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},E.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class R extends v{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=(0,s.o)(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:o}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const o="reset"===n,a=this.chart,r=this.getDataset(),h=a.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,d=l.yCenter,u=l.getIndexAngle(0)-.5*s.P;let g,p=u;const f=360/this.countVisibleElements();for(g=0;g{!isNaN(t.data[s])&&this.chart.getDataVisibility(s)&&i++})),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?(0,s.t)(this.resolveDataElementOptions(t,e).angle||i):0}}R.id="polarArea",R.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},R.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class z extends O{}z.id="pie",z.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class F extends v{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this.getDataset(),o=this._cachedMeta.rScale,a="reset"===s;for(let r=e;r"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var V=Object.freeze({__proto__:null,BarController:L,BubbleController:T,DoughnutController:O,LineController:E,PolarAreaController:R,PieController:z,RadarController:F,ScatterController:I});function B(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class N{constructor(t){this.options=t||{}}formats(){return B()}parse(t,e){return B()}format(t,e){return B()}add(t,e,i){return B()}diff(t,e,i){return B()}startOf(t,e,i){return B()}endOf(t,e){return B()}}N.override=function(t){Object.assign(N.prototype,t)};var W={_date:N};function H(t,e){return"native"in t?{x:t.x,y:t.y}:(0,s.y)(t,e)}function j(t,e,i,n){const{controller:o,data:a,_sorted:r}=t,h=o._cachedMeta.iScale;if(h&&e===h.axis&&r&&a.length){const t=h._reversePixels?s.A:s.x;if(!n)return t(a,e,i);if(o._sharedOptions){const s=a[0],n="function"===typeof s.getRange&&s.getRange(e);if(n){const s=t(a,e,i-n),o=t(a,e,i+n);return{lo:s.lo,hi:o.hi}}}}return{lo:0,hi:a.length-1}}function $(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let r=0,h=o.length;r{t[r](n[a],s)&&o.push({element:t,datasetIndex:e,index:i}),t.inRange(n.x,n.y,s)&&(h=!0)})),i.intersect&&!h?[]:o}var K={modes:{index(t,e,i,s){const n=H(e,t),o=i.axis||"x",a=i.intersect?U(t,n,o,s):Y(t,n,o,!1,s),r=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&r.push({element:i,datasetIndex:t.index,index:e})})),r):[]},dataset(t,e,i,s){const n=H(e,t),o=i.axis||"xy";let a=i.intersect?U(t,n,o,s):Y(t,n,o,!1,s);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tU(t,H(e,t),i.axis||"xy",s),nearest:(t,e,i,s)=>Y(t,H(e,t),i.axis||"xy",i.intersect,s),x:(t,e,i,s)=>(i.axis="x",X(t,e,i,s)),y:(t,e,i,s)=>(i.axis="y",X(t,e,i,s))}};const q=["left","top","right","bottom"];function G(t,e){return t.filter((t=>t.pos===e))}function J(t,e){return t.filter((t=>-1===q.indexOf(t.pos)&&t.box.axis===e))}function Z(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Q(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!q.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function nt(t,e,i,s){const n=[];let o,a,r,h,l,c;for(o=0,a=t.length,l=0;ot.box.fullSize)),!0),s=Z(G(e,"left"),!0),n=Z(G(e,"right")),o=Z(G(e,"top"),!0),a=Z(G(e,"bottom")),r=J(e,"x"),h=J(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(a).concat(r),chartArea:G(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(a).concat(r)}}(t.boxes),l=h.vertical,c=h.horizontal;(0,s.C)(t.boxes,(t=>{"function"===typeof t.beforeLayout&&t.beforeLayout()}));const d=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:a,availableHeight:r,vBoxMaxWidth:a/2/d,hBoxMaxHeight:r/2}),g=Object.assign({},o);et(g,(0,s.B)(n));const p=Object.assign({maxPadding:g,w:a,h:r,x:o.left,y:o.top},o),f=Q(l.concat(c),u);nt(h.fullSize,p,u,f),nt(l,p,u,f),nt(c,p,u,f)&&nt(l,p,u,f),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),at(h.leftAndTop,p,u,f),p.x+=p.w,p.y+=p.h,at(h.rightAndBottom,p,u,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},(0,s.C)(h.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class ht{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class lt extends ht{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ct={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},dt=t=>null===t||""===t;const ut=!!s.I&&{passive:!0};function gt(t,e,i){t.canvas.removeEventListener(e,i,ut)}function pt(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function ft(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||pt(i.addedNodes,s),e=e&&!pt(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function mt(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||pt(i.removedNodes,s),e=e&&!pt(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const xt=new Map;let bt=0;function _t(){const t=window.devicePixelRatio;t!==bt&&(bt=t,xt.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function yt(t,e,i){const n=t.canvas,o=n&&(0,s.E)(n);if(!o)return;const a=(0,s.G)(((t,e)=>{const s=o.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)}));return r.observe(o),function(t,e){xt.size||window.addEventListener("resize",_t),xt.set(t,e)}(t,a),r}function vt(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){xt.delete(t),xt.size||window.removeEventListener("resize",_t)}(t)}function Mt(t,e,i){const n=t.canvas,o=(0,s.G)((e=>{null!==t.ctx&&i(function(t,e){const i=ct[t.type]||t.type,{x:n,y:o}=(0,s.y)(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==o?o:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,i){t.addEventListener(e,i,ut)}(n,e,o),o}class wt extends ht{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",dt(o)){const e=(0,s.F)(t,"width");void 0!==e&&(t.width=e)}if(dt(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=(0,s.F)(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach((t=>{const n=i[t];(0,s.k)(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:ft,detach:mt,resize:yt}[e]||Mt;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:vt,detach:vt,resize:vt}[e]||gt)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return(0,s.D)(t,e,i,n)}isAttached(t){const e=(0,s.E)(t);return!(!e||!e.isConnected)}}class kt{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,s.q)(this.x)&&(0,s.q)(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}kt.defaults={},kt.defaultRoutes=void 0;const St={values:t=>(0,s.b)(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let o,a=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),a=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const r=(0,s.K)(Math.abs(a)),h=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:o,minimumFractionDigits:h,maximumFractionDigits:h};return Object.assign(l,this.options.ticks.format),(0,s.o)(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor((0,s.K)(t)));return 1===n||2===n||5===n?St.numeric.call(this,t,e,i):""}};var Dt={formatters:St};function Ct(t,e){const i=t.options.ticks,n=i.maxTicksLimit||function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),o=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;in)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;no)return t}return Math.max(o,1)}(o,e,n);if(a>0){let t,i;const n=a>1?Math.round((h-r)/(a-1)):null;for(Pt(e,l,c,(0,s.k)(n)?0:r-n,r),t=0,i=a-1;te.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Dt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.d.route("scale.ticks","color","","color"),s.d.route("scale.grid","color","","borderColor"),s.d.route("scale.grid","borderColor","","borderColor"),s.d.route("scale.title","color","","color"),s.d.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),s.d.describe("scales",{_fallback:"scale"}),s.d.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const At=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Lt(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;oa+r)))return l}function Ot(t){return t.drawTicks?t.tickLength:0}function Et(t,e){if(!t.display)return 0;const i=(0,s.Y)(t.font,e),n=(0,s.B)(t.padding);return((0,s.b)(t.text)?t.text.length:1)*i.lineHeight+n.height}function Rt(t,e,i){let n=(0,s.Z)(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class zt extends kt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=(0,s.M)(t,Number.POSITIVE_INFINITY),e=(0,s.M)(e,Number.NEGATIVE_INFINITY),i=(0,s.M)(i,Number.POSITIVE_INFINITY),n=(0,s.M)(n,Number.NEGATIVE_INFINITY),{min:(0,s.M)(t,i),max:(0,s.M)(e,n),minDefined:(0,s.g)(t),maxDefined:(0,s.g)(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let s=0,h=r.length;sn?n:i,n=o&&i>n?i:n,{min:(0,s.M)(i,(0,s.M)(n,i)),max:(0,s.M)(n,(0,s.M)(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,s.N)(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=(0,s.O)(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=r=o||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,g=(0,s.w)(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),d+6>a&&(a=g/(i-(t.offset?.5:1)),r=this.maxHeight-Ot(t.grid)-e.padding-Et(t.title,this.chart.options.font),h=Math.sqrt(d*d+u*u),l=(0,s.Q)(Math.min(Math.asin((0,s.w)((c.highest.height+6)/a,-1,1)),Math.asin((0,s.w)(r/h,-1,1))-Math.asin((0,s.w)(u/h,-1,1)))),l=Math.max(n,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){(0,s.N)(this.options.afterCalculateLabelRotation,[this])}beforeFit(){(0,s.N)(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const a=Et(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ot(o)+a):(t.height=this.maxHeight,t.width=Ot(o)+a),i.display&&this.ticks.length){const{first:e,last:n,widest:o,highest:a}=this._getLabelSizes(),h=2*i.padding,l=(0,s.t)(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(r){const e=i.mirror?0:d*o.width+c*a.height;t.height=Math.min(this.maxHeight,t.height+e+h)}else{const e=i.mirror?0:c*o.width+d*a.height;t.width=Math.min(this.maxWidth,t.width+e+h)}this._calculatePadding(e,n,d,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?h?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){(0,s.N)(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n({width:o[t]||0,height:a[t]||0});return{first:M(0),last:M(e-1),widest:M(y),highest:M(v),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return(0,s.S)(this._alignToPixels?(0,s.U)(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:h/n:h*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:a}=n,r=o.offset,h=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=Ot(o),d=[],u=o.setContext(this.getContext()),g=u.drawBorder?u.borderWidth:0,p=g/2,f=function(t){return(0,s.U)(i,t,g)};let m,x,b,_,y,v,M,w,k,S,D,C;if("top"===a)m=f(this.bottom),v=this.bottom-c,w=m-p,S=f(t.top)+p,C=t.bottom;else if("bottom"===a)m=f(this.top),S=t.top,C=f(t.bottom)-p,v=m+p,w=this.top+c;else if("left"===a)m=f(this.right),y=this.right-c,M=m-p,k=f(t.left)+p,D=t.right;else if("right"===a)m=f(this.left),k=t.left,D=f(t.right)-p,y=m+p,M=this.left+c;else if("x"===e){if("center"===a)m=f((t.top+t.bottom)/2+.5);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];m=f(this.chart.scales[t].getPixelForValue(e))}S=t.top,C=t.bottom,v=m+p,w=v+c}else if("y"===e){if("center"===a)m=f((t.left+t.right)/2);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];m=f(this.chart.scales[t].getPixelForValue(e))}y=m-p,M=y-c,k=t.left,D=t.right}const P=(0,s.v)(n.ticks.maxTicksLimit,l),A=Math.max(1,Math.ceil(l/P));for(x=0;xe.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n{const n=i.split("."),o=n.pop(),a=[t].concat(n).join("."),r=e[i].split("."),h=r.pop(),l=r.join(".");s.d.route(a,o,l,h)}))}(e,t.defaultRoutes);t.descriptors&&s.d.describe(e,t.descriptors)}(t,a,i),this.override&&s.d.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in s.d[n]&&(delete s.d[n][i],this.override&&delete s.a0[i])}}var It=new class{constructor(){this.controllers=new Ft(v,"datasets",!0),this.elements=new Ft(kt,"elements"),this.plugins=new Ft(Object,"plugins"),this.scales=new Ft(zt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):(0,s.C)(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const n=(0,s.a2)(t);(0,s.N)(i["before"+n],[],i),e[t](i),(0,s.N)(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Bt(t,e){return e||!1!==t?!0===t?{}:t:null}function Nt(t,e,i,s){const n=t.pluginScopeKeys(e),o=t.getOptionScopes(i,n);return t.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Wt(t,e){const i=s.d.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ht(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function jt(t){const e=t.options||(t.options={});e.plugins=(0,s.v)(e.plugins,{}),e.scales=function(t,e){const i=s.a0[t.type]||{scales:{}},n=e.scales||{},o=Wt(t.type,e),a=Object.create(null),r=Object.create(null);return Object.keys(n).forEach((t=>{const e=n[t];if(!(0,s.i)(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const h=Ht(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(h,o),c=i.scales||{};a[h]=a[h]||t,r[t]=(0,s.a8)(Object.create(null),[{axis:h},e,c[h],c[l]])})),t.data.datasets.forEach((i=>{const o=i.type||t.type,h=i.indexAxis||Wt(o,e),l=(s.a0[o]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,h),o=i[e+"AxisID"]||a[e]||e;r[o]=r[o]||Object.create(null),(0,s.a8)(r[o],[{axis:e},n[o],l[t]])}))})),Object.keys(r).forEach((t=>{const e=r[t];(0,s.a8)(e,[s.d.scales[e.type],s.d.scale])})),r}(t,e)}function $t(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ut=new Map,Yt=new Set;function Xt(t,e){let i=Ut.get(t);return i||(i=e(),Ut.set(t,i),Yt.add(i)),i}const Kt=(t,e,i)=>{const n=(0,s.f)(e,i);void 0!==n&&t.add(n)};class qt{constructor(t){this._config=function(t){return(t=t||{}).data=$t(t.data),jt(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=$t(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),jt(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Xt(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Xt(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Xt(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Xt(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:n,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const h=new Set;e.forEach((e=>{t&&(h.add(t),e.forEach((e=>Kt(h,t,e)))),e.forEach((t=>Kt(h,n,t))),e.forEach((t=>Kt(h,s.a0[o]||{},t))),e.forEach((t=>Kt(h,s.d,t))),e.forEach((t=>Kt(h,s.a3,t)))}));const l=Array.from(h);return 0===l.length&&l.push(Object.create(null)),Yt.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,s.a0[e]||{},s.d.datasets[e]||{},{type:e},s.d,s.a3]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Gt(this._resolverCache,t,n);let h=a;if(function(t,e){const{isScriptable:i,isIndexable:n}=(0,s.a7)(t);for(const o of e){const e=i(o),a=n(o),r=(a||e)&&t[o];if(e&&((0,s.a4)(r)||Jt(r))||a&&(0,s.b)(r))return!0}return!1}(a,e)){o.$shared=!1,i=(0,s.a4)(i)?i():i;const e=this.createResolver(t,i,r);h=(0,s.a5)(a,i,e)}for(const s of e)o[s]=h[s];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Gt(this._resolverCache,t,i);return(0,s.i)(e)?(0,s.a5)(o,e,void 0,n):o}}function Gt(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const o=i.join();let a=n.get(o);if(!a){a={resolver:(0,s.a6)(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(o,a)}return a}const Jt=t=>(0,s.i)(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||(0,s.a4)(t[i])),!1);const Zt=["top","bottom","left","right","chartArea"];function Qt(t,e){return"top"===t||"bottom"===t||-1===Zt.indexOf(t)&&"x"===e}function te(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function ee(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),(0,s.N)(i&&i.onComplete,[t],e)}function ie(t){const e=t.chart,i=e.options.animation;(0,s.N)(i&&i.onProgress,[t],e)}function se(t){return(0,s.J)()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ne={},oe=t=>{const e=se(t);return Object.values(ne).filter((t=>t.canvas===e)).pop()};function ae(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class re{constructor(t,e){const i=this.config=new qt(e),o=se(t),a=oe(o);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!(0,s.J)()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?lt:wt}(o)),this.platform.updateConfig(i);const h=this.platform.acquireContext(o,r.aspectRatio),l=h&&h.canvas,c=l&&l.height,d=l&&l.width;this.id=(0,s.a9)(),this.ctx=h,this.canvas=l,this.width=d,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Vt,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,s.aa)((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],ne[this.id]=this,h&&l?(n.listen(this,"complete",ee),n.listen(this,"progress",ie),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return(0,s.k)(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,s.ab)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,s.ac)(this.canvas,this.ctx),this}stop(){return n.stop(this),this}resize(t,e){n.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,(0,s.ab)(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),(0,s.N)(i.onResize,[this,a],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};(0,s.C)(t,((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let o=[];e&&(o=o.concat(Object.keys(e).map((t=>{const i=e[t],s=Ht(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),(0,s.C)(o,(e=>{const o=e.options,a=o.id,r=Ht(a,o),h=(0,s.v)(o.type,e.dtype);void 0!==o.position&&Qt(o.position,r)===Qt(e.dposition)||(o.position=e.dposition),n[a]=!0;let l=null;if(a in i&&i[a].type===h)l=i[a];else{l=new(It.getScale(h))({id:a,type:h,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(o,t)})),(0,s.C)(n,((t,e)=>{t||delete i[e]})),(0,s.C)(i,(t=>{rt.configure(this,t,t.options),rt.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let s=0,r=this.data.datasets.length;s{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(te("z","_idx")),this._lastEvent&&this._eventHandler(this._lastEvent,!0),this.render()}_updateScales(){(0,s.C)(this.scales,(t=>{rt.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(0,s.ad)(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){ae(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),n=i(0);for(let o=1;ot.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;rt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,s.C)(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,o=this.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(n&&(0,s.V)(e,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?this.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&(0,s.X)(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}getElementsAtEventForMode(t,e,i,s){const n=K.modes[e];return"function"===typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=(0,s.h)(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);(0,s.j)(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),n.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};(0,s.C)(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){(0,s.C)(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},(0,s.C)(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!(0,s.ae)(i,e)&&(this._active=i,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e){const{_active:i=[],options:n}=this,o=n.hover,a=e;let r=[],h=!1,l=null;return"mouseout"!==t.type&&(r=this.getElementsAtEventForMode(t,o.mode,o,a),l="click"===t.type?this._lastEvent:t),this._lastEvent=null,(0,s.z)(t,this.chartArea,this._minPadding)&&((0,s.N)(n.onHover,[t,r,this],this),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||(0,s.N)(n.onClick,[t,r,this],this)),h=!(0,s.ae)(r,i),(h||e)&&(this._active=r,this._updateHoverStyles(r,i,e)),this._lastEvent=l,h}}const he=()=>(0,s.C)(re.instances,(t=>t._plugins.invalidate())),le=!0;function ce(t,e,i){const{startAngle:n,pixelMargin:o,x:a,y:r,outerRadius:h,innerRadius:l}=e;let c=o/h;t.beginPath(),t.arc(a,r,h,n-c,i+c),l>o?(c=o/l,t.arc(a,r,l,i+c,n-c,!0)):t.arc(a,r,o,i+s.H,n-s.H),t.closePath(),t.clip()}function de(t,e,i,n){const o=(a=t.options.borderRadius,(0,s.ah)(a,["outerStart","outerEnd","innerStart","innerEnd"]));var a;const r=(i-e)/2,h=Math.min(r,n*e/2),l=t=>{const e=(i-Math.min(r,t))*n/2;return(0,s.w)(t,0,Math.min(r,e))};return{outerStart:l(o.outerStart),outerEnd:l(o.outerEnd),innerStart:(0,s.w)(o.innerStart,0,h),innerEnd:(0,s.w)(o.innerEnd,0,h)}}function ue(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function ge(t,e,i,n,o){const{x:a,y:r,startAngle:h,pixelMargin:l,innerRadius:c}=e,d=Math.max(e.outerRadius+n+i-l,0),u=c>0?c+n+i+l:0;let g=0;const p=o-h;if(n){const t=((c>0?c-n:0)+(d>0?d-n:0))/2;g=(p-(0!==t?p*t/(t+n):p))/2}const f=(p-Math.max(.001,p*d-i/s.P)/d)/2,m=h+f+g,x=o-f-g,{outerStart:b,outerEnd:_,innerStart:y,innerEnd:v}=de(e,u,d,x-m),M=d-b,w=d-_,k=m+b/M,S=x-_/w,D=u+y,C=u+v,P=m+y/D,A=x-v/C;if(t.beginPath(),t.arc(a,r,d,k,S),_>0){const e=ue(w,S,a,r);t.arc(e.x,e.y,_,S,x+s.H)}const L=ue(C,x,a,r);if(t.lineTo(L.x,L.y),v>0){const e=ue(C,A,a,r);t.arc(e.x,e.y,v,x+s.H,A+Math.PI)}if(t.arc(a,r,u,x-v/u,m+y/u,!0),y>0){const e=ue(D,P,a,r);t.arc(e.x,e.y,y,P+Math.PI,m-s.H)}const T=ue(M,m,a,r);if(t.lineTo(T.x,T.y),b>0){const e=ue(M,k,a,r);t.arc(e.x,e.y,b,m-s.H,k)}t.closePath()}function pe(t,e,i,n,o){const{options:a}=e,r="inner"===a.borderAlign;a.borderWidth&&(r?(t.lineWidth=2*a.borderWidth,t.lineJoin="round"):(t.lineWidth=a.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,i){const{x:n,y:o,startAngle:a,pixelMargin:r,fullCircles:h}=e,l=Math.max(e.outerRadius-r,0),c=e.innerRadius+r;let d;for(i&&ce(t,e,a+s.T),t.beginPath(),t.arc(n,o,c,a+s.T,a,!0),d=0;d{It.add(...t),he()}},unregister:{enumerable:le,value:(...t)=>{It.remove(...t),he()}}});class fe extends kt{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:o,distance:a}=(0,s.af)(n,{x:t,y:e}),{startAngle:r,endAngle:h,innerRadius:l,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,g=(0,s.v)(d,h-r)>=s.T||(0,s.p)(o,r,h),p=(0,s.ag)(a,l+u,c+u);return g&&p}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:h}=this.options,l=(s+n)/2,c=(o+a+h+r)/2;return{x:e+Math.cos(l)*c,y:i+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,o=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>s.T?Math.floor(i/s.T):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=s.P&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const r=function(t,e,i,n){const{fullCircles:o,startAngle:a,circumference:r}=e;let h=e.endAngle;if(o){ge(t,e,i,n,a+s.T);for(let e=0;er&&o>r;return{count:s,start:h,loop:e.loop,ilen:l(a+(l?r-t:t))%o,_=()=>{g!==p&&(t.lineTo(m,p),t.lineTo(m,g),t.lineTo(m,f))};for(h&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(ip&&(p=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,g=p=i),f=i}_()}function ve(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i?ye:_e}fe.id="arc",fe.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},fe.defaultRoutes={backgroundColor:"backgroundColor"};const Me="function"===typeof Path2D;function we(t,e,i,s){Me&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),me(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=ve(e);for(const r of n)me(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class ke extends kt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;(0,s.ai)(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=(0,s.aj)(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,a=(0,s.ak)(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],h=function(t){return t.stepped?s.al:t.tension||"monotone"===t.cubicInterpolationMode?s.am:s.an}(i);let l,c;for(l=0,c=a.length;l"borderDash"!==t&&"fill"!==t};class De extends kt{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2){ze(t)}))}var Ie={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Fe(t);const n=t.width;t.data.datasets.forEach(((e,o)=>{const{_data:a,indexAxis:r}=e,h=t.getDatasetMeta(o),l=a||e.data;if("y"===(0,s.a)([r,t.options.indexAxis]))return;if("line"!==h.type)return;const c=t.scales[h.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:d,count:u}=function(t,e){const i=e.length;let n,o=0;const{iScale:a}=t,{min:r,max:h,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(o=(0,s.w)((0,s.x)(e,a.axis,r).lo,0,i-1)),n=c?(0,s.w)((0,s.x)(e,a.axis,h).hi+1,o,i)-o:i-o,{start:o,count:n}}(h,l);if(u<=(i.threshold||4*n))return void ze(e);let g;switch((0,s.k)(a)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":g=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let h=0;const l=e+i-1;let c,d,u,g,p,f=e;for(a[h++]=t[f],c=0;cu&&(u=g,d=t[s],p=s);a[h++]=d,f=p}return a[h++]=t[l],a}(l,d,u,n,i);break;case"min-max":g=function(t,e,i,n){let o,a,r,h,l,c,d,u,g,p,f=0,m=0;const x=[],b=e+i-1,_=t[e].x,y=t[b].x-_;for(o=e;op&&(p=h,d=o),f=(m*f+a.x)/++m;else{const i=o-1;if(!(0,s.k)(c)&&!(0,s.k)(d)){const e=Math.min(c,d),s=Math.max(c,d);e!==u&&e!==i&&x.push({...t[e],x:f}),s!==u&&s!==i&&x.push({...t[s],x:f})}o>0&&i!==u&&x.push(t[i]),x.push(a),l=e,m=0,g=p=h,c=d=u=o}}return x}(l,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=g}))},destroy(t){Fe(t)}};function Ve(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=(0,s.v)(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if((0,s.i)(n))return!isNaN(n.value)&&n;let o=parseFloat(n);return(0,s.g)(o)&&Math.floor(o)===o?("-"!==n[0]&&"+"!==n[0]||(o=e+o),!(o===e||o<0||o>=i)&&o):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}class Be{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:a}=this;return e=e||{start:0,end:s.T},t.arc(n,o,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function Ne(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,n=e.options,o=e.getLabels().length,a=[],r=n.reverse?e.max:e.min,h=n.reverse?e.min:e.max;let l,c,d;if(d="start"===i?r:"end"===i?h:(0,s.i)(i)?i.value:e.getBaseValue(),n.grid.circular)return c=e.getPointPositionForValue(0,r),new Be({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(d)});for(l=0;lt;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function He(t,e,i){const s=[];for(let n=0;n{e=We(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(t,e),i.length?new ke({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ye(t,e,i){let n=t[e].fill;const o=[e];let a;if(!i)return n;for(;!1!==n&&-1===o.indexOf(n);){if(!(0,s.g)(n))return n;if(a=t[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function Xe(t,e,i){t.beginPath(),e.path(t),t.lineTo(e.last().x,i),t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Ke(t,e,i,n){if(n)return;let o=e[t],a=i[t];return"angle"===t&&(o=(0,s.av)(o),a=(0,s.av)(a)),{property:t,start:o,end:a}}function qe(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function Ge(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:o,start:a,end:r}=i||{};"x"===o&&(t.beginPath(),t.rect(a,s,r-a,n-s),t.clip())}function Je(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}function Ze(t,e){const{line:i,target:n,property:o,color:a,scale:r}=e,h=function(t,e,i){const n=t.segments,o=t.points,a=e.points,r=[];for(const h of n){let{start:t,end:n}=h;n=We(t,n,o);const l=Ke(i,o[t],o[n],h.loop);if(!e.segments){r.push({source:h,target:l,start:o[t],end:o[n]});continue}const c=(0,s.ak)(e,l);for(const e of c){const t=Ke(i,a[e.start],a[e.end],e.loop),n=(0,s.au)(h,o,t);for(const s of n)r.push({source:s,target:e,start:{[i]:qe(l,t,"start",Math.max)},end:{[i]:qe(l,t,"end",Math.min)}})}}return r}(i,n,o);for(const{source:s,target:l,start:c,end:d}of h){const{style:{backgroundColor:e=a}={}}=s,h=!0!==n;t.save(),t.fillStyle=e,Ge(t,r,h&&Ke(o,c,d)),t.beginPath();const u=!!i.pathSegment(t,s);let g;if(h){u?t.closePath():Je(t,n,d,o);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});g=u&&e,g||Je(t,n,c,o)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function Qe(t,e,i){const n=$e(e),{line:o,scale:a,axis:r}=e,h=o.options,l=h.fill,c=h.backgroundColor,{above:d=c,below:u=c}=l||{};n&&o.points.length&&((0,s.V)(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r}=e,h=i._loop?"angle":e.axis;t.save(),"x"===h&&o!==n&&(Xe(t,s,a.top),Ze(t,{line:i,target:s,color:n,scale:r,property:h}),t.restore(),t.save(),Xe(t,s,a.bottom)),Ze(t,{line:i,target:s,color:o,scale:r,property:h}),t.restore()}(t,{line:o,target:n,above:d,below:u,area:i,scale:a,axis:r}),(0,s.X)(t))}var ti={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,h;for(a=0;a=0;--a){const e=n[a].$filler;e&&(e.line.updateControlPoints(o,e.axis),s&&Qe(t.ctx,e,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const e=s[n].$filler;e&&Qe(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;s&&!1!==s.fill&&"beforeDatasetDraw"===i.drawTime&&Qe(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ei=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class ii extends kt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=(0,s.N)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=(0,s.Y)(i.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:h}=ei(i,o);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(a,o,r,h)+10):(c=this.maxHeight,l=this._fitCols(a,o,r,h)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],h=this.lineWidths=[0],l=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-l;return this.legendItems.forEach(((t,g)=>{const p=i+e/2+n.measureText(t.text).width;(0===g||h[h.length-1]+p+2*a>o)&&(c+=l,h[h.length-(g>0?0:1)]=0,u+=l,d++),r[g]={left:0,top:u,row:d,width:p,height:s},h[h.length-1]+=p+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],h=this.columnSizes=[],l=o-t;let c=a,d=0,u=0,g=0,p=0;return this.legendItems.forEach(((t,o)=>{const f=i+e/2+n.measureText(t.text).width;o>0&&u+s+2*a>l&&(c+=d+a,h.push({width:d,height:u}),g+=d+a,p++,d=u=0),r[o]={left:g,top:u,col:p,width:f,height:s},d=Math.max(d,f),u+=s+a})),c+=d,h.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,a=(0,s.aw)(o,this.left,this.width);if(this.isHorizontal()){let o=0,r=(0,s.$)(i,this.left+n,this.right-this.lineWidths[o]);for(const h of e)o!==h.row&&(o=h.row,r=(0,s.$)(i,this.left+n,this.right-this.lineWidths[o])),h.top+=this.top+t+n,h.left=a.leftForLtr(a.x(r),h.width),r+=h.width+n}else{let o=0,r=(0,s.$)(i,this.top+t+n,this.bottom-this.columnSizes[o].height);for(const h of e)h.col!==o&&(o=h.col,r=(0,s.$)(i,this.top+t+n,this.bottom-this.columnSizes[o].height)),h.top=r,h.left+=this.left+n,h.left=a.leftForLtr(a.x(h.left),h.width),r+=h.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;(0,s.V)(t,this),this._draw(),(0,s.X)(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:a}=t,r=s.d.color,h=(0,s.aw)(t.rtl,this.left,this.width),l=(0,s.Y)(a.font),{color:c,padding:d}=a,u=l.size,g=u/2;let p;this.drawTitle(),n.textAlign=h.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:m,itemHeight:x}=ei(a,u),b=this.isHorizontal(),_=this._computeTitleHeight();p=b?{x:(0,s.$)(o,this.left+d,this.right-i[0]),y:this.top+d+_,line:0}:{x:this.left+d,y:(0,s.$)(o,this.top+_+d,this.bottom-e[0].height),line:0},(0,s.ax)(this.ctx,t.textDirection);const y=x+d;this.legendItems.forEach(((v,M)=>{n.strokeStyle=v.fontColor||c,n.fillStyle=v.fontColor||c;const w=n.measureText(v.text).width,k=h.textAlign(v.textAlign||(v.textAlign=a.textAlign)),S=f+g+w;let D=p.x,C=p.y;h.setWidth(this.width),b?M>0&&D+S+d>this.right&&(C=p.y+=y,p.line++,D=p.x=(0,s.$)(o,this.left+d,this.right-i[p.line])):M>0&&C+y>this.bottom&&(D=p.x=D+e[p.line].width+d,p.line++,C=p.y=(0,s.$)(o,this.top+_+d,this.bottom-e[p.line].height));!function(t,e,i){if(isNaN(f)||f<=0||isNaN(m)||m<0)return;n.save();const o=(0,s.v)(i.lineWidth,1);if(n.fillStyle=(0,s.v)(i.fillStyle,r),n.lineCap=(0,s.v)(i.lineCap,"butt"),n.lineDashOffset=(0,s.v)(i.lineDashOffset,0),n.lineJoin=(0,s.v)(i.lineJoin,"miter"),n.lineWidth=o,n.strokeStyle=(0,s.v)(i.strokeStyle,r),n.setLineDash((0,s.v)(i.lineDash,[])),a.usePointStyle){const a={radius:f*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:o},r=h.xPlus(t,f/2),l=e+g;(0,s.aq)(n,a,r,l)}else{const a=e+Math.max((u-m)/2,0),r=h.leftForLtr(t,f),l=(0,s.at)(i.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?(0,s.ar)(n,{x:r,y:a,w:f,h:m,radius:l}):n.rect(r,a,f,m),n.fill(),0!==o&&n.stroke()}n.restore()}(h.x(D),C,v),D=(0,s.ay)(k,D+f+g,b?D+S:this.right,t.rtl),function(t,e,i){(0,s.W)(n,i.text,t,e+x/2,l,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})}(h.x(D),C,v),b?p.x+=S+d:p.y+=y})),(0,s.az)(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=(0,s.Y)(e.font),n=(0,s.B)(e.padding);if(!e.display)return;const o=(0,s.aw)(t.rtl,this.left,this.width),a=this.ctx,r=e.position,h=i.size/2,l=n.top+h;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+l,d=(0,s.$)(t.align,d,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+(0,s.$)(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const g=(0,s.$)(r,d,d+u);a.textAlign=o.textAlign((0,s.Z)(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,(0,s.W)(a,e.text,g,c,i)}_computeTitleHeight(){const t=this.options.title,e=(0,s.Y)(t.font),i=(0,s.B)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if((0,s.ag)(t,this.left,this.right)&&(0,s.ag)(e,this.top,this.bottom))for(o=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:o,color:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const r=t.controller.getStyle(i?0:void 0),h=(0,s.B)(r.borderWidth);return{text:e[t.index].label,fillStyle:r.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:r.borderColor,pointStyle:n||r.pointStyle,rotation:r.rotation,textAlign:o||r.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class ni extends kt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=(0,s.b)(i.text)?i.text.length:1;this._padding=(0,s.B)(i.padding);const o=n*(0,s.Y)(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:a}=this,r=a.align;let h,l,c,d=0;return this.isHorizontal()?(l=(0,s.$)(r,i,o),c=e+t,h=o-i):("left"===a.position?(l=i+t,c=(0,s.$)(r,n,e),d=-.5*s.P):(l=o-t,c=(0,s.$)(r,e,n),d=.5*s.P),h=n-e),{titleX:l,titleY:c,maxWidth:h,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=(0,s.Y)(e.font),n=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:h}=this._drawArgs(n);(0,s.W)(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:h,textAlign:(0,s.Z)(e.align),textBaseline:"middle",translation:[o,a]})}}var oi={id:"title",_element:ni,start(t,e,i){!function(t,e){const i=new ni({ctx:t.ctx,options:e,chart:t});rt.configure(t,i,e),rt.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;rt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;rt.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ai=new WeakMap;var ri={id:"subtitle",start(t,e,i){const s=new ni({ctx:t.ctx,options:i,chart:t});rt.configure(t,s,i),rt.addBox(t,s),ai.set(t,s)},stop(t){rt.removeBox(t,ai.get(t)),ai.delete(t)},beforeUpdate(t,e,i){const s=ai.get(t);rt.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const hi={average(t){if(!t.length)return!1;let e,i,s=0,n=0,o=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function di(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function ui(t,e){const i=t._chart.ctx,{body:n,footer:o,title:a}=t,{boxWidth:r,boxHeight:h}=e,l=(0,s.Y)(e.bodyFont),c=(0,s.Y)(e.titleFont),d=(0,s.Y)(e.footerFont),u=a.length,g=o.length,p=n.length,f=(0,s.B)(e.padding);let m=f.height,x=0,b=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){m+=p*(e.displayColors?Math.max(h,l.lineHeight):l.lineHeight)+(b-p)*l.lineHeight+(b-1)*e.bodySpacing}g&&(m+=e.footerMarginTop+g*d.lineHeight+(g-1)*e.footerSpacing);let _=0;const y=function(t){x=Math.max(x,i.measureText(t).width+_)};return i.save(),i.font=c.string,(0,s.C)(t.title,y),i.font=l.string,(0,s.C)(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?r+2+e.boxPadding:0,(0,s.C)(n,(t=>{(0,s.C)(t.before,y),(0,s.C)(t.lines,y),(0,s.C)(t.after,y)})),_=0,i.font=d.string,(0,s.C)(t.footer,y),i.restore(),x+=f.width,{width:x,height:m}}function gi(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:h}}=t;let l="center";return"center"===s?l=n<=(r+h)/2?"left":"right":n<=o/2?l="left":n>=a-o/2&&(l="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(l,t,e,i)&&(l="center"),l}function pi(t,e,i){const s=e.yAlign||function(t,e){const{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}(t,i);return{xAlign:e.xAlign||gi(t,e,i,s),yAlign:s}}function fi(t,e,i,n){const{caretSize:o,caretPadding:a,cornerRadius:r}=t,{xAlign:h,yAlign:l}=i,c=o+a,{topLeft:d,topRight:u,bottomLeft:g,bottomRight:p}=(0,s.at)(r);let f=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,h);const m=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,c);return"center"===l?"left"===h?f+=c:"right"===h&&(f-=c):"left"===h?f-=Math.max(d,g)+o:"right"===h&&(f+=Math.max(u,p)+o),{x:(0,s.w)(f,0,n.width-e.width),y:(0,s.w)(m,0,n.height-e.height)}}function mi(t,e,i){const n=(0,s.B)(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function xi(t){return li([],ci(t))}function bi(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class _i extends kt{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this._chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new l(this._chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this._chart.getContext(),e=this,i=this._tooltipItems,(0,s.h)(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=li(a,ci(s)),a=li(a,ci(n)),a=li(a,ci(o)),a}getBeforeBody(t,e){return xi(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return(0,s.C)(t,(t=>{const e={before:[],lines:[],after:[]},s=bi(i,t);li(e.before,ci(s.beforeLabel.call(this,t))),li(e.lines,s.label.call(this,t)),li(e.after,ci(s.afterLabel.call(this,t))),n.push(e)})),n}getAfterBody(t,e){return xi(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=li(a,ci(s)),a=li(a,ci(n)),a=li(a,ci(o)),a}_createItems(t){const e=this._active,i=this._chart.data,n=[],o=[],a=[];let r,h,l=[];for(r=0,h=e.length;rt.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),(0,s.C)(l,(e=>{const i=bi(t.callbacks,e);n.push(i.labelColor.call(this,e)),o.push(i.labelPointStyle.call(this,e)),a.push(i.labelTextColor.call(this,e))})),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=hi[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=ui(this,i),a=Object.assign({},t,e),r=pi(this._chart,i,a),h=fi(i,a,r,this._chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this._chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:h,topRight:l,bottomLeft:c,bottomRight:d}=(0,s.at)(r),{x:u,y:g}=t,{width:p,height:f}=e;let m,x,b,_,y,v;return"center"===o?(y=g+f/2,"left"===n?(m=u,x=m-a,_=y+a,v=y-a):(m=u+p,x=m+a,_=y-a,v=y+a),b=m):(x="left"===n?u+Math.max(h,c)+a:"right"===n?u+p-Math.max(l,d)-a:this.caretX,"top"===o?(_=g,y=_-a,m=x-a,b=x+a):(_=g+f,y=_+a,m=x+a,b=x-a),v=_),{x1:m,x2:x,x3:b,y1:_,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,o=n.length;let a,r,h;if(o){const l=(0,s.aw)(i.rtl,this.x,this.width);for(t.x=mi(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,s.Y)(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,h=0;h0!==t))?(t.beginPath(),t.fillStyle=o.multiKeyBackground,(0,s.ar)(t,{x:e,y:f,w:l,h:h,radius:r}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),(0,s.ar)(t,{x:i,y:f+1,w:l-2,h:h-2,radius:r}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,f,l,h),t.strokeRect(e,f,l,h),t.fillStyle=a.backgroundColor,t.fillRect(i,f+1,l-2,h-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:h,boxWidth:l,boxPadding:c}=i,d=(0,s.Y)(i.bodyFont);let u=d.lineHeight,g=0;const p=(0,s.aw)(i.rtl,this.x,this.width),f=function(i){e.fillText(i,p.x(t.x+g),t.y+u/2),t.y+=u+o},m=p.textAlign(a);let x,b,_,y,v,M,w;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=mi(this,m,i),e.fillStyle=i.bodyColor,(0,s.C)(this.beforeBody,f),g=r&&"right"!==m?"center"===a?l/2+c:l+2+c:0,y=0,M=n.length;y0&&e.stroke()}_updateAnimationTarget(t){const e=this._chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=hi[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=ui(this,t),a=Object.assign({},i,this._size),r=pi(e,t,a),h=fi(t,a,r,e);s._to===h.x&&n._to===h.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=(0,s.B)(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),(0,s.ax)(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),(0,s.az)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map((({datasetIndex:t,index:e})=>{const i=this._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),o=!(0,s.ae)(i,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this.update(!0))}handleEvent(t,e){const i=this.options,n=this._active||[];let o=!1,a=[];"mouseout"!==t.type&&(a=this._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&a.reverse());const r=this._positionChanged(a,t);return o=e||!(0,s.ae)(a,n)||r,o&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=hi[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}_i.positioners=hi;var yi={id:"tooltip",_element:_i,positioners:hi,afterInit(t,e,i){i&&(t.tooltip=new _i({_chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:s.aA,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},vi=Object.freeze({__proto__:null,Decimation:Ie,Filler:ti,Legend:si,SubTitle:ri,Title:oi,Tooltip:yi});function Mi(t,e,i,s){const n=t.indexOf(e);if(-1===n)return((t,e,i,s)=>("string"===typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}class wi extends zt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if((0,s.k)(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:(0,s.w)(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Mi(i,t,(0,s.v)(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function ki(t,e,{horizontal:i,minRotation:n}){const o=(0,s.t)(n),a=(i?Math.sin(o):Math.cos(o))||.001,r=.75*e*(""+t).length;return Math.min(e/a,r)}wi.id="category",wi.defaults={ticks:{callback:wi.prototype.getLabelForValue}};class Si extends zt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return(0,s.k)(t)||("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const a=t=>n=e?n:t,r=t=>o=i?o:t;if(t){const t=(0,s.s)(n),e=(0,s.s)(o);t<0&&e<0?r(0):t>0&&e>0&&a(0)}if(n===o){let e=1;(o>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*o)),r(o+e),t||a(n-e)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:o,min:a,max:r,precision:h,count:l,maxTicks:c,maxDigits:d,includeBounds:u}=t,g=o||1,p=c-1,{min:f,max:m}=e,x=!(0,s.k)(a),b=!(0,s.k)(r),_=!(0,s.k)(l),y=(m-f)/(d+1);let v,M,w,k,S=(0,s.aD)((m-f)/p/g)*g;if(S<1e-14&&!x&&!b)return[{value:f},{value:m}];k=Math.ceil(m/S)-Math.floor(f/S),k>p&&(S=(0,s.aD)(k*S/p/g)*g),(0,s.k)(h)||(v=Math.pow(10,h),S=Math.ceil(S*v)/v),"ticks"===n?(M=Math.floor(f/S)*S,w=Math.ceil(m/S)*S):(M=f,w=m),x&&b&&o&&(0,s.aE)((r-a)/o,S/1e3)?(k=Math.round(Math.min((r-a)/S,c)),S=(r-a)/k,M=a,w=r):_?(M=x?a:M,w=b?r:w,k=l-1,S=(w-M)/k):(k=(w-M)/S,k=(0,s.aF)(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const D=Math.max((0,s.aG)(S),(0,s.aG)(M));v=Math.pow(10,(0,s.k)(h)?D:h),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let C=0;for(x&&(u&&M!==a?(i.push({value:a}),M0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,s.g)(t)?Math.max(0,t):null,this.max=(0,s.g)(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const o=e=>i=t?i:e,a=t=>n=e?n:t,r=(t,e)=>Math.pow(10,Math.floor((0,s.K)(t))+e);i===n&&(i<=0?(o(1),a(10)):(o(r(i,-1)),a(r(n,1)))),i<=0&&o(r(n,-1)),n<=0&&a(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&o(r(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor((0,s.K)(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),o=[];let a=(0,s.M)(t.min,Math.pow(10,Math.floor((0,s.K)(e.min)))),r=Math.floor((0,s.K)(a)),h=Math.floor(a/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{o.push({value:a,major:Ci(a)}),++h,10===h&&(h=1,++r,l=r>=0?1:l),a=Math.round(h*Math.pow(10,r)*l)/l}while(rn?{start:e-i,end:e}:{start:e,end:e+i}}function Ti(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},i={},n=[],o=[],a=t.getLabels().length;for(let c=0;ce.r&&(e.r=m.end,i.r=p),x.starte.b&&(e.b=x.end,i.b=p)}var r,h,l;t._setReductions(t.drawingArea,e,i),t._pointLabelItems=function(t,e,i){const n=[],o=t.getLabels().length,a=t.options,r=Ai(a),h=t.getDistanceFromCenterForValue(a.ticks.reverse?t.min:t.max);for(let l=0;l270||i<90)&&(t-=e),t}function zi(t,e,i,n){const{ctx:o}=t;if(i)o.arc(t.xCenter,t.yCenter,e,0,s.T);else{let i=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(let s=1;s{const i=(0,s.N)(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}))}fit(){const t=this.options;t.display&&t.pointLabels.display?Ti(this):this.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){let s=e.l/Math.sin(i.l),n=Math.max(e.r-this.width,0)/Math.sin(i.r),o=-e.t/Math.cos(i.t),a=-Math.max(e.b-(this.height-this.paddingTop),0)/Math.cos(i.b);s=Fi(s),n=Fi(n),o=Fi(o),a=Fi(a),this.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(s+n)/2),Math.floor(t-(o+a)/2))),this.setCenterPoint(s,n,o,a)}setCenterPoint(t,e,i,s){const n=this.width-e-this.drawingArea,o=t+this.drawingArea,a=i+this.drawingArea,r=this.height-this.paddingTop-s-this.drawingArea;this.xCenter=Math.floor((o+n)/2+this.left),this.yCenter=Math.floor((a+r)/2+this.top+this.paddingTop)}getIndexAngle(t){const e=s.T/this.getLabels().length,i=this.options.startAngle||0;return(0,s.av)(t*e+(0,s.t)(i))}getDistanceFromCenterForValue(t){if((0,s.k)(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if((0,s.k)(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;o--){const e=n.setContext(t.getPointLabelContext(o)),a=(0,s.Y)(e.font),{x:r,y:h,textAlign:l,left:c,top:d,right:u,bottom:g}=t._pointLabelItems[o],{backdropColor:p}=e;if(!(0,s.k)(p)){const t=(0,s.B)(e.backdropPadding);i.fillStyle=p,i.fillRect(c-t.left,d-t.top,u-c+t.width,g-d+t.height)}(0,s.W)(i,t._pointLabels[o],r,h+a.lineHeight/2,a,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e){r=this.getDistanceFromCenterForValue(t.value);!function(t,e,i,s){const n=t.ctx,o=e.circular,{color:a,lineWidth:r}=e;!o&&!s||!a||!r||i<0||(n.save(),n.strokeStyle=a,n.lineWidth=r,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),zi(t,i,o,s),n.closePath(),n.stroke(),n.restore())}(this,n.setContext(this.getContext(e-1)),r,o)}})),i.display){for(t.save(),a=this.getLabels().length-1;a>=0;a--){const s=i.setContext(this.getPointLabelContext(a)),{color:n,lineWidth:o}=s;o&&n&&(t.lineWidth=o,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),h=this.getPointPosition(a,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(h.x,h.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((n,r)=>{if(0===r&&!e.reverse)return;const h=i.setContext(this.getContext(r)),l=(0,s.Y)(h.font);if(o=this.getDistanceFromCenterForValue(this.ticks[r].value),h.showLabelBackdrop){t.font=l.string,a=t.measureText(n.label).width,t.fillStyle=h.backdropColor;const e=(0,s.B)(h.backdropPadding);t.fillRect(-a/2-e.left,-o-l.size/2-e.top,a+e.width,l.size+e.height)}(0,s.W)(t,n.label,0,-o,l,{color:h.color})})),t.restore()}drawTitle(){}}Ii.id="radialLinear",Ii.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Dt.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},Ii.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Ii.descriptors={angleLines:{_fallback:"grid"}};const Vi={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}},Bi=Object.keys(Vi);function Ni(t,e){return t-e}function Wi(t,e){if((0,s.k)(e))return null;const i=t._adapter,{parser:n,round:o,isoWeekday:a}=t._parseOpts;let r=e;return"function"===typeof n&&(r=n(r)),(0,s.g)(r)||(r="string"===typeof n?i.parse(r,n):i.parse(r)),null===r?null:(o&&(r="week"!==o||!(0,s.q)(a)&&!0!==a?i.startOf(r,o):i.startOf(r,"isoWeek",a)),+r)}function Hi(t,e,i,s){const n=Bi.length;for(let o=Bi.indexOf(t);o=e?i[n]:i[o]]=!0}}else t[e]=!0}function $i(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a=0&&(e[h].major=!0);return e}(t,s,n,i):s}class Ui extends zt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new W._date(t.adapters.date);(0,s.a8)(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Wi(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function h(t){a||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(o=Math.max(o,t.max))}a&&r||(h(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||h(this.getMinMax(!1))),n=(0,s.g)(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),o=(0,s.g)(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,a=this.max,r=(0,s.aI)(n,o,a);return this._unit=e.unit||(i.autoSkip?Hi(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(t,e,i,s,n){for(let o=Bi.length-1;o>=Bi.indexOf(i);o--){const i=Bi[o];if(Vi[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return Bi[i?Bi.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Bi.indexOf(t)+1,i=Bi.length;e1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+a);const p="data"===n.ticks.source&&this.getDataTimestamps();for(d=g,u=0;dt-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const o=this.options,a=o.time.displayFormats,r=this._unit,h=this._majorUnit,l=r&&a[r],c=h&&a[h],d=i[e],u=h&&c&&d&&d.major,g=this._adapter.format(t,n||(u?c:l)),p=o.ticks.callback;return p?(0,s.N)(p,[g,e,i],this):g}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t=t[h].pos&&e<=t[l].pos&&({lo:h,hi:l}=(0,s.x)(t,"pos",e)),({pos:n,time:a}=t[h]),({pos:o,time:r}=t[l])):(e>=t[h].time&&e<=t[l].time&&({lo:h,hi:l}=(0,s.x)(t,"time",e)),({time:n,pos:a}=t[h]),({time:o,pos:r}=t[l]));const c=o-n;return c?a+(r-a)*(e-n)/c:a}Ui.id="time",Ui.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Xi extends Ui{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Yi(e,this.min),this._tableRange=Yi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,h,l;for(o=0,a=t.length;o=e&&h<=i&&s.push(h);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=s.r.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const o="transparent",a={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=(0,s.c)(t||o),a=n.valid&&(0,s.c)(e||o);return a&&a.valid?a.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class r{constructor(t,e,i,n){const o=e[i];n=(0,s.a)([t.to,n,o,t.from]);const r=(0,s.a)([t.from,o,n]);this._active=!0,this._fn=t.fn||a[t.type||typeof r],this._easing=s.e[t.easing]||s.e.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=(0,s.a)([t.to,e,n,t.from]),this._from=(0,s.a)([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),s.d.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),s.d.describe("animations",{_fallback:"animation"}),s.d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class l{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,s.i)(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const n=t[i];if(!(0,s.i)(n))return;const o={};for(const t of h)o[t]=n[t];((0,s.b)(n.properties)&&n.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let n=0;n{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let h;for(h=o.length-1;h>=0;--h){const l=o[h];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const c=e[l];let d=n[l];const u=i.get(l);if(d){if(u&&d.active()){d.update(u,c,a);continue}d.cancel()}u&&u.duration?(n[l]=d=new r(u,t,l,c),s.push(d)):t[l]=c}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(n.add(this._chart,i),!0):void 0}}function c(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function d(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n0||!i&&e<0)return n.index}return null}function m(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,h=o.axis,l=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let g=0;gi[t].axis===e)).shift()}function b(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i]}}}const _=t=>"reset"===t||"none"===t,y=(t,e)=>e?t:Object.assign({},t);class v{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=g(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&b(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,o=e.xAxisID=(0,s.v)(i.xAxisID,x(t,"x")),a=e.yAxisID=(0,s.v)(i.yAxisID,x(t,"y")),r=e.rAxisID=(0,s.v)(i.rAxisID,x(t,"r")),h=e.indexAxis,l=e.iAxisID=n(h,o,a,r),c=e.vAxisID=n(h,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&(0,s.u)(this._data,this),t._stacked&&b(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,s.i)(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let s,n,o;for(s=0,n=e.length;s0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=(0,s.b)(n[t])?this.parseArrayData(i,n,t,e):(0,s.i)(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const o=()=>null===l[r]||u&&l[r]t&&!e.hidden&&e._stacked&&{keys:d(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let g,p;function f(){p=n[g];const e=p[r.axis];return!(0,s.g)(p[t.axis])||c>e||u=0;--g)if(!f()){this.updateRangeFromParsed(l,t,p,h);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,a;for(n=0,o=e.length;n=0&&tthis.getContext(i,n)),d);return p.$shared&&(p.$shared=h,o[a]=Object.freeze(y(p,h))),p}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const h=new l(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||_(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){_(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!_(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,r,h]of this._syncList)this[a](r,h);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;at-e)))}return t._cache.$bar}(e,t.type);let n,o,a,r,h=e._length;const l=()=>{32767!==a&&-32768!==a&&((0,s.j)(r)&&(h=Math.min(h,Math.abs(a-r)||h)),r=a)};for(n=0,o=i.length;nMath.abs(r)&&(h=r,l=a),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:n,end:o,min:a,max:r}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function k(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,h=[];let l,c,d,u;for(l=i,c=i+s;lt.x,i="left",s="right"):(e=t.base=i?1:-1)}(d,e,a)*o,u===a&&(m-=d/2),c=m+d),m===e.getPixelForValue(a)){const t=(0,s.s)(d)*e.getLineWidthForValue(a)/2;m+=t,d-=t}return{size:d,base:m,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,o=n.skipNull,a=(0,s.v)(n.maxBarThickness,1/0);let r,h;if(e.grouped){const i=o?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,n=this.getParsed(t),o=i.getLabelForValue(n.x),a=s.getLabelForValue(n.y),r=n._custom;return{label:e.label,value:"("+o+", "+a+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,r=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(r),l=this.includeOptions(s,h),c=o.axis,d=a.axis;for(let u=e;u""}}}};class O extends v{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let o,a,r=t=>+i[t];if((0,s.i)(i[t])){const{key:t="value"}=this._parsing;r=e=>+(0,s.f)(i[e],t)}for(o=t,a=t+e;o(0,s.p)(t,h,l,!0)?1:Math.max(e,e*i,n,n*i),f=(t,e,n)=>(0,s.p)(t,h,l,!0)?-1:Math.min(e,e*i,n,n*i),m=p(0,c,u),x=p(s.H,d,g),b=f(s.P,c,u),_=f(s.P+s.H,d,g);n=(m-b)/2,o=(x-_)/2,a=-(m+b)/2,r=-(x+_)/2}return{ratioX:n,ratioY:o,offsetX:a,offsetY:r}}(d,c,h),m=(i.width-a)/u,x=(i.height-a)/g,b=Math.max(Math.min(m,x)/2,0),_=(0,s.n)(this.options.radius,b),y=(_-Math.max(_*h,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=f*_,n.total=this.calculateTotal(),this.outerRadius=_-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/s.T)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,h=(a.left+a.right)/2,l=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,g=this.resolveDataElementOptions(e,s),p=this.getSharedOptions(g),f=this.includeOptions(s,p);let m,x=this._getRotation();for(m=0;m0&&!isNaN(t)?s.T*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=(0,s.o)(e._parsed[t],i.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s"spacing"!==t,_indexable:t=>"spacing"!==t},O.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return(0,s.b)(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class E extends v{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:h}=function(t,e,i){const n=e.length;let o=0,a=n;if(t._sorted){const{iScale:r,_parsed:h}=t,l=r.axis,{min:c,max:d,minDefined:u,maxDefined:g}=r.getUserBounds();u&&(o=(0,s.w)(Math.min((0,s.x)(h,r.axis,c).lo,i?n:(0,s.x)(e,l,r.getPixelForValue(c)).lo),0,n-1)),a=g?(0,s.w)(Math.max((0,s.x)(h,r.axis,d).hi+1,i?0:(0,s.x)(e,l,r.getPixelForValue(d)).hi+1),o,n)-o:n-o}return{start:o,count:a}}(e,n,a);this._drawStart=r,this._drawCount=h,function(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(e)&&(r=0,h=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:l},t),this.updateElements(n,r,h,t)}updateElements(t,e,i,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:h,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(c),u=this.includeOptions(n,d),g=a.axis,p=r.axis,{spanGaps:f,segment:m}=this.options,x=(0,s.q)(f)?f:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||"none"===n;let _=e>0&&this.getParsed(e-1);for(let y=e;y0&&i[g]-_[g]>x,m&&(c.parsed=i,c.raw=l.data[y]),u&&(c.options=d||this.resolveDataElementOptions(y,e.active?"active":n)),b||this.updateElement(e,y,c,n),_=i}this.updateSharedOptions(d,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}E.id="line",E.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},E.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class R extends v{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=(0,s.o)(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:o}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const o="reset"===n,a=this.chart,r=this.getDataset(),h=a.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,d=l.yCenter,u=l.getIndexAngle(0)-.5*s.P;let g,p=u;const f=360/this.countVisibleElements();for(g=0;g{!isNaN(t.data[s])&&this.chart.getDataVisibility(s)&&i++})),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?(0,s.t)(this.resolveDataElementOptions(t,e).angle||i):0}}R.id="polarArea",R.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},R.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class z extends O{}z.id="pie",z.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class F extends v{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this.getDataset(),o=this._cachedMeta.rScale,a="reset"===s;for(let r=e;r"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var V=Object.freeze({__proto__:null,BarController:L,BubbleController:T,DoughnutController:O,LineController:E,PolarAreaController:R,PieController:z,RadarController:F,ScatterController:I});function B(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class N{constructor(t){this.options=t||{}}formats(){return B()}parse(t,e){return B()}format(t,e){return B()}add(t,e,i){return B()}diff(t,e,i){return B()}startOf(t,e,i){return B()}endOf(t,e){return B()}}N.override=function(t){Object.assign(N.prototype,t)};var W={_date:N};function H(t,e){return"native"in t?{x:t.x,y:t.y}:(0,s.y)(t,e)}function j(t,e,i,n){const{controller:o,data:a,_sorted:r}=t,h=o._cachedMeta.iScale;if(h&&e===h.axis&&r&&a.length){const t=h._reversePixels?s.A:s.x;if(!n)return t(a,e,i);if(o._sharedOptions){const s=a[0],n="function"===typeof s.getRange&&s.getRange(e);if(n){const s=t(a,e,i-n),o=t(a,e,i+n);return{lo:s.lo,hi:o.hi}}}}return{lo:0,hi:a.length-1}}function $(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let r=0,h=o.length;r{t[r](n[a],s)&&o.push({element:t,datasetIndex:e,index:i}),t.inRange(n.x,n.y,s)&&(h=!0)})),i.intersect&&!h?[]:o}var K={modes:{index(t,e,i,s){const n=H(e,t),o=i.axis||"x",a=i.intersect?U(t,n,o,s):Y(t,n,o,!1,s),r=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&r.push({element:i,datasetIndex:t.index,index:e})})),r):[]},dataset(t,e,i,s){const n=H(e,t),o=i.axis||"xy";let a=i.intersect?U(t,n,o,s):Y(t,n,o,!1,s);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tU(t,H(e,t),i.axis||"xy",s),nearest:(t,e,i,s)=>Y(t,H(e,t),i.axis||"xy",i.intersect,s),x:(t,e,i,s)=>(i.axis="x",X(t,e,i,s)),y:(t,e,i,s)=>(i.axis="y",X(t,e,i,s))}};const q=["left","top","right","bottom"];function G(t,e){return t.filter((t=>t.pos===e))}function J(t,e){return t.filter((t=>-1===q.indexOf(t.pos)&&t.box.axis===e))}function Z(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Q(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!q.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function nt(t,e,i,s){const n=[];let o,a,r,h,l,c;for(o=0,a=t.length,l=0;ot.box.fullSize)),!0),s=Z(G(e,"left"),!0),n=Z(G(e,"right")),o=Z(G(e,"top"),!0),a=Z(G(e,"bottom")),r=J(e,"x"),h=J(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(a).concat(r),chartArea:G(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(a).concat(r)}}(t.boxes),l=h.vertical,c=h.horizontal;(0,s.C)(t.boxes,(t=>{"function"===typeof t.beforeLayout&&t.beforeLayout()}));const d=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:a,availableHeight:r,vBoxMaxWidth:a/2/d,hBoxMaxHeight:r/2}),g=Object.assign({},o);et(g,(0,s.B)(n));const p=Object.assign({maxPadding:g,w:a,h:r,x:o.left,y:o.top},o),f=Q(l.concat(c),u);nt(h.fullSize,p,u,f),nt(l,p,u,f),nt(c,p,u,f)&&nt(l,p,u,f),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),at(h.leftAndTop,p,u,f),p.x+=p.w,p.y+=p.h,at(h.rightAndBottom,p,u,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},(0,s.C)(h.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h)}))}};class ht{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class lt extends ht{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ct={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},dt=t=>null===t||""===t;const ut=!!s.I&&{passive:!0};function gt(t,e,i){t.canvas.removeEventListener(e,i,ut)}function pt(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{for(const e of t)for(const t of e.addedNodes)if(t===s||t.contains(s))return i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function ft(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{for(const e of t)for(const t of e.removedNodes)if(t===s||t.contains(s))return i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const mt=new Map;let xt=0;function bt(){const t=window.devicePixelRatio;t!==xt&&(xt=t,mt.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function _t(t,e,i){const n=t.canvas,o=n&&(0,s.E)(n);if(!o)return;const a=(0,s.G)(((t,e)=>{const s=o.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)}));return r.observe(o),function(t,e){mt.size||window.addEventListener("resize",bt),mt.set(t,e)}(t,a),r}function yt(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){mt.delete(t),mt.size||window.removeEventListener("resize",bt)}(t)}function vt(t,e,i){const n=t.canvas,o=(0,s.G)((e=>{null!==t.ctx&&i(function(t,e){const i=ct[t.type]||t.type,{x:n,y:o}=(0,s.y)(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==o?o:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,i){t.addEventListener(e,i,ut)}(n,e,o),o}class Mt extends ht{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",dt(o)){const e=(0,s.F)(t,"width");void 0!==e&&(t.width=e)}if(dt(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=(0,s.F)(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach((t=>{const n=i[t];(0,s.k)(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:pt,detach:ft,resize:_t}[e]||vt;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:yt,detach:yt,resize:yt}[e]||gt)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return(0,s.D)(t,e,i,n)}isAttached(t){const e=(0,s.E)(t);return!(!e||!e.isConnected)}}class wt{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,s.q)(this.x)&&(0,s.q)(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}wt.defaults={},wt.defaultRoutes=void 0;const kt={values:t=>(0,s.b)(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let o,a=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),a=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const r=(0,s.K)(Math.abs(a)),h=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:o,minimumFractionDigits:h,maximumFractionDigits:h};return Object.assign(l,this.options.ticks.format),(0,s.o)(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor((0,s.K)(t)));return 1===n||2===n||5===n?kt.numeric.call(this,t,e,i):""}};var St={formatters:kt};function Dt(t,e){const i=t.options.ticks,n=i.maxTicksLimit||function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),o=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;in)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;no)return t}return Math.max(o,1)}(o,e,n);if(a>0){let t,i;const n=a>1?Math.round((h-r)/(a-1)):null;for(Pt(e,l,c,(0,s.k)(n)?0:r-n,r),t=0,i=a-1;te.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:St.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.d.route("scale.ticks","color","","color"),s.d.route("scale.grid","color","","borderColor"),s.d.route("scale.grid","borderColor","","borderColor"),s.d.route("scale.title","color","","color"),s.d.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),s.d.describe("scales",{_fallback:"scale"}),s.d.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ct=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function At(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;oa+r)))return l}function Tt(t){return t.drawTicks?t.tickLength:0}function Ot(t,e){if(!t.display)return 0;const i=(0,s.Y)(t.font,e),n=(0,s.B)(t.padding);return((0,s.b)(t.text)?t.text.length:1)*i.lineHeight+n.height}function Et(t,e,i){let n=(0,s.Z)(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Rt extends wt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=(0,s.M)(t,Number.POSITIVE_INFINITY),e=(0,s.M)(e,Number.NEGATIVE_INFINITY),i=(0,s.M)(i,Number.POSITIVE_INFINITY),n=(0,s.M)(n,Number.NEGATIVE_INFINITY),{min:(0,s.M)(t,i),max:(0,s.M)(e,n),minDefined:(0,s.g)(t),maxDefined:(0,s.g)(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let s=0,h=r.length;sn?n:i,n=o&&i>n?i:n,{min:(0,s.M)(i,(0,s.M)(n,i)),max:(0,s.M)(n,(0,s.M)(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,s.N)(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=(0,s.O)(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=r=o||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,g=(0,s.w)(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),d+6>a&&(a=g/(i-(t.offset?.5:1)),r=this.maxHeight-Tt(t.grid)-e.padding-Ot(t.title,this.chart.options.font),h=Math.sqrt(d*d+u*u),l=(0,s.Q)(Math.min(Math.asin((0,s.w)((c.highest.height+6)/a,-1,1)),Math.asin((0,s.w)(r/h,-1,1))-Math.asin((0,s.w)(u/h,-1,1)))),l=Math.max(n,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){(0,s.N)(this.options.afterCalculateLabelRotation,[this])}beforeFit(){(0,s.N)(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const a=Ot(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Tt(o)+a):(t.height=this.maxHeight,t.width=Tt(o)+a),i.display&&this.ticks.length){const{first:e,last:n,widest:o,highest:a}=this._getLabelSizes(),h=2*i.padding,l=(0,s.t)(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(r){const e=i.mirror?0:d*o.width+c*a.height;t.height=Math.min(this.maxHeight,t.height+e+h)}else{const e=i.mirror?0:c*o.width+d*a.height;t.width=Math.min(this.maxWidth,t.width+e+h)}this._calculatePadding(e,n,d,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?h?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){(0,s.N)(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n({width:o[t]||0,height:a[t]||0});return{first:M(0),last:M(e-1),widest:M(y),highest:M(v),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return(0,s.S)(this._alignToPixels?(0,s.U)(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:h/n:h*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:a}=n,r=o.offset,h=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=Tt(o),d=[],u=o.setContext(this.getContext()),g=u.drawBorder?u.borderWidth:0,p=g/2,f=function(t){return(0,s.U)(i,t,g)};let m,x,b,_,y,v,M,w,k,S,D,P;if("top"===a)m=f(this.bottom),v=this.bottom-c,w=m-p,S=f(t.top)+p,P=t.bottom;else if("bottom"===a)m=f(this.top),S=t.top,P=f(t.bottom)-p,v=m+p,w=this.top+c;else if("left"===a)m=f(this.right),y=this.right-c,M=m-p,k=f(t.left)+p,D=t.right;else if("right"===a)m=f(this.left),k=t.left,D=f(t.right)-p,y=m+p,M=this.left+c;else if("x"===e){if("center"===a)m=f((t.top+t.bottom)/2+.5);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];m=f(this.chart.scales[t].getPixelForValue(e))}S=t.top,P=t.bottom,v=m+p,w=v+c}else if("y"===e){if("center"===a)m=f((t.left+t.right)/2);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];m=f(this.chart.scales[t].getPixelForValue(e))}y=m-p,M=y-c,k=t.left,D=t.right}const C=(0,s.v)(n.ticks.maxTicksLimit,l),A=Math.max(1,Math.ceil(l/C));for(x=0;xe.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n{const n=i.split("."),o=n.pop(),a=[t].concat(n).join("."),r=e[i].split("."),h=r.pop(),l=r.join(".");s.d.route(a,o,l,h)}))}(e,t.defaultRoutes);t.descriptors&&s.d.describe(e,t.descriptors)}(t,a,i),this.override&&s.d.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in s.d[n]&&(delete s.d[n][i],this.override&&delete s.a0[i])}}var Ft=new class{constructor(){this.controllers=new zt(v,"datasets",!0),this.elements=new zt(wt,"elements"),this.plugins=new zt(Object,"plugins"),this.scales=new zt(Rt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):(0,s.C)(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const n=(0,s.a2)(t);(0,s.N)(i["before"+n],[],i),e[t](i),(0,s.N)(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Vt(t,e){return e||!1!==t?!0===t?{}:t:null}function Bt(t,e,i,s){const n=t.pluginScopeKeys(e),o=t.getOptionScopes(i,n);return t.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Nt(t,e){const i=s.d.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Wt(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function Ht(t){const e=t.options||(t.options={});e.plugins=(0,s.v)(e.plugins,{}),e.scales=function(t,e){const i=s.a0[t.type]||{scales:{}},n=e.scales||{},o=Nt(t.type,e),a=Object.create(null),r=Object.create(null);return Object.keys(n).forEach((t=>{const e=n[t];if(!(0,s.i)(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const h=Wt(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(h,o),c=i.scales||{};a[h]=a[h]||t,r[t]=(0,s.a8)(Object.create(null),[{axis:h},e,c[h],c[l]])})),t.data.datasets.forEach((i=>{const o=i.type||t.type,h=i.indexAxis||Nt(o,e),l=(s.a0[o]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,h),o=i[e+"AxisID"]||a[e]||e;r[o]=r[o]||Object.create(null),(0,s.a8)(r[o],[{axis:e},n[o],l[t]])}))})),Object.keys(r).forEach((t=>{const e=r[t];(0,s.a8)(e,[s.d.scales[e.type],s.d.scale])})),r}(t,e)}function jt(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const $t=new Map,Ut=new Set;function Yt(t,e){let i=$t.get(t);return i||(i=e(),$t.set(t,i),Ut.add(i)),i}const Xt=(t,e,i)=>{const n=(0,s.f)(e,i);void 0!==n&&t.add(n)};class Kt{constructor(t){this._config=function(t){return(t=t||{}).data=jt(t.data),Ht(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=jt(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ht(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Yt(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Yt(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Yt(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Yt(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:n,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const h=new Set;e.forEach((e=>{t&&(h.add(t),e.forEach((e=>Xt(h,t,e)))),e.forEach((t=>Xt(h,n,t))),e.forEach((t=>Xt(h,s.a0[o]||{},t))),e.forEach((t=>Xt(h,s.d,t))),e.forEach((t=>Xt(h,s.a3,t)))}));const l=Array.from(h);return 0===l.length&&l.push(Object.create(null)),Ut.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,s.a0[e]||{},s.d.datasets[e]||{},{type:e},s.d,s.a3]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=qt(this._resolverCache,t,n);let h=a;if(function(t,e){const{isScriptable:i,isIndexable:n}=(0,s.a7)(t);for(const o of e){const e=i(o),a=n(o),r=(a||e)&&t[o];if(e&&((0,s.a4)(r)||Gt(r))||a&&(0,s.b)(r))return!0}return!1}(a,e)){o.$shared=!1,i=(0,s.a4)(i)?i():i;const e=this.createResolver(t,i,r);h=(0,s.a5)(a,i,e)}for(const s of e)o[s]=h[s];return o}createResolver(t,e,i=[""],n){const{resolver:o}=qt(this._resolverCache,t,i);return(0,s.i)(e)?(0,s.a5)(o,e,void 0,n):o}}function qt(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const o=i.join();let a=n.get(o);if(!a){a={resolver:(0,s.a6)(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(o,a)}return a}const Gt=t=>(0,s.i)(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||(0,s.a4)(t[i])),!1);const Jt=["top","bottom","left","right","chartArea"];function Zt(t,e){return"top"===t||"bottom"===t||-1===Jt.indexOf(t)&&"x"===e}function Qt(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function te(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),(0,s.N)(i&&i.onComplete,[t],e)}function ee(t){const e=t.chart,i=e.options.animation;(0,s.N)(i&&i.onProgress,[t],e)}function ie(t){return(0,s.J)()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const se={},ne=t=>{const e=ie(t);return Object.values(se).filter((t=>t.canvas===e)).pop()};class oe{constructor(t,e){const i=this.config=new Kt(e),o=ie(t),a=ne(o);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!(0,s.J)()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?lt:Mt}(o)),this.platform.updateConfig(i);const h=this.platform.acquireContext(o,r.aspectRatio),l=h&&h.canvas,c=l&&l.height,d=l&&l.width;this.id=(0,s.a9)(),this.ctx=h,this.canvas=l,this.width=d,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new It,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,s.aa)((t=>this.update(t)),r.resizeDelay||0),se[this.id]=this,h&&l?(n.listen(this,"complete",te),n.listen(this,"progress",ee),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return(0,s.k)(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,s.ab)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,s.ac)(this.canvas,this.ctx),this}stop(){return n.stop(this),this}resize(t,e){n.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),h=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,(0,s.ab)(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),(0,s.N)(i.onResize,[this,a],this),this.attached&&this._doResize(h)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};(0,s.C)(t,((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let o=[];e&&(o=o.concat(Object.keys(e).map((t=>{const i=e[t],s=Wt(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),(0,s.C)(o,(e=>{const o=e.options,a=o.id,r=Wt(a,o),h=(0,s.v)(o.type,e.dtype);void 0!==o.position&&Zt(o.position,r)===Zt(e.dposition)||(o.position=e.dposition),n[a]=!0;let l=null;if(a in i&&i[a].type===h)l=i[a];else{l=new(Ft.getScale(h))({id:a,type:h,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(o,t)})),(0,s.C)(n,((t,e)=>{t||delete i[e]})),(0,s.C)(i,(t=>{rt.configure(this,t,t.options),rt.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext());(0,s.C)(this.scales,(t=>{rt.removeBox(this,t)}));const n=this._animationsDisabled=!i.animation;this.ensureScalesHaveIDs(),this.buildOrUpdateScales();const o=new Set(Object.keys(this._listeners)),a=new Set(i.events);if((0,s.ad)(o,a)&&!!this._responsiveListeners===i.responsive||(this.unbindEvents(),this.bindEvents()),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let h=0;for(let s=0,l=this.data.datasets.length;s{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Qt("z","_idx")),this._lastEvent&&this._eventHandler(this._lastEvent,!0),this.render()}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;rt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,s.C)(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,o=this.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(n&&(0,s.V)(e,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?this.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&(0,s.X)(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}getElementsAtEventForMode(t,e,i,s){const n=K.modes[e];return"function"===typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=(0,s.h)(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);(0,s.j)(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),n.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};(0,s.C)(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){(0,s.C)(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},(0,s.C)(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!(0,s.ae)(i,e)&&(this._active=i,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e){const{_active:i=[],options:n}=this,o=n.hover,a=e;let r=[],h=!1,l=null;return"mouseout"!==t.type&&(r=this.getElementsAtEventForMode(t,o.mode,o,a),l="click"===t.type?this._lastEvent:t),this._lastEvent=null,(0,s.z)(t,this.chartArea,this._minPadding)&&((0,s.N)(n.onHover,[t,r,this],this),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||(0,s.N)(n.onClick,[t,r,this],this)),h=!(0,s.ae)(r,i),(h||e)&&(this._active=r,this._updateHoverStyles(r,i,e)),this._lastEvent=l,h}}const ae=()=>(0,s.C)(oe.instances,(t=>t._plugins.invalidate())),re=!0;function he(t,e,i){const{startAngle:n,pixelMargin:o,x:a,y:r,outerRadius:h,innerRadius:l}=e;let c=o/h;t.beginPath(),t.arc(a,r,h,n-c,i+c),l>o?(c=o/l,t.arc(a,r,l,i+c,n-c,!0)):t.arc(a,r,o,i+s.H,n-s.H),t.closePath(),t.clip()}function le(t,e,i,n){const o=(a=t.options.borderRadius,(0,s.ag)(a,["outerStart","outerEnd","innerStart","innerEnd"]));var a;const r=(i-e)/2,h=Math.min(r,n*e/2),l=t=>{const e=(i-Math.min(r,t))*n/2;return(0,s.w)(t,0,Math.min(r,e))};return{outerStart:l(o.outerStart),outerEnd:l(o.outerEnd),innerStart:(0,s.w)(o.innerStart,0,h),innerEnd:(0,s.w)(o.innerEnd,0,h)}}function ce(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function de(t,e,i,n,o){const{x:a,y:r,startAngle:h,pixelMargin:l,innerRadius:c}=e,d=Math.max(e.outerRadius+n+i-l,0),u=c>0?c+n+i+l:0;let g=0;const p=o-h;if(n){const t=((c>0?c-n:0)+(d>0?d-n:0))/2;g=(p-(0!==t?p*t/(t+n):p))/2}const f=(p-Math.max(.001,p*d-i/s.P)/d)/2,m=h+f+g,x=o-f-g,{outerStart:b,outerEnd:_,innerStart:y,innerEnd:v}=le(e,u,d,x-m),M=d-b,w=d-_,k=m+b/M,S=x-_/w,D=u+y,P=u+v,C=m+y/D,A=x-v/P;if(t.beginPath(),t.arc(a,r,d,k,S),_>0){const e=ce(w,S,a,r);t.arc(e.x,e.y,_,S,x+s.H)}const L=ce(P,x,a,r);if(t.lineTo(L.x,L.y),v>0){const e=ce(P,A,a,r);t.arc(e.x,e.y,v,x+s.H,A+Math.PI)}if(t.arc(a,r,u,x-v/u,m+y/u,!0),y>0){const e=ce(D,C,a,r);t.arc(e.x,e.y,y,C+Math.PI,m-s.H)}const T=ce(M,m,a,r);if(t.lineTo(T.x,T.y),b>0){const e=ce(M,k,a,r);t.arc(e.x,e.y,b,m-s.H,k)}t.closePath()}function ue(t,e,i,n,o){const{options:a}=e,r="inner"===a.borderAlign;a.borderWidth&&(r?(t.lineWidth=2*a.borderWidth,t.lineJoin="round"):(t.lineWidth=a.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,i){const{x:n,y:o,startAngle:a,pixelMargin:r,fullCircles:h}=e,l=Math.max(e.outerRadius-r,0),c=e.innerRadius+r;let d;for(i&&he(t,e,a+s.T),t.beginPath(),t.arc(n,o,c,a+s.T,a,!0),d=0;d{Ft.add(...t),ae()}},unregister:{enumerable:re,value:(...t)=>{Ft.remove(...t),ae()}}});class ge extends wt{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:o,distance:a}=(0,s.af)(n,{x:t,y:e}),{startAngle:r,endAngle:h,innerRadius:l,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2;return(d>=s.T||(0,s.p)(o,r,h))&&(a>=l+u&&a<=c+u)}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:h}=this.options,l=(s+n)/2,c=(o+a+h+r)/2;return{x:e+Math.cos(l)*c,y:i+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,o=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>s.T?Math.floor(i/s.T):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=s.P&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const r=function(t,e,i,n){const{fullCircles:o,startAngle:a,circumference:r}=e;let h=e.endAngle;if(o){de(t,e,i,n,a+s.T);for(let e=0;er&&o>r;return{count:s,start:h,loop:e.loop,ilen:l(a+(l?r-t:t))%o,_=()=>{g!==p&&(t.lineTo(m,p),t.lineTo(m,g),t.lineTo(m,f))};for(h&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(ip&&(p=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,g=p=i),f=i}_()}function _e(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i?be:xe}ge.id="arc",ge.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ge.defaultRoutes={backgroundColor:"backgroundColor"};const ye="function"===typeof Path2D;function ve(t,e,i,s){ye&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),pe(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=_e(e);for(const r of n)pe(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class Me extends wt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;(0,s.ah)(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=(0,s.ai)(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,a=(0,s.aj)(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],h=function(t){return t.stepped?s.ak:t.tension||"monotone"===t.cubicInterpolationMode?s.al:s.am}(i);let l,c;for(l=0,c=a.length;l"borderDash"!==t&&"fill"!==t};class ke extends wt{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)=a.left&&e<=a.right)&&(o||i>=a.top&&i<=a.bottom)}function Ae(t,e){t.rect(e.x,e.y,e.w,e.h)}function Le(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+a,radius:t.radius}}ke.id="point",ke.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},ke.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Te extends wt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:o,outer:a}=Pe(this),r=(h=a.radius).topLeft||h.topRight||h.bottomLeft||h.bottomRight?s.aq:Ae;var h;t.save(),a.w===o.w&&a.h===o.h||(t.beginPath(),r(t,Le(a,e,o)),t.clip(),r(t,Le(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Le(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return Ce(this,t,e,i)}inXRange(t,e){return Ce(this,t,null,e)}inYRange(t,e){return Ce(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Te.id="bar",Te.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Te.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Oe=Object.freeze({__proto__:null,ArcElement:ge,LineElement:Me,PointElement:ke,BarElement:Te});function Ee(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function Re(t){t.data.datasets.forEach((t=>{Ee(t)}))}var ze={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Re(t);const n=t.width;t.data.datasets.forEach(((e,o)=>{const{_data:a,indexAxis:r}=e,h=t.getDatasetMeta(o),l=a||e.data;if("y"===(0,s.a)([r,t.options.indexAxis]))return;if("line"!==h.type)return;const c=t.scales[h.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:d,count:u}=function(t,e){const i=e.length;let n,o=0;const{iScale:a}=t,{min:r,max:h,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(o=(0,s.w)((0,s.x)(e,a.axis,r).lo,0,i-1)),n=c?(0,s.w)((0,s.x)(e,a.axis,h).hi+1,o,i)-o:i-o,{start:o,count:n}}(h,l);if(u<=(i.threshold||4*n))return void Ee(e);let g;switch((0,s.k)(a)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":g=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let h=0;const l=e+i-1;let c,d,u,g,p,f=e;for(a[h++]=t[f],c=0;cu&&(u=g,d=t[s],p=s);a[h++]=d,f=p}return a[h++]=t[l],a}(l,d,u,n,i);break;case"min-max":g=function(t,e,i,n){let o,a,r,h,l,c,d,u,g,p,f=0,m=0;const x=[],b=e+i-1,_=t[e].x,y=t[b].x-_;for(o=e;op&&(p=h,d=o),f=(m*f+a.x)/++m;else{const i=o-1;if(!(0,s.k)(c)&&!(0,s.k)(d)){const e=Math.min(c,d),s=Math.max(c,d);e!==u&&e!==i&&x.push({...t[e],x:f}),s!==u&&s!==i&&x.push({...t[s],x:f})}o>0&&i!==u&&x.push(t[i]),x.push(a),l=e,m=0,g=p=h,c=d=u=o}}return x}(l,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=g}))},destroy(t){Re(t)}};function Fe(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=(0,s.v)(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if((0,s.i)(n))return!isNaN(n.value)&&n;let o=parseFloat(n);return(0,s.g)(o)&&Math.floor(o)===o?("-"!==n[0]&&"+"!==n[0]||(o=e+o),!(o===e||o<0||o>=i)&&o):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}class Ie{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:a}=this;return e=e||{start:0,end:s.T},t.arc(n,o,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function Ve(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,n=e.options,o=e.getLabels().length,a=[],r=n.reverse?e.max:e.min,h=n.reverse?e.min:e.max;let l,c,d;if(d="start"===i?r:"end"===i?h:(0,s.i)(i)?i.value:e.getBaseValue(),n.grid.circular)return c=e.getPointPositionForValue(0,r),new Ie({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(d)});for(l=0;lt;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Ne(t,e,i){const s=[];for(let n=0;n=e&&n<=s){r=n===e,h=n===s;break}}return{first:r,last:h,point:s}}function He(t){const{chart:e,fill:i,line:n}=t;if((0,s.g)(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let n=0;n{e=Be(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(t,e),i.length?new Me({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function $e(t,e,i){let n=t[e].fill;const o=[e];let a;if(!i)return n;for(;!1!==n&&-1===o.indexOf(n);){if(!(0,s.g)(n))return n;if(a=t[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function Ue(t,e,i){t.beginPath(),e.path(t),t.lineTo(e.last().x,i),t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Ye(t,e,i,n){if(n)return;let o=e[t],a=i[t];return"angle"===t&&(o=(0,s.au)(o),a=(0,s.au)(a)),{property:t,start:o,end:a}}function Xe(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function Ke(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:o,start:a,end:r}=i||{};"x"===o&&(t.beginPath(),t.rect(a,s,r-a,n-s),t.clip())}function qe(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}function Ge(t,e){const{line:i,target:n,property:o,color:a,scale:r}=e,h=function(t,e,i){const n=t.segments,o=t.points,a=e.points,r=[];for(const h of n){let{start:t,end:n}=h;n=Be(t,n,o);const l=Ye(i,o[t],o[n],h.loop);if(!e.segments){r.push({source:h,target:l,start:o[t],end:o[n]});continue}const c=(0,s.aj)(e,l);for(const e of c){const t=Ye(i,a[e.start],a[e.end],e.loop),n=(0,s.at)(h,o,t);for(const s of n)r.push({source:s,target:e,start:{[i]:Xe(l,t,"start",Math.max)},end:{[i]:Xe(l,t,"end",Math.min)}})}}return r}(i,n,o);for(const{source:s,target:l,start:c,end:d}of h){const{style:{backgroundColor:e=a}={}}=s,h=!0!==n;t.save(),t.fillStyle=e,Ke(t,r,h&&Ye(o,c,d)),t.beginPath();const u=!!i.pathSegment(t,s);let g;if(h){u?t.closePath():qe(t,n,d,o);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});g=u&&e,g||qe(t,n,c,o)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function Je(t,e,i){const n=He(e),{line:o,scale:a,axis:r}=e,h=o.options,l=h.fill,c=h.backgroundColor,{above:d=c,below:u=c}=l||{};n&&o.points.length&&((0,s.V)(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r}=e,h=i._loop?"angle":e.axis;t.save(),"x"===h&&o!==n&&(Ue(t,s,a.top),Ge(t,{line:i,target:s,color:n,scale:r,property:h}),t.restore(),t.save(),Ue(t,s,a.bottom)),Ge(t,{line:i,target:s,color:o,scale:r,property:h}),t.restore()}(t,{line:o,target:n,above:d,below:u,area:i,scale:a,axis:r}),(0,s.X)(t))}var Ze={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,h;for(a=0;a=0;--a){const e=n[a].$filler;e&&(e.line.updateControlPoints(o,e.axis),s&&Je(t.ctx,e,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const e=s[n].$filler;e&&Je(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;s&&!1!==s.fill&&"beforeDatasetDraw"===i.drawTime&&Je(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Qe=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class ti extends wt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=(0,s.N)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=(0,s.Y)(i.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:h}=Qe(i,o);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(a,o,r,h)+10):(c=this.maxHeight,l=this._fitCols(a,o,r,h)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],h=this.lineWidths=[0],l=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-l;return this.legendItems.forEach(((t,g)=>{const p=i+e/2+n.measureText(t.text).width;(0===g||h[h.length-1]+p+2*a>o)&&(c+=l,h[h.length-(g>0?0:1)]=0,u+=l,d++),r[g]={left:0,top:u,row:d,width:p,height:s},h[h.length-1]+=p+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],h=this.columnSizes=[],l=o-t;let c=a,d=0,u=0,g=0,p=0;return this.legendItems.forEach(((t,o)=>{const f=i+e/2+n.measureText(t.text).width;o>0&&u+s+2*a>l&&(c+=d+a,h.push({width:d,height:u}),g+=d+a,p++,d=u=0),r[o]={left:g,top:u,col:p,width:f,height:s},d=Math.max(d,f),u+=s+a})),c+=d,h.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,a=(0,s.av)(o,this.left,this.width);if(this.isHorizontal()){let o=0,r=(0,s.$)(i,this.left+n,this.right-this.lineWidths[o]);for(const h of e)o!==h.row&&(o=h.row,r=(0,s.$)(i,this.left+n,this.right-this.lineWidths[o])),h.top+=this.top+t+n,h.left=a.leftForLtr(a.x(r),h.width),r+=h.width+n}else{let o=0,r=(0,s.$)(i,this.top+t+n,this.bottom-this.columnSizes[o].height);for(const h of e)h.col!==o&&(o=h.col,r=(0,s.$)(i,this.top+t+n,this.bottom-this.columnSizes[o].height)),h.top=r,h.left+=this.left+n,h.left=a.leftForLtr(a.x(h.left),h.width),r+=h.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;(0,s.V)(t,this),this._draw(),(0,s.X)(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:a}=t,r=s.d.color,h=(0,s.av)(t.rtl,this.left,this.width),l=(0,s.Y)(a.font),{color:c,padding:d}=a,u=l.size,g=u/2;let p;this.drawTitle(),n.textAlign=h.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:m,itemHeight:x}=Qe(a,u),b=this.isHorizontal(),_=this._computeTitleHeight();p=b?{x:(0,s.$)(o,this.left+d,this.right-i[0]),y:this.top+d+_,line:0}:{x:this.left+d,y:(0,s.$)(o,this.top+_+d,this.bottom-e[0].height),line:0},(0,s.aw)(this.ctx,t.textDirection);const y=x+d;this.legendItems.forEach(((v,M)=>{n.strokeStyle=v.fontColor||c,n.fillStyle=v.fontColor||c;const w=n.measureText(v.text).width,k=h.textAlign(v.textAlign||(v.textAlign=a.textAlign)),S=f+g+w;let D=p.x,P=p.y;h.setWidth(this.width),b?M>0&&D+S+d>this.right&&(P=p.y+=y,p.line++,D=p.x=(0,s.$)(o,this.left+d,this.right-i[p.line])):M>0&&P+y>this.bottom&&(D=p.x=D+e[p.line].width+d,p.line++,P=p.y=(0,s.$)(o,this.top+_+d,this.bottom-e[p.line].height));!function(t,e,i){if(isNaN(f)||f<=0||isNaN(m)||m<0)return;n.save();const o=(0,s.v)(i.lineWidth,1);if(n.fillStyle=(0,s.v)(i.fillStyle,r),n.lineCap=(0,s.v)(i.lineCap,"butt"),n.lineDashOffset=(0,s.v)(i.lineDashOffset,0),n.lineJoin=(0,s.v)(i.lineJoin,"miter"),n.lineWidth=o,n.strokeStyle=(0,s.v)(i.strokeStyle,r),n.setLineDash((0,s.v)(i.lineDash,[])),a.usePointStyle){const a={radius:f*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:o},r=h.xPlus(t,f/2),l=e+g;(0,s.ap)(n,a,r,l)}else{const a=e+Math.max((u-m)/2,0),r=h.leftForLtr(t,f),l=(0,s.as)(i.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?(0,s.aq)(n,{x:r,y:a,w:f,h:m,radius:l}):n.rect(r,a,f,m),n.fill(),0!==o&&n.stroke()}n.restore()}(h.x(D),P,v),D=(0,s.ax)(k,D+f+g,b?D+S:this.right,t.rtl),function(t,e,i){(0,s.W)(n,i.text,t,e+x/2,l,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})}(h.x(D),P,v),b?p.x+=S+d:p.y+=y})),(0,s.ay)(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=(0,s.Y)(e.font),n=(0,s.B)(e.padding);if(!e.display)return;const o=(0,s.av)(t.rtl,this.left,this.width),a=this.ctx,r=e.position,h=i.size/2,l=n.top+h;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+l,d=(0,s.$)(t.align,d,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+(0,s.$)(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const g=(0,s.$)(r,d,d+u);a.textAlign=o.textAlign((0,s.Z)(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,(0,s.W)(a,e.text,g,c,i)}_computeTitleHeight(){const t=this.options.title,e=(0,s.Y)(t.font),i=(0,s.B)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom)for(n=this.legendHitBoxes,i=0;i=s.left&&t<=s.left+s.width&&e>=s.top&&e<=s.top+s.height)return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if("mousemove"===t&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const a=this._hoveredItem,r=(o=i,null!==(n=a)&&null!==o&&n.datasetIndex===o.datasetIndex&&n.index===o.index);a&&!r&&(0,s.N)(e.onLeave,[t,a,this],this),this._hoveredItem=i,i&&!r&&(0,s.N)(e.onHover,[t,i,this],this)}else i&&(0,s.N)(e.onClick,[t,i,this],this);var n,o}}var ei={id:"legend",_element:ti,start(t,e,i){const s=t.legend=new ti({ctx:t.ctx,options:i,chart:t});rt.configure(t,s,i),rt.addBox(t,s)},stop(t){rt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;rt.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:o,color:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const r=t.controller.getStyle(i?0:void 0),h=(0,s.B)(r.borderWidth);return{text:e[t.index].label,fillStyle:r.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:r.borderColor,pointStyle:n||r.pointStyle,rotation:r.rotation,textAlign:o||r.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class ii extends wt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=(0,s.b)(i.text)?i.text.length:1;this._padding=(0,s.B)(i.padding);const o=n*(0,s.Y)(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:a}=this,r=a.align;let h,l,c,d=0;return this.isHorizontal()?(l=(0,s.$)(r,i,o),c=e+t,h=o-i):("left"===a.position?(l=i+t,c=(0,s.$)(r,n,e),d=-.5*s.P):(l=o-t,c=(0,s.$)(r,e,n),d=.5*s.P),h=n-e),{titleX:l,titleY:c,maxWidth:h,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=(0,s.Y)(e.font),n=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:h}=this._drawArgs(n);(0,s.W)(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:h,textAlign:(0,s.Z)(e.align),textBaseline:"middle",translation:[o,a]})}}var si={id:"title",_element:ii,start(t,e,i){!function(t,e){const i=new ii({ctx:t.ctx,options:e,chart:t});rt.configure(t,i,e),rt.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;rt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;rt.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ni=new WeakMap;var oi={id:"subtitle",start(t,e,i){const s=new ii({ctx:t.ctx,options:i,chart:t});rt.configure(t,s,i),rt.addBox(t,s),ni.set(t,s)},stop(t){rt.removeBox(t,ni.get(t)),ni.delete(t)},beforeUpdate(t,e,i){const s=ni.get(t);rt.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ai={average(t){if(!t.length)return!1;let e,i,s=0,n=0,o=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function li(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function ci(t,e){const i=t._chart.ctx,{body:n,footer:o,title:a}=t,{boxWidth:r,boxHeight:h}=e,l=(0,s.Y)(e.bodyFont),c=(0,s.Y)(e.titleFont),d=(0,s.Y)(e.footerFont),u=a.length,g=o.length,p=n.length,f=(0,s.B)(e.padding);let m=f.height,x=0,b=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){m+=p*(e.displayColors?Math.max(h,l.lineHeight):l.lineHeight)+(b-p)*l.lineHeight+(b-1)*e.bodySpacing}g&&(m+=e.footerMarginTop+g*d.lineHeight+(g-1)*e.footerSpacing);let _=0;const y=function(t){x=Math.max(x,i.measureText(t).width+_)};return i.save(),i.font=c.string,(0,s.C)(t.title,y),i.font=l.string,(0,s.C)(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?r+2+e.boxPadding:0,(0,s.C)(n,(t=>{(0,s.C)(t.before,y),(0,s.C)(t.lines,y),(0,s.C)(t.after,y)})),_=0,i.font=d.string,(0,s.C)(t.footer,y),i.restore(),x+=f.width,{width:x,height:m}}function di(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:h}}=t;let l="center";return"center"===s?l=n<=(r+h)/2?"left":"right":n<=o/2?l="left":n>=a-o/2&&(l="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(l,t,e,i)&&(l="center"),l}function ui(t,e,i){const s=e.yAlign||function(t,e){const{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}(t,i);return{xAlign:e.xAlign||di(t,e,i,s),yAlign:s}}function gi(t,e,i,n){const{caretSize:o,caretPadding:a,cornerRadius:r}=t,{xAlign:h,yAlign:l}=i,c=o+a,{topLeft:d,topRight:u,bottomLeft:g,bottomRight:p}=(0,s.as)(r);let f=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,h);const m=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,c);return"center"===l?"left"===h?f+=c:"right"===h&&(f-=c):"left"===h?f-=Math.max(d,g)+a:"right"===h&&(f+=Math.max(u,p)+a),{x:(0,s.w)(f,0,n.width-e.width),y:(0,s.w)(m,0,n.height-e.height)}}function pi(t,e,i){const n=(0,s.B)(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function fi(t){return ri([],hi(t))}function mi(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class xi extends wt{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this._chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new l(this._chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this._chart.getContext(),e=this,i=this._tooltipItems,(0,s.h)(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=ri(a,hi(s)),a=ri(a,hi(n)),a=ri(a,hi(o)),a}getBeforeBody(t,e){return fi(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return(0,s.C)(t,(t=>{const e={before:[],lines:[],after:[]},s=mi(i,t);ri(e.before,hi(s.beforeLabel.call(this,t))),ri(e.lines,s.label.call(this,t)),ri(e.after,hi(s.afterLabel.call(this,t))),n.push(e)})),n}getAfterBody(t,e){return fi(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=ri(a,hi(s)),a=ri(a,hi(n)),a=ri(a,hi(o)),a}_createItems(t){const e=this._active,i=this._chart.data,n=[],o=[],a=[];let r,h,l=[];for(r=0,h=e.length;rt.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),(0,s.C)(l,(e=>{const i=mi(t.callbacks,e);n.push(i.labelColor.call(this,e)),o.push(i.labelPointStyle.call(this,e)),a.push(i.labelTextColor.call(this,e))})),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=ai[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=ci(this,i),a=Object.assign({},t,e),r=ui(this._chart,i,a),h=gi(i,a,r,this._chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this._chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:h,topRight:l,bottomLeft:c,bottomRight:d}=(0,s.as)(r),{x:u,y:g}=t,{width:p,height:f}=e;let m,x,b,_,y,v;return"center"===o?(y=g+f/2,"left"===n?(m=u,x=m-a,_=y+a,v=y-a):(m=u+p,x=m+a,_=y-a,v=y+a),b=m):(x="left"===n?u+Math.max(h,c)+a:"right"===n?u+p-Math.max(l,d)-a:this.caretX,"top"===o?(_=g,y=_-a,m=x-a,b=x+a):(_=g+f,y=_+a,m=x+a,b=x-a),v=_),{x1:m,x2:x,x3:b,y1:_,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,o=n.length;let a,r,h;if(o){const l=(0,s.av)(i.rtl,this.x,this.width);for(t.x=pi(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,s.Y)(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,h=0;h0!==t))?(t.beginPath(),t.fillStyle=o.multiKeyBackground,(0,s.aq)(t,{x:e,y:f,w:l,h:h,radius:r}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),(0,s.aq)(t,{x:i,y:f+1,w:l-2,h:h-2,radius:r}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,f,l,h),t.strokeRect(e,f,l,h),t.fillStyle=a.backgroundColor,t.fillRect(i,f+1,l-2,h-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:h,boxWidth:l,boxPadding:c}=i,d=(0,s.Y)(i.bodyFont);let u=d.lineHeight,g=0;const p=(0,s.av)(i.rtl,this.x,this.width),f=function(i){e.fillText(i,p.x(t.x+g),t.y+u/2),t.y+=u+o},m=p.textAlign(a);let x,b,_,y,v,M,w;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=pi(this,m,i),e.fillStyle=i.bodyColor,(0,s.C)(this.beforeBody,f),g=r&&"right"!==m?"center"===a?l/2+c:l+2+c:0,y=0,M=n.length;y0&&e.stroke()}_updateAnimationTarget(t){const e=this._chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=ai[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=ci(this,t),a=Object.assign({},i,this._size),r=ui(e,t,a),h=gi(t,a,r,e);s._to===h.x&&n._to===h.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=(0,s.B)(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),(0,s.aw)(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),(0,s.ay)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map((({datasetIndex:t,index:e})=>{const i=this._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),o=!(0,s.ae)(i,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this.update(!0))}handleEvent(t,e){const i=this.options,n=this._active||[];let o=!1,a=[];"mouseout"!==t.type&&(a=this._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&a.reverse());const r=this._positionChanged(a,t);return o=e||!(0,s.ae)(a,n)||r,o&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=ai[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}xi.positioners=ai;var bi={id:"tooltip",_element:xi,positioners:ai,afterInit(t,e,i){i&&(t.tooltip=new xi({_chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:s.az,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},_i=Object.freeze({__proto__:null,Decimation:ze,Filler:Ze,Legend:ei,SubTitle:oi,Title:si,Tooltip:bi});function yi(t,e,i){const s=t.indexOf(e);if(-1===s)return((t,e,i)=>"string"===typeof e?t.push(e)-1:isNaN(e)?null:i)(t,e,i);return s!==t.lastIndexOf(e)?i:s}class vi extends Rt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if((0,s.k)(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:(0,s.w)(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:yi(i,t,(0,s.v)(e,t)),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Mi(t,e,{horizontal:i,minRotation:n}){const o=(0,s.t)(n),a=(i?Math.sin(o):Math.cos(o))||.001,r=.75*e*(""+t).length;return Math.min(e/a,r)}vi.id="category",vi.defaults={ticks:{callback:vi.prototype.getLabelForValue}};class wi extends Rt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return(0,s.k)(t)||("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const a=t=>n=e?n:t,r=t=>o=i?o:t;if(t){const t=(0,s.s)(n),e=(0,s.s)(o);t<0&&e<0?r(0):t>0&&e>0&&a(0)}if(n===o){let e=1;(o>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*o)),r(o+e),t||a(n-e)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:o,min:a,max:r,precision:h,count:l,maxTicks:c,maxDigits:d,includeBounds:u}=t,g=o||1,p=c-1,{min:f,max:m}=e,x=!(0,s.k)(a),b=!(0,s.k)(r),_=!(0,s.k)(l),y=(m-f)/(d+1);let v,M,w,k,S=(0,s.aC)((m-f)/p/g)*g;if(S<1e-14&&!x&&!b)return[{value:f},{value:m}];k=Math.ceil(m/S)-Math.floor(f/S),k>p&&(S=(0,s.aC)(k*S/p/g)*g),(0,s.k)(h)||(v=Math.pow(10,h),S=Math.ceil(S*v)/v),"ticks"===n?(M=Math.floor(f/S)*S,w=Math.ceil(m/S)*S):(M=f,w=m),x&&b&&o&&(0,s.aD)((r-a)/o,S/1e3)?(k=Math.round(Math.min((r-a)/S,c)),S=(r-a)/k,M=a,w=r):_?(M=x?a:M,w=b?r:w,k=l-1,S=(w-M)/k):(k=(w-M)/S,k=(0,s.aE)(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const D=Math.max((0,s.aF)(S),(0,s.aF)(M));v=Math.pow(10,(0,s.k)(h)?D:h),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let P=0;for(x&&(u&&M!==a?(i.push({value:a}),M0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,s.g)(t)?Math.max(0,t):null,this.max=(0,s.g)(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const o=e=>i=t?i:e,a=t=>n=e?n:t,r=(t,e)=>Math.pow(10,Math.floor((0,s.K)(t))+e);i===n&&(i<=0?(o(1),a(10)):(o(r(i,-1)),a(r(n,1)))),i<=0&&o(r(n,-1)),n<=0&&a(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&o(r(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor((0,s.K)(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),o=[];let a=(0,s.M)(t.min,Math.pow(10,Math.floor((0,s.K)(e.min)))),r=Math.floor((0,s.K)(a)),h=Math.floor(a/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{o.push({value:a,major:Si(a)}),++h,10===h&&(h=1,++r,l=r>=0?1:l),a=Math.round(h*Math.pow(10,r)*l)/l}while(rn?{start:e-i,end:e}:{start:e,end:e+i}}function Ai(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},i={},n=[],o=[],a=t.getLabels().length;for(let c=0;ce.r&&(e.r=m.end,i.r=p),x.starte.b&&(e.b=x.end,i.b=p)}var r,h,l;t._setReductions(t.drawingArea,e,i),t._pointLabelItems=function(t,e,i){const n=[],o=t.getLabels().length,a=t.options,r=Pi(a),h=t.getDistanceFromCenterForValue(a.ticks.reverse?t.min:t.max);for(let l=0;l270||i<90)&&(t-=e),t}function Ei(t,e,i,n){const{ctx:o}=t;if(i)o.arc(t.xCenter,t.yCenter,e,0,s.T);else{let i=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(let s=1;s{const i=(0,s.N)(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}))}fit(){const t=this.options;t.display&&t.pointLabels.display?Ai(this):this.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){let s=e.l/Math.sin(i.l),n=Math.max(e.r-this.width,0)/Math.sin(i.r),o=-e.t/Math.cos(i.t),a=-Math.max(e.b-(this.height-this.paddingTop),0)/Math.cos(i.b);s=Ri(s),n=Ri(n),o=Ri(o),a=Ri(a),this.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(s+n)/2),Math.floor(t-(o+a)/2))),this.setCenterPoint(s,n,o,a)}setCenterPoint(t,e,i,s){const n=this.width-e-this.drawingArea,o=t+this.drawingArea,a=i+this.drawingArea,r=this.height-this.paddingTop-s-this.drawingArea;this.xCenter=Math.floor((o+n)/2+this.left),this.yCenter=Math.floor((a+r)/2+this.top+this.paddingTop)}getIndexAngle(t){const e=s.T/this.getLabels().length,i=this.options.startAngle||0;return(0,s.au)(t*e+(0,s.t)(i))}getDistanceFromCenterForValue(t){if((0,s.k)(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if((0,s.k)(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;o--){const e=n.setContext(t.getPointLabelContext(o)),a=(0,s.Y)(e.font),{x:r,y:h,textAlign:l,left:c,top:d,right:u,bottom:g}=t._pointLabelItems[o],{backdropColor:p}=e;if(!(0,s.k)(p)){const t=(0,s.B)(e.backdropPadding);i.fillStyle=p,i.fillRect(c-t.left,d-t.top,u-c+t.width,g-d+t.height)}(0,s.W)(i,t._pointLabels[o],r,h+a.lineHeight/2,a,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e){r=this.getDistanceFromCenterForValue(t.value);!function(t,e,i,s){const n=t.ctx,o=e.circular,{color:a,lineWidth:r}=e;!o&&!s||!a||!r||i<0||(n.save(),n.strokeStyle=a,n.lineWidth=r,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),Ei(t,i,o,s),n.closePath(),n.stroke(),n.restore())}(this,n.setContext(this.getContext(e-1)),r,o)}})),i.display){for(t.save(),a=this.getLabels().length-1;a>=0;a--){const s=i.setContext(this.getPointLabelContext(a)),{color:n,lineWidth:o}=s;o&&n&&(t.lineWidth=o,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),h=this.getPointPosition(a,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(h.x,h.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((n,r)=>{if(0===r&&!e.reverse)return;const h=i.setContext(this.getContext(r)),l=(0,s.Y)(h.font);if(o=this.getDistanceFromCenterForValue(this.ticks[r].value),h.showLabelBackdrop){t.font=l.string,a=t.measureText(n.label).width,t.fillStyle=h.backdropColor;const e=(0,s.B)(h.backdropPadding);t.fillRect(-a/2-e.left,-o-l.size/2-e.top,a+e.width,l.size+e.height)}(0,s.W)(t,n.label,0,-o,l,{color:h.color})})),t.restore()}drawTitle(){}}zi.id="radialLinear",zi.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:St.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},zi.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},zi.descriptors={angleLines:{_fallback:"grid"}};const Fi={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}},Ii=Object.keys(Fi);function Vi(t,e){return t-e}function Bi(t,e){if((0,s.k)(e))return null;const i=t._adapter,{parser:n,round:o,isoWeekday:a}=t._parseOpts;let r=e;return"function"===typeof n&&(r=n(r)),(0,s.g)(r)||(r="string"===typeof n?i.parse(r,n):i.parse(r)),null===r?null:(o&&(r="week"!==o||!(0,s.q)(a)&&!0!==a?i.startOf(r,o):i.startOf(r,"isoWeek",a)),+r)}function Ni(t,e,i,s){const n=Ii.length;for(let o=Ii.indexOf(t);o=e?i[n]:i[o]]=!0}}else t[e]=!0}function Hi(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a=0&&(e[h].major=!0);return e}(t,s,n,i):s}class ji extends Rt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new W._date(t.adapters.date);(0,s.a8)(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Bi(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function h(t){a||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(o=Math.max(o,t.max))}a&&r||(h(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||h(this.getMinMax(!1))),n=(0,s.g)(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),o=(0,s.g)(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,a=this.max,r=(0,s.aH)(n,o,a);return this._unit=e.unit||(i.autoSkip?Ni(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(t,e,i,s,n){for(let o=Ii.length-1;o>=Ii.indexOf(i);o--){const i=Ii[o];if(Fi[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return Ii[i?Ii.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Ii.indexOf(t)+1,i=Ii.length;e1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+a);const p="data"===n.ticks.source&&this.getDataTimestamps();for(d=g,u=0;dt-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const o=this.options,a=o.time.displayFormats,r=this._unit,h=this._majorUnit,l=r&&a[r],c=h&&a[h],d=i[e],u=h&&c&&d&&d.major,g=this._adapter.format(t,n||(u?c:l)),p=o.ticks.callback;return p?(0,s.N)(p,[g,e,i],this):g}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t=t[h].pos&&e<=t[l].pos&&({lo:h,hi:l}=(0,s.x)(t,"pos",e)),({pos:n,time:a}=t[h]),({pos:o,time:r}=t[l])):(e>=t[h].time&&e<=t[l].time&&({lo:h,hi:l}=(0,s.x)(t,"time",e)),({time:n,pos:a}=t[h]),({time:o,pos:r}=t[l]));const c=o-n;return c?a+(r-a)*(e-n)/c:a}ji.id="time",ji.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Ui extends ji{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=$i(e,this.min),this._tableRange=$i(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,h,l;for(o=0,a=t.length;o=e&&h<=i&&s.push(h);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o=1},subscribe:function(t){return s.size||this.register(),c+=1,s.set(c,t),t(u),c},unsubscribe:function(t){s.delete(t),s.size||this.unregister()},unregister:function(){var t=this;Object.keys(a).forEach((function(e){var n=a[e],r=t.matchHandlers[n];null===r||void 0===r||r.mql.removeListener(null===r||void 0===r?void 0:r.listener)})),s.clear()},register:function(){var t=this;Object.keys(a).forEach((function(e){var n=a[e],i=function(n){var i=n.matches;t.dispatch((0,o.Z)((0,o.Z)({},u),(0,r.Z)({},e,i)))},s=window.matchMedia(n);s.addListener(i),t.matchHandlers[n]={mql:s,listener:i},i(s)}))}};e.ZP=l},31877:function(t,e,n){"use strict";var r=n(53328);r.kL.register(...r.zX),e.Z=r.kL},3940:function(t,e,n){"use strict";n.d(e,{$:function(){return s},A:function(){return ze},B:function(){return ye},C:function(){return x},D:function(){return rn},E:function(){return qe},F:function(){return sn},G:function(){return o},H:function(){return I},I:function(){return an},J:function(){return $e},K:function(){return W},L:function(){return V},M:function(){return g},N:function(){return v},O:function(){return ve},P:function(){return R},Q:function(){return J},R:function(){return Jt},S:function(){return it},T:function(){return L},U:function(){return Kt},V:function(){return re},W:function(){return se},X:function(){return oe},Y:function(){return be},Z:function(){return a},_:function(){return Ae},a:function(){return me},a0:function(){return Xt},a1:function(){return _},a2:function(){return S},a3:function(){return Qt},a4:function(){return j},a5:function(){return Se},a6:function(){return Te},a7:function(){return Ee},a8:function(){return k},a9:function(){return l},aA:function(){return u},aB:function(){return tt},aC:function(){return $},aD:function(){return U},aE:function(){return Z},aF:function(){return Q},aG:function(){return G},aH:function(){return Gt},aI:function(){return Ce},aJ:function(){return we},aa:function(){return i},ab:function(){return on},ac:function(){return te},ad:function(){return P},ae:function(){return w},af:function(){return K},ag:function(){return at},ah:function(){return he},ai:function(){return Ze},aj:function(){return xn},ak:function(){return vn},al:function(){return un},am:function(){return ln},an:function(){return cn},ao:function(){return ie},ap:function(){return ae},aq:function(){return ee},ar:function(){return ue},as:function(){return de},at:function(){return ge},au:function(){return mn},av:function(){return nt},aw:function(){return hn},ax:function(){return dn},ay:function(){return c},az:function(){return gn},b:function(){return p},c:function(){return Ut},d:function(){return qt},e:function(){return lt},f:function(){return T},g:function(){return d},h:function(){return xe},i:function(){return h},j:function(){return E},k:function(){return f},l:function(){return ke},m:function(){return b},n:function(){return m},o:function(){return pn},p:function(){return rt},q:function(){return X},r:function(){return r},s:function(){return Y},t:function(){return q},u:function(){return Oe},v:function(){return y},w:function(){return ot},x:function(){return Me},y:function(){return en},z:function(){return ne}});const r="undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame;function o(t,e,n){const o=n||(t=>Array.prototype.slice.call(t));let i=!1,a=[];return function(...n){a=o(n),i||(i=!0,r.call(window,(()=>{i=!1,t.apply(e,a)})))}}function i(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const a=t=>"start"===t?"left":"end"===t?"right":"center",s=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2,c=(t,e,n,r)=>t===(r?"left":"right")?n:"center"===t?(e+n)/2:e;function u(){}const l=function(){let t=0;return function(){return t++}}();function f(t){return null===t||"undefined"===typeof t}function p(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function h(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const d=t=>("number"===typeof t||t instanceof Number)&&isFinite(+t);function g(t,e){return d(t)?t:e}function y(t,e){return"undefined"===typeof t?e:t}const b=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,m=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function v(t,e,n){if(t&&"function"===typeof t.call)return t.apply(n,e)}function x(t,e,n,r){let o,i,a;if(p(t))if(i=t.length,r)for(o=i-1;o>=0;o--)e.call(n,t[o],o);else for(o=0;on;)t=t[e.substr(n,r-n)],n=r+1,r=A(e,n);return t}function S(t){return t.charAt(0).toUpperCase()+t.slice(1)}const E=t=>"undefined"!==typeof t,j=t=>"function"===typeof t,P=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0},R=Math.PI,L=2*R,D=L+R,N=Number.POSITIVE_INFINITY,F=R/180,I=R/2,B=R/4,H=2*R/3,W=Math.log10,Y=Math.sign;function U(t){const e=Math.round(t);t=Q(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(W(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function V(t){const e=[],n=Math.sqrt(t);let r;for(r=1;rt-e)).pop(),e}function X(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Q(t,e,n){return Math.abs(t-e)=t}function $(t,e,n){let r,o,i;for(r=0,o=t.length;rc&&u=Math.min(e,n)-r&&t<=Math.max(e,n)+r}const st=t=>0===t||1===t,ct=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*L/n),ut=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*L/n)+1,lt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*I),easeOutSine:t=>Math.sin(t*I),easeInOutSine:t=>-.5*(Math.cos(R*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>st(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>st(t)?t:ct(t,.075,.3),easeOutElastic:t=>st(t)?t:ut(t,.075,.3),easeInOutElastic(t){const e=.1125;return st(t)?t:t<.5?.5*ct(2*t,e,.45):.5+.5*ut(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-lt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*lt.easeInBounce(2*t):.5*lt.easeOutBounce(2*t-1)+.5},ft={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},pt="0123456789ABCDEF",ht=t=>pt[15&t],dt=t=>pt[(240&t)>>4]+pt[15&t],gt=t=>(240&t)>>4===(15&t);function yt(t){var e=function(t){return gt(t.r)&>(t.g)&>(t.b)&>(t.a)}(t)?ht:dt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function bt(t){return t+.5|0}const mt=(t,e,n)=>Math.max(Math.min(t,n),e);function vt(t){return mt(bt(2.55*t),0,255)}function xt(t){return mt(bt(255*t),0,255)}function wt(t){return mt(bt(t/2.55)/100,0,1)}function Mt(t){return mt(bt(100*t),0,100)}const zt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const Ct=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function _t(t,e,n){const r=e*Math.min(n,1-n),o=(e,o=(e+t/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}function kt(t,e,n){const r=(r,o=(r+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function Ot(t,e,n){const r=_t(t,1,.5);let o;for(e+n>1&&(o=1/(e+n),e*=o,n*=o),o=0;o<3;o++)r[o]*=1-e-n,r[o]+=e;return r}function At(t){const e=t.r/255,n=t.g/255,r=t.b/255,o=Math.max(e,n,r),i=Math.min(e,n,r),a=(o+i)/2;let s,c,u;return o!==i&&(u=o-i,c=a>.5?u/(2-o-i):u/(o+i),s=o===e?(n-r)/u+(n>16&255,i>>8&255,255&i]}return t}(),Lt.transparent=[0,0,0,0]);const e=Lt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function Nt(t,e,n){if(t){let r=At(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,0===e?360:1)),r=St(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Ft(t,e){return t?Object.assign(e||{},t):t}function It(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=xt(t[3]))):(e=Ft(t,{r:0,g:0,b:0,a:1})).a=xt(e.a),e}function Bt(t){return"r"===t.charAt(0)?function(t){const e=zt.exec(t);let n,r,o,i=255;if(e){if(e[7]!==n){const t=+e[7];i=255&(e[8]?vt(t):255*t)}return n=+e[1],r=+e[3],o=+e[5],n=255&(e[2]?vt(n):n),r=255&(e[4]?vt(r):r),o=255&(e[6]?vt(o):o),{r:n,g:r,b:o,a:i}}}(t):jt(t)}class Ht{constructor(t){if(t instanceof Ht)return t;const e=typeof t;let n;"object"===e?n=It(t):"string"===e&&(n=function(t){var e,n=t.length;return"#"===t[0]&&(4===n||5===n?e={r:255&17*ft[t[1]],g:255&17*ft[t[2]],b:255&17*ft[t[3]],a:5===n?17*ft[t[4]]:255}:7!==n&&9!==n||(e={r:ft[t[1]]<<4|ft[t[2]],g:ft[t[3]]<<4|ft[t[4]],b:ft[t[5]]<<4|ft[t[6]],a:9===n?ft[t[7]]<<4|ft[t[8]]:255})),e}(t)||Dt(t)||Bt(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Ft(this._rgb);return t&&(t.a=wt(t.a)),t}set rgb(t){this._rgb=It(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${wt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?yt(this._rgb):this._rgb}hslString(){return this._valid?function(t){if(!t)return;const e=At(t),n=e[0],r=Mt(e[1]),o=Mt(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${o}%, ${wt(t.a)})`:`hsl(${n}, ${r}%, ${o}%)`}(this._rgb):this._rgb}mix(t,e){const n=this;if(t){const r=n.rgb,o=t.rgb;let i;const a=e===i?.5:e,s=2*a-1,c=r.a-o.a,u=((s*c===-1?s:(s+c)/(1+s*c))+1)/2;i=1-u,r.r=255&u*r.r+i*o.r+.5,r.g=255&u*r.g+i*o.g+.5,r.b=255&u*r.b+i*o.b+.5,r.a=a*r.a+(1-a)*o.a,n.rgb=r}return n}clone(){return new Ht(this.rgb)}alpha(t){return this._rgb.a=xt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=bt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Nt(this._rgb,2,t),this}darken(t){return Nt(this._rgb,2,-t),this}saturate(t){return Nt(this._rgb,1,t),this}desaturate(t){return Nt(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=At(t);n[0]=Et(n[0]+e),n=St(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function Wt(t){return new Ht(t)}const Yt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Ut(t){return Yt(t)?t:Wt(t)}function Vt(t){return Yt(t)?t:Wt(t).saturate(.5).darken(.1).hexString()}const Xt=Object.create(null),Qt=Object.create(null);function Zt(t,e){if(!e)return t;const n=e.split(".");for(let r=0,o=n.length;rt.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Vt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Vt(e.borderColor),this.hoverColor=(t,e)=>Vt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Zt(this,t)}describe(t,e){return $t(Qt,t,e)}override(t,e){return $t(Xt,t,e)}route(t,e,n,r){const o=Zt(this,t),i=Zt(this,n),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=i[r];return h(t)?Object.assign({},e,t):y(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Jt(t,e,n,r,o){let i=e[o];return i||(i=e[o]=t.measureText(o).width,n.push(o)),i>r&&(r=i),r}function Gt(t,e,n,r){let o=(r=r||{}).data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(o=r.data={},i=r.garbageCollect=[],r.font=e),t.save(),t.font=e;let a=0;const s=n.length;let c,u,l,f,h;for(c=0;cn.length){for(c=0;c0&&t.stroke()}}function ne(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.xe.top-n&&t.y0&&""!==i.strokeColor;let c,u;for(t.save(),t.font=o.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);f(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,i),c=0;cy(t[n],t[e[n]]):e=>t[e]:()=>t;for(const a of o)n[a]=+i(a)||0;return n}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ge(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ye(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function be(t,e){t=t||{},e=e||qt.font;let n=y(t.size,e.size);"string"===typeof n&&(n=parseInt(n,10));let r=y(t.style,e.style);r&&!(""+r).match(fe)&&(console.warn('Invalid font style specified: "'+r+'"'),r="");const o={family:y(t.family,e.family),lineHeight:pe(y(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:y(t.weight,e.weight),string:""};return o.string=function(t){return!t||f(t.size)||f(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(o),o}function me(t,e,n,r){let o,i,a,s=!0;for(o=0,i=t.length;on&&0===t?0:t+e;return{min:a(r,-Math.abs(i)),max:a(o,i)}}function xe(t,e){return Object.assign(Object.create(t),e)}function we(t,e,n){n=n||(n=>t[n]1;)r=i+o>>1,n(r)?i=r:o=r;return{lo:i,hi:o}}const Me=(t,e,n)=>we(t,n,(r=>t[r][e]we(t,n,(r=>t[r][e]>=n));function Ce(t,e,n){let r=0,o=t.length;for(;rr&&t[o-1]>n;)o--;return r>0||o{const n="_onData"+S(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const o=r.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"===typeof t[n]&&t[n](...e)})),o}})})))}function Oe(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(e);-1!==o&&r.splice(o,1),r.length>0||(_e.forEach((e=>{delete t[e]})),delete t._chartjs)}function Ae(t){const e=new Set;let n,r;for(n=0,r=t.length;nt[0])){E(r)||(r=Be("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:r,_getTarget:o,override:o=>Te([o,...t],e,n,r)};return new Proxy(i,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,r)=>Re(n,r,(()=>function(t,e,n,r){let o;for(const i of e)if(o=Be(je(i,t),n),E(o))return Pe(t,o)?Fe(n,r,t,o):o}(r,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>He(t).includes(e),ownKeys:t=>He(t),set:(t,e,n)=>((t._storage||(t._storage=o()))[e]=n,delete t[e],delete t._keys,!0)})}function Se(t,e,n,r){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Ee(t,r),setContext:e=>Se(t,e,n,r),override:o=>Se(t.override(o),e,n,r)};return new Proxy(o,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>Re(t,e,(()=>function(t,e,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:a}=t;let s=r[e];j(s)&&a.isScriptable(e)&&(s=function(t,e,n,r){const{_proxy:o,_context:i,_subProxy:a,_stack:s}=n;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t),e=e(i,a||r),s.delete(t),Pe(t,e)&&(e=Fe(o._scopes,o,t,e));return e}(e,s,t,n));p(s)&&s.length&&(s=function(t,e,n,r){const{_proxy:o,_context:i,_subProxy:a,_descriptors:s}=n;if(E(i.index)&&r(t))e=e[i.index%e.length];else if(h(e[0])){const n=e,r=o._scopes.filter((t=>t!==n));e=[];for(const c of n){const n=Fe(r,o,t,c);e.push(Se(n,i,a&&a[t],s))}}return e}(e,s,t,a.isIndexable));Pe(e,s)&&(s=Se(s,o,i&&i[e],a));return s}(t,e,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,r)=>(t[n]=r,delete e[n],!0)})}function Ee(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:n,indexable:r,isScriptable:j(n)?n:()=>n,isIndexable:j(r)?r:()=>r}}const je=(t,e)=>t?t+S(e):e,Pe=(t,e)=>h(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Re(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const r=n();return t[e]=r,r}function Le(t,e,n){return j(t)?t(e,n):t}const De=(t,e)=>!0===t?e:"string"===typeof t?T(e,t):void 0;function Ne(t,e,n,r){for(const o of e){const e=De(n,o);if(e){t.add(e);const o=Le(e._fallback,n,e);if(E(o)&&o!==n&&o!==r)return o}else if(!1===e&&E(r)&&n!==r)return null}return!1}function Fe(t,e,n,r){const o=e._rootScopes,i=Le(e._fallback,n,r),a=[...t,...o],s=new Set;s.add(r);let c=Ie(s,a,n,i||n);return null!==c&&((!E(i)||i===n||(c=Ie(s,a,i,c),null!==c))&&Te(Array.from(s),[""],o,i,(()=>function(t,e,n){const r=t._getTarget();e in r||(r[e]={});const o=r[e];if(p(o)&&h(n))return n;return o}(e,n,r))))}function Ie(t,e,n,r){for(;n;)n=Ne(t,e,n,r);return n}function Be(t,e){for(const n of e){if(!n)continue;const e=n[t];if(E(e))return e}}function He(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const We=Number.EPSILON||1e-14,Ye=(t,e)=>e"x"===t?"y":"x";function Ve(t,e,n,r){const o=t.skip?e:t,i=e,a=n.skip?e:n,s=tt(i,o),c=tt(a,i);let u=s/(s+c),l=c/(s+c);u=isNaN(u)?0:u,l=isNaN(l)?0:l;const f=r*u,p=r*l;return{previous:{x:i.x-f*(a.x-o.x),y:i.y-f*(a.y-o.y)},next:{x:i.x+p*(a.x-o.x),y:i.y+p*(a.y-o.y)}}}function Xe(t,e="x"){const n=Ue(e),r=t.length,o=Array(r).fill(0),i=Array(r);let a,s,c,u=Ye(t,0);for(a=0;a!t.skip))),"monotone"===e.cubicInterpolationMode)Xe(t,o);else{let n=r?t[t.length-1]:t[0];for(i=0,a=t.length;iwindow.getComputedStyle(t,null);const Ke=["top","right","bottom","left"];function tn(t,e,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=Ke[o];r[i]=parseFloat(t[e+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}function en(t,e){const{canvas:n,currentDevicePixelRatio:r}=e,o=Ge(n),i="border-box"===o.boxSizing,a=tn(o,"padding"),s=tn(o,"border","width"),{x:c,y:u,box:l}=function(t,e){const n=t.native||t,r=n.touches,o=r&&r.length?r[0]:n,{offsetX:i,offsetY:a}=o;let s,c,u=!1;if(((t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot))(i,a,n.target))s=i,c=a;else{const t=e.getBoundingClientRect();s=o.clientX-t.left,c=o.clientY-t.top,u=!0}return{x:s,y:c,box:u}}(t,n),f=a.left+(l&&s.left),p=a.top+(l&&s.top);let{width:h,height:d}=e;return i&&(h-=a.width+s.width,d-=a.height+s.height),{x:Math.round((c-f)/h*n.width/r),y:Math.round((u-p)/d*n.height/r)}}const nn=t=>Math.round(10*t)/10;function rn(t,e,n,r){const o=Ge(t),i=tn(o,"margin"),a=Je(o.maxWidth,t,"clientWidth")||N,s=Je(o.maxHeight,t,"clientHeight")||N,c=function(t,e,n){let r,o;if(void 0===e||void 0===n){const i=qe(t);if(i){const t=i.getBoundingClientRect(),a=Ge(i),s=tn(a,"border","width"),c=tn(a,"padding");e=t.width-c.width-s.width,n=t.height-c.height-s.height,r=Je(a.maxWidth,i,"clientWidth"),o=Je(a.maxHeight,i,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:r||N,maxHeight:o||N}}(t,e,n);let{width:u,height:l}=c;if("content-box"===o.boxSizing){const t=tn(o,"border","width"),e=tn(o,"padding");u-=e.width+t.width,l-=e.height+t.height}return u=Math.max(0,u-i.width),l=Math.max(0,r?Math.floor(u/r):l-i.height),u=nn(Math.min(u,a,c.maxWidth)),l=nn(Math.min(l,s,c.maxHeight)),u&&!l&&(l=nn(u/2)),{width:u,height:l}}function on(t,e,n){const r=e||1,o=Math.floor(t.height*r),i=Math.floor(t.width*r);t.height=o/r,t.width=i/r;const a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==r||a.height!==o||a.width!==i)&&(t.currentDevicePixelRatio=r,a.height=o,a.width=i,t.ctx.setTransform(r,0,0,r,0,0),!0)}const an=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function sn(t,e){const n=function(t,e){return Ge(t).getPropertyValue(e)}(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function cn(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function un(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:"middle"===r?n<.5?t.y:e.y:"after"===r?n<1?t.y:e.y:n>0?e.y:t.y}}function ln(t,e,n,r){const o={x:t.cp2x,y:t.cp2y},i={x:e.cp1x,y:e.cp1y},a=cn(t,o,n),s=cn(o,i,n),c=cn(i,e,n),u=cn(a,s,n),l=cn(s,c,n);return cn(u,l,n)}const fn=new Map;function pn(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let r=fn.get(n);return r||(r=new Intl.NumberFormat(t,e),fn.set(n,r)),r}(e,n).format(t)}function hn(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function dn(t,e){let n,r;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function gn(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function yn(t){return"angle"===t?{between:rt,compare:et,normalize:nt}:{between:at,compare:(t,e)=>t-e,normalize:t=>t}}function bn({start:t,end:e,count:n,loop:r,style:o}){return{start:t%n,end:e%n,loop:r&&(e-t+1)%n===0,style:o}}function mn(t,e,n){if(!n)return[t];const{property:r,start:o,end:i}=n,a=e.length,{compare:s,between:c,normalize:u}=yn(r),{start:l,end:f,loop:p,style:h}=function(t,e,n){const{property:r,start:o,end:i}=n,{between:a,normalize:s}=yn(r),c=e.length;let u,l,{start:f,end:p,loop:h}=t;if(h){for(f+=c,p+=c,u=0,l=c;um||c(o,b,g)&&0!==s(o,b),w=()=>!m||0===s(i,g)||c(i,b,g);for(let M=l,z=l;M<=f;++M)y=e[M%a],y.skip||(g=u(y[r]),g!==b&&(m=c(g,o,i),null===v&&x()&&(v=0===s(g,o)?M:z),null!==v&&w()&&(d.push(bn({start:v,end:M,loop:p,count:a,style:h})),v=null),z=M,b=g));return null!==v&&d.push(bn({start:v,end:f,loop:p,count:a,style:h})),d}function vn(t,e){const n=[],r=t.segments;for(let o=0;oo&&t[i%e].skip;)i--;return i%=e,{start:o,end:i}}(n,o,i,r);if(!0===r)return wn(t,[{start:a,end:s,loop:i}],n,e);return wn(t,function(t,e,n,r){const o=t.length,i=[];let a,s=e,c=t[e];for(a=e+1;a<=n;++a){const n=t[a%o];n.skip||n.stop?c.skip||(r=!1,i.push({start:e%o,end:(a-1)%o,loop:r}),e=s=n.stop?a:null):(s=a,c.skip&&(e=a)),c=n}return null!==s&&i.push({start:e%o,end:s%o,loop:r}),i}(n,a,s=6}function M(t){return"number"===typeof t}var z=["bytes","KB","MB","GB","TB","PB","EB"];function C(t,e,n,r){t=t||"",n.prefix&&(e<0&&(e*=-1,t+="-"),t+=n.prefix);var o=n.suffix||"",i=n.precision,a=n.round;if(n.byteScale){var c,u=r?n.byteScale:e;u>=0x1000000000000000?(e/=0x1000000000000000,c=6):u>=0x4000000000000?(e/=0x4000000000000,c=5):u>=1099511627776?(e/=1099511627776,c=4):u>=1073741824?(e/=1073741824,c=3):u>=1048576?(e/=1048576,c=2):u>=1024?(e/=1024,c=1):c=0,void 0===i&&void 0===a&&(e>=1023.5&&c=1e3?4:3),o=" "+z[c]}if(void 0!==i&&void 0!==a)throw Error("Use either round or precision, not both");if(!r&&(void 0!==i&&(e=e.toPrecision(i),n.zeros||(e=parseFloat(e))),void 0!==a))if(a<0){var l=Math.pow(10,-1*a);e=parseInt((1*e/l).toFixed(0))*l}else e=e.toFixed(a),n.zeros||(e=parseFloat(e));if(n.thousands||n.decimal){var f=(e=s(e)).split(".");e=f[0],n.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),f.length>1&&(e+=(n.decimal||".")+f[1])}return t+e+o}function _(t,e,n){return n in e?e[n]:n in t.options?t.options[n]:null}function k(t){var e,n,r;for(e=0;e25?r=25:r<10&&(r=10),n.scales.x.ticks.callback||(n.scales.x.ticks.callback=function(t){return(t=s(this.getLabelForValue(t))).length>r?t.substring(0,r-2)+"...":t})},W=function(e,n,r){var o={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros};if(e.options.bytes){var i=e.data;"pie"===r&&(i=[{data:i}]);for(var a=0,s=0;sa&&(a=c.data[u][1]);for(var l=1;a>=1024;)l*=1024,a/=1024;o.byteScale=l}if("pie"!==r){var f=n.scales.y;"bar"===r&&(f=n.scales.x),o.byteScale&&(f.ticks.stepSize||(f.ticks.stepSize=o.byteScale/2),f.ticks.maxTicksLimit||(f.ticks.maxTicksLimit=4)),f.ticks.callback||(f.ticks.callback=function(t){return C("",t,o,!0)})}if(!n.plugins.tooltip.callbacks.label)if("scatter"===r)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";return e&&(e+=": "),e+"("+t.label+", "+t.formattedValue+")"};else if("bubble"===r)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";e&&(e+=": ");var n=t.raw;return e+"("+n.x+", "+n.y+", "+n.v+")"};else if("pie"===r)n.plugins.tooltip.callbacks.label=function(e){var n=e.label,r=": ";return t(n)?(n=n.slice())[0]+=r:n+=r,C(n,e.parsed,o)};else{var p="bar"===r?"x":"y";n.plugins.tooltip.callbacks.label=function(t){if(null!==t.parsed[p]){var e=t.dataset.label||"";return e&&(e+=": "),C(e,t.parsed[p],o)}}}},Y=f(o(O,A),S,E,j,P,D,N,F),U=function(e,n,r){var i,a=[],s=[],l=e.options.colors||T,f=!0,p=!0,h=!0,w=!0,M=!0,z=!0,C=e.data,k=0;if("bubble"===r)for(var O=0;Ok&&(k=A.data[S][2]);var E,j,P,R,L,D,N,F=[],H=[];if("bar"===r||"column"===r||"number"!==e.xtype&&"bubble"!==e.xtype){var W,Y,U=[];for(E=0;E0){var et=(B(K)?u(K):s[0]).getTime(),nt=(B(tt)?u(tt):s[0]).getTime();for(E=1;Ent&&(nt=rt)}var ot,it=(nt-et)/864e5;if(!n.scales.x.time.unit&&(w||it>3650?(n.scales.x.time.unit="year",ot=365):h||it>300?(n.scales.x.time.unit="month",ot=30):f||it>10?(n.scales.x.time.unit="day",ot=1):M||it>.5?(n.scales.x.time.displayFormats={hour:"MMM d, h a"},n.scales.x.time.unit="hour",ot=1/24):z&&(n.scales.x.time.displayFormats={minute:"h:mm a"},n.scales.x.time.unit="minute",ot=1/24/60),ot&&it>0)){var at=e.element.offsetWidth;if(at>0){var st=Math.ceil(it/ot/(at/100));p&&1===ot&&(st=7*Math.ceil(st/7)),n.scales.x.time.stepSize=st}}n.scales.x.time.tooltipFormat||(f?n.scales.x.time.tooltipFormat="PP":M?n.scales.x.time.tooltipFormat="MMM d, h a":z&&(n.scales.x.time.tooltipFormat="h:mm a"))}return{labels:s,datasets:a}},V=function(t){this.name="chartjs",this.library=t};V.prototype.renderLineChart=function(t,e){var n={};!t.options.max&&k(t.data)&&(n.max=1);var r=Y(t,o(n,t.options));W(t,r,e);var i=U(t,r,e||"line");"number"===t.xtype?(r.scales.x.type=r.scales.x.type||"linear",r.scales.x.position=r.scales.x.position||"bottom"):r.scales.x.type="string"===t.xtype?"category":"time",this.drawChart(t,"line",i,r)},V.prototype.renderPieChart=function(t){var e=o({},O);t.options.donut&&(e.cutout="50%"),"legend"in t.options&&S(e,t.options.legend),t.options.title&&E(e,t.options.title),e=o(e,t.options.library||{}),W(t,e,"pie");for(var n=[],r=[],i=0;i\u25cf '+C(this.series.name+": ",this.y,r)+"
"})},J=function(t){this.name="highcharts",this.library=t};J.prototype.renderLineChart=function(t,e){var n={};"areaspline"===(e=e||"spline")&&(n={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var r,o,i,a=$(t,t.options,n);"number"===t.xtype?a.xAxis.type=a.xAxis.type||"linear":a.xAxis.type="string"===t.xtype?"category":"datetime",a.chart.type||(a.chart.type=e),q(t,a,e);var s=t.data;for(o=0;o0)return!1;return!0}function mt(t){var e=t.element,n=document.createElement("a"),r=t.options.download;!0===r?r={}:"string"===typeof r&&(r={filename:r}),n.download=r.filename||"chart.png",n.style.position="absolute",n.style.top="20px",n.style.right="20px",n.style.zIndex=1e3,n.style.lineHeight="20px",n.target="_blank";var o=document.createElement("img");o.alt="Download",o.style.border="none",o.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==",n.appendChild(o),e.style.position="relative",t.__downloadAttached=!0,t.__enterEvent=vt(e,"mouseover",(function(o){var i=o.relatedTarget;i&&(i===this||wt(this,i))||!t.options.download||(n.href=t.toImage(r),e.appendChild(n))})),t.__leaveEvent=vt(e,"mouseout",(function(t){var e=t.relatedTarget;e&&(e===this||wt(this,e))||n.parentNode&&n.parentNode.removeChild(n)}))}function vt(t,e,n){if(t.addEventListener)return t.addEventListener(e,n,!1),n;var r=function(){return n.call(t,window.event)};return t.attachEvent("on"+e,r),r}function xt(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)}function wt(t,e){if(t===e)return!1;for(;e&&e!==t;)e=e.parentNode;return e===t}lt.prototype.renderLineChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={};!1===t.options.curve&&(n.curveType="none"),!1===t.options.points&&(n.pointSize=0);var r=ct(t,t.options,n),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"LineChart",o,r)}))},lt.prototype.renderPieChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(n.colors=t.options.colors),t.options.donut&&(n.pieHole=.5),"legend"in t.options&&et(n,t.options.legend),t.options.title&&nt(n,t.options.title);var r=o(o(tt,n),t.options.library||{}),i=new e.library.visualization.DataTable;i.addColumn("string",""),i.addColumn("number","Value"),i.addRows(t.data),e.drawChart(t,"PieChart",i,r)}))},lt.prototype.renderColumnChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=ct(t,t.options),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"ColumnChart",r,n)}))},lt.prototype.renderBarChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={hAxis:{gridlines:{color:"#ccc"}}},r=f(tt,et,nt,rt,ot,it,at,st)(t,t.options,n),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"BarChart",o,r)}))},lt.prototype.renderAreaChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={isStacked:!0,pointSize:0,areaOpacity:.5},r=ct(t,t.options,n),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"AreaChart",o,r)}))},lt.prototype.renderGeoChart=function(t){var e=this;this.waitForLoaded(t,"geochart",(function(){var n={legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}},r=o(o(tt,n),t.options.library||{}),i=new e.library.visualization.DataTable;i.addColumn("string",""),i.addColumn("number",t.options.label||"Value"),i.addRows(t.data),e.drawChart(t,"GeoChart",i,r)}))},lt.prototype.renderScatterChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n,r,o,i,a={},s=ct(t,t.options,a),c=t.data,u=[];for(n=0;n0?new Error("No charting library found for "+t):new Error("No charting libraries found - be sure to include one before your charts")}var Ht=function(t,e,n){var r;if("string"===typeof t&&(r=t,!(t=document.getElementById(t))))throw new Error("No element with id "+r);this.element=t,this.options=o(Wt.options,n||{}),this.dataSource=e,Wt.charts[t.id]=this,Lt(this,e,!0),this.options.refresh&&this.startRefresh()};Ht.prototype.getElement=function(){return this.element},Ht.prototype.getDataSource=function(){return this.dataSource},Ht.prototype.getData=function(){return this.data},Ht.prototype.getOptions=function(){return this.options},Ht.prototype.getChartObject=function(){return this.chart},Ht.prototype.getAdapter=function(){return this.adapter},Ht.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),Lt(this,t,!0)},Ht.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},Ht.prototype.redraw=function(){Lt(this,this.rawData)},Ht.prototype.refreshData=function(){if("string"===typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&";Lt(this,this.dataSource+t+"_="+(new Date).getTime())}else"function"===typeof this.dataSource&&Lt(this,this.dataSource)},Ht.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!==typeof this.dataSource&&"function"!==typeof this.dataSource)throw new Error("Data source must be a URL or callback for refresh");if(!this.intervalId){if(!e)throw new Error("No refresh interval");this.intervalId=setInterval((function(){t.refreshData()}),1e3*e)}},Ht.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},Ht.prototype.toImage=function(t){if("chartjs"===this.adapter){if(t&&t.background&&"transparent"!==t.background){var e=this.chart.canvas,n=this.chart.ctx,r=document.createElement("canvas"),o=r.getContext("2d");return r.width=n.canvas.width,r.height=n.canvas.height,o.fillStyle=t.background,o.fillRect(0,0,r.width,r.height),o.drawImage(e,0,0),r.toDataURL("image/png")}return this.chart.toBase64Image()}throw new Error("Feature only available for Chart.js")},Ht.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&xt(this.element,"mouseover",this.__enterEvent),this.__leaveEvent&&xt(this.element,"mouseout",this.__leaveEvent)},Ht.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=o(Wt.options,t),e&&(this.stopRefresh(),this.startRefresh())},Ht.prototype.__render=function(){this.data=this.__processData(),It(this.__chartName(),this)},Ht.prototype.__config=function(){return St};var Wt={LineChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this)},e.prototype.__chartName=function(){return"LineChart"},e}(Ht),PieChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return yt(this)},e.prototype.__chartName=function(){return"PieChart"},e}(Ht),ColumnChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(Ht),BarChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(Ht),AreaChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(Ht),GeoChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return yt(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(Ht),ScatterChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(Ht),BubbleChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(Ht),Timeline:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){var t,e=this.rawData;for(t=0;t=1},subscribe:function(t){return s.size||this.register(),c+=1,s.set(c,t),t(u),c},unsubscribe:function(t){s.delete(t),s.size||this.unregister()},unregister:function(){var t=this;Object.keys(a).forEach((function(e){var n=a[e],r=t.matchHandlers[n];null===r||void 0===r||r.mql.removeListener(null===r||void 0===r?void 0:r.listener)})),s.clear()},register:function(){var t=this;Object.keys(a).forEach((function(e){var n=a[e],i=function(n){var i=n.matches;t.dispatch((0,o.Z)((0,o.Z)({},u),(0,r.Z)({},e,i)))},s=window.matchMedia(n);s.addListener(i),t.matchHandlers[n]={mql:s,listener:i},i(s)}))}};e.ZP=l},31877:function(t,e,n){"use strict";var r=n(53328);r.kL.register(...r.zX),e.Z=r.kL},3940:function(t,e,n){"use strict";n.d(e,{$:function(){return s},A:function(){return Me},B:function(){return ge},C:function(){return x},D:function(){return nn},E:function(){return $e},F:function(){return an},G:function(){return o},H:function(){return I},I:function(){return on},J:function(){return Ze},K:function(){return W},L:function(){return V},M:function(){return g},N:function(){return v},O:function(){return me},P:function(){return R},Q:function(){return J},R:function(){return qt},S:function(){return it},T:function(){return L},U:function(){return Gt},V:function(){return ne},W:function(){return ae},X:function(){return re},Y:function(){return ye},Z:function(){return a},_:function(){return Oe},a:function(){return be},a0:function(){return Vt},a1:function(){return _},a2:function(){return S},a3:function(){return Xt},a4:function(){return j},a5:function(){return Te},a6:function(){return Ae},a7:function(){return Se},a8:function(){return k},a9:function(){return l},aA:function(){return tt},aB:function(){return $},aC:function(){return U},aD:function(){return Z},aE:function(){return Q},aF:function(){return G},aG:function(){return Jt},aH:function(){return ze},aI:function(){return xe},aa:function(){return i},ab:function(){return rn},ac:function(){return Kt},ad:function(){return P},ae:function(){return w},af:function(){return K},ag:function(){return pe},ah:function(){return Qe},ai:function(){return vn},aj:function(){return mn},ak:function(){return cn},al:function(){return un},am:function(){return sn},an:function(){return oe},ao:function(){return ie},ap:function(){return te},aq:function(){return ce},ar:function(){return he},as:function(){return de},at:function(){return bn},au:function(){return nt},av:function(){return pn},aw:function(){return hn},ax:function(){return c},ay:function(){return dn},az:function(){return u},b:function(){return p},c:function(){return Yt},d:function(){return $t},e:function(){return ut},f:function(){return T},g:function(){return d},h:function(){return ve},i:function(){return h},j:function(){return E},k:function(){return f},l:function(){return _e},m:function(){return b},n:function(){return m},o:function(){return fn},p:function(){return rt},q:function(){return X},r:function(){return r},s:function(){return Y},t:function(){return q},u:function(){return ke},v:function(){return y},w:function(){return ot},x:function(){return we},y:function(){return tn},z:function(){return ee}});const r="undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame;function o(t,e,n){const o=n||(t=>Array.prototype.slice.call(t));let i=!1,a=[];return function(...n){a=o(n),i||(i=!0,r.call(window,(()=>{i=!1,t.apply(e,a)})))}}function i(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const a=t=>"start"===t?"left":"end"===t?"right":"center",s=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2,c=(t,e,n,r)=>t===(r?"left":"right")?n:"center"===t?(e+n)/2:e;function u(){}const l=function(){let t=0;return function(){return t++}}();function f(t){return null===t||"undefined"===typeof t}function p(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function h(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const d=t=>("number"===typeof t||t instanceof Number)&&isFinite(+t);function g(t,e){return d(t)?t:e}function y(t,e){return"undefined"===typeof t?e:t}const b=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,m=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function v(t,e,n){if(t&&"function"===typeof t.call)return t.apply(n,e)}function x(t,e,n,r){let o,i,a;if(p(t))if(i=t.length,r)for(o=i-1;o>=0;o--)e.call(n,t[o],o);else for(o=0;on;)t=t[e.substr(n,r-n)],n=r+1,r=A(e,n);return t}function S(t){return t.charAt(0).toUpperCase()+t.slice(1)}const E=t=>"undefined"!==typeof t,j=t=>"function"===typeof t,P=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0},R=Math.PI,L=2*R,D=L+R,N=Number.POSITIVE_INFINITY,F=R/180,I=R/2,B=R/4,H=2*R/3,W=Math.log10,Y=Math.sign;function U(t){const e=Math.round(t);t=Q(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(W(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function V(t){const e=[],n=Math.sqrt(t);let r;for(r=1;rt-e)).pop(),e}function X(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Q(t,e,n){return Math.abs(t-e)=t}function $(t,e,n){let r,o,i;for(r=0,o=t.length;rc&&u0===t||1===t,st=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*L/n),ct=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*L/n)+1,ut={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*I),easeOutSine:t=>Math.sin(t*I),easeInOutSine:t=>-.5*(Math.cos(R*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>at(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>at(t)?t:st(t,.075,.3),easeOutElastic:t=>at(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return at(t)?t:t<.5?.5*st(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ut.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*ut.easeInBounce(2*t):.5*ut.easeOutBounce(2*t-1)+.5},lt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ft="0123456789ABCDEF",pt=t=>ft[15&t],ht=t=>ft[(240&t)>>4]+ft[15&t],dt=t=>(240&t)>>4===(15&t);function gt(t){var e=function(t){return dt(t.r)&&dt(t.g)&&dt(t.b)&&dt(t.a)}(t)?pt:ht;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function yt(t){return t+.5|0}const bt=(t,e,n)=>Math.max(Math.min(t,n),e);function mt(t){return bt(yt(2.55*t),0,255)}function vt(t){return bt(yt(255*t),0,255)}function xt(t){return bt(yt(t/2.55)/100,0,1)}function wt(t){return bt(yt(100*t),0,100)}const Mt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const zt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ct(t,e,n){const r=e*Math.min(n,1-n),o=(e,o=(e+t/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}function _t(t,e,n){const r=(r,o=(r+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function kt(t,e,n){const r=Ct(t,1,.5);let o;for(e+n>1&&(o=1/(e+n),e*=o,n*=o),o=0;o<3;o++)r[o]*=1-e-n,r[o]+=e;return r}function Ot(t){const e=t.r/255,n=t.g/255,r=t.b/255,o=Math.max(e,n,r),i=Math.min(e,n,r),a=(o+i)/2;let s,c,u;return o!==i&&(u=o-i,c=a>.5?u/(2-o-i):u/(o+i),s=o===e?(n-r)/u+(n>16&255,i>>8&255,255&i]}return t}(),Rt.transparent=[0,0,0,0]);const e=Rt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function Dt(t,e,n){if(t){let r=Ot(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,0===e?360:1)),r=Tt(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Nt(t,e){return t?Object.assign(e||{},t):t}function Ft(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=vt(t[3]))):(e=Nt(t,{r:0,g:0,b:0,a:1})).a=vt(e.a),e}function It(t){return"r"===t.charAt(0)?function(t){const e=Mt.exec(t);let n,r,o,i=255;if(e){if(e[7]!==n){const t=+e[7];i=255&(e[8]?mt(t):255*t)}return n=+e[1],r=+e[3],o=+e[5],n=255&(e[2]?mt(n):n),r=255&(e[4]?mt(r):r),o=255&(e[6]?mt(o):o),{r:n,g:r,b:o,a:i}}}(t):Et(t)}class Bt{constructor(t){if(t instanceof Bt)return t;const e=typeof t;let n;"object"===e?n=Ft(t):"string"===e&&(n=function(t){var e,n=t.length;return"#"===t[0]&&(4===n||5===n?e={r:255&17*lt[t[1]],g:255&17*lt[t[2]],b:255&17*lt[t[3]],a:5===n?17*lt[t[4]]:255}:7!==n&&9!==n||(e={r:lt[t[1]]<<4|lt[t[2]],g:lt[t[3]]<<4|lt[t[4]],b:lt[t[5]]<<4|lt[t[6]],a:9===n?lt[t[7]]<<4|lt[t[8]]:255})),e}(t)||Lt(t)||It(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Nt(this._rgb);return t&&(t.a=xt(t.a)),t}set rgb(t){this._rgb=Ft(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${xt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?gt(this._rgb):this._rgb}hslString(){return this._valid?function(t){if(!t)return;const e=Ot(t),n=e[0],r=wt(e[1]),o=wt(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${o}%, ${xt(t.a)})`:`hsl(${n}, ${r}%, ${o}%)`}(this._rgb):this._rgb}mix(t,e){const n=this;if(t){const r=n.rgb,o=t.rgb;let i;const a=e===i?.5:e,s=2*a-1,c=r.a-o.a,u=((s*c===-1?s:(s+c)/(1+s*c))+1)/2;i=1-u,r.r=255&u*r.r+i*o.r+.5,r.g=255&u*r.g+i*o.g+.5,r.b=255&u*r.b+i*o.b+.5,r.a=a*r.a+(1-a)*o.a,n.rgb=r}return n}clone(){return new Bt(this.rgb)}alpha(t){return this._rgb.a=vt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=yt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Dt(this._rgb,2,t),this}darken(t){return Dt(this._rgb,2,-t),this}saturate(t){return Dt(this._rgb,1,t),this}desaturate(t){return Dt(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=Ot(t);n[0]=St(n[0]+e),n=Tt(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function Ht(t){return new Bt(t)}const Wt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Yt(t){return Wt(t)?t:Ht(t)}function Ut(t){return Wt(t)?t:Ht(t).saturate(.5).darken(.1).hexString()}const Vt=Object.create(null),Xt=Object.create(null);function Qt(t,e){if(!e)return t;const n=e.split(".");for(let r=0,o=n.length;rt.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Ut(e.backgroundColor),this.hoverBorderColor=(t,e)=>Ut(e.borderColor),this.hoverColor=(t,e)=>Ut(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.describe(t)}set(t,e){return Zt(this,t,e)}get(t){return Qt(this,t)}describe(t,e){return Zt(Xt,t,e)}override(t,e){return Zt(Vt,t,e)}route(t,e,n,r){const o=Qt(this,t),i=Qt(this,n),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=i[r];return h(t)?Object.assign({},e,t):y(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,n,r,o){let i=e[o];return i||(i=e[o]=t.measureText(o).width,n.push(o)),i>r&&(r=i),r}function Jt(t,e,n,r){let o=(r=r||{}).data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(o=r.data={},i=r.garbageCollect=[],r.font=e),t.save(),t.font=e;let a=0;const s=n.length;let c,u,l,f,h;for(c=0;cn.length){for(c=0;c0&&t.stroke()}}function ee(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.xe.top-n&&t.y0&&""!==i.strokeColor;let c,u;for(t.save(),t.font=o.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);f(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,i),c=0;cy(t[n],t[e[n]]):e=>t[e]:()=>t;for(const a of o)n[a]=+i(a)||0;return n}function he(t){return pe(t,{top:"y",right:"x",bottom:"y",left:"x"})}function de(t){return pe(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ge(t){const e=he(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ye(t,e){t=t||{},e=e||$t.font;let n=y(t.size,e.size);"string"===typeof n&&(n=parseInt(n,10));let r=y(t.style,e.style);r&&!(""+r).match(le)&&(console.warn('Invalid font style specified: "'+r+'"'),r="");const o={family:y(t.family,e.family),lineHeight:fe(y(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:y(t.weight,e.weight),string:""};return o.string=function(t){return!t||f(t.size)||f(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(o),o}function be(t,e,n,r){let o,i,a,s=!0;for(o=0,i=t.length;on&&0===t?0:t+e;return{min:a(r,-Math.abs(i)),max:a(o,i)}}function ve(t,e){return Object.assign(Object.create(t),e)}function xe(t,e,n){n=n||(n=>t[n]1;)r=i+o>>1,n(r)?i=r:o=r;return{lo:i,hi:o}}const we=(t,e,n)=>xe(t,n,(r=>t[r][e]xe(t,n,(r=>t[r][e]>=n));function ze(t,e,n){let r=0,o=t.length;for(;rr&&t[o-1]>n;)o--;return r>0||o{const n="_onData"+S(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const o=r.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"===typeof t[n]&&t[n](...e)})),o}})})))}function ke(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(e);-1!==o&&r.splice(o,1),r.length>0||(Ce.forEach((e=>{delete t[e]})),delete t._chartjs)}function Oe(t){const e=new Set;let n,r;for(n=0,r=t.length;nt[0])){E(r)||(r=Ie("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:r,_getTarget:o,override:o=>Ae([o,...t],e,n,r)};return new Proxy(i,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,r)=>Pe(n,r,(()=>function(t,e,n,r){let o;for(const i of e)if(o=Ie(Ee(i,t),n),E(o))return je(t,o)?Ne(n,r,t,o):o}(r,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Be(t).includes(e),ownKeys:t=>Be(t),set:(t,e,n)=>((t._storage||(t._storage=o()))[e]=n,delete t[e],delete t._keys,!0)})}function Te(t,e,n,r){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Se(t,r),setContext:e=>Te(t,e,n,r),override:o=>Te(t.override(o),e,n,r)};return new Proxy(o,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>Pe(t,e,(()=>function(t,e,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:a}=t;let s=r[e];j(s)&&a.isScriptable(e)&&(s=function(t,e,n,r){const{_proxy:o,_context:i,_subProxy:a,_stack:s}=n;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t),e=e(i,a||r),s.delete(t),h(e)&&(e=Ne(o._scopes,o,t,e));return e}(e,s,t,n));p(s)&&s.length&&(s=function(t,e,n,r){const{_proxy:o,_context:i,_subProxy:a,_descriptors:s}=n;if(E(i.index)&&r(t))e=e[i.index%e.length];else if(h(e[0])){const n=e,r=o._scopes.filter((t=>t!==n));e=[];for(const c of n){const n=Ne(r,o,t,c);e.push(Te(n,i,a&&a[t],s))}}return e}(e,s,t,a.isIndexable));je(e,s)&&(s=Te(s,o,i&&i[e],a));return s}(t,e,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,r)=>(t[n]=r,delete e[n],!0)})}function Se(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:n,indexable:r,isScriptable:j(n)?n:()=>n,isIndexable:j(r)?r:()=>r}}const Ee=(t,e)=>t?t+S(e):e,je=(t,e)=>h(e)&&"adapters"!==t;function Pe(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const r=n();return t[e]=r,r}function Re(t,e,n){return j(t)?t(e,n):t}const Le=(t,e)=>!0===t?e:"string"===typeof t?T(e,t):void 0;function De(t,e,n,r){for(const o of e){const e=Le(n,o);if(e){t.add(e);const o=Re(e._fallback,n,e);if(E(o)&&o!==n&&o!==r)return o}else if(!1===e&&E(r)&&n!==r)return null}return!1}function Ne(t,e,n,r){const o=e._rootScopes,i=Re(e._fallback,n,r),a=[...t,...o],s=new Set;s.add(r);let c=Fe(s,a,n,i||n);return null!==c&&((!E(i)||i===n||(c=Fe(s,a,i,c),null!==c))&&Ae(Array.from(s),[""],o,i,(()=>function(t,e,n){const r=t._getTarget();e in r||(r[e]={});const o=r[e];if(p(o)&&h(n))return n;return o}(e,n,r))))}function Fe(t,e,n,r){for(;n;)n=De(t,e,n,r);return n}function Ie(t,e){for(const n of e){if(!n)continue;const e=n[t];if(E(e))return e}}function Be(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const He=Number.EPSILON||1e-14,We=(t,e)=>e"x"===t?"y":"x";function Ue(t,e,n,r){const o=t.skip?e:t,i=e,a=n.skip?e:n,s=tt(i,o),c=tt(a,i);let u=s/(s+c),l=c/(s+c);u=isNaN(u)?0:u,l=isNaN(l)?0:l;const f=r*u,p=r*l;return{previous:{x:i.x-f*(a.x-o.x),y:i.y-f*(a.y-o.y)},next:{x:i.x+p*(a.x-o.x),y:i.y+p*(a.y-o.y)}}}function Ve(t,e="x"){const n=Ye(e),r=t.length,o=Array(r).fill(0),i=Array(r);let a,s,c,u=We(t,0);for(a=0;a!t.skip))),"monotone"===e.cubicInterpolationMode)Ve(t,o);else{let n=r?t[t.length-1]:t[0];for(i=0,a=t.length;iwindow.getComputedStyle(t,null);const Ge=["top","right","bottom","left"];function Ke(t,e,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=Ge[o];r[i]=parseFloat(t[e+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}function tn(t,e){const{canvas:n,currentDevicePixelRatio:r}=e,o=Je(n),i="border-box"===o.boxSizing,a=Ke(o,"padding"),s=Ke(o,"border","width"),{x:c,y:u,box:l}=function(t,e){const n=t.native||t,r=n.touches,o=r&&r.length?r[0]:n,{offsetX:i,offsetY:a}=o;let s,c,u=!1;if(((t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot))(i,a,n.target))s=i,c=a;else{const t=e.getBoundingClientRect();s=o.clientX-t.left,c=o.clientY-t.top,u=!0}return{x:s,y:c,box:u}}(t,n),f=a.left+(l&&s.left),p=a.top+(l&&s.top);let{width:h,height:d}=e;return i&&(h-=a.width+s.width,d-=a.height+s.height),{x:Math.round((c-f)/h*n.width/r),y:Math.round((u-p)/d*n.height/r)}}const en=t=>Math.round(10*t)/10;function nn(t,e,n,r){const o=Je(t),i=Ke(o,"margin"),a=qe(o.maxWidth,t,"clientWidth")||N,s=qe(o.maxHeight,t,"clientHeight")||N,c=function(t,e,n){let r,o;if(void 0===e||void 0===n){const i=$e(t);if(i){const t=i.getBoundingClientRect(),a=Je(i),s=Ke(a,"border","width"),c=Ke(a,"padding");e=t.width-c.width-s.width,n=t.height-c.height-s.height,r=qe(a.maxWidth,i,"clientWidth"),o=qe(a.maxHeight,i,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:r||N,maxHeight:o||N}}(t,e,n);let{width:u,height:l}=c;if("content-box"===o.boxSizing){const t=Ke(o,"border","width"),e=Ke(o,"padding");u-=e.width+t.width,l-=e.height+t.height}return u=Math.max(0,u-i.width),l=Math.max(0,r?Math.floor(u/r):l-i.height),u=en(Math.min(u,a,c.maxWidth)),l=en(Math.min(l,s,c.maxHeight)),u&&!l&&(l=en(u/2)),{width:u,height:l}}function rn(t,e,n){const r=e||1,o=Math.floor(t.height*r),i=Math.floor(t.width*r);t.height=o/r,t.width=i/r;const a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==r||a.height!==o||a.width!==i)&&(t.currentDevicePixelRatio=r,a.height=o,a.width=i,t.ctx.setTransform(r,0,0,r,0,0),!0)}const on=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function an(t,e){const n=function(t,e){return Je(t).getPropertyValue(e)}(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function sn(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function cn(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:"middle"===r?n<.5?t.y:e.y:"after"===r?n<1?t.y:e.y:n>0?e.y:t.y}}function un(t,e,n,r){const o={x:t.cp2x,y:t.cp2y},i={x:e.cp1x,y:e.cp1y},a=sn(t,o,n),s=sn(o,i,n),c=sn(i,e,n),u=sn(a,s,n),l=sn(s,c,n);return sn(u,l,n)}const ln=new Map;function fn(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let r=ln.get(n);return r||(r=new Intl.NumberFormat(t,e),ln.set(n,r)),r}(e,n).format(t)}function pn(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function hn(t,e){let n,r;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function dn(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function gn(t){return"angle"===t?{between:rt,compare:et,normalize:nt}:{between:(t,e,n)=>t>=Math.min(e,n)&&t<=Math.max(n,e),compare:(t,e)=>t-e,normalize:t=>t}}function yn({start:t,end:e,count:n,loop:r,style:o}){return{start:t%n,end:e%n,loop:r&&(e-t+1)%n===0,style:o}}function bn(t,e,n){if(!n)return[t];const{property:r,start:o,end:i}=n,a=e.length,{compare:s,between:c,normalize:u}=gn(r),{start:l,end:f,loop:p,style:h}=function(t,e,n){const{property:r,start:o,end:i}=n,{between:a,normalize:s}=gn(r),c=e.length;let u,l,{start:f,end:p,loop:h}=t;if(h){for(f+=c,p+=c,u=0,l=c;um||c(o,b,g)&&0!==s(o,b),w=()=>!m||0===s(i,g)||c(i,b,g);for(let M=l,z=l;M<=f;++M)y=e[M%a],y.skip||(g=u(y[r]),g!==b&&(m=c(g,o,i),null===v&&x()&&(v=0===s(g,o)?M:z),null!==v&&w()&&(d.push(yn({start:v,end:M,loop:p,count:a,style:h})),v=null),z=M,b=g));return null!==v&&d.push(yn({start:v,end:f,loop:p,count:a,style:h})),d}function mn(t,e){const n=[],r=t.segments;for(let o=0;oo&&t[i%e].skip;)i--;return i%=e,{start:o,end:i}}(n,o,i,r);if(!0===r)return xn(t,[{start:a,end:s,loop:i}],n,e);return xn(t,function(t,e,n,r){const o=t.length,i=[];let a,s=e,c=t[e];for(a=e+1;a<=n;++a){const n=t[a%o];n.skip||n.stop?c.skip||(r=!1,i.push({start:e%o,end:(a-1)%o,loop:r}),e=s=n.stop?a:null):(s=a,c.skip&&(e=a)),c=n}return null!==s&&i.push({start:e%o,end:s%o,loop:r}),i}(n,a,s=6}function M(t){return"number"===typeof t}var z=["bytes","KB","MB","GB","TB","PB","EB"];function C(t,e,n,r){t=t||"",n.prefix&&(e<0&&(e*=-1,t+="-"),t+=n.prefix);var o=n.suffix||"",i=n.precision,a=n.round;if(n.byteScale){var c,u=r?n.byteScale:e;u>=0x1000000000000000?(e/=0x1000000000000000,c=6):u>=0x4000000000000?(e/=0x4000000000000,c=5):u>=1099511627776?(e/=1099511627776,c=4):u>=1073741824?(e/=1073741824,c=3):u>=1048576?(e/=1048576,c=2):u>=1024?(e/=1024,c=1):c=0,void 0===i&&void 0===a&&(e>=1023.5&&c=1e3?4:3),o=" "+z[c]}if(void 0!==i&&void 0!==a)throw Error("Use either round or precision, not both");if(!r&&(void 0!==i&&(e=e.toPrecision(i),n.zeros||(e=parseFloat(e))),void 0!==a))if(a<0){var l=Math.pow(10,-1*a);e=parseInt((1*e/l).toFixed(0))*l}else e=e.toFixed(a),n.zeros||(e=parseFloat(e));if(n.thousands||n.decimal){var f=(e=s(e)).split(".");e=f[0],n.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),f.length>1&&(e+=(n.decimal||".")+f[1])}return t+e+o}function _(t,e,n){return n in e?e[n]:n in t.options?t.options[n]:null}function k(t){var e,n,r;for(e=0;e25?r=25:r<10&&(r=10),n.scales.x.ticks.callback||(n.scales.x.ticks.callback=function(t){return(t=s(this.getLabelForValue(t))).length>r?t.substring(0,r-2)+"...":t})},W=function(e,n,r){var o={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros};if(e.options.bytes){var i=e.data;"pie"===r&&(i=[{data:i}]);for(var a=0,s=0;sa&&(a=c.data[u][1]);for(var l=1;a>=1024;)l*=1024,a/=1024;o.byteScale=l}if("pie"!==r){var f=n.scales.y;"bar"===r&&(f=n.scales.x),o.byteScale&&(f.ticks.stepSize||(f.ticks.stepSize=o.byteScale/2),f.ticks.maxTicksLimit||(f.ticks.maxTicksLimit=4)),f.ticks.callback||(f.ticks.callback=function(t){return C("",t,o,!0)})}if(!n.plugins.tooltip.callbacks.label)if("scatter"===r)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";return e&&(e+=": "),e+"("+t.label+", "+t.formattedValue+")"};else if("bubble"===r)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";e&&(e+=": ");var n=t.raw;return e+"("+n.x+", "+n.y+", "+n.v+")"};else if("pie"===r)n.plugins.tooltip.callbacks.label=function(e){var n=e.label,r=": ";return t(n)?(n=n.slice())[0]+=r:n+=r,C(n,e.parsed,o)};else{var p="bar"===r?"x":"y";n.plugins.tooltip.callbacks.label=function(t){if(null!==t.parsed[p]){var e=t.dataset.label||"";return e&&(e+=": "),C(e,t.parsed[p],o)}}}},Y=f(o(O,A),S,E,j,P,D,N,F),U=function(e,n,r){var i,a=[],s=[],l=e.options.colors||T,f=!0,p=!0,h=!0,w=!0,M=!0,z=!0,C=e.data,k=0;if("bubble"===r)for(var O=0;Ok&&(k=A.data[S][2]);var E,j,P,R,L,D,N,F=[],H=[];if("bar"===r||"column"===r||"number"!==e.xtype&&"bubble"!==e.xtype){var W,Y,U=[];for(E=0;E0){var et=(B(K)?u(K):s[0]).getTime(),nt=(B(tt)?u(tt):s[0]).getTime();for(E=1;Ent&&(nt=rt)}var ot,it=(nt-et)/864e5;if(!n.scales.x.time.unit&&(w||it>3650?(n.scales.x.time.unit="year",ot=365):h||it>300?(n.scales.x.time.unit="month",ot=30):f||it>10?(n.scales.x.time.unit="day",ot=1):M||it>.5?(n.scales.x.time.displayFormats={hour:"MMM d, h a"},n.scales.x.time.unit="hour",ot=1/24):z&&(n.scales.x.time.displayFormats={minute:"h:mm a"},n.scales.x.time.unit="minute",ot=1/24/60),ot&&it>0)){var at=e.element.offsetWidth;if(at>0){var st=Math.ceil(it/ot/(at/100));p&&1===ot&&(st=7*Math.ceil(st/7)),n.scales.x.time.stepSize=st}}n.scales.x.time.tooltipFormat||(f?n.scales.x.time.tooltipFormat="PP":M?n.scales.x.time.tooltipFormat="MMM d, h a":z&&(n.scales.x.time.tooltipFormat="h:mm a"))}return{labels:s,datasets:a}},V=function(t){this.name="chartjs",this.library=t};V.prototype.renderLineChart=function(t,e){var n={};!t.options.max&&k(t.data)&&(n.max=1);var r=Y(t,o(n,t.options));W(t,r,e);var i=U(t,r,e||"line");"number"===t.xtype?(r.scales.x.type=r.scales.x.type||"linear",r.scales.x.position=r.scales.x.position||"bottom"):r.scales.x.type="string"===t.xtype?"category":"time",this.drawChart(t,"line",i,r)},V.prototype.renderPieChart=function(t){var e=o({},O);t.options.donut&&(e.cutout="50%"),"legend"in t.options&&S(e,t.options.legend),t.options.title&&E(e,t.options.title),e=o(e,t.options.library||{}),W(t,e,"pie");for(var n=[],r=[],i=0;i\u25cf '+C(this.series.name+": ",this.y,r)+"
"})},J=function(t){this.name="highcharts",this.library=t};J.prototype.renderLineChart=function(t,e){var n={};"areaspline"===(e=e||"spline")&&(n={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var r,o,i,a=$(t,t.options,n);"number"===t.xtype?a.xAxis.type=a.xAxis.type||"linear":a.xAxis.type="string"===t.xtype?"category":"datetime",a.chart.type||(a.chart.type=e),q(t,a,e);var s=t.data;for(o=0;o0)return!1;return!0}function mt(t){var e=t.element,n=document.createElement("a"),r=t.options.download;!0===r?r={}:"string"===typeof r&&(r={filename:r}),n.download=r.filename||"chart.png",n.style.position="absolute",n.style.top="20px",n.style.right="20px",n.style.zIndex=1e3,n.style.lineHeight="20px",n.target="_blank";var o=document.createElement("img");o.alt="Download",o.style.border="none",o.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==",n.appendChild(o),e.style.position="relative",t.__downloadAttached=!0,t.__enterEvent=vt(e,"mouseover",(function(o){var i=o.relatedTarget;i&&(i===this||wt(this,i))||!t.options.download||(n.href=t.toImage(r),e.appendChild(n))})),t.__leaveEvent=vt(e,"mouseout",(function(t){var e=t.relatedTarget;e&&(e===this||wt(this,e))||n.parentNode&&n.parentNode.removeChild(n)}))}function vt(t,e,n){if(t.addEventListener)return t.addEventListener(e,n,!1),n;var r=function(){return n.call(t,window.event)};return t.attachEvent("on"+e,r),r}function xt(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)}function wt(t,e){if(t===e)return!1;for(;e&&e!==t;)e=e.parentNode;return e===t}lt.prototype.renderLineChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={};!1===t.options.curve&&(n.curveType="none"),!1===t.options.points&&(n.pointSize=0);var r=ct(t,t.options,n),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"LineChart",o,r)}))},lt.prototype.renderPieChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(n.colors=t.options.colors),t.options.donut&&(n.pieHole=.5),"legend"in t.options&&et(n,t.options.legend),t.options.title&&nt(n,t.options.title);var r=o(o(tt,n),t.options.library||{}),i=new e.library.visualization.DataTable;i.addColumn("string",""),i.addColumn("number","Value"),i.addRows(t.data),e.drawChart(t,"PieChart",i,r)}))},lt.prototype.renderColumnChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=ct(t,t.options),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"ColumnChart",r,n)}))},lt.prototype.renderBarChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={hAxis:{gridlines:{color:"#ccc"}}},r=f(tt,et,nt,rt,ot,it,at,st)(t,t.options,n),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"BarChart",o,r)}))},lt.prototype.renderAreaChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={isStacked:!0,pointSize:0,areaOpacity:.5},r=ct(t,t.options,n),o=e.createDataTable(t.data,t.xtype);e.drawChart(t,"AreaChart",o,r)}))},lt.prototype.renderGeoChart=function(t){var e=this;this.waitForLoaded(t,"geochart",(function(){var n={legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}},r=o(o(tt,n),t.options.library||{}),i=new e.library.visualization.DataTable;i.addColumn("string",""),i.addColumn("number",t.options.label||"Value"),i.addRows(t.data),e.drawChart(t,"GeoChart",i,r)}))},lt.prototype.renderScatterChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n,r,o,i,a={},s=ct(t,t.options,a),c=t.data,u=[];for(n=0;n0?new Error("No charting library found for "+t):new Error("No charting libraries found - be sure to include one before your charts")}var Ht=function(t,e,n){var r;if("string"===typeof t&&(r=t,!(t=document.getElementById(t))))throw new Error("No element with id "+r);this.element=t,this.options=o(Wt.options,n||{}),this.dataSource=e,Wt.charts[t.id]=this,Lt(this,e,!0),this.options.refresh&&this.startRefresh()};Ht.prototype.getElement=function(){return this.element},Ht.prototype.getDataSource=function(){return this.dataSource},Ht.prototype.getData=function(){return this.data},Ht.prototype.getOptions=function(){return this.options},Ht.prototype.getChartObject=function(){return this.chart},Ht.prototype.getAdapter=function(){return this.adapter},Ht.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),Lt(this,t,!0)},Ht.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},Ht.prototype.redraw=function(){Lt(this,this.rawData)},Ht.prototype.refreshData=function(){if("string"===typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&";Lt(this,this.dataSource+t+"_="+(new Date).getTime())}else"function"===typeof this.dataSource&&Lt(this,this.dataSource)},Ht.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!==typeof this.dataSource&&"function"!==typeof this.dataSource)throw new Error("Data source must be a URL or callback for refresh");if(!this.intervalId){if(!e)throw new Error("No refresh interval");this.intervalId=setInterval((function(){t.refreshData()}),1e3*e)}},Ht.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},Ht.prototype.toImage=function(t){if("chartjs"===this.adapter){if(t&&t.background&&"transparent"!==t.background){var e=this.chart.canvas,n=this.chart.ctx,r=document.createElement("canvas"),o=r.getContext("2d");return r.width=n.canvas.width,r.height=n.canvas.height,o.fillStyle=t.background,o.fillRect(0,0,r.width,r.height),o.drawImage(e,0,0),r.toDataURL("image/png")}return this.chart.toBase64Image()}throw new Error("Feature only available for Chart.js")},Ht.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&xt(this.element,"mouseover",this.__enterEvent),this.__leaveEvent&&xt(this.element,"mouseout",this.__leaveEvent)},Ht.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=o(Wt.options,t),e&&(this.stopRefresh(),this.startRefresh())},Ht.prototype.__render=function(){this.data=this.__processData(),It(this.__chartName(),this)},Ht.prototype.__config=function(){return St};var Wt={LineChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this)},e.prototype.__chartName=function(){return"LineChart"},e}(Ht),PieChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return yt(this)},e.prototype.__chartName=function(){return"PieChart"},e}(Ht),ColumnChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(Ht),BarChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(Ht),AreaChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(Ht),GeoChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return yt(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(Ht),ScatterChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(Ht),BubbleChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return gt(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(Ht),Timeline:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){var t,e=this.rawData;for(t=0;tOwncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No Data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No Data

\ No newline at end of file diff --git a/static/admin/actions/index.html b/static/admin/actions/index.html index 92537f4a8..cad4c7d83 100644 --- a/static/admin/actions/index.html +++ b/static/admin/actions/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No Data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No Data

\ No newline at end of file diff --git a/static/admin/chat/messages/index.html b/static/admin/chat/messages/index.html index b25b00cf0..1be8107bf 100644 --- a/static/admin/chat/messages/index.html +++ b/static/admin/chat/messages/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No Data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No Data
\ No newline at end of file diff --git a/static/admin/chat/users/index.html b/static/admin/chat/users/index.html index 308d82c33..f9c650b34 100644 --- a/static/admin/chat/users/index.html +++ b/static/admin/chat/users/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file diff --git a/static/admin/config-chat/index.html b/static/admin/config-chat/index.html index 576355513..62bb89662 100644 --- a/static/admin/config-chat/index.html +++ b/static/admin/config-chat/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/admin/config-public-details/index.html b/static/admin/config-public-details/index.html index 39e38f425..3c876cb4a 100644 --- a/static/admin/config-public-details/index.html +++ b/static/admin/config-public-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


Customize your page styling with CSS

Customize the look and feel of your Owncast instance by overriding the CSS styles of various components on the page. Refer to the CSS & Components guide.

Please input plain CSS text, as this will be directly injected onto your page during load.


\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


Customize your page styling with CSS

Customize the look and feel of your Owncast instance by overriding the CSS styles of various components on the page. Refer to the CSS & Components guide.

Please input plain CSS text, as this will be directly injected onto your page during load.


\ No newline at end of file diff --git a/static/admin/config-server-details/index.html b/static/admin/config-server-details/index.html index 78f6950a5..cd33518c5 100644 --- a/static/admin/config-server-details/index.html +++ b/static/admin/config-server-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file diff --git a/static/admin/config-social-items/index.html b/static/admin/config-social-items/index.html index 0cb032b8e..3fd01c671 100644 --- a/static/admin/config-social-items/index.html +++ b/static/admin/config-social-items/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file diff --git a/static/admin/config-storage/index.html b/static/admin/config-storage/index.html index 622a3bc4f..011bb5294 100644 --- a/static/admin/config-storage/index.html +++ b/static/admin/config-storage/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file diff --git a/static/admin/config-video/index.html b/static/admin/config-video/index.html index b79b0613c..d18153d1e 100644 --- a/static/admin/config-video/index.html +++ b/static/admin/config-video/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file diff --git a/static/admin/hardware-info/index.html b/static/admin/hardware-info/index.html index 90e8200b6..72172679d 100644 --- a/static/admin/hardware-info/index.html +++ b/static/admin/hardware-info/index.html @@ -1,4 +1,4 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


Disk
0%
Loading...
\ No newline at end of file + a 47,47 0 1 1 0,94" stroke="" stroke-linecap="round" stroke-width="6" opacity="0" fill-opacity="0" style="stroke:#52C41A;stroke-dasharray:0px 295.3097094374406px;stroke-dashoffset:-37.5px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s">
Disk
0%
Loading...
\ No newline at end of file diff --git a/static/admin/help/index.html b/static/admin/help/index.html index 9bd90d38a..6a7de1f70 100644 --- a/static/admin/help/index.html +++ b/static/admin/help/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file diff --git a/static/admin/index.html b/static/admin/index.html index 61b12a015..52ba8e3ca 100644 --- a/static/admin/index.html +++ b/static/admin/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
Not sure what to do next?
If you're having issues or would like to know how to customize and configure your Owncast server visit the help page.

News & Updates from Owncast

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
Not sure what to do next?
If you're having issues or would like to know how to customize and configure your Owncast server visit the help page.

News & Updates from Owncast

\ No newline at end of file diff --git a/static/admin/logs/index.html b/static/admin/logs/index.html index 51c61e745..7b5d315a6 100644 --- a/static/admin/logs/index.html +++ b/static/admin/logs/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/admin/upgrade/index.html b/static/admin/upgrade/index.html index 55a8be7ea..6f02fb8bd 100644 --- a/static/admin/upgrade/index.html +++ b/static/admin/upgrade/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No Data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No Data
\ No newline at end of file diff --git a/static/admin/viewer-info/index.html b/static/admin/viewer-info/index.html index fa52f32ff..594240fd3 100644 --- a/static/admin/viewer-info/index.html +++ b/static/admin/viewer-info/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
no info
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
no info
\ No newline at end of file diff --git a/static/admin/webhooks/index.html b/static/admin/webhooks/index.html index ceb1e3b88..7eaf110a9 100644 --- a/static/admin/webhooks/index.html +++ b/static/admin/webhooks/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No Data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No Data

\ No newline at end of file