@htmlbricks/hb-chartjs 0.20.18 → 0.50.0-alpha.8

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 ADDED
@@ -0,0 +1,18 @@
1
+ var Uf=Object.defineProperty;var Ca=N=>{throw TypeError(N)};var Xf=(N,H,G)=>H in N?Uf(N,H,{enumerable:!0,configurable:!0,writable:!0,value:G}):N[H]=G;var w=(N,H,G)=>Xf(N,typeof H!="symbol"?H+"":H,G),Ta=(N,H,G)=>H.has(N)||Ca("Cannot "+G);var lt=(N,H,G)=>(Ta(N,H,"read from private field"),G?G.call(N):H.get(N)),ys=(N,H,G)=>H.has(N)?Ca("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(N):H.set(N,G),vs=(N,H,G,ci)=>(Ta(N,H,"write to private field"),ci?ci.call(N,G):H.set(N,G),G);(function(N){"use strict";var Bt,_t,mn;const H="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(H);const G=2,ci="[",Ea="]",Ee={},ct=Symbol(),_n=!1,xt=2,ws=4,Ms=8,ks=16,Nt=32,ge=64,hi=128,gt=256,ui=512,pt=1024,Vt=2048,pe=4096,di=8192,fi=16384,La=32768,Ra=65536,Fa=1<<19,Ss=1<<20,xn=Symbol("$state"),Ia=Symbol("legacy props");var Ps=Array.isArray,za=Array.prototype.indexOf,$a=Array.from,gi=Object.keys,pi=Object.defineProperty,me=Object.getOwnPropertyDescriptor,Ba=Object.prototype,Na=Array.prototype,Va=Object.getPrototypeOf;function Wa(i){for(var t=0;t<i.length;t++)i[t]()}let mi=!1,yn=[];function Ds(){mi=!1;const i=yn.slice();yn=[],Wa(i)}function Ha(i){mi||(mi=!0,queueMicrotask(Ds)),yn.push(i)}function ja(){mi&&Ds()}function Os(i){return i===this.v}function Ya(i,t){return i!=i?t==t:i!==t||i!==null&&typeof i=="object"||typeof i=="function"}function Ua(i){return!Ya(i,this.v)}function Xa(i){throw new Error("https://svelte.dev/e/effect_in_teardown")}function qa(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ka(i){throw new Error("https://svelte.dev/e/effect_orphan")}function Ga(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Za(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ja(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Qa(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function tl(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function el(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let il=!1;function Mt(i,t){var e={f:0,v:i,reactions:null,equals:Os,rv:0,wv:0};return e}function nl(i){return sl(Mt(i))}function As(i,t=!1){const e=Mt(i);return t||(e.equals=Ua),e}function sl(i){return F!==null&&!kt&&F.f&xt&&(St===null?dl([i]):St.push(i)),i}function mt(i,t){return F!==null&&!kt&&ro()&&F.f&(xt|ks)&&(St===null||!St.includes(i))&&el(),ol(i,t)}function ol(i,t){return i.equals(t)||(i.v,i.v=t,i.wv=Ys(),Cs(i,Vt),z!==null&&z.f&pt&&!(z.f&(Nt|ge))&&(At===null?fl([i]):At.push(i))),t}function Cs(i,t){var e=i.reactions;if(e!==null)for(var n=e.length,s=0;s<n;s++){var o=e[s],r=o.f;r&Vt||(jt(o,t),r&(pt|gt)&&(r&xt?Cs(o,pe):Sn(o)))}}function Ts(i){var t=xt|Vt,e=F!==null&&F.f&xt?F:null;return z===null||e!==null&&e.f&gt?t|=gt:z.f|=Ss,{ctx:ot,deps:null,effects:null,equals:Os,f:t,fn:i,reactions:null,rv:0,v:null,wv:0,parent:e??z}}function Es(i){var t=i.effects;if(t!==null){i.effects=null;for(var e=0;e<t.length;e+=1)Yt(t[e])}}function rl(i){for(var t=i.parent;t!==null;){if(!(t.f&xt))return t;t=t.parent}return null}function al(i){var t,e=z;ve(rl(i));try{Es(i),t=Xs(i)}finally{ve(e)}return t}function Ls(i){var t=al(i),e=(Ht||i.f&gt)&&i.deps!==null?pe:pt;jt(i,e),i.equals(t)||(i.v=t,i.wv=Ys())}function vn(i){console.warn("https://svelte.dev/e/hydration_mismatch")}let Wt=!1;function bi(i){Wt=i}let st;function _i(i){if(i===null)throw vn(),Ee;return st=i}function Rs(){return _i(yi(st))}function ll(i){if(Wt){if(yi(st)!==null)throw vn(),Ee;st=i}}function be(i,t=null,e){if(typeof i!="object"||i===null||xn in i)return i;const n=Va(i);if(n!==Ba&&n!==Na)return i;var s=new Map,o=Ps(i),r=Mt(0);o&&s.set("length",Mt(i.length));var a;return new Proxy(i,{defineProperty(l,c,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&Ja();var u=s.get(c);return u===void 0?(u=Mt(h.value),s.set(c,u)):mt(u,be(h.value,a)),!0},deleteProperty(l,c){var h=s.get(c);if(h===void 0)c in l&&s.set(c,Mt(ct));else{if(o&&typeof c=="string"){var u=s.get("length"),d=Number(c);Number.isInteger(d)&&d<u.v&&mt(u,d)}mt(h,ct),Fs(r)}return!0},get(l,c,h){var g;if(c===xn)return i;var u=s.get(c),d=c in l;if(u===void 0&&(!d||(g=me(l,c))!=null&&g.writable)&&(u=Mt(be(d?l[c]:ct,a)),s.set(c,u)),u!==void 0){var f=J(u);return f===ct?void 0:f}return Reflect.get(l,c,h)},getOwnPropertyDescriptor(l,c){var h=Reflect.getOwnPropertyDescriptor(l,c);if(h&&"value"in h){var u=s.get(c);u&&(h.value=J(u))}else if(h===void 0){var d=s.get(c),f=d==null?void 0:d.v;if(d!==void 0&&f!==ct)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return h},has(l,c){var f;if(c===xn)return!0;var h=s.get(c),u=h!==void 0&&h.v!==ct||Reflect.has(l,c);if(h!==void 0||z!==null&&(!u||(f=me(l,c))!=null&&f.writable)){h===void 0&&(h=Mt(u?be(l[c],a):ct),s.set(c,h));var d=J(h);if(d===ct)return!1}return u},set(l,c,h,u){var y;var d=s.get(c),f=c in l;if(o&&c==="length")for(var g=h;g<d.v;g+=1){var p=s.get(g+"");p!==void 0?mt(p,ct):g in l&&(p=Mt(ct),s.set(g+"",p))}d===void 0?(!f||(y=me(l,c))!=null&&y.writable)&&(d=Mt(void 0),mt(d,be(h,a)),s.set(c,d)):(f=d.v!==ct,mt(d,be(h,a)));var m=Reflect.getOwnPropertyDescriptor(l,c);if(m!=null&&m.set&&m.set.call(u,h),!f){if(o&&typeof c=="string"){var b=s.get("length"),_=Number(c);Number.isInteger(_)&&_>=b.v&&mt(b,_+1)}Fs(r)}return!0},ownKeys(l){J(r);var c=Reflect.ownKeys(l).filter(d=>{var f=s.get(d);return f===void 0||f.v!==ct});for(var[h,u]of s)u.v!==ct&&!(h in l)&&c.push(h);return c},setPrototypeOf(){Qa()}})}function Fs(i,t=1){mt(i,i.v+t)}var Is,zs,$s,Bs;function wn(){if(Is===void 0){Is=window,zs=/Firefox/.test(navigator.userAgent);var i=Element.prototype,t=Node.prototype;$s=me(t,"firstChild").get,Bs=me(t,"nextSibling").get,i.__click=void 0,i.__className="",i.__attributes=null,i.__styles=null,i.__e=void 0,Text.prototype.__t=void 0}}function Ns(i=""){return document.createTextNode(i)}function xi(i){return $s.call(i)}function yi(i){return Bs.call(i)}function cl(i,t){if(!Wt)return xi(i);var e=xi(st);return e===null&&(e=st.appendChild(Ns())),_i(e),e}function hl(i){i.textContent=""}const Vs=0,ul=1;let vi=!1,wi=Vs,Le=!1,Re=null,_e=!1,Mn=!1;function Ws(i){_e=i}function Hs(i){Mn=i}let te=[],xe=0,qf=[],F=null,kt=!1;function ye(i){F=i}let z=null;function ve(i){z=i}let St=null;function dl(i){St=i}let nt=null,ht=0,At=null;function fl(i){At=i}let js=1,Mi=0,Ht=!1;function Ys(){return++js}function ki(i){var u;var t=i.f;if(t&Vt)return!0;if(t&pe){var e=i.deps,n=(t&gt)!==0;if(e!==null){var s,o,r=(t&ui)!==0,a=n&&z!==null&&!Ht,l=e.length;if(r||a){var c=i,h=c.parent;for(s=0;s<l;s++)o=e[s],(r||!((u=o==null?void 0:o.reactions)!=null&&u.includes(c)))&&(o.reactions??(o.reactions=[])).push(c);r&&(c.f^=ui),a&&h!==null&&!(h.f&gt)&&(c.f^=gt)}for(s=0;s<l;s++)if(o=e[s],ki(o)&&Ls(o),o.wv>i.wv)return!0}(!n||z!==null&&!Ht)&&jt(i,pt)}return!1}function gl(i,t){for(var e=t;e!==null;){if(e.f&hi)try{e.fn(i);return}catch{e.f^=hi}e=e.parent}throw vi=!1,i}function pl(i){return(i.f&fi)===0&&(i.parent===null||(i.parent.f&hi)===0)}function Si(i,t,e,n){if(vi){if(e===null&&(vi=!1),pl(t))throw i;return}e!==null&&(vi=!0);{gl(i,t);return}}function Us(i,t,e=!0){var n=i.reactions;if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];o.f&xt?Us(o,t,!1):t===o&&(e?jt(o,Vt):o.f&pt&&jt(o,pe),Sn(o))}}function Xs(i){var f;var t=nt,e=ht,n=At,s=F,o=Ht,r=St,a=ot,l=kt,c=i.f;nt=null,ht=0,At=null,F=c&(Nt|ge)?null:i,Ht=(c&gt)!==0&&(!_e||s===null||l),St=null,no(i.ctx),kt=!1,Mi++;try{var h=(0,i.fn)(),u=i.deps;if(nt!==null){var d;if(Pi(i,ht),u!==null&&ht>0)for(u.length=ht+nt.length,d=0;d<nt.length;d++)u[ht+d]=nt[d];else i.deps=u=nt;if(!Ht)for(d=ht;d<u.length;d++)((f=u[d]).reactions??(f.reactions=[])).push(i)}else u!==null&&ht<u.length&&(Pi(i,ht),u.length=ht);if(ro()&&At!==null&&!kt&&u!==null&&!(i.f&(xt|pe|Vt)))for(d=0;d<At.length;d++)Us(At[d],i);return s!==null&&Mi++,h}finally{nt=t,ht=e,At=n,F=s,Ht=o,St=r,no(a),kt=l}}function ml(i,t){let e=t.reactions;if(e!==null){var n=za.call(e,i);if(n!==-1){var s=e.length-1;s===0?e=t.reactions=null:(e[n]=e[s],e.pop())}}e===null&&t.f&xt&&(nt===null||!nt.includes(t))&&(jt(t,pe),t.f&(gt|ui)||(t.f^=ui),Es(t),Pi(t,0))}function Pi(i,t){var e=i.deps;if(e!==null)for(var n=t;n<e.length;n++)ml(i,e[n])}function kn(i){var t=i.f;if(!(t&fi)){jt(i,pt);var e=z,n=ot;z=i;try{t&ks?Dl(i):to(i),Qs(i);var s=Xs(i);i.teardown=typeof s=="function"?s:null,i.wv=js;var o=i.deps,r;_n&&il&&i.f&Vt}catch(a){Si(a,i,e,n||i.ctx)}finally{z=e}}}function qs(){if(xe>1e3){xe=0;try{Ga()}catch(i){if(Re!==null)Si(i,Re,null);else throw i}}xe++}function Ks(i){var t=i.length;if(t!==0){qs();var e=_e;_e=!0;try{for(var n=0;n<t;n++){var s=i[n];s.f&pt||(s.f^=pt);var o=xl(s);bl(o)}}finally{_e=e}}}function bl(i){var t=i.length;if(t!==0)for(var e=0;e<t;e++){var n=i[e];if(!(n.f&(fi|di)))try{ki(n)&&(kn(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?eo(n):n.fn=null))}catch(s){Si(s,n,null,n.ctx)}}}function _l(){if(Le=!1,xe>1001)return;const i=te;te=[],Ks(i),Le||(xe=0,Re=null)}function Sn(i){wi===Vs&&(Le||(Le=!0,queueMicrotask(_l))),Re=i;for(var t=i;t.parent!==null;){t=t.parent;var e=t.f;if(e&(ge|Nt)){if(!(e&pt))return;t.f^=pt}}te.push(t)}function xl(i){var t=[],e=i.first;t:for(;e!==null;){var n=e.f,s=(n&Nt)!==0,o=s&&(n&pt)!==0,r=e.next;if(!o&&!(n&di)){if(n&ws)t.push(e);else if(s)e.f^=pt;else{var a=F;try{F=e,ki(e)&&kn(e)}catch(h){Si(h,e,null,e.ctx)}finally{F=a}}var l=e.first;if(l!==null){e=l;continue}}if(r===null){let h=e.parent;for(;h!==null;){if(i===h)break t;var c=h.next;if(c!==null){e=c;continue t}h=h.parent}}e=r}return t}function Di(i){var t=wi,e=te;try{qs();const s=[];wi=ul,te=s,Le=!1,Ks(e);var n=i==null?void 0:i();return ja(),(te.length>0||s.length>0)&&Di(),xe=0,Re=null,n}finally{wi=t,te=e}}function J(i){var t=i.f,e=(t&xt)!==0;if(F!==null&&!kt){St!==null&&St.includes(i)&&tl();var n=F.deps;i.rv<Mi&&(i.rv=Mi,nt===null&&n!==null&&n[ht]===i?ht++:nt===null?nt=[i]:(!Ht||!nt.includes(i))&&nt.push(i))}else if(e&&i.deps===null&&i.effects===null){var s=i,o=s.parent;o!==null&&!(o.f&gt)&&(s.f^=gt)}return e&&(s=i,ki(s)&&Ls(s)),i.v}function Gs(i){var t=kt;try{return kt=!0,i()}finally{kt=t}}const yl=-7169;function jt(i,t){i.f=i.f&yl|t}function vl(i){z===null&&F===null&&Ka(),F!==null&&F.f&gt&&z===null&&qa(),Mn&&Xa()}function wl(i,t){var e=t.last;e===null?t.last=t.first=i:(e.next=i,i.prev=e,t.last=i)}function Fe(i,t,e,n=!0){var s=(i&ge)!==0,o=z,r={ctx:ot,deps:null,nodes_start:null,nodes_end:null,f:i|Vt,first:null,fn:t,last:null,next:null,parent:s?null:o,prev:null,teardown:null,transitions:null,wv:0};if(e){var a=_e;try{Ws(!0),kn(r),r.f|=La}catch(h){throw Yt(r),h}finally{Ws(a)}}else t!==null&&Sn(r);var l=e&&r.deps===null&&r.first===null&&r.nodes_start===null&&r.teardown===null&&(r.f&(Ss|hi))===0;if(!l&&!s&&n&&(o!==null&&wl(r,o),F!==null&&F.f&xt)){var c=F;(c.effects??(c.effects=[])).push(r)}return r}function Zs(i){vl();var t=z!==null&&(z.f&Nt)!==0&&ot!==null&&!ot.m;if(t){var e=ot;(e.e??(e.e=[])).push({fn:i,effect:z,reaction:F})}else{var n=Js(i);return n}}function Ml(i){const t=Fe(ge,i,!0);return()=>{Yt(t)}}function kl(i){const t=Fe(ge,i,!0);return(e={})=>new Promise(n=>{e.outro?Ol(t,()=>{Yt(t),n(void 0)}):(Yt(t),n(void 0))})}function Js(i){return Fe(ws,i,!1)}function Sl(i){return Fe(Ms,i,!0)}function Pl(i,t=!0){return Fe(Ms|Nt,i,!0,t)}function Qs(i){var t=i.teardown;if(t!==null){const e=Mn,n=F;Hs(!0),ye(null);try{t.call(null)}finally{Hs(e),ye(n)}}}function to(i,t=!1){var e=i.first;for(i.first=i.last=null;e!==null;){var n=e.next;Yt(e,t),e=n}}function Dl(i){for(var t=i.first;t!==null;){var e=t.next;t.f&Nt||Yt(t),t=e}}function Yt(i,t=!0){var e=!1;if((t||i.f&Fa)&&i.nodes_start!==null){for(var n=i.nodes_start,s=i.nodes_end;n!==null;){var o=n===s?null:yi(n);n.remove(),n=o}e=!0}to(i,t&&!e),Pi(i,0),jt(i,fi);var r=i.transitions;if(r!==null)for(const l of r)l.stop();Qs(i);var a=i.parent;a!==null&&a.first!==null&&eo(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.fn=i.nodes_start=i.nodes_end=null}function eo(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 Ol(i,t){var e=[];io(i,e,!0),Al(e,()=>{Yt(i),t&&t()})}function Al(i,t){var e=i.length;if(e>0){var n=()=>--e||t();for(var s of i)s.out(n)}else t()}function io(i,t,e){if(!(i.f&di)){if(i.f^=di,i.transitions!==null)for(const r of i.transitions)(r.is_global||e)&&t.push(r);for(var n=i.first;n!==null;){var s=n.next,o=(n.f&Ra)!==0||(n.f&Nt)!==0;io(n,t,o?e:!1),n=s}}}function Cl(i){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let ot=null;function no(i){ot=i}function so(i,t=!1,e){ot={p:ot,c:null,e:null,m:!1,s:i,x:null,l:null}}function oo(i){const t=ot;if(t!==null){i!==void 0&&(t.x=i);const r=t.e;if(r!==null){var e=z,n=F;t.e=null;try{for(var s=0;s<r.length;s++){var o=r[s];ve(o.effect),ye(o.reaction),Js(o.fn)}}finally{ve(e),ye(n)}}ot=t.p,t.m=!0}return i||{}}function ro(){return!0}const Tl=["touchstart","touchmove"];function El(i){return Tl.includes(i)}const ao=new Set,Pn=new Set;function Ll(i){for(var t=0;t<i.length;t++)ao.add(i[t]);for(var e of Pn)e(i)}function Oi(i){var _;var t=this,e=t.ownerDocument,n=i.type,s=((_=i.composedPath)==null?void 0:_.call(i))||[],o=s[0]||i.target,r=0,a=i.__root;if(a){var l=s.indexOf(a);if(l!==-1&&(t===document||t===window)){i.__root=t;return}var c=s.indexOf(t);if(c===-1)return;l<=c&&(r=l)}if(o=s[r]||i.target,o!==t){pi(i,"currentTarget",{configurable:!0,get(){return o||e}});var h=F,u=z;ye(null),ve(null);try{for(var d,f=[];o!==null;){var g=o.assignedSlot||o.parentNode||o.host||null;try{var p=o["__"+n];if(p!==void 0&&!o.disabled)if(Ps(p)){var[m,...b]=p;m.apply(o,[i,...b])}else p.call(o,i)}catch(y){d?f.push(y):d=y}if(i.cancelBubble||g===t||g===null)break;o=g}if(d){for(let y of f)queueMicrotask(()=>{throw y});throw d}}finally{i.__root=t,delete i.currentTarget,ye(h),ve(u)}}}function Rl(i){var t=document.createElement("template");return t.innerHTML=i,t.content}function Dn(i,t){var e=z;e.nodes_start===null&&(e.nodes_start=i,e.nodes_end=t)}function Fl(i,t){var e=(t&G)!==0,n,s=!i.startsWith("<!>");return()=>{if(Wt)return Dn(st,null),st;n===void 0&&(n=Rl(s?i:"<!>"+i),n=xi(n));var o=e||zs?document.importNode(n,!0):n.cloneNode(!0);return Dn(o,o),o}}function lo(i,t){if(Wt){z.nodes_end=st,Rs();return}i!==null&&i.before(t)}function co(i,t){return ho(i,t)}function Il(i,t){wn(),t.intro=t.intro??!1;const e=t.target,n=Wt,s=st;try{for(var o=xi(e);o&&(o.nodeType!==8||o.data!==ci);)o=yi(o);if(!o)throw Ee;bi(!0),_i(o),Rs();const r=ho(i,{...t,anchor:o});if(st===null||st.nodeType!==8||st.data!==Ea)throw vn(),Ee;return bi(!1),r}catch(r){if(r===Ee)return t.recover===!1&&Za(),wn(),hl(e),bi(!1),co(i,t);throw r}finally{bi(n),_i(s)}}const we=new Map;function ho(i,{target:t,anchor:e,props:n={},events:s,context:o,intro:r=!0}){wn();var a=new Set,l=u=>{for(var d=0;d<u.length;d++){var f=u[d];if(!a.has(f)){a.add(f);var g=El(f);t.addEventListener(f,Oi,{passive:g});var p=we.get(f);p===void 0?(document.addEventListener(f,Oi,{passive:g}),we.set(f,1)):we.set(f,p+1)}}};l($a(ao)),Pn.add(l);var c=void 0,h=kl(()=>{var u=e??t.appendChild(Ns());return Pl(()=>{if(o){so({});var d=ot;d.c=o}s&&(n.$$events=s),Wt&&Dn(u,null),c=i(u,n)||{},Wt&&(z.nodes_end=st),o&&oo()}),()=>{var g;for(var d of a){t.removeEventListener(d,Oi);var f=we.get(d);--f===0?(document.removeEventListener(d,Oi),we.delete(d)):we.set(d,f)}Pn.delete(l),u!==e&&((g=u.parentNode)==null||g.removeChild(u))}});return On.set(c,h),c}let On=new WeakMap;function zl(i,t){const e=On.get(i);return e?(On.delete(i),e(t)):Promise.resolve()}function $l(i,t){Ha(()=>{var e=i.getRootNode(),n=e.host?e:e.head??e.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const s=document.createElement("style");s.id=t.hash,s.textContent=t.code,n.appendChild(s)}})}function Bl(i){ot===null&&Cl(),Zs(()=>{const t=Gs(i);if(typeof t=="function")return t})}function uo(i,t,e,n){var s;s=i[t];var o=n,r=!0,a=!1,l=()=>(a=!0,r&&(r=!1,o=n),o);s===void 0&&n!==void 0&&(s=l());var c;c=()=>{var f=i[t];return f===void 0?l():(r=!0,a=!1,f)};var h=!1,u=As(s),d=Ts(()=>{var f=c(),g=J(u);return h?(h=!1,g):u.v=f});return function(f,g){if(arguments.length>0){const p=g?J(d):f;return d.equals(p)||(h=!0,mt(u,p),a&&o!==void 0&&(o=p),Gs(()=>J(d))),f}return J(d)}}function Nl(i){return new Vl(i)}class Vl{constructor(t){ys(this,Bt);ys(this,_t);var o;var e=new Map,n=(r,a)=>{var l=As(a);return e.set(r,l),l};const s=new Proxy({...t.props||{},$$events:{}},{get(r,a){return J(e.get(a)??n(a,Reflect.get(r,a)))},has(r,a){return a===Ia?!0:(J(e.get(a)??n(a,Reflect.get(r,a))),Reflect.has(r,a))},set(r,a,l){return mt(e.get(a)??n(a,l),l),Reflect.set(r,a,l)}});vs(this,_t,(t.hydrate?Il:co)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((o=t==null?void 0:t.props)!=null&&o.$$host)||t.sync===!1)&&Di(),vs(this,Bt,s.$$events);for(const r of Object.keys(lt(this,_t)))r==="$set"||r==="$destroy"||r==="$on"||pi(this,r,{get(){return lt(this,_t)[r]},set(a){lt(this,_t)[r]=a},enumerable:!0});lt(this,_t).$set=r=>{Object.assign(s,r)},lt(this,_t).$destroy=()=>{zl(lt(this,_t))}}$set(t){lt(this,_t).$set(t)}$on(t,e){lt(this,Bt)[t]=lt(this,Bt)[t]||[];const n=(...s)=>e.call(this,...s);return lt(this,Bt)[t].push(n),()=>{lt(this,Bt)[t]=lt(this,Bt)[t].filter(s=>s!==n)}}$destroy(){lt(this,_t).$destroy()}}Bt=new WeakMap,_t=new WeakMap;let fo;typeof HTMLElement=="function"&&(fo=class extends HTMLElement{constructor(t,e,n){super();w(this,"$$ctor");w(this,"$$s");w(this,"$$c");w(this,"$$cn",!1);w(this,"$$d",{});w(this,"$$r",!1);w(this,"$$p_d",{});w(this,"$$l",{});w(this,"$$l_u",new Map);w(this,"$$me");this.$$ctor=t,this.$$s=e,n&&this.attachShadow({mode:"open"})}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const s=this.$$c.$on(t,e);this.$$l_u.set(e,s)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const s=this.$$l_u.get(e);s&&(s(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(s){return o=>{const r=document.createElement("slot");s!=="default"&&(r.name=s),lo(o,r)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},n=Wl(this);for(const s of this.$$s)s in n&&(s==="default"&&!this.$$d.children?(this.$$d.children=t(s),e.default=!0):e[s]=t(s));for(const s of this.attributes){const o=this.$$g_p(s.name);o in this.$$d||(this.$$d[o]=Ai(o,s.value,this.$$p_d,"toProp"))}for(const s in this.$$p_d)!(s in this.$$d)&&this[s]!==void 0&&(this.$$d[s]=this[s],delete this[s]);this.$$c=Nl({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=Ml(()=>{Sl(()=>{var s;this.$$r=!0;for(const o of gi(this.$$c)){if(!((s=this.$$p_d[o])!=null&&s.reflect))continue;this.$$d[o]=this.$$c[o];const r=Ai(o,this.$$d[o],this.$$p_d,"toAttribute");r==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,r)}this.$$r=!1})});for(const s in this.$$l)for(const o of this.$$l[s]){const r=this.$$c.$on(s,o);this.$$l_u.set(o,r)}this.$$l={}}}attributeChangedCallback(t,e,n){var s;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Ai(t,n,this.$$p_d,"toProp"),(s=this.$$c)==null||s.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return gi(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Ai(i,t,e,n){var o;const s=(o=e[i])==null?void 0:o.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 Wl(i){const t={};return i.childNodes.forEach(e=>{t[e.slot||"default"]=!0}),t}function Hl(i,t,e,n,s,o){let r=class extends fo{constructor(){super(i,e,s),this.$$p_d=t}static get observedAttributes(){return gi(t).map(a=>(t[a].attribute||a).toLowerCase())}};return gi(t).forEach(a=>{pi(r.prototype,a,{get(){return this.$$c&&a in this.$$c?this.$$c[a]:this.$$d[a]},set(l){var u;l=Ai(a,l,t),this.$$d[a]=l;var c=this.$$c;if(c){var h=(u=me(c,a))==null?void 0:u.get;h?c[a]=l:c.$set({[a]:l})}}})}),n.forEach(a=>{pi(r.prototype,a,{get(){var l;return(l=this.$$c)==null?void 0:l[a]}})}),i.element=r,r}function jl(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ci={exports:{}},go;function Yl(){if(go)return Ci.exports;go=1;function i(t,e=100,n={}){if(typeof t!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(e<0)throw new RangeError("`wait` must not be negative.");const{immediate:s}=typeof n=="boolean"?{immediate:n}:n;let o,r,a,l,c;function h(){const f=o,g=r;return o=void 0,r=void 0,c=t.apply(f,g),c}function u(){const f=Date.now()-l;f<e&&f>=0?a=setTimeout(u,e-f):(a=void 0,s||(c=h()))}const d=function(...f){if(o&&this!==o&&Object.getPrototypeOf(this)===Object.getPrototypeOf(o))throw new Error("Debounced method called with different contexts of the same prototype.");o=this,r=f,l=Date.now();const g=s&&!a;return a||(a=setTimeout(u,e)),g&&(c=h()),c};return Object.defineProperty(d,"isPending",{get(){return a!==void 0}}),d.clear=()=>{a&&(clearTimeout(a),a=void 0)},d.flush=()=>{a&&d.trigger()},d.trigger=()=>{c=h(),d.clear()},d}return Ci.exports.debounce=i,Ci.exports=i,Ci.exports}var Ul=Yl();const Xl=jl(Ul);/*!
2
+ * @kurkle/color v0.3.4
3
+ * https://github.com/kurkle/color#readme
4
+ * (c) 2024 Jukka Kurkela
5
+ * Released under the MIT License
6
+ */function Ie(i){return i+.5|0}const Ut=(i,t,e)=>Math.max(Math.min(i,e),t);function ze(i){return Ut(Ie(i*2.55),0,255)}function Xt(i){return Ut(Ie(i*255),0,255)}function Ct(i){return Ut(Ie(i/2.55)/100,0,1)}function po(i){return Ut(Ie(i*100),0,100)}const bt={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},An=[..."0123456789ABCDEF"],ql=i=>An[i&15],Kl=i=>An[(i&240)>>4]+An[i&15],Ti=i=>(i&240)>>4===(i&15),Gl=i=>Ti(i.r)&&Ti(i.g)&&Ti(i.b)&&Ti(i.a);function Zl(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&bt[i[1]]*17,g:255&bt[i[2]]*17,b:255&bt[i[3]]*17,a:t===5?bt[i[4]]*17:255}:(t===7||t===9)&&(e={r:bt[i[1]]<<4|bt[i[2]],g:bt[i[3]]<<4|bt[i[4]],b:bt[i[5]]<<4|bt[i[6]],a:t===9?bt[i[7]]<<4|bt[i[8]]:255})),e}const Jl=(i,t)=>i<255?t(i):"";function Ql(i){var t=Gl(i)?ql:Kl;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Jl(i.a,t):void 0}const tc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function mo(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 ec(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 ic(i,t,e){const n=mo(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 nc(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 Cn(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=nc(e,n,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Tn(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(Xt)}function En(i,t,e){return Tn(mo,i,t,e)}function sc(i,t,e){return Tn(ic,i,t,e)}function oc(i,t,e){return Tn(ec,i,t,e)}function bo(i){return(i%360+360)%360}function rc(i){const t=tc.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?ze(+t[5]):Xt(+t[5]));const s=bo(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=sc(s,o,r):t[1]==="hsv"?n=oc(s,o,r):n=En(s,o,r),{r:n[0],g:n[1],b:n[2],a:e}}function ac(i,t){var e=Cn(i);e[0]=bo(e[0]+t),e=En(e),i.r=e[0],i.g=e[1],i.b=e[2]}function lc(i){if(!i)return;const t=Cn(i),e=t[0],n=po(t[1]),s=po(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${Ct(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const _o={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"},xo={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 cc(){const i={},t=Object.keys(xo),e=Object.keys(_o);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,_o[o]);o=parseInt(xo[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let Ei;function hc(i){Ei||(Ei=cc(),Ei.transparent=[0,0,0,0]);const t=Ei[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const uc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function dc(i){const t=uc.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const r=+t[7];e=t[8]?ze(r):Ut(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?ze(n):Ut(n,0,255)),s=255&(t[4]?ze(s):Ut(s,0,255)),o=255&(t[6]?ze(o):Ut(o,0,255)),{r:n,g:s,b:o,a:e}}}function fc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Ct(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ln=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Me=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function gc(i,t,e){const n=Me(Ct(i.r)),s=Me(Ct(i.g)),o=Me(Ct(i.b));return{r:Xt(Ln(n+e*(Me(Ct(t.r))-n))),g:Xt(Ln(s+e*(Me(Ct(t.g))-s))),b:Xt(Ln(o+e*(Me(Ct(t.b))-o))),a:i.a+e*(t.a-i.a)}}function Li(i,t,e){if(i){let n=Cn(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=En(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function yo(i,t){return i&&Object.assign(t||{},i)}function vo(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=Xt(i[3]))):(t=yo(i,{r:0,g:0,b:0,a:1}),t.a=Xt(t.a)),t}function pc(i){return i.charAt(0)==="r"?dc(i):rc(i)}class $e{constructor(t){if(t instanceof $e)return t;const e=typeof t;let n;e==="object"?n=vo(t):e==="string"&&(n=Zl(t)||hc(t)||pc(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=yo(this._rgb);return t&&(t.a=Ct(t.a)),t}set rgb(t){this._rgb=vo(t)}rgbString(){return this._valid?fc(this._rgb):void 0}hexString(){return this._valid?Ql(this._rgb):void 0}hslString(){return this._valid?lc(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=gc(this._rgb,t._rgb,e)),this}clone(){return new $e(this.rgb)}alpha(t){return this._rgb.a=Xt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ie(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 Li(this._rgb,2,t),this}darken(t){return Li(this._rgb,2,-t),this}saturate(t){return Li(this._rgb,1,t),this}desaturate(t){return Li(this._rgb,1,-t),this}rotate(t){return ac(this._rgb,t),this}}/*!
7
+ * Chart.js v4.4.8
8
+ * https://www.chartjs.org
9
+ * (c) 2025 Chart.js Contributors
10
+ * Released under the MIT License
11
+ */function Tt(){}const mc=(()=>{let i=0;return()=>i++})();function C(i){return i==null}function V(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 T(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function j(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function ut(i,t){return j(i)?i:t}function D(i,t){return typeof i>"u"?t:i}const bc=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,wo=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function I(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function L(i,t,e,n){let s,o,r;if(V(i))for(o=i.length,s=0;s<o;s++)t.call(e,i[s],s);else if(T(i))for(r=Object.keys(i),o=r.length,s=0;s<o;s++)t.call(e,i[r[s]],r[s])}function Ri(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 Fi(i){if(V(i))return i.map(Fi);if(T(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=Fi(i[e[s]]);return t}return i}function Mo(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function _c(i,t,e,n){if(!Mo(i))return;const s=t[i],o=e[i];T(s)&&T(o)?Be(s,o,n):t[i]=Fi(o)}function Be(i,t,e){const n=V(t)?t:[t],s=n.length;if(!T(i))return i;e=e||{};const o=e.merger||_c;let r;for(let a=0;a<s;++a){if(r=n[a],!T(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 Ne(i,t){return Be(i,t,{merger:xc})}function xc(i,t,e){if(!Mo(i))return;const n=t[i],s=e[i];T(n)&&T(s)?Ne(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Fi(s))}const ko={"":i=>i,x:i=>i.x,y:i=>i.y};function yc(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 vc(i){const t=yc(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function qt(i,t){return(ko[t]||(ko[t]=vc(t)))(i)}function Rn(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Ve=i=>typeof i<"u",Kt=i=>typeof i=="function",So=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function wc(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const $=Math.PI,B=2*$,Mc=B+$,Ii=Number.POSITIVE_INFINITY,kc=$/180,U=$/2,ee=$/4,Po=$*2/3,Gt=Math.log10,Pt=Math.sign;function We(i,t,e){return Math.abs(i-t)<e}function Do(i){const t=Math.round(i);i=We(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Gt(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Sc(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 Pc(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function ke(i){return!Pc(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Dc(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Oo(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 yt(i){return i*($/180)}function Fn(i){return i*(180/$)}function Ao(i){if(!j(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Co(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*$&&(o+=B),{angle:o,distance:s}}function In(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Oc(i,t){return(i-t+Mc)%B-$}function dt(i){return(i%B+B)%B}function He(i,t,e,n){const s=dt(i),o=dt(t),r=dt(e),a=dt(o-s),l=dt(r-s),c=dt(s-o),h=dt(s-r);return s===o||s===r||n&&o===r||a>l&&c<h}function K(i,t,e){return Math.max(t,Math.min(e,i))}function Ac(i){return K(i,-32768,32767)}function Et(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function zn(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 Lt=(i,t,e,n)=>zn(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),Cc=(i,t,e)=>zn(i,e,n=>i[n][t]>=e);function Tc(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 To=["push","pop","shift","splice","unshift"];function Ec(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),To.forEach(e=>{const n="_onData"+Rn(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 Eo(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)&&(To.forEach(o=>{delete i[o]}),delete i._chartjs)}function Lo(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Ro=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Fo(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Ro.call(window,()=>{n=!1,i.apply(t,e)}))}}function Lc(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const $n=i=>i==="start"?"left":i==="end"?"right":"center",Q=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Rc=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function Io(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:u,max:d,minDefined:f,maxDefined:g}=r.getUserBounds();if(f){if(s=Math.min(Lt(l,h,u).lo,e?n:Lt(t,h,r.getPixelForValue(u)).lo),c){const p=l.slice(0,s+1).reverse().findIndex(m=>!C(m[a.axis]));s-=Math.max(0,p)}s=K(s,0,n-1)}if(g){let p=Math.max(Lt(l,r.axis,d,!0).hi+1,e?0:Lt(t,h,r.getPixelForValue(d),!0).hi+1);if(c){const m=l.slice(p-1).findIndex(b=>!C(b[a.axis]));p+=Math.max(0,m)}o=K(p,s,n)-s}else o=n-s}return{start:s,count:o}}function zo(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 zi=i=>i===0||i===1,$o=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*B/e)),Bo=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*B/e)+1,je={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*U)+1,easeOutSine:i=>Math.sin(i*U),easeInOutSine:i=>-.5*(Math.cos($*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=>zi(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=>zi(i)?i:$o(i,.075,.3),easeOutElastic:i=>zi(i)?i:Bo(i,.075,.3),easeInOutElastic(i){return zi(i)?i:i<.5?.5*$o(i*2,.1125,.45):.5+.5*Bo(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-je.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?je.easeInBounce(i*2)*.5:je.easeOutBounce(i*2-1)*.5+.5};function Bn(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function No(i){return Bn(i)?i:new $e(i)}function Nn(i){return Bn(i)?i:new $e(i).saturate(.5).darken(.1).hexString()}const Fc=["x","y","borderWidth","radius","tension"],Ic=["color","borderColor","backgroundColor"];function zc(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:Ic},numbers:{type:"number",properties:Fc}}),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 $c(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Vo=new Map;function Bc(i,t){t=t||{};const e=i+JSON.stringify(t);let n=Vo.get(e);return n||(n=new Intl.NumberFormat(i,t),Vo.set(e,n)),n}function Ye(i,t,e){return Bc(t,e).format(i)}const Wo={values(i){return V(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=Nc(i,e)}const r=Gt(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),Ye(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(Gt(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?Wo.numeric.call(this,i,t,e):""}};function Nc(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 $i={formatters:Wo};function Vc(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:$i.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 ie=Object.create(null),Vn=Object.create(null);function Ue(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 Wn(i,t,e){return typeof t=="string"?Be(Ue(i,t),e):Be(Ue(i,""),t)}class Wc{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)=>Nn(s.backgroundColor),this.hoverBorderColor=(n,s)=>Nn(s.borderColor),this.hoverColor=(n,s)=>Nn(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 Wn(this,t,e)}get(t){return Ue(this,t)}describe(t,e){return Wn(Vn,t,e)}override(t,e){return Wn(ie,t,e)}route(t,e,n,s){const o=Ue(this,t),r=Ue(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 T(l)?Object.assign({},c,l):D(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var Y=new Wc({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[zc,$c,Vc]);function Hc(i){return!i||C(i.size)||C(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Bi(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 jc(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,u,d;for(l=0;l<a;l++)if(u=e[l],u!=null&&!V(u))r=Bi(i,s,o,r,u);else if(V(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!V(d)&&(r=Bi(i,s,o,r,d));i.restore();const f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function ne(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 Ho(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Hn(i,t,e,n){jo(i,t,e,n,null)}function jo(i,t,e,n,s){let o,r,a,l,c,h,u,d;const f=t.pointStyle,g=t.rotation,p=t.radius;let m=(g||0)*kc;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),f){default:s?i.ellipse(e,n,s/2,p,0,0,B):i.arc(e,n,p,0,B),i.closePath();break;case"triangle":h=s?s/2:p,i.moveTo(e+Math.sin(m)*h,n-Math.cos(m)*p),m+=Po,i.lineTo(e+Math.sin(m)*h,n-Math.cos(m)*p),m+=Po,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+ee)*l,u=Math.cos(m+ee)*(s?s/2-c:l),a=Math.sin(m+ee)*l,d=Math.sin(m+ee)*(s?s/2-c:l),i.arc(e-u,n-a,c,m-$,m-U),i.arc(e+d,n-r,c,m-U,m),i.arc(e+u,n+a,c,m,m+U),i.arc(e-d,n+r,c,m+U,m+$),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+=ee;case"rectRot":u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,d=Math.sin(m)*(s?s/2:p),i.moveTo(e-u,n-a),i.lineTo(e+d,n-r),i.lineTo(e+u,n+a),i.lineTo(e-d,n+r),i.closePath();break;case"crossRot":m+=ee;case"cross":u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,d=Math.sin(m)*(s?s/2:p),i.moveTo(e-u,n-a),i.lineTo(e+u,n+a),i.moveTo(e+d,n-r),i.lineTo(e-d,n+r);break;case"star":u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,d=Math.sin(m)*(s?s/2:p),i.moveTo(e-u,n-a),i.lineTo(e+u,n+a),i.moveTo(e+d,n-r),i.lineTo(e-d,n+r),m+=ee,u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,d=Math.sin(m)*(s?s/2:p),i.moveTo(e-u,n-a),i.lineTo(e+u,n+a),i.moveTo(e+d,n-r),i.lineTo(e-d,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 Rt(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 Ni(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Vi(i){i.restore()}function Yc(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 Uc(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 Xc(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 qc(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 Kc(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function se(i,t,e,n,s,o={}){const r=V(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,Xc(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Kc(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),qc(i,e,n,c,o),n+=Number(s.lineHeight);i.restore()}function Xe(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*$,$,!0),i.lineTo(e,n+o-r.bottomLeft),i.arc(e+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,$,U,!0),i.lineTo(e+s-r.bottomRight,n+o),i.arc(e+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,U,0,!0),i.lineTo(e+s,n+r.topRight),i.arc(e+s-r.topRight,n+r.topRight,r.topRight,0,-U,!0),i.lineTo(e+r.topLeft,n)}const Gc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Zc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Jc(i,t){const e=(""+i).match(Gc);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 Qc=i=>+i||0;function jn(i,t){const e={},n=T(t),s=n?Object.keys(t):t,o=T(i)?n?r=>D(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of s)e[r]=Qc(o(r));return e}function Yo(i){return jn(i,{top:"y",right:"x",bottom:"y",left:"x"})}function oe(i){return jn(i,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(i){const t=Yo(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function q(i,t){i=i||{},t=t||Y.font;let e=D(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=D(i.style,t.style);n&&!(""+n).match(Zc)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:D(i.family,t.family),lineHeight:Jc(D(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:D(i.weight,t.weight),string:""};return s.string=Hc(s),s}function qe(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 th(i,t,e){const{min:n,max:s}=i,o=wo(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 Zt(i,t){return Object.assign(Object.create(i),t)}function Yn(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=Go("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>Yn([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 Xo(a,l,()=>lh(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Zo(a).includes(l)},ownKeys(a){return Zo(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function Se(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Uo(i,n),setContext:o=>Se(i,o,e,n),override:o=>Se(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 Xo(o,r,()=>ih(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 Uo(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:Kt(e)?e:()=>e,isIndexable:Kt(n)?n:()=>n}}const eh=(i,t)=>i?i+Rn(t):t,Un=(i,t)=>T(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Xo(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function ih(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i;let a=n[t];return Kt(a)&&r.isScriptable(t)&&(a=nh(t,a,i,e)),V(a)&&a.length&&(a=sh(t,a,i,r.isIndexable)),Un(t,a)&&(a=Se(a,s,o&&o[t],r)),a}function nh(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),Un(i,l)&&(l=Xn(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(T(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=Xn(c,s,i,h);t.push(Se(u,o,r&&r[i],a))}}return t}function qo(i,t,e){return Kt(i)?i(t,e):i}const oh=(i,t)=>i===!0?t:typeof i=="string"?qt(t,i):void 0;function rh(i,t,e,n,s){for(const o of t){const r=oh(e,o);if(r){i.add(r);const a=qo(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 Xn(i,t,e,n){const s=t._rootScopes,o=qo(t._fallback,e,n),r=[...i,...s],a=new Set;a.add(n);let l=Ko(a,r,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=Ko(a,r,o,l,n),l===null)?!1:Yn(Array.from(a),[""],s,o,()=>ah(t,e,n))}function Ko(i,t,e,n,s){for(;e;)e=rh(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 V(s)&&T(e)?e:s||{}}function lh(i,t,e,n){let s;for(const o of t)if(s=Go(eh(o,i),e),typeof s<"u")return Un(i,s)?Xn(e,n,i,s):s}function Go(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Zo(i){let t=i._keys;return t||(t=i._keys=ch(i._scopes)),t}function ch(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 Jo(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(qt(h,o),c)};return r}const hh=Number.EPSILON||1e-14,Pe=(i,t)=>t<i.length&&!i[t].skip&&i[t],Qo=i=>i==="x"?"y":"x";function uh(i,t,e,n){const s=i.skip?t:i,o=t,r=e.skip?t:e,a=In(o,s),l=In(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const u=n*c,d=n*h;return{previous:{x:o.x-u*(r.x-s.x),y:o.y-u*(r.y-s.y)},next:{x:o.x+d*(r.x-s.x),y:o.y+d*(r.y-s.y)}}}function dh(i,t,e){const n=i.length;let s,o,r,a,l,c=Pe(i,0);for(let h=0;h<n-1;++h)if(l=c,c=Pe(i,h+1),!(!l||!c)){if(We(t[h],0,hh)){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 fh(i,t,e="x"){const n=Qo(e),s=i.length;let o,r,a,l=Pe(i,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Pe(i,c+1),!a)continue;const h=a[e],u=a[n];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${n}`]=u-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${n}`]=u+o*t[c])}}function gh(i,t="x"){const e=Qo(t),n=i.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=Pe(i,0);for(r=0;r<n;++r)if(a=l,l=c,c=Pe(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?Pt(s[r-1])!==Pt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}dh(i,s,o),fh(i,o,t)}function Wi(i,t,e){return Math.max(Math.min(i,e),t)}function ph(i,t){let e,n,s,o,r,a=Rt(i[0],t);for(e=0,n=i.length;e<n;++e)r=o,o=a,a=e<n-1&&Rt(i[e+1],t),o&&(s=i[e],r&&(s.cp1x=Wi(s.cp1x,t.left,t.right),s.cp1y=Wi(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Wi(s.cp2x,t.left,t.right),s.cp2y=Wi(s.cp2y,t.top,t.bottom)))}function mh(i,t,e,n,s){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")gh(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=uh(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&&ph(i,e)}function qn(){return typeof window<"u"&&typeof document<"u"}function Kn(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Hi(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 ji=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function bh(i,t){return ji(i).getPropertyValue(t)}const _h=["top","right","bottom","left"];function re(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=_h[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const xh=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function yh(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let r=!1,a,l;if(xh(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 ae(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=ji(e),o=s.boxSizing==="border-box",r=re(s,"padding"),a=re(s,"border","width"),{x:l,y:c,box:h}=yh(i,e),u=r.left+(h&&a.left),d=r.top+(h&&a.top);let{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-u)/f*e.width/n),y:Math.round((c-d)/g*e.height/n)}}function vh(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&Kn(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=ji(o),l=re(a,"border","width"),c=re(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,n=Hi(a.maxWidth,o,"clientWidth"),s=Hi(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||Ii,maxHeight:s||Ii}}const Yi=i=>Math.round(i*10)/10;function wh(i,t,e,n){const s=ji(i),o=re(s,"margin"),r=Hi(s.maxWidth,i,"clientWidth")||Ii,a=Hi(s.maxHeight,i,"clientHeight")||Ii,l=vh(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const d=re(s,"border","width"),f=re(s,"padding");c-=f.width+d.width,h-=f.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Yi(Math.min(c,r,l.maxWidth)),h=Yi(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Yi(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=Yi(Math.floor(h*n))),{width:c,height:h}}function tr(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(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 Mh=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 er(i,t){const e=bh(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function le(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function kh(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 Sh(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=le(i,s,e),a=le(s,o,e),l=le(o,t,e),c=le(r,a,e),h=le(a,l,e);return le(c,h,e)}const Ph=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}}},Dh=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function De(i,t,e){return i?Ph(t,e):Dh()}function ir(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 nr(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function sr(i){return i==="angle"?{between:He,compare:Oc,normalize:dt}:{between:Et,compare:(t,e)=>t-e,normalize:t=>t}}function or({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 Oh(i,t,e){const{property:n,start:s,end:o}=e,{between:r,normalize:a}=sr(n),l=t.length;let{start:c,end:h,loop:u}=i,d,f;if(u){for(c+=l,h+=l,d=0,f=l;d<f&&r(a(t[c%l][n]),s,o);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:i.style}}function rr(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=sr(n),{start:h,end:u,loop:d,style:f}=Oh(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),M=()=>p||v(),k=()=>!p||x();for(let S=h,P=h;S<=u;++S)_=t[S%r],!_.skip&&(b=c(_[n]),b!==y&&(p=l(b,s,o),m===null&&M()&&(m=a(b,s)===0?S:P),m!==null&&k()&&(g.push(or({start:m,end:S,loop:d,count:r,style:f})),m=null),P=S,y=b));return m!==null&&g.push(or({start:m,end:u,loop:d,count:r,style:f})),g}function ar(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=rr(n[s],i.points,t);o.length&&e.push(...o)}return e}function Ah(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 Ch(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 Th(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:r,end:a}=Ah(e,s,o,n);if(n===!0)return lr(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 lr(i,Ch(e,r,l,c),e,t)}function lr(i,t,e,n){return!n||!n.setContext||!e?t:Eh(i,t,e,n)}function Eh(i,t,e,n){const s=i._chart.getContext(),o=cr(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,u=t[0].start,d=u;function f(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,u=p%l)}}for(const g of t){u=a?u:g.start;let p=e[u%l],m;for(d=u+1;d<=g.end;d++){const b=e[d%l];m=cr(n.setContext(Zt(s,{type:"segment",p0:p,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:r}))),Lh(m,h)&&f(u,d-1,g.loop,h),p=b,h=m}u<d-1&&f(u,d-1,g.loop,h)}return c}function cr(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Lh(i,t){if(!t)return!1;const e=[],n=function(s,o){return Bn(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}/*!
12
+ * Chart.js v4.4.8
13
+ * https://www.chartjs.org
14
+ * (c) 2025 Chart.js Contributors
15
+ * Released under the MIT License
16
+ */class Rh{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=Ro.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 Ft=new Rh;const hr="transparent",Fh={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=No(i||hr),s=n.valid&&No(t||hr);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Ih{constructor(t,e,n,s){const o=e[n];s=qe([t.to,s,o,t.from]);const r=qe([t.from,o,s]);this._active=!0,this._fn=t.fn||Fh[t.type||typeof r],this._easing=je[t.easing]||je.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=qe([t.to,e,s,t.from]),this._from=qe([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 ur{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!T(t))return;const e=Object.keys(Y.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!T(o))return;const r={};for(const a of e)r[a]=o[a];(V(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,e){const n=e.options,s=$h(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&zh(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 u=o[c];const d=n.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}o[c]=u=new Ih(d,t,c,h),s.push(u)}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 Ft.add(this._chart,n),!0}}function zh(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 $h(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 dr(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 Bh(i,t,e){if(e===!1)return!1;const n=dr(i,e),s=dr(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Nh(i){let t,e,n,s;return T(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 fr(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 gr(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],j(c)&&(o||t===0||Pt(t)===Pt(c))&&(t+=c)}return!h&&!n.all?0:t}function Vh(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 Gn(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Wh(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Hh(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 jh(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function pr(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 mr(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=Wh(o,r,n),u=t.length;let d;for(let f=0;f<u;++f){const g=t[f],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});d=b[c]=jh(s,h,p),d[a]=m,d._top=pr(d,r,!0,n.type),d._bottom=pr(d,r,!1,n.type);const _=d._visualValues||(d._visualValues={});_[a]=m}}function Zn(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Yh(i,t){return Zt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Uh(i,t,e){return Zt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ke(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 Jn=i=>i==="reset"||i==="none",br=(i,t)=>t?i:Object.assign({},i),Xh=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:fr(e,!0),values:null};class vt{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=Gn(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&&Ke(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(u,d,f,g)=>u==="x"?d:u==="r"?g:f,o=e.xAxisID=D(n.xAxisID,Zn(t,"x")),r=e.yAxisID=D(n.yAxisID,Zn(t,"y")),a=e.rAxisID=D(n.rAxisID,Zn(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&&Eo(this._data,this),t._stacked&&Ke(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(T(e)){const s=this._cachedMeta;this._data=Vh(e,s)}else if(n!==e){if(n){Eo(n,this);const s=this._cachedMeta;Ke(s),s._parsed=[]}e&&Object.isExtensible(e)&&Ec(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=Gn(e.vScale,e),e.stack!==n.stack&&(s=!0,Ke(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(mr(this,e._parsed),e._stacked=Gn(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,u,d;if(this._parsing===!1)n._parsed=s,n._sorted=!0,d=s;else{V(s[t])?d=this.parseArrayData(n,s,t,e):T(s[t])?d=this.parseObjectData(n,s,t,e):d=this.parsePrimitiveData(n,s,t,e);const f=()=>u[a]===null||c&&u[a]<c[a];for(h=0;h<e;++h)n._parsed[h+t]=u=d[h],l&&(f()&&(l=!1),c=u);n._sorted=l}r&&mr(this,d)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,u=new Array(s);let d,f,g;for(d=0,f=s;d<f;++d)g=d+n,u[d]={[a]:h||o.parse(c[g],g),[l]:r.parse(e[g],g)};return u}parseArrayData(t,e,n,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,h,u;for(l=0,c=s;l<c;++l)h=l+n,u=e[h],a[l]={x:o.parse(u[0],h),y:r.parse(u[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,u,d,f;for(h=0,u=s;h<u;++h)d=h+n,f=e[d],c[h]={x:o.parse(qt(f,a),d),y:r.parse(qt(f,l),d)};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:fr(s,!0),values:e._stacks[t.axis]._visualValues};return gr(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=gr(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=Xh(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=Hh(a);let d,f;function g(){f=s[d];const p=f[a.axis];return!j(f[t.axis])||h>p||u<p}for(d=0;d<r&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++d);if(o){for(d=r-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(c,t,f,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],j(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=Nh(D(this.options.clip,Bh(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 u=s[h];u.hidden||(u.active&&c?r.push(u):u.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=Uh(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=Yh(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&&Ve(n);if(a)return br(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),f=Object.keys(Y.elements[t]),g=()=>this.getContext(n,s,e),p=c.resolveNamedOptions(d,f,g,u);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(br(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,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,n,e))}const c=new ur(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||Jn(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){Jn(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!Jn(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&&Ke(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])}}w(vt,"defaults",{}),w(vt,"datasetElementType",null),w(vt,"dataElementType",null);function qh(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=Lo(n.sort((s,o)=>s-o))}return i._cache.$bar}function Kh(i){const t=i.iScale,e=qh(t,i.type);let n=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(Ve(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 Gh(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 Zh(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 Jh(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 _r(i,t,e,n){return V(i)?Jh(i,t,e,n):t[e.axis]=e.parse(i,n),t}function xr(i,t,e,n){const s=i.iScale,o=i.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,u,d;for(c=e,h=e+n;c<h;++c)d=t[c],u={},u[s.axis]=a||s.parse(r[c],c),l.push(_r(d,u,o,c));return l}function Qn(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function Qh(i,t,e){return i!==0?Pt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function tu(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 eu(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}=tu(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=h:(o[yr(h,r,a,l)]=!0,s=c)),o[yr(s,r,a,l)]=!0,i.borderSkipped=o}function yr(i,t,e,n){return n?(i=iu(i,t,e),i=vr(i,e,t)):i=vr(i,t,e),i}function iu(i,t,e){return i===t?e:i===e?t:i}function vr(i,t,e){return i==="start"?t:i==="end"?e:i}function nu(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class Ui extends vt{parsePrimitiveData(t,e,n,s){return xr(t,e,n,s)}parseArrayData(t,e,n,s){return xr(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,u=[];let d,f,g,p;for(d=n,f=n+s;d<f;++d)p=e[d],g={},g[o.axis]=o.parse(qt(p,c),d),u.push(_r(qt(p,h),g,r,d));return u}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=Qn(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:u,includeOptions:d}=this._getSharedOptions(e,s);for(let f=e;f<e+n;f++){const g=this.getParsed(f),p=o||C(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,h),b=(g._stacks||{})[a.axis],_={horizontal:c,base:p.base,enableBorderRadius:!b||Qn(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};d&&(_.options=u||this.resolveDataElementOptions(f,t[f].active?"active":s));const y=_.options||t[f].options;eu(_,y,b,r),nu(_,y,h.ratio),this.updateElement(t[f],f,_,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 u=h._parsed.find(f=>f[n.axis]===l),d=u&&u[h.vScale.axis];if(C(d)||isNaN(d))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}_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||Kh(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=Qn(c);let u=l[e.axis],d=0,f=n?this.applyStack(e,l,n):u,g,p;f!==u&&(d=f-u,f=u),h&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Pt(u)!==Pt(c.barEnd)&&(d=0),d+=u);const m=!C(o)&&!h?o:d;let b=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(d+f):g=b,p=g-b,Math.abs(p)<r){p=Qh(p,e,a)*r,u===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 _=Pt(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=D(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?Zh(t,e,s,c):Gh(t,e,s,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=h.start+h.chunk*u+h.chunk/2,l=Math.min(r,h.chunk*h.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)}}w(Ui,"id","bar"),w(Ui,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),w(Ui,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Xi extends vt{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=D(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=D(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,u=a.axis;for(let d=e;d<e+n;d++){const f=t[d],g=!o&&this.getParsed(d),p={},m=p[h]=o?r.getPixelForDecimal(.5):r.getPixelForValue(g[h]),b=p[u]=o?a.getBasePixel():a.getPixelForValue(g[u]);p.skip=isNaN(m)||isNaN(b),c&&(p.options=l||this.resolveDataElementOptions(d,f.active?"active":s),o&&(p.options.radius=0)),this.updateElement(f,d,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+=D(n&&n._custom,o),s}}w(Xi,"id","bubble"),w(Xi,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),w(Xi,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function su(i,t,e){let n=1,s=1,o=0,r=0;if(t<B){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),f=(y,v,x)=>He(y,a,l,!0)?1:Math.max(v,v*e,x,x*e),g=(y,v,x)=>He(y,a,l,!0)?-1:Math.min(v,v*e,x,x*e),p=f(0,c,u),m=f(U,h,d),b=g($,c,u),_=g($+U,h,d);n=(p-b)/2,s=(m-_)/2,o=-(p+b)/2,r=-(m+_)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}class Oe extends vt{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(T(n[t])){const{key:l="value"}=this._parsing;o=c=>+qt(n[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let t=B,e=-B;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(bc(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:g,offsetY:p}=su(u,h,l),m=(n.width-r)/d,b=(n.height-r)/f,_=Math.max(Math.min(m,b)/2,0),y=wo(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/B)}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,u=(a.top+a.bottom)/2,d=o&&c.animateScale,f=d?0:this.innerRadius,g=d?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:u+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:g,innerRadius:f};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)?B*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Ye(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(D(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}w(Oe,"id","doughnut"),w(Oe,"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"}),w(Oe,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),w(Oe,"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()}}}});class qi extends vt{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}=Io(e,s,r);this._drawStart=a,this._drawCount=l,zo(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:u}=this._getSharedOptions(e,s),d=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=ke(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 M=t[x],k=b?M:{};if(x<e||x>=_){k.skip=!0;continue}const S=this.getParsed(x),P=C(S[f]),O=k[d]=r.getPixelForValue(S[d],x),A=k[f]=o||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,S,l):S[f],x);k.skip=isNaN(O)||isNaN(A)||P,k.stop=x>0&&Math.abs(S[d]-v[d])>m,p&&(k.parsed=S,k.raw=c.data[x]),u&&(k.options=h||this.resolveDataElementOptions(x,M.active?"active":s)),b||this.updateElement(M,x,k,s),v=S}}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()}}w(qi,"id","line"),w(qi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),w(qi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ki extends vt{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=Ye(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return Jo.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,u=c.yCenter,d=c.getIndexAngle(0)-.5*$;let f=d,g;const p=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,s,p);for(g=e;g<e+n;g++){const m=t[g];let b=f,_=f+this._computeAngle(g,s,p),y=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=_,o&&(l.animateScale&&(y=0),l.animateRotate&&(b=_=d));const v={x:h,y:u,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)?yt(this.resolveDataElementOptions(t,e).angle||n):0}}w(Ki,"id","polarArea"),w(Ki,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),w(Ki,"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}}});class ts extends Oe{}w(ts,"id","pie"),w(ts,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Gi extends vt{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 Jo.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),u=r?o.xCenter:h.x,d=r?o.yCenter:h.y,f={x:u,y:d,angle:h.angle,skip:isNaN(u)||isNaN(d),options:c};this.updateElement(l,a,f,s)}}}w(Gi,"id","radar"),w(Gi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),w(Gi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Zi extends vt{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}=Io(e,n,s);if(this._drawStart=o,this._drawCount=r,zo(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),u=this.getSharedOptions(h),d=this.includeOptions(s,u),f=r.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=ke(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],M=this.getParsed(v),k=_?x:{},S=C(M[g]),P=k[f]=r.getPixelForValue(M[f],v),O=k[g]=o||S?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[g],v);k.skip=isNaN(P)||isNaN(O)||S,k.stop=v>0&&Math.abs(M[f]-y[f])>b,m&&(k.parsed=M,k.raw=c.data[v]),d&&(k.options=u||this.resolveDataElementOptions(v,x.active?"active":s)),_||this.updateElement(x,v,k,s),y=M}this.updateSharedOptions(u,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}}w(Zi,"id","scatter"),w(Zi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),w(Zi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});function ce(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class es{constructor(t){w(this,"options");this.options=t||{}}static override(t){Object.assign(es.prototype,t)}init(){}formats(){return ce()}parse(){return ce()}format(){return ce()}add(){return ce()}diff(){return ce()}startOf(){return ce()}endOf(){return ce()}}var ou={_date:es};function ru(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?Cc:Lt;if(n){if(s._sharedOptions){const h=o[0],u=typeof h.getRange=="function"&&h.getRange(t);if(u){const d=c(o,t,e-u),f=c(o,t,e+u);return{lo:d.lo,hi:f.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:u}=s._cachedMeta,{_parsed:d}=i,f=d.slice(0,h.lo+1).reverse().findIndex(p=>!C(p[u.axis]));h.lo-=Math.max(0,f);const g=d.slice(h.hi).findIndex(p=>!C(p[u.axis]));h.hi+=Math.max(0,g)}return h}}return{lo:0,hi:o.length-1}}function Ji(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:u,hi:d}=ru(o[a],t,r,s);for(let f=u;f<=d;++f){const g=h[f];g.skip||n(g,c,f)}}}function au(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 is(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||Ji(i,e,t,function(a,l,c){!s&&!Rt(a,i.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function lu(i,t,e,n){let s=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],n),{angle:u}=Co(r,{x:t.x,y:t.y});He(u,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return Ji(i,e,t,o),s}function cu(i,t,e,n,s,o){let r=[];const a=au(e);let l=Number.POSITIVE_INFINITY;function c(h,u,d){const f=h.inRange(t.x,t.y,s);if(n&&!f)return;const g=h.getCenterPoint(s);if(!(!!o||i.isPointInArea(g))&&!f)return;const m=a(t,g);m<l?(r=[{element:h,datasetIndex:u,index:d}],l=m):m===l&&r.push({element:h,datasetIndex:u,index:d})}return Ji(i,e,t,c),r}function ns(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?lu(i,t,e,s):cu(i,t,e,n,s,o)}function wr(i,t,e,n,s){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Ji(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 hu={modes:{index(i,t,e,n){const s=ae(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?is(i,s,o,n,r):ns(i,s,o,!1,n,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=ae(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?is(i,s,o,n,r):ns(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=ae(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return is(i,s,o,n,r)},nearest(i,t,e,n){const s=ae(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return ns(i,s,o,e.intersect,n,r)},x(i,t,e,n){const s=ae(t,i);return wr(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=ae(t,i);return wr(i,s,"y",e.intersect,n)}}};const Mr=["left","top","right","bottom"];function Ge(i,t){return i.filter(e=>e.pos===t)}function kr(i,t){return i.filter(e=>Mr.indexOf(e.pos)===-1&&e.box.axis===t)}function Ze(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 uu(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 du(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!Mr.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 fu(i,t){const e=du(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 gu(i){const t=uu(i),e=Ze(t.filter(c=>c.box.fullSize),!0),n=Ze(Ge(t,"left"),!0),s=Ze(Ge(t,"right")),o=Ze(Ge(t,"top"),!0),r=Ze(Ge(t,"bottom")),a=kr(t,"x"),l=kr(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Ge(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Sr(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Pr(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 pu(i,t,e,n){const{pos:s,box:o}=e,r=i.maxPadding;if(!T(s)){e.size&&(i[s]-=e.size);const u=n[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,i[s]+=e.size}o.getPadding&&Pr(r,o.getPadding());const a=Math.max(0,t.outerWidth-Sr(r,i,"left","right")),l=Math.max(0,t.outerHeight-Sr(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 mu(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 bu(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 Je(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,bu(a.horizontal,t));const{same:u,other:d}=pu(t,e,a,n);c|=u&&s.length,h=h||d,l.fullSize||s.push(a)}return c&&Je(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 Dr(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 u=t.w*h,d=c.size||l.height;Ve(c.start)&&(r=c.start),l.fullSize?Qi(l,s.left,r,e.outerWidth-s.right-s.left,d):Qi(l,t.left+c.placed,r,u,d),c.start=r,c.placed+=u,r=l.bottom}else{const u=t.h*h,d=c.size||l.width;Ve(c.start)&&(o=c.start),l.fullSize?Qi(l,o,s.top,d,e.outerHeight-s.bottom-s.top):Qi(l,o,t.top+c.placed,d,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=r}var et={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=tt(i.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=gu(i.boxes),l=a.vertical,c=a.horizontal;L(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,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),d=Object.assign({},s);Pr(d,tt(n));const f=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),g=fu(l.concat(c),u);Je(a.fullSize,f,u,g),Je(l,f,u,g),Je(c,f,u,g)&&Je(l,f,u,g),mu(f),Dr(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,Dr(a.rightAndBottom,f,u,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},L(a.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Or{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 _u extends Or{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const tn="$chartjs",xu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ar=i=>i===null||i==="";function yu(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[tn]={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",Ar(s)){const o=er(i,"width");o!==void 0&&(i.width=o)}if(Ar(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=er(i,"height");o!==void 0&&(i.height=o)}return i}const Cr=Mh?{passive:!0}:!1;function vu(i,t,e){i&&i.addEventListener(t,e,Cr)}function wu(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Cr)}function Mu(i,t){const e=xu[i.type]||i.type,{x:n,y:s}=ae(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function en(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function ku(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||en(a.addedNodes,n),r=r&&!en(a.removedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Su(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||en(a.removedNodes,n),r=r&&!en(a.addedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Qe=new Map;let Tr=0;function Er(){const i=window.devicePixelRatio;i!==Tr&&(Tr=i,Qe.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Pu(i,t){Qe.size||window.addEventListener("resize",Er),Qe.set(i,t)}function Du(i){Qe.delete(i),Qe.size||window.removeEventListener("resize",Er)}function Ou(i,t,e){const n=i.canvas,s=n&&Kn(n);if(!s)return;const o=Fo((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),Pu(i,o),r}function ss(i,t,e){e&&e.disconnect(),t==="resize"&&Du(i)}function Au(i,t,e){const n=i.canvas,s=Fo(o=>{i.ctx!==null&&e(Mu(o,i))},i);return vu(n,t,s),s}class Cu extends Or{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(yu(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[tn])return!1;const n=e[tn].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[tn],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:ku,detach:Su,resize:Ou}[e]||Au;s[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:ss,detach:ss,resize:ss}[e]||wu)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return wh(t,e,n,s)}isAttached(t){const e=t&&Kn(t);return!!(e&&e.isConnected)}}function Tu(i){return!qn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?_u:Cu}let It=(mn=class{constructor(){w(this,"x");w(this,"y");w(this,"active",!1);w(this,"options");w(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return ke(this.x)&&ke(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}},w(mn,"defaults",{}),w(mn,"defaultRoutes"),mn);function Eu(i,t){const e=i.options.ticks,n=Lu(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 Iu(t,c,o,r/s),c;const h=Ru(o,t,s);if(r>0){let u,d;const f=r>1?Math.round((l-a)/(r-1)):null;for(nn(t,c,h,C(f)?0:a-f,a),u=0,d=r-1;u<d;u++)nn(t,c,h,o[u],o[u+1]);return nn(t,c,h,l,C(f)?t.length:l+f),c}return nn(t,c,h),c}function Lu(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 Ru(i,t,e){const n=zu(i),s=t.length/e;if(!n)return Math.max(s,1);const o=Sc(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 Iu(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 nn(i,t,e,n,s){const o=D(n,0),r=Math.min(D(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 zu(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 $u=i=>i==="left"?"right":i==="right"?"left":i,Lr=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Rr=(i,t)=>Math.min(t||i,i);function Fr(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 Bu(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 Nu(i,t){L(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 ti(i){return i.drawTicks?i.tickLength:0}function Ir(i,t){if(!i.display)return 0;const e=q(i.font,t),n=tt(i.padding);return(V(i.text)?i.text.length:1)*e.lineHeight+n.height}function Vu(i,t){return Zt(i,{scale:t,type:"scale"})}function Wu(i,t,e){return Zt(i,{tick:e,index:t,type:"tick"})}function Hu(i,t,e){let n=$n(i);return(e&&t!=="right"||!e&&t==="right")&&(n=$u(n)),n}function ju(i,t,e,n){const{top:s,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let u=0,d,f,g;const p=r-s,m=a-o;if(i.isHorizontal()){if(f=Q(n,o,a),T(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=Lr(i,e,t);d=a-o}else{if(T(e)){const b=Object.keys(e)[0],_=e[b];f=h[b].getPixelForValue(_)-m+t}else e==="center"?f=(c.left+c.right)/2-m+t:f=Lr(i,e,t);g=Q(n,r,s),u=e==="left"?-U:U}return{titleX:f,titleY:g,maxWidth:d,rotation:u}}class he extends It{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=ut(t,Number.POSITIVE_INFINITY),e=ut(e,Number.NEGATIVE_INFINITY),n=ut(n,Number.POSITIVE_INFINITY),s=ut(s,Number.NEGATIVE_INFINITY),{min:ut(t,n),max:ut(e,s),minDefined:j(t),maxDefined:j(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:ut(e,ut(n,e)),max:ut(n,ut(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(){I(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=th(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Fr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Eu(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(){I(this.options.afterUpdate,[this])}beforeSetDimensions(){I(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(){I(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),I(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){I(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=I(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){I(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){I(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Rr(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(),u=h.widest.width,d=h.highest.height,f=K(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),u+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-ti(t.grid)-e.padding-Ir(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),r=Fn(Math.min(Math.asin(K((h.highest.height+6)/a,-1,1)),Math.asin(K(l/c,-1,1))-Math.asin(K(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(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=Ir(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=ti(o)+l):(t.height=this.maxHeight,t.width=ti(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=n.padding*2,g=yt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=n.mirror?0:m*u.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=n.mirror?0:p*u.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}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,u=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,f=0;l?c?(d=s*t.width,f=n*e.height):(d=n*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+r)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;o==="start"?(h=0,u=t.height):o==="end"&&(h=e.height,u=0),this.paddingTop=h+r,this.paddingBottom=u+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(){I(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=Fr(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/Rr(e,n));let c=0,h=0,u,d,f,g,p,m,b,_,y,v,x;for(u=0;u<e;u+=l){if(g=t[u].label,p=this._resolveTickFontOptions(u),s.font=m=p.string,b=o[m]=o[m]||{data:{},gc:[]},_=p.lineHeight,y=v=0,!C(g)&&!V(g))y=Bi(s,b.data,b.gc,y,g),v=_;else if(V(g))for(d=0,f=g.length;d<f;++d)x=g[d],!C(x)&&!V(x)&&(y=Bi(s,b.data,b.gc,y,x),v+=_);r.push(y),a.push(v),c=Math.max(y,c),h=Math.max(v,h)}Nu(o,e);const M=r.indexOf(c),k=a.indexOf(h),S=P=>({width:r[P]||0,height:a[P]||0});return{first:S(0),last:S(e-1),widest:S(M),highest:S(k),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 Ac(this._alignToPixels?ne(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=Wu(this.getContext(),t,n))}return this.$context||(this.$context=Vu(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=yt(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(),u=this.ticks.length+(l?1:0),d=ti(o),f=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function(W){return ne(n,W,p)};let _,y,v,x,M,k,S,P,O,A,E,Z;if(r==="top")_=b(this.bottom),k=this.bottom-d,P=_-m,A=b(t.top)+m,Z=t.bottom;else if(r==="bottom")_=b(this.top),A=t.top,Z=b(t.bottom)-m,k=_+m,P=this.top+d;else if(r==="left")_=b(this.right),M=this.right-d,S=_-m,O=b(t.left)+m,E=t.right;else if(r==="right")_=b(this.left),O=t.left,E=b(t.right)-m,M=_+m,S=this.left+d;else if(e==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(T(r)){const W=Object.keys(r)[0],X=r[W];_=b(this.chart.scales[W].getPixelForValue(X))}A=t.top,Z=t.bottom,k=_+m,P=k+d}else if(e==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(T(r)){const W=Object.keys(r)[0],X=r[W];_=b(this.chart.scales[W].getPixelForValue(X))}M=_-m,S=M-d,O=t.left,E=t.right}const ft=D(s.ticks.maxTicksLimit,u),R=Math.max(1,Math.ceil(u/ft));for(y=0;y<u;y+=R){const W=this.getContext(y),X=o.setContext(W),wt=a.setContext(W),it=X.lineWidth,Ce=X.color,bn=wt.dash||[],Te=wt.dashOffset,ai=X.tickWidth,de=X.tickColor,li=X.tickBorderDash||[],fe=X.tickBorderDashOffset;v=Bu(this,y,l),v!==void 0&&(x=ne(n,v,it),c?M=S=O=E=x:k=P=A=Z=x,f.push({tx1:M,ty1:k,tx2:S,ty2:P,x1:O,y1:A,x2:E,y2:Z,width:it,color:Ce,borderDash:bn,borderDashOffset:Te,tickWidth:ai,tickColor:de,tickBorderDash:li,tickBorderDashOffset:fe}))}return this._ticksLength=u,this._borderValue=_,f}_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:u}=o,d=ti(n.grid),f=d+h,g=u?-h:f,p=-yt(this.labelRotation),m=[];let b,_,y,v,x,M,k,S,P,O,A,E,Z="middle";if(s==="top")M=this.bottom-g,k=this._getXAxisLabelAlignment();else if(s==="bottom")M=this.top+g,k=this._getXAxisLabelAlignment();else if(s==="left"){const R=this._getYAxisLabelAlignment(d);k=R.textAlign,x=R.x}else if(s==="right"){const R=this._getYAxisLabelAlignment(d);k=R.textAlign,x=R.x}else if(e==="x"){if(s==="center")M=(t.top+t.bottom)/2+f;else if(T(s)){const R=Object.keys(s)[0],W=s[R];M=this.chart.scales[R].getPixelForValue(W)+f}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")x=(t.left+t.right)/2-f;else if(T(s)){const R=Object.keys(s)[0],W=s[R];x=this.chart.scales[R].getPixelForValue(W)}k=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?Z="top":l==="end"&&(Z="bottom"));const ft=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){y=a[b],v=y.label;const R=o.setContext(this.getContext(b));S=this.getPixelForTick(b)+o.labelOffset,P=this._resolveTickFontOptions(b),O=P.lineHeight,A=V(v)?v.length:1;const W=A/2,X=R.color,wt=R.textStrokeColor,it=R.textStrokeWidth;let Ce=k;r?(x=S,k==="inner"&&(b===_-1?Ce=this.options.reverse?"left":"right":b===0?Ce=this.options.reverse?"right":"left":Ce="center"),s==="top"?c==="near"||p!==0?E=-A*O+O/2:c==="center"?E=-ft.highest.height/2-W*O+O:E=-ft.highest.height+O/2:c==="near"||p!==0?E=O/2:c==="center"?E=ft.highest.height/2-W*O:E=ft.highest.height-A*O,u&&(E*=-1),p!==0&&!R.showLabelBackdrop&&(x+=O/2*Math.sin(p))):(M=S,E=(1-A)*O/2);let bn;if(R.showLabelBackdrop){const Te=tt(R.backdropPadding),ai=ft.heights[b],de=ft.widths[b];let li=E-Te.top,fe=0-Te.left;switch(Z){case"middle":li-=ai/2;break;case"bottom":li-=ai;break}switch(k){case"center":fe-=de/2;break;case"right":fe-=de;break;case"inner":b===_-1?fe-=de:b>0&&(fe-=de/2);break}bn={left:fe,top:li,width:de+Te.width,height:ai+Te.height,color:R.backdropColor}}m.push({label:v,font:P,textOffset:E,options:{rotation:p,color:X,strokeColor:wt,strokeWidth:it,textAlign:Ce,textBaseline:Z,translation:[x,M],backdrop:bn}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-yt(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,u,d;this.isHorizontal()?(c=ne(t,this.left,r)-r/2,h=ne(t,this.right,a)+a/2,u=d=l):(u=ne(t,this.top,r)-r/2,d=ne(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,u),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&Ni(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;se(n,c,0,h,l,a)}s&&Vi(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=q(n.font),r=tt(n.padding),a=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||T(e)?(l+=r.bottom,V(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:u,rotation:d}=ju(this,l,e,a);se(t,n.text,0,0,o,{color:n.color,maxWidth:u,rotation:d,textAlign:Hu(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=D(t.grid&&t.grid.z,-1),s=D(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==he.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 q(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class sn{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;Xu(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,Yu(t,r,n),this.override&&Y.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 Y[s]&&(delete Y[s][n],this.override&&delete ie[n])}}function Yu(i,t,e){const n=Be(Object.create(null),[e?Y.get(e):{},Y.get(t),i.defaults]);Y.set(t,n),i.defaultRoutes&&Uu(t,i.defaultRoutes),i.descriptors&&Y.describe(t,i.descriptors)}function Uu(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(".");Y.route(o,s,l,a)})}function Xu(i){return"id"in i&&"defaults"in i}class qu{constructor(){this.controllers=new sn(vt,"datasets",!0),this.elements=new sn(It,"elements"),this.plugins=new sn(Object,"plugins"),this.scales=new sn(he,"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):L(s,r=>{const a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,n){const s=Rn(t);I(n["before"+s],[],n),e[t](n),I(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 Dt=new qu;class Ku{constructor(){this._init=[]}notify(t,e,n,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));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")),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(I(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=D(n.options&&n.options.plugins,{}),o=Gu(n);return s===!1&&!e?[]:Ju(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 Gu(i){const t={},e=[],n=Object.keys(Dt.plugins.items);for(let o=0;o<n.length;o++)e.push(Dt.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 Zu(i,t){return!t&&i===!1?null:i===!0?{}:i}function Ju(i,{plugins:t,localIds:e},n,s){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Zu(n[l],s);c!==null&&o.push({plugin:a,options:Qu(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Qu(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 os(i,t){const e=Y.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function td(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function ed(i,t){return i===t?"_index_":"_value_"}function zr(i){if(i==="x"||i==="y"||i==="r")return i}function id(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function rs(i,...t){if(zr(i))return i;for(const e of t){const n=e.axis||id(e.position)||i.length>1&&zr(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function $r(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function nd(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 $r(i,"x",e[0])||$r(i,"y",e[0])}return{}}function sd(i,t){const e=ie[i.type]||{scales:{}},n=t.scales||{},s=os(i.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{const a=n[r];if(!T(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=rs(r,a,nd(r,i),Y.scales[a.type]),c=ed(l,s),h=e.scales||{};o[r]=Ne(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||os(a,t),h=(ie[a]||{}).scales||{};Object.keys(h).forEach(u=>{const d=td(u,l),f=r[d+"AxisID"]||d;o[f]=o[f]||Object.create(null),Ne(o[f],[{axis:d},n[f],h[u]])})}),Object.keys(o).forEach(r=>{const a=o[r];Ne(a,[Y.scales[a.type],Y.scale])}),o}function Br(i){const t=i.options||(i.options={});t.plugins=D(t.plugins,{}),t.scales=sd(i,t)}function Nr(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function od(i){return i=i||{},i.data=Nr(i.data),Br(i),i}const Vr=new Map,Wr=new Set;function on(i,t){let e=Vr.get(i);return e||(e=t(),Vr.set(i,e),Wr.add(e)),e}const ei=(i,t,e)=>{const n=qt(t,e);n!==void 0&&i.add(n)};class rd{constructor(t){this._config=od(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=Nr(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(),Br(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return on(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return on(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return on(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return on(`${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(u=>ei(l,t,u))),h.forEach(u=>ei(l,s,u)),h.forEach(u=>ei(l,ie[o]||{},u)),h.forEach(u=>ei(l,Y,u)),h.forEach(u=>ei(l,Vn,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Wr.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,ie[e]||{},Y.datasets[e]||{},{type:e},Y,Vn]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Hr(this._resolverCache,t,s);let l=r;if(ld(r,e)){o.$shared=!1,n=Kt(n)?n():n;const c=this.createResolver(t,n,a);l=Se(r,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=Hr(this._resolverCache,t,n);return T(e)?Se(o,e,void 0,s):o}}function Hr(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:Yn(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}const ad=i=>T(i)&&Object.getOwnPropertyNames(i).some(t=>Kt(i[t]));function ld(i,t){const{isScriptable:e,isIndexable:n}=Uo(i);for(const s of t){const o=e(s),r=n(s),a=(r||o)&&i[s];if(o&&(Kt(a)||ad(a))||r&&V(a))return!0}return!1}var cd="4.4.8";const hd=["top","bottom","left","right","chartArea"];function jr(i,t){return i==="top"||i==="bottom"||hd.indexOf(i)===-1&&t==="x"}function Yr(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function Ur(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),I(e&&e.onComplete,[i],t)}function ud(i){const t=i.chart,e=t.options.animation;I(e&&e.onProgress,[i],t)}function Xr(i){return qn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const rn={},qr=i=>{const t=Xr(i);return Object.values(rn).filter(e=>e.canvas===t).pop()};function dd(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 fd(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function an(i,t,e){return i.options.clip?i[e]:t[e]}function gd(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:an(e,t,"left"),right:an(e,t,"right"),top:an(n,t,"top"),bottom:an(n,t,"bottom")}:t}class zt{static register(...t){Dt.add(...t),Kr()}static unregister(...t){Dt.remove(...t),Kr()}constructor(t,e){const n=this.config=new rd(e),s=Xr(t),o=qr(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||Tu(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=mc(),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 Ku,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Lc(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],rn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ft.listen(this,"complete",Ur),Ft.listen(this,"progress",ud),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 Dt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ho(this.canvas,this.ctx),this}stop(){return Ft.stop(this),this}resize(t,e){Ft.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,tr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};L(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=rs(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),L(o,r=>{const a=r.options,l=a.id,c=rs(l,a),h=D(a.type,r.dtype);(a.position===void 0||jr(a.position,c)!==jr(r.dposition))&&(a.position=r.dposition),s[l]=!0;let u=null;if(l in n&&n[l].type===h)u=n[l];else{const d=Dt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(a,t)}),L(s,(r,a)=>{r||delete n[a]}),L(n,r=>{et.configure(this,r,r.options),et.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(Yr("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||os(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=Dt.getController(a),{datasetElementType:c,dataElementType:h}=Y.datasets[a];Object.assign(l,{dataElementType:Dt.getElement(h),datasetElementType:c&&Dt.getElement(c)}),r.controller=new l(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){L(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:u}=this.getDatasetMeta(c),d=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(d),r=Math.max(+u.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||L(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Yr("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){L(this.scales,t=>{et.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!So(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;dd(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(!So(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;et.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],L(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,Kt(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&&(Ft.has(this)?this.attached&&!Ft.running(this)&&Ft.start(this):(this.draw(),Ur({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=t._clip,s=!n.disabled,o=gd(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&Ni(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&Vi(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Rt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=hu.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=Zt(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);Ve(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(),Ft.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(),Ho(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete rn[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)};L(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(){L(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},L(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}});!Ri(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(u=>h.datasetIndex===u.datasetIndex&&h.index===u.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=wc(t),c=fd(t,this._lastEvent,n,l);n&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const h=!Ri(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)}}w(zt,"defaults",Y),w(zt,"instances",rn),w(zt,"overrides",ie),w(zt,"registry",Dt),w(zt,"version",cd),w(zt,"getChart",qr);function Kr(){return L(zt.instances,i=>i._plugins.invalidate())}function pd(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+U,n-U),i.closePath(),i.clip()}function md(i){return jn(i,["outerStart","outerEnd","innerStart","innerEnd"])}function bd(i,t,e,n){const s=md(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 K(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:K(s.innerStart,0,r),innerEnd:K(s.innerEnd,0,r)}}function Ae(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function ln(i,t,e,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+n+e-c,0),d=h>0?h+n+e+c:0;let f=0;const g=s-l;if(n){const R=h>0?h-n:0,W=u>0?u-n:0,X=(R+W)/2,wt=X!==0?g*X/(X+n):g;f=(g-wt)/2}const p=Math.max(.001,g*u-e/$)/u,m=(g-p)/2,b=l+m+f,_=s-m-f,{outerStart:y,outerEnd:v,innerStart:x,innerEnd:M}=bd(t,d,u,_-b),k=u-y,S=u-v,P=b+y/k,O=_-v/S,A=d+x,E=d+M,Z=b+x/A,ft=_-M/E;if(i.beginPath(),o){const R=(P+O)/2;if(i.arc(r,a,u,P,R),i.arc(r,a,u,R,O),v>0){const it=Ae(S,O,r,a);i.arc(it.x,it.y,v,O,_+U)}const W=Ae(E,_,r,a);if(i.lineTo(W.x,W.y),M>0){const it=Ae(E,ft,r,a);i.arc(it.x,it.y,M,_+U,ft+Math.PI)}const X=(_-M/d+(b+x/d))/2;if(i.arc(r,a,d,_-M/d,X,!0),i.arc(r,a,d,X,b+x/d,!0),x>0){const it=Ae(A,Z,r,a);i.arc(it.x,it.y,x,Z+Math.PI,b-U)}const wt=Ae(k,b,r,a);if(i.lineTo(wt.x,wt.y),y>0){const it=Ae(k,P,r,a);i.arc(it.x,it.y,y,b-U,P)}}else{i.moveTo(r,a);const R=Math.cos(P)*u+r,W=Math.sin(P)*u+a;i.lineTo(R,W);const X=Math.cos(O)*u+r,wt=Math.sin(O)*u+a;i.lineTo(X,wt)}i.closePath()}function _d(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){ln(i,t,e,n,l,s);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%B||B))}return ln(i,t,e,n,l,s),i.fill(),l}function xd(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:d}=l,f=l.borderAlign==="inner";if(!c)return;i.setLineDash(u||[]),i.lineDashOffset=d,f?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let g=t.endAngle;if(o){ln(i,t,e,n,g,s);for(let p=0;p<o;++p)i.stroke();isNaN(a)||(g=r+(a%B||B))}f&&pd(i,t,g),o||(ln(i,t,e,n,g,s),i.stroke())}class ii extends It{constructor(e){super();w(this,"circumference");w(this,"endAngle");w(this,"fullCircles");w(this,"innerRadius");w(this,"outerRadius");w(this,"pixelMargin");w(this,"startAngle");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,n,s){const o=this.getProps(["x","y"],s),{angle:r,distance:a}=Co(o,{x:e,y:n}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,g=D(d,c-l),p=He(r,l,c)&&l!==c,m=g>=B||p,b=Et(a,h+f,u+f);return m&&b}getCenterPoint(e){const{x:n,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,u=(o+r)/2,d=(a+l+h+c)/2;return{x:n+Math.cos(u)*d,y:s+Math.sin(u)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,o=(n.offset||0)/4,r=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>B?Math.floor(s/B):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min($,s||0)),h=o*c;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,_d(e,this,h,r,a),xd(e,this,h,r,a),e.restore()}}w(ii,"id","arc"),w(ii,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),w(ii,"defaultRoutes",{backgroundColor:"backgroundColor"}),w(ii,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Gr(i,t,e=t){i.lineCap=D(e.borderCapStyle,t.borderCapStyle),i.setLineDash(D(e.borderDash,t.borderDash)),i.lineDashOffset=D(e.borderDashOffset,t.borderDashOffset),i.lineJoin=D(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=D(e.borderWidth,t.borderWidth),i.strokeStyle=D(e.borderColor,t.borderColor)}function yd(i,t,e){i.lineTo(e.x,e.y)}function vd(i){return i.stepped?Yc:i.tension||i.cubicInterpolationMode==="monotone"?Uc:yd}function Zr(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 wd(i,t,e,n){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Zr(s,e,n),h=vd(o);let{move:u=!0,reverse:d}=n||{},f,g,p;for(f=0;f<=c;++f)g=s[(a+(d?c-f:f))%r],!g.skip&&(u?(i.moveTo(g.x,g.y),u=!1):h(i,p,g,d,o.stepped),p=g);return l&&(g=s[(a+(d?c:0))%r],h(i,p,g,d,o.stepped)),!!l}function Md(i,t,e,n){const s=t.points,{count:o,start:r,ilen:a}=Zr(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,u=0,d,f,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&&(f=s[_(0)],i.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=s[_(d)],f.skip)continue;const v=f.x,x=f.y,M=v|0;M===g?(x<p?p=x:x>m&&(m=x),h=(u*h+v)/++u):(y(),i.lineTo(v,x),g=M,u=0,p=m=x),b=x}y()}function as(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Md:wd}function kd(i){return i.stepped?kh:i.tension||i.cubicInterpolationMode==="monotone"?Sh:le}function Sd(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Gr(i,t.options),i.stroke(s)}function Pd(i,t,e,n){const{segments:s,options:o}=t,r=as(t);for(const a of s)Gr(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Dd=typeof Path2D=="function";function Od(i,t,e,n){Dd&&!t.options.segment?Sd(i,t,e,n):Pd(i,t,e,n)}class Jt extends It{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;mh(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=Th(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=ar(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=kd(n);let c,h;for(c=0,h=r.length;c<h;++c){const{start:u,end:d}=r[c],f=o[u],g=o[d];if(f===g){a.push(f);continue}const p=Math.abs((s-f[e])/(g[e]-f[e])),m=l(f,g,p,n.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,n){return as(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=as(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)}}w(Jt,"id","line"),w(Jt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),w(Jt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),w(Jt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Jr(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class cn extends It{constructor(e){super();w(this,"parsed");w(this,"skip");w(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,n,s){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(e-r,2)+Math.pow(n-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,n){return Jr(this,e,"x",n)}inYRange(e,n){return Jr(this,e,"y",n)}getCenterPoint(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}size(e){e=e||this.options||{};let n=e.radius||0;n=Math.max(n,n&&e.hoverRadius||0);const s=n&&e.borderWidth||0;return(n+s)*2}draw(e,n){const s=this.options;this.skip||s.radius<.1||!Rt(this,n,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Hn(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}w(cn,"id","point"),w(cn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),w(cn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Qr(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,u;return i.horizontal?(u=r/2,a=Math.min(e,s),l=Math.max(e,s),c=n-u,h=n+u):(u=o/2,a=e-u,l=e+u,c=Math.min(n,s),h=Math.max(n,s)),{left:a,top:c,right:l,bottom:h}}function Qt(i,t,e,n){return i?0:K(t,e,n)}function Ad(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,o=Yo(n);return{t:Qt(s.top,o.top,0,e),r:Qt(s.right,o.right,0,t),b:Qt(s.bottom,o.bottom,0,e),l:Qt(s.left,o.left,0,t)}}function Cd(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=oe(s),r=Math.min(t,e),a=i.borderSkipped,l=n||T(s);return{topLeft:Qt(!l||a.top||a.left,o.topLeft,0,r),topRight:Qt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Qt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Qt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Td(i){const t=Qr(i),e=t.right-t.left,n=t.bottom-t.top,s=Ad(i,e/2,n/2),o=Cd(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 ls(i,t,e,n){const s=t===null,o=e===null,a=i&&!(s&&o)&&Qr(i,n);return a&&(s||Et(t,a.left,a.right))&&(o||Et(e,a.top,a.bottom))}function Ed(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Ld(i,t){i.rect(t.x,t.y,t.w,t.h)}function cs(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 hn extends It{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}=Td(this),a=Ed(r.radius)?Xe:Ld;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,cs(r,e,o)),t.clip(),a(t,cs(o,-e,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,cs(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return ls(this,t,e,n)}inXRange(t,e){return ls(this,t,null,e)}inYRange(t,e){return ls(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}}w(hn,"id","bar"),w(hn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),w(hn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Rd(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,u,d,f,g,p;for(r[l++]=i[h],u=0;u<o-2;u++){let m=0,b=0,_;const y=Math.floor((u+1)*a)+1+t,v=Math.min(Math.floor((u+2)*a)+1,e)+t,x=v-y;for(_=y;_<v;_++)m+=i[_].x,b+=i[_].y;m/=x,b/=x;const M=Math.floor(u*a)+1+t,k=Math.min(Math.floor((u+1)*a)+1,e)+t,{x:S,y:P}=i[h];for(f=g=-1,_=M;_<k;_++)g=.5*Math.abs((S-m)*(i[_].y-P)-(S-i[_].x)*(b-P)),g>f&&(f=g,d=i[_],p=_);r[l++]=d,h=p}return r[l++]=i[c],r}function Fd(i,t,e,n){let s=0,o=0,r,a,l,c,h,u,d,f,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,u=r):c>p&&(p=c,d=r),s=(o*s+a.x)/++o;else{const M=r-1;if(!C(u)&&!C(d)){const k=Math.min(u,d),S=Math.max(u,d);k!==f&&k!==M&&m.push({...i[k],x:s}),S!==f&&S!==M&&m.push({...i[S],x:s})}r>0&&M!==f&&m.push(i[M]),m.push(a),h=x,o=0,g=p=c,u=d=f=r}}return m}function ta(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 ea(i){i.data.datasets.forEach(t=>{ta(t)})}function Id(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=K(Lt(t,o.axis,r).lo,0,e-1)),c?s=K(Lt(t,o.axis,a).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var zd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){ea(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(qe([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:u,count:d}=Id(l,c);const f=e.threshold||4*n;if(d<=f){ta(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=Rd(c,u,d,n,e);break;case"min-max":g=Fd(c,u,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(i){ea(i)}};function $d(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=us(l,c,s);const h=hs(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}const u=ar(t,h);for(const d of u){const f=hs(e,o[d.start],o[d.end],d.loop),g=rr(a,s,f);for(const p of g)r.push({source:p,target:d,start:{[e]:ia(h,f,"start",Math.max)},end:{[e]:ia(h,f,"end",Math.min)}})}}return r}function hs(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=dt(s),o=dt(o)),{property:i,start:s,end:o}}function Bd(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=us(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 us(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function ia(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function na(i,t){let e=[],n=!1;return V(i)?(n=!0,e=i):e=Bd(i,t),e.length?new Jt({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function sa(i){return i&&i.fill!==!1}function Nd(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(!j(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function Vd(i,t,e){const n=Yd(i);if(T(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return j(s)&&Math.floor(s)===s?Wd(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Wd(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function Hd(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:T(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function jd(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:T(i)?n=i.value:n=t.getBaseValue(),n}function Yd(i){const t=i.options,e=t.fill;let n=D(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Ud(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,r=n.points,a=Xd(t,e);a.push(na({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++)qd(s,r[h],a)}return new Jt({points:s,options:{}})}function Xd(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 qd(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:a,point:l}=Kd(o,t,"x");if(!(!l||r&&a)){if(r)n.unshift(l);else if(i.push(l),!a)break}}i.push(...n)}function Kd(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],u=r[h.start][e],d=r[h.end][e];if(Et(s,u,d)){a=s===u,l=s===d;break}}return{first:a,last:l,point:n}}class oa{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:B},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 Gd(i){const{chart:t,fill:e,line:n}=i;if(j(e))return Zd(t,e);if(e==="stack")return Ud(i);if(e==="shape")return!0;const s=Jd(i);return s instanceof oa?s:na(s,n)}function Zd(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Jd(i){return(i.scale||{}).getPointPositionForValue?tf(i):Qd(i)}function Qd(i){const{scale:t={},fill:e}=i,n=Hd(e,t);if(j(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function tf(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=jd(e,t,o),a=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new oa({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 ds(i,t,e){const n=Gd(t),{line:s,scale:o,axis:r}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:u=c}=l||{};n&&s.points.length&&(Ni(i,e),ef(i,{line:s,target:n,above:h,below:u,area:e,scale:o,axis:r}),Vi(i))}function ef(i,t){const{line:e,target:n,above:s,below:o,area:r,scale:a}=t,l=e._loop?"angle":t.axis;i.save(),l==="x"&&o!==s&&(ra(i,n,r.top),aa(i,{line:e,target:n,color:s,scale:a,property:l}),i.restore(),i.save(),ra(i,n,r.bottom)),aa(i,{line:e,target:n,color:o,scale:a,property:l}),i.restore()}function ra(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],u=s[us(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(u.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function aa(i,t){const{line:e,target:n,property:s,color:o,scale:r}=t,a=$d(e,n,s);for(const{source:l,target:c,start:h,end:u}of a){const{style:{backgroundColor:d=o}={}}=l,f=n!==!0;i.save(),i.fillStyle=d,nf(i,r,f&&hs(s,h,u)),i.beginPath();const g=!!e.pathSegment(i,l);let p;if(f){g?i.closePath():la(i,n,u,s);const m=!!n.pathSegment(i,c,{move:g,reverse:!0});p=g&&m,p||la(i,n,h,s)}i.closePath(),i.fill(p?"evenodd":"nonzero"),i.restore()}}function nf(i,t,e){const{top:n,bottom:s}=t.chart.chartArea,{property:o,start:r,end:a}=e||{};o==="x"&&(i.beginPath(),i.rect(r,n,a-r,s-n),i.clip())}function la(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var sf={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 Jt&&(l={visible:i.isDatasetVisible(r),index:r,fill:Vd(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=Nd(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&&ds(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;sa(o)&&ds(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!sa(n)||e.drawTime!=="beforeDatasetDraw"||ds(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ca=(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)}},of=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class ha extends It{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=I(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=q(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ca(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 u=t;o.textAlign="left",o.textBaseline="middle";let d=-1,f=-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)&&(u+=h,c[c.length-(p>0?0:1)]=0,f+=h,d++),l[p]={left:0,top:f,row:d,width:m,height:s},c[c.length-1]+=m+a}),u}_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 u=a,d=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:_,itemHeight:y}=rf(n,e,o,m,s);b>0&&f+y+2*a>h&&(u+=d+a,c.push({width:d,height:f}),g+=d+a,p++,d=f=0),l[b]={left:g,top:f,col:p,width:_,height:y},d=Math.max(d,_),f+=y+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,r=De(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Q(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=Q(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=Q(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=Q(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;Ni(t,this),this._draw(),Vi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=Y.color,l=De(t.rtl,this.left,this.width),c=q(r.font),{padding:h}=r,u=c.size,d=u/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=ca(r,u),b=function(M,k,S){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const P=D(S.lineWidth,1);if(s.fillStyle=D(S.fillStyle,a),s.lineCap=D(S.lineCap,"butt"),s.lineDashOffset=D(S.lineDashOffset,0),s.lineJoin=D(S.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=D(S.strokeStyle,a),s.setLineDash(D(S.lineDash,[])),r.usePointStyle){const O={radius:p*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:P},A=l.xPlus(M,g/2),E=k+d;jo(s,O,A,E,r.pointStyleWidth&&g)}else{const O=k+Math.max((u-p)/2,0),A=l.leftForLtr(M,g),E=oe(S.borderRadius);s.beginPath(),Object.values(E).some(Z=>Z!==0)?Xe(s,{x:A,y:O,w:g,h:p,radius:E}):s.rect(A,O,g,p),s.fill(),P!==0&&s.stroke()}s.restore()},_=function(M,k,S){se(s,S.text,M,k+m/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();y?f={x:Q(o,this.left+h,this.right-n[0]),y:this.top+h+v,line:0}:f={x:this.left+h,y:Q(o,this.top+v+h,this.bottom-e[0].height),line:0},ir(this.ctx,t.textDirection);const x=m+h;this.legendItems.forEach((M,k)=>{s.strokeStyle=M.fontColor,s.fillStyle=M.fontColor;const S=s.measureText(M.text).width,P=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),O=g+d+S;let A=f.x,E=f.y;l.setWidth(this.width),y?k>0&&A+O+h>this.right&&(E=f.y+=x,f.line++,A=f.x=Q(o,this.left+h,this.right-n[f.line])):k>0&&E+x>this.bottom&&(A=f.x=A+e[f.line].width+h,f.line++,E=f.y=Q(o,this.top+v+h,this.bottom-e[f.line].height));const Z=l.x(A);if(b(Z,E,M),A=Rc(P,A+g+d,y?A+O:this.right,t.rtl),_(l.x(A),E,M),y)f.x+=O+h;else if(typeof M.text!="string"){const ft=c.lineHeight;f.y+=ua(M,ft)+h}else f.y+=x}),nr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=q(e.font),s=tt(e.padding);if(!e.display)return;const o=De(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=Q(t.align,u,this.right-d);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+Q(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=Q(a,u,u+d);r.textAlign=o.textAlign($n(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,se(r,e.text,f,h,n)}_computeTitleHeight(){const t=this.options.title,e=q(t.font),n=tt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(Et(t,this.left,this.right)&&Et(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],Et(t,s.left,s.left+s.width)&&Et(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!cf(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=of(s,n);s&&!o&&I(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&I(e.onHover,[t,n,this],this)}else n&&I(e.onClick,[t,n,this],this)}}function rf(i,t,e,n,s){const o=af(n,i,t,e),r=lf(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function af(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 lf(i,t,e){let n=i;return typeof t.text!="string"&&(n=ua(t,e)),n}function ua(i,t){const e=i.text?i.text.length:0;return t*e}function cf(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var hf={id:"legend",_element:ha,start(i,t,e){const n=i.legend=new ha({ctx:i.ctx,options:e,chart:i});et.configure(i,n,e),et.addBox(i,n)},stop(i){et.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;et.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=tt(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 fs extends It{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=V(n.text)?n.text.length:1;this._padding=tt(n.padding);const o=s*q(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,u;return this.isHorizontal()?(h=Q(a,n,o),u=e+t,c=o-n):(r.position==="left"?(h=n+t,u=Q(a,s,e),l=$*-.5):(h=o-t,u=Q(a,e,s),l=$*.5),c=s-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=q(e.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);se(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:$n(e.align),textBaseline:"middle",translation:[r,a]})}}function uf(i,t){const e=new fs({ctx:i.ctx,options:t,chart:i});et.configure(i,e,t),et.addBox(i,e),i.titleBlock=e}var df={id:"title",_element:fs,start(i,t,e){uf(i,e)},stop(i){const t=i.titleBlock;et.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;et.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 un=new WeakMap;var ff={id:"subtitle",start(i,t,e){const n=new fs({ctx:i.ctx,options:e,chart:i});et.configure(i,n,e),et.addBox(i,n),un.set(i,n)},stop(i){et.removeBox(i,un.get(i)),un.delete(i)},beforeUpdate(i,t,e){const n=un.get(i);et.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 ni={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=In(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 Ot(i,t){return t&&(V(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function $t(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
17
+ `)>-1?i.split(`
18
+ `):i}function gf(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 da(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=q(t.bodyFont),c=q(t.titleFont),h=q(t.footerFont),u=o.length,d=s.length,f=n.length,g=tt(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,u&&(p+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let _=0;const y=function(v){m=Math.max(m,e.measureText(v).width+_)};return e.save(),e.font=c.string,L(i.title,y),e.font=l.string,L(i.beforeBody.concat(i.afterBody),y),_=t.displayColors?r+2+t.boxPadding:0,L(n,v=>{L(v.before,y),L(v.lines,y),L(v.after,y)}),_=0,e.font=h.string,L(i.footer,y),e.restore(),m+=g.width,{width:m,height:p}}function pf(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function mf(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 bf(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"),mf(c,i,t,e)&&(c="center"),c}function fa(i,t,e){const n=e.yAlign||t.yAlign||pf(i,e);return{xAlign:e.xAlign||t.xAlign||bf(i,t,e,n),yAlign:n}}function _f(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function xf(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function ga(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=oe(r);let g=_f(t,a);const p=xf(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+s:a==="right"&&(g+=Math.max(u,f)+s),{x:K(g,0,n.width-t.width),y:K(p,0,n.height-t.height)}}function dn(i,t,e){const n=tt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function pa(i){return Ot([],$t(i))}function yf(i,t,e){return Zt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ma(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const ba={beforeTitle:Tt,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:Tt,beforeBody:Tt,beforeLabel:Tt,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:Tt,afterBody:Tt,beforeFooter:Tt,footer:Tt,afterFooter:Tt};function rt(i,t,e,n){const s=i[t].call(e,n);return typeof s>"u"?ba[t].call(e,n):s}class gs extends It{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 ur(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=yf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=rt(n,"beforeTitle",this,t),o=rt(n,"title",this,t),r=rt(n,"afterTitle",this,t);let a=[];return a=Ot(a,$t(s)),a=Ot(a,$t(o)),a=Ot(a,$t(r)),a}getBeforeBody(t,e){return pa(rt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return L(t,o=>{const r={before:[],lines:[],after:[]},a=ma(n,o);Ot(r.before,$t(rt(a,"beforeLabel",this,o))),Ot(r.lines,rt(a,"label",this,o)),Ot(r.after,$t(rt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return pa(rt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=rt(n,"beforeFooter",this,t),o=rt(n,"footer",this,t),r=rt(n,"afterFooter",this,t);let a=[];return a=Ot(a,$t(s)),a=Ot(a,$t(o)),a=Ot(a,$t(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(gf(this.chart,e[l]));return t.filter&&(a=a.filter((h,u,d)=>t.filter(h,u,d,n))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,n))),L(a,h=>{const u=ma(t.callbacks,h);s.push(rt(u,"labelColor",this,h)),o.push(rt(u,"labelPointStyle",this,h)),r.push(rt(u,"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=ni[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=da(this,n),c=Object.assign({},a,l),h=fa(this.chart,n,c),u=ga(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:u.x,y:u.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:u}=oe(a),{x:d,y:f}=t,{width:g,height:p}=e;let m,b,_,y,v,x;return o==="center"?(v=f+p/2,s==="left"?(m=d,b=m-r,y=v+r,x=v-r):(m=d+g,b=m+r,y=v-r,x=v+r),_=m):(s==="left"?b=d+Math.max(l,h)+r:s==="right"?b=d+g-Math.max(c,u)-r:b=this.caretX,o==="top"?(y=f,v=y-r,m=b-r,_=b+r):(y=f+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=De(n.rtl,this.x,this.width);for(t.x=dn(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",r=q(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=q(o.bodyFont),u=dn(this,"left",o),d=s.x(u),f=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+f;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(d,c)+c/2,b=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Hn(t,p,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Hn(t,p,m,b)}else{t.lineWidth=T(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(d,c),m=s.leftForLtr(s.xPlus(d,1),c-2),b=oe(r.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Xe(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Xe(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,u=q(n.bodyFont);let d=u.lineHeight,f=0;const g=De(n.rtl,this.x,this.width),p=function(S){e.fillText(S,g.x(t.x+f),t.y+d/2),t.y+=d+o},m=g.textAlign(r);let b,_,y,v,x,M,k;for(e.textAlign=r,e.textBaseline="middle",e.font=u.string,t.x=dn(this,m,n),e.fillStyle=n.bodyColor,L(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,M=s.length;v<M;++v){for(b=s[v],_=this.labelTextColors[v],e.fillStyle=_,L(b.before,p),y=b.lines,a&&y.length&&(this._drawColorBox(e,t,v,g,n),d=Math.max(u.lineHeight,l)),x=0,k=y.length;x<k;++x)p(y[x]),d=u.lineHeight;L(b.after,p)}f=0,d=u.lineHeight,L(this.afterBody,p),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let r,a;if(o){const l=De(n.rtl,this.x,this.width);for(t.x=dn(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",r=q(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:u,topRight:d,bottomLeft:f,bottomRight:g}=oe(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+u,l),r==="top"&&this.drawCaret(t,e,n,s),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),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+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(a,l+u),e.quadraticCurveTo(a,l,a+u,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=ni[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=da(this,t),l=Object.assign({},r,this._size),c=fa(e,t,l),h=ga(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=tt(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),ir(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),nr(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=!Ri(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||!Ri(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=ni[o.position].call(this,t,e);return r!==!1&&(n!==r.x||s!==r.y)}}w(gs,"positioners",ni);var vf={id:"tooltip",_element:gs,positioners:ni,afterInit(i,t,e){e&&(i.tooltip=new gs({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:ba},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 wf=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Mf(i,t,e,n){const s=i.indexOf(t);if(s===-1)return wf(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const kf=(i,t)=>i===null?null:K(Math.round(i),0,t);function _a(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class ps extends he{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:Mf(n,t,D(e,t),this._addedLabels),kf(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 _a.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}}w(ps,"id","category"),w(ps,"defaults",{ticks:{callback:_a}});function Sf(i,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=i,f=o||1,g=h-1,{min:p,max:m}=t,b=!C(r),_=!C(a),y=!C(c),v=(m-p)/(u+1);let x=Do((m-p)/g/f)*f,M,k,S,P;if(x<1e-14&&!b&&!_)return[{value:p},{value:m}];P=Math.ceil(m/x)-Math.floor(p/x),P>g&&(x=Do(P*x/g/f)*f),C(l)||(M=Math.pow(10,l),x=Math.ceil(x*M)/M),s==="ticks"?(k=Math.floor(p/x)*x,S=Math.ceil(m/x)*x):(k=p,S=m),b&&_&&o&&Dc((a-r)/o,x/1e3)?(P=Math.round(Math.min((a-r)/x,h)),x=(a-r)/P,k=r,S=a):y?(k=b?r:k,S=_?a:S,P=c-1,x=(S-k)/P):(P=(S-k)/x,We(P,Math.round(P),x/1e3)?P=Math.round(P):P=Math.ceil(P));const O=Math.max(Ao(x),Ao(k));M=Math.pow(10,C(l)?O:l),k=Math.round(k*M)/M,S=Math.round(S*M)/M;let A=0;for(b&&(d&&k!==r?(e.push({value:r}),k<r&&A++,We(Math.round((k+A*x)*M)/M,r,xa(r,v,i))&&A++):k<r&&A++);A<P;++A){const E=Math.round((k+A*x)*M)/M;if(_&&E>a)break;e.push({value:E})}return _&&d&&S!==a?e.length&&We(e[e.length-1].value,a,xa(a,v,i))?e[e.length-1].value=a:e.push({value:a}):(!_||S===a)&&e.push({value:S}),e}function xa(i,t,{horizontal:e,minRotation:n}){const s=yt(n),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class fn extends he{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=Pt(s),c=Pt(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=Sf(s,o);return t.bounds==="ticks"&&Oo(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 Ye(t,this.chart.options.locale,this.options.ticks.format)}}class ms extends fn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=j(t)?t:0,this.max=j(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=yt(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}}w(ms,"id","linear"),w(ms,"defaults",{ticks:{callback:$i.formatters.numeric}});const si=i=>Math.floor(Gt(i)),ue=(i,t)=>Math.pow(10,si(i)+t);function ya(i){return i/Math.pow(10,si(i))===1}function va(i,t,e){const n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function Pf(i,t){const e=t-i;let n=si(e);for(;va(i,t,n)>10;)n++;for(;va(i,t,n)<10;)n--;return Math.min(n,si(i))}function Df(i,{min:t,max:e}){t=ut(i.min,t);const n=[],s=si(t);let o=Pf(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 u=Math.floor((c-h)/Math.pow(10,o)),d=ut(i.min,Math.round((l+h+u*Math.pow(10,o))*r)/r);for(;d<e;)n.push({value:d,major:ya(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,r=o>=0?1:r),d=Math.round((l+h+u*Math.pow(10,o))*r)/r;const f=ut(i.max,d);return n.push({value:f,major:ya(f),significand:u}),n}class bs extends he{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=fn.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return j(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=j(t)?Math.max(0,t):null,this.max=j(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!j(this._userMin)&&(this.min=t===ue(this.min,0)?ue(this.min,-1):ue(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let 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(ue(n,-1)),r(ue(s,1)))),n<=0&&o(ue(s,-1)),s<=0&&r(ue(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=Df(e,this);return t.bounds==="ticks"&&Oo(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":Ye(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Gt(t),this._valueRange=Gt(this.max)-Gt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Gt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}w(bs,"id","logarithmic"),w(bs,"defaults",{ticks:{callback:$i.formatters.logarithmic,major:{enabled:!0}}});function _s(i){const t=i.ticks;if(t.display&&i.display){const e=tt(t.backdropPadding);return D(t.font&&t.font.size,Y.font.size)+e.height}return 0}function Of(i,t,e){return e=V(e)?e:[e],{w:jc(i,t.string,e),h:e.length*t.lineHeight}}function wa(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 Af(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?$/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),u=q(c.font),d=Of(i.ctx,u,i._pointLabels[l]);n[l]=d;const f=dt(i.getIndexAngle(l)+a),g=Math.round(Fn(f)),p=wa(g,h.x,d.w,0,180),m=wa(g,h.y,d.h,90,270);Cf(e,t,f,p,m)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Lf(i,n,s)}function Cf(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 Tf(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(Fn(dt(l.angle+U))),h=If(l.y,a.h,c),u=Rf(c),d=Ff(l.x,a.w,u);return{visible:!0,x:l.x,y:h,textAlign:u,left:d,top:h,right:d+a.w,bottom:h+a.h}}function Ef(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(Rt({x:e,y:n},t)||Rt({x:e,y:o},t)||Rt({x:s,y:n},t)||Rt({x:s,y:o},t))}function Lf(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:_s(o)/2,additionalAngle:r?$/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const u=Tf(i,h,l);n.push(u),a==="auto"&&(u.visible=Ef(u,c),u.visible&&(c=u))}return n}function Rf(i){return i===0||i===180?"center":i<180?"left":"right"}function Ff(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function If(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function zf(i,t,e){const{left:n,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!C(a)){const l=oe(t.borderRadius),c=tt(t.backdropPadding);i.fillStyle=a;const h=n-c.left,u=s-c.top,d=o-n+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(i.beginPath(),Xe(i,{x:h,y:u,w:d,h:f,radius:l}),i.fill()):i.fillRect(h,u,d,f)}}function $f(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));zf(e,r,o);const a=q(r.font),{x:l,y:c,textAlign:h}=o;se(e,i._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Ma(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,B);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 Bf(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(),Ma(i,e,r,n),o.closePath(),o.stroke(),o.restore())}function Nf(i,t,e){return Zt(i,{label:e,index:t,type:"pointLabel"})}class oi extends fn{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=tt(_s(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=j(t)&&!isNaN(t)?t:0,this.max=j(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/_s(this.options))}generateTickLabels(t){fn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=I(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?Af(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=B/(this._pointLabels.length||1),n=this.options.startAngle||0;return dt(t*e+yt(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 Nf(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-U+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(),Ma(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&&$f(this,r),s.display&&this.ticks.forEach((h,u)=>{if(u!==0||u===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const d=this.getContext(u),f=s.setContext(d),g=o.setContext(d);Bf(this,f,l,r,g)}}),n.display){for(t.save(),a=r-1;a>=0;a--){const h=n.setContext(this.getPointLabelContext(a)),{color:u,lineWidth:d}=h;!d||!u||(t.lineWidth=d,t.strokeStyle=u,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=q(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 u=tt(c.backdropPadding);t.fillRect(-r/2-u.left,-o-h.size/2-u.top,r+u.width,h.size+u.height)}se(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}w(oi,"id","radialLinear"),w(oi,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:$i.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),w(oi,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),w(oi,"descriptors",{angleLines:{_fallback:"grid"}});const gn={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}},at=Object.keys(gn);function ka(i,t){return i-t}function Sa(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)),j(r)||(r=typeof n=="string"?e.parse(r,n):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(ke(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function Pa(i,t,e,n){const s=at.length;for(let o=at.indexOf(i);o<s-1;++o){const r=gn[at[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=n)return at[o]}return at[s-1]}function Vf(i,t,e,n,s){for(let o=at.length-1;o>=at.indexOf(e);o--){const r=at[o];if(gn[r].common&&i._adapter.diff(s,n,r)>=t-1)return r}return at[e?at.indexOf(e):0]}function Wf(i){for(let t=at.indexOf(i)+1,e=at.length;t<e;++t)if(gn[at[t]].common)return at[t]}function Da(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=zn(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function Hf(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 Oa(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:Hf(i,n,s,e)}class ri extends he{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 ou._date(t.adapters.date);s.init(e),Ne(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:Sa(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=j(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=j(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=Tc(s,o,r);return this._unit=e.unit||(n.autoSkip?Pa(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Vf(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Wf(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Oa(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=K(e,0,r),n=K(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||Pa(o.minUnit,e,n,this._getLabelCapacity(e)),a=D(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=ke(l)||l===!0,h={};let u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,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(d=u,f=0;d<n;d=+t.add(d,a,r),f++)Da(h,d,g);return(d===n||s.bounds==="ticks"||f===1)&&Da(h,d,g),Object.keys(h).sort(ka).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 I(r,[t,e,n],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],u=c&&a[c],d=n[e],f=c&&u&&d&&d.major;return this._adapter.format(t,s||(f?u: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=yt(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,Oa(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(Sa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Lo(t.sort(ka))}}w(ri,"id","time"),w(ri,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function pn(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}=Lt(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}=Lt(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 xs extends ri{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=pn(e,this.min),this._tableRange=pn(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(pn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return pn(this._table,n*this._tableRange+this._minPos,!0)}}w(xs,"id","timeseries"),w(xs,"defaults",ri.defaults);var jf=Fl('<div part="container" class="chart-container svelte-18irkjf"><canvas id="canvas"></canvas></div>');const Yf={hash:"svelte-18irkjf",code:".chart-container.svelte-18irkjf {position:relative;margin:auto;}"};function Aa(i,t){so(t,!0),$l(i,Yf);const e=t.$$host;zt.register(ii,Jt,hn,cn,Ui,Xi,Oe,qi,ts,Ki,Gi,Zi,ps,ms,bs,oi,ri,xs,zd,sf,hf,df,vf,ff);function n(f,g){t.$$host.dispatchEvent(new CustomEvent(f,{detail:g}))}let s=uo(t,"id",7,""),o=uo(t,"data",7,void 0),r=!1,a=nl(void 0);Zs(()=>{o()&&typeof o()=="string"&&o(JSON.parse(o())),c()});function l(f){var m,b,_,y,v;const g=(m=J(a))==null?void 0:m.getElementsAtEventForMode(f,"nearest",{intersect:!0},!0);let p={};if(g!=null&&g.length){const x=g[0];p.label=(y=(_=(b=J(a))==null?void 0:b.data)==null?void 0:_.labels)==null?void 0:y[x.index],p.value=(v=J(a))==null?void 0:v.data.datasets[x.datasetIndex].data[x.index]}n("chartClick",p)}function c(){var f,g;r&&o()&&((f=e==null?void 0:e.shadowRoot)!=null&&f.getElementById("canvas"))&&(J(a)&&(J(a).destroy(),mt(a,void 0)),mt(a,be(new zt((g=e==null?void 0:e.shadowRoot)==null?void 0:g.getElementById("canvas"),{type:o().type,data:o().data,options:o().options}))))}Bl(()=>{r=!0,c()});var h=jf(),u=cl(h),d=Ts(()=>Xl(l,200));return u.__click=function(...f){var g;(g=J(d))==null||g.apply(this,f)},ll(h),lo(i,h),oo({get id(){return s()},set id(f=""){s(f),Di()},get data(){return o()},set data(f=void 0){o(f),Di()}})}Ll(["click"]),customElements.define("hb-chartjs",Hl(Aa,{id:{},data:{}},[],[],!0)),N.Component=Aa,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})})(this.chartjs=this.chartjs||{});