@htmlbricks/hb-chartjs 0.66.6 → 0.66.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/main.iife.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(vs){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const qa=2,ws="[",Ms="[!",ks="[?",Ss="]",He={},tt=Symbol(),Ga="http://www.w3.org/1999/xhtml",Ja=!1;var Za=Array.isArray,Qa=Array.prototype.indexOf,Pe=Array.prototype.includes,tl=Array.from,vi=Object.keys,wi=Object.defineProperty,De=Object.getOwnPropertyDescriptor,el=Object.prototype,il=Array.prototype,nl=Object.getPrototypeOf,Ps=Object.isExtensible;const sl=()=>{};function ol(i){for(var t=0;t<i.length;t++)i[t]()}function rl(){var i,t,e=new Promise((n,s)=>{i=n,t=s});return{promise:e,resolve:i,reject:t}}const q=2,Ae=4,Ds=8,As=1<<24,Vt=16,Ot=32,Wt=64,un=128,pt=512,Z=1024,rt=2048,St=4096,Ht=8192,jt=16384,oe=32768,Cs=1<<25,Mi=65536,Os=1<<17,al=1<<18,Ce=1<<19,ll=1<<20,re=65536,dn=1<<21,Ts=1<<22,je=1<<23,gn=Symbol("$state"),cl=Symbol("legacy props"),pn=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},mn=8;function Es(i){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function hl(i){throw new Error("https://svelte.dev/e/effect_in_teardown")}function fl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ul(i){throw new Error("https://svelte.dev/e/effect_orphan")}function dl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function gl(){throw new Error("https://svelte.dev/e/hydration_failed")}function pl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ml(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function bl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function _l(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function bn(i){console.warn("https://svelte.dev/e/hydration_mismatch")}function xl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let ht=!1;function ki(i){ht=i}let X;function Oe(i){if(i===null)throw bn(),He;return X=i}function Rs(){return Oe(le(X))}function yl(i){if(ht){if(le(X)!==null)throw bn(),He;X=i}}function vl(i=1){if(ht){for(var t=i,e=X;t--;)e=le(e);X=e}}function wl(i=!0){for(var t=0,e=X;;){if(e.nodeType===mn){var n=e.data;if(n===Ss){if(t===0)return e;t-=1}else(n===ws||n===Ms||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}var s=le(e);i&&e.remove(),e=s}}function Ls(i){return i===this.v}function Ml(i,t){return i!=i?t==t:i!==t||i!==null&&typeof i=="object"||typeof i=="function"}function kl(i){return!Ml(i,this.v)}let Sl=!1,ft=null;function Si(i){ft=i}function Is(i,t=!1,e){ft={p:ft,i:!1,c:null,e:null,s:i,x:null,r:L,l:null}}function Fs(i){var t=ft,e=t.e;if(e!==null){t.e=null;for(var n of e)ro(n)}return i!==void 0&&(t.x=i),t.i=!0,ft=t.p,i??{}}function zs(){return!0}let ae=[];function $s(){var i=ae;ae=[],ol(i)}function Te(i){if(ae.length===0&&!Ye){var t=ae;queueMicrotask(()=>{t===ae&&$s()})}ae.push(i)}function Pl(){for(;ae.length>0;)$s()}function Bs(i){var t=L;if(t===null)return T.f|=je,i;if((t.f&oe)===0&&(t.f&Ae)===0)throw i;Ee(i,t)}function Ee(i,t){for(;t!==null;){if((t.f&un)!==0){if((t.f&oe)===0)throw i;try{t.b.error(i);return}catch(e){i=e}}t=t.parent}throw i}const Dl=-7169;function G(i,t){i.f=i.f&Dl|t}function _n(i){(i.f&pt)!==0||i.deps===null?G(i,Z):G(i,St)}function Ns(i){if(i!==null)for(const t of i)(t.f&q)===0||(t.f&re)===0||(t.f^=re,Ns(t.deps))}function Vs(i,t,e){(i.f&rt)!==0?t.add(i):(i.f&St)!==0&&e.add(i),Ns(i.deps),G(i,Z)}const Yt=new Set;let Y=null,yt=null,xn=null,Ye=!1,yn=!1,Re=null,Pi=null;var Ws=0;let Al=1;class Ut{id=Al++;current=new Map;previous=new Map;#t=new Set;#i=new Set;#o=new Map;#l=new Map;#r=null;#e=[];#n=new Set;#s=new Set;#a=new Map;is_fork=!1;#f=!1;#c=new Set;#u(){return this.is_fork||this.#l.size>0}#g(){for(const n of this.#c)for(const s of n.#l.keys()){for(var t=!1,e=s;e.parent!==null;){if(this.#a.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(t){this.#a.has(t)||this.#a.set(t,{d:[],m:[]})}unskip_effect(t){var e=this.#a.get(t);if(e){this.#a.delete(t);for(var n of e.d)G(n,rt),this.schedule(n);for(n of e.m)G(n,St),this.schedule(n)}}#d(){if(Ws++>1e3&&(Yt.delete(this),Cl()),!this.#u()){for(const a of this.#n)this.#s.delete(a),G(a,rt),this.schedule(a);for(const a of this.#s)G(a,St),this.schedule(a)}const t=this.#e;this.#e=[],this.apply();var e=Re=[],n=[],s=Pi=[];for(const a of t)try{this.#h(a,e,n)}catch(l){throw Xs(a),l}if(Y=null,s.length>0){var o=Ut.ensure();for(const a of s)o.schedule(a)}if(Re=null,Pi=null,this.#u()||this.#g()){this.#p(n),this.#p(e);for(const[a,l]of this.#a)Us(a,l)}else{this.#o.size===0&&Yt.delete(this),this.#n.clear(),this.#s.clear();for(const a of this.#t)a(this);this.#t.clear(),Hs(n),Hs(e),this.#r?.resolve()}var r=Y;if(this.#e.length>0){const a=r??=this;a.#e.push(...this.#e.filter(l=>!a.#e.includes(l)))}r!==null&&(Yt.add(r),r.#d()),Yt.has(this)||this.#m()}#h(t,e,n){t.f^=Z;for(var s=t.first;s!==null;){var o=s.f,r=(o&(Ot|Wt))!==0,a=r&&(o&Z)!==0,l=a||(o&Ht)!==0||this.#a.has(s);if(!l&&s.fn!==null){r?s.f^=Z:(o&Ae)!==0?e.push(s):Ke(s)&&((o&Vt)!==0&&this.#s.add(s),Le(s));var c=s.first;if(c!==null){s=c;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}}#p(t){for(var e=0;e<t.length;e+=1)Vs(t[e],this.#n,this.#s)}capture(t,e,n=!1){e!==tt&&!this.previous.has(t)&&this.previous.set(t,e),(t.f&je)===0&&(this.current.set(t,[t.v,n]),yt?.set(t,t.v))}activate(){Y=this}deactivate(){Y=null,yt=null}flush(){try{yn=!0,Y=this,this.#d()}finally{Ws=0,xn=null,Re=null,Pi=null,yn=!1,Y=null,yt=null,Xt.clear()}}discard(){for(const t of this.#i)t(this);this.#i.clear(),Yt.delete(this)}#m(){for(const c of Yt){var t=c.id<this.id,e=[];for(const[h,[f,u]]of this.current){if(c.current.has(h)){var n=c.current.get(h)[0];if(t&&f!==n)c.current.set(h,[f,u]);else continue}e.push(h)}var s=[...c.current.keys()].filter(h=>!this.current.has(h));if(s.length===0)t&&c.discard();else if(e.length>0){c.activate();var o=new Set,r=new Map;for(var a of e)js(a,s,o,r);if(c.#e.length>0){c.apply();for(var l of c.#e)c.#h(l,[],[]);c.#e=[]}c.deactivate()}}for(const c of Yt)c.#c.has(this)&&(c.#c.delete(this),c.#c.size===0&&!c.#u()&&(c.activate(),c.#d()))}increment(t,e){let n=this.#o.get(e)??0;if(this.#o.set(e,n+1),t){let s=this.#l.get(e)??0;this.#l.set(e,s+1)}}decrement(t,e,n){let s=this.#o.get(e)??0;if(s===1?this.#o.delete(e):this.#o.set(e,s-1),t){let o=this.#l.get(e)??0;o===1?this.#l.delete(e):this.#l.set(e,o-1)}this.#f||n||(this.#f=!0,Te(()=>{this.#f=!1,this.flush()}))}transfer_effects(t,e){for(const n of t)this.#n.add(n);for(const n of e)this.#s.add(n);t.clear(),e.clear()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#i.add(t)}settled(){return(this.#r??=rl()).promise}static ensure(){if(Y===null){const t=Y=new Ut;yn||(Yt.add(Y),Ye||Te(()=>{Y===t&&t.flush()}))}return Y}apply(){{yt=null;return}}schedule(t){if(xn=t,t.b?.is_pending&&(t.f&(Ae|Ds|As))!==0&&(t.f&oe)===0){t.b.defer_effect(t);return}for(var e=t;e.parent!==null;){e=e.parent;var n=e.f;if(Re!==null&&e===L&&(T===null||(T.f&q)===0))return;if((n&(Wt|Ot))!==0){if((n&Z)===0)return;e.f^=Z}}this.#e.push(e)}}function vn(i){var t=Ye;Ye=!0;try{for(var e;;){if(Pl(),Y===null)return e;Y.flush()}}finally{Ye=t}}function Cl(){try{dl()}catch(i){Ee(i,xn)}}let Tt=null;function Hs(i){var t=i.length;if(t!==0){for(var e=0;e<t;){var n=i[e++];if((n.f&(jt|Ht))===0&&Ke(n)&&(Tt=new Set,Le(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&co(n),Tt?.size>0)){Xt.clear();for(const s of Tt){if((s.f&(jt|Ht))!==0)continue;const o=[s];let r=s.parent;for(;r!==null;)Tt.has(r)&&(Tt.delete(r),o.push(r)),r=r.parent;for(let a=o.length-1;a>=0;a--){const l=o[a];(l.f&(jt|Ht))===0&&Le(l)}}Tt.clear()}}Tt=null}}function js(i,t,e,n){if(!e.has(i)&&(e.add(i),i.reactions!==null))for(const s of i.reactions){const o=s.f;(o&q)!==0?js(s,t,e,n):(o&(Ts|Vt))!==0&&(o&rt)===0&&Ys(s,t,n)&&(G(s,rt),wn(s))}}function Ys(i,t,e){const n=e.get(i);if(n!==void 0)return n;if(i.deps!==null)for(const s of i.deps){if(Pe.call(t,s))return!0;if((s.f&q)!==0&&Ys(s,t,e))return e.set(s,!0),!0}return e.set(i,!1),!1}function wn(i){Y.schedule(i)}function Us(i,t){if(!((i.f&Ot)!==0&&(i.f&Z)!==0)){(i.f&rt)!==0?t.d.push(i):(i.f&St)!==0&&t.m.push(i),G(i,Z);for(var e=i.first;e!==null;)Us(e,t),e=e.next}}function Xs(i){G(i,Z);for(var t=i.first;t!==null;)Xs(t),t=t.next}function Ol(i){let t=0,e=Di(0),n;return()=>{An()&&(U(e),ao(()=>(t===0&&(n=On(()=>i(()=>Ue(e)))),t+=1,()=>{Te(()=>{t-=1,t===0&&(n?.(),n=void 0,Ue(e))})})))}}var Tl=Mi|Ce;function El(i,t,e,n){new Rl(i,t,e,n)}class Rl{parent;is_pending=!1;transform_error;#t;#i=ht?X:null;#o;#l;#r;#e=null;#n=null;#s=null;#a=null;#f=0;#c=0;#u=!1;#g=new Set;#d=new Set;#h=null;#p=Ol(()=>(this.#h=Di(this.#f),()=>{this.#h=null}));constructor(t,e,n,s){this.#t=t,this.#o=e,this.#l=o=>{var r=L;r.b=this,r.f|=un,n(o)},this.parent=L.b,this.transform_error=s??this.parent?.transform_error??(o=>o),this.#r=Xl(()=>{if(ht){const o=this.#i;Rs();const r=o.data===Ms;if(o.data.startsWith(ks)){const l=JSON.parse(o.data.slice(ks.length));this.#v(l)}else r?this.#w():this.#m()}else this.#x()},Tl),ht&&(this.#t=X)}#m(){try{this.#e=he(()=>this.#l(this.#t))}catch(t){this.error(t)}}#v(t){const e=this.#o.failed;e&&(this.#s=he(()=>{e(this.#t,()=>t,()=>()=>{})}))}#w(){const t=this.#o.pending;t&&(this.is_pending=!0,this.#n=he(()=>t(this.#t)),Te(()=>{var e=this.#a=document.createDocumentFragment(),n=Pn();e.append(n),this.#e=this.#_(()=>he(()=>this.#l(n))),this.#c===0&&(this.#t.before(e),this.#a=null,Ci(this.#n,()=>{this.#n=null}),this.#b(Y))}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#c=0,this.#f=0,this.#e=he(()=>{this.#l(this.#t)}),this.#c>0){var t=this.#a=document.createDocumentFragment();Gl(this.#e,t);const e=this.#o.pending;this.#n=he(()=>e(this.#t))}else this.#b(Y)}catch(e){this.error(e)}}#b(t){this.is_pending=!1,t.transfer_effects(this.#g,this.#d)}defer_effect(t){Vs(t,this.#g,this.#d)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#o.pending}#_(t){var e=L,n=T,s=ft;qt(this.#r),Pt(this.#r),Si(this.#r.ctx);try{return Ut.ensure(),t()}catch(o){return Bs(o),null}finally{qt(e),Pt(n),Si(s)}}#y(t,e){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(t,e);return}this.#c+=t,this.#c===0&&(this.#b(e),this.#n&&Ci(this.#n,()=>{this.#n=null}),this.#a&&(this.#t.before(this.#a),this.#a=null))}update_pending_count(t,e){this.#y(t,e),this.#f+=t,!(!this.#h||this.#u)&&(this.#u=!0,Te(()=>{this.#u=!1,this.#h&&Zs(this.#h,this.#f)}))}get_effect_pending(){return this.#p(),U(this.#h)}error(t){var e=this.#o.onerror;let n=this.#o.failed;if(!e&&!n)throw t;this.#e&&(vt(this.#e),this.#e=null),this.#n&&(vt(this.#n),this.#n=null),this.#s&&(vt(this.#s),this.#s=null),ht&&(Oe(this.#i),vl(),Oe(wl()));var s=!1,o=!1;const r=()=>{if(s){xl();return}s=!0,o&&_l(),this.#s!==null&&Ci(this.#s,()=>{this.#s=null}),this.#_(()=>{this.#x()})},a=l=>{try{o=!0,e?.(l,r),o=!1}catch(c){Ee(c,this.#r&&this.#r.parent)}n&&(this.#s=this.#_(()=>{try{return he(()=>{var c=L;c.b=this,c.f|=un,n(this.#t,()=>l,()=>r)})}catch(c){return Ee(c,this.#r.parent),null}}))};Te(()=>{var l;try{l=this.transform_error(t)}catch(c){Ee(c,this.#r&&this.#r.parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(a,c=>Ee(c,this.#r&&this.#r.parent)):a(l)})}}function Ks(i){var t=q|rt,e=T!==null&&(T.f&q)!==0?T:null;return L!==null&&(L.f|=Ce),{ctx:ft,deps:null,effects:null,equals:Ls,f:t,fn:i,reactions:null,rv:0,v:tt,wv:0,parent:e??L,ac:null}}function Ll(i){const t=Ks(i);return uo(t),t}function Il(i){var t=i.effects;if(t!==null){i.effects=null;for(var e=0;e<t.length;e+=1)vt(t[e])}}function Fl(i){for(var t=i.parent;t!==null;){if((t.f&q)===0)return(t.f&jt)===0?t:null;t=t.parent}return null}function Mn(i){var t,e=L;qt(Fl(i));try{i.f&=~re,Il(i),t=_o(i)}finally{qt(e)}return t}function qs(i){var t=i.v,e=Mn(i);if(!i.equals(e)&&(i.wv=mo(),(!Y?.is_fork||i.deps===null)&&(i.v=e,Y?.capture(i,t,!0),i.deps===null))){G(i,Z);return}Kt||(yt!==null?(An()||Y?.is_fork)&&yt.set(i,e):_n(i))}function zl(i){if(i.effects!==null)for(const t of i.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(pn),t.teardown=sl,t.ac=null,qe(t,0),Cn(t))}function Gs(i){if(i.effects!==null)for(const t of i.effects)t.teardown&&Le(t)}let kn=new Set;const Xt=new Map;let Js=!1;function Di(i,t){var e={f:0,v:i,reactions:null,equals:Ls,rv:0,wv:0};return e}function Et(i,t){const e=Di(i);return uo(e),e}function $l(i,t=!1,e=!0){const n=Di(i);return t||(n.equals=kl),n}function mt(i,t,e=!1){T!==null&&(!wt||(T.f&Os)!==0)&&zs()&&(T.f&(q|Vt|Ts|Os))!==0&&(bt===null||!Pe.call(bt,i))&&bl();let n=e?Xe(t):t;return Zs(i,n,Pi)}function Zs(i,t,e=null){if(!i.equals(t)){var n=i.v;Kt?Xt.set(i,t):Xt.set(i,n),i.v=t;var s=Ut.ensure();if(s.capture(i,n),(i.f&q)!==0){const o=i;(i.f&rt)!==0&&Mn(o),yt===null&&_n(o)}i.wv=mo(),Qs(i,rt,e),L!==null&&(L.f&Z)!==0&&(L.f&(Ot|Wt))===0&&(_t===null?Jl([i]):_t.push(i)),!s.is_fork&&kn.size>0&&!Js&&Bl()}return t}function Bl(){Js=!1;for(const i of kn)(i.f&Z)!==0&&G(i,St),Ke(i)&&Le(i);kn.clear()}function Ue(i){mt(i,i.v+1)}function Qs(i,t,e){var n=i.reactions;if(n!==null)for(var s=n.length,o=0;o<s;o++){var r=n[o],a=r.f,l=(a&rt)===0;if(l&&G(r,t),(a&q)!==0){var c=r;yt?.delete(c),(a&re)===0&&(a&pt&&(r.f|=re),Qs(c,St,e))}else if(l){var h=r;(a&Vt)!==0&&Tt!==null&&Tt.add(h),e!==null?e.push(h):wn(h)}}}function Xe(i){if(typeof i!="object"||i===null||gn in i)return i;const t=nl(i);if(t!==el&&t!==il)return i;var e=new Map,n=Za(i),s=Et(0),o=ue,r=a=>{if(ue===o)return a();var l=T,c=ue;Pt(null),po(o);var h=a();return Pt(l),po(c),h};return n&&e.set("length",Et(i.length)),new Proxy(i,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&pl();var h=e.get(l);return h===void 0?r(()=>{var f=Et(c.value);return e.set(l,f),f}):mt(h,c.value,!0),!0},deleteProperty(a,l){var c=e.get(l);if(c===void 0){if(l in a){const h=r(()=>Et(tt));e.set(l,h),Ue(s)}}else mt(c,tt),Ue(s);return!0},get(a,l,c){if(l===gn)return i;var h=e.get(l),f=l in a;if(h===void 0&&(!f||De(a,l)?.writable)&&(h=r(()=>{var d=Xe(f?a[l]:tt),g=Et(d);return g}),e.set(l,h)),h!==void 0){var u=U(h);return u===tt?void 0:u}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var h=e.get(l);h&&(c.value=U(h))}else if(c===void 0){var f=e.get(l),u=f?.v;if(f!==void 0&&u!==tt)return{enumerable:!0,configurable:!0,value:u,writable:!0}}return c},has(a,l){if(l===gn)return!0;var c=e.get(l),h=c!==void 0&&c.v!==tt||Reflect.has(a,l);if(c!==void 0||L!==null&&(!h||De(a,l)?.writable)){c===void 0&&(c=r(()=>{var u=h?Xe(a[l]):tt,d=Et(u);return d}),e.set(l,c));var f=U(c);if(f===tt)return!1}return h},set(a,l,c,h){var f=e.get(l),u=l in a;if(n&&l==="length")for(var d=c;d<f.v;d+=1){var g=e.get(d+"");g!==void 0?mt(g,tt):d in a&&(g=r(()=>Et(tt)),e.set(d+"",g))}if(f===void 0)(!u||De(a,l)?.writable)&&(f=r(()=>Et(void 0)),mt(f,Xe(c)),e.set(l,f));else{u=f.v!==tt;var p=r(()=>Xe(c));mt(f,p)}var m=Reflect.getOwnPropertyDescriptor(a,l);if(m?.set&&m.set.call(h,c),!u){if(n&&typeof l=="string"){var b=e.get("length"),_=Number(l);Number.isInteger(_)&&_>=b.v&&mt(b,_+1)}Ue(s)}return!0},ownKeys(a){U(s);var l=Reflect.ownKeys(a).filter(f=>{var u=e.get(f);return u===void 0||u.v!==tt});for(var[c,h]of e)h.v!==tt&&!(c in a)&&l.push(c);return l},setPrototypeOf(){ml()}})}var to,eo,io,no;function Sn(){if(to===void 0){to=window,eo=/Firefox/.test(navigator.userAgent);var i=Element.prototype,t=Node.prototype,e=Text.prototype;io=De(t,"firstChild").get,no=De(t,"nextSibling").get,Ps(i)&&(i.__click=void 0,i.__className=void 0,i.__attributes=null,i.__style=void 0,i.__e=void 0),Ps(e)&&(e.__t=void 0)}}function Pn(i=""){return document.createTextNode(i)}function Ai(i){return io.call(i)}function le(i){return no.call(i)}function Nl(i,t){if(!ht)return Ai(i);var e=Ai(X);return e===null&&(e=X.appendChild(Pn())),Oe(e),e}function Vl(i){i.textContent=""}function Dn(i,t,e){return document.createElementNS(Ga,i,void 0)}function so(i){var t=T,e=L;Pt(null),qt(null);try{return i()}finally{Pt(t),qt(e)}}function Wl(i){L===null&&(T===null&&ul(),fl()),Kt&&hl()}function Hl(i,t){var e=t.last;e===null?t.last=t.first=i:(e.next=i,i.prev=e,t.last=i)}function ce(i,t){var e=L;e!==null&&(e.f&Ht)!==0&&(i|=Ht);var n={ctx:ft,deps:null,nodes:null,f:i|rt|pt,first:null,fn:t,last:null,next:null,parent:e,b:e&&e.b,prev:null,teardown:null,wv:0,ac:null},s=n;if((i&Ae)!==0)Re!==null?Re.push(n):Ut.ensure().schedule(n);else if(t!==null){try{Le(n)}catch(r){throw vt(n),r}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Ce)===0&&(s=s.first,(i&Vt)!==0&&(i&Mi)!==0&&s!==null&&(s.f|=Mi))}if(s!==null&&(s.parent=e,e!==null&&Hl(s,e),T!==null&&(T.f&q)!==0&&(i&Wt)===0)){var o=T;(o.effects??=[]).push(s)}return n}function An(){return T!==null&&!wt}function oo(i){Wl();var t=L.f,e=!T&&(t&Ot)!==0&&(t&oe)===0;if(e){var n=ft;(n.e??=[]).push(i)}else return ro(i)}function ro(i){return ce(Ae|ll,i)}function jl(i){Ut.ensure();const t=ce(Wt|Ce,i);return()=>{vt(t)}}function Yl(i){Ut.ensure();const t=ce(Wt|Ce,i);return(e={})=>new Promise(n=>{e.outro?Ci(t,()=>{vt(t),n(void 0)}):(vt(t),n(void 0))})}function Ul(i){return ce(Ae,i)}function ao(i,t=0){return ce(Ds|t,i)}function Xl(i,t=0){var e=ce(Vt|t,i);return e}function he(i){return ce(Ot|Ce,i)}function lo(i){var t=i.teardown;if(t!==null){const e=Kt,n=T;fo(!0),Pt(null);try{t.call(null)}finally{fo(e),Pt(n)}}}function Cn(i,t=!1){var e=i.first;for(i.first=i.last=null;e!==null;){const s=e.ac;s!==null&&so(()=>{s.abort(pn)});var n=e.next;(e.f&Wt)!==0?e.parent=null:vt(e,t),e=n}}function Kl(i){for(var t=i.first;t!==null;){var e=t.next;(t.f&Ot)===0&&vt(t),t=e}}function vt(i,t=!0){var e=!1;(t||(i.f&al)!==0)&&i.nodes!==null&&i.nodes.end!==null&&(ql(i.nodes.start,i.nodes.end),e=!0),G(i,Cs),Cn(i,t&&!e),qe(i,0);var n=i.nodes&&i.nodes.t;if(n!==null)for(const o of n)o.stop();lo(i),i.f^=Cs,i.f|=jt;var s=i.parent;s!==null&&s.first!==null&&co(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.fn=i.nodes=i.ac=i.b=null}function ql(i,t){for(;i!==null;){var e=i===t?null:le(i);i.remove(),i=e}}function co(i){var t=i.parent,e=i.prev,n=i.next;e!==null&&(e.next=n),n!==null&&(n.prev=e),t!==null&&(t.first===i&&(t.first=n),t.last===i&&(t.last=e))}function Ci(i,t,e=!0){var n=[];ho(i,n,!0);var s=()=>{e&&vt(i),t&&t()},o=n.length;if(o>0){var r=()=>--o||s();for(var a of n)a.out(r)}else s()}function ho(i,t,e){if((i.f&Ht)===0){i.f^=Ht;var n=i.nodes&&i.nodes.t;if(n!==null)for(const a of n)(a.is_global||e)&&t.push(a);for(var s=i.first;s!==null;){var o=s.next,r=(s.f&Mi)!==0||(s.f&Ot)!==0&&(i.f&Vt)!==0;ho(s,t,r?e:!1),s=o}}}function Gl(i,t){if(i.nodes)for(var e=i.nodes.start,n=i.nodes.end;e!==null;){var s=e===n?null:le(e);t.append(e),e=s}}let Oi=!1,Kt=!1;function fo(i){Kt=i}let T=null,wt=!1;function Pt(i){T=i}let L=null;function qt(i){L=i}let bt=null;function uo(i){T!==null&&(bt===null?bt=[i]:bt.push(i))}let at=null,ut=0,_t=null;function Jl(i){_t=i}let go=1,fe=0,ue=fe;function po(i){ue=i}function mo(){return++go}function Ke(i){var t=i.f;if((t&rt)!==0)return!0;if(t&q&&(i.f&=~re),(t&St)!==0){for(var e=i.deps,n=e.length,s=0;s<n;s++){var o=e[s];if(Ke(o)&&qs(o),o.wv>i.wv)return!0}(t&pt)!==0&&yt===null&&G(i,Z)}return!1}function bo(i,t,e=!0){var n=i.reactions;if(n!==null&&!(bt!==null&&Pe.call(bt,i)))for(var s=0;s<n.length;s++){var o=n[s];(o.f&q)!==0?bo(o,t,!1):t===o&&(e?G(o,rt):(o.f&Z)!==0&&G(o,St),wn(o))}}function _o(i){var t=at,e=ut,n=_t,s=T,o=bt,r=ft,a=wt,l=ue,c=i.f;at=null,ut=0,_t=null,T=(c&(Ot|Wt))===0?i:null,bt=null,Si(i.ctx),wt=!1,ue=++fe,i.ac!==null&&(so(()=>{i.ac.abort(pn)}),i.ac=null);try{i.f|=dn;var h=i.fn,f=h();i.f|=oe;var u=i.deps,d=Y?.is_fork;if(at!==null){var g;if(d||qe(i,ut),u!==null&&ut>0)for(u.length=ut+at.length,g=0;g<at.length;g++)u[ut+g]=at[g];else i.deps=u=at;if(An()&&(i.f&pt)!==0)for(g=ut;g<u.length;g++)(u[g].reactions??=[]).push(i)}else!d&&u!==null&&ut<u.length&&(qe(i,ut),u.length=ut);if(zs()&&_t!==null&&!wt&&u!==null&&(i.f&(q|St|rt))===0)for(g=0;g<_t.length;g++)bo(_t[g],i);if(s!==null&&s!==i){if(fe++,s.deps!==null)for(let p=0;p<e;p+=1)s.deps[p].rv=fe;if(t!==null)for(const p of t)p.rv=fe;_t!==null&&(n===null?n=_t:n.push(..._t))}return(i.f&je)!==0&&(i.f^=je),f}catch(p){return Bs(p)}finally{i.f^=dn,at=t,ut=e,_t=n,T=s,bt=o,Si(r),wt=a,ue=l}}function Zl(i,t){let e=t.reactions;if(e!==null){var n=Qa.call(e,i);if(n!==-1){var s=e.length-1;s===0?e=t.reactions=null:(e[n]=e[s],e.pop())}}if(e===null&&(t.f&q)!==0&&(at===null||!Pe.call(at,t))){var o=t;(o.f&pt)!==0&&(o.f^=pt,o.f&=~re),_n(o),zl(o),qe(o,0)}}function qe(i,t){var e=i.deps;if(e!==null)for(var n=t;n<e.length;n++)Zl(i,e[n])}function Le(i){var t=i.f;if((t&jt)===0){G(i,Z);var e=L,n=Oi;L=i,Oi=!0;try{(t&(Vt|As))!==0?Kl(i):Cn(i),lo(i);var s=_o(i);i.teardown=typeof s=="function"?s:null,i.wv=go;var o;Ja&&Sl&&(i.f&rt)!==0&&i.deps}finally{Oi=n,L=e}}}function U(i){var t=i.f,e=(t&q)!==0;if(T!==null&&!wt){var n=L!==null&&(L.f&jt)!==0;if(!n&&(bt===null||!Pe.call(bt,i))){var s=T.deps;if((T.f&dn)!==0)i.rv<fe&&(i.rv=fe,at===null&&s!==null&&s[ut]===i?ut++:at===null?at=[i]:at.push(i));else{(T.deps??=[]).push(i);var o=i.reactions;o===null?i.reactions=[T]:Pe.call(o,T)||o.push(T)}}}if(Kt&&Xt.has(i))return Xt.get(i);if(e){var r=i;if(Kt){var a=r.v;return((r.f&Z)===0&&r.reactions!==null||yo(r))&&(a=Mn(r)),Xt.set(r,a),a}var l=(r.f&pt)===0&&!wt&&T!==null&&(Oi||(T.f&pt)!==0),c=(r.f&oe)===0;Ke(r)&&(l&&(r.f|=pt),qs(r)),l&&!c&&(Gs(r),xo(r))}if(yt?.has(i))return yt.get(i);if((i.f&je)!==0)throw i.v;return i.v}function xo(i){if(i.f|=pt,i.deps!==null)for(const t of i.deps)(t.reactions??=[]).push(i),(t.f&q)!==0&&(t.f&pt)===0&&(Gs(t),xo(t))}function yo(i){if(i.v===tt)return!0;if(i.deps===null)return!1;for(const t of i.deps)if(Xt.has(t)||(t.f&q)!==0&&yo(t))return!0;return!1}function On(i){var t=wt;try{return wt=!0,i()}finally{wt=t}}const Ge=Symbol("events"),vo=new Set,Tn=new Set;function Ql(i,t,e){(t[Ge]??={})[i]=e}function tc(i){for(var t=0;t<i.length;t++)vo.add(i[t]);for(var e of Tn)e(i)}let wo=null;function Mo(i){var t=this,e=t.ownerDocument,n=i.type,s=i.composedPath?.()||[],o=s[0]||i.target;wo=i;var r=0,a=wo===i&&i[Ge];if(a){var l=s.indexOf(a);if(l!==-1&&(t===document||t===window)){i[Ge]=t;return}var c=s.indexOf(t);if(c===-1)return;l<=c&&(r=l)}if(o=s[r]||i.target,o!==t){wi(i,"currentTarget",{configurable:!0,get(){return o||e}});var h=T,f=L;Pt(null),qt(null);try{for(var u,d=[];o!==null;){var g=o.assignedSlot||o.parentNode||o.host||null;try{var p=o[Ge]?.[n];p!=null&&(!o.disabled||i.target===o)&&p.call(o,i)}catch(m){u?d.push(m):u=m}if(i.cancelBubble||g===t||g===null)break;o=g}if(u){for(let m of d)queueMicrotask(()=>{throw m});throw u}}finally{i[Ge]=t,delete i.currentTarget,Pt(h),qt(f)}}}const ec=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:i=>i});function ic(i){return ec?.createHTML(i)??i}function nc(i){var t=Dn("template");return t.innerHTML=ic(i.replaceAll("<!>","<!---->")),t.content}function En(i,t){var e=L;e.nodes===null&&(e.nodes={start:i,end:t,a:null,t:null})}function sc(i,t){var e=(t&qa)!==0,n,s=!i.startsWith("<!>");return()=>{if(ht)return En(X,null),X;n===void 0&&(n=nc(s?i:"<!>"+i),n=Ai(n));var o=e||eo?document.importNode(n,!0):n.cloneNode(!0);return En(o,o),o}}function ko(i,t){if(ht){var e=L;((e.f&oe)===0||e.nodes.end===null)&&(e.nodes.end=X),Rs();return}i!==null&&i.before(t)}const oc=["touchstart","touchmove"];function rc(i){return oc.includes(i)}function So(i,t){return Po(i,t)}function ac(i,t){Sn(),t.intro=t.intro??!1;const e=t.target,n=ht,s=X;try{for(var o=Ai(e);o&&(o.nodeType!==mn||o.data!==ws);)o=le(o);if(!o)throw He;ki(!0),Oe(o);const r=Po(i,{...t,anchor:o});return ki(!1),r}catch(r){if(r instanceof Error&&r.message.split(`
2
- `).some(a=>a.startsWith("https://svelte.dev/e/")))throw r;return r!==He&&console.warn("Failed to hydrate: ",r),t.recover===!1&&gl(),Sn(),Vl(e),ki(!1),So(i,t)}finally{ki(n),Oe(s)}}const Ti=new Map;function Po(i,{target:t,anchor:e,props:n={},events:s,context:o,intro:r=!0,transformError:a}){Sn();var l=void 0,c=Yl(()=>{var h=e??t.appendChild(Pn());El(h,{pending:()=>{}},d=>{Is({});var g=ft;if(o&&(g.c=o),s&&(n.$$events=s),ht&&En(d,null),l=i(d,n)||{},ht&&(L.nodes.end=X,X===null||X.nodeType!==mn||X.data!==Ss))throw bn(),He;Fs()},a);var f=new Set,u=d=>{for(var g=0;g<d.length;g++){var p=d[g];if(!f.has(p)){f.add(p);var m=rc(p);for(const y of[t,document]){var b=Ti.get(y);b===void 0&&(b=new Map,Ti.set(y,b));var _=b.get(p);_===void 0?(y.addEventListener(p,Mo,{passive:m}),b.set(p,1)):b.set(p,_+1)}}}};return u(tl(vo)),Tn.add(u),()=>{for(var d of f)for(const m of[t,document]){var g=Ti.get(m),p=g.get(d);--p==0?(m.removeEventListener(d,Mo),g.delete(d),g.size===0&&Ti.delete(m)):g.set(d,p)}Tn.delete(u),h!==e&&h.parentNode?.removeChild(h)}});return Rn.set(l,c),l}let Rn=new WeakMap;function lc(i,t){const e=Rn.get(i);return e?(Rn.delete(i),e(t)):Promise.resolve()}function Do(i){ft===null&&Es(),oo(()=>{const t=On(i);if(typeof t=="function")return t})}function cc(i){ft===null&&Es(),Do(()=>()=>On(i))}function hc(i,t){Ul(()=>{var e=i.getRootNode(),n=e.host?e:e.head??e.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const s=Dn("style");s.id=t.hash,s.textContent=t.code,n.appendChild(s)}})}function Ao(i,t,e,n){var s=n,o=!0,r=()=>(o&&(o=!1,s=n),s),a;a=i[t],a===void 0&&n!==void 0&&(a=r());var l;l=()=>{var u=i[t];return u===void 0?r():(o=!0,u)};var c=!1,h=Ks(()=>(c=!1,l())),f=L;return(function(u,d){if(arguments.length>0){const g=d?U(h):u;return mt(h,g),c=!0,s!==void 0&&(s=g),u}return Kt&&c||(f.f&jt)!==0?h.v:U(h)})}function fc(i){return new uc(i)}class uc{#t;#i;constructor(t){var e=new Map,n=(o,r)=>{var a=$l(r,!1,!1);return e.set(o,a),a};const s=new Proxy({...t.props||{},$$events:{}},{get(o,r){return U(e.get(r)??n(r,Reflect.get(o,r)))},has(o,r){return r===cl?!0:(U(e.get(r)??n(r,Reflect.get(o,r))),Reflect.has(o,r))},set(o,r,a){return mt(e.get(r)??n(r,a),a),Reflect.set(o,r,a)}});this.#i=(t.hydrate?ac:So)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&vn(),this.#t=s.$$events;for(const o of Object.keys(this.#i))o==="$set"||o==="$destroy"||o==="$on"||wi(this,o,{get(){return this.#i[o]},set(r){this.#i[o]=r},enumerable:!0});this.#i.$set=o=>{Object.assign(s,o)},this.#i.$destroy=()=>{lc(this.#i)}}$set(t){this.#i.$set(t)}$on(t,e){this.#t[t]=this.#t[t]||[];const n=(...s)=>e.call(this,...s);return this.#t[t].push(n),()=>{this.#t[t]=this.#t[t].filter(s=>s!==n)}}$destroy(){this.#i.$destroy()}}let Co;typeof HTMLElement=="function"&&(Co=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(i,t,e){super(),this.$$ctor=i,this.$$s=t,e&&(this.$$shadowRoot=this.attachShadow(e))}addEventListener(i,t,e){if(this.$$l[i]=this.$$l[i]||[],this.$$l[i].push(t),this.$$c){const n=this.$$c.$on(i,t);this.$$l_u.set(t,n)}super.addEventListener(i,t,e)}removeEventListener(i,t,e){if(super.removeEventListener(i,t,e),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let i=function(n){return s=>{const o=Dn("slot");n!=="default"&&(o.name=n),ko(s,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},e=dc(this);for(const n of this.$$s)n in e&&(n==="default"&&!this.$$d.children?(this.$$d.children=i(n),t.default=!0):t[n]=i(n));for(const n of this.attributes){const s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=Ei(s,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=fc({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=jl(()=>{ao(()=>{this.$$r=!0;for(const n of vi(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const s=Ei(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1})});for(const n in this.$$l)for(const s of this.$$l[n]){const o=this.$$c.$on(n,s);this.$$l_u.set(s,o)}this.$$l={}}}attributeChangedCallback(i,t,e){this.$$r||(i=this.$$g_p(i),this.$$d[i]=Ei(i,e,this.$$p_d,"toProp"),this.$$c?.$set({[i]:this.$$d[i]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(i){return vi(this.$$p_d).find(t=>this.$$p_d[t].attribute===i||!this.$$p_d[t].attribute&&t.toLowerCase()===i)||i}});function Ei(i,t,e,n){const s=e[i]?.type;if(t=s==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!e[i])return t;if(n==="toAttribute")switch(s){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(s){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function dc(i){const t={};return i.childNodes.forEach(e=>{t[e.slot||"default"]=!0}),t}function gc(i,t,e,n,s,o){let r=class extends Co{constructor(){super(i,e,s),this.$$p_d=t}static get observedAttributes(){return vi(t).map(a=>(t[a].attribute||a).toLowerCase())}};return vi(t).forEach(a=>{wi(r.prototype,a,{get(){return this.$$c&&a in this.$$c?this.$$c[a]:this.$$d[a]},set(l){l=Ei(a,l,t),this.$$d[a]=l;var c=this.$$c;if(c){var h=De(c,a)?.get;h?c[a]=l:c.$set({[a]:l})}}})}),n.forEach(a=>{wi(r.prototype,a,{get(){return this.$$c?.[a]}})}),i.element=r,r}function Oo(i,t=100,e={}){if(typeof i!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof i}\`.`);if(t<0)throw new RangeError("`wait` must not be negative.");if(typeof e=="boolean")throw new TypeError("The `options` parameter must be an object, not a boolean. Use `{immediate: true}` instead.");const{immediate:n}=e;let s,o,r,a,l;function c(){const u=s,d=o;return s=void 0,o=void 0,l=i.apply(u,d),l}function h(){const u=Date.now()-a;u<t&&u>=0?r=setTimeout(h,t-u):(r=void 0,n||(l=c()))}const f=function(...u){if(s&&this!==s&&Object.getPrototypeOf(this)===Object.getPrototypeOf(s))throw new Error("Debounced method called with different contexts of the same prototype.");s=this,o=u,a=Date.now();const d=n&&!r;if(r||(r=setTimeout(h,t)),d)return l=c(),l};return Object.defineProperty(f,"isPending",{get(){return r!==void 0}}),f.clear=()=>{r&&(clearTimeout(r),r=void 0,s=void 0,o=void 0)},f.flush=()=>{r&&f.trigger()},f.trigger=()=>{l=c(),f.clear()},f}function Je(i){return i+.5|0}const Gt=(i,t,e)=>Math.max(Math.min(i,e),t);function Ze(i){return Gt(Je(i*2.55),0,255)}function Jt(i){return Gt(Je(i*255),0,255)}function Rt(i){return Gt(Je(i/2.55)/100,0,1)}function To(i){return Gt(Je(i*100),0,100)}const xt={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},Ln=[..."0123456789ABCDEF"],pc=i=>Ln[i&15],mc=i=>Ln[(i&240)>>4]+Ln[i&15],Ri=i=>(i&240)>>4===(i&15),bc=i=>Ri(i.r)&&Ri(i.g)&&Ri(i.b)&&Ri(i.a);function _c(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&xt[i[1]]*17,g:255&xt[i[2]]*17,b:255&xt[i[3]]*17,a:t===5?xt[i[4]]*17:255}:(t===7||t===9)&&(e={r:xt[i[1]]<<4|xt[i[2]],g:xt[i[3]]<<4|xt[i[4]],b:xt[i[5]]<<4|xt[i[6]],a:t===9?xt[i[7]]<<4|xt[i[8]]:255})),e}const xc=(i,t)=>i<255?t(i):"";function yc(i){var t=bc(i)?pc:mc;return i?"#"+t(i.r)+t(i.g)+t(i.b)+xc(i.a,t):void 0}const vc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Eo(i,t,e){const n=t*Math.min(e,1-e),s=(o,r=(o+i/30)%12)=>e-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function wc(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Mc(i,t,e){const n=Eo(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function kc(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function In(i){const e=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(e,n,s),r=Math.min(e,n,s),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=kc(e,n,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Fn(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(Jt)}function zn(i,t,e){return Fn(Eo,i,t,e)}function Sc(i,t,e){return Fn(Mc,i,t,e)}function Pc(i,t,e){return Fn(wc,i,t,e)}function Ro(i){return(i%360+360)%360}function Dc(i){const t=vc.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?Ze(+t[5]):Jt(+t[5]));const s=Ro(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=Sc(s,o,r):t[1]==="hsv"?n=Pc(s,o,r):n=zn(s,o,r),{r:n[0],g:n[1],b:n[2],a:e}}function Ac(i,t){var e=In(i);e[0]=Ro(e[0]+t),e=zn(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Cc(i){if(!i)return;const t=In(i),e=t[0],n=To(t[1]),s=To(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${Rt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const Lo={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Io={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Oc(){const i={},t=Object.keys(Io),e=Object.keys(Lo);let n,s,o,r,a;for(n=0;n<t.length;n++){for(r=a=t[n],s=0;s<e.length;s++)o=e[s],a=a.replace(o,Lo[o]);o=parseInt(Io[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let Li;function Tc(i){Li||(Li=Oc(),Li.transparent=[0,0,0,0]);const t=Li[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Ec=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Rc(i){const t=Ec.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const r=+t[7];e=t[8]?Ze(r):Gt(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?Ze(n):Gt(n,0,255)),s=255&(t[4]?Ze(s):Gt(s,0,255)),o=255&(t[6]?Ze(o):Gt(o,0,255)),{r:n,g:s,b:o,a:e}}}function Lc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Rt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const $n=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Ie=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Ic(i,t,e){const n=Ie(Rt(i.r)),s=Ie(Rt(i.g)),o=Ie(Rt(i.b));return{r:Jt($n(n+e*(Ie(Rt(t.r))-n))),g:Jt($n(s+e*(Ie(Rt(t.g))-s))),b:Jt($n(o+e*(Ie(Rt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function Ii(i,t,e){if(i){let n=In(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=zn(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function Fo(i,t){return i&&Object.assign(t||{},i)}function zo(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Jt(i[3]))):(t=Fo(i,{r:0,g:0,b:0,a:1}),t.a=Jt(t.a)),t}function Fc(i){return i.charAt(0)==="r"?Rc(i):Dc(i)}class Qe{constructor(t){if(t instanceof Qe)return t;const e=typeof t;let n;e==="object"?n=zo(t):e==="string"&&(n=_c(t)||Tc(t)||Fc(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Fo(this._rgb);return t&&(t.a=Rt(t.a)),t}set rgb(t){this._rgb=zo(t)}rgbString(){return this._valid?Lc(this._rgb):void 0}hexString(){return this._valid?yc(this._rgb):void 0}hslString(){return this._valid?Cc(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Ic(this._rgb,t._rgb,e)),this}clone(){return new Qe(this.rgb)}alpha(t){return this._rgb.a=Jt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Je(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.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 Ii(this._rgb,2,t),this}darken(t){return Ii(this._rgb,2,-t),this}saturate(t){return Ii(this._rgb,1,t),this}desaturate(t){return Ii(this._rgb,1,-t),this}rotate(t){return Ac(this._rgb,t),this}}function Lt(){}const zc=(()=>{let i=0;return()=>i++})();function C(i){return i==null}function B(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function O(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function V(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function dt(i,t){return V(i)?i:t}function P(i,t){return typeof i>"u"?t:i}const $c=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,$o=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function z(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function I(i,t,e,n){let s,o,r;if(B(i))for(o=i.length,s=0;s<o;s++)t.call(e,i[s],s);else if(O(i))for(r=Object.keys(i),o=r.length,s=0;s<o;s++)t.call(e,i[r[s]],r[s])}function Fi(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function zi(i){if(B(i))return i.map(zi);if(O(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=zi(i[e[s]]);return t}return i}function Bo(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Bc(i,t,e,n){if(!Bo(i))return;const s=t[i],o=e[i];O(s)&&O(o)?ti(s,o,n):t[i]=zi(o)}function ti(i,t,e){const n=B(t)?t:[t],s=n.length;if(!O(i))return i;e=e||{};const o=e.merger||Bc;let r;for(let a=0;a<s;++a){if(r=n[a],!O(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function ei(i,t){return ti(i,t,{merger:Nc})}function Nc(i,t,e){if(!Bo(i))return;const n=t[i],s=e[i];O(n)&&O(s)?ei(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=zi(s))}const No={"":i=>i,x:i=>i.x,y:i=>i.y};function Vc(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Wc(i){const t=Vc(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Zt(i,t){return(No[t]||(No[t]=Wc(t)))(i)}function Bn(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ii=i=>typeof i<"u",Qt=i=>typeof i=="function",Vo=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Hc(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const R=Math.PI,$=2*R,jc=$+R,$i=Number.POSITIVE_INFINITY,Yc=R/180,H=R/2,de=R/4,Wo=R*2/3,te=Math.log10,Dt=Math.sign;function ni(i,t,e){return Math.abs(i-t)<e}function Ho(i){const t=Math.round(i);i=ni(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(te(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Uc(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function Xc(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Fe(i){return!Xc(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Kc(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function jo(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Mt(i){return i*(R/180)}function Nn(i){return i*(180/R)}function Yo(i){if(!V(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Uo(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*R&&(o+=$),{angle:o,distance:s}}function Vn(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function qc(i,t){return(i-t+jc)%$-R}function et(i){return(i%$+$)%$}function si(i,t,e,n){const s=et(i),o=et(t),r=et(e),a=et(o-s),l=et(r-s),c=et(s-o),h=et(s-r);return s===o||s===r||n&&o===r||a>l&&c<h}function J(i,t,e){return Math.max(t,Math.min(e,i))}function Gc(i){return J(i,-32768,32767)}function It(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Wn(i,t,e){e=e||(r=>i[r]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Ft=(i,t,e,n)=>Wn(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),Jc=(i,t,e)=>Wn(i,e,n=>i[n][t]>=e);function Zc(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const Xo=["push","pop","shift","splice","unshift"];function Qc(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Xo.forEach(e=>{const n="_onData"+Bn(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function Ko(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(Xo.forEach(o=>{delete i[o]}),delete i._chartjs)}function qo(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Go=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Jo(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Go.call(window,()=>{n=!1,i.apply(t,e)}))}}function th(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Hn=i=>i==="start"?"left":i==="end"?"right":"center",it=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,eh=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function Zo(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:f,max:u,minDefined:d,maxDefined:g}=r.getUserBounds();if(d){if(s=Math.min(Ft(l,h,f).lo,e?n:Ft(t,h,r.getPixelForValue(f)).lo),c){const p=l.slice(0,s+1).reverse().findIndex(m=>!C(m[a.axis]));s-=Math.max(0,p)}s=J(s,0,n-1)}if(g){let p=Math.max(Ft(l,r.axis,u,!0).hi+1,e?0:Ft(t,h,r.getPixelForValue(u),!0).hi+1);if(c){const m=l.slice(p-1).findIndex(b=>!C(b[a.axis]));p+=Math.max(0,m)}o=J(p,s,n)-s}else o=n-s}return{start:s,count:o}}function Qo(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const Bi=i=>i===0||i===1,tr=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*$/e)),er=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*$/e)+1,oi={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*H)+1,easeOutSine:i=>Math.sin(i*H),easeInOutSine:i=>-.5*(Math.cos(R*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Bi(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Bi(i)?i:tr(i,.075,.3),easeOutElastic:i=>Bi(i)?i:er(i,.075,.3),easeInOutElastic(i){return Bi(i)?i:i<.5?.5*tr(i*2,.1125,.45):.5+.5*er(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-oi.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?oi.easeInBounce(i*2)*.5:oi.easeOutBounce(i*2-1)*.5+.5};function jn(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ir(i){return jn(i)?i:new Qe(i)}function Yn(i){return jn(i)?i:new Qe(i).saturate(.5).darken(.1).hexString()}const ih=["x","y","borderWidth","radius","tension"],nh=["color","borderColor","backgroundColor"];function sh(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:nh},numbers:{type:"number",properties:ih}}),i.describe("animations",{_fallback:"animation"}),i.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=>t|0}}}})}function oh(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const nr=new Map;function rh(i,t){t=t||{};const e=i+JSON.stringify(t);let n=nr.get(e);return n||(n=new Intl.NumberFormat(i,t),nr.set(e,n)),n}function ri(i,t,e){return rh(t,e).format(i)}const sr={values(i){return B(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=ah(i,e)}const r=te(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ri(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(te(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?sr.numeric.call(this,i,t,e):""}};function ah(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Ni={formatters:sr};function lh(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ni.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ge=Object.create(null),Un=Object.create(null);function ai(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function Xn(i,t,e){return typeof t=="string"?ti(ai(i,t),e):ti(ai(i,""),t)}class ch{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.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=(n,s)=>Yn(s.backgroundColor),this.hoverBorderColor=(n,s)=>Yn(s.borderColor),this.hoverColor=(n,s)=>Yn(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xn(this,t,e)}get(t){return ai(this,t)}describe(t,e){return Xn(Un,t,e)}override(t,e){return Xn(ge,t,e)}route(t,e,n,s){const o=ai(this,t),r=ai(this,n),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[s];return O(l)?Object.assign({},c,l):P(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var W=new ch({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[sh,oh,lh]);function hh(i){return!i||C(i.size)||C(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Vi(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function fh(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,f,u;for(l=0;l<a;l++)if(f=e[l],f!=null&&!B(f))r=Vi(i,s,o,r,f);else if(B(f))for(c=0,h=f.length;c<h;c++)u=f[c],u!=null&&!B(u)&&(r=Vi(i,s,o,r,u));i.restore();const d=o.length/2;if(d>e.length){for(l=0;l<d;l++)delete s[o[l]];o.splice(0,d)}return r}function pe(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function or(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Kn(i,t,e,n){rr(i,t,e,n,null)}function rr(i,t,e,n,s){let o,r,a,l,c,h,f,u;const d=t.pointStyle,g=t.rotation,p=t.radius;let m=(g||0)*Yc;if(d&&typeof d=="object"&&(o=d.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(m),i.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),d){default:s?i.ellipse(e,n,s/2,p,0,0,$):i.arc(e,n,p,0,$),i.closePath();break;case"triangle":h=s?s/2:p,i.moveTo(e+Math.sin(m)*h,n-Math.cos(m)*p),m+=Wo,i.lineTo(e+Math.sin(m)*h,n-Math.cos(m)*p),m+=Wo,i.lineTo(e+Math.sin(m)*h,n-Math.cos(m)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,r=Math.cos(m+de)*l,f=Math.cos(m+de)*(s?s/2-c:l),a=Math.sin(m+de)*l,u=Math.sin(m+de)*(s?s/2-c:l),i.arc(e-f,n-a,c,m-R,m-H),i.arc(e+u,n-r,c,m-H,m),i.arc(e+f,n+a,c,m,m+H),i.arc(e-u,n+r,c,m+H,m+R),i.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}m+=de;case"rectRot":f=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-f,n-a),i.lineTo(e+u,n-r),i.lineTo(e+f,n+a),i.lineTo(e-u,n+r),i.closePath();break;case"crossRot":m+=de;case"cross":f=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-f,n-a),i.lineTo(e+f,n+a),i.moveTo(e+u,n-r),i.lineTo(e-u,n+r);break;case"star":f=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-f,n-a),i.lineTo(e+f,n+a),i.moveTo(e+u,n-r),i.lineTo(e-u,n+r),m+=de,f=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),i.moveTo(e-f,n-a),i.lineTo(e+f,n+a),i.moveTo(e+u,n-r),i.lineTo(e-u,n+r);break;case"line":r=s?s/2:Math.cos(m)*p,a=Math.sin(m)*p,i.moveTo(e-r,n-a),i.lineTo(e+r,n+a);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(m)*(s?s/2:p),n+Math.sin(m)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function zt(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function Wi(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Hi(i){i.restore()}function uh(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function dh(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function gh(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),C(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function ph(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function mh(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function me(i,t,e,n,s,o={}){const r=B(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,gh(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&mh(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),C(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),ph(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function li(i,t){const{x:e,y:n,w:s,h:o,radius:r}=t;i.arc(e+r.topLeft,n+r.topLeft,r.topLeft,1.5*R,R,!0),i.lineTo(e,n+o-r.bottomLeft),i.arc(e+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,R,H,!0),i.lineTo(e+s-r.bottomRight,n+o),i.arc(e+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,H,0,!0),i.lineTo(e+s,n+r.topRight),i.arc(e+s-r.topRight,n+r.topRight,r.topRight,0,-H,!0),i.lineTo(e+r.topLeft,n)}const bh=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,_h=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function xh(i,t){const e=(""+i).match(bh);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const yh=i=>+i||0;function qn(i,t){const e={},n=O(t),s=n?Object.keys(t):t,o=O(i)?n?r=>P(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of s)e[r]=yh(o(r));return e}function ar(i){return qn(i,{top:"y",right:"x",bottom:"y",left:"x"})}function be(i){return qn(i,["topLeft","topRight","bottomLeft","bottomRight"])}function nt(i){const t=ar(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function K(i,t){i=i||{},t=t||W.font;let e=P(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=P(i.style,t.style);n&&!(""+n).match(_h)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:P(i.family,t.family),lineHeight:xh(P(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:P(i.weight,t.weight),string:""};return s.string=hh(s),s}function ci(i,t,e,n){let s,o,r;for(s=0,o=i.length;s<o;++s)if(r=i[s],r!==void 0&&r!==void 0)return r}function vh(i,t,e){const{min:n,max:s}=i,o=$o(t,(s-n)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function ee(i,t){return Object.assign(Object.create(i),t)}function Gn(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=ur("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>Gn([a,...i],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return cr(a,l,()=>Ch(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return dr(a).includes(l)},ownKeys(a){return dr(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function ze(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:lr(i,n),setContext:o=>ze(i,o,e,n),override:o=>ze(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return cr(o,r,()=>Mh(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function lr(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Qt(e)?e:()=>e,isIndexable:Qt(n)?n:()=>n}}const wh=(i,t)=>i?i+Bn(t):t,Jn=(i,t)=>O(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function cr(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function Mh(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i;let a=n[t];return Qt(a)&&r.isScriptable(t)&&(a=kh(t,a,i,e)),B(a)&&a.length&&(a=Sh(t,a,i,r.isIndexable)),Jn(t,a)&&(a=ze(a,s,o&&o[t],r)),a}function kh(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||n);return a.delete(i),Jn(i,l)&&(l=Zn(s._scopes,s,i,l)),l}function Sh(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(O(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const f=Zn(c,s,i,h);t.push(ze(f,o,r&&r[i],a))}}return t}function hr(i,t,e){return Qt(i)?i(t,e):i}const Ph=(i,t)=>i===!0?t:typeof i=="string"?Zt(t,i):void 0;function Dh(i,t,e,n,s){for(const o of t){const r=Ph(e,o);if(r){i.add(r);const a=hr(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==n)return a}else if(r===!1&&typeof n<"u"&&e!==n)return null}return!1}function Zn(i,t,e,n){const s=t._rootScopes,o=hr(t._fallback,e,n),r=[...i,...s],a=new Set;a.add(n);let l=fr(a,r,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=fr(a,r,o,l,n),l===null)?!1:Gn(Array.from(a),[""],s,o,()=>Ah(t,e,n))}function fr(i,t,e,n,s){for(;e;)e=Dh(i,t,e,n,s);return e}function Ah(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return B(s)&&O(e)?e:s||{}}function Ch(i,t,e,n){let s;for(const o of t)if(s=ur(wh(o,i),e),typeof s<"u")return Jn(i,s)?Zn(e,n,i,s):s}function ur(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function dr(i){let t=i._keys;return t||(t=i._keys=Oh(i._scopes)),t}function Oh(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function gr(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+e,h=t[c],r[a]={r:s.parse(Zt(h,o),c)};return r}const Th=Number.EPSILON||1e-14,$e=(i,t)=>t<i.length&&!i[t].skip&&i[t],pr=i=>i==="x"?"y":"x";function Eh(i,t,e,n){const s=i.skip?t:i,o=t,r=e.skip?t:e,a=Vn(o,s),l=Vn(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const f=n*c,u=n*h;return{previous:{x:o.x-f*(r.x-s.x),y:o.y-f*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Rh(i,t,e){const n=i.length;let s,o,r,a,l,c=$e(i,0);for(let h=0;h<n-1;++h)if(l=c,c=$e(i,h+1),!(!l||!c)){if(ni(t[h],0,Th)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=s*r*t[h],e[h+1]=o*r*t[h])}}function Lh(i,t,e="x"){const n=pr(e),s=i.length;let o,r,a,l=$e(i,0);for(let c=0;c<s;++c){if(r=a,a=l,l=$e(i,c+1),!a)continue;const h=a[e],f=a[n];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${n}`]=f-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${n}`]=f+o*t[c])}}function Ih(i,t="x"){const e=pr(t),n=i.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=$e(i,0);for(r=0;r<n;++r)if(a=l,l=c,c=$e(i,r+1),!!l){if(c){const h=c[t]-l[t];s[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?Dt(s[r-1])!==Dt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Rh(i,s,o),Lh(i,o,t)}function ji(i,t,e){return Math.max(Math.min(i,e),t)}function Fh(i,t){let e,n,s,o,r,a=zt(i[0],t);for(e=0,n=i.length;e<n;++e)r=o,o=a,a=e<n-1&&zt(i[e+1],t),o&&(s=i[e],r&&(s.cp1x=ji(s.cp1x,t.left,t.right),s.cp1y=ji(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=ji(s.cp2x,t.left,t.right),s.cp2y=ji(s.cp2y,t.top,t.bottom)))}function zh(i,t,e,n,s){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Ih(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=Eh(c,a,i[Math.min(o+1,r-(n?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Fh(i,e)}function Qn(){return typeof window<"u"&&typeof document<"u"}function ts(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Yi(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const Ui=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function $h(i,t){return Ui(i).getPropertyValue(t)}const Bh=["top","right","bottom","left"];function _e(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Bh[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Nh=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Vh(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let r=!1,a,l;if(Nh(s,o,i.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function xe(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=Ui(e),o=s.boxSizing==="border-box",r=_e(s,"padding"),a=_e(s,"border","width"),{x:l,y:c,box:h}=Vh(i,e),f=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:d,height:g}=t;return o&&(d-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-f)/d*e.width/n),y:Math.round((c-u)/g*e.height/n)}}function Wh(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&ts(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Ui(o),l=_e(a,"border","width"),c=_e(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,n=Yi(a.maxWidth,o,"clientWidth"),s=Yi(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||$i,maxHeight:s||$i}}const ie=i=>Math.round(i*10)/10;function Hh(i,t,e,n){const s=Ui(i),o=_e(s,"margin"),r=Yi(s.maxWidth,i,"clientWidth")||$i,a=Yi(s.maxHeight,i,"clientHeight")||$i,l=Wh(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const u=_e(s,"border","width"),d=_e(s,"padding");c-=d.width+u.width,h-=d.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=ie(Math.min(c,r,l.maxWidth)),h=ie(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ie(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=ie(Math.floor(h*n))),{width:c,height:h}}function mr(i,t,e){const n=t||1,s=ie(i.height*n),o=ie(i.width*n);i.height=ie(i.height),i.width=ie(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(i.currentDevicePixelRatio=n,r.height=s,r.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const jh=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Qn()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function br(i,t){const e=$h(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ye(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Yh(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Uh(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=ye(i,s,e),a=ye(s,o,e),l=ye(o,t,e),c=ye(r,a,e),h=ye(a,l,e);return ye(c,h,e)}const Xh=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Kh=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Be(i,t,e){return i?Xh(t,e):Kh()}function _r(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function xr(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function yr(i){return i==="angle"?{between:si,compare:qc,normalize:et}:{between:It,compare:(t,e)=>t-e,normalize:t=>t}}function vr({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function qh(i,t,e){const{property:n,start:s,end:o}=e,{between:r,normalize:a}=yr(n),l=t.length;let{start:c,end:h,loop:f}=i,u,d;if(f){for(c+=l,h+=l,u=0,d=l;u<d&&r(a(t[c%l][n]),s,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:f,style:i.style}}function wr(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=yr(n),{start:h,end:f,loop:u,style:d}=qh(i,t,e),g=[];let p=!1,m=null,b,_,y;const v=()=>l(s,y,b)&&a(s,y)!==0,x=()=>a(o,b)===0||l(o,y,b),w=()=>p||v(),M=()=>!p||x();for(let k=h,S=h;k<=f;++k)_=t[k%r],!_.skip&&(b=c(_[n]),b!==y&&(p=l(b,s,o),m===null&&w()&&(m=a(b,s)===0?k:S),m!==null&&M()&&(g.push(vr({start:m,end:k,loop:u,count:r,style:d})),m=null),S=k,y=b));return m!==null&&g.push(vr({start:m,end:f,loop:u,count:r,style:d})),g}function Mr(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=wr(n[s],i.points,t);o.length&&e.push(...o)}return e}function Gh(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Jh(i,t,e,n){const s=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?a.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:n}),o}function Zh(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:r,end:a}=Gh(e,s,o,n);if(n===!0)return kr(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+s:a,c=!!i._fullLoop&&r===0&&a===s-1;return kr(i,Jh(e,r,l,c),e,t)}function kr(i,t,e,n){return!n||!n.setContext||!e?t:Qh(i,t,e,n)}function Qh(i,t,e,n){const s=i._chart.getContext(),o=Sr(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,f=t[0].start,u=f;function d(g,p,m,b){const _=a?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=_;for(;e[p%l].skip;)p+=_;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),h=b,f=p%l)}}for(const g of t){f=a?f:g.start;let p=e[f%l],m;for(u=f+1;u<=g.end;u++){const b=e[u%l];m=Sr(n.setContext(ee(s,{type:"segment",p0:p,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),tf(m,h)&&d(f,u-1,g.loop,h),p=b,h=m}f<u-1&&d(f,u-1,g.loop,h)}return c}function Sr(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function tf(i,t){if(!t)return!1;const e=[],n=function(s,o){return jn(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}function Xi(i,t,e){return i.options.clip?i[e]:t[e]}function ef(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:Xi(e,t,"left"),right:Xi(e,t,"right"),top:Xi(n,t,"top"),bottom:Xi(n,t,"bottom")}:t}function Pr(i,t){const e=t._clip;if(e.disabled)return!1;const n=ef(t,i.chartArea);return{left:e.left===!1?0:n.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:n.right+(e.right===!0?0:e.right),top:e.top===!1?0:n.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:n.bottom+(e.bottom===!0?0:e.bottom)}}class nf{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Go.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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((n,s)=>Math.max(n,s._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 n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $t=new nf;const Dr="transparent",sf={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=ir(i||Dr),s=n.valid&&ir(t||Dr);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class of{constructor(t,e,n,s){const o=e[n];s=ci([t.to,s,o,t.from]);const r=ci([t.from,o,s]);this._active=!0,this._fn=t.fn||sf[t.type||typeof r],this._easing=oi[t.easing]||oi.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=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ci([t.to,e,s,t.from]),this._from=ci([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<n),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class Ar{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!O(t))return;const e=Object.keys(W.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!O(o))return;const r={};for(const a of e)r[a]=o[a];(B(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,e){const n=e.options,s=af(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&rf(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let f=o[c];const u=n.get(c);if(f)if(u&&f.active()){f.update(u,h,a);continue}else f.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=f=new of(u,t,c,h),s.push(f)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return $t.add(this._chart,n),!0}}function rf(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function af(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Cr(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function lf(i,t,e){if(e===!1)return!1;const n=Cr(i,e),s=Cr(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function cf(i){let t,e,n,s;return O(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Or(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function Tr(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(h=!0,n.all)continue;break}c=i.values[l],V(c)&&(o||t===0||Dt(t)===Dt(c))&&(t+=c)}return!h&&!n.all?0:t}function hf(i,t){const{iScale:e,vScale:n}=t,s=e.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:i[h]};return a}function es(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function ff(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function uf(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function df(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function Er(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Rr(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=ff(o,r,n),f=t.length;let u;for(let d=0;d<f;++d){const g=t[d],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});u=b[c]=df(s,h,p),u[a]=m,u._top=Er(u,r,!0,n.type),u._bottom=Er(u,r,!1,n.type);const _=u._visualValues||(u._visualValues={});_[a]=m}}function is(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function gf(i,t){return ee(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function pf(i,t,e){return ee(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function hi(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const ns=i=>i==="reset"||i==="none",Lr=(i,t)=>t?i:Object.assign({},i),mf=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Or(e,!0),values:null};class ne{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=es(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&hi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(f,u,d,g)=>f==="x"?u:f==="r"?g:d,o=e.xAxisID=P(n.xAxisID,is(t,"x")),r=e.yAxisID=P(n.yAxisID,is(t,"y")),a=e.rAxisID=P(n.rAxisID,is(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),h=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}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&&Ko(this._data,this),t._stacked&&hi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(O(e)){const s=this._cachedMeta;this._data=hf(e,s)}else if(n!==e){if(n){Ko(n,this);const s=this._cachedMeta;hi(s),s._parsed=[]}e&&Object.isExtensible(e)&&Qc(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=es(e.vScale,e),e.stack!==n.stack&&(s=!0,hi(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Rr(this,e._parsed),e._stacked=es(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,f,u;if(this._parsing===!1)n._parsed=s,n._sorted=!0,u=s;else{B(s[t])?u=this.parseArrayData(n,s,t,e):O(s[t])?u=this.parseObjectData(n,s,t,e):u=this.parsePrimitiveData(n,s,t,e);const d=()=>f[a]===null||c&&f[a]<c[a];for(h=0;h<e;++h)n._parsed[h+t]=f=u[h],l&&(d()&&(l=!1),c=f);n._sorted=l}r&&Rr(this,u)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,f=new Array(s);let u,d,g;for(u=0,d=s;u<d;++u)g=u+n,f[u]={[a]:h||o.parse(c[g],g),[l]:r.parse(e[g],g)};return f}parseArrayData(t,e,n,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,h,f;for(l=0,c=s;l<c;++l)h=l+n,f=e[h],a[l]={x:o.parse(f[0],h),y:r.parse(f[1],h)};return a}parseObjectData(t,e,n,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,f,u,d;for(h=0,f=s;h<f;++h)u=h+n,d=e[u],c[h]={x:o.parse(Zt(d,a),u),y:r.parse(Zt(d,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Or(s,!0),values:e._stacks[t.axis]._visualValues};return Tr(a,r,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let r=o===null?NaN:o;const a=s&&n._stacks[e.axis];s&&a&&(s.values=a,r=Tr(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,a=this._getOtherScale(t),l=mf(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=uf(a);let u,d;function g(){d=s[u];const p=d[a.axis];return!V(d[t.axis])||h>p||f<p}for(u=0;u<r&&!(!g()&&(this.updateRangeFromParsed(c,t,d,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(c,t,d,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],V(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=cf(P(this.options.clip,lf(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const f=s[h];f.hidden||(f.active&&c?r.push(f):f.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=pf(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=gf(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&ii(n);if(a)return Lr(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),f=s?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),d=Object.keys(W.elements[t]),g=()=>this.getContext(n,s,e),p=c.resolveNamedOptions(u,d,g,f);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(Lr(p,l))),p}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),f);l=h.createResolver(u,this.getContext(t,n,e))}const c=new Ar(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ns(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:r}}updateElement(t,e,n,s){ns(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!ns(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&hi(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function bf(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,o=e.length;s<o;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=qo(n.sort((s,o)=>s-o))}return i._cache.$bar}function _f(i){const t=i.iScale,e=bf(t,i.type);let n=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(ii(a)&&(n=Math.min(n,Math.abs(r-a)||n)),a=r)};for(s=0,o=e.length;s<o;++s)r=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return n}function xf(i,t,e,n){const s=e.barThickness;let o,r;return C(s)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=s*n,r=1),{chunk:o/n,ratio:r,start:t.pixels[i]-o/2}}function yf(i,t,e,n){const s=t.pixels,o=s[i];let r=i>0?s[i-1]:null,a=i<s.length-1?s[i+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/n,ratio:e.barPercentage,start:c}}function vf(i,t,e,n){const s=e.parse(i[0],n),o=e.parse(i[1],n),r=Math.min(s,o),a=Math.max(s,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function Ir(i,t,e,n){return B(i)?vf(i,t,e,n):t[e.axis]=e.parse(i,n),t}function Fr(i,t,e,n){const s=i.iScale,o=i.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,f,u;for(c=e,h=e+n;c<h;++c)u=t[c],f={},f[s.axis]=a||s.parse(r[c],c),l.push(Ir(u,f,o,c));return l}function ss(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function wf(i,t,e){return i!==0?Dt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Mf(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:n,reverse:t,top:s,bottom:o}}function kf(i,t,e,n){let s=t.borderSkipped;const o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=Mf(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=h:(o[zr(h,r,a,l)]=!0,s=c)),o[zr(s,r,a,l)]=!0,i.borderSkipped=o}function zr(i,t,e,n){return n?(i=Sf(i,t,e),i=$r(i,e,t)):i=$r(i,t,e),i}function Sf(i,t,e){return i===t?e:i===e?t:i}function $r(i,t,e){return i==="start"?t:i==="end"?e:i}function Pf(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class Df extends ne{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,n,s){return Fr(t,e,n,s)}parseArrayData(t,e,n,s){return Fr(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,h=r.axis==="x"?a:l,f=[];let u,d,g,p;for(u=n,d=n+s;u<d;++u)p=e[u],g={},g[o.axis]=o.parse(Zt(p,c),u),f.push(Ir(Zt(p,h),g,r,u));return f}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const o=n._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:s}=e,o=this.getParsed(t),r=o._custom,a=ss(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){const o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:f,includeOptions:u}=this._getSharedOptions(e,s);for(let d=e;d<e+n;d++){const g=this.getParsed(d),p=o||C(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(d),m=this._calculateBarIndexPixels(d,h),b=(g._stacks||{})[a.axis],_={horizontal:c,base:p.base,enableBorderRadius:!b||ss(g._custom)||r===b._top||r===b._bottom,x:c?p.head:m.center,y:c?m.center:p.head,height:c?m.size:Math.abs(p.size),width:c?Math.abs(p.size):m.size};u&&(_.options=f||this.resolveDataElementOptions(d,t[d].active?"active":s));const y=_.options||t[d].options;kf(_,y,b,r),Pf(_,y,h.ratio),this.updateElement(t[d],d,_,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=n.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[n.axis],c=h=>{const f=h._parsed.find(d=>d[n.axis]===l),u=f&&f[h.vScale.axis];if(C(u)||isNaN(u))return!0};for(const h of s)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const n of this.chart.data.datasets)t[P(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,r;for(o=0,r=e.data.length;o<r;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const a=t.barThickness;return{min:a||_f(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=ss(c);let f=l[e.axis],u=0,d=n?this.applyStack(e,l,n):f,g,p;d!==f&&(u=d-f,d=f),h&&(f=c.barStart,d=c.barEnd-c.barStart,f!==0&&Dt(f)!==Dt(c.barEnd)&&(u=0),u+=f);const m=!C(o)&&!h?o:u;let b=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(u+d):g=b,p=g-b,Math.abs(p)<r){p=wf(p,e,a)*r,f===a&&(b-=p/2);const _=e.getPixelForDecimal(0),y=e.getPixelForDecimal(1),v=Math.min(_,y),x=Math.max(_,y);b=Math.max(Math.min(b,x),v),g=b+p,n&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(b))}if(b===e.getPixelForValue(a)){const _=Dt(p)*e.getLineWidthForValue(a)/2;b+=_,p-=_}return{size:p,base:b,head:g,center:g+p/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,o=s.skipNull,r=P(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(e.grouped){const h=o?this._getStackCount(t):e.stackCount,f=s.barThickness==="flex"?yf(t,e,s,h*c):xf(t,e,s,h*c),u=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(P(u,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+d;a=f.start+f.chunk*g+f.chunk/2,l=Math.min(r,f.chunk*f.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}}class Af extends ne{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const o=super.parsePrimitiveData(t,e,n,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+n).radius;return o}parseArrayData(t,e,n,s){const o=super.parseArrayData(t,e,n,s);for(let r=0;r<o.length;r++){const a=e[n+r];o[r]._custom=P(a[2],this.resolveDataElementOptions(r+n).radius)}return o}parseObjectData(t,e,n,s){const o=super.parseObjectData(t,e,n,s);for(let r=0;r<o.length;r++){const a=e[n+r];o[r]._custom=P(a&&a.r&&+a.r,this.resolveDataElementOptions(r+n).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:n[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=r.axis,f=a.axis;for(let u=e;u<e+n;u++){const d=t[u],g=!o&&this.getParsed(u),p={},m=p[h]=o?r.getPixelForDecimal(.5):r.getPixelForValue(g[h]),b=p[f]=o?a.getBasePixel():a.getPixelForValue(g[f]);p.skip=isNaN(m)||isNaN(b),c&&(p.options=l||this.resolveDataElementOptions(u,d.active?"active":s),o&&(p.options.radius=0)),this.updateElement(d,u,p,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=P(n&&n._custom,o),s}}function Cf(i,t,e){let n=1,s=1,o=0,r=0;if(t<$){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),f=Math.cos(l),u=Math.sin(l),d=(y,v,x)=>si(y,a,l,!0)?1:Math.max(v,v*e,x,x*e),g=(y,v,x)=>si(y,a,l,!0)?-1:Math.min(v,v*e,x,x*e),p=d(0,c,f),m=d(H,h,u),b=g(R,c,f),_=g(R+H,h,u);n=(p-b)/2,s=(m-_)/2,o=-(p+b)/2,r=-(m+_)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}class Br extends ne{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const f=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:f.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:s,pointStyle:n,borderRadius:r&&(a||f.borderRadius),index:c}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(O(n[t])){const{key:l="value"}=this._parsing;o=c=>+Zt(n[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return Mt(this.options.rotation-90)}_getCircumference(){return Mt(this.options.circumference)}_getRotationExtents(){let t=$,e=-$;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),l=Math.min($c(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:d,offsetX:g,offsetY:p}=Cf(f,h,l),m=(n.width-r)/u,b=(n.height-r)/d,_=Math.max(Math.min(m,b)/2,0),y=$o(this.options.radius,_),v=Math.max(y*l,0),x=(y-v)/this._getVisibleDatasetWeightTotal();this.offsetX=g*y,this.offsetY=p*y,s.total=this.calculateTotal(),this.outerRadius=y-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/$)}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,f=(a.top+a.bottom)/2,u=o&&c.animateScale,d=u?0:this.innerRadius,g=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(e,s);let b=this._getRotation(),_;for(_=0;_<e;++_)b+=this._circumference(_,o);for(_=e;_<e+n;++_){const y=this._circumference(_,o),v=t[_],x={x:h+this.offsetX,y:f+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:g,innerRadius:d};m&&(x.options=p||this.resolveDataElementOptions(_,v.active?"active":s)),b+=y,this.updateElement(v,_,x,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?$*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ri(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){r=n.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(P(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Of extends ne{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Zo(e,s,r);this._drawStart=a,this._drawCount=l,Qo(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s),u=r.axis,d=a.axis,{spanGaps:g,segment:p}=this.options,m=Fe(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",_=e+n,y=t.length;let v=e>0&&this.getParsed(e-1);for(let x=0;x<y;++x){const w=t[x],M=b?w:{};if(x<e||x>=_){M.skip=!0;continue}const k=this.getParsed(x),S=C(k[d]),D=M[u]=r.getPixelForValue(k[u],x),A=M[d]=o||S?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[d],x);M.skip=isNaN(D)||isNaN(A)||S,M.stop=x>0&&Math.abs(k[u]-v[u])>m,p&&(M.parsed=k,M.raw=c.data[x]),f&&(M.options=h||this.resolveDataElementOptions(x,w.active?"active":s)),b||this.updateElement(w,x,M,s),v=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Tf extends ne{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ri(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return gr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,f=c.yCenter,u=c.getIndexAngle(0)-.5*R;let d=u,g;const p=360/this.countVisibleElements();for(g=0;g<e;++g)d+=this._computeAngle(g,s,p);for(g=e;g<e+n;g++){const m=t[g];let b=d,_=d+this._computeAngle(g,s,p),y=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;d=_,o&&(l.animateScale&&(y=0),l.animateRotate&&(b=_=u));const v={x:h,y:f,innerRadius:0,outerRadius:y,startAngle:b,endAngle:_,options:this.resolveDataElementOptions(g,m.active?"active":s)};this.updateElement(m,g,v,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?Mt(this.resolveDataElementOptions(t,e).angle||n):0}}class Ef extends Br{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Rf extends ne{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return gr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(n,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let a=e;a<e+n;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),h=o.getPointPositionForValue(a,this.getParsed(a).r),f=r?o.xCenter:h.x,u=r?o.yCenter:h.y,d={x:f,y:u,angle:h.angle,skip:isNaN(f)||isNaN(u),options:c};this.updateElement(l,a,d,s)}}}class Lf extends ne{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:n[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:r}=Zo(e,n,s);if(this._drawStart=o,this._drawCount=r,Qo(e)&&(o=0,r=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),f=this.getSharedOptions(h),u=this.includeOptions(s,f),d=r.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=Fe(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none";let y=e>0&&this.getParsed(e-1);for(let v=e;v<e+n;++v){const x=t[v],w=this.getParsed(v),M=_?x:{},k=C(w[g]),S=M[d]=r.getPixelForValue(w[d],v),D=M[g]=o||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,w,l):w[g],v);M.skip=isNaN(S)||isNaN(D)||k,M.stop=v>0&&Math.abs(w[d]-y[d])>b,m&&(M.parsed=w,M.raw=c.data[v]),u&&(M.options=f||this.resolveDataElementOptions(v,x.active?"active":s)),_||this.updateElement(x,v,M,s),y=w}this.updateSharedOptions(f,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}}function ve(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class os{static override(t){Object.assign(os.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ve()}parse(){return ve()}format(){return ve()}add(){return ve()}diff(){return ve()}startOf(){return ve()}endOf(){return ve()}}var If={_date:os};function Ff(i,t,e,n){const{controller:s,data:o,_sorted:r}=i,a=s._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Jc:Ft;if(n){if(s._sharedOptions){const h=o[0],f=typeof h.getRange=="function"&&h.getRange(t);if(f){const u=c(o,t,e-f),d=c(o,t,e+f);return{lo:u.lo,hi:d.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:f}=s._cachedMeta,{_parsed:u}=i,d=u.slice(0,h.lo+1).reverse().findIndex(p=>!C(p[f.axis]));h.lo-=Math.max(0,d);const g=u.slice(h.hi).findIndex(p=>!C(p[f.axis]));h.hi+=Math.max(0,g)}return h}}return{lo:0,hi:o.length-1}}function Ki(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:f,hi:u}=Ff(o[a],t,r,s);for(let d=f;d<=u;++d){const g=h[d];g.skip||n(g,c,d)}}}function zf(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,r=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function rs(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||Ki(i,e,t,function(a,l,c){!s&&!zt(a,i.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function $f(i,t,e,n){let s=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],n),{angle:f}=Uo(r,{x:t.x,y:t.y});si(f,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return Ki(i,e,t,o),s}function Bf(i,t,e,n,s,o){let r=[];const a=zf(e);let l=Number.POSITIVE_INFINITY;function c(h,f,u){const d=h.inRange(t.x,t.y,s);if(n&&!d)return;const g=h.getCenterPoint(s);if(!(!!o||i.isPointInArea(g))&&!d)return;const m=a(t,g);m<l?(r=[{element:h,datasetIndex:f,index:u}],l=m):m===l&&r.push({element:h,datasetIndex:f,index:u})}return Ki(i,e,t,c),r}function as(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?$f(i,t,e,s):Bf(i,t,e,n,s,o)}function Nr(i,t,e,n,s){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Ki(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}var Nf={modes:{index(i,t,e,n){const s=xe(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?rs(i,s,o,n,r):as(i,s,o,!1,n,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,f=c.data[h];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=xe(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?rs(i,s,o,n,r):as(i,s,o,!1,n,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,n){const s=xe(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return rs(i,s,o,n,r)},nearest(i,t,e,n){const s=xe(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return as(i,s,o,e.intersect,n,r)},x(i,t,e,n){const s=xe(t,i);return Nr(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=xe(t,i);return Nr(i,s,"y",e.intersect,n)}}};const Vr=["left","top","right","bottom"];function fi(i,t){return i.filter(e=>e.pos===t)}function Wr(i,t){return i.filter(e=>Vr.indexOf(e.pos)===-1&&e.box.axis===t)}function ui(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Vf(i){const t=[];let e,n,s,o,r,a;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Wf(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!Vr.includes(s))continue;const r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Hf(i,t){const e=Wf(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=h?h*s:l&&t.availableHeight)}return e}function jf(i){const t=Vf(i),e=ui(t.filter(c=>c.box.fullSize),!0),n=ui(fi(t,"left"),!0),s=ui(fi(t,"right")),o=ui(fi(t,"top"),!0),r=ui(fi(t,"bottom")),a=Wr(t,"x"),l=Wr(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:fi(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Hr(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function jr(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Yf(i,t,e,n){const{pos:s,box:o}=e,r=i.maxPadding;if(!O(s)){e.size&&(i[s]-=e.size);const f=n[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?o.height:o.width),e.size=f.size/f.count,i[s]+=e.size}o.getPadding&&jr(r,o.getPadding());const a=Math.max(0,t.outerWidth-Hr(r,i,"left","right")),l=Math.max(0,t.outerHeight-Hr(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Uf(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Xf(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return n(i?["left","right"]:["top","bottom"])}function di(i,t,e,n){const s=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Xf(a.horizontal,t));const{same:f,other:u}=Yf(t,e,a,n);c|=f&&s.length,h=h||u,l.fullSize||s.push(a)}return c&&di(s,t,e,n)||h}function qi(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function Yr(i,t,e,n){const s=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=n[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*h,u=c.size||l.height;ii(c.start)&&(r=c.start),l.fullSize?qi(l,s.left,r,e.outerWidth-s.right-s.left,u):qi(l,t.left+c.placed,r,f,u),c.start=r,c.placed+=f,r=l.bottom}else{const f=t.h*h,u=c.size||l.width;ii(c.start)&&(o=c.start),l.fullSize?qi(l,o,s.top,u,e.outerHeight-s.bottom-s.top):qi(l,o,t.top+c.placed,u,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=r}var st={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,n){if(!i)return;const s=nt(i.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=jf(i.boxes),l=a.vertical,c=a.horizontal;I(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);jr(u,nt(n));const d=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),g=Hf(l.concat(c),f);di(a.fullSize,d,f,g),di(l,d,f,g),di(c,d,f,g)&&di(l,d,f,g),Uf(d),Yr(a.leftAndTop,d,f,g),d.x+=d.w,d.y+=d.h,Yr(a.rightAndBottom,d,f,g),i.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},I(a.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})})}};class Ur{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Kf extends Ur{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Gi="$chartjs",qf={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xr=i=>i===null||i==="";function Gf(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Gi]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Xr(s)){const o=br(i,"width");o!==void 0&&(i.width=o)}if(Xr(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=br(i,"height");o!==void 0&&(i.height=o)}return i}const Kr=jh?{passive:!0}:!1;function Jf(i,t,e){i&&i.addEventListener(t,e,Kr)}function Zf(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Kr)}function Qf(i,t){const e=qf[i.type]||i.type,{x:n,y:s}=xe(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Ji(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function tu(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ji(a.addedNodes,n),r=r&&!Ji(a.removedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function eu(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ji(a.removedNodes,n),r=r&&!Ji(a.addedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const gi=new Map;let qr=0;function Gr(){const i=window.devicePixelRatio;i!==qr&&(qr=i,gi.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function iu(i,t){gi.size||window.addEventListener("resize",Gr),gi.set(i,t)}function nu(i){gi.delete(i),gi.size||window.removeEventListener("resize",Gr)}function su(i,t,e){const n=i.canvas,s=n&&ts(n);if(!s)return;const o=Jo((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),iu(i,o),r}function ls(i,t,e){e&&e.disconnect(),t==="resize"&&nu(i)}function ou(i,t,e){const n=i.canvas,s=Jo(o=>{i.ctx!==null&&e(Qf(o,i))},i);return Jf(n,t,s),s}class ru extends Ur{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Gf(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Gi])return!1;const n=e[Gi].initial;["height","width"].forEach(o=>{const r=n[o];C(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Gi],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:tu,detach:eu,resize:su}[e]||ou;s[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:ls,detach:ls,resize:ls}[e]||Zf)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Hh(t,e,n,s)}isAttached(t){const e=t&&ts(t);return!!(e&&e.isConnected)}}function au(i){return!Qn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Kf:ru}let Bt=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Fe(this.x)&&Fe(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}};function lu(i,t){const e=i.options.ticks,n=cu(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?fu(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return uu(t,c,o,r/s),c;const h=hu(o,t,s);if(r>0){let f,u;const d=r>1?Math.round((l-a)/(r-1)):null;for(Zi(t,c,h,C(d)?0:a-d,a),f=0,u=r-1;f<u;f++)Zi(t,c,h,o[f],o[f+1]);return Zi(t,c,h,l,C(d)?t.length:l+d),c}return Zi(t,c,h),c}function cu(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function hu(i,t,e){const n=du(i),s=t.length/e;if(!n)return Math.max(s,1);const o=Uc(n);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function fu(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function uu(i,t,e,n){let s=0,o=e[0],r;for(n=Math.ceil(n),r=0;r<i.length;r++)r===o&&(t.push(i[r]),s++,o=e[s*n])}function Zi(i,t,e,n,s){const o=P(n,0),r=Math.min(P(s,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function du(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const gu=i=>i==="left"?"right":i==="right"?"left":i,Jr=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Zr=(i,t)=>Math.min(t||i,i);function Qr(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function pu(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function mu(i,t){I(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function pi(i){return i.drawTicks?i.tickLength:0}function ta(i,t){if(!i.display)return 0;const e=K(i.font,t),n=nt(i.padding);return(B(i.text)?i.text.length:1)*e.lineHeight+n.height}function bu(i,t){return ee(i,{scale:t,type:"scale"})}function _u(i,t,e){return ee(i,{tick:e,index:t,type:"tick"})}function xu(i,t,e){let n=Hn(i);return(e&&t!=="right"||!e&&t==="right")&&(n=gu(n)),n}function yu(i,t,e,n){const{top:s,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let f=0,u,d,g;const p=r-s,m=a-o;if(i.isHorizontal()){if(d=it(n,o,a),O(e)){const b=Object.keys(e)[0],_=e[b];g=h[b].getPixelForValue(_)+p-t}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=Jr(i,e,t);u=a-o}else{if(O(e)){const b=Object.keys(e)[0],_=e[b];d=h[b].getPixelForValue(_)-m+t}else e==="center"?d=(c.left+c.right)/2-m+t:d=Jr(i,e,t);g=it(n,r,s),f=e==="left"?-H:H}return{titleX:d,titleY:g,maxWidth:u,rotation:f}}class we extends Bt{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:n,_suggestedMax:s}=this;return t=dt(t,Number.POSITIVE_INFINITY),e=dt(e,Number.NEGATIVE_INFINITY),n=dt(n,Number.POSITIVE_INFINITY),s=dt(s,Number.NEGATIVE_INFINITY),{min:dt(t,n),max:dt(e,s),minDefined:V(t),maxDefined:V(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:n};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(n=Math.max(n,r.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:dt(e,dt(n,e)),max:dt(n,dt(e,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){z(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=vh(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Qr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=lu(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){z(this.options.afterUpdate,[this])}beforeSetDimensions(){z(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){z(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),z(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=z(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Zr(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),f=h.widest.width,u=h.highest.height,d=J(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/n:d/(n-1),f+6>a&&(a=d/(n-(t.offset?.5:1)),l=this.maxHeight-pi(t.grid)-e.padding-ta(t.title,this.chart.options.font),c=Math.sqrt(f*f+u*u),r=Nn(Math.min(Math.asin(J((h.highest.height+6)/a,-1,1)),Math.asin(J(l/c,-1,1))-Math.asin(J(u/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=ta(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=pi(o)+l):(t.height=this.maxHeight,t.width=pi(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:f,highest:u}=this._getLabelSizes(),d=n.padding*2,g=Mt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=n.mirror?0:m*f.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+d)}else{const b=n.mirror?0:p*f.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+d)}this._calculatePadding(c,h,m,p)}}this._handleMargins(),a?(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,n,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,d=0;l?c?(u=s*t.width,d=n*e.height):(u=n*t.height,d=s*e.width):o==="start"?d=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,d=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((d-f+r)*this.width/(this.width-f),0)}else{let h=e.height/2,f=t.height/2;o==="start"?(h=0,f=t.height):o==="end"&&(h=e.height,f=0),this.paddingTop=h+r,this.paddingBottom=f+r}}_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(){z(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)C(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Qr(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Zr(e,n));let c=0,h=0,f,u,d,g,p,m,b,_,y,v,x;for(f=0;f<e;f+=l){if(g=t[f].label,p=this._resolveTickFontOptions(f),s.font=m=p.string,b=o[m]=o[m]||{data:{},gc:[]},_=p.lineHeight,y=v=0,!C(g)&&!B(g))y=Vi(s,b.data,b.gc,y,g),v=_;else if(B(g))for(u=0,d=g.length;u<d;++u)x=g[u],!C(x)&&!B(x)&&(y=Vi(s,b.data,b.gc,y,x),v+=_);r.push(y),a.push(v),c=Math.max(y,c),h=Math.max(v,h)}mu(o,e);const w=r.indexOf(c),M=a.indexOf(h),k=S=>({width:r[S]||0,height:a[S]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(M),widths:r,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 Gc(this._alignToPixels?pe(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&&t<e.length){const n=e[t];return n.$context||(n.$context=_u(this.getContext(),t,n))}return this.$context||(this.$context=bu(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Mt(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),u=pi(o),d=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function(N){return pe(n,N,p)};let _,y,v,x,w,M,k,S,D,A,E,Q;if(r==="top")_=b(this.bottom),M=this.bottom-u,S=_-m,A=b(t.top)+m,Q=t.bottom;else if(r==="bottom")_=b(this.top),A=t.top,Q=b(t.bottom)-m,M=_+m,S=this.top+u;else if(r==="left")_=b(this.right),w=this.right-u,k=_-m,D=b(t.left)+m,E=t.right;else if(r==="right")_=b(this.left),D=t.left,E=b(t.right)-m,w=_+m,k=this.left+u;else if(e==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(O(r)){const N=Object.keys(r)[0],j=r[N];_=b(this.chart.scales[N].getPixelForValue(j))}A=t.top,Q=t.bottom,M=_+m,S=M+u}else if(e==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(O(r)){const N=Object.keys(r)[0],j=r[N];_=b(this.chart.scales[N].getPixelForValue(j))}w=_-m,k=w-u,D=t.left,E=t.right}const gt=P(s.ticks.maxTicksLimit,f),F=Math.max(1,Math.ceil(f/gt));for(y=0;y<f;y+=F){const N=this.getContext(y),j=o.setContext(N),kt=a.setContext(N),ot=j.lineWidth,Ve=j.color,fn=kt.dash||[],We=kt.dashOffset,xi=j.tickWidth,ke=j.tickColor,yi=j.tickBorderDash||[],Se=j.tickBorderDashOffset;v=pu(this,y,l),v!==void 0&&(x=pe(n,v,ot),c?w=k=D=E=x:M=S=A=Q=x,d.push({tx1:w,ty1:M,tx2:k,ty2:S,x1:D,y1:A,x2:E,y2:Q,width:ot,color:Ve,borderDash:fn,borderDashOffset:We,tickWidth:xi,tickColor:ke,tickBorderDash:yi,tickBorderDashOffset:Se}))}return this._ticksLength=f,this._borderValue=_,d}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:f}=o,u=pi(n.grid),d=u+h,g=f?-h:d,p=-Mt(this.labelRotation),m=[];let b,_,y,v,x,w,M,k,S,D,A,E,Q="middle";if(s==="top")w=this.bottom-g,M=this._getXAxisLabelAlignment();else if(s==="bottom")w=this.top+g,M=this._getXAxisLabelAlignment();else if(s==="left"){const F=this._getYAxisLabelAlignment(u);M=F.textAlign,x=F.x}else if(s==="right"){const F=this._getYAxisLabelAlignment(u);M=F.textAlign,x=F.x}else if(e==="x"){if(s==="center")w=(t.top+t.bottom)/2+d;else if(O(s)){const F=Object.keys(s)[0],N=s[F];w=this.chart.scales[F].getPixelForValue(N)+d}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")x=(t.left+t.right)/2-d;else if(O(s)){const F=Object.keys(s)[0],N=s[F];x=this.chart.scales[F].getPixelForValue(N)}M=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const gt=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){y=a[b],v=y.label;const F=o.setContext(this.getContext(b));k=this.getPixelForTick(b)+o.labelOffset,S=this._resolveTickFontOptions(b),D=S.lineHeight,A=B(v)?v.length:1;const N=A/2,j=F.color,kt=F.textStrokeColor,ot=F.textStrokeWidth;let Ve=M;r?(x=k,M==="inner"&&(b===_-1?Ve=this.options.reverse?"left":"right":b===0?Ve=this.options.reverse?"right":"left":Ve="center"),s==="top"?c==="near"||p!==0?E=-A*D+D/2:c==="center"?E=-gt.highest.height/2-N*D+D:E=-gt.highest.height+D/2:c==="near"||p!==0?E=D/2:c==="center"?E=gt.highest.height/2-N*D:E=gt.highest.height-A*D,f&&(E*=-1),p!==0&&!F.showLabelBackdrop&&(x+=D/2*Math.sin(p))):(w=k,E=(1-A)*D/2);let fn;if(F.showLabelBackdrop){const We=nt(F.backdropPadding),xi=gt.heights[b],ke=gt.widths[b];let yi=E-We.top,Se=0-We.left;switch(Q){case"middle":yi-=xi/2;break;case"bottom":yi-=xi;break}switch(M){case"center":Se-=ke/2;break;case"right":Se-=ke;break;case"inner":b===_-1?Se-=ke:b>0&&(Se-=ke/2);break}fn={left:Se,top:yi,width:ke+We.width,height:xi+We.height,color:F.backdropColor}}m.push({label:v,font:S,textOffset:E,options:{rotation:p,color:j,strokeColor:kt,strokeWidth:ot,textAlign:Ve,textBaseline:Q,translation:[x,w],backdrop:fn}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Mt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){const l=s[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),r=n.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,f,u;this.isHorizontal()?(c=pe(t,this.left,r)-r/2,h=pe(t,this.right,a)+a/2,f=u=l):(f=pe(t,this.top,r)-r/2,u=pe(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,f),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&Wi(n,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;me(n,c,0,h,l,a)}s&&Hi(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=K(n.font),r=nt(n.padding),a=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||O(e)?(l+=r.bottom,B(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:f,rotation:u}=yu(this,l,e,a);me(t,n.text,0,0,o,{color:n.color,maxWidth:f,rotation:u,textAlign:xu(a,e,s),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=P(t.grid&&t.grid.z,-1),s=P(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==we.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return K(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Qi{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;Mu(e)&&(n=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,vu(t,r,n),this.override&&W.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in W[s]&&(delete W[s][n],this.override&&delete ge[n])}}function vu(i,t,e){const n=ti(Object.create(null),[e?W.get(e):{},W.get(t),i.defaults]);W.set(t,n),i.defaultRoutes&&wu(t,i.defaultRoutes),i.descriptors&&W.describe(t,i.descriptors)}function wu(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");W.route(o,s,l,a)})}function Mu(i){return"id"in i&&"defaults"in i}class ku{constructor(){this.controllers=new Qi(ne,"datasets",!0),this.elements=new Qi(Bt,"elements"),this.plugins=new Qi(Object,"plugins"),this.scales=new Qi(we,"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,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):I(s,r=>{const a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,n){const s=Bn(t);z(n["before"+s],[],n),e[t](n),z(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var At=new ku;class Su{constructor(){this._init=void 0}notify(t,e,n,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,n,s){s=s||{};for(const o of t){const r=o.plugin,a=r[n],l=[e,s,o.options];if(z(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){C(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,s=P(n.options&&n.options.plugins,{}),o=Pu(n);return s===!1&&!e?[]:Au(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function Pu(i){const t={},e=[],n=Object.keys(At.plugins.items);for(let o=0;o<n.length;o++)e.push(At.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Du(i,t){return!t&&i===!1?null:i===!0?{}:i}function Au(i,{plugins:t,localIds:e},n,s){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Du(n[l],s);c!==null&&o.push({plugin:a,options:Cu(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Cu(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(n,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function cs(i,t){const e=W.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Ou(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Tu(i,t){return i===t?"_index_":"_value_"}function ea(i){if(i==="x"||i==="y"||i==="r")return i}function Eu(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function hs(i,...t){if(ea(i))return i;for(const e of t){const n=e.axis||Eu(e.position)||i.length>1&&ea(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function ia(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Ru(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return ia(i,"x",e[0])||ia(i,"y",e[0])}return{}}function Lu(i,t){const e=ge[i.type]||{scales:{}},n=t.scales||{},s=cs(i.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{const a=n[r];if(!O(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=hs(r,a,Ru(r,i),W.scales[a.type]),c=Tu(l,s),h=e.scales||{};o[r]=ei(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||cs(a,t),h=(ge[a]||{}).scales||{};Object.keys(h).forEach(f=>{const u=Ou(f,l),d=r[u+"AxisID"]||u;o[d]=o[d]||Object.create(null),ei(o[d],[{axis:u},n[d],h[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];ei(a,[W.scales[a.type],W.scale])}),o}function na(i){const t=i.options||(i.options={});t.plugins=P(t.plugins,{}),t.scales=Lu(i,t)}function sa(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Iu(i){return i=i||{},i.data=sa(i.data),na(i),i}const oa=new Map,ra=new Set;function tn(i,t){let e=oa.get(i);return e||(e=t(),oa.set(i,e),ra.add(e)),e}const mi=(i,t,e)=>{const n=Zt(t,e);n!==void 0&&i.add(n)};class Fu{constructor(t){this._config=Iu(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=sa(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(),na(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return tn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return tn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return tn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return tn(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(f=>mi(l,t,f))),h.forEach(f=>mi(l,s,f)),h.forEach(f=>mi(l,ge[o]||{},f)),h.forEach(f=>mi(l,W,f)),h.forEach(f=>mi(l,Un,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ra.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,ge[e]||{},W.datasets[e]||{},{type:e},W,Un]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=aa(this._resolverCache,t,s);let l=r;if($u(r,e)){o.$shared=!1,n=Qt(n)?n():n;const c=this.createResolver(t,n,a);l=ze(r,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=aa(this._resolverCache,t,n);return O(e)?ze(o,e,void 0,s):o}}function aa(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:Gn(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}const zu=i=>O(i)&&Object.getOwnPropertyNames(i).some(t=>Qt(i[t]));function $u(i,t){const{isScriptable:e,isIndexable:n}=lr(i);for(const s of t){const o=e(s),r=n(s),a=(r||o)&&i[s];if(o&&(Qt(a)||zu(a))||r&&B(a))return!0}return!1}var Bu="4.5.1";const Nu=["top","bottom","left","right","chartArea"];function la(i,t){return i==="top"||i==="bottom"||Nu.indexOf(i)===-1&&t==="x"}function ca(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function ha(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),z(e&&e.onComplete,[i],t)}function Vu(i){const t=i.chart,e=t.options.animation;z(e&&e.onProgress,[i],t)}function fa(i){return Qn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const en={},ua=i=>{const t=fa(i);return Object.values(en).filter(e=>e.canvas===t).pop()};function Wu(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const r=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=r)}}}function Hu(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}class fs{static defaults=W;static instances=en;static overrides=ge;static registry=At;static version=Bu;static getChart=ua;static register(...t){At.add(...t),da()}static unregister(...t){At.remove(...t),da()}constructor(t,e){const n=this.config=new Fu(e),s=fa(t),o=ua(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||au(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=zc(),this.ctx=a,this.canvas=l,this.width=h,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 Su,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=th(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],en[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$t.listen(this,"complete",ha),$t.listen(this,"progress",Vu),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return C(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return At}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():mr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return or(this.canvas,this.ctx),this}stop(){return $t.stop(this),this}resize(t,e){$t.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,mr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),z(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};I(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=hs(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),I(o,r=>{const a=r.options,l=a.id,c=hs(l,a),h=P(a.type,r.dtype);(a.position===void 0||la(a.position,c)!==la(r.dposition))&&(a.position=r.dposition),s[l]=!0;let f=null;if(l in n&&n[l].type===h)f=n[l];else{const u=At.getScale(h);f=new u({id:l,type:h,ctx:this.ctx,chart:this}),n[f.id]=f}f.init(a,t)}),I(s,(r,a)=>{r||delete n[a]}),I(n,r=>{st.configure(this,r,r.options),st.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(ca("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let r=this.getDatasetMeta(n);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=a,r.indexAxis=o.indexAxis||cs(a,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{const l=At.getController(a),{datasetElementType:c,dataElementType:h}=W.datasets[a];Object.assign(l,{dataElementType:At.getElement(h),datasetElementType:c&&At.getElement(c)}),r.controller=new l(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){I(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:f}=this.getDatasetMeta(c),u=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(u),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||I(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ca("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){I(this.scales,t=>{st.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Vo(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const r=n==="_removeElements"?-o:o;Wu(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!Vo(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;st.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Qt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&($t.has(this)?this.attached&&!$t.running(this)&&$t.start(this):(this.draw(),ha({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const r=e[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=Pr(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&Wi(e,s),t.controller.draw(),s&&Hi(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return zt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=Nf.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._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},n.push(s)),s}getContext(){return this.$context||(this.$context=ee(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);ii(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s: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(),$t.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),or(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete en[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};I(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){I(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},I(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Fi(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.index)),r=o(e,t),a=n?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,n,r),l=Hc(t),c=Hu(t,this._lastEvent,n,l);n&&(this._lastEvent=null,z(o.onHover,[t,a,this],this),l&&z(o.onClick,[t,a,this],this));const h=!Fi(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function da(){return I(fs.instances,i=>i._plugins.invalidate())}function ju(i,t,e){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,f=Math.min(c/r,et(n-e));if(i.beginPath(),i.arc(s,o,r-c/2,n+f/2,e-f/2),a>0){const u=Math.min(c/a,et(n-e));i.arc(s,o,a+c/2,e-u/2,n+u/2,!0)}else{const u=Math.min(c/2,r*et(n-e));if(h==="round")i.arc(s,o,u,e-R/2,n+R/2,!0);else if(h==="bevel"){const d=2*u*u,g=-d*Math.cos(e+R/2)+s,p=-d*Math.sin(e+R/2)+o,m=d*Math.cos(n+R/2)+s,b=d*Math.sin(n+R/2)+o;i.lineTo(g,p),i.lineTo(m,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function Yu(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;i.beginPath(),i.arc(o,r,a,n-c,e+c),l>s?(c=s/l,i.arc(o,r,l,e+c,n-c,!0)):i.arc(o,r,s,e+H,n-H),i.closePath(),i.clip()}function Uu(i){return qn(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Xu(i,t,e,n){const s=Uu(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,n*t/2),a=l=>{const c=(e-Math.min(o,l))*n/2;return J(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:J(s.innerStart,0,r),innerEnd:J(s.innerEnd,0,r)}}function Ne(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function nn(i,t,e,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,f=Math.max(t.outerRadius+n+e-c,0),u=h>0?h+n+e+c:0;let d=0;const g=s-l;if(n){const F=h>0?h-n:0,N=f>0?f-n:0,j=(F+N)/2,kt=j!==0?g*j/(j+n):g;d=(g-kt)/2}const p=Math.max(.001,g*f-e/R)/f,m=(g-p)/2,b=l+m+d,_=s-m-d,{outerStart:y,outerEnd:v,innerStart:x,innerEnd:w}=Xu(t,u,f,_-b),M=f-y,k=f-v,S=b+y/M,D=_-v/k,A=u+x,E=u+w,Q=b+x/A,gt=_-w/E;if(i.beginPath(),o){const F=(S+D)/2;if(i.arc(r,a,f,S,F),i.arc(r,a,f,F,D),v>0){const ot=Ne(k,D,r,a);i.arc(ot.x,ot.y,v,D,_+H)}const N=Ne(E,_,r,a);if(i.lineTo(N.x,N.y),w>0){const ot=Ne(E,gt,r,a);i.arc(ot.x,ot.y,w,_+H,gt+Math.PI)}const j=(_-w/u+(b+x/u))/2;if(i.arc(r,a,u,_-w/u,j,!0),i.arc(r,a,u,j,b+x/u,!0),x>0){const ot=Ne(A,Q,r,a);i.arc(ot.x,ot.y,x,Q+Math.PI,b-H)}const kt=Ne(M,b,r,a);if(i.lineTo(kt.x,kt.y),y>0){const ot=Ne(M,S,r,a);i.arc(ot.x,ot.y,y,b-H,S)}}else{i.moveTo(r,a);const F=Math.cos(S)*f+r,N=Math.sin(S)*f+a;i.lineTo(F,N);const j=Math.cos(D)*f+r,kt=Math.sin(D)*f+a;i.lineTo(j,kt)}i.closePath()}function Ku(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){nn(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%$||$))}return nn(i,t,e,n,l,s),i.fill(),l}function qu(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:f,borderDashOffset:u,borderRadius:d}=l,g=l.borderAlign==="inner";if(!c)return;i.setLineDash(f||[]),i.lineDashOffset=u,g?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let p=t.endAngle;if(o){nn(i,t,e,n,p,s);for(let m=0;m<o;++m)i.stroke();isNaN(a)||(p=r+(a%$||$))}g&&Yu(i,t,p),l.selfJoin&&p-r>=R&&d===0&&h!=="miter"&&ju(i,t,p),o||(nn(i,t,e,n,p,s),i.stroke())}class Gu extends Bt{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.getProps(["x","y"],n),{angle:o,distance:r}=Uo(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=(this.options.spacing+this.options.borderWidth)/2,d=P(f,l-a),g=si(o,a,l)&&a!==l,p=d>=$||g,m=It(r,c+u,h+u);return p&&m}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(s+o)/2,f=(r+a+c+l)/2;return{x:e+Math.cos(h)*f,y:n+Math.sin(h)*f}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>$?Math.floor(n/$):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(R,n||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,Ku(t,this,c,o,r),qu(t,this,c,o,r),t.restore()}}function ga(i,t,e=t){i.lineCap=P(e.borderCapStyle,t.borderCapStyle),i.setLineDash(P(e.borderDash,t.borderDash)),i.lineDashOffset=P(e.borderDashOffset,t.borderDashOffset),i.lineJoin=P(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=P(e.borderWidth,t.borderWidth),i.strokeStyle=P(e.borderColor,t.borderColor)}function Ju(i,t,e){i.lineTo(e.x,e.y)}function Zu(i){return i.stepped?uh:i.tension||i.cubicInterpolationMode==="monotone"?dh:Ju}function pa(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function Qu(i,t,e,n){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=pa(s,e,n),h=Zu(o);let{move:f=!0,reverse:u}=n||{},d,g,p;for(d=0;d<=c;++d)g=s[(a+(u?c-d:d))%r],!g.skip&&(f?(i.moveTo(g.x,g.y),f=!1):h(i,p,g,u,o.stepped),p=g);return l&&(g=s[(a+(u?c:0))%r],h(i,p,g,u,o.stepped)),!!l}function td(i,t,e,n){const s=t.points,{count:o,start:r,ilen:a}=pa(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,f=0,u,d,g,p,m,b;const _=v=>(r+(c?a-v:v))%o,y=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(d=s[_(0)],i.moveTo(d.x,d.y)),u=0;u<=a;++u){if(d=s[_(u)],d.skip)continue;const v=d.x,x=d.y,w=v|0;w===g?(x<p?p=x:x>m&&(m=x),h=(f*h+v)/++f):(y(),i.lineTo(v,x),g=w,f=0,p=m=x),b=x}y()}function us(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?td:Qu}function ed(i){return i.stepped?Yh:i.tension||i.cubicInterpolationMode==="monotone"?Uh:ye}function id(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),ga(i,t.options),i.stroke(s)}function nd(i,t,e,n){const{segments:s,options:o}=t,r=us(t);for(const a of s)ga(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const sd=typeof Path2D=="function";function od(i,t,e,n){sd&&!t.options.segment?id(i,t,e,n):nd(i,t,e,n)}class sn extends Bt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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 n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;zh(this._points,n,t,s,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=Zh(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,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,r=Mr(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=ed(n);let c,h;for(c=0,h=r.length;c<h;++c){const{start:f,end:u}=r[c],d=o[f],g=o[u];if(d===g){a.push(d);continue}const p=Math.abs((s-d[e])/(g[e]-d[e])),m=l(d,g,p,n.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,n){return us(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=us(this);let r=this._loop;e=e||0,n=n||this.points.length-e;for(const a of s)r&=o(t,this,a,{start:e,end:e+n-1});return!!r}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),od(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ma(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class rd extends Bt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return ma(this,t,"x",e)}inYRange(t,e){return ma(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!zt(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Kn(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function ba(i,t){const{x:e,y:n,base:s,width:o,height:r}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,f;return i.horizontal?(f=r/2,a=Math.min(e,s),l=Math.max(e,s),c=n-f,h=n+f):(f=o/2,a=e-f,l=e+f,c=Math.min(n,s),h=Math.max(n,s)),{left:a,top:c,right:l,bottom:h}}function se(i,t,e,n){return i?0:J(t,e,n)}function ad(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,o=ar(n);return{t:se(s.top,o.top,0,e),r:se(s.right,o.right,0,t),b:se(s.bottom,o.bottom,0,e),l:se(s.left,o.left,0,t)}}function ld(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=be(s),r=Math.min(t,e),a=i.borderSkipped,l=n||O(s);return{topLeft:se(!l||a.top||a.left,o.topLeft,0,r),topRight:se(!l||a.top||a.right,o.topRight,0,r),bottomLeft:se(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:se(!l||a.bottom||a.right,o.bottomRight,0,r)}}function cd(i){const t=ba(i),e=t.right-t.left,n=t.bottom-t.top,s=ad(i,e/2,n/2),o=ld(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function ds(i,t,e,n){const s=t===null,o=e===null,a=i&&!(s&&o)&&ba(i,n);return a&&(s||It(t,a.left,a.right))&&(o||It(e,a.top,a.bottom))}function hd(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function fd(i,t){i.rect(t.x,t.y,t.w,t.h)}function gs(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-n,r=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+o,h:i.h+r,radius:i.radius}}class ud extends Bt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:r}=cd(this),a=hd(r.radius)?li:fd;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,gs(r,e,o)),t.clip(),a(t,gs(o,-e,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,gs(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return ds(this,t,e,n)}inXRange(t,e){return ds(this,t,null,e)}inYRange(t,e){return ds(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}function dd(i,t,e,n,s){const o=s.samples||n;if(o>=e)return i.slice(t,t+e);const r=[],a=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,f,u,d,g,p;for(r[l++]=i[h],f=0;f<o-2;f++){let m=0,b=0,_;const y=Math.floor((f+1)*a)+1+t,v=Math.min(Math.floor((f+2)*a)+1,e)+t,x=v-y;for(_=y;_<v;_++)m+=i[_].x,b+=i[_].y;m/=x,b/=x;const w=Math.floor(f*a)+1+t,M=Math.min(Math.floor((f+1)*a)+1,e)+t,{x:k,y:S}=i[h];for(d=g=-1,_=w;_<M;_++)g=.5*Math.abs((k-m)*(i[_].y-S)-(k-i[_].x)*(b-S)),g>d&&(d=g,u=i[_],p=_);r[l++]=u,h=p}return r[l++]=i[c],r}function gd(i,t,e,n){let s=0,o=0,r,a,l,c,h,f,u,d,g,p;const m=[],b=t+e-1,_=i[t].x,v=i[b].x-_;for(r=t;r<t+e;++r){a=i[r],l=(a.x-_)/v*n,c=a.y;const x=l|0;if(x===h)c<g?(g=c,f=r):c>p&&(p=c,u=r),s=(o*s+a.x)/++o;else{const w=r-1;if(!C(f)&&!C(u)){const M=Math.min(f,u),k=Math.max(f,u);M!==d&&M!==w&&m.push({...i[M],x:s}),k!==d&&k!==w&&m.push({...i[k],x:s})}r>0&&w!==d&&m.push(i[w]),m.push(a),h=x,o=0,g=p=c,f=u=d=r}}return m}function _a(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function xa(i){i.data.datasets.forEach(t=>{_a(t)})}function pd(i,t){const e=t.length;let n=0,s;const{iScale:o}=i,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=J(Ft(t,o.axis,r).lo,0,e-1)),c?s=J(Ft(t,o.axis,a).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var md={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){xa(i);return}const n=i.width;i.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:a}=s,l=i.getDatasetMeta(o),c=r||s.data;if(ci([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=i.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||i.options.parsing)return;let{start:f,count:u}=pd(l,c);const d=e.threshold||4*n;if(u<=d){_a(s);return}C(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(e.algorithm){case"lttb":g=dd(c,f,u,n,e);break;case"min-max":g=gd(c,f,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(i){xa(i)}};function bd(i,t,e){const n=i.segments,s=i.points,o=t.points,r=[];for(const a of n){let{start:l,end:c}=a;c=on(l,c,s);const h=ps(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}const f=Mr(t,h);for(const u of f){const d=ps(e,o[u.start],o[u.end],u.loop),g=wr(a,s,d);for(const p of g)r.push({source:p,target:u,start:{[e]:ya(h,d,"start",Math.max)},end:{[e]:ya(h,d,"end",Math.min)}})}}return r}function ps(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=et(s),o=et(o)),{property:i,start:s,end:o}}function _d(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=on(r,a,s);const l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function on(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function ya(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function va(i,t){let e=[],n=!1;return B(i)?(n=!0,e=i):e=_d(i,t),e.length?new sn({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function wa(i){return i&&i.fill!==!1}function xd(i,t,e){let s=i[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!V(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function yd(i,t,e){const n=kd(i);if(O(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return V(s)&&Math.floor(s)===s?vd(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function vd(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function wd(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:O(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Md(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:O(i)?n=i.value:n=t.getBaseValue(),n}function kd(i){const t=i.options,e=t.fill;let n=P(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Sd(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,r=n.points,a=Pd(t,e);a.push(va({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Dd(s,r[h],a)}return new sn({points:s,options:{}})}function Pd(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Dd(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:a,point:l}=Ad(o,t,"x");if(!(!l||r&&a)){if(r)n.unshift(l);else if(i.push(l),!a)break}}i.push(...n)}function Ad(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,r=i.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],f=r[h.start][e],u=r[h.end][e];if(It(s,f,u)){a=s===f,l=s===u;break}}return{first:a,last:l,point:n}}class Ma{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:$},t.arc(s,o,r,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function Cd(i){const{chart:t,fill:e,line:n}=i;if(V(e))return Od(t,e);if(e==="stack")return Sd(i);if(e==="shape")return!0;const s=Td(i);return s instanceof Ma?s:va(s,n)}function Od(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Td(i){return(i.scale||{}).getPointPositionForValue?Rd(i):Ed(i)}function Ed(i){const{scale:t={},fill:e}=i,n=wd(e,t);if(V(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Rd(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=Md(e,t,o),a=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new Ma({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function ms(i,t,e){const n=Cd(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,h=c.fill,f=c.backgroundColor,{above:u=f,below:d=f}=h||{},g=s.getDatasetMeta(o),p=Pr(s,g);n&&r.points.length&&(Wi(i,e),Ld(i,{line:r,target:n,above:u,below:d,area:e,scale:a,axis:l,clip:p}),Hi(i))}function Ld(i,t){const{line:e,target:n,above:s,below:o,area:r,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let h=o;o!==s&&(c==="x"?(ka(i,n,r.top),bs(i,{line:e,target:n,color:s,scale:a,property:c,clip:l}),i.restore(),i.save(),ka(i,n,r.bottom)):c==="y"&&(Sa(i,n,r.left),bs(i,{line:e,target:n,color:o,scale:a,property:c,clip:l}),i.restore(),i.save(),Sa(i,n,r.right),h=s)),bs(i,{line:e,target:n,color:h,scale:a,property:c,clip:l}),i.restore()}function ka(i,t,e){const{segments:n,points:s}=t;let o=!0,r=!1;i.beginPath();for(const a of n){const{start:l,end:c}=a,h=s[l],f=s[on(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(f.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Sa(i,t,e){const{segments:n,points:s}=t;let o=!0,r=!1;i.beginPath();for(const a of n){const{start:l,end:c}=a,h=s[l],f=s[on(l,c,s)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(e,h.y),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(e,f.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function bs(i,t){const{line:e,target:n,property:s,color:o,scale:r,clip:a}=t,l=bd(e,n,s);for(const{source:c,target:h,start:f,end:u}of l){const{style:{backgroundColor:d=o}={}}=c,g=n!==!0;i.save(),i.fillStyle=d,Id(i,r,a,g&&ps(s,f,u)),i.beginPath();const p=!!e.pathSegment(i,c);let m;if(g){p?i.closePath():Pa(i,n,u,s);const b=!!n.pathSegment(i,h,{move:p,reverse:!0});m=p&&b,m||Pa(i,n,f,s)}i.closePath(),i.fill(m?"evenodd":"nonzero"),i.restore()}}function Id(i,t,e,n){const s=t.chart.chartArea,{property:o,start:r,end:a}=n||{};if(o==="x"||o==="y"){let l,c,h,f;o==="x"?(l=r,c=s.top,h=a,f=s.bottom):(l=s.left,c=r,h=s.right,f=a),i.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),f=Math.min(f,e.bottom)),i.rect(l,c,h-l,f-c),i.clip()}}function Pa(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var Fd={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<n;++r)o=i.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof sn&&(l={visible:i.isDatasetVisible(r),index:r,fill:yd(a,r,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=xd(s,r,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&ms(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;wa(o)&&ms(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!wa(n)||e.drawTime!=="beforeDatasetDraw"||ms(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Da=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},zd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Aa extends Bt{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=z(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=K(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Da(n,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let f=t;o.textAlign="left",o.textBaseline="middle";let u=-1,d=-h;return this.legendItems.forEach((g,p)=>{const m=n+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(f+=h,c[c.length-(p>0?0:1)]=0,d+=h,u++),l[p]={left:0,top:d,row:u,width:m,height:s},c[c.length-1]+=m+a}),f}_fitCols(t,e,n,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let f=a,u=0,d=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:_,itemHeight:y}=$d(n,e,o,m,s);b>0&&d+y+2*a>h&&(f+=u+a,c.push({width:u,height:d}),g+=u+a,p++,u=d=0),l[b]={left:g,top:d,col:p,width:_,height:y},u=Math.max(u,_),d+=y+a}),f+=u,c.push({width:u,height:d}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,r=Be(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=it(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=it(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=it(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=it(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Wi(t,this),this._draw(),Hi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=W.color,l=Be(t.rtl,this.left,this.width),c=K(r.font),{padding:h}=r,f=c.size,u=f/2;let d;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=Da(r,f),b=function(w,M,k){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const S=P(k.lineWidth,1);if(s.fillStyle=P(k.fillStyle,a),s.lineCap=P(k.lineCap,"butt"),s.lineDashOffset=P(k.lineDashOffset,0),s.lineJoin=P(k.lineJoin,"miter"),s.lineWidth=S,s.strokeStyle=P(k.strokeStyle,a),s.setLineDash(P(k.lineDash,[])),r.usePointStyle){const D={radius:p*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:S},A=l.xPlus(w,g/2),E=M+u;rr(s,D,A,E,r.pointStyleWidth&&g)}else{const D=M+Math.max((f-p)/2,0),A=l.leftForLtr(w,g),E=be(k.borderRadius);s.beginPath(),Object.values(E).some(Q=>Q!==0)?li(s,{x:A,y:D,w:g,h:p,radius:E}):s.rect(A,D,g,p),s.fill(),S!==0&&s.stroke()}s.restore()},_=function(w,M,k){me(s,k.text,w,M+m/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();y?d={x:it(o,this.left+h,this.right-n[0]),y:this.top+h+v,line:0}:d={x:this.left+h,y:it(o,this.top+v+h,this.bottom-e[0].height),line:0},_r(this.ctx,t.textDirection);const x=m+h;this.legendItems.forEach((w,M)=>{s.strokeStyle=w.fontColor,s.fillStyle=w.fontColor;const k=s.measureText(w.text).width,S=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),D=g+u+k;let A=d.x,E=d.y;l.setWidth(this.width),y?M>0&&A+D+h>this.right&&(E=d.y+=x,d.line++,A=d.x=it(o,this.left+h,this.right-n[d.line])):M>0&&E+x>this.bottom&&(A=d.x=A+e[d.line].width+h,d.line++,E=d.y=it(o,this.top+v+h,this.bottom-e[d.line].height));const Q=l.x(A);if(b(Q,E,w),A=eh(S,A+g+u,y?A+D:this.right,t.rtl),_(l.x(A),E,w),y)d.x+=D+h;else if(typeof w.text!="string"){const gt=c.lineHeight;d.y+=Ca(w,gt)+h}else d.y+=x}),xr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=K(e.font),s=nt(e.padding);if(!e.display)return;const o=Be(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,f=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,f=it(t.align,f,this.right-u);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+it(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const d=it(a,f,f+u);r.textAlign=o.textAlign(Hn(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,me(r,e.text,d,h,n)}_computeTitleHeight(){const t=this.options.title,e=K(t.font),n=nt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(It(t,this.left,this.right)&&It(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],It(t,s.left,s.left+s.width)&&It(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Vd(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=zd(s,n);s&&!o&&z(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&z(e.onHover,[t,n,this],this)}else n&&z(e.onClick,[t,n,this],this)}}function $d(i,t,e,n,s){const o=Bd(n,i,t,e),r=Nd(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Bd(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+n.measureText(s).width}function Nd(i,t,e){let n=i;return typeof t.text!="string"&&(n=Ca(t,e)),n}function Ca(i,t){const e=i.text?i.text.length:0;return t*e}function Vd(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Wd={id:"legend",_element:Aa,start(i,t,e){const n=i.legend=new Aa({ctx:i.ctx,options:e,chart:i});st.configure(i,n,e),st.addBox(i,n)},stop(i){st.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;st.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=nt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class _s extends Bt{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 n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=B(n.text)?n.text.length:1;this._padding=nt(n.padding);const o=s*K(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,h,f;return this.isHorizontal()?(h=it(a,n,o),f=e+t,c=o-n):(r.position==="left"?(h=n+t,f=it(a,s,e),l=R*-.5):(h=o-t,f=it(a,e,s),l=R*.5),c=s-e),{titleX:h,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=K(e.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);me(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Hn(e.align),textBaseline:"middle",translation:[r,a]})}}function Hd(i,t){const e=new _s({ctx:i.ctx,options:t,chart:i});st.configure(i,e,t),st.addBox(i,e),i.titleBlock=e}var jd={id:"title",_element:_s,start(i,t,e){Hd(i,e)},stop(i){const t=i.titleBlock;st.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;st.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const rn=new WeakMap;var Yd={id:"subtitle",start(i,t,e){const n=new _s({ctx:i.ctx,options:e,chart:i});st.configure(i,n,e),st.addBox(i,n),rn.set(i,n)},stop(i){st.removeBox(i,rn.get(i)),rn.delete(i)},beforeUpdate(i,t,e){const n=rn.get(i);st.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const bi={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Vn(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function Ct(i,t){return t&&(B(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Nt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
3
- `)>-1?i.split(`
4
- `):i}function Ud(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:i,label:r,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function Oa(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=K(t.bodyFont),c=K(t.titleFont),h=K(t.footerFont),f=o.length,u=s.length,d=n.length,g=nt(t.padding);let p=g.height,m=0,b=n.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,f&&(p+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=d*v+(b-d)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let _=0;const y=function(v){m=Math.max(m,e.measureText(v).width+_)};return e.save(),e.font=c.string,I(i.title,y),e.font=l.string,I(i.beforeBody.concat(i.afterBody),y),_=t.displayColors?r+2+t.boxPadding:0,I(n,v=>{I(v.before,y),I(v.lines,y),I(v.after,y)}),_=0,e.font=h.string,I(i.footer,y),e.restore(),m+=g.width,{width:m,height:p}}function Xd(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function Kd(i,t,e,n){const{x:s,width:o}=n,r=e.caretSize+e.caretPadding;if(i==="left"&&s+o+r>t.width||i==="right"&&s-o-r<0)return!0}function qd(i,t,e,n){const{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Kd(c,i,t,e)&&(c="center"),c}function Ta(i,t,e){const n=e.yAlign||t.yAlign||Xd(i,e);return{xAlign:e.xAlign||t.xAlign||qd(i,t,e,n),yAlign:n}}function Gd(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Jd(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function Ea(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:h,topRight:f,bottomLeft:u,bottomRight:d}=be(r);let g=Gd(t,a);const p=Jd(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+s:a==="right"&&(g+=Math.max(f,d)+s),{x:J(g,0,n.width-t.width),y:J(p,0,n.height-t.height)}}function an(i,t,e){const n=nt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function Ra(i){return Ct([],Nt(i))}function Zd(i,t,e){return ee(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function La(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Ia={beforeTitle:Lt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:Lt,beforeBody:Lt,beforeLabel:Lt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return C(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Lt,afterBody:Lt,beforeFooter:Lt,footer:Lt,afterFooter:Lt};function lt(i,t,e,n){const s=i[t].call(e,n);return typeof s>"u"?Ia[t].call(e,n):s}class Fa extends Bt{static positioners=bi;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new Ar(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Zd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=lt(n,"beforeTitle",this,t),o=lt(n,"title",this,t),r=lt(n,"afterTitle",this,t);let a=[];return a=Ct(a,Nt(s)),a=Ct(a,Nt(o)),a=Ct(a,Nt(r)),a}getBeforeBody(t,e){return Ra(lt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return I(t,o=>{const r={before:[],lines:[],after:[]},a=La(n,o);Ct(r.before,Nt(lt(a,"beforeLabel",this,o))),Ct(r.lines,lt(a,"label",this,o)),Ct(r.after,Nt(lt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return Ra(lt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=lt(n,"beforeFooter",this,t),o=lt(n,"footer",this,t),r=lt(n,"afterFooter",this,t);let a=[];return a=Ct(a,Nt(s)),a=Ct(a,Nt(o)),a=Ct(a,Nt(r)),a}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Ud(this.chart,e[l]));return t.filter&&(a=a.filter((h,f,u)=>t.filter(h,f,u,n))),t.itemSort&&(a=a.sort((h,f)=>t.itemSort(h,f,n))),I(a,h=>{const f=La(t.callbacks,h);s.push(lt(f,"labelColor",this,h)),o.push(lt(f,"labelPointStyle",this,h)),r.push(lt(f,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=bi[n.position].call(this,s,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const l=this._size=Oa(this,n),c=Object.assign({},a,l),h=Ta(this.chart,n,c),f=Ea(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:f}=be(a),{x:u,y:d}=t,{width:g,height:p}=e;let m,b,_,y,v,x;return o==="center"?(v=d+p/2,s==="left"?(m=u,b=m-r,y=v+r,x=v-r):(m=u+g,b=m+r,y=v-r,x=v+r),_=m):(s==="left"?b=u+Math.max(l,h)+r:s==="right"?b=u+g-Math.max(c,f)-r:b=this.caretX,o==="top"?(y=d,v=y-r,m=b-r,_=b+r):(y=d+p,v=y+r,m=b+r,_=b-r),x=y),{x1:m,x2:b,x3:_,y1:y,y2:v,y3:x}}drawTitle(t,e,n){const s=this.title,o=s.length;let r,a,l;if(o){const c=Be(n.rtl,this.x,this.width);for(t.x=an(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",r=K(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,s,o){const r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,h=K(o.bodyFont),f=an(this,"left",o),u=s.x(f),d=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+d;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(u,c)+c/2,b=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Kn(t,p,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Kn(t,p,m,b)}else{t.lineWidth=O(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const p=s.leftForLtr(u,c),m=s.leftForLtr(s.xPlus(u,1),c-2),b=be(r.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,li(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),li(t,{x:m,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,f=K(n.bodyFont);let u=f.lineHeight,d=0;const g=Be(n.rtl,this.x,this.width),p=function(k){e.fillText(k,g.x(t.x+d),t.y+u/2),t.y+=u+o},m=g.textAlign(r);let b,_,y,v,x,w,M;for(e.textAlign=r,e.textBaseline="middle",e.font=f.string,t.x=an(this,m,n),e.fillStyle=n.bodyColor,I(this.beforeBody,p),d=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,w=s.length;v<w;++v){for(b=s[v],_=this.labelTextColors[v],e.fillStyle=_,I(b.before,p),y=b.lines,a&&y.length&&(this._drawColorBox(e,t,v,g,n),u=Math.max(f.lineHeight,l)),x=0,M=y.length;x<M;++x)p(y[x]),u=f.lineHeight;I(b.after,p)}d=0,u=f.lineHeight,I(this.afterBody,p),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let r,a;if(o){const l=Be(n.rtl,this.x,this.width);for(t.x=an(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",r=K(n.footerFont),e.fillStyle=n.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=n,{topLeft:f,topRight:u,bottomLeft:d,bottomRight:g}=be(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+f,l),r==="top"&&this.drawCaret(t,e,n,s),e.lineTo(a+c-u,l),e.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(a+c,l+h-g),e.quadraticCurveTo(a+c,l+h,a+c-g,l+h),r==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(a+d,l+h),e.quadraticCurveTo(a,l+h,a,l+h-d),r==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(a,l+f),e.quadraticCurveTo(a,l,a+f,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const r=bi[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Oa(this,t),l=Object.assign({},r,this._size),c=Ta(e,t,l),h=Ea(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=nt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),_r(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),xr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Fi(n,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,n),a=this._positionChanged(r,t),l=e||!Fi(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,r=bi[o.position].call(this,t,e);return r!==!1&&(n!==r.x||s!==r.y)}}var Qd={id:"tooltip",_element:Fa,positioners:bi,afterInit(i,t,e){e&&(i.tooltip=new Fa({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ia},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const tg=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function eg(i,t,e,n){const s=i.indexOf(t);if(s===-1)return tg(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const ig=(i,t)=>i===null?null:J(Math.round(i),0,t);function za(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class ng extends we{static id="category";static defaults={ticks:{callback:za}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(C(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:eg(n,t,P(e,t),this._addedLabels),ig(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return za.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function sg(i,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:f,includeBounds:u}=i,d=o||1,g=h-1,{min:p,max:m}=t,b=!C(r),_=!C(a),y=!C(c),v=(m-p)/(f+1);let x=Ho((m-p)/g/d)*d,w,M,k,S;if(x<1e-14&&!b&&!_)return[{value:p},{value:m}];S=Math.ceil(m/x)-Math.floor(p/x),S>g&&(x=Ho(S*x/g/d)*d),C(l)||(w=Math.pow(10,l),x=Math.ceil(x*w)/w),s==="ticks"?(M=Math.floor(p/x)*x,k=Math.ceil(m/x)*x):(M=p,k=m),b&&_&&o&&Kc((a-r)/o,x/1e3)?(S=Math.round(Math.min((a-r)/x,h)),x=(a-r)/S,M=r,k=a):y?(M=b?r:M,k=_?a:k,S=c-1,x=(k-M)/S):(S=(k-M)/x,ni(S,Math.round(S),x/1e3)?S=Math.round(S):S=Math.ceil(S));const D=Math.max(Yo(x),Yo(M));w=Math.pow(10,C(l)?D:l),M=Math.round(M*w)/w,k=Math.round(k*w)/w;let A=0;for(b&&(u&&M!==r?(e.push({value:r}),M<r&&A++,ni(Math.round((M+A*x)*w)/w,r,$a(r,v,i))&&A++):M<r&&A++);A<S;++A){const E=Math.round((M+A*x)*w)/w;if(_&&E>a)break;e.push({value:E})}return _&&u&&k!==a?e.length&&ni(e[e.length-1].value,a,$a(a,v,i))?e[e.length-1].value=a:e.push({value:a}):(!_||k===a)&&e.push({value:k}),e}function $a(i,t,{horizontal:e,minRotation:n}){const s=Mt(n),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class ln extends we{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 C(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=e?s:l,a=l=>o=n?o:l;if(t){const l=Dt(s),c=Dt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=sg(s,o);return t.bounds==="ticks"&&jo(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return ri(t,this.chart.options.locale,this.options.ticks.format)}}class og extends ln{static id="linear";static defaults={ticks:{callback:Ni.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=V(t)?t:0,this.max=V(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=Mt(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const _i=i=>Math.floor(te(i)),Me=(i,t)=>Math.pow(10,_i(i)+t);function Ba(i){return i/Math.pow(10,_i(i))===1}function Na(i,t,e){const n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function rg(i,t){const e=t-i;let n=_i(e);for(;Na(i,t,n)>10;)n++;for(;Na(i,t,n)<10;)n--;return Math.min(n,_i(i))}function ag(i,{min:t,max:e}){t=dt(i.min,t);const n=[],s=_i(t);let o=rg(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-h)/Math.pow(10,o)),u=dt(i.min,Math.round((l+h+f*Math.pow(10,o))*r)/r);for(;u<e;)n.push({value:u,major:Ba(u),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,r=o>=0?1:r),u=Math.round((l+h+f*Math.pow(10,o))*r)/r;const d=dt(i.max,u);return n.push({value:d,major:Ba(d),significand:f}),n}class lg extends we{static id="logarithmic";static defaults={ticks:{callback:Ni.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=ln.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return V(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=V(t)?Math.max(0,t):null,this.max=V(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!V(this._userMin)&&(this.min=t===Me(this.min,0)?Me(this.min,-1):Me(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const o=a=>n=t?n:a,r=a=>s=e?s:a;n===s&&(n<=0?(o(1),r(10)):(o(Me(n,-1)),r(Me(s,1)))),n<=0&&o(Me(s,-1)),s<=0&&r(Me(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=ag(e,this);return t.bounds==="ticks"&&jo(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":ri(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=te(t),this._valueRange=te(this.max)-te(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(te(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function xs(i){const t=i.ticks;if(t.display&&i.display){const e=nt(t.backdropPadding);return P(t.font&&t.font.size,W.font.size)+e.height}return 0}function cg(i,t,e){return e=B(e)?e:[e],{w:fh(i,t.string,e),h:e.length*t.lineHeight}}function Va(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function hg(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?R/o:0;for(let l=0;l<o;l++){const c=r.setContext(i.getPointLabelContext(l));s[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+s[l],a),f=K(c.font),u=cg(i.ctx,f,i._pointLabels[l]);n[l]=u;const d=et(i.getIndexAngle(l)+a),g=Math.round(Nn(d)),p=Va(g,h.x,u.w,0,180),m=Va(g,h.y,u.h,90,270);fg(e,t,d,p,m)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=gg(i,n,s)}function fg(i,t,e,n,s){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;n.start<t.l?(a=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function ug(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=i.getPointPosition(t,n+s+r,o),c=Math.round(Nn(et(l.angle+H))),h=bg(l.y,a.h,c),f=pg(c),u=mg(l.x,a.w,f);return{visible:!0,x:l.x,y:h,textAlign:f,left:u,top:h,right:u+a.w,bottom:h+a.h}}function dg(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(zt({x:e,y:n},t)||zt({x:e,y:o},t)||zt({x:s,y:n},t)||zt({x:s,y:o},t))}function gg(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:xs(o)/2,additionalAngle:r?R/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const f=ug(i,h,l);n.push(f),a==="auto"&&(f.visible=dg(f,c),f.visible&&(c=f))}return n}function pg(i){return i===0||i===180?"center":i<180?"left":"right"}function mg(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function bg(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function _g(i,t,e){const{left:n,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!C(a)){const l=be(t.borderRadius),c=nt(t.backdropPadding);i.fillStyle=a;const h=n-c.left,f=s-c.top,u=o-n+c.width,d=r-s+c.height;Object.values(l).some(g=>g!==0)?(i.beginPath(),li(i,{x:h,y:f,w:u,h:d,radius:l}),i.fill()):i.fillRect(h,f,u,d)}}function xg(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const r=n.setContext(i.getPointLabelContext(s));_g(e,r,o);const a=K(r.font),{x:l,y:c,textAlign:h}=o;me(e,i._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Wa(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,$);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<n;r++)o=i.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function yg(i,t,e,n,s){const o=i.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!n||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Wa(i,e,r,n),o.closePath(),o.stroke(),o.restore())}function vg(i,t,e){return ee(i,{label:e,index:t,type:"pointLabel"})}class wg extends ln{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ni.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=nt(xs(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=V(t)&&!isNaN(t)?t:0,this.max=V(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xs(this.options))}generateTickLabels(t){ln.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=z(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?hg(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=$/(this._pointLabels.length||1),n=this.options.startAngle||0;return et(t*e+Mt(n))}getDistanceFromCenterForValue(t){if(C(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(C(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<e.length){const n=e[t];return vg(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-H+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),Wa(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s,border:o}=e,r=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&xg(this,r),s.display&&this.ticks.forEach((h,f)=>{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(f),d=s.setContext(u),g=o.setContext(u);yg(this,d,l,r,g)}}),n.display){for(t.save(),a=r-1;a>=0;a--){const h=n.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:u}=h;!u||!f||(t.lineWidth=u,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=K(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=nt(c.backdropPadding);t.fillRect(-r/2-f.left,-o-h.size/2-f.top,r+f.width,h.size+f.height)}me(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const cn={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}},ct=Object.keys(cn);function Ha(i,t){return i-t}function ja(i,t){if(C(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let r=t;return typeof n=="function"&&(r=n(r)),V(r)||(r=typeof n=="string"?e.parse(r,n):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(Fe(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function Ya(i,t,e,n){const s=ct.length;for(let o=ct.indexOf(i);o<s-1;++o){const r=cn[ct[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=n)return ct[o]}return ct[s-1]}function Mg(i,t,e,n,s){for(let o=ct.length-1;o>=ct.indexOf(e);o--){const r=ct[o];if(cn[r].common&&i._adapter.diff(s,n,r)>=t-1)return r}return ct[e?ct.indexOf(e):0]}function kg(i){for(let t=ct.indexOf(i)+1,e=ct.length;t<e;++t)if(cn[ct[t]].common)return ct[t]}function Ua(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=Wn(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function Sg(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function Xa(i,t,e){const n=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,n.push({value:a,major:!1});return o===0||!e?n:Sg(i,n,s,e)}class ys extends we{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const n=t.time||(t.time={}),s=this._adapter=new If._date(t.adapters.date);s.init(e),ei(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:ja(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=V(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=V(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=Zc(s,o,r);return this._unit=e.unit||(n.autoSkip?Ya(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Mg(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:kg(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Xa(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=J(e,0,r),n=J(n,0,r),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||Ya(o.minUnit,e,n,this._getLabelCapacity(e)),a=P(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Fe(l)||l===!0,h={};let f=e,u,d;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":r),t.diff(n,e,r)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+r);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(u=f,d=0;u<n;u=+t.add(u,a,r),d++)Ua(h,u,g);return(u===n||s.bounds==="ticks"||d===1)&&Ua(h,u,g),Object.keys(h).sort(Ha).map(p=>+p)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,n,s){const o=this.options,r=o.ticks.callback;if(r)return z(r,[t,e,n],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],f=c&&a[c],u=n[e],d=c&&f&&u&&u.major;return this._adapter.format(t,s||(d?f:h))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=Mt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,Xa(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(ja(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return qo(t.sort(Ha))}}function hn(i,t,e){let n=0,s=i.length-1,o,r,a,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Ft(i,"pos",t)),{pos:o,time:a}=i[n],{pos:r,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Ft(i,"time",t)),{time:o,pos:a}=i[n],{time:r,pos:l}=i[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Pg extends ys{static id="timeseries";static defaults=ys.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=hn(e,this.min),this._tableRange=hn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(r=0,a=s.length;r<a;++r)h=s[r+1],l=s[r-1],c=s[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(e)||n.length===1)&&n.push(e),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(hn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return hn(this._table,n*this._tableRange+this._minPos,!0)}}var Dg=sc('<div part="container" class="chart-container svelte-3ok30t" id="chart-container"><canvas id="canvas" class="svelte-3ok30t"></canvas></div>');const Ag={hash:"svelte-3ok30t",code:'@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host {font-family:"Roboto", sans-serif;width:100%;height:auto;}.chart-container.svelte-3ok30t {position:relative;margin:auto;width:100%;height:100%;overflow:hidden;}#canvas.svelte-3ok30t {margin:auto;display:block;max-width:100%;max-height:100%;width:100%;height:auto;}'};function Ka(i,t){Is(t,!0),hc(i,Ag);const e=t.$$host;fs.register(Gu,sn,ud,rd,Df,Af,Br,Of,Ef,Tf,Rf,Lf,ng,og,lg,wg,ys,Pg,md,Fd,Wd,jd,Qd,Yd);function n(m,b){t.$$host.dispatchEvent(new CustomEvent(m,{detail:b}))}let s=Ao(t,"id",7,""),o=Ao(t,"data",7,void 0),r=null,a=!1,l=Et(void 0);oo(()=>{o()&&typeof o()=="string"&&(o(JSON.parse(o())),h())});function c(m){const b=U(l)?.getElementsAtEventForMode(m,"nearest",{intersect:!0},!0);let _=[];if(b?.length)for(const y of b){const v=U(l)?.data?.labels?.[y.index],x=U(l)?.data.datasets[y.datasetIndex].data[y.index];_.push({label:v,value:x})}n("chartClick",_)}function h(){if(a&&o()&&e?.shadowRoot?.getElementById("canvas")){U(l)&&(U(l).destroy(),mt(l,void 0));const m=e?.shadowRoot?.getElementById("chart-container"),b=m?.clientWidth??0,_=m?.clientHeight??0,y=b>0&&_>0?b/_:void 0,v={responsive:!0,maintainAspectRatio:!0,...y?{aspectRatio:y}:{}};mt(l,new fs(e?.shadowRoot?.getElementById("canvas"),{type:o().type,data:o().data,options:{...o().options||{},...v}}),!0)}}const f=Oo(()=>{console.log("handleResize");const m=U(l)?.canvas||void 0;if(!(!U(l)||!m||!m.isConnected))try{h()}catch(b){console.warn("Chart resize failed",b)}},100);Do(()=>{a=!0,e?.shadowRoot?.getElementById("chart-container")&&(r=new ResizeObserver(()=>{f()}),r.observe(e.shadowRoot.getElementById("chart-container"))),window.addEventListener("resize",f),h()}),cc(()=>{console.log("onDestroy"),window.removeEventListener("resize",f),r&&(r.disconnect(),r=null),U(l)&&(U(l).destroy(),mt(l,void 0))});var u={get id(){return s()},set id(m=""){s(m),vn()},get data(){return o()},set data(m=void 0){o(m),vn()}},d=Dg(),g=Nl(d),p=Ll(()=>Oo(c,200));return yl(d),Ql("click",g,function(...m){U(p)?.apply(this,m)}),ko(i,d),Fs(u)}tc(["click"]),customElements.define("hb-chartjs",gc(Ka,{id:{},data:{}},[],[],{mode:"open"})),vs.Component=Ka,Object.defineProperty(vs,Symbol.toStringTag,{value:"Module"})})(this.chartjs=this.chartjs||{});
5
- //# sourceMappingURL=main.iife.js.map
1
+ (function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var t={},n=Symbol(),r=Array.isArray,i=Array.prototype.indexOf,a=Array.prototype.includes,o=Array.from,s=Object.keys,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=Object.prototype,d=Array.prototype,f=Object.getPrototypeOf,p=Object.isExtensible,m=()=>{};function h(e){for(var t=0;t<e.length;t++)e[t]()}function g(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var _=1024,v=2048,y=4096,b=8192,x=16384,S=32768,C=1<<25,w=65536,T=1<<19,E=1<<20,D=65536,ee=1<<21,te=1<<23,ne=Symbol(`$state`),re=Symbol(`legacy props`),ie=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"};globalThis.document?.contentType;function ae(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function oe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function se(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function ce(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function le(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ue(){throw Error(`https://svelte.dev/e/hydration_failed`)}function de(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function fe(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function pe(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function me(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function he(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function ge(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function _e(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var ve=!1;function ye(e){ve=e}var O;function be(e){if(e===null)throw ge(),t;return O=e}function xe(){return be(Ut(O))}function Se(e){if(ve){if(Ut(O)!==null)throw ge(),t;O=e}}function Ce(e=1){if(ve){for(var t=e,n=O;t--;)n=Ut(n);O=n}}function we(e=!0){for(var t=0,n=O;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Ut(n);e&&n.remove(),n=i}}function Te(e){return e===this.v}function Ee(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function De(e){return!Ee(e,this.v)}var Oe=!1,ke=!1,k=null;function Ae(e){k=e}function je(e,t=!1,n){k={p:k,i:!1,c:null,e:null,s:e,x:null,r:P,l:ke&&!t?{s:null,u:null,$:[]}:null}}function Me(e){var t=k,n=t.e;if(n!==null){t.e=null;for(var r of n)en(r)}return e!==void 0&&(t.x=e),t.i=!0,k=t.p,e??{}}function Ne(){return!ke||k!==null&&k.l===null}var Pe=[];function Fe(){var e=Pe;Pe=[],h(e)}function Ie(e){if(Pe.length===0&&!Ye){var t=Pe;queueMicrotask(()=>{t===Pe&&Fe()})}Pe.push(e)}function Le(){for(;Pe.length>0;)Fe()}function Re(e){var t=P;if(t===null)return N.f|=te,e;if(!(t.f&32768)&&!(t.f&4))throw e;ze(e,t)}function ze(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var Be=~(v|y|_);function A(e,t){e.f=e.f&Be|t}function Ve(e){e.f&512||e.deps===null?A(e,_):A(e,y)}function He(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=D,He(t.deps))}function Ue(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),He(e.deps),A(e,_)}var We=!1,Ge=!1;function Ke(e){var t=Ge;try{return Ge=!1,[e(),Ge]}finally{Ge=t}}var qe=new Set,j=null,M=null,Je=null,Ye=!1,Xe=!1,Ze=null,Qe=null,$e=0,et=1,tt=class e{id=et++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=new Set;#s=new Set;#c=new Map;is_fork=!1;#l=!1;#u=new Set;#d(){return this.is_fork||this.#r.size>0}#f(){for(let n of this.#u)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#c.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#c.get(e);if(t){this.#c.delete(e);for(var n of t.d)A(n,v),this.schedule(n);for(n of t.m)A(n,y),this.schedule(n)}}#p(){if($e++>1e3&&(qe.delete(this),rt()),!this.#d()){for(let e of this.#o)this.#s.delete(e),A(e,v),this.schedule(e);for(let e of this.#s)A(e,y),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=Ze=[],r=[],i=Qe=[];for(let e of t)try{this.#m(e,n,r)}catch(t){throw ut(e),t}if(j=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Ze=null,Qe=null,this.#d()||this.#f()){this.#h(r),this.#h(n);for(let[e,t]of this.#c)lt(e,t)}else{this.#n.size===0&&qe.delete(this),this.#o.clear(),this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),at(r),at(n),this.#i?.resolve()}var o=j;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(qe.add(o),o.#p()),qe.has(this)||this.#g()}#m(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):Oe&&i&16777224?n.push(r):Pn(r)&&(i&16&&this.#s.add(r),zn(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#h(e){for(var t=0;t<e.length;t+=1)Ue(e[t],this.#o,this.#s)}capture(e,t,r=!1){t!==n&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,[e.v,r]),M?.set(e,e.v))}activate(){j=this}deactivate(){j=null,M=null}flush(){try{Xe=!0,j=this,this.#p()}finally{$e=0,Je=null,Ze=null,Qe=null,Xe=!1,j=null,M=null,Tt.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),qe.delete(this)}#g(){for(let c of qe){var e=c.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(c.current.has(r)){var n=c.current.get(r)[0];if(e&&i!==n)c.current.set(r,[i,a]);else continue}t.push(r)}var r=[...c.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&c.discard();else if(t.length>0){c.activate();var i=new Set,a=new Map;for(var o of t)ot(o,r,i,a);if(c.#a.length>0){c.apply();for(var s of c.#a)c.#m(s,[],[]);c.#a=[]}c.deactivate()}}for(let e of qe)e.#u.has(this)&&(e.#u.delete(this),e.#u.size===0&&!e.#d()&&(e.activate(),e.#p()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#l||n||(this.#l=!0,Ie(()=>{this.#l=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#o.add(t);for(let e of t)this.#s.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=g()).promise}static ensure(){if(j===null){let t=j=new e;Xe||(qe.add(j),Ye||Ie(()=>{j===t&&t.flush()}))}return j}apply(){if(!Oe||!this.is_fork&&qe.size===1){M=null;return}M=new Map;for(let[e,[t]]of this.current)M.set(e,t);for(let n of qe)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#u.add(n);else for(let[e,t]of n.previous)M.has(e)||M.set(e,t)}}schedule(e){if(Je=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Ze!==null&&t===P&&(Oe||(N===null||!(N.f&2))&&!We))return;if(n&96){if(!(n&1024))return;t.f^=_}}this.#a.push(t)}};function nt(e){var t=Ye;Ye=!0;try{var n;for(e&&(j!==null&&!j.is_fork&&j.flush(),n=e());;){if(Le(),j===null)return n;j.flush()}}finally{Ye=t}}function rt(){try{le()}catch(e){ze(e,Je)}}var it=null;function at(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Pn(r)&&(it=new Set,zn(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&pn(r),it?.size>0)){Tt.clear();for(let e of it){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)it.has(n)&&(it.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||zn(n)}}it.clear()}}it=null}}function ot(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?ot(i,t,n,r):e&4194320&&!(e&2048)&&st(i,t,r)&&(A(i,v),ct(i))}}function st(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(a.call(t,r))return!0;if(r.f&2&&st(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function ct(e){j.schedule(e)}function lt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),A(e,_);for(var n=e.first;n!==null;)lt(n,t),n=n.next}}function ut(e){A(e,_);for(var t=e.first;t!==null;)ut(t),t=t.next}function dt(e){let t=0,n=Dt(0),r;return()=>{Qt()&&(I(n),an(()=>(t===0&&(r=Hn(()=>e(()=>Nt(n)))),t+=1,()=>{Ie(()=>{--t,t===0&&(r?.(),r=void 0,Nt(n))})})))}}var ft=w|T;function pt(e,t,n,r){new mt(e,t,n,r)}var mt=class{parent;is_pending=!1;transform_error;#e;#t=ve?O:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=dt(()=>(this.#m=Dt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=P;t.b=this,t.f|=128,n(e)},this.parent=P.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=on(()=>{if(ve){let e=this.#t;xe();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},ft),ve&&(this.#e=O)}#g(){try{this.#a=sn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=sn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=sn(()=>e(this.#e)),Ie(()=>{var e=this.#c=document.createDocumentFragment(),t=Vt();e.append(t),this.#a=this.#x(()=>sn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,mn(this.#o,()=>{this.#o=null}),this.#b(j))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=sn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();gn(this.#a,e);let t=this.#n.pending;this.#o=sn(()=>t(this.#e))}else this.#b(j)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Ue(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=P,n=N,r=k;Cn(this.#i),Sn(this.#i),Ae(this.#i.ctx);try{return tt.ensure(),e()}catch(e){return Re(e),null}finally{Cn(t),Sn(n),Ae(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&mn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Ie(()=>{this.#d=!1,this.#m&&jt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),I(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(dn(this.#a),null),this.#o&&=(dn(this.#o),null),this.#s&&=(dn(this.#s),null),ve&&(be(this.#t),Ce(),be(we()));var r=!1,i=!1;let a=()=>{if(r){_e();return}r=!0,i&&he(),this.#s!==null&&mn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){ze(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return sn(()=>{var t=P;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return ze(e,this.#i.parent),null}}))};Ie(()=>{var t;try{t=this.transform_error(e)}catch(e){ze(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>ze(e,this.#i&&this.#i.parent)):o(t)})}};function ht(e){var t=2|v,r=N!==null&&N.f&2?N:null;return P!==null&&(P.f|=T),{ctx:k,deps:null,effects:null,equals:Te,f:t,fn:e,reactions:null,rv:0,v:n,wv:0,parent:r??P,ac:null}}function gt(e){let t=ht(e);return Oe||Tn(t),t}function _t(e){let t=ht(e);return t.equals=De,t}function vt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)dn(t[n])}}function yt(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function bt(e){var t,n=P;Cn(yt(e));try{e.f&=~D,vt(e),t=In(e)}finally{Cn(n)}return t}function xt(e){var t=e.v,n=bt(e);if(!e.equals(n)&&(e.wv=Nn(),(!j?.is_fork||e.deps===null)&&(e.v=n,j?.capture(e,t,!0),e.deps===null))){A(e,_);return}yn||(M===null?Ve(e):(Qt()||j?.is_fork)&&M.set(e,n))}function St(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(ie),t.teardown=m,t.ac=null,Rn(t,0),ln(t))}function Ct(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&zn(t)}var wt=new Set,Tt=new Map,Et=!1;function Dt(e,t){return{f:0,v:e,reactions:null,equals:Te,rv:0,wv:0}}function Ot(e,t){let n=Dt(e,t);return Tn(n),n}function kt(e,t=!1,n=!0){let r=Dt(e);return t||(r.equals=De),ke&&n&&k!==null&&k.l!==null&&(k.l.s??=[]).push(r),r}function At(e,t,n=!1){return N!==null&&(!xn||N.f&131072)&&Ne()&&N.f&4325394&&(wn===null||!a.call(wn,e))&&me(),jt(e,n?Ft(t):t,Qe)}function jt(e,t,n=null){if(!e.equals(t)){var r=e.v;yn?Tt.set(e,t):Tt.set(e,r),e.v=t;var i=tt.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&bt(t),M===null&&Ve(t)}e.wv=Nn(),Pt(e,v,n),Ne()&&P!==null&&P.f&1024&&!(P.f&96)&&(Dn===null?On([e]):Dn.push(e)),!i.is_fork&&wt.size>0&&!Et&&Mt()}return t}function Mt(){Et=!1;for(let e of wt)e.f&1024&&A(e,y),Pn(e)&&zn(e);wt.clear()}function Nt(e){At(e,e.v+1)}function Pt(e,t,n){var r=e.reactions;if(r!==null)for(var i=Ne(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===P)){var l=(c&v)===0;if(l&&A(s,t),c&2){var u=s;M?.delete(u),c&65536||(c&512&&(s.f|=D),Pt(u,y,n))}else if(l){var d=s;c&16&&it!==null&&it.add(d),n===null?ct(d):n.push(d)}}}}function Ft(e){if(typeof e!=`object`||!e||ne in e)return e;let t=f(e);if(t!==u&&t!==d)return e;var i=new Map,a=r(e),o=Ot(0),s=null,c=jn,p=e=>{if(jn===c)return e();var t=N,n=jn;Sn(null),Mn(c);var r=e();return Sn(t),Mn(n),r};return a&&i.set(`length`,Ot(e.length,s)),new Proxy(e,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&fe();var r=i.get(t);return r===void 0?p(()=>{var e=Ot(n.value,s);return i.set(t,e),e}):At(r,n.value,!0),!0},deleteProperty(e,t){var r=i.get(t);if(r===void 0){if(t in e){let e=p(()=>Ot(n,s));i.set(t,e),Nt(o)}}else At(r,n),Nt(o);return!0},get(t,r,a){if(r===ne)return e;var o=i.get(r),c=r in t;if(o===void 0&&(!c||l(t,r)?.writable)&&(o=p(()=>Ot(Ft(c?t[r]:n),s)),i.set(r,o)),o!==void 0){var u=I(o);return u===n?void 0:u}return Reflect.get(t,r,a)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var a=i.get(t);a&&(r.value=I(a))}else if(r===void 0){var o=i.get(t),s=o?.v;if(o!==void 0&&s!==n)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return r},has(e,t){if(t===ne)return!0;var r=i.get(t),a=r!==void 0&&r.v!==n||Reflect.has(e,t);return(r!==void 0||P!==null&&(!a||l(e,t)?.writable))&&(r===void 0&&(r=p(()=>Ot(a?Ft(e[t]):n,s)),i.set(t,r)),I(r)===n)?!1:a},set(e,t,r,c){var u=i.get(t),d=t in e;if(a&&t===`length`)for(var f=r;f<u.v;f+=1){var m=i.get(f+``);m===void 0?f in e&&(m=p(()=>Ot(n,s)),i.set(f+``,m)):At(m,n)}if(u===void 0)(!d||l(e,t)?.writable)&&(u=p(()=>Ot(void 0,s)),At(u,Ft(r)),i.set(t,u));else{d=u.v!==n;var h=p(()=>Ft(r));At(u,h)}var g=Reflect.getOwnPropertyDescriptor(e,t);if(g?.set&&g.set.call(c,r),!d){if(a&&typeof t==`string`){var _=i.get(`length`),v=Number(t);Number.isInteger(v)&&v>=_.v&&At(_,v+1)}Nt(o)}return!0},ownKeys(e){I(o);var t=Reflect.ownKeys(e).filter(e=>{var t=i.get(e);return t===void 0||t.v!==n});for(var[r,a]of i)a.v!==n&&!(r in e)&&t.push(r);return t},setPrototypeOf(){pe()}})}var It,Lt,Rt,zt;function Bt(){if(It===void 0){It=window,Lt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Rt=l(t,`firstChild`).get,zt=l(t,`nextSibling`).get,p(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),p(n)&&(n.__t=void 0)}}function Vt(e=``){return document.createTextNode(e)}function Ht(e){return Rt.call(e)}function Ut(e){return zt.call(e)}function Wt(e,t){if(!ve)return Ht(e);var n=Ht(O);if(n===null)n=O.appendChild(Vt());else if(t&&n.nodeType!==3){var r=Vt();return n?.before(r),be(r),r}return t&&qt(n),be(n),n}function Gt(e){e.textContent=``}function Kt(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function qt(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Jt(e){var t=N,n=P;Sn(null),Cn(null);try{return e()}finally{Sn(t),Cn(n)}}function Yt(e){P===null&&(N===null&&ce(e),se()),yn&&oe(e)}function Xt(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Zt(e,t){var n=P;n!==null&&n.f&8192&&(e|=b);var r={ctx:k,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if(e&4)Ze===null?tt.ensure().schedule(r):Ze.push(r);else if(t!==null){try{zn(r)}catch(e){throw dn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=w))}if(i!==null&&(i.parent=n,n!==null&&Xt(i,n),N!==null&&N.f&2&&!(e&64))){var a=N;(a.effects??=[]).push(i)}return r}function Qt(){return N!==null&&!xn}function $t(e){Yt(`$effect`);var t=P.f;if(!N&&t&32&&!(t&32768)){var n=k;(n.e??=[]).push(e)}else return en(e)}function en(e){return Zt(4|E,e)}function tn(e){tt.ensure();let t=Zt(64|T,e);return()=>{dn(t)}}function nn(e){tt.ensure();let t=Zt(64|T,e);return(e={})=>new Promise(n=>{e.outro?mn(t,()=>{dn(t),n(void 0)}):(dn(t),n(void 0))})}function rn(e){return Zt(4,e)}function an(e,t=0){return Zt(8|t,e)}function on(e,t=0){return Zt(16|t,e)}function sn(e){return Zt(32|T,e)}function cn(e){var t=e.teardown;if(t!==null){let e=yn,n=N;bn(!0),Sn(null);try{t.call(null)}finally{bn(e),Sn(n)}}}function ln(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Jt(()=>{e.abort(ie)});var r=n.next;n.f&64?n.parent=null:dn(n,t),n=r}}function un(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||dn(t),t=n}}function dn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(fn(e.nodes.start,e.nodes.end),n=!0),A(e,C),ln(e,t&&!n),Rn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();cn(e),e.f^=C,e.f|=x;var i=e.parent;i!==null&&i.first!==null&&pn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function fn(e,t){for(;e!==null;){var n=e===t?null:Ut(e);e.remove(),e=n}}function pn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function mn(e,t,n=!0){var r=[];hn(e,r,!0);var i=()=>{n&&dn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function hn(e,t,n){if(!(e.f&8192)){e.f^=b;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;hn(i,t,o?n:!1),i=a}}}function gn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Ut(n);t.append(n),n=i}}var _n=null,vn=!1,yn=!1;function bn(e){yn=e}var N=null,xn=!1;function Sn(e){N=e}var P=null;function Cn(e){P=e}var wn=null;function Tn(e){N!==null&&(!Oe||N.f&2)&&(wn===null?wn=[e]:wn.push(e))}var F=null,En=0,Dn=null;function On(e){Dn=e}var kn=1,An=0,jn=An;function Mn(e){jn=e}function Nn(){return++kn}function Pn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~D),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Pn(a)&&xt(a),a.wv>e.wv)return!0}t&512&&M===null&&A(e,_)}return!1}function Fn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Oe&&wn!==null&&a.call(wn,e)))for(var i=0;i<r.length;i++){var o=r[i];o.f&2?Fn(o,t,!1):t===o&&(n?A(o,v):o.f&1024&&A(o,y),ct(o))}}function In(e){var t=F,n=En,r=Dn,i=N,a=wn,o=k,s=xn,c=jn,l=e.f;F=null,En=0,Dn=null,N=l&96?null:e,wn=null,Ae(e.ctx),xn=!1,jn=++An,e.ac!==null&&(Jt(()=>{e.ac.abort(ie)}),e.ac=null);try{e.f|=ee;var u=e.fn,d=u();e.f|=S;var f=e.deps,p=j?.is_fork;if(F!==null){var m;if(p||Rn(e,En),f!==null&&En>0)for(f.length=En+F.length,m=0;m<F.length;m++)f[En+m]=F[m];else e.deps=f=F;if(Qt()&&e.f&512)for(m=En;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&En<f.length&&(Rn(e,En),f.length=En);if(Ne()&&Dn!==null&&!xn&&f!==null&&!(e.f&6146))for(m=0;m<Dn.length;m++)Fn(Dn[m],e);if(i!==null&&i!==e){if(An++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=An;if(t!==null)for(let e of t)e.rv=An;Dn!==null&&(r===null?r=Dn:r.push(...Dn))}return e.f&8388608&&(e.f^=te),d}catch(e){return Re(e)}finally{e.f^=ee,F=t,En=n,Dn=r,N=i,wn=a,Ae(o),xn=s,jn=c}}function Ln(e,t){let n=t.reactions;if(n!==null){var r=i.call(n,e);if(r!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[r]=n[o],n.pop())}}if(n===null&&t.f&2&&(F===null||!a.call(F,t))){var s=t;s.f&512&&(s.f^=512,s.f&=~D),Ve(s),St(s),Rn(s,0)}}function Rn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Ln(e,n[r])}function zn(e){var t=e.f;if(!(t&16384)){A(e,_);var n=P,r=vn;P=e,vn=!0;try{t&16777232?un(e):ln(e),cn(e);var i=In(e);e.teardown=typeof i==`function`?i:null,e.wv=kn}finally{vn=r,P=n}}}function I(e){var t=(e.f&2)!=0;if(_n?.add(e),N!==null&&!xn&&!(P!==null&&P.f&16384)&&(wn===null||!a.call(wn,e))){var n=N.deps;if(N.f&2097152)e.rv<An&&(e.rv=An,F===null&&n!==null&&n[En]===e?En++:F===null?F=[e]:F.push(e));else{(N.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[N]:a.call(r,N)||r.push(N)}}if(yn&&Tt.has(e))return Tt.get(e);if(t){var i=e;if(yn){var o=i.v;return(!(i.f&1024)&&i.reactions!==null||Vn(i))&&(o=bt(i)),Tt.set(i,o),o}var s=(i.f&512)==0&&!xn&&N!==null&&(vn||(N.f&512)!=0),c=(i.f&S)===0;Pn(i)&&(s&&(i.f|=512),xt(i)),s&&!c&&(Ct(i),Bn(i))}if(M?.has(e))return M.get(e);if(e.f&8388608)throw e.v;return e.v}function Bn(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Ct(t),Bn(t))}function Vn(e){if(e.v===n)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Tt.has(t)||t.f&2&&Vn(t))return!0;return!1}function Hn(e){var t=xn;try{return xn=!0,e()}finally{xn=t}}var Un=Symbol(`events`),Wn=new Set,Gn=new Set;function Kn(e,t,n){(t[Un]??={})[e]=n}function qn(e){for(var t=0;t<e.length;t++)Wn.add(e[t]);for(var n of Gn)n(e)}var Jn=null;function Yn(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Jn=e;var o=0,s=Jn===e&&e[Un];if(s){var l=i.indexOf(s);if(l!==-1&&(t===document||t===window)){e[Un]=t;return}var u=i.indexOf(t);if(u===-1)return;l<=u&&(o=l)}if(a=i[o]||e.target,a!==t){c(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=N,f=P;Sn(null),Cn(null);try{for(var p,m=[];a!==null;){var h=a.assignedSlot||a.parentNode||a.host||null;try{var g=a[Un]?.[r];g!=null&&(!a.disabled||e.target===a)&&g.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;a=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Un]=t,delete e.currentTarget,Sn(d),Cn(f)}}}var Xn=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Zn(e){return Xn?.createHTML(e)??e}function Qn(e){var t=Kt(`template`);return t.innerHTML=Zn(e.replaceAll(`<!>`,`<!---->`)),t.content}function $n(e,t){var n=P;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function er(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(ve)return $n(O,null),O;i===void 0&&(i=Qn(a?e:`<!>`+e),n||(i=Ht(i)));var t=r||Lt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Ht(t),s=t.lastChild;$n(o,s)}else $n(t,t);return t}}function tr(e,t){if(ve){var n=P;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=O),xe();return}e!==null&&e.before(t)}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var nr=[`touchstart`,`touchmove`];function rr(e){return nr.includes(e)}function ir(e,t){return sr(e,t)}function ar(e,n){Bt(),n.intro=n.intro??!1;let r=n.target,i=ve,a=O;try{for(var o=Ht(r);o&&(o.nodeType!==8||o.data!==`[`);)o=Ut(o);if(!o)throw t;ye(!0),be(o);let i=sr(e,{...n,anchor:o});return ye(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
2
+ `).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw i;return i!==t&&console.warn(`Failed to hydrate: `,i),n.recover===!1&&ue(),Bt(),Gt(r),ye(!1),ir(e,n)}finally{ye(i),be(a)}}var or=new Map;function sr(e,{target:n,anchor:r,props:i={},events:a,context:s,intro:c=!0,transformError:l}){Bt();var u=void 0,d=nn(()=>{var c=r??n.appendChild(Vt());pt(c,{pending:()=>{}},n=>{je({});var r=k;if(s&&(r.c=s),a&&(i.$$events=a),ve&&$n(n,null),u=e(n,i)||{},ve&&(P.nodes.end=O,O===null||O.nodeType!==8||O.data!==`]`))throw ge(),t;Me()},l);var d=new Set,f=e=>{for(var t=0;t<e.length;t++){var r=e[t];if(!d.has(r)){d.add(r);var i=rr(r);for(let e of[n,document]){var a=or.get(e);a===void 0&&(a=new Map,or.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Yn,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(o(Wn)),Gn.add(f),()=>{for(var e of d)for(let r of[n,document]){var t=or.get(r),i=t.get(e);--i==0?(r.removeEventListener(e,Yn),t.delete(e),t.size===0&&or.delete(r)):t.set(e,i)}Gn.delete(f),c!==r&&c.parentNode?.removeChild(c)}});return cr.set(u,d),u}var cr=new WeakMap;function lr(e,t){let n=cr.get(e);return n?(cr.delete(e),n(t)):Promise.resolve()}function ur(e){k===null&&ae(`onMount`),ke&&k.l!==null?fr(k).m.push(e):$t(()=>{let t=Hn(e);if(typeof t==`function`)return t})}function dr(e){k===null&&ae(`onDestroy`),ur(()=>()=>Hn(e))}function fr(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function pr(e,t){rn(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=Kt(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function mr(e,t,n,r){var i=!ke||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,u=()=>(c&&(c=!1,s=o?Hn(r):r),s);let d;if(a){var f=ne in e||re in e;d=l(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=Ke(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&de(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?ht:_t)(()=>(_=!1,h()));a&&I(v);var y=P;return(function(e,t){if(arguments.length>0){let n=t?I(v):i&&a?Ft(e):e;return At(v,n),_=!0,s!==void 0&&(s=n),e}return yn&&_||y.f&16384?v.v:I(v)})}function hr(e){return new gr(e)}var gr=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=kt(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return I(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===re?!0:(I(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return At(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?ar:ir)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),!Oe&&(!e?.props?.$$host||e.sync===!1)&&nt(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||c(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{lr(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},_r;typeof HTMLElement==`function`&&(_r=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=Kt(`slot`);e!==`default`&&(n.name=e),tr(t,n)}}let t={},n=yr(this);for(let r of this.$$s)r in n&&(r===`default`&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=vr(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=hr({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=tn(()=>{an(()=>{this.$$r=!0;for(let e of s(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=vr(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=vr(e,n,this.$$p_d,`toProp`),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return s(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function vr(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`toAttribute`)switch(i){case`Object`:case`Array`:return t==null?null:JSON.stringify(t);case`Boolean`:return t?``:null;case`Number`:return t??null;default:return t}else switch(i){case`Object`:case`Array`:return t&&JSON.parse(t);case`Boolean`:return t;case`Number`:return t==null?t:+t;default:return t}}function yr(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function br(e,t,n,r,i,a){let o=class extends _r{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return s(t).map(e=>(t[e].attribute||e).toLowerCase())}};return s(t).forEach(e=>{c(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=vr(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(l(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{c(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}function xr(e,t=100,n={}){if(typeof e!=`function`)throw TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(t<0)throw RangeError("`wait` must not be negative.");if(typeof n==`boolean`)throw TypeError("The `options` parameter must be an object, not a boolean. Use `{immediate: true}` instead.");let{immediate:r}=n,i,a,o,s,c;function l(){let t=i,n=a;return i=void 0,a=void 0,c=e.apply(t,n),c}function u(){let e=Date.now()-s;e<t&&e>=0?o=setTimeout(u,t-e):(o=void 0,r||(c=l()))}let d=function(...e){if(i&&this!==i&&Object.getPrototypeOf(this)===Object.getPrototypeOf(i))throw Error(`Debounced method called with different contexts of the same prototype.`);i=this,a=e,s=Date.now();let n=r&&!o;if(o||=setTimeout(u,t),n)return c=l(),c};return Object.defineProperty(d,`isPending`,{get(){return o!==void 0}}),d.clear=()=>{o&&(clearTimeout(o),o=void 0,i=void 0,a=void 0)},d.flush=()=>{o&&d.trigger()},d.trigger=()=>{c=l(),d.clear()},d}function Sr(e){return e+.5|0}var Cr=(e,t,n)=>Math.max(Math.min(e,n),t);function wr(e){return Cr(Sr(e*2.55),0,255)}function Tr(e){return Cr(Sr(e*255),0,255)}function Er(e){return Cr(Sr(e/2.55)/100,0,1)}function Dr(e){return Cr(Sr(e*100),0,100)}var Or={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},kr=[...`0123456789ABCDEF`],Ar=e=>kr[e&15],jr=e=>kr[(e&240)>>4]+kr[e&15],Mr=e=>(e&240)>>4==(e&15),Nr=e=>Mr(e.r)&&Mr(e.g)&&Mr(e.b)&&Mr(e.a);function Pr(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&Or[e[1]]*17,g:255&Or[e[2]]*17,b:255&Or[e[3]]*17,a:t===5?Or[e[4]]*17:255}:(t===7||t===9)&&(n={r:Or[e[1]]<<4|Or[e[2]],g:Or[e[3]]<<4|Or[e[4]],b:Or[e[5]]<<4|Or[e[6]],a:t===9?Or[e[7]]<<4|Or[e[8]]:255})),n}var Fr=(e,t)=>e<255?t(e):``;function Ir(e){var t=Nr(e)?Ar:jr;return e?`#`+t(e.r)+t(e.g)+t(e.b)+Fr(e.a,t):void 0}var Lr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Rr(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function zr(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function Br(e,t,n){let r=Rr(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function Vr(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Hr(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=Vr(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function Ur(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Tr)}function Wr(e,t,n){return Ur(Rr,e,t,n)}function Gr(e,t,n){return Ur(Br,e,t,n)}function Kr(e,t,n){return Ur(zr,e,t,n)}function qr(e){return(e%360+360)%360}function Jr(e){let t=Lr.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?wr(+t[5]):Tr(+t[5]));let i=qr(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?Gr(i,a,o):t[1]===`hsv`?Kr(i,a,o):Wr(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function Yr(e,t){var n=Hr(e);n[0]=qr(n[0]+t),n=Wr(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Xr(e){if(!e)return;let t=Hr(e),n=t[0],r=Dr(t[1]),i=Dr(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${Er(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var Zr={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},Qr={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function $r(){let e={},t=Object.keys(Qr),n=Object.keys(Zr),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,Zr[a]);a=parseInt(Qr[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var ei;function ti(e){ei||(ei=$r(),ei.transparent=[0,0,0,0]);let t=ei[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var ni=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ri(e){let t=ni.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?wr(e):Cr(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?wr(r):Cr(r,0,255)),i=255&(t[4]?wr(i):Cr(i,0,255)),a=255&(t[6]?wr(a):Cr(a,0,255)),{r,g:i,b:a,a:n}}}function ii(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Er(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var ai=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,oi=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function si(e,t,n){let r=oi(Er(e.r)),i=oi(Er(e.g)),a=oi(Er(e.b));return{r:Tr(ai(r+n*(oi(Er(t.r))-r))),g:Tr(ai(i+n*(oi(Er(t.g))-i))),b:Tr(ai(a+n*(oi(Er(t.b))-a))),a:e.a+n*(t.a-e.a)}}function ci(e,t,n){if(e){let r=Hr(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Wr(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function li(e,t){return e&&Object.assign(t||{},e)}function ui(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Tr(e[3]))):(t=li(e,{r:0,g:0,b:0,a:1}),t.a=Tr(t.a)),t}function di(e){return e.charAt(0)===`r`?ri(e):Jr(e)}var fi=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=ui(t):n===`string`&&(r=Pr(t)||ti(t)||di(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=li(this._rgb);return e&&(e.a=Er(e.a)),e}set rgb(e){this._rgb=ui(e)}rgbString(){return this._valid?ii(this._rgb):void 0}hexString(){return this._valid?Ir(this._rgb):void 0}hslString(){return this._valid?Xr(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=si(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=Tr(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=Sr(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return ci(this._rgb,2,e),this}darken(e){return ci(this._rgb,2,-e),this}saturate(e){return ci(this._rgb,1,e),this}desaturate(e){return ci(this._rgb,1,-e),this}rotate(e){return Yr(this._rgb,e),this}};function pi(){}var mi=(()=>{let e=0;return()=>e++})();function L(e){return e==null}function R(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function z(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function B(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function hi(e,t){return B(e)?e:t}function V(e,t){return e===void 0?t:e}var gi=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,_i=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function H(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function U(e,t,n,r){let i,a,o;if(R(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<a;i++)t.call(n,e[i],i);else if(z(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function vi(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function yi(e){if(R(e))return e.map(yi);if(z(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=yi(e[n[i]]);return t}return e}function bi(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function xi(e,t,n,r){if(!bi(e))return;let i=t[e],a=n[e];z(i)&&z(a)?Si(i,a,r):t[e]=yi(a)}function Si(e,t,n){let r=R(t)?t:[t],i=r.length;if(!z(e))return e;n||={};let a=n.merger||xi,o;for(let t=0;t<i;++t){if(o=r[t],!z(o))continue;let i=Object.keys(o);for(let t=0,r=i.length;t<r;++t)a(i[t],e,o,n)}return e}function Ci(e,t){return Si(e,t,{merger:wi})}function wi(e,t,n){if(!bi(e))return;let r=t[e],i=n[e];z(r)&&z(i)?Ci(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=yi(i))}var Ti={"":e=>e,x:e=>e.x,y:e=>e.y};function Ei(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function Di(e){let t=Ei(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Oi(e,t){return(Ti[t]||(Ti[t]=Di(t)))(e)}function ki(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ai=e=>e!==void 0,ji=e=>typeof e==`function`,Mi=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Ni(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var W=Math.PI,G=2*W,Pi=G+W,Fi=1/0,Ii=W/180,K=W/2,Li=W/4,Ri=W*2/3,zi=Math.log10,Bi=Math.sign;function Vi(e,t,n){return Math.abs(e-t)<n}function Hi(e){let t=Math.round(e);e=Vi(e,t,e/1e3)?t:e;let n=10**Math.floor(zi(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Ui(e){let t=[],n=Math.sqrt(e),r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}function Wi(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function Gi(e){return!Wi(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Ki(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function qi(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Ji(e){return W/180*e}function Yi(e){return 180/W*e}function Xi(e){if(!B(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Zi(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*W&&(a+=G),{angle:a,distance:i}}function Qi(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function $i(e,t){return(e-t+Pi)%G-W}function q(e){return(e%G+G)%G}function ea(e,t,n,r){let i=q(e),a=q(t),o=q(n),s=q(a-i),c=q(o-i),l=q(i-a),u=q(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function J(e,t,n){return Math.max(t,Math.min(n,e))}function ta(e){return J(e,-32768,32767)}function na(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ra(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var ia=(e,t,n,r)=>ra(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),aa=(e,t,n)=>ra(e,n,r=>e[r][t]>=n);function oa(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var sa=[`push`,`pop`,`shift`,`splice`,`unshift`];function ca(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,`_chartjs`,{configurable:!0,enumerable:!1,value:{listeners:[t]}}),sa.forEach(t=>{let n=`_onData`+ki(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function la(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(sa.forEach(t=>{delete e[t]}),delete e._chartjs)}function ua(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var da=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function fa(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,da.call(window,()=>{r=!1,e.apply(t,n)}))}}function pa(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var ma=e=>e===`start`?`left`:e===`end`?`right`:`center`,Y=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,ha=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function ga(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(ia(c,u,d).lo,n?r:ia(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!L(e[s.axis]));i-=Math.max(0,e)}i=J(i,0,r-1)}if(m){let e=Math.max(ia(c,o.axis,f,!0).hi+1,n?0:ia(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!L(e[s.axis]));e+=Math.max(0,t)}a=J(e,i,r)-i}else a=r-i}return{start:i,count:a}}function _a(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var va=e=>e===0||e===1,ya=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*G/n)),ba=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*G/n)+1,xa={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*K)+1,easeOutSine:e=>Math.sin(e*K),easeInOutSine:e=>-.5*(Math.cos(W*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>va(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>va(e)?e:ya(e,.075,.3),easeOutElastic:e=>va(e)?e:ba(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return va(e)?e:e<.5?.5*ya(e*2,t,n):.5+.5*ba(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-xa.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?xa.easeInBounce(e*2)*.5:xa.easeOutBounce(e*2-1)*.5+.5};function Sa(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function Ca(e){return Sa(e)?e:new fi(e)}function wa(e){return Sa(e)?e:new fi(e).saturate(.5).darken(.1).hexString()}var Ta=[`x`,`y`,`borderWidth`,`radius`,`tension`],Ea=[`color`,`borderColor`,`backgroundColor`];function Da(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Ea},numbers:{type:`number`,properties:Ta}}),e.describe(`animations`,{_fallback:`animation`}),e.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:e=>e|0}}}})}function Oa(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var ka=new Map;function Aa(e,t){t||={};let n=e+JSON.stringify(t),r=ka.get(n);return r||(r=new Intl.NumberFormat(e,t),ka.set(n,r)),r}function ja(e,t,n){return Aa(t,n).format(e)}var Ma={values(e){return R(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Na(e,n)}let o=zi(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),ja(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(zi(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Ma.numeric.call(this,e,t,n):``}};function Na(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Pa={formatters:Ma};function Fa(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Pa.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Ia=Object.create(null),La=Object.create(null);function Ra(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function za(e,t,n){return typeof t==`string`?Si(Ra(e,t),n):Si(Ra(e,``),t)}var X=new class{constructor(e,t){this.animation=void 0,this.backgroundColor=`rgba(0,0,0,0.1)`,this.borderColor=`rgba(0,0,0,0.1)`,this.color=`#666`,this.datasets={},this.devicePixelRatio=e=>e.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=(e,t)=>wa(t.backgroundColor),this.hoverBorderColor=(e,t)=>wa(t.borderColor),this.hoverColor=(e,t)=>wa(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return za(this,e,t)}get(e){return Ra(this,e)}describe(e,t){return za(La,e,t)}override(e,t){return za(Ia,e,t)}route(e,t,n,r){let i=Ra(this,e),a=Ra(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return z(e)?Object.assign({},t,e):V(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Da,Oa,Fa]);function Ba(e){return!e||L(e.size)||L(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Va(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Ha(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;c<s;c++)if(d=n[c],d!=null&&!R(d))o=Va(e,i,a,o,d);else if(R(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!R(f)&&(o=Va(e,i,a,o,f));e.restore();let p=a.length/2;if(p>n.length){for(c=0;c<p;c++)delete i[a[c]];a.splice(0,p)}return o}function Ua(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function Wa(e,t){!t&&!e||(t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ga(e,t,n,r){Ka(e,t,n,r,null)}function Ka(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=t.pointStyle,m=t.rotation,h=t.radius,g=(m||0)*Ii;if(p&&typeof p==`object`&&(a=p.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`)){e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(h)||h<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,h,0,0,G):e.arc(n,r,h,0,G),e.closePath();break;case`triangle`:u=i?i/2:h,e.moveTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Ri,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Ri,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),e.closePath();break;case`rectRounded`:l=h*.516,c=h-l,o=Math.cos(g+Li)*c,d=Math.cos(g+Li)*(i?i/2-l:c),s=Math.sin(g+Li)*c,f=Math.sin(g+Li)*(i?i/2-l:c),e.arc(n-d,r-s,l,g-W,g-K),e.arc(n+f,r-o,l,g-K,g),e.arc(n+d,r+s,l,g,g+K),e.arc(n-f,r+o,l,g+K,g+W),e.closePath();break;case`rect`:if(!m){c=Math.SQRT1_2*h,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}g+=Li;case`rectRot`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case`crossRot`:g+=Li;case`cross`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`star`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),g+=Li,d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`line`:o=i?i/2:Math.cos(g)*h,s=Math.sin(g)*h,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(i?i/2:h),r+Math.sin(g)*h);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function qa(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Ja(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Ya(e){e.restore()}function Xa(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i===`middle`){let r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y)}else i===`after`==!!r?e.lineTo(n.x,t.y):e.lineTo(t.x,n.y);e.lineTo(n.x,n.y)}function Za(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function Qa(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),L(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function $a(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function eo(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function to(e,t,n,r,i,a={}){let o=R(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,Qa(e,a),c=0;c<o.length;++c)l=o[c],a.backdrop&&eo(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),L(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),$a(e,n,r,l,a),r+=Number(i.lineHeight);e.restore()}function no(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*W,W,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,W,K,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,K,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-K,!0),e.lineTo(n+o.topLeft,r)}var ro=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,io=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ao(e,t){let n=(``+e).match(ro);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100;break}return t*e}var oo=e=>+e||0;function so(e,t){let n={},r=z(t),i=r?Object.keys(t):t,a=z(e)?r?n=>V(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=oo(a(e));return n}function co(e){return so(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function lo(e){return so(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function Z(e){let t=co(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Q(e,t){e||={},t||=X.font;let n=V(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=V(e.style,t.style);r&&!(``+r).match(io)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:V(e.family,t.family),lineHeight:ao(V(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:V(e.weight,t.weight),string:``};return i.string=Ba(i),i}function uo(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],s!==void 0&&(t!==void 0&&typeof s==`function`&&(s=s(t),i=!1),n!==void 0&&R(s)&&(s=s[n%s.length],i=!1),s!==void 0))return r&&!i&&(r.cacheable=!1),s}function fo(e,t,n){let{min:r,max:i}=e,a=_i(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function po(e,t){return Object.assign(Object.create(e),t)}function mo(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=Ao(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>mo([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return yo(n,r,()=>ko(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return jo(e).includes(t)},ownKeys(e){return jo(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function ho(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:go(e,r),setContext:t=>ho(e,t,n,r),override:i=>ho(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return yo(e,t,()=>bo(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function go(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:ji(n)?n:()=>n,isIndexable:ji(r)?r:()=>r}}var _o=(e,t)=>e?e+ki(t):t,vo=(e,t)=>z(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function yo(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function bo(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return ji(s)&&o.isScriptable(t)&&(s=xo(t,s,e,n)),R(s)&&s.length&&(s=So(t,s,e,o.isIndexable)),vo(t,s)&&(s=ho(s,i,a&&a[t],o)),s}function xo(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),vo(e,c)&&(c=Eo(i._scopes,i,e,c)),c}function So(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(z(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Eo(r,i,e,c);t.push(ho(n,a,o&&o[e],s))}}return t}function Co(e,t,n){return ji(e)?e(t,n):e}var wo=(e,t)=>e===!0?t:typeof e==`string`?Oi(t,e):void 0;function To(e,t,n,r,i){for(let a of t){let t=wo(n,a);if(t){e.add(t);let a=Co(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Eo(e,t,n,r){let i=t._rootScopes,a=Co(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Do(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Do(s,o,a,c,r),c===null)?!1:mo(Array.from(s),[``],i,a,()=>Oo(t,n,r))}function Do(e,t,n,r,i){for(;n;)n=To(e,t,n,r,i);return n}function Oo(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return R(i)&&z(n)?n:i||{}}function ko(e,t,n,r){let i;for(let a of t)if(i=Ao(_o(a,e),n),i!==void 0)return vo(e,i)?Eo(n,r,e,i):i}function Ao(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function jo(e){let t=e._keys;return t||=e._keys=Mo(e._scopes),t}function Mo(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}function No(e,t,n,r){let{iScale:i}=e,{key:a=`r`}=this._parsing,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={r:i.parse(Oi(u,a),l)};return o}var Po=2**-52||1e-14,Fo=(e,t)=>t<e.length&&!e[t].skip&&e[t],Io=e=>e===`x`?`y`:`x`;function Lo(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=Qi(a,i),c=Qi(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Ro(e,t,n){let r=e.length,i,a,o,s,c,l=Fo(e,0);for(let u=0;u<r-1;++u)if(c=l,l=Fo(e,u+1),!(!c||!l)){if(Vi(t[u],0,Po)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],a=n[u+1]/t[u],s=i**2+a**2,!(s<=9)&&(o=3/Math.sqrt(s),n[u]=i*o*t[u],n[u+1]=a*o*t[u])}}function zo(e,t,n=`x`){let r=Io(n),i=e.length,a,o,s,c=Fo(e,0);for(let l=0;l<i;++l){if(o=s,s=c,c=Fo(e,l+1),!s)continue;let i=s[n],u=s[r];o&&(a=(i-o[n])/3,s[`cp1${n}`]=i-a,s[`cp1${r}`]=u-a*t[l]),c&&(a=(c[n]-i)/3,s[`cp2${n}`]=i+a,s[`cp2${r}`]=u+a*t[l])}}function Bo(e,t=`x`){let n=Io(t),r=e.length,i=Array(r).fill(0),a=Array(r),o,s,c,l=Fo(e,0);for(o=0;o<r;++o)if(s=c,c=l,l=Fo(e,o+1),c){if(l){let e=l[t]-c[t];i[o]=e===0?0:(l[n]-c[n])/e}a[o]=s?l?Bi(i[o-1])===Bi(i[o])?(i[o-1]+i[o])/2:0:i[o-1]:i[o]}Ro(e,i,a),zo(e,a,t)}function Vo(e,t,n){return Math.max(Math.min(e,n),t)}function Ho(e,t){let n,r,i,a,o,s=qa(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&qa(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=Vo(i.cp1x,t.left,t.right),i.cp1y=Vo(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=Vo(i.cp2x,t.left,t.right),i.cp2y=Vo(i.cp2y,t.top,t.bottom)))}function Uo(e,t,n,r,i){let a,o,s,c;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),t.cubicInterpolationMode===`monotone`)Bo(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],c=Lo(n,s,e[Math.min(a+1,o-(r?0:1))%o],t.tension),s.cp1x=c.previous.x,s.cp1y=c.previous.y,s.cp2x=c.next.x,s.cp2y=c.next.y,n=s}t.capBezierPoints&&Ho(e,n)}function Wo(){return typeof window<`u`&&typeof document<`u`}function Go(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function Ko(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var qo=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Jo(e,t){return qo(e).getPropertyValue(t)}var Yo=[`top`,`right`,`bottom`,`left`];function Xo(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=Yo[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var Zo=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Qo(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(Zo(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function $o(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=qo(n),a=i.boxSizing===`border-box`,o=Xo(i,`padding`),s=Xo(i,`border`,`width`),{x:c,y:l,box:u}=Qo(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function es(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Go(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=qo(a),s=Xo(o,`border`,`width`),c=Xo(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Ko(o.maxWidth,a,`clientWidth`),i=Ko(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||Fi,maxHeight:i||Fi}}var ts=e=>Math.round(e*10)/10;function ns(e,t,n,r){let i=qo(e),a=Xo(i,`margin`),o=Ko(i.maxWidth,e,`clientWidth`)||Fi,s=Ko(i.maxHeight,e,`clientHeight`)||Fi,c=es(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=Xo(i,`border`,`width`),t=Xo(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=ts(Math.min(l,o,c.maxWidth)),u=ts(Math.min(u,s,c.maxHeight)),l&&!u&&(u=ts(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=ts(Math.floor(u*r))),{width:l,height:u}}function rs(e,t,n){let r=t||1,i=ts(e.height*r),a=ts(e.width*r);e.height=ts(e.height),e.width=ts(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var is=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Wo()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function as(e,t){let n=Jo(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function os(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function ss(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function cs(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=os(e,i,n),s=os(i,a,n),c=os(a,t,n);return os(os(o,s,n),os(s,c,n),n)}var ls=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},us=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ds(e,t,n){return e?ls(t,n):us()}function fs(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function ps(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function ms(e){return e===`angle`?{between:ea,compare:$i,normalize:q}:{between:na,compare:(e,t)=>e-t,normalize:e=>e}}function hs({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function gs(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=ms(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;f<p&&o(s(t[l%c][r]),i,a);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function _s(e,t,n){if(!n)return[e];let{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:c,normalize:l}=ms(r),{start:u,end:d,loop:f,style:p}=gs(e,t,n),m=[],h=!1,g=null,_,v,y,b=()=>c(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(hs({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(hs({start:g,end:d,loop:f,count:o,style:p})),m}function vs(e,t){let n=[],r=e.segments;for(let i=0;i<r.length;i++){let a=_s(r[i],e.points,t);a.length&&n.push(...a)}return n}function ys(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function bs(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function xs(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=ys(n,i,a,r);return r===!0?Ss(e,[{start:o,end:s,loop:a}],n,t):Ss(e,bs(n,o,s<o?s+i:s,!!e._fullLoop&&o===0&&s===i-1),n,t)}function Ss(e,t,n,r){return!r||!r.setContext||!n?t:Cs(e,t,n,r)}function Cs(e,t,n,r){let i=e._chart.getContext(),a=ws(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,c=n.length,l=[],u=a,d=t[0].start,f=d;function p(e,t,r,i){let a=s?-1:1;if(e!==t){for(e+=c;n[e%c].skip;)e-=a;for(;n[t%c].skip;)t+=a;e%c!==t%c&&(l.push({start:e%c,end:t%c,loop:r,style:i}),u=i,d=t%c)}}for(let e of t){d=s?d:e.start;let t=n[d%c],a;for(f=d+1;f<=e.end;f++){let s=n[f%c];a=ws(r.setContext(po(i,{type:`segment`,p0:t,p1:s,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:o}))),Ts(a,u)&&p(d,f-1,e.loop,u),t=s,u=a}d<f-1&&p(d,f-1,e.loop,u)}return l}function ws(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Ts(e,t){if(!t)return!1;let n=[],r=function(e,t){return Sa(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function Es(e,t,n){return e.options.clip?e[n]:t[n]}function Ds(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:Es(n,t,`left`),right:Es(n,t,`right`),top:Es(r,t,`top`),bottom:Es(r,t,`bottom`)}:t}function Os(e,t){let n=t._clip;if(n.disabled)return!1;let r=Ds(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}var ks=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,da.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},As=`transparent`,js={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=Ca(e||As),i=r.valid&&Ca(t||As);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Ms=class{constructor(e,t,n,r){let i=t[n];r=uo([e.to,r,i,e.from]);let a=uo([e.from,i,r]);this._active=!0,this._fn=e.fn||js[e.type||typeof a],this._easing=xa[e.easing]||xa.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=uo([e.to,t,r,e.from]),this._from=uo([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t<n),!this._active){this._target[r]=o,this._notify(!0);return}if(t<0){this._target[r]=i;return}s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}},Ns=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!z(e))return;let t=Object.keys(X.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!z(i))return;let a={};for(let e of t)a[e]=i[e];(R(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Fs(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Ps(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Ms(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return ks.add(this._chart,n),!0}};function Ps(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Fs(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Is(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function Ls(e,t,n){if(n===!1)return!1;let r=Is(e,n),i=Is(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Rs(e){let t,n,r,i;return z(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function zs(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Bs(e,t,n,r={}){let i=e.keys,a=r.mode===`single`,o,s,c,l;if(t===null)return;let u=!1;for(o=0,s=i.length;o<s;++o){if(c=+i[o],c===n){if(u=!0,r.all)continue;break}l=e.values[c],B(l)&&(a||t===0||Bi(t)===Bi(l))&&(t+=l)}return!u&&!r.all?0:t}function Vs(e,t){let{iScale:n,vScale:r}=t,i=n.axis===`x`?`x`:`y`,a=r.axis===`x`?`x`:`y`,o=Object.keys(e),s=Array(o.length),c,l,u;for(c=0,l=o.length;c<l;++c)u=o[c],s[c]={[i]:u,[a]:e[u]};return s}function Hs(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Us(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Ws(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function Gs(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Ks(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function qs(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Us(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=Gs(i,u,a),f[s]=d,f._top=Ks(f,o,!0,r.type),f._bottom=Ks(f,o,!1,r.type);let m=f._visualValues||={};m[s]=d}}function Js(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function Ys(e,t){return po(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function Xs(e,t,n){return po(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function Zs(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var Qs=e=>e===`reset`||e===`none`,$s=(e,t)=>t?e:Object.assign({},e),ec=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:zs(n,!0),values:null},tc=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Hs(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&Zs(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=V(n.xAxisID,Js(e,`x`)),a=t.yAxisID=V(n.yAxisID,Js(e,`y`)),o=t.rAxisID=V(n.rAxisID,Js(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&la(this._data,this),e._stacked&&Zs(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(z(t)){let e=this._cachedMeta;this._data=Vs(t,e)}else if(n!==t){if(n){la(n,this);let e=this._cachedMeta;Zs(e),e._parsed=[]}t&&Object.isExtensible(t)&&ca(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Hs(t.vScale,t),t.stack!==n.stack&&(r=!0,Zs(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(qs(this,t._parsed),t._stacked=Hs(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length?!0:n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=R(r[e])?this.parseArrayData(n,r,e,t):z(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]<c[o];for(l=0;l<t;++l)n._parsed[l+e]=u=d[l],s&&(i()&&(s=!1),c=u);n._sorted=s}a&&qs(this,d)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(Oi(f,o),d),y:a.parse(Oi(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis];return Bs({keys:zs(r,!0),values:t._stacks[e.axis]._visualValues},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=Bs(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,a=r.length,o=this._getOtherScale(e),s=ec(t,n,this.chart),c={min:1/0,max:-1/0},{min:l,max:u}=Ws(o),d,f;function p(){f=r[d];let t=f[o.axis];return!B(f[e.axis])||l>t||u<t}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(c,e,f,s),i));++d);if(i){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r][e.axis],B(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=Rs(V(this.options.clip,Ls(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=Xs(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=Ys(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&Ai(n);if(o)return $s(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(X.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze($s(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new Ns(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||Qs(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){Qs(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!Qs(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&Zs(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}};function nc(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),r=[];for(let t=0,i=n.length;t<i;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=ua(r.sort((e,t)=>e-t))}return e._cache.$bar}function rc(e){let t=e.iScale,n=nc(t,e.type),r=t._length,i,a,o,s,c=()=>{o===32767||o===-32768||(Ai(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),c();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),c();return r}function ic(e,t,n,r){let i=n.barThickness,a,o;return L(i)?(a=t.min*n.categoryPercentage,o=n.barPercentage):(a=i*r,o=1),{chunk:a/r,ratio:o,start:t.pixels[e]-a/2}}function ac(e,t,n,r){let i=t.pixels,a=i[e],o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,c=n.categoryPercentage;o===null&&(o=a-(s===null?t.end-t.start:s-a)),s===null&&(s=a+a-o);let l=a-(a-Math.min(o,s))/2*c;return{chunk:Math.abs(s-o)/2*c/r,ratio:n.barPercentage,start:l}}function oc(e,t,n,r){let i=n.parse(e[0],r),a=n.parse(e[1],r),o=Math.min(i,a),s=Math.max(i,a),c=o,l=s;Math.abs(o)>Math.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function sc(e,t,n,r){return R(e)?oc(e,t,n,r):t[n.axis]=n.parse(e,r),t}function cc(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[i.axis]=s||i.parse(o[l],l),c.push(sc(f,d,a,l));return c}function lc(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function uc(e,t,n){return e===0?(t.isHorizontal()?1:-1)*(t.min>=n?1:-1):Bi(e)}function dc(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.base<e.y,n=`bottom`,r=`top`),t?(i=`end`,a=`start`):(i=`start`,a=`end`),{start:n,end:r,reverse:t,top:i,bottom:a}}function fc(e,t,n,r){let i=t.borderSkipped,a={};if(!i){e.borderSkipped=a;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:s,reverse:c,top:l,bottom:u}=dc(e);i===`middle`&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=l:(n._bottom||0)===r?i=u:(a[pc(u,o,s,c)]=!0,i=l)),a[pc(i,o,s,c)]=!0,e.borderSkipped=a}function pc(e,t,n,r){return r?(e=mc(e,t,n),e=hc(e,n,t)):e=hc(e,t,n),e}function mc(e,t,n){return e===t?n:e===n?t:e}function hc(e,t,n){return e===`start`?t:e===`end`?n:e}function gc(e,{inflateAmount:t},n){e.inflateAmount=t===`auto`?n===1?.33:0:t}var _c=class extends tc{static id=`bar`;static defaults={datasetElementType:!1,dataElementType:`bar`,categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:`number`,properties:[`x`,`y`,`base`,`width`,`height`]}}};static overrides={scales:{_index_:{type:`category`,offset:!0,grid:{offset:!0}},_value_:{type:`linear`,beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return cc(e,t,n,r)}parseArrayData(e,t,n,r){return cc(e,t,n,r)}parseObjectData(e,t,n,r){let{iScale:i,vScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=i.axis===`x`?o:s,l=a.axis===`x`?o:s,u=[],d,f,p,m;for(d=n,f=n+r;d<f;++d)m=t[d],p={},p[i.axis]=i.parse(Oi(m,c),d),u.push(sc(Oi(m,l),p,a,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);let i=n._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let{iScale:t,vScale:n}=this._cachedMeta,r=this.getParsed(e),i=r._custom,a=lc(i)?`[`+i.start+`, `+i.end+`]`:``+n.getLabelForValue(r[n.axis]);return{label:``+t.getLabelForValue(r[t.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{index:a,_cachedMeta:{vScale:o}}=this,s=o.getBasePixel(),c=o.isHorizontal(),l=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let f=t;f<t+n;f++){let t=this.getParsed(f),n=i||L(t[o.axis])?{base:s,head:s}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,l),m=(t._stacks||{})[o.axis],h={horizontal:c,base:n.base,enableBorderRadius:!m||lc(t._custom)||a===m._top||a===m._bottom,x:c?n.head:p.center,y:c?p.center:n.head,height:c?p.size:Math.abs(n.size),width:c?Math.abs(n.size):p.size};d&&(h.options=u||this.resolveDataElementOptions(f,e[f].active?`active`:r));let g=h.options||e[f].options;fc(h,g,m,a),gc(h,g,l.ratio),this.updateElement(e[f],f,h,r)}}_getStacks(e,t){let{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(L(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[V(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;i<a;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));let o=e.barThickness;return{min:o||rc(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:o?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:i,minBarLength:a}}=this,o=i||0,s=this.getParsed(e),c=s._custom,l=lc(c),u=s[t.axis],d=0,f=n?this.applyStack(t,s,n):u,p,m;f!==u&&(d=f-u,f=u),l&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Bi(u)!==Bi(c.barEnd)&&(d=0),d+=u);let h=!L(i)&&!l?i:d,g=t.getPixelForValue(h);if(p=this.chart.getDataVisibility(e)?t.getPixelForValue(d+f):g,m=p-g,Math.abs(m)<a){m=uc(m,t,o)*a,u===o&&(g-=m/2);let e=t.getPixelForDecimal(0),i=t.getPixelForDecimal(1);g=Math.max(Math.min(g,Math.max(e,i)),Math.min(e,i)),p=g+m,n&&!l&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(p)-t.getValueForPixel(g))}if(g===t.getPixelForValue(o)){let e=Bi(m)*t.getLineWidthForValue(o)/2;g+=e,m-=e}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(e,t){let n=t.scale,r=this.options,i=r.skipNull,a=V(r.maxBarThickness,1/0),o,s,c=this._getAxisCount();if(t.grouped){let n=i?this._getStackCount(e):t.stackCount,l=r.barThickness===`flex`?ac(e,t,r,n*c):ic(e,t,r,n*c),u=this.chart.options.indexAxis===`x`?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(V(u,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+d;o=l.start+l.chunk*f+l.chunk/2,s=Math.min(a,l.chunk*l.ratio)}else o=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(a,t.min*t.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}}draw(){let e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,i=0;for(;i<r;++i)this.getParsed(i)[t.axis]!==null&&!n[i].hidden&&n[i].draw(this._ctx)}},vc=class extends tc{static id=`bubble`;static defaults={datasetElementType:!1,dataElementType:`point`,animations:{numbers:{type:`number`,properties:[`x`,`y`,`borderWidth`,`radius`]}}};static overrides={scales:{x:{type:`linear`},y:{type:`linear`}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,n,r){let i=super.parsePrimitiveData(e,t,n,r);for(let e=0;e<i.length;e++)i[e]._custom=this.resolveDataElementOptions(e+n).radius;return i}parseArrayData(e,t,n,r){let i=super.parseArrayData(e,t,n,r);for(let e=0;e<i.length;e++){let r=t[n+e];i[e]._custom=V(r[2],this.resolveDataElementOptions(e+n).radius)}return i}parseObjectData(e,t,n,r){let i=super.parseObjectData(e,t,n,r);for(let e=0;e<i.length;e++){let r=t[n+e];i[e]._custom=V(r&&r.r&&+r.r,this.resolveDataElementOptions(e+n).radius)}return i}getMaxOverflow(){let e=this._cachedMeta.data,t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=t,a=this.getParsed(e),o=r.getLabelForValue(a.x),s=i.getLabelForValue(a.y),c=a._custom;return{label:n[e]||``,value:`(`+o+`, `+s+(c?`, `+c:``)+`)`}}update(e){let t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:s,includeOptions:c}=this._getSharedOptions(t,r),l=a.axis,u=o.axis;for(let d=t;d<t+n;d++){let t=e[d],n=!i&&this.getParsed(d),f={},p=f[l]=i?a.getPixelForDecimal(.5):a.getPixelForValue(n[l]),m=f[u]=i?o.getBasePixel():o.getPixelForValue(n[u]);f.skip=isNaN(p)||isNaN(m),c&&(f.options=s||this.resolveDataElementOptions(d,t.active?`active`:r),i&&(f.options.radius=0)),this.updateElement(t,d,f,r)}}resolveDataElementOptions(e,t){let n=this.getParsed(e),r=super.resolveDataElementOptions(e,t);r.$shared&&(r=Object.assign({},r,{$shared:!1}));let i=r.radius;return t!==`active`&&(r.radius=0),r.radius+=V(n&&n._custom,i),r}};function yc(e,t,n){let r=1,i=1,a=0,o=0;if(t<G){let s=e,c=s+t,l=Math.cos(s),u=Math.sin(s),d=Math.cos(c),f=Math.sin(c),p=(e,t,r)=>ea(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>ea(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(K,u,f),_=m(W,l,d),v=m(W+K,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var bc=class extends tc{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(z(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Oi(n[t],e)}let a,o;for(a=e,o=e+t;a<o;++a)r._parsed[a]=i(a)}}_getRotation(){return Ji(this.options.rotation-90)}_getCircumference(){return Ji(this.options.circumference)}_getRotationExtents(){let e=G,t=-G;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),a=r._getCircumference();e=Math.min(e,i),t=Math.max(t,i+a)}return{rotation:e,circumference:t-e}}update(e){let{chartArea:t}=this.chart,n=this._cachedMeta,r=n.data,i=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(t.width,t.height)-i)/2,0),o=Math.min(gi(this.options.cutout,a),1),s=this._getRingWeight(this.index),{circumference:c,rotation:l}=this._getRotationExtents(),{ratioX:u,ratioY:d,offsetX:f,offsetY:p}=yc(l,c,o),m=(t.width-i)/u,h=(t.height-i)/d,g=Math.max(Math.min(m,h)/2,0),_=_i(this.options.radius,g),v=(_-Math.max(_*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*_,this.offsetY=p*_,n.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*s,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let n=this.options,r=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/G)}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.chartArea,s=a.options.animation,c=(o.left+o.right)/2,l=(o.top+o.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,f=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,r),h=this._getRotation(),g;for(g=0;g<t;++g)h+=this._circumference(g,i);for(g=t;g<t+n;++g){let t=this._circumference(g,i),n=e[g],a={x:c+this.offsetX,y:l+this.offsetY,startAngle:h,endAngle:h+t,circumference:t,outerRadius:f,innerRadius:d};m&&(a.options=p||this.resolveDataElementOptions(g,n.active?`active`:r)),h+=t,this.updateElement(n,g,a,r)}}calculateTotal(){let e=this._cachedMeta,t=e.data,n=0,r;for(r=0;r<t.length;r++){let i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!t[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?Math.abs(e)/t*G:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=ja(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){a=n.getDatasetMeta(r),e=a.data,o=a.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)s=o.resolveDataElementOptions(r),s.borderAlign!==`inner`&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){let e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(V(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}},xc=class extends tc{static id=`line`;static defaults={datasetElementType:`line`,dataElementType:`point`,showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:`category`},_value_:{type:`linear`}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){let t=this._cachedMeta,{dataset:n,data:r=[],_dataset:i}=t,a=this.chart._animationsDisabled,{start:o,count:s}=ga(t,r,a);this._drawStart=o,this._drawCount=s,_a(t)&&(o=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=r;let c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},e),this.updateElements(r,o,s,e)}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(t,r),d=a.axis,f=o.axis,{spanGaps:p,segment:m}=this.options,h=Gi(p)?p:1/0,g=this.chart._animationsDisabled||i||r===`none`,_=t+n,v=e.length,y=t>0&&this.getParsed(t-1);for(let n=0;n<v;++n){let p=e[n],v=g?p:{};if(n<t||n>=_){v.skip=!0;continue}let b=this.getParsed(n),x=L(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},Sc=class extends tc{static id=`polarArea`;static defaults={dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:`number`,properties:[`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`]}},indexAxis:`r`,startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map((t,i)=>{let a=e.getDatasetMeta(0).controller.getStyle(i);return{text:t,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(i),index:i}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:`radialLinear`,angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=ja(t._parsed[e].r,n.options.locale);return{label:r[e]||``,value:i}}parseObjectData(e,t,n,r){return No.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){let e=this._cachedMeta,t={min:1/0,max:-1/0};return e.data.forEach((e,n)=>{let r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<t.min&&(t.min=r),r>t.max&&(t.max=r))}),t}_updateRadius(){let e=this.chart,t=e.chartArea,n=e.options,r=Math.min(t.right-t.left,t.bottom-t.top),i=Math.max(r/2,0),a=(i-Math.max(n.cutoutPercentage?i/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.options.animation,s=this._cachedMeta.rScale,c=s.xCenter,l=s.yCenter,u=s.getIndexAngle(0)-.5*W,d=u,f,p=360/this.countVisibleElements();for(f=0;f<t;++f)d+=this._computeAngle(f,r,p);for(f=t;f<t+n;f++){let t=e[f],n=d,m=d+this._computeAngle(f,r,p),h=a.getDataVisibility(f)?s.getDistanceFromCenterForValue(this.getParsed(f).r):0;d=m,i&&(o.animateScale&&(h=0),o.animateRotate&&(n=m=u));let g={x:c,y:l,innerRadius:0,outerRadius:h,startAngle:n,endAngle:m,options:this.resolveDataElementOptions(f,t.active?`active`:r)};this.updateElement(t,f,g,r)}}countVisibleElements(){let e=this._cachedMeta,t=0;return e.data.forEach((e,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++}),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?Ji(this.resolveDataElementOptions(e,t).angle||n):0}},Cc=class extends bc{static id=`pie`;static defaults={cutout:0,rotation:0,circumference:360,radius:`100%`}},wc=class extends tc{static id=`radar`;static defaults={datasetElementType:`line`,dataElementType:`point`,indexAxis:`r`,showLine:!0,elements:{line:{fill:`start`}}};static overrides={aspectRatio:1,scales:{r:{type:`radialLinear`}}};getLabelAndValue(e){let t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:``+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,r){return No.bind(this)(e,t,n,r)}update(e){let t=this._cachedMeta,n=t.dataset,r=t.data||[],i=t.iScale.getLabels();if(n.points=r,e!==`resize`){let t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);let a={_loop:!0,_fullLoop:i.length===r.length,options:t};this.updateElement(n,void 0,a,e)}this.updateElements(r,0,r.length,e)}updateElements(e,t,n,r){let i=this._cachedMeta.rScale,a=r===`reset`;for(let o=t;o<t+n;o++){let t=e[o],n=this.resolveDataElementOptions(o,t.active?`active`:r),s=i.getPointPositionForValue(o,this.getParsed(o).r),c=a?i.xCenter:s.x,l=a?i.yCenter:s.y,u={x:c,y:l,angle:s.angle,skip:isNaN(c)||isNaN(l),options:n};this.updateElement(t,o,u,r)}}},Tc=class extends tc{static id=`scatter`;static defaults={datasetElementType:!1,dataElementType:`point`,showLine:!1,fill:!1};static overrides={interaction:{mode:`point`},scales:{x:{type:`linear`},y:{type:`linear`}}};getLabelAndValue(e){let t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=t,a=this.getParsed(e),o=r.getLabelForValue(a.x),s=i.getLabelForValue(a.y);return{label:n[e]||``,value:`(`+o+`, `+s+`)`}}update(e){let t=this._cachedMeta,{data:n=[]}=t,r=this.chart._animationsDisabled,{start:i,count:a}=ga(t,n,r);if(this._drawStart=i,this._drawCount=a,_a(t)&&(i=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:i,_dataset:a}=t;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;let o=this.resolveDatasetElementOptions(e);o.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:o},e)}else this.datasetElementType&&=(delete t.dataset,!1);this.updateElements(n,i,a,e)}addElements(){let{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement(`line`)),super.addElements()}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,l=this.resolveDataElementOptions(t,r),u=this.getSharedOptions(l),d=this.includeOptions(r,u),f=a.axis,p=o.axis,{spanGaps:m,segment:h}=this.options,g=Gi(m)?m:1/0,_=this.chart._animationsDisabled||i||r===`none`,v=t>0&&this.getParsed(t-1);for(let l=t;l<t+n;++l){let t=e[l],n=this.getParsed(l),m=_?t:{},y=L(n[p]),b=m[f]=a.getPixelForValue(n[f],l),x=m[p]=i||y?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,n,s):n[p],l);m.skip=isNaN(b)||isNaN(x)||y,m.stop=l>0&&Math.abs(n[f]-v[f])>g,h&&(m.parsed=n,m.raw=c.data[l]),d&&(m.options=u||this.resolveDataElementOptions(l,t.active?`active`:r)),_||this.updateElement(t,l,m,r),v=n}this.updateSharedOptions(u,r,l)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}let n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;let i=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,i,a)/2}};function Ec(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Dc={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Ec()}parse(){return Ec()}format(){return Ec()}add(){return Ec()}diff(){return Ec()}startOf(){return Ec()}endOf(){return Ec()}}};function Oc(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?aa:ia;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!L(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!L(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function kc(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=Oc(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function Ac(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function jc(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||kc(e,n,t,function(n,o,s){!i&&!qa(n,e.chartArea,0)||n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function Mc(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=Zi(e,{x:t.x,y:t.y});ea(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return kc(e,n,t,a),i}function Nc(e,t,n,r,i,a){let o=[],s=Ac(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return kc(e,n,t,l),o}function Pc(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?Mc(e,t,n,i):Nc(e,t,n,r,i,a)}function Fc(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return kc(e,n,t,(e,r,c)=>{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Ic={evaluateInteractionItems:kc,modes:{index(e,t,n,r){let i=$o(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?jc(e,i,a,r,o):Pc(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=$o(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?jc(e,i,a,r,o):Pc(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return jc(e,$o(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=$o(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return Pc(e,i,a,n.intersect,r,o)},x(e,t,n,r){return Fc(e,$o(t,e),`x`,n.intersect,r)},y(e,t,n,r){return Fc(e,$o(t,e),`y`,n.intersect,r)}}},Lc=[`left`,`top`,`right`,`bottom`];function Rc(e,t){return e.filter(e=>e.pos===t)}function zc(e,t){return e.filter(e=>Lc.indexOf(e.pos)===-1&&e.box.axis===t)}function Bc(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Vc(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function Hc(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!Lc.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function Uc(e,t){let n=Hc(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function Wc(e){let t=Vc(e),n=Bc(t.filter(e=>e.box.fullSize),!0),r=Bc(Rc(t,`left`),!0),i=Bc(Rc(t,`right`)),a=Bc(Rc(t,`top`),!0),o=Bc(Rc(t,`bottom`)),s=zc(t,`x`),c=zc(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Rc(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function Gc(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Kc(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function qc(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!z(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Kc(o,a.getPadding());let s=Math.max(0,t.outerWidth-Gc(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-Gc(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function Jc(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function Yc(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Xc(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,Yc(s.horizontal,t));let{same:o,other:d}=qc(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&Xc(i,t,n,r)||u}function Zc(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function Qc(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;Ai(c.start)&&(o=c.start),e.fullSize?Zc(e,i.left,o,n.outerWidth-i.right-i.left,a):Zc(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;Ai(c.start)&&(a=c.start),e.fullSize?Zc(e,a,i.top,o,n.outerHeight-i.bottom-i.top):Zc(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}var $={addBox(e,t){e.boxes||=[],t.fullSize=t.fullSize||!1,t.position=t.position||`top`,t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=Z(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=Wc(e.boxes),c=s.vertical,l=s.horizontal;U(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Kc(f,Z(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Uc(c.concat(l),d);Xc(s.fullSize,p,d,m),Xc(c,p,d,m),Xc(l,p,d,m)&&Xc(c,p,d,m),Jc(p),Qc(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,Qc(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},U(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},$c=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},el=class extends $c{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},tl=`$chartjs`,nl={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},rl=e=>e===null||e===``;function il(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[tl]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,rl(i)){let t=as(e,`width`);t!==void 0&&(e.width=t)}if(rl(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=as(e,`height`);t!==void 0&&(e.height=t)}return e}var al=is?{passive:!0}:!1;function ol(e,t,n){e&&e.addEventListener(t,n,al)}function sl(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,al)}function cl(e,t){let n=nl[e.type]||e.type,{x:r,y:i}=$o(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function ll(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function ul(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ll(n.addedNodes,r),t&&=!ll(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function dl(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ll(n.removedNodes,r),t&&=!ll(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var fl=new Map,pl=0;function ml(){let e=window.devicePixelRatio;e!==pl&&(pl=e,fl.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function hl(e,t){fl.size||window.addEventListener(`resize`,ml),fl.set(e,t)}function gl(e){fl.delete(e),fl.size||window.removeEventListener(`resize`,ml)}function _l(e,t,n){let r=e.canvas,i=r&&Go(r);if(!i)return;let a=fa((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),hl(e,a),o}function vl(e,t,n){n&&n.disconnect(),t===`resize`&&gl(e)}function yl(e,t,n){let r=e.canvas,i=fa(t=>{e.ctx!==null&&n(cl(t,e))},e);return ol(r,t,i),i}var bl=class extends $c{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(il(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[tl])return!1;let n=t[tl].initial;[`height`,`width`].forEach(e=>{let r=n[e];L(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[tl],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:ul,detach:dl,resize:_l}[t]||yl)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:vl,detach:vl,resize:vl}[t]||sl)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return ns(e,t,n,r)}isAttached(e){let t=e&&Go(e);return!!(t&&t.isConnected)}};function xl(e){return!Wo()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?el:bl}var Sl=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return Gi(this.x)&&Gi(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Cl(e,t){let n=e.options.ticks,r=wl(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?El(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Dl(t,l,a,o/i),l;let u=Tl(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(Ol(t,l,u,L(r)?0:s-r,s),e=0,n=o-1;e<n;e++)Ol(t,l,u,a[e],a[e+1]);return Ol(t,l,u,c,L(r)?t.length:c+r),l}return Ol(t,l,u),l}function wl(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Tl(e,t,n){let r=kl(e),i=t.length/n;if(!r)return Math.max(i,1);let a=Ui(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function El(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Dl(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function Ol(e,t,n,r,i){let a=V(r,0),o=Math.min(V(i,e.length),e.length),s=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),u=a;u<0;)s++,u=Math.round(a+s*n);for(l=Math.max(a,0);l<o;l++)l===u&&(t.push(e[l]),s++,u=Math.round(a+s*n))}function kl(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var Al=e=>e===`left`?`right`:e===`right`?`left`:e,jl=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Ml=(e,t)=>Math.min(t||e,e);function Nl(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function Pl(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function Fl(e,t){U(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function Il(e){return e.drawTicks?e.tickLength:0}function Ll(e,t){if(!e.display)return 0;let n=Q(e.font,t),r=Z(e.padding);return(R(e.text)?e.text.length:1)*n.lineHeight+r.height}function Rl(e,t){return po(e,{scale:t,type:`scale`})}function zl(e,t,n){return po(e,{tick:n,index:t,type:`tick`})}function Bl(e,t,n){let r=ma(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=Al(r)),r}function Vl(e,t,n,r){let{top:i,left:a,bottom:o,right:s,chart:c}=e,{chartArea:l,scales:u}=c,d=0,f,p,m,h=o-i,g=s-a;if(e.isHorizontal()){if(p=Y(r,a,s),z(n)){let e=Object.keys(n)[0],r=n[e];m=u[e].getPixelForValue(r)+h-t}else m=n===`center`?(l.bottom+l.top)/2+h-t:jl(e,n,t);f=s-a}else{if(z(n)){let e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p=n===`center`?(l.left+l.right)/2-g+t:jl(e,n,t);m=Y(r,o,i),d=n===`left`?-K:K}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}var Hl=class e extends Sl{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=hi(e,1/0),t=hi(t,-1/0),n=hi(n,1/0),r=hi(r,-1/0),{min:hi(e,n),max:hi(t,r),minDefined:B(e),maxDefined:B(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let o=this.getMatchingVisibleMetas();for(let s=0,c=o.length;s<c;++s)a=o[s].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max));return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:hi(t,hi(n,t)),max:hi(n,hi(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){H(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fo(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?Nl(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=Cl(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){H(this.options.afterUpdate,[this])}beforeSetDimensions(){H(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){H(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),H(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){H(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=H(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){H(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){H(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=Ml(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=J(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-Il(e.grid)-t.padding-Ll(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=Yi(Math.min(Math.asin(J((l.highest.height+6)/o,-1,1)),Math.asin(J(s/c,-1,1))-Math.asin(J(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ll(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=Il(i)+a):(e.height=this.maxHeight,e.width=Il(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=Ji(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){H(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)L(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=Nl(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:i}=this,a=[],o=[],s=Math.floor(t/Ml(t,n)),c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;u+=s){if(p=e[u].label,m=this._resolveTickFontOptions(u),r.font=h=m.string,g=i[h]=i[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!L(p)&&!R(p))v=Va(r,g.data,g.gc,v,p),y=_;else if(R(p))for(d=0,f=p.length;d<f;++d)b=p[d],!L(b)&&!R(b)&&(v=Va(r,g.data,g.gc,v,b),y+=_);a.push(v),o.push(y),c=Math.max(v,c),l=Math.max(y,l)}Fl(i,t);let x=a.indexOf(c),S=o.indexOf(l),C=e=>({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ta(this._alignToPixels?Ua(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let n=t[e];return n.$context||=zl(this.getContext(),e,n)}return this.$context||=Rl(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=Ji(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+(s?1:0),u=Il(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Ua(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(z(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(z(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=V(r.ticks.maxTicksLimit,l),te=Math.max(1,Math.ceil(l/ee));for(_=0;_<l;_+=te){let e=this.getContext(_),t=i.setContext(e),r=o.setContext(e),a=t.lineWidth,l=t.color,u=r.dash||[],f=r.dashOffset,p=t.tickWidth,m=t.tickColor,h=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=Pl(this,_,s),v!==void 0&&(y=Ua(n,v,a),c?b=S=w=E=y:x=C=T=D=y,d.push({tx1:b,ty1:x,tx2:S,ty2:C,x1:w,y1:T,x2:E,y2:D,width:a,color:l,borderDash:u,borderDashOffset:f,tickWidth:p,tickColor:m,tickBorderDash:h,tickBorderDashOffset:g}))}return this._ticksLength=l,this._borderValue=g,d}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:i}=n,a=this.isHorizontal(),o=this.ticks,{align:s,crossAlign:c,padding:l,mirror:u}=i,d=Il(n.grid),f=d+l,p=u?-l:f,m=-Ji(this.labelRotation),h=[],g,_,v,y,b,x,S,C,w,T,E,D,ee=`middle`;if(r===`top`)x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(r===`bottom`)x=this.top+p,S=this._getXAxisLabelAlignment();else if(r===`left`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(r===`right`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(t===`x`){if(r===`center`)x=(e.top+e.bottom)/2+f;else if(z(r)){let e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if(t===`y`){if(r===`center`)b=(e.left+e.right)/2-f;else if(z(r)){let e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(d).textAlign}t===`y`&&(s===`start`?ee=`top`:s===`end`&&(ee=`bottom`));let te=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){v=o[g],y=v.label;let e=i.setContext(this.getContext(g));C=this.getPixelForTick(g)+i.labelOffset,w=this._resolveTickFontOptions(g),T=w.lineHeight,E=R(y)?y.length:1;let t=E/2,n=e.color,s=e.textStrokeColor,l=e.textStrokeWidth,d=S;a?(b=C,S===`inner`&&(d=g===_-1?this.options.reverse?`left`:`right`:g===0?this.options.reverse?`right`:`left`:`center`),D=r===`top`?c===`near`||m!==0?-E*T+T/2:c===`center`?-te.highest.height/2-t*T+T:-te.highest.height+T/2:c===`near`||m!==0?T/2:c===`center`?te.highest.height/2-t*T:te.highest.height-E*T,u&&(D*=-1),m!==0&&!e.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(x=C,D=(1-E)*T/2);let f;if(e.showLabelBackdrop){let t=Z(e.backdropPadding),n=te.heights[g],r=te.widths[g],i=D-t.top,a=0-t.left;switch(ee){case`middle`:i-=n/2;break;case`bottom`:i-=n;break}switch(S){case`center`:a-=r/2;break;case`right`:a-=r;break;case`inner`:g===_-1?a-=r:g>0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Ji(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),a=n.display?i.width:0;if(!a)return;let o=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue,c,l,u,d;this.isHorizontal()?(c=Ua(e,this.left,a)-a/2,l=Ua(e,this.right,o)+o/2,u=d=s):(u=Ua(e,this.top,a)-a/2,d=Ua(e,this.bottom,o)+o/2,c=l=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(c,u),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&Ja(t,n);let r=this.getLabelItems(e);for(let e of r){let n=e.options,r=e.font,i=e.label,a=e.textOffset;to(t,i,0,a,r,n)}n&&Ya(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let i=Q(n.font),a=Z(n.padding),o=n.align,s=i.lineHeight/2;t===`bottom`||t===`center`||z(t)?(s+=a.bottom,R(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=a.top;let{titleX:c,titleY:l,maxWidth:u,rotation:d}=Vl(this,s,t,o);to(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:Bl(o,t,r),textBaseline:`middle`,translation:[c,l]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=V(t.grid&&t.grid.z,-1),i=V(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){return Q(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Ul=class{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),n;Kl(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r?a:(r[i]=e,Wl(e,a,n),this.override&&X.override(e.id,e.overrides),a)}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in X[r]&&(delete X[r][n],this.override&&delete Ia[n])}};function Wl(e,t,n){let r=Si(Object.create(null),[n?X.get(n):{},X.get(t),e.defaults]);X.set(t,r),e.defaultRoutes&&Gl(t,e.defaultRoutes),e.descriptors&&X.describe(t,e.descriptors)}function Gl(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);X.route(a,i,c,s)})}function Kl(e){return`id`in e&&`defaults`in e}var ql=new class{constructor(){this.controllers=new Ul(tc,`datasets`,!0),this.elements=new Ul(Sl,`elements`),this.plugins=new Ul(Object,`plugins`),this.scales=new Ul(Hl,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):U(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=ki(e);H(n[`before`+r],[],n),t[e](n),H(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(r===void 0)throw Error(`"`+e+`" is not a registered `+n+`.`);return r}},Jl=class{constructor(){this._init=void 0}notify(e,t,n,r){if(t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`)),this._init===void 0)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`),this._init=void 0),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(H(a,[t,r,i.options],e)===!1&&r.cancelable)return!1}return!0}invalidate(){L(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=V(n.options&&n.options.plugins,{}),i=Yl(n);return r===!1&&!t?[]:Zl(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Yl(e){let t={},n=[],r=Object.keys(ql.plugins.items);for(let e=0;e<r.length;e++)n.push(ql.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function Xl(e,t){return!t&&e===!1?null:e===!0?{}:e}function Zl(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=Xl(r[t],i);c!==null&&a.push({plugin:s,options:Ql(e.config,{plugin:s,local:n[t]},c,o)})}return a}function Ql(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function $l(e,t){let n=X.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function eu(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function tu(e,t){return e===t?`_index_`:`_value_`}function nu(e){if(e===`x`||e===`y`||e===`r`)return e}function ru(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function iu(e,...t){if(nu(e))return e;for(let n of t){let t=n.axis||ru(n.position)||e.length>1&&nu(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function au(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function ou(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return au(e,`x`,n[0])||au(e,`y`,n[0])}return{}}function su(e,t){let n=Ia[e.type]||{scales:{}},r=t.scales||{},i=$l(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!z(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=iu(t,o,ou(t,e),X.scales[o.type]),c=tu(s,i),l=n.scales||{};a[t]=Ci(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||$l(i,t),s=(Ia[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=eu(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Ci(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Ci(t,[X.scales[t.type],X.scale])}),a}function cu(e){let t=e.options||={};t.plugins=V(t.plugins,{}),t.scales=su(e,t)}function lu(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function uu(e){return e||={},e.data=lu(e.data),cu(e),e}var du=new Map,fu=new Set;function pu(e,t){let n=du.get(e);return n||(n=t(),du.set(e,n),fu.add(n)),n}var mu=(e,t,n)=>{let r=Oi(t,n);r!==void 0&&e.add(r)},hu=class{constructor(e){this._config=uu(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=lu(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),cu(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return pu(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return pu(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return pu(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return pu(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>mu(s,e,t))),t.forEach(e=>mu(s,r,e)),t.forEach(e=>mu(s,Ia[i]||{},e)),t.forEach(e=>mu(s,X,e)),t.forEach(e=>mu(s,La,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),fu.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Ia[t]||{},X.datasets[t]||{},{type:t},X,La]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=gu(this._resolverCache,e,r),s=a;if(vu(a,t)){i.$shared=!1,n=ji(n)?n():n;let t=this.createResolver(e,n,o);s=ho(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=gu(this._resolverCache,e,n);return z(t)?ho(i,t,void 0,r):i}};function gu(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:mo(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var _u=e=>z(e)&&Object.getOwnPropertyNames(e).some(t=>ji(e[t]));function vu(e,t){let{isScriptable:n,isIndexable:r}=go(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(ji(o)||_u(o))||a&&R(o))return!0}return!1}var yu=`4.5.1`,bu=[`top`,`bottom`,`left`,`right`,`chartArea`];function xu(e,t){return e===`top`||e===`bottom`||bu.indexOf(e)===-1&&t===`x`}function Su(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Cu(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),H(n&&n.onComplete,[e],t)}function wu(e){let t=e.chart,n=t.options.animation;H(n&&n.onProgress,[e],t)}function Tu(e){return Wo()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Eu={},Du=e=>{let t=Tu(e);return Object.values(Eu).filter(e=>e.canvas===t).pop()};function Ou(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function ku(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var Au=class{static defaults=X;static instances=Eu;static overrides=Ia;static registry=ql;static version=yu;static getChart=Du;static register(...e){ql.add(...e),ju()}static unregister(...e){ql.remove(...e),ju()}constructor(e,t){let n=this.config=new hu(t),r=Tu(e),i=Du(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(xl(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=mi(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Jl,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=pa(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],Eu[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}ks.listen(this,`complete`,Cu),ks.listen(this,`progress`,wu),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return L(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return ql}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():rs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Wa(this.canvas,this.ctx),this}stop(){return ks.stop(this),this}resize(e,t){ks.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,rs(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),H(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){U(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=iu(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),U(i,t=>{let i=t.options,a=i.id,o=iu(a,i),s=V(i.type,t.dtype);(i.position===void 0||xu(i.position,o)!==xu(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(ql.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),U(r,(e,t)=>{e||delete n[t]}),U(n,e=>{$.configure(this,e,e.options),$.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Su(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||$l(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=ql.getController(a),{datasetElementType:r,dataElementType:o}=X.datasets[a];Object.assign(t,{dataElementType:ql.getElement(o),datasetElementType:r&&ql.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){U(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||U(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Su(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){U(this.scales,e=>{$.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!Mi(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)Ou(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!Mi(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;$.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],U(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,ji(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(ks.has(this)?this.attached&&!ks.running(this)&&ks.start(this):(this.draw(),Cu({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Os(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&Ja(t,r),e.controller.draw(),r&&Ya(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return qa(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Ic.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=po(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);Ai(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ks.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Wa(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Eu[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};U(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){U(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},U(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});vi(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Ni(e),c=ku(e,this._lastEvent,n,s);n&&(this._lastEvent=null,H(i.onHover,[e,o,this],this),s&&H(i.onClick,[e,o,this],this));let l=!vi(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function ju(){return U(Au.instances,e=>e._plugins.invalidate())}function Mu(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,q(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,q(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*q(r-n));if(u===`round`)e.arc(i,a,t,n-W/2,r+W/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+W/2)+i,c=-o*Math.sin(n+W/2)+a,l=o*Math.cos(r+W/2)+i,u=o*Math.sin(r+W/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Nu(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+K,r-K),e.closePath(),e.clip()}function Pu(e){return so(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function Fu(e,t,n,r){let i=Pu(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return J(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:J(i.innerStart,0,o),innerEnd:J(i.innerEnd,0,o)}}function Iu(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Lu(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/W)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=Fu(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,te=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Iu(C,T,o,s);e.arc(t.x,t.y,y,T,_+K)}let n=Iu(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Iu(D,te,o,s);e.arc(t.x,t.y,x,_+K,te+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Iu(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-K)}let i=Iu(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Iu(S,w,o,s);e.arc(t.x,t.y,v,g-K,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Ru(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Lu(e,t,n,r,c,i);for(let t=0;t<a;++t)e.fill();isNaN(s)||(c=o+(s%G||G))}return Lu(e,t,n,r,c,i),e.fill(),c}function zu(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=c,m=c.borderAlign===`inner`;if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=l*2,e.lineJoin=u||`round`):(e.lineWidth=l,e.lineJoin=u||`bevel`);let h=t.endAngle;if(a){Lu(e,t,n,r,h,i);for(let t=0;t<a;++t)e.stroke();isNaN(s)||(h=o+(s%G||G))}m&&Nu(e,t,h),c.selfJoin&&h-o>=W&&p===0&&u!==`miter`&&Mu(e,t,h),a||(Lu(e,t,n,r,h,i),e.stroke())}var Bu=class extends Sl{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){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,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=Zi(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=V(l,o-a),f=ea(r,a,o)&&a!==o,p=d>=G||f,m=na(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>G?Math.floor(n/G):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(W,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Ru(e,this,s,i,a),zu(e,this,s,i,a),e.restore()}};function Vu(e,t,n=t){e.lineCap=V(n.borderCapStyle,t.borderCapStyle),e.setLineDash(V(n.borderDash,t.borderDash)),e.lineDashOffset=V(n.borderDashOffset,t.borderDashOffset),e.lineJoin=V(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=V(n.borderWidth,t.borderWidth),e.strokeStyle=V(n.borderColor,t.borderColor)}function Hu(e,t,n){e.lineTo(n.x,n.y)}function Uu(e){return e.stepped?Xa:e.tension||e.cubicInterpolationMode===`monotone`?Za:Hu}function Wu(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=i<o&&a<o||i>s&&a>s;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function Gu(e,t,n,r){let{points:i,options:a}=t,{count:o,start:s,loop:c,ilen:l}=Wu(i,n,r),u=Uu(a),{move:d=!0,reverse:f}=r||{},p,m,h;for(p=0;p<=l;++p)m=i[(s+(f?l-p:p))%o],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,h,m,f,a.stepped),h=m);return c&&(m=i[(s+(f?l:0))%o],u(e,h,m,f,a.stepped)),!!c}function Ku(e,t,n,r){let i=t.points,{count:a,start:o,ilen:s}=Wu(i,n,r),{move:c=!0,reverse:l}=r||{},u=0,d=0,f,p,m,h,g,_,v=e=>(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(n<h?h=n:n>g&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function qu(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Ku:Gu}function Ju(e){return e.stepped?ss:e.tension||e.cubicInterpolationMode===`monotone`?cs:os}function Yu(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Vu(e,t.options),e.stroke(i)}function Xu(e,t,n,r){let{segments:i,options:a}=t,o=qu(t);for(let s of i)Vu(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var Zu=typeof Path2D==`function`;function Qu(e,t,n,r){Zu&&!t.options.segment?Yu(e,t,n,r):Xu(e,t,n,r)}var $u=class extends Sl{static id=`line`;static defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Uo(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=xs(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=vs(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=Ju(n),c,l;for(c=0,l=a.length;c<l;++c){let{start:l,end:u}=a[c],d=i[l],f=i[u];if(d===f){o.push(d);continue}let p=s(d,f,Math.abs((r-d[t])/(f[t]-d[t])),n.stepped);p[t]=e[t],o.push(p)}return o.length===1?o[0]:o}pathSegment(e,t,n){return qu(this)(e,this,t,n)}path(e,t,n){let r=this.segments,i=qu(this),a=this._loop;t||=0,n||=this.points.length-t;for(let o of r)a&=i(e,this,o,{start:t,end:t+n-1});return!!a}draw(e,t,n,r){let i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),Qu(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function ed(e,t,n,r){let i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}var td=class extends Sl{static id=`point`;parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:`circle`,radius:3,rotation:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){let r=this.options,{x:i,y:a}=this.getProps([`x`,`y`],n);return(e-i)**2+(t-a)**2<(r.hitRadius+r.radius)**2}inXRange(e,t){return ed(this,e,`x`,t)}inYRange(e,t){return ed(this,e,`y`,t)}getCenterPoint(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);let n=t&&e.borderWidth||0;return(t+n)*2}draw(e,t){let n=this.options;this.skip||n.radius<.1||!qa(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Ga(e,n,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};function nd(e,t){let{x:n,y:r,base:i,width:a,height:o}=e.getProps([`x`,`y`,`base`,`width`,`height`],t),s,c,l,u,d;return e.horizontal?(d=o/2,s=Math.min(n,i),c=Math.max(n,i),l=r-d,u=r+d):(d=a/2,s=n-d,c=n+d,l=Math.min(r,i),u=Math.max(r,i)),{left:s,top:l,right:c,bottom:u}}function rd(e,t,n,r){return e?0:J(t,n,r)}function id(e,t,n){let r=e.options.borderWidth,i=e.borderSkipped,a=co(r);return{t:rd(i.top,a.top,0,n),r:rd(i.right,a.right,0,t),b:rd(i.bottom,a.bottom,0,n),l:rd(i.left,a.left,0,t)}}function ad(e,t,n){let{enableBorderRadius:r}=e.getProps([`enableBorderRadius`]),i=e.options.borderRadius,a=lo(i),o=Math.min(t,n),s=e.borderSkipped,c=r||z(i);return{topLeft:rd(!c||s.top||s.left,a.topLeft,0,o),topRight:rd(!c||s.top||s.right,a.topRight,0,o),bottomLeft:rd(!c||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:rd(!c||s.bottom||s.right,a.bottomRight,0,o)}}function od(e){let t=nd(e),n=t.right-t.left,r=t.bottom-t.top,i=id(e,n/2,r/2),a=ad(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function sd(e,t,n,r){let i=t===null,a=n===null,o=e&&!(i&&a)&&nd(e,r);return o&&(i||na(t,o.left,o.right))&&(a||na(n,o.top,o.bottom))}function cd(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function ld(e,t){e.rect(t.x,t.y,t.w,t.h)}function ud(e,t,n={}){let r=e.x===n.x?0:-t,i=e.y===n.y?0:-t,a=(e.x+e.w===n.x+n.w?0:t)-r,o=(e.y+e.h===n.y+n.h?0:t)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}var dd=class extends Sl{static id=`bar`;static defaults={borderSkipped:`start`,borderWidth:0,borderRadius:0,inflateAmount:`auto`,pointStyle:void 0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){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,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:a}=od(this),o=cd(a.radius)?no:ld;e.save(),(a.w!==i.w||a.h!==i.h)&&(e.beginPath(),o(e,ud(a,t,i)),e.clip(),o(e,ud(i,-t,a)),e.fillStyle=n,e.fill(`evenodd`)),e.beginPath(),o(e,ud(i,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return sd(this,e,t,n)}inXRange(e,t){return sd(this,e,null,t)}inYRange(e,t){return sd(this,null,e,t)}getCenterPoint(e){let{x:t,y:n,base:r,horizontal:i}=this.getProps([`x`,`y`,`base`,`horizontal`],e);return{x:i?(t+r)/2:t,y:i?n:(n+r)/2}}getRange(e){return e===`x`?this.width/2:this.height/2}};function fd(e,t,n,r,i){let a=i.samples||r;if(a>=n)return e.slice(t,t+n);let o=[],s=(n-2)/(a-2),c=0,l=t+n-1,u=t,d,f,p,m,h;for(o[c++]=e[u],d=0;d<a-2;d++){let r=0,i=0,a,l=Math.floor((d+1)*s)+1+t,g=Math.min(Math.floor((d+2)*s)+1,n)+t,_=g-l;for(a=l;a<g;a++)r+=e[a].x,i+=e[a].y;r/=_,i/=_;let v=Math.floor(d*s)+1+t,y=Math.min(Math.floor((d+1)*s)+1,n)+t,{x:b,y:x}=e[u];for(p=m=-1,a=v;a<y;a++)m=.5*Math.abs((b-r)*(e[a].y-x)-(b-e[a].x)*(i-x)),m>p&&(p=m,f=e[a],h=a);o[c++]=f,u=h}return o[c++]=e[l],o}function pd(e,t,n,r){let i=0,a=0,o,s,c,l,u,d,f,p,m,h,g=[],_=t+n-1,v=e[t].x,y=e[_].x-v;for(o=t;o<t+n;++o){s=e[o],c=(s.x-v)/y*r,l=s.y;let t=c|0;if(t===u)l<m?(m=l,d=o):l>h&&(h=l,f=o),i=(a*i+s.x)/++a;else{let n=o-1;if(!L(d)&&!L(f)){let t=Math.min(d,f),r=Math.max(d,f);t!==p&&t!==n&&g.push({...e[t],x:i}),r!==p&&r!==n&&g.push({...e[r],x:i})}o>0&&n!==p&&g.push(e[n]),g.push(s),u=t,a=0,m=h=l,d=f=p=o}}return g}function md(e){if(e._decimated){let t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,`data`,{configurable:!0,enumerable:!0,writable:!0,value:t})}}function hd(e){e.data.datasets.forEach(e=>{md(e)})}function gd(e,t){let n=t.length,r=0,i,{iScale:a}=e,{min:o,max:s,minDefined:c,maxDefined:l}=a.getUserBounds();return c&&(r=J(ia(t,a.axis,o).lo,0,n-1)),i=l?J(ia(t,a.axis,s).hi+1,r,n)-r:n-r,{start:r,count:i}}var _d={id:`decimation`,defaults:{algorithm:`min-max`,enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){hd(e);return}let r=e.width;e.data.datasets.forEach((t,i)=>{let{_data:a,indexAxis:o}=t,s=e.getDatasetMeta(i),c=a||t.data;if(uo([o,e.options.indexAxis])===`y`||!s.controller.supportsDecimation)return;let l=e.scales[s.xAxisID];if(l.type!==`linear`&&l.type!==`time`||e.options.parsing)return;let{start:u,count:d}=gd(s,c);if(d<=(n.threshold||4*r)){md(t);return}L(a)&&(t._data=c,delete t.data,Object.defineProperty(t,`data`,{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}}));let f;switch(n.algorithm){case`lttb`:f=fd(c,u,d,r,n);break;case`min-max`:f=pd(c,u,d,r);break;default:throw Error(`Unsupported decimation algorithm '${n.algorithm}'`)}t._decimated=f})},destroy(e){hd(e)}};function vd(e,t,n){let r=e.segments,i=e.points,a=t.points,o=[];for(let e of r){let{start:r,end:s}=e;s=xd(r,s,i);let c=yd(n,i[r],i[s],e.loop);if(!t.segments){o.push({source:e,target:c,start:i[r],end:i[s]});continue}let l=vs(t,c);for(let t of l){let r=yd(n,a[t.start],a[t.end],t.loop),s=_s(e,i,r);for(let e of s)o.push({source:e,target:t,start:{[n]:Sd(c,r,`start`,Math.max)},end:{[n]:Sd(c,r,`end`,Math.min)}})}}return o}function yd(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e===`angle`&&(i=q(i),a=q(a)),{property:e,start:i,end:a}}function bd(e,t){let{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:e,end:t})=>{t=xd(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function xd(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function Sd(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Cd(e,t){let n=[],r=!1;return R(e)?(r=!0,n=e):n=bd(e,t),n.length?new $u({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function wd(e){return e&&e.fill!==!1}function Td(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!B(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function Ed(e,t,n){let r=Ad(e);if(z(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return B(i)&&Math.floor(i)===i?Dd(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function Dd(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Od(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:z(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function kd(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:z(e)?e.value:t.getBaseValue(),r}function Ad(e){let t=e.options,n=t.fill,r=V(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function jd(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Md(t,n);s.push(Cd({x:null,y:t.bottom},r));for(let e=0;e<a.length;e++){let t=a[e];for(let e=t.start;e<=t.end;e++)Nd(i,o[e],s)}return new $u({points:i,options:{}})}function Md(e,t){let n=[],r=e.getMatchingVisibleMetas(`line`);for(let e=0;e<r.length;e++){let i=r[e];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function Nd(e,t,n){let r=[];for(let i=0;i<n.length;i++){let a=n[i],{first:o,last:s,point:c}=Pd(a,t,`x`);if(!(!c||o&&s)){if(o)r.unshift(c);else if(e.push(c),!s)break}}e.push(...r)}function Pd(e,t,n){let r=e.interpolate(t,n);if(!r)return{};let i=r[n],a=e.segments,o=e.points,s=!1,c=!1;for(let e=0;e<a.length;e++){let t=a[e],r=o[t.start][n],l=o[t.end][n];if(na(i,r,l)){s=i===r,c=i===l;break}}return{first:s,last:c,point:r}}var Fd=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){let{x:r,y:i,radius:a}=this;return t||={start:0,end:G},e.arc(r,i,a,t.end,t.start,!0),!n.bounds}interpolate(e){let{x:t,y:n,radius:r}=this,i=e.angle;return{x:t+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}};function Id(e){let{chart:t,fill:n,line:r}=e;if(B(n))return Ld(t,n);if(n===`stack`)return jd(e);if(n===`shape`)return!0;let i=Rd(e);return i instanceof Fd?i:Cd(i,r)}function Ld(e,t){let n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Rd(e){return(e.scale||{}).getPointPositionForValue?Bd(e):zd(e)}function zd(e){let{scale:t={},fill:n}=e,r=Od(n,t);if(B(r)){let e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}function Bd(e){let{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=kd(n,t,a),s=[];if(r.grid.circular){let e=t.getPointPositionForValue(0,a);return new Fd({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(o)})}for(let e=0;e<i;++e)s.push(t.getPointPositionForValue(e,o));return s}function Vd(e,t,n){let r=Id(t),{chart:i,index:a,line:o,scale:s,axis:c}=t,l=o.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:p=d}=u||{},m=Os(i,i.getDatasetMeta(a));r&&o.points.length&&(Ja(e,n),Hd(e,{line:o,target:r,above:f,below:p,area:n,scale:s,axis:c,clip:m}),Ya(e))}function Hd(e,t){let{line:n,target:r,above:i,below:a,area:o,scale:s,clip:c}=t,l=n._loop?`angle`:t.axis;e.save();let u=a;a!==i&&(l===`x`?(Ud(e,r,o.top),Gd(e,{line:n,target:r,color:i,scale:s,property:l,clip:c}),e.restore(),e.save(),Ud(e,r,o.bottom)):l===`y`&&(Wd(e,r,o.left),Gd(e,{line:n,target:r,color:a,scale:s,property:l,clip:c}),e.restore(),e.save(),Wd(e,r,o.right),u=i)),Gd(e,{line:n,target:r,color:u,scale:s,property:l,clip:c}),e.restore()}function Ud(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[xd(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(l.x,n),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Wd(e,t,n){let{segments:r,points:i}=t,a=!0,o=!1;e.beginPath();for(let s of r){let{start:r,end:c}=s,l=i[r],u=i[xd(r,c,i)];a?(e.moveTo(l.x,l.y),a=!1):(e.lineTo(n,l.y),e.lineTo(l.x,l.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(n,u.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Gd(e,t){let{line:n,target:r,property:i,color:a,scale:o,clip:s}=t,c=vd(n,r,i);for(let{source:t,target:l,start:u,end:d}of c){let{style:{backgroundColor:c=a}={}}=t,f=r!==!0;e.save(),e.fillStyle=c,Kd(e,o,s,f&&yd(i,u,d)),e.beginPath();let p=!!n.pathSegment(e,t),m;if(f){p?e.closePath():qd(e,r,d,i);let t=!!r.pathSegment(e,l,{move:p,reverse:!0});m=p&&t,m||qd(e,r,u,i)}e.closePath(),e.fill(m?`evenodd`:`nonzero`),e.restore()}}function Kd(e,t,n,r){let i=t.chart.chartArea,{property:a,start:o,end:s}=r||{};if(a===`x`||a===`y`){let t,r,c,l;a===`x`?(t=o,r=i.top,c=s,l=i.bottom):(t=i.left,r=o,c=i.right,l=s),e.beginPath(),n&&(t=Math.max(t,n.left),c=Math.min(c,n.right),r=Math.max(r,n.top),l=Math.min(l,n.bottom)),e.rect(t,r,c-t,l-r),e.clip()}}function qd(e,t,n,r){let i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Jd={id:`filler`,afterDatasetsUpdate(e,t,n){let r=(e.data.datasets||[]).length,i=[],a,o,s,c;for(o=0;o<r;++o)a=e.getDatasetMeta(o),s=a.dataset,c=null,s&&s.options&&s instanceof $u&&(c={visible:e.isDatasetVisible(o),index:o,fill:Ed(s,o,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=c,i.push(c);for(o=0;o<r;++o)c=i[o],!(!c||c.fill===!1)&&(c.fill=Td(i,o,n.propagate))},beforeDraw(e,t,n){let r=n.drawTime===`beforeDraw`,i=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let t=i.length-1;t>=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&Vd(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;wd(n)&&Vd(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!wd(r)||n.drawTime!==`beforeDatasetDraw`||Vd(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Yd=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Xd=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Zd=class extends Sl{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=H(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=Q(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=Yd(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=Qd(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=ds(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=Y(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=Y(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=Y(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=Y(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;Ja(e,this),this._draw(),Ya(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=X.color,s=ds(e.rtl,this.left,this.width),c=Q(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=Yd(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=V(n.lineWidth,1);if(r.fillStyle=V(n.fillStyle,o),r.lineCap=V(n.lineCap,`butt`),r.lineDashOffset=V(n.lineDashOffset,0),r.lineJoin=V(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=V(n.strokeStyle,o),r.setLineDash(V(n.lineDash,[])),a.usePointStyle)Ka(r,{radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},s.xPlus(e,p/2),t+d,a.pointStyleWidth&&p);else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=lo(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?no(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){to(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:Y(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:Y(i,this.top+y+l,this.bottom-t[0].height),line:0},fs(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;if(s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=Y(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=Y(i,this.top+y+l,this.bottom-t[f.line].height)),g(s.x(S),C,o),S=ha(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=tf(o,e)+l}else f.y+=b}),ps(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=Q(t.font),r=Z(t.padding);if(!t.display)return;let i=ds(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=Y(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+Y(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=Y(o,u,u+d);a.textAlign=i.textAlign(ma(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,to(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=Q(e.font),n=Z(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(na(e,this.left,this.right)&&na(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],na(e,r.left,r.left+r.width)&&na(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!nf(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type===`mousemove`||e.type===`mouseout`){let r=this._hoveredItem,i=Xd(r,n);r&&!i&&H(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&H(t.onHover,[e,n,this],this)}else n&&H(t.onClick,[e,n,this],this)}};function Qd(e,t,n,r,i){return{itemWidth:$d(r,e,t,n),itemHeight:ef(i,r,t.lineHeight)}}function $d(e,t,n,r){let i=e.text;return i&&typeof i!=`string`&&(i=i.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function ef(e,t,n){let r=e;return typeof t.text!=`string`&&(r=tf(t,n)),r}function tf(e,t){return t*(e.text?e.text.length:0)}function nf(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var rf={id:`legend`,_element:Zd,start(e,t,n){let r=e.legend=new Zd({ctx:e.ctx,options:n,chart:e});$.configure(e,r,n),$.addBox(e,r)},stop(e){$.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;$.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=Z(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},af=class extends Sl{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=R(n.text)?n.text.length:1;this._padding=Z(n.padding);let i=r*Q(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){let e=this.options.position;return e===`top`||e===`bottom`}_drawArgs(e){let{top:t,left:n,bottom:r,right:i,options:a}=this,o=a.align,s=0,c,l,u;return this.isHorizontal()?(l=Y(o,n,i),u=t+e,c=i-n):(a.position===`left`?(l=n+e,u=Y(o,r,t),s=W*-.5):(l=i-e,u=Y(o,t,r),s=W*.5),c=r-t),{titleX:l,titleY:u,maxWidth:c,rotation:s}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=Q(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:o,rotation:s}=this._drawArgs(r);to(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:ma(t.align),textBaseline:`middle`,translation:[i,a]})}};function of(e,t){let n=new af({ctx:e.ctx,options:t,chart:e});$.configure(e,n,t),$.addBox(e,n),e.titleBlock=n}var sf={id:`title`,_element:af,start(e,t,n){of(e,n)},stop(e){let t=e.titleBlock;$.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;$.configure(e,r,n),r.options=n},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}},cf=new WeakMap,lf={id:`subtitle`,start(e,t,n){let r=new af({ctx:e.ctx,options:n,chart:e});$.configure(e,r,n),$.addBox(e,r),cf.set(e,r)},stop(e){$.removeBox(e,cf.get(e)),cf.delete(e)},beforeUpdate(e,t,n){let r=cf.get(e);$.configure(e,r,n),r.options=n},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}},uf={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=Qi(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function df(e,t){return t&&(R(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ff(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(`
3
+ `)>-1?e.split(`
4
+ `):e}function pf(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function mf(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=Q(t.bodyFont),l=Q(t.titleFont),u=Q(t.footerFont),d=a.length,f=i.length,p=r.length,m=Z(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,U(e.title,y),n.font=c.string,U(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,U(r,e=>{U(e.before,y),U(e.lines,y),U(e.after,y)}),v=0,n.font=u.string,U(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function hf(e,t){let{y:n,height:r}=t;return n<r/2?`top`:n>e.height-r/2?`bottom`:`center`}function gf(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function _f(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),gf(l,e,t,n)&&(l=`center`),l}function vf(e,t,n){let r=n.yAlign||t.yAlign||hf(e,n);return{xAlign:n.xAlign||t.xAlign||_f(e,t,n,r),yAlign:r}}function yf(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function bf(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:t===`bottom`?r-=i+n:r-=i/2,r}function xf(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=lo(o),m=yf(t,s),h=bf(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:J(m,0,r.width-t.width),y:J(h,0,r.height-t.height)}}function Sf(e,t,n){let r=Z(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function Cf(e){return df([],ff(e))}function wf(e,t,n){return po(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function Tf(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var Ef={beforeTitle:pi,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return``},afterTitle:pi,beforeBody:pi,beforeLabel:pi,label(e){if(this&&this.options&&this.options.mode===`dataset`)return e.label+`: `+e.formattedValue||e.formattedValue;let t=e.dataset.label||``;t&&(t+=`: `);let n=e.formattedValue;return L(n)||(t+=n),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:pi,afterBody:pi,beforeFooter:pi,footer:pi,afterFooter:pi};function Df(e,t,n,r){let i=e[t].call(n,r);return i===void 0?Ef[t].call(n,r):i}var Of=class extends Sl{static positioners=uf;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new Ns(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||=wf(this.chart.getContext(),this,this._tooltipItems)}getTitle(e,t){let{callbacks:n}=t,r=Df(n,`beforeTitle`,this,e),i=Df(n,`title`,this,e),a=Df(n,`afterTitle`,this,e),o=[];return o=df(o,ff(r)),o=df(o,ff(i)),o=df(o,ff(a)),o}getBeforeBody(e,t){return Cf(Df(t.callbacks,`beforeBody`,this,e))}getBody(e,t){let{callbacks:n}=t,r=[];return U(e,e=>{let t={before:[],lines:[],after:[]},i=Tf(n,e);df(t.before,ff(Df(i,`beforeLabel`,this,e))),df(t.lines,Df(i,`label`,this,e)),df(t.after,ff(Df(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return Cf(Df(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=Df(n,`beforeFooter`,this,e),i=Df(n,`footer`,this,e),a=Df(n,`afterFooter`,this,e),o=[];return o=df(o,ff(r)),o=df(o,ff(i)),o=df(o,ff(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;s<c;++s)o.push(pf(this.chart,t[s]));return e.filter&&(o=o.filter((t,r,i)=>e.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),U(o,t=>{let n=Tf(e.callbacks,t);r.push(Df(n,`labelColor`,this,t)),i.push(Df(n,`labelPointStyle`,this,t)),a.push(Df(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=uf[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=mf(this,n),o=Object.assign({},e,t),s=vf(this.chart,n,o),c=xf(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=lo(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=ds(n.rtl,this.x,this.width);for(e.x=Sf(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=Q(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<i;++s)t.fillText(r[s],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,r,i){let a=this.labelColors[n],o=this.labelPointStyles[n],{boxHeight:s,boxWidth:c}=i,l=Q(i.bodyFont),u=Sf(this,`left`,i),d=r.x(u),f=s<l.lineHeight?(l.lineHeight-s)/2:0,p=t.y+f;if(i.usePointStyle){let t={radius:Math.min(c,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},n=r.leftForLtr(d,c)+c/2,l=p+s/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Ga(e,t,n,l),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Ga(e,t,n,l)}else{e.lineWidth=z(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;let t=r.leftForLtr(d,c),n=r.leftForLtr(r.xPlus(d,1),c-2),o=lo(a.borderRadius);Object.values(o).some(e=>e!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,no(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),no(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=Q(n.bodyFont),d=u.lineHeight,f=0,p=ds(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=Sf(this,h,n),t.fillStyle=n.bodyColor,U(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y<x;++y){for(g=r[y],_=this.labelTextColors[y],t.fillStyle=_,U(g.before,m),v=g.lines,o&&v.length&&(this._drawColorBox(t,e,y,p,n),d=Math.max(u.lineHeight,s)),b=0,S=v.length;b<S;++b)m(v[b]),d=u.lineHeight;U(g.after,m)}f=0,d=u.lineHeight,U(this.afterBody,m),e.y-=i}drawFooter(e,t,n){let r=this.footer,i=r.length,a,o;if(i){let s=ds(n.rtl,this.x,this.width);for(e.x=Sf(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline=`middle`,a=Q(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,o=0;o<i;++o)t.fillText(r[o],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:a}=this,{x:o,y:s}=e,{width:c,height:l}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=lo(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+u,s),a===`top`&&this.drawCaret(e,t,n,r),t.lineTo(o+c-d,s),t.quadraticCurveTo(o+c,s,o+c,s+d),a===`center`&&i===`right`&&this.drawCaret(e,t,n,r),t.lineTo(o+c,s+l-p),t.quadraticCurveTo(o+c,s+l,o+c-p,s+l),a===`bottom`&&this.drawCaret(e,t,n,r),t.lineTo(o+f,s+l),t.quadraticCurveTo(o,s+l,o,s+l-f),a===`center`&&i===`left`&&this.drawCaret(e,t,n,r),t.lineTo(o,s+u),t.quadraticCurveTo(o,s,o+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=uf[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=mf(this,e),o=Object.assign({},n,this._size),s=vf(t,e,o),c=xf(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=Z(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),fs(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),ps(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!vi(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!vi(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=uf[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},kf={id:`tooltip`,_element:Of,positioners:uf,afterInit(e,t,n){n&&(e.tooltip=new Of({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:Ef},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},Af=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function jf(e,t,n,r){let i=e.indexOf(t);return i===-1?Af(e,t,n,r):i===e.lastIndexOf(t)?i:n}var Mf=(e,t)=>e===null?null:J(Math.round(e),0,t);function Nf(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var Pf=class extends Hl{static id=`category`;static defaults={ticks:{callback:Nf}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(L(e))return null;let n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:jf(n,e,V(t,e),this._addedLabels),Mf(t,n.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:n,max:r}=this.getMinMax(!0);this.options.bounds===`ticks`&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){let e=this.min,t=this.max,n=this.options.offset,r=[],i=this.getLabels();i=e===0&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return Nf.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!=`number`&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function Ff(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!L(a),_=!L(o),v=!L(c),y=(h-m)/(u+1),b=Hi((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=Hi(w*b/p/f)*f),L(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&Ki((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Vi(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(Xi(b),Xi(S));x=10**(L(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),S<a&&E++,Vi(Math.round((S+E*b)*x)/x,a,If(a,y,e))&&E++):S<a&&E++);E<w;++E){let e=Math.round((S+E*b)*x)/x;if(_&&e>o)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Vi(n[n.length-1].value,o,If(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function If(e,t,{horizontal:n,minRotation:r}){let i=Ji(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var Lf=class extends Hl{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return L(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=Bi(r),t=Bi(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=Ff({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&qi(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return ja(e,this.chart.options.locale,this.options.ticks.format)}},Rf=class extends Lf{static id=`linear`;static defaults={ticks:{callback:Pa.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=B(e)?e:0,this.max=B(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=Ji(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},zf=e=>Math.floor(zi(e)),Bf=(e,t)=>10**(zf(e)+t);function Vf(e){return e/10**zf(e)==1}function Hf(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Uf(e,t){let n=zf(t-e);for(;Hf(e,t,n)>10;)n++;for(;Hf(e,t,n)<10;)n--;return Math.min(n,zf(e))}function Wf(e,{min:t,max:n}){t=hi(e.min,t);let r=[],i=zf(t),a=Uf(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=hi(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f<n;)r.push({value:f,major:Vf(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=hi(e.max,f);return r.push({value:p,major:Vf(p),significand:d}),r}var Gf=class extends Hl{static id=`logarithmic`;static defaults={ticks:{callback:Pa.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=Lf.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return B(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=B(e)?Math.max(0,e):null,this.max=B(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!B(this._userMin)&&(this.min=e===Bf(this.min,0)?Bf(this.min,-1):Bf(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(Bf(n,-1)),a(Bf(r,1)))),n<=0&&i(Bf(r,-1)),r<=0&&a(Bf(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=Wf({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&qi(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:ja(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=zi(e),this._valueRange=zi(this.max)-zi(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(zi(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}};function Kf(e){let t=e.ticks;if(t.display&&e.display){let e=Z(t.backdropPadding);return V(t.font&&t.font.size,X.font.size)+e.height}return 0}function qf(e,t,n){return n=R(n)?n:[n],{w:Ha(e,t.string,n),h:n.length*t.lineHeight}}function Jf(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Yf(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?W/a:0;for(let c=0;c<a;c++){let a=o.setContext(e.getPointLabelContext(c));i[c]=a.padding;let l=e.getPointPosition(c,e.drawingArea+i[c],s),u=Q(a.font),d=qf(e.ctx,u,e._pointLabels[c]);r[c]=d;let f=q(e.getIndexAngle(c)+s),p=Math.round(Yi(f));Xf(n,t,f,Jf(p,l.x,d.w,0,180),Jf(p,l.y,d.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=$f(e,r,i)}function Xf(e,t,n,r,i){let a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=0,c=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(c=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function Zf(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(Yi(q(c.angle+K))),u=np(c.y,s.h,l),d=ep(l),f=tp(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function Qf(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(qa({x:n,y:r},t)||qa({x:n,y:a},t)||qa({x:i,y:r},t)||qa({x:i,y:a},t))}function $f(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:Kf(a)/2,additionalAngle:o?W/i:0},l;for(let a=0;a<i;a++){c.padding=n[a],c.size=t[a];let i=Zf(e,a,c);r.push(i),s===`auto`&&(i.visible=Qf(i,l),i.visible&&(l=i))}return r}function ep(e){return e===0||e===180?`center`:e<180?`left`:`right`}function tp(e,t,n){return n===`right`?e-=t:n===`center`&&(e-=t/2),e}function np(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function rp(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!L(s)){let n=lo(t.borderRadius),c=Z(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),no(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function ip(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));rp(n,a,t);let o=Q(a.font),{x:s,y:c,textAlign:l}=t;to(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function ap(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,G);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),i.lineTo(n.x,n.y)}}function op(e,t,n,r,i){let a=e.ctx,o=t.circular,{color:s,lineWidth:c}=t;!o&&!r||!s||!c||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=c,a.setLineDash(i.dash||[]),a.lineDashOffset=i.dashOffset,a.beginPath(),ap(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function sp(e,t,n){return po(e,{label:n,index:t,type:`pointLabel`})}var cp=class extends Lf{static id=`radialLinear`;static defaults={display:!0,animate:!0,position:`chartArea`,angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Pa.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":`borderColor`,"pointLabels.color":`color`,"ticks.color":`color`};static descriptors={angleLines:{_fallback:`grid`}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=Z(Kf(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=B(e)&&!isNaN(e)?e:0,this.max=B(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Kf(this.options))}generateTickLabels(e){Lf.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=H(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?Yf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=G/(this._pointLabels.length||1),n=this.options.startAngle||0;return q(e*t+Ji(n))}getDistanceFromCenterForValue(e){if(L(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(L(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let n=t[e];return sp(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-K+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),ap(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:n,grid:r,border:i}=t,a=this._pointLabels.length,o,s,c;if(t.pointLabels.display&&ip(this,a),r.display&&this.ticks.forEach((e,t)=>{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);op(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;!a||!i||(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=Q(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=Z(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}to(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}},lp={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}},up=Object.keys(lp);function dp(e,t){return e-t}function fp(e,t){if(L(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),B(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(Gi(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function pp(e,t,n,r){let i=up.length;for(let a=up.indexOf(e);a<i-1;++a){let e=lp[up[a]],i=e.steps?e.steps:2**53-1;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return up[a]}return up[i-1]}function mp(e,t,n,r,i){for(let a=up.length-1;a>=up.indexOf(n);a--){let n=up[a];if(lp[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return up[n?up.indexOf(n):0]}function hp(e){for(let t=up.indexOf(e)+1,n=up.length;t<n;++t)if(lp[up[t]].common)return up[t]}function gp(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:r,hi:i}=ra(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function _p(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function vp(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:_p(e,r,i,n)}var yp=class extends Hl{static id=`time`;static defaults={bounds:`data`,adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:`millisecond`,displayFormats:{}},ticks:{source:`auto`,callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit=`day`,this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){let n=e.time||={},r=this._adapter=new Dc._date(e.adapters.date);r.init(t),Ci(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:fp(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||`day`,{min:r,max:i,minDefined:a,maxDefined:o}=this.getUserBounds();function s(e){!a&&!isNaN(e.min)&&(r=Math.min(r,e.min)),!o&&!isNaN(e.max)&&(i=Math.max(i,e.max))}(!a||!o)&&(s(this._getLabelBounds()),(e.bounds!==`ticks`||e.ticks.source!==`labels`)&&s(this.getMinMax(!1))),r=B(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=B(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r=n.source===`labels`?this.getLabelTimestamps():this._generate();e.bounds===`ticks`&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,a=this.max,o=oa(r,i,a);return this._unit=t.unit||(n.autoSkip?pp(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):mp(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit===`year`?void 0:hp(this._unit),this.initOffsets(r),e.reverse&&o.reverse(),vp(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=J(t,0,a),n=J(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||pp(i.minUnit,t,n,this._getLabelCapacity(t)),o=V(r.ticks.stepSize,1),s=a===`week`?i.isoWeekday:!1,c=Gi(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+e.add(d,o,a),f++)gp(l,d,p);return(d===n||r.bounds===`ticks`||f===1)&&gp(l,d,p),Object.keys(l).sort(dp).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return H(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=Ji(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*a,h:n*a+o*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,vp(this,[e],this._majorUnit),r),a=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t<n;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,n;if(e.length)return e;let r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(fp(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return ua(e.sort(dp))}};function bp(e,t,n){let r=0,i=e.length-1,a,o,s,c;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ia(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ia(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}var xp=class extends yp{static id=`timeseries`;static defaults=yp.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=bp(t,this.min),this._tableRange=bp(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a<o;++a)c=e[a],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;a<o;++a)l=r[a+1],s=r[a-1],c=r[a],Math.round((l+s)/2)!==c&&i.push({time:c,pos:a/(o-1)});return i}_generate(){let e=this.min,t=this.max,n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(bp(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return bp(this._table,n*this._tableRange+this._minPos,!0)}},Sp=er(`<div part="container" class="chart-container svelte-3ok30t" id="chart-container"><canvas id="canvas" class="svelte-3ok30t"></canvas></div>`),Cp={hash:`svelte-3ok30t`,code:`@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host {font-family:"Roboto", sans-serif;width:100%;height:auto;}.chart-container.svelte-3ok30t {position:relative;margin:auto;width:100%;height:100%;overflow:hidden;}#canvas.svelte-3ok30t {margin:auto;display:block;max-width:100%;max-height:100%;width:100%;height:auto;}`};function wp(e,t){je(t,!0),pr(e,Cp);let n=t.$$host;Au.register(Bu,$u,dd,td,_c,vc,bc,xc,Cc,Sc,wc,Tc,Pf,Rf,Gf,cp,yp,xp,_d,Jd,rf,sf,kf,lf);function r(e,n){t.$$host.dispatchEvent(new CustomEvent(e,{detail:n}))}let i=mr(t,`id`,7,``),a=mr(t,`data`,7,void 0),o=null,s=!1,c=Ot(void 0);$t(()=>{a()&&typeof a()==`string`&&(a(JSON.parse(a())),u())});function l(e){let t=I(c)?.getElementsAtEventForMode(e,`nearest`,{intersect:!0},!0),n=[];if(t?.length)for(let e of t){let t=I(c)?.data?.labels?.[e.index],r=I(c)?.data.datasets[e.datasetIndex].data[e.index];n.push({label:t,value:r})}r(`chartClick`,n)}function u(){if(s&&a()&&n?.shadowRoot?.getElementById(`canvas`)){I(c)&&(I(c).destroy(),At(c,void 0));let e=n?.shadowRoot?.getElementById(`chart-container`),t=e?.clientWidth??0,r=e?.clientHeight??0,i=t>0&&r>0?t/r:void 0,o={responsive:!0,maintainAspectRatio:!0,...i?{aspectRatio:i}:{}};At(c,new Au(n?.shadowRoot?.getElementById(`canvas`),{type:a().type,data:a().data,options:{...a().options||{},...o}}),!0)}}let d=xr(()=>{console.log(`handleResize`);let e=I(c)?.canvas||void 0;if(!(!I(c)||!e||!e.isConnected))try{u()}catch(e){console.warn(`Chart resize failed`,e)}},100);ur(()=>{s=!0,n?.shadowRoot?.getElementById(`chart-container`)&&(o=new ResizeObserver(()=>{d()}),o.observe(n.shadowRoot.getElementById(`chart-container`))),window.addEventListener(`resize`,d),u()}),dr(()=>{console.log(`onDestroy`),window.removeEventListener(`resize`,d),o&&=(o.disconnect(),null),I(c)&&(I(c).destroy(),At(c,void 0))});var f={get id(){return i()},set id(e=``){i(e),nt()},get data(){return a()},set data(e=void 0){a(e),nt()}},p=Sp(),m=Wt(p),h=gt(()=>xr(l,200));return Se(p),Kn(`click`,m,function(...e){I(h)?.apply(this,e)}),tr(e,p),Me(f)}qn([`click`]),customElements.define(`hb-chartjs`,br(wp,{id:{},data:{}},[],[],{mode:`open`})),e.Component=wp})(this.chartjs=this.chartjs||{});
5
+ //# sourceMappingURL=main.iife.js.map