@oliasoft-open-source/charts-library 5.1.1 → 5.1.2-beta-2
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/dist/assets/{Color-YHDXOIA2-BMZgyHAN.js → Color-YHDXOIA2-D1T4LLq8.js} +1 -1
- package/dist/assets/{DocsRenderer-CFRXHY34-CbvfojdO.js → DocsRenderer-CFRXHY34-D6Q7Fl4L.js} +4 -4
- package/dist/assets/bar-chart.stories-5CuN6VFG.js +136 -0
- package/dist/assets/chunk-XP5HYGXS-D5tuasO7.js +1 -0
- package/dist/assets/{client-9BU5HM4U.js → client-DnE3718B.js} +1 -1
- package/dist/assets/entry-preview-D2nZ6Uy3.js +2 -0
- package/dist/assets/{entry-preview-docs-z3mMcuG4.js → entry-preview-docs-Cet2djRm.js} +1 -1
- package/dist/assets/{get-draggableData-6sYCK0Sg.js → get-draggableData-eD2Xdq-6.js} +2 -2
- package/dist/assets/{iframe-BMP-xuj2.js → iframe-BRmCfBZj.js} +15 -15
- package/dist/assets/{index-D3-0uUTW.js → index-BhTLYoCu.js} +1 -1
- package/dist/assets/{index-B-BONL6g.js → index-CgYGpm1H.js} +1 -1
- package/dist/assets/index-DHw5ixvP.js +1 -0
- package/dist/assets/index-YTOF1_EJ.js +9 -0
- package/dist/assets/{index-CVdx34fM.js → index-uDG1oqxT.js} +1 -1
- package/dist/assets/jsx-runtime-W3oueGCa.js +9 -0
- package/dist/assets/legend-Cgq98xea.js +1367 -0
- package/dist/assets/{legend-context-CuYQJx0k.js → legend-context-PSa8HhGj.js} +22 -22
- package/dist/assets/line-chart-DQPiqg-c.js +1 -0
- package/dist/assets/{line-chart.stories-CCmSDSVh.js → line-chart.stories-yZbOjEZw.js} +16 -13
- package/dist/assets/{line-chart.test-case.stories-tBreUWeJ.js → line-chart.test-case.stories-KRbhVyto.js} +1 -1
- package/dist/assets/{pie-chart.stories-cGmfyrjX.js → pie-chart.stories-C3l9VGYJ.js} +1 -1
- package/dist/assets/{preview-DjxCxm3j.js → preview-OTEdgn42.js} +2 -2
- package/dist/assets/{preview-cjTsgsnd.js → preview-THptAU8l.js} +1 -1
- package/dist/assets/{react-18-DZY5LW1V.js → react-18-BdgjDjvZ.js} +1 -1
- package/dist/assets/{scatter-chart.stories-BK0zwTCK.js → scatter-chart.stories-U-tLziOZ.js} +6 -6
- package/dist/assets/test-utils-BBHUGUfi.js +9 -0
- package/dist/iframe.html +1 -1
- package/dist/index.js +34 -110
- package/dist/line-chart/hooks/use-chart-state.d.ts +1 -5
- package/dist/line-chart/state/initial-state.d.ts +0 -3
- package/dist/line-chart/utils/axis-scales/axis-scales.d.ts +1 -3
- package/dist/line-chart/utils/line-chart-utils.d.ts +6 -1
- package/dist/project.json +1 -1
- package/dist/sb-manager/globals-runtime.js +1 -1
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +1 -5
- package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +1 -3
- package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +6 -1
- package/package.json +1 -1
- package/dist/assets/bar-chart.stories-BxoeoHbp.js +0 -153
- package/dist/assets/entry-preview-BsyjCx5f.js +0 -10
- package/dist/assets/index-BGqSdrBK.js +0 -1
- package/dist/assets/index-eCxJ45ll.js +0 -9
- package/dist/assets/jsx-runtime-Y5Ju2SGo.js +0 -9
- package/dist/assets/legend-DOpGXAxK.js +0 -1346
- package/dist/assets/line-chart-BWgI7lqL.js +0 -1
- package/dist/assets/react-CxVRKATl.js +0 -1
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import{j as Y}from"./jsx-runtime-Y5Ju2SGo.js";import{r as es}from"./index-eCxJ45ll.js";import{g as al}from"./get-custom-legend-plugin-example-Bx2dNJXg.js";import{K as ll,C as $t,g as qr,M as cl,N as hl,w as ys,x as q,S as Ge,y as dl,O as ul,A as Lt,E as ns,Q as Ys,R as fl,T as gl,L as Xs,a as pl,U as Kr,V as ml,W as Us,d as bl,r as _l,B as xl,z as yl,f as vl,P as wl,b as Sl,s as kl,F as Ml,X as Cl,I as Al,h as Pl,i as Ol,J as Dl,Y as Ll,j as Tl,k as Rl,Z as El,p as Il,m as Fl,n as Bl,o as zl,q as Nl,t as jl}from"./legend-context-CuYQJx0k.js";import{j as Vl,u as Wl,t as Hl,p as $l,B as Yl,m as Xl,H as Ul,L as Gl,n as ql,o as Kl}from"./legend-DOpGXAxK.js";import{f as Gs,a as Zl,b as Ql,C as Jl,c as tc}from"./get-draggableData-6sYCK0Sg.js";import{D as ec,a as nc}from"./bar-chart-const-Cgj9sgUU.js";import"./index-B-BONL6g.js";import"./index-BGqSdrBK.js";import"./index-D3-0uUTW.js";/*!
|
|
2
|
-
* Chart.js v3.9.1
|
|
3
|
-
* https://www.chartjs.org
|
|
4
|
-
* (c) 2022 Chart.js Contributors
|
|
5
|
-
* Released under the MIT License
|
|
6
|
-
*/const sc=function(){let e=0;return function(){return e++}}();function R(e){return e===null||typeof e>"u"}function V(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function D(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}const U=e=>(typeof e=="number"||e instanceof Number)&&isFinite(+e);function et(e,t){return U(e)?e:t}function O(e,t){return typeof e>"u"?t:e}const ic=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:e/t,Zr=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function W(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function T(e,t,n,s){let i,o,r;if(V(e))for(o=e.length,i=0;i<o;i++)t.call(n,e[i],i);else if(D(e))for(r=Object.keys(e),o=r.length,i=0;i<o;i++)t.call(n,e[r[i]],r[i])}function gn(e,t){let n,s,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,s=e.length;n<s;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function pn(e){if(V(e))return e.map(pn);if(D(e)){const t=Object.create(null),n=Object.keys(e),s=n.length;let i=0;for(;i<s;++i)t[n[i]]=pn(e[n[i]]);return t}return e}function Qr(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function oc(e,t,n,s){if(!Qr(e))return;const i=t[e],o=n[e];D(i)&&D(o)?Ne(i,o,s):t[e]=pn(o)}function Ne(e,t,n){const s=V(t)?t:[t],i=s.length;if(!D(e))return e;n=n||{};const o=n.merger||oc;for(let r=0;r<i;++r){if(t=s[r],!D(t))continue;const a=Object.keys(t);for(let l=0,c=a.length;l<c;++l)o(a[l],e,t,n)}return e}function Ie(e,t){return Ne(e,t,{merger:rc})}function rc(e,t,n){if(!Qr(e))return;const s=t[e],i=n[e];D(s)&&D(i)?Ie(s,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=pn(i))}const qs={"":e=>e,x:e=>e.x,y:e=>e.y};function Mt(e,t){return(qs[t]||(qs[t]=ac(t)))(e)}function ac(e){const t=lc(e);return n=>{for(const s of t){if(s==="")break;n=n&&n[s]}return n}}function lc(e){const t=e.split("."),n=[];let s="";for(const i of t)s+=i,s.endsWith("\\")?s=s.slice(0,-1)+".":(n.push(s),s="");return n}function vs(e){return e.charAt(0).toUpperCase()+e.slice(1)}const it=e=>typeof e<"u",Ct=e=>typeof e=="function",Ks=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function cc(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const $=Math.PI,z=2*$,hc=z+$,mn=Number.POSITIVE_INFINITY,dc=$/180,H=$/2,Kt=$/4,Zs=$*2/3,st=Math.log10,ut=Math.sign;function Qs(e){const t=Math.round(e);e=Fe(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(st(e))),s=e/n;return(s<=1?1:s<=2?2:s<=5?5:10)*n}function uc(e){const t=[],n=Math.sqrt(e);let s;for(s=1;s<n;s++)e%s===0&&(t.push(s),t.push(e/s));return n===(n|0)&&t.push(n),t.sort((i,o)=>i-o).pop(),t}function Xt(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Fe(e,t,n){return Math.abs(e-t)<n}function fc(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Jr(e,t,n){let s,i,o;for(s=0,i=e.length;s<i;s++)o=e[s][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function at(e){return e*($/180)}function ws(e){return e*(180/$)}function Js(e){if(!U(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function ta(e,t){const n=t.x-e.x,s=t.y-e.y,i=Math.sqrt(n*n+s*s);let o=Math.atan2(s,n);return o<-.5*$&&(o+=z),{angle:o,distance:i}}function ss(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function gc(e,t){return(e-t+hc)%z-$}function rt(e){return(e%z+z)%z}function je(e,t,n,s){const i=rt(e),o=rt(t),r=rt(n),a=rt(o-i),l=rt(r-i),c=rt(i-o),h=rt(i-r);return i===o||i===r||s&&o===r||a>l&&c<h}function K(e,t,n){return Math.max(t,Math.min(n,e))}function pc(e){return K(e,-32768,32767)}function bn(e,t,n,s=1e-6){return e>=Math.min(t,n)-s&&e<=Math.max(t,n)+s}function Ss(e,t,n){n=n||(r=>e[r]<t);let s=e.length-1,i=0,o;for(;s-i>1;)o=i+s>>1,n(o)?i=o:s=o;return{lo:i,hi:s}}const It=(e,t,n,s)=>Ss(e,n,s?i=>e[i][t]<=n:i=>e[i][t]<n),mc=(e,t,n)=>Ss(e,n,s=>e[s][t]>=n);function bc(e,t,n){let s=0,i=e.length;for(;s<i&&e[s]<t;)s++;for(;i>s&&e[i-1]>n;)i--;return s>0||i<e.length?e.slice(s,i):e}const ea=["push","pop","shift","splice","unshift"];function _c(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ea.forEach(n=>{const s="_onData"+vs(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function ti(e,t){const n=e._chartjs;if(!n)return;const s=n.listeners,i=s.indexOf(t);i!==-1&&s.splice(i,1),!(s.length>0)&&(ea.forEach(o=>{delete e[o]}),delete e._chartjs)}function na(e){const t=new Set;let n,s;for(n=0,s=e.length;n<s;++n)t.add(e[n]);return t.size===s?e:Array.from(t)}const sa=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function ia(e,t,n){const s=n||(r=>Array.prototype.slice.call(r));let i=!1,o=[];return function(...r){o=s(r),i||(i=!0,sa.call(window,()=>{i=!1,e.apply(t,o)}))}}function xc(e,t){let n;return function(...s){return t?(clearTimeout(n),n=setTimeout(e,t,s)):e.apply(this,s),t}}const yc=e=>e==="start"?"left":e==="end"?"right":"center",ei=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2;function oa(e,t,n){const s=t.length;let i=0,o=s;if(e._sorted){const{iScale:r,_parsed:a}=e,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(i=K(Math.min(It(a,r.axis,c).lo,n?s:It(t,l,r.getPixelForValue(c)).lo),0,s-1)),u?o=K(Math.max(It(a,r.axis,h,!0).hi+1,n?0:It(t,l,r.getPixelForValue(h),!0).hi+1),i,s)-i:o=s-i}return{start:i,count:o}}function ra(e){const{xScale:t,yScale:n,_scaleRanges:s}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!s)return e._scaleRanges=i,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==n.min||s.ymax!==n.max;return Object.assign(s,i),o}const qe=e=>e===0||e===1,ni=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*z/n)),si=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*z/n)+1,Be={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*H)+1,easeOutSine:e=>Math.sin(e*H),easeInOutSine:e=>-.5*(Math.cos($*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>qe(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>qe(e)?e:ni(e,.075,.3),easeOutElastic:e=>qe(e)?e:si(e,.075,.3),easeInOutElastic(e){return qe(e)?e:e<.5?.5*ni(e*2,.1125,.45):.5+.5*si(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Be.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Be.easeInBounce(e*2)*.5:Be.easeOutBounce(e*2-1)*.5+.5};/*!
|
|
7
|
-
* @kurkle/color v0.2.1
|
|
8
|
-
* https://github.com/kurkle/color#readme
|
|
9
|
-
* (c) 2022 Jukka Kurkela
|
|
10
|
-
* Released under the MIT License
|
|
11
|
-
*/function He(e){return e+.5|0}const wt=(e,t,n)=>Math.max(Math.min(e,n),t);function se(e){return wt(He(e*2.55),0,255)}function kt(e){return wt(He(e*255),0,255)}function bt(e){return wt(He(e/2.55)/100,0,1)}function ii(e){return wt(He(e*100),0,100)}const tt={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},is=[..."0123456789ABCDEF"],vc=e=>is[e&15],wc=e=>is[(e&240)>>4]+is[e&15],Ke=e=>(e&240)>>4===(e&15),Sc=e=>Ke(e.r)&&Ke(e.g)&&Ke(e.b)&&Ke(e.a);function kc(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&tt[e[1]]*17,g:255&tt[e[2]]*17,b:255&tt[e[3]]*17,a:t===5?tt[e[4]]*17:255}:(t===7||t===9)&&(n={r:tt[e[1]]<<4|tt[e[2]],g:tt[e[3]]<<4|tt[e[4]],b:tt[e[5]]<<4|tt[e[6]],a:t===9?tt[e[7]]<<4|tt[e[8]]:255})),n}const Mc=(e,t)=>e<255?t(e):"";function Cc(e){var t=Sc(e)?vc:wc;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Mc(e.a,t):void 0}const Ac=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function aa(e,t,n){const s=t*Math.min(n,1-n),i=(o,r=(o+e/30)%12)=>n-s*Math.max(Math.min(r-3,9-r,1),-1);return[i(0),i(8),i(4)]}function Pc(e,t,n){const s=(i,o=(i+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Oc(e,t,n){const s=aa(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)s[i]*=1-t-n,s[i]+=t;return s}function Dc(e,t,n,s,i){return e===i?(t-n)/s+(t<n?6:0):t===i?(n-e)/s+2:(e-t)/s+4}function ks(e){const n=e.r/255,s=e.g/255,i=e.b/255,o=Math.max(n,s,i),r=Math.min(n,s,i),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=Dc(n,s,i,h,o),l=l*60+.5),[l|0,c||0,a]}function Ms(e,t,n,s){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,s)).map(kt)}function Cs(e,t,n){return Ms(aa,e,t,n)}function Lc(e,t,n){return Ms(Oc,e,t,n)}function Tc(e,t,n){return Ms(Pc,e,t,n)}function la(e){return(e%360+360)%360}function Rc(e){const t=Ac.exec(e);let n=255,s;if(!t)return;t[5]!==s&&(n=t[6]?se(+t[5]):kt(+t[5]));const i=la(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=Lc(i,o,r):t[1]==="hsv"?s=Tc(i,o,r):s=Cs(i,o,r),{r:s[0],g:s[1],b:s[2],a:n}}function Ec(e,t){var n=ks(e);n[0]=la(n[0]+t),n=Cs(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Ic(e){if(!e)return;const t=ks(e),n=t[0],s=ii(t[1]),i=ii(t[2]);return e.a<255?`hsla(${n}, ${s}%, ${i}%, ${bt(e.a)})`:`hsl(${n}, ${s}%, ${i}%)`}const oi={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"},ri={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 Fc(){const e={},t=Object.keys(ri),n=Object.keys(oi);let s,i,o,r,a;for(s=0;s<t.length;s++){for(r=a=t[s],i=0;i<n.length;i++)o=n[i],a=a.replace(o,oi[o]);o=parseInt(ri[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Ze;function Bc(e){Ze||(Ze=Fc(),Ze.transparent=[0,0,0,0]);const t=Ze[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const zc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Nc(e){const t=zc.exec(e);let n=255,s,i,o;if(t){if(t[7]!==s){const r=+t[7];n=t[8]?se(r):wt(r*255,0,255)}return s=+t[1],i=+t[3],o=+t[5],s=255&(t[2]?se(s):wt(s,0,255)),i=255&(t[4]?se(i):wt(i,0,255)),o=255&(t[6]?se(o):wt(o,0,255)),{r:s,g:i,b:o,a:n}}}function jc(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${bt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const jn=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,jt=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Vc(e,t,n){const s=jt(bt(e.r)),i=jt(bt(e.g)),o=jt(bt(e.b));return{r:kt(jn(s+n*(jt(bt(t.r))-s))),g:kt(jn(i+n*(jt(bt(t.g))-i))),b:kt(jn(o+n*(jt(bt(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Qe(e,t,n){if(e){let s=ks(e);s[t]=Math.max(0,Math.min(s[t]+s[t]*n,t===0?360:1)),s=Cs(s),e.r=s[0],e.g=s[1],e.b=s[2]}}function ca(e,t){return e&&Object.assign(t||{},e)}function ai(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=kt(e[3]))):(t=ca(e,{r:0,g:0,b:0,a:1}),t.a=kt(t.a)),t}function Wc(e){return e.charAt(0)==="r"?Nc(e):Rc(e)}class _n{constructor(t){if(t instanceof _n)return t;const n=typeof t;let s;n==="object"?s=ai(t):n==="string"&&(s=kc(t)||Bc(t)||Wc(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=ca(this._rgb);return t&&(t.a=bt(t.a)),t}set rgb(t){this._rgb=ai(t)}rgbString(){return this._valid?jc(this._rgb):void 0}hexString(){return this._valid?Cc(this._rgb):void 0}hslString(){return this._valid?Ic(this._rgb):void 0}mix(t,n){if(t){const s=this.rgb,i=t.rgb;let o;const r=n===o?.5:n,a=2*r-1,l=s.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*i.r+.5,s.g=255&c*s.g+o*i.g+.5,s.b=255&c*s.b+o*i.b+.5,s.a=r*s.a+(1-r)*i.a,this.rgb=s}return this}interpolate(t,n){return t&&(this._rgb=Vc(this._rgb,t._rgb,n)),this}clone(){return new _n(this.rgb)}alpha(t){return this._rgb.a=kt(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=He(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.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 Qe(this._rgb,2,t),this}darken(t){return Qe(this._rgb,2,-t),this}saturate(t){return Qe(this._rgb,1,t),this}desaturate(t){return Qe(this._rgb,1,-t),this}rotate(t){return Ec(this._rgb,t),this}}function ha(e){return new _n(e)}function da(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function li(e){return da(e)?e:ha(e)}function Vn(e){return da(e)?e:ha(e).saturate(.5).darken(.1).hexString()}const Bt=Object.create(null),os=Object.create(null);function ze(e,t){if(!t)return e;const n=t.split(".");for(let s=0,i=n.length;s<i;++s){const o=n[s];e=e[o]||(e[o]=Object.create(null))}return e}function Wn(e,t,n){return typeof t=="string"?Ne(ze(e,t),n):Ne(ze(e,""),t)}class Hc{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=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)=>Vn(s.backgroundColor),this.hoverBorderColor=(n,s)=>Vn(s.borderColor),this.hoverColor=(n,s)=>Vn(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)}set(t,n){return Wn(this,t,n)}get(t){return ze(this,t)}describe(t,n){return Wn(os,t,n)}override(t,n){return Wn(Bt,t,n)}route(t,n,s,i){const o=ze(this,t),r=ze(this,s),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=r[i];return D(l)?Object.assign({},c,l):O(l,c)},set(l){this[a]=l}}})}}var P=new Hc({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function $c(e){return!e||R(e.size)||R(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function xn(e,t,n,s,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>s&&(s=o),s}function Yc(e,t,n,s){s=s||{};let i=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(i=s.data={},o=s.garbageCollect=[],s.font=t),e.save(),e.font=t;let r=0;const a=n.length;let l,c,h,d,u;for(l=0;l<a;l++)if(d=n[l],d!=null&&V(d)!==!0)r=xn(e,i,o,r,d);else if(V(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!V(u)&&(r=xn(e,i,o,r,u));e.restore();const f=o.length/2;if(f>n.length){for(l=0;l<f;l++)delete i[o[l]];o.splice(0,f)}return r}function Ot(e,t,n){const s=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*s)/s+i}function ci(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function rs(e,t,n,s){Xc(e,t,n,s)}function Xc(e,t,n,s,i){let o,r,a,l,c,h;const d=t.pointStyle,u=t.rotation,f=t.radius;let g=(u||0)*dc;if(d&&typeof d=="object"&&(o=d.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,s),e.rotate(g),e.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),e.restore();return}if(!(isNaN(f)||f<=0)){switch(e.beginPath(),d){default:e.arc(n,s,f,0,z),e.closePath();break;case"triangle":e.moveTo(n+Math.sin(g)*f,s-Math.cos(g)*f),g+=Zs,e.lineTo(n+Math.sin(g)*f,s-Math.cos(g)*f),g+=Zs,e.lineTo(n+Math.sin(g)*f,s-Math.cos(g)*f),e.closePath();break;case"rectRounded":c=f*.516,l=f-c,r=Math.cos(g+Kt)*l,a=Math.sin(g+Kt)*l,e.arc(n-r,s-a,c,g-$,g-H),e.arc(n+a,s-r,c,g-H,g),e.arc(n+r,s+a,c,g,g+H),e.arc(n-a,s+r,c,g+H,g+$),e.closePath();break;case"rect":if(!u){l=Math.SQRT1_2*f,h=l,e.rect(n-h,s-l,2*h,2*l);break}g+=Kt;case"rectRot":r=Math.cos(g)*f,a=Math.sin(g)*f,e.moveTo(n-r,s-a),e.lineTo(n+a,s-r),e.lineTo(n+r,s+a),e.lineTo(n-a,s+r),e.closePath();break;case"crossRot":g+=Kt;case"cross":r=Math.cos(g)*f,a=Math.sin(g)*f,e.moveTo(n-r,s-a),e.lineTo(n+r,s+a),e.moveTo(n+a,s-r),e.lineTo(n-a,s+r);break;case"star":r=Math.cos(g)*f,a=Math.sin(g)*f,e.moveTo(n-r,s-a),e.lineTo(n+r,s+a),e.moveTo(n+a,s-r),e.lineTo(n-a,s+r),g+=Kt,r=Math.cos(g)*f,a=Math.sin(g)*f,e.moveTo(n-r,s-a),e.lineTo(n+r,s+a),e.moveTo(n+a,s-r),e.lineTo(n-a,s+r);break;case"line":r=Math.cos(g)*f,a=Math.sin(g)*f,e.moveTo(n-r,s-a),e.lineTo(n+r,s+a);break;case"dash":e.moveTo(n,s),e.lineTo(n+Math.cos(g)*f,s+Math.sin(g)*f);break}e.fill(),t.borderWidth>0&&e.stroke()}}function Ve(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function ua(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function fa(e){e.restore()}function Uc(e,t,n,s,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else i==="after"!=!!s?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Gc(e,t,n,s){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?n.cp2x:n.cp1x,s?n.cp2y:n.cp1y,n.x,n.y)}function yn(e,t,n,s,i,o={}){const r=V(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,qc(e,o),l=0;l<r.length;++l)c=r[l],a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),R(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,s,o.maxWidth)),e.fillText(c,n,s,o.maxWidth),Kc(e,n,s,c,o),s+=i.lineHeight;e.restore()}function qc(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),R(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Kc(e,t,n,s,i){if(i.strikethrough||i.underline){const o=e.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,h=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(r,h),e.lineTo(a,h),e.stroke()}}function vn(e,t){const{x:n,y:s,w:i,h:o,radius:r}=t;e.arc(n+r.topLeft,s+r.topLeft,r.topLeft,-H,$,!0),e.lineTo(n,s+o-r.bottomLeft),e.arc(n+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,$,H,!0),e.lineTo(n+i-r.bottomRight,s+o),e.arc(n+i-r.bottomRight,s+o-r.bottomRight,r.bottomRight,H,0,!0),e.lineTo(n+i,s+r.topRight),e.arc(n+i-r.topRight,s+r.topRight,r.topRight,0,-H,!0),e.lineTo(n+r.topLeft,s)}const Zc=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Qc=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Jc(e,t){const n=(""+e).match(Zc);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const th=e=>+e||0;function As(e,t){const n={},s=D(t),i=s?Object.keys(t):t,o=D(e)?s?r=>O(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of i)n[r]=th(o(r));return n}function ga(e){return As(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Yt(e){return As(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ot(e){const t=ga(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(e,t){e=e||{},t=t||P.font;let n=O(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let s=O(e.style,t.style);s&&!(""+s).match(Qc)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const i={family:O(e.family,t.family),lineHeight:Jc(O(e.lineHeight,t.lineHeight),n),size:n,style:s,weight:O(e.weight,t.weight),string:""};return i.string=$c(i),i}function Je(e,t,n,s){let i,o,r;for(i=0,o=e.length;i<o;++i)if(r=e[i],r!==void 0&&r!==void 0)return r}function eh(e,t,n){const{min:s,max:i}=e,o=Zr(t,(i-s)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(i,o)}}function At(e,t){return Object.assign(Object.create(e),t)}function Ps(e,t=[""],n=e,s,i=()=>e[0]){it(s)||(s=_a("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:s,_getTarget:i,override:r=>Ps([r,...e],t,n,s)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete e[0][a],!0},get(r,a){return ma(r,a,()=>ch(a,t,e,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(r,a){return di(r).includes(a)},ownKeys(r){return di(r)},set(r,a,l){const c=r._storage||(r._storage=i());return r[a]=c[a]=l,delete r._keys,!0}})}function Ut(e,t,n,s){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:pa(e,s),setContext:o=>Ut(e,o,n,s),override:o=>Ut(e.override(o),t,n,s)};return new Proxy(i,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return ma(o,r,()=>sh(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function pa(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:s=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:s,isScriptable:Ct(n)?n:()=>n,isIndexable:Ct(s)?s:()=>s}}const nh=(e,t)=>e?e+vs(t):t,Os=(e,t)=>D(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ma(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const s=n();return e[t]=s,s}function sh(e,t,n){const{_proxy:s,_context:i,_subProxy:o,_descriptors:r}=e;let a=s[t];return Ct(a)&&r.isScriptable(t)&&(a=ih(t,a,e,n)),V(a)&&a.length&&(a=oh(t,a,e,r.isIndexable)),Os(t,a)&&(a=Ut(a,i,o&&o[t],r)),a}function ih(e,t,n,s){const{_proxy:i,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);return a.add(e),t=t(o,r||s),a.delete(e),Os(e,t)&&(t=Ds(i._scopes,i,e,t)),t}function oh(e,t,n,s){const{_proxy:i,_context:o,_subProxy:r,_descriptors:a}=n;if(it(o.index)&&s(e))t=t[o.index%t.length];else if(D(t[0])){const l=t,c=i._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Ds(c,i,e,h);t.push(Ut(d,o,r&&r[e],a))}}return t}function ba(e,t,n){return Ct(e)?e(t,n):e}const rh=(e,t)=>e===!0?t:typeof e=="string"?Mt(t,e):void 0;function ah(e,t,n,s,i){for(const o of t){const r=rh(n,o);if(r){e.add(r);const a=ba(r._fallback,n,i);if(it(a)&&a!==n&&a!==s)return a}else if(r===!1&&it(s)&&n!==s)return null}return!1}function Ds(e,t,n,s){const i=t._rootScopes,o=ba(t._fallback,n,s),r=[...e,...i],a=new Set;a.add(s);let l=hi(a,r,n,o||n,s);return l===null||it(o)&&o!==n&&(l=hi(a,r,o,l,s),l===null)?!1:Ps(Array.from(a),[""],i,o,()=>lh(t,n,s))}function hi(e,t,n,s,i){for(;n;)n=ah(e,t,n,s,i);return n}function lh(e,t,n){const s=e._getTarget();t in s||(s[t]={});const i=s[t];return V(i)&&D(n)?n:i}function ch(e,t,n,s){let i;for(const o of t)if(i=_a(nh(o,e),n),it(i))return Os(e,i)?Ds(n,s,e,i):i}function _a(e,t){for(const n of t){if(!n)continue;const s=n[e];if(it(s))return s}}function di(e){let t=e._keys;return t||(t=e._keys=hh(e._scopes)),t}function hh(e){const t=new Set;for(const n of e)for(const s of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(s);return Array.from(t)}function xa(e,t,n,s){const{iScale:i}=e,{key:o="r"}=this._parsing,r=new Array(s);let a,l,c,h;for(a=0,l=s;a<l;++a)c=a+n,h=t[c],r[a]={r:i.parse(Mt(h,o),c)};return r}const dh=Number.EPSILON||1e-14,Gt=(e,t)=>t<e.length&&!e[t].skip&&e[t],ya=e=>e==="x"?"y":"x";function uh(e,t,n,s){const i=e.skip?t:e,o=t,r=n.skip?t:n,a=ss(o,i),l=ss(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-i.x),y:o.y-d*(r.y-i.y)},next:{x:o.x+u*(r.x-i.x),y:o.y+u*(r.y-i.y)}}}function fh(e,t,n){const s=e.length;let i,o,r,a,l,c=Gt(e,0);for(let h=0;h<s-1;++h)if(l=c,c=Gt(e,h+1),!(!l||!c)){if(Fe(t[h],0,dh)){n[h]=n[h+1]=0;continue}i=n[h]/t[h],o=n[h+1]/t[h],a=Math.pow(i,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[h]=i*r*t[h],n[h+1]=o*r*t[h])}}function gh(e,t,n="x"){const s=ya(n),i=e.length;let o,r,a,l=Gt(e,0);for(let c=0;c<i;++c){if(r=a,a=l,l=Gt(e,c+1),!a)continue;const h=a[n],d=a[s];r&&(o=(h-r[n])/3,a[`cp1${n}`]=h-o,a[`cp1${s}`]=d-o*t[c]),l&&(o=(l[n]-h)/3,a[`cp2${n}`]=h+o,a[`cp2${s}`]=d+o*t[c])}}function ph(e,t="x"){const n=ya(t),s=e.length,i=Array(s).fill(0),o=Array(s);let r,a,l,c=Gt(e,0);for(r=0;r<s;++r)if(a=l,l=c,c=Gt(e,r+1),!!l){if(c){const h=c[t]-l[t];i[r]=h!==0?(c[n]-l[n])/h:0}o[r]=a?c?ut(i[r-1])!==ut(i[r])?0:(i[r-1]+i[r])/2:i[r-1]:i[r]}fh(e,i,o),gh(e,o,t)}function tn(e,t,n){return Math.max(Math.min(e,n),t)}function mh(e,t){let n,s,i,o,r,a=Ve(e[0],t);for(n=0,s=e.length;n<s;++n)r=o,o=a,a=n<s-1&&Ve(e[n+1],t),o&&(i=e[n],r&&(i.cp1x=tn(i.cp1x,t.left,t.right),i.cp1y=tn(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=tn(i.cp2x,t.left,t.right),i.cp2y=tn(i.cp2y,t.top,t.bottom)))}function bh(e,t,n,s,i){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")ph(e,i);else{let c=s?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=uh(c,a,e[Math.min(o+1,r-(s?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&&mh(e,n)}function va(){return typeof window<"u"&&typeof document<"u"}function Ls(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function wn(e,t,n){let s;return typeof e=="string"?(s=parseInt(e,10),e.indexOf("%")!==-1&&(s=s/100*t.parentNode[n])):s=e,s}const On=e=>window.getComputedStyle(e,null);function _h(e,t){return On(e).getPropertyValue(t)}const xh=["top","right","bottom","left"];function Ft(e,t,n){const s={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=xh[i];s[o]=parseFloat(e[t+"-"+o+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const yh=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function vh(e,t){const n=e.touches,s=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=s;let r=!1,a,l;if(yh(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Tt(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:s}=t,i=On(n),o=i.boxSizing==="border-box",r=Ft(i,"padding"),a=Ft(i,"border","width"),{x:l,y:c,box:h}=vh(e,n),d=r.left+(h&&a.left),u=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-d)/f*n.width/s),y:Math.round((c-u)/g*n.height/s)}}function wh(e,t,n){let s,i;if(t===void 0||n===void 0){const o=Ls(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=On(o),l=Ft(a,"border","width"),c=Ft(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,s=wn(a.maxWidth,o,"clientWidth"),i=wn(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:s||mn,maxHeight:i||mn}}const Hn=e=>Math.round(e*10)/10;function Sh(e,t,n,s){const i=On(e),o=Ft(i,"margin"),r=wn(i.maxWidth,e,"clientWidth")||mn,a=wn(i.maxHeight,e,"clientHeight")||mn,l=wh(e,t,n);let{width:c,height:h}=l;if(i.boxSizing==="content-box"){const d=Ft(i,"border","width"),u=Ft(i,"padding");c-=u.width+d.width,h-=u.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?Math.floor(c/s):h-o.height),c=Hn(Math.min(c,r,l.maxWidth)),h=Hn(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Hn(c/2)),{width:c,height:h}}function ui(e,t,n){const s=t||1,i=Math.floor(e.height*s),o=Math.floor(e.width*s);e.height=i/s,e.width=o/s;const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==s||r.height!==i||r.width!==o?(e.currentDevicePixelRatio=s,r.height=i,r.width=o,e.ctx.setTransform(s,0,0,s,0,0),!0):!1}const kh=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function fi(e,t){const n=_h(e,t),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Rt(e,t,n,s){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Mh(e,t,n,s){return{x:e.x+n*(t.x-e.x),y:s==="middle"?n<.5?e.y:t.y:s==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Ch(e,t,n,s){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Rt(e,i,n),a=Rt(i,o,n),l=Rt(o,t,n),c=Rt(r,a,n),h=Rt(a,l,n);return Rt(c,h,n)}const gi=new Map;function Ah(e,t){t=t||{};const n=e+JSON.stringify(t);let s=gi.get(n);return s||(s=new Intl.NumberFormat(e,t),gi.set(n,s)),s}function $e(e,t,n){return Ah(t,n).format(e)}const Ph=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,s){return n-s},leftForLtr(n,s){return n-s}}},Oh=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function $n(e,t,n){return e?Ph(t,n):Oh()}function Dh(e,t){let n,s;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,s=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=s)}function Lh(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function wa(e){return e==="angle"?{between:je,compare:gc,normalize:rt}:{between:bn,compare:(t,n)=>t-n,normalize:t=>t}}function pi({start:e,end:t,count:n,loop:s,style:i}){return{start:e%n,end:t%n,loop:s&&(t-e+1)%n===0,style:i}}function Th(e,t,n){const{property:s,start:i,end:o}=n,{between:r,normalize:a}=wa(s),l=t.length;let{start:c,end:h,loop:d}=e,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&r(a(t[c%l][s]),i,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:e.style}}function Rh(e,t,n){if(!n)return[e];const{property:s,start:i,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=wa(s),{start:h,end:d,loop:u,style:f}=Th(e,t,n),g=[];let p=!1,_=null,b,v,y;const m=()=>l(i,y,b)&&a(i,y)!==0,x=()=>a(o,b)===0||l(o,y,b),w=()=>p||m(),S=()=>!p||x();for(let k=h,M=h;k<=d;++k)v=t[k%r],!v.skip&&(b=c(v[s]),b!==y&&(p=l(b,i,o),_===null&&w()&&(_=a(b,i)===0?k:M),_!==null&&S()&&(g.push(pi({start:_,end:k,loop:u,count:r,style:f})),_=null),M=k,y=b));return _!==null&&g.push(pi({start:_,end:d,loop:u,count:r,style:f})),g}function Eh(e,t){const n=[],s=e.segments;for(let i=0;i<s.length;i++){const o=Rh(s[i],e.points,t);o.length&&n.push(...o)}return n}function Ih(e,t,n,s){let i=0,o=t-1;if(n&&!s)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function Fh(e,t,n,s){const i=e.length,o=[];let r=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%i,end:(l-1)%i,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%i,end:r%i,loop:s}),o}function Bh(e,t){const n=e.points,s=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:r,end:a}=Ih(n,i,o,s);if(s===!0)return mi(e,[{start:r,end:a,loop:o}],n,t);const l=a<r?a+i:a,c=!!e._fullLoop&&r===0&&a===i-1;return mi(e,Fh(n,r,l,c),n,t)}function mi(e,t,n,s){return!s||!s.setContext||!n?t:zh(e,t,n,s)}function zh(e,t,n,s){const i=e._chart.getContext(),o=bi(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let h=o,d=t[0].start,u=d;function f(g,p,_,b){const v=a?-1:1;if(g!==p){for(g+=l;n[g%l].skip;)g-=v;for(;n[p%l].skip;)p+=v;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:_,style:b}),h=b,d=p%l)}}for(const g of t){d=a?d:g.start;let p=n[d%l],_;for(u=d+1;u<=g.end;u++){const b=n[u%l];_=bi(s.setContext(At(i,{type:"segment",p0:p,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Nh(_,h)&&f(d,u-1,g.loop,h),p=b,h=_}d<u-1&&f(d,u-1,g.loop,h)}return c}function bi(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Nh(e,t){return t&&JSON.stringify(e)!==JSON.stringify(t)}/*!
|
|
12
|
-
* Chart.js v3.9.1
|
|
13
|
-
* https://www.chartjs.org
|
|
14
|
-
* (c) 2022 Chart.js Contributors
|
|
15
|
-
* Released under the MIT License
|
|
16
|
-
*/class jh{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,s,i){const o=n.listeners[i],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(s-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=sa.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((s,i)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,s,t,"progress")),o.length||(s.running=!1,this._notify(i,s,t,"complete"),s.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let s=n.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,s)),s}listen(t,n,s){this._getAnims(t).listeners[n].push(s)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((s,i)=>Math.max(s,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const s=n.items;let i=s.length-1;for(;i>=0;--i)s[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var pt=new jh;const _i="transparent",Vh={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const s=li(e||_i),i=s.valid&&li(t||_i);return i&&i.valid?i.mix(s,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Wh{constructor(t,n,s,i){const o=n[s];i=Je([t.to,i,o,t.from]);const r=Je([t.from,o,i]);this._active=!0,this._fn=t.fn||Vh[t.type||typeof r],this._easing=Be[t.easing]||Be.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=s,this._from=r,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,s){if(this._active){this._notify(!1);const i=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Je([t.to,n,i,t.from]),this._from=Je([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,s=this._duration,i=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||n<s),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,s)=>{t.push({res:n,rej:s})})}_notify(t){const n=t?"res":"rej",s=this._promises||[];for(let i=0;i<s.length;i++)s[i][n]()}}const Hh=["x","y","borderWidth","radius","tension"],$h=["color","borderColor","backgroundColor"];P.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Yh=Object.keys(P.animation);P.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"});P.set("animations",{colors:{type:"color",properties:$h},numbers:{type:"number",properties:Hh}});P.describe("animations",{_fallback:"animation"});P.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}});class Sa{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!D(t))return;const n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const i=t[s];if(!D(i))return;const o={};for(const r of Yh)o[r]=i[r];(V(i.properties)&&i.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,o)})})}_animateOptions(t,n){const s=n.options,i=Uh(t,s);if(!i)return[];const o=this._createAnimations(i,s);return s.$shared&&Xh(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,n){const s=this._properties,i=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),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"){i.push(...this._animateOptions(t,n));continue}const h=n[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new Wh(u,t,c,h),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const s=this._createAnimations(t,n);if(s.length)return pt.add(this._chart,s),!0}}function Xh(e,t){const n=[],s=Object.keys(t);for(let i=0;i<s.length;i++){const o=e[s[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Uh(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function xi(e,t){const n=e&&e.options||{},s=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:s?o:i,end:s?i:o}}function Gh(e,t,n){if(n===!1)return!1;const s=xi(e,n),i=xi(t,n);return{top:i.end,right:s.end,bottom:i.start,left:s.start}}function qh(e){let t,n,s,i;return D(e)?(t=e.top,n=e.right,s=e.bottom,i=e.left):t=n=s=i=e,{top:t,right:n,bottom:s,left:i,disabled:e===!1}}function ka(e,t){const n=[],s=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=s.length;i<o;++i)n.push(s[i].index);return n}function yi(e,t,n,s={}){const i=e.keys,o=s.mode==="single";let r,a,l,c;if(t!==null){for(r=0,a=i.length;r<a;++r){if(l=+i[r],l===n){if(s.all)continue;break}c=e.values[l],U(c)&&(o||t===0||ut(t)===ut(c))&&(t+=c)}return t}}function Kh(e){const t=Object.keys(e),n=new Array(t.length);let s,i,o;for(s=0,i=t.length;s<i;++s)o=t[s],n[s]={x:o,y:e[o]};return n}function vi(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Zh(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Qh(e){const{min:t,max:n,minDefined:s,maxDefined:i}=e.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function Jh(e,t,n){const s=e[t]||(e[t]={});return s[n]||(s[n]={})}function wi(e,t,n,s){for(const i of t.getMatchingVisibleMetas(s).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function Si(e,t){const{chart:n,_cachedMeta:s}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Zh(o,r,s),d=t.length;let u;for(let f=0;f<d;++f){const g=t[f],{[l]:p,[c]:_}=g,b=g._stacks||(g._stacks={});u=b[c]=Jh(i,h,p),u[a]=_,u._top=wi(u,r,!0,s.type),u._bottom=wi(u,r,!1,s.type)}}function Yn(e,t){const n=e.scales;return Object.keys(n).filter(s=>n[s].axis===t).shift()}function td(e,t){return At(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ed(e,t,n){return At(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Zt(e,t){const n=e.controller.index,s=e.vScale&&e.vScale.axis;if(s){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[s]===void 0||o[s][n]===void 0)return;delete o[s][n]}}}const Xn=e=>e==="reset"||e==="none",ki=(e,t)=>t?e:Object.assign({},e),nd=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:ka(n,!0),values:null};class lt{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=vi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Zt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,s=this.getDataset(),i=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=n.xAxisID=O(s.xAxisID,Yn(t,"x")),r=n.yAxisID=O(s.yAxisID,Yn(t,"y")),a=n.rAxisID=O(s.rAxisID,Yn(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,r,a),h=n.vAxisID=i(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&ti(this._data,this),t._stacked&&Zt(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),s=this._data;if(D(n))this._data=Kh(n);else if(s!==n){if(s){ti(s,this);const i=this._cachedMeta;Zt(i),i._parsed=[]}n&&Object.isExtensible(n)&&_c(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,s=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=vi(n.vScale,n),n.stack!==s.stack&&(i=!0,Zt(n),n.stack=s.stack),this._resyncElements(t),(i||o!==n._stacked)&&Si(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:s,_data:i}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&n===i.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=i,s._sorted=!0,u=i;else{V(i[t])?u=this.parseArrayData(s,i,t,n):D(i[t])?u=this.parseObjectData(s,i,t,n):u=this.parsePrimitiveData(s,i,t,n);const f=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<n;++h)s._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);s._sorted=l}r&&Si(this,u)}parsePrimitiveData(t,n,s,i){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(i);let u,f,g;for(u=0,f=i;u<f;++u)g=u+s,d[u]={[a]:h||o.parse(c[g],g),[l]:r.parse(n[g],g)};return d}parseArrayData(t,n,s,i){const{xScale:o,yScale:r}=t,a=new Array(i);let l,c,h,d;for(l=0,c=i;l<c;++l)h=l+s,d=n[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,n,s,i){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let h,d,u,f;for(h=0,d=i;h<d;++h)u=h+s,f=n[u],c[h]={x:o.parse(Mt(f,a),u),y:r.parse(Mt(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,s){const i=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:ka(i,!0),values:n._stacks[t.axis]};return yi(a,r,o.index,{mode:s})}updateRangeFromParsed(t,n,s,i){const o=s[n.axis];let r=o===null?NaN:o;const a=i&&s._stacks[n.axis];i&&a&&(i.values=a,r=yi(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){const s=this._cachedMeta,i=s._parsed,o=s._sorted&&t===s.iScale,r=i.length,a=this._getOtherScale(t),l=nd(n,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Qh(a);let u,f;function g(){f=i[u];const p=f[a.axis];return!U(f[t.axis])||h>p||d<p}for(u=0;u<r&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,s=[];let i,o,r;for(i=0,o=n.length;i<o;++i)r=n[i][t.axis],U(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,s=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=qh(O(this.options.clip,Gh(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,s=this._cachedMeta,i=s.data||[],o=n.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=i[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,n){const s=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,n,s){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=ed(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=td(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",s){const i=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&it(s);if(a)return ki(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(P.elements[t]),g=()=>this.getContext(s,i),p=c.resolveNamedOptions(u,f,g,d);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(ki(p,l))),p}_resolveAnimations(t,n,s){const i=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,a=o[r];if(a)return a;let l;if(i.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,n),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,n))}const c=new Sa(i,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,n){return!n||Xn(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const s=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,s),{sharedOptions:o,includeOptions:r}}updateElement(t,n,s,i){Xn(i)?Object.assign(t,s):this._resolveAnimations(n,i).update(t,s)}updateSharedOptions(t,n,s){t&&!Xn(n)&&this._resolveAnimations(void 0,n).update(t,s)}_setStyle(t,n,s,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,s,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,n,s){this._setStyle(t,s,"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 n=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=s.length,o=n.length,r=Math.min(o,i);r&&this.parse(0,r),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,s=!0){const i=this._cachedMeta,o=i.data,r=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),s&&this.updateElements(o,t,n,"reset")}updateElements(t,n,s,i){}_removeElements(t,n){const s=this._cachedMeta;if(this._parsing){const i=s._parsed.splice(t,n);s._stacked&&Zt(s,i)}s.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,s,i]=t;this[n](s,i)}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,n){n&&this._sync(["_removeElements",t,n]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}lt.defaults={};lt.prototype.datasetElementType=null;lt.prototype.dataElementType=null;function sd(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let s=[];for(let i=0,o=n.length;i<o;i++)s=s.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=na(s.sort((i,o)=>i-o))}return e._cache.$bar}function id(e){const t=e.iScale,n=sd(t,e.type);let s=t._length,i,o,r,a;const l=()=>{r===32767||r===-32768||(it(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(i=0,o=n.length;i<o;++i)r=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)r=t.getPixelForTick(i),l();return s}function od(e,t,n,s){const i=n.barThickness;let o,r;return R(i)?(o=t.min*n.categoryPercentage,r=n.barPercentage):(o=i*s,r=1),{chunk:o/s,ratio:r,start:t.pixels[e]-o/2}}function rd(e,t,n,s){const i=t.pixels,o=i[e];let r=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.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/s,ratio:n.barPercentage,start:c}}function ad(e,t,n,s){const i=n.parse(e[0],s),o=n.parse(e[1],s),r=Math.min(i,o),a=Math.max(i,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:r,max:a}}function Ma(e,t,n,s){return V(e)?ad(e,t,n,s):t[n.axis]=n.parse(e,s),t}function Mi(e,t,n,s){const i=e.iScale,o=e.vScale,r=i.getLabels(),a=i===o,l=[];let c,h,d,u;for(c=n,h=n+s;c<h;++c)u=t[c],d={},d[i.axis]=a||i.parse(r[c],c),l.push(Ma(u,d,o,c));return l}function Un(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function ld(e,t,n){return e!==0?ut(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function cd(e){let t,n,s,i,o;return e.horizontal?(t=e.base>e.x,n="left",s="right"):(t=e.base<e.y,n="bottom",s="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:s,reverse:t,top:i,bottom:o}}function hd(e,t,n,s){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=cd(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===s?i=c:(n._bottom||0)===s?i=h:(o[Ci(h,r,a,l)]=!0,i=c)),o[Ci(i,r,a,l)]=!0,e.borderSkipped=o}function Ci(e,t,n,s){return s?(e=dd(e,t,n),e=Ai(e,n,t)):e=Ai(e,t,n),e}function dd(e,t,n){return e===t?n:e===n?t:e}function Ai(e,t,n){return e==="start"?t:e==="end"?n:e}function ud(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Ts extends lt{parsePrimitiveData(t,n,s,i){return Mi(t,n,s,i)}parseArrayData(t,n,s,i){return Mi(t,n,s,i)}parseObjectData(t,n,s,i){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,d=[];let u,f,g,p;for(u=s,f=s+i;u<f;++u)p=n[u],g={},g[o.axis]=o.parse(Mt(p,c),u),d.push(Ma(Mt(p,h),g,r,u));return d}updateRangeFromParsed(t,n,s,i){super.updateRangeFromParsed(t,n,s,i);const o=s._custom;o&&n===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 n=this._cachedMeta,{iScale:s,vScale:i}=n,o=this.getParsed(t),r=o._custom,a=Un(r)?"["+r.start+", "+r.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,s,i){const o=i==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(n,i);for(let f=n;f<n+s;f++){const g=this.getParsed(f),p=o||R(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),_=this._calculateBarIndexPixels(f,h),b=(g._stacks||{})[a.axis],v={horizontal:c,base:p.base,enableBorderRadius:!b||Un(g._custom)||r===b._top||r===b._bottom,x:c?p.head:_.center,y:c?_.center:p.head,height:c?_.size:Math.abs(p.size),width:c?Math.abs(p.size):_.size};u&&(v.options=d||this.resolveDataElementOptions(f,t[f].active?"active":i));const y=v.options||t[f].options;hd(v,y,b,r),ud(v,y,h.ratio),this.updateElement(t[f],f,v,i)}}_getStacks(t,n){const{iScale:s}=this._cachedMeta,i=s.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=s.options.stacked,r=[],a=l=>{const c=l.controller.getParsed(n),h=c&&c[l.vScale.axis];if(R(h)||isNaN(h))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,s){const i=this._getStacks(t,s),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,s=n.iScale,i=[];let o,r;for(o=0,r=n.data.length;o<r;++o)i.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const a=t.barThickness;return{min:a||id(n),pixels:i,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:s},options:{base:i,minBarLength:o}}=this,r=i||0,a=this.getParsed(t),l=a._custom,c=Un(l);let h=a[n.axis],d=0,u=s?this.applyStack(n,a,s):h,f,g;u!==h&&(d=u-h,u=h),c&&(h=l.barStart,u=l.barEnd-l.barStart,h!==0&&ut(h)!==ut(l.barEnd)&&(d=0),d+=h);const p=!R(i)&&!c?i:d;let _=n.getPixelForValue(p);if(this.chart.getDataVisibility(t)?f=n.getPixelForValue(d+u):f=_,g=f-_,Math.abs(g)<o){g=ld(g,n,r)*o,h===r&&(_-=g/2);const b=n.getPixelForDecimal(0),v=n.getPixelForDecimal(1),y=Math.min(b,v),m=Math.max(b,v);_=Math.max(Math.min(_,m),y),f=_+g}if(_===n.getPixelForValue(r)){const b=ut(g)*n.getLineWidthForValue(r)/2;_+=b,g-=b}return{size:g,base:_,head:f,center:f+g/2}}_calculateBarIndexPixels(t,n){const s=n.scale,i=this.options,o=i.skipNull,r=O(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,h=i.barThickness==="flex"?rd(t,n,i,c):od(t,n,i,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=h.start+h.chunk*d+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=s.getPixelForValue(this.getParsed(t)[s.axis],t),l=Math.min(r,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,s=t.data,i=s.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&s[o].draw(this._ctx)}}Ts.id="bar";Ts.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Ts.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Rs extends lt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,s,i){const o=super.parsePrimitiveData(t,n,s,i);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+s).radius;return o}parseArrayData(t,n,s,i){const o=super.parseArrayData(t,n,s,i);for(let r=0;r<o.length;r++){const a=n[s+r];o[r]._custom=O(a[2],this.resolveDataElementOptions(r+s).radius)}return o}parseObjectData(t,n,s,i){const o=super.parseObjectData(t,n,s,i);for(let r=0;r<o.length;r++){const a=n[s+r];o[r]._custom=O(a&&a.r&&+a.r,this.resolveDataElementOptions(r+s).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let s=t.length-1;s>=0;--s)n=Math.max(n,t[s].size(this.resolveDataElementOptions(s))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,{xScale:s,yScale:i}=n,o=this.getParsed(t),r=s.getLabelForValue(o.x),a=i.getLabelForValue(o.y),l=o._custom;return{label:n.label,value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,s,i){const o=i==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),h=r.axis,d=a.axis;for(let u=n;u<n+s;u++){const f=t[u],g=!o&&this.getParsed(u),p={},_=p[h]=o?r.getPixelForDecimal(.5):r.getPixelForValue(g[h]),b=p[d]=o?a.getBasePixel():a.getPixelForValue(g[d]);p.skip=isNaN(_)||isNaN(b),c&&(p.options=l||this.resolveDataElementOptions(u,f.active?"active":i),o&&(p.options.radius=0)),this.updateElement(f,u,p,i)}}resolveDataElementOptions(t,n){const s=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=O(s&&s._custom,o),i}}Rs.id="bubble";Rs.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Rs.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function fd(e,t,n){let s=1,i=1,o=0,r=0;if(t<z){const a=e,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(y,m,x)=>je(y,a,l,!0)?1:Math.max(m,m*n,x,x*n),g=(y,m,x)=>je(y,a,l,!0)?-1:Math.min(m,m*n,x,x*n),p=f(0,c,d),_=f(H,h,u),b=g($,c,d),v=g($+H,h,u);s=(p-b)/2,i=(_-v)/2,o=-(p+b)/2,r=-(_+v)/2}return{ratioX:s,ratioY:i,offsetX:o,offsetY:r}}class Ye extends lt{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const s=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=s;else{let o=l=>+s[l];if(D(s[t])){const{key:l="value"}=this._parsing;o=c=>+Mt(s[c],l)}let r,a;for(r=t,a=t+n;r<a;++r)i._parsed[r]=o(r)}}_getRotation(){return at(this.options.rotation-90)}_getCircumference(){return at(this.options.circumference)}_getRotationExtents(){let t=z,n=-z;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)){const i=this.chart.getDatasetMeta(s).controller,o=i._getRotation(),r=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+r)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:s}=n,i=this._cachedMeta,o=i.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(s.width,s.height)-r)/2,0),l=Math.min(ic(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:g,offsetY:p}=fd(d,h,l),_=(s.width-r)/u,b=(s.height-r)/f,v=Math.max(Math.min(_,b)/2,0),y=Zr(this.options.radius,v),m=Math.max(y*l,0),x=(y-m)/this._getVisibleDatasetWeightTotal();this.offsetX=g*y,this.offsetY=p*y,i.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,n){const s=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/z)}updateElements(t,n,s,i){const o=i==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,u=o&&c.animateScale,f=u?0:this.innerRadius,g=u?0:this.outerRadius,{sharedOptions:p,includeOptions:_}=this._getSharedOptions(n,i);let b=this._getRotation(),v;for(v=0;v<n;++v)b+=this._circumference(v,o);for(v=n;v<n+s;++v){const y=this._circumference(v,o),m=t[v],x={x:h+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:g,innerRadius:f};_&&(x.options=p||this.resolveDataElementOptions(v,m.active?"active":i)),b+=y,this.updateElement(m,v,x,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let s=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?z*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=$e(n._parsed[t],s.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const s=this.chart;let i,o,r,a,l;if(!t){for(i=0,o=s.data.datasets.length;i<o;++i)if(s.isDatasetVisible(i)){r=s.getDatasetMeta(i),t=r.data,a=r.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let s=0,i=t.length;s<i;++s){const o=this.resolveDataElementOptions(s);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(n+=this._getRingWeight(s));return n}_getRingWeight(t){return Math.max(O(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ye.id="doughnut";Ye.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"};Ye.descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"};Ye.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((s,i)=>{const r=e.getDatasetMeta(0).controller.getStyle(i);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(i),index:i}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){let t=e.label;const n=": "+e.formattedValue;return V(t)?(t=t.slice(),t[0]+=n):t+=n,t}}}}};class Es extends lt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:s,data:i=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:a,count:l}=oa(n,i,r);this._drawStart=a,this._drawCount=l,ra(n)&&(a=0,l=i.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,s,i){const o=i==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(n,i),u=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,_=Xt(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||i==="none";let v=n>0&&this.getParsed(n-1);for(let y=n;y<n+s;++y){const m=t[y],x=this.getParsed(y),w=b?m:{},S=R(x[f]),k=w[u]=r.getPixelForValue(x[u],y),M=w[f]=o||S?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,x,l):x[f],y);w.skip=isNaN(k)||isNaN(M)||S,w.stop=y>0&&Math.abs(x[u]-v[u])>_,p&&(w.parsed=x,w.raw=c.data[y]),d&&(w.options=h||this.resolveDataElementOptions(y,m.active?"active":i)),b||this.updateElement(m,y,w,i),v=x}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,s=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return s;const o=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Es.id="line";Es.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Es.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Is extends lt{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=$e(n._parsed[t].r,s.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,s,i){return xa.bind(this)(t,n,s,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,s=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),r=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,s,i){const o=i==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*$;let f=u,g;const p=360/this.countVisibleElements();for(g=0;g<n;++g)f+=this._computeAngle(g,i,p);for(g=n;g<n+s;g++){const _=t[g];let b=f,v=f+this._computeAngle(g,i,p),y=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=v,o&&(l.animateScale&&(y=0),l.animateRotate&&(b=v=u));const m={x:h,y:d,innerRadius:0,outerRadius:y,startAngle:b,endAngle:v,options:this.resolveDataElementOptions(g,_.active?"active":i)};this.updateElement(_,g,m,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((s,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,s){return this.chart.getDataVisibility(t)?at(this.resolveDataElementOptions(t,n).angle||s):0}}Is.id="polarArea";Is.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Is.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map((s,i)=>{const r=e.getDatasetMeta(0).controller.getStyle(i);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(i),index:i}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title(){return""},label(e){return e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Ca extends Ye{}Ca.id="pie";Ca.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Fs extends lt{getLabelAndValue(t){const n=this._cachedMeta.vScale,s=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(s[n.axis])}}parseObjectData(t,n,s,i){return xa.bind(this)(t,n,s,i)}update(t){const n=this._cachedMeta,s=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(s.points=i,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:r};this.updateElement(s,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,s,i){const o=this._cachedMeta.rScale,r=i==="reset";for(let a=n;a<n+s;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),h=o.getPointPositionForValue(a,this.getParsed(a).r),d=r?o.xCenter:h.x,u=r?o.yCenter:h.y,f={x:d,y:u,angle:h.angle,skip:isNaN(d)||isNaN(u),options:c};this.updateElement(l,a,f,i)}}}Fs.id="radar";Fs.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Fs.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class xt{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:n,y:s}=this.getProps(["x","y"],t);return{x:n,y:s}}hasValue(){return Xt(this.x)&&Xt(this.y)}getProps(t,n){const s=this.$animations;if(!n||!s)return this;const i={};return t.forEach(o=>{i[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),i}}xt.defaults={};xt.defaultRoutes=void 0;const Aa={values(e){return V(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const s=this.chart.options.locale;let i,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),o=gd(e,n)}const r=st(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),$e(e,s,l)},logarithmic(e,t,n){if(e===0)return"0";const s=e/Math.pow(10,Math.floor(st(e)));return s===1||s===2||s===5?Aa.numeric.call(this,e,t,n):""}};function gd(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Dn={formatters:Aa};P.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Dn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});P.route("scale.ticks","color","","color");P.route("scale.grid","color","","borderColor");P.route("scale.grid","borderColor","","borderColor");P.route("scale.title","color","","color");P.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"});P.describe("scales",{_fallback:"scale"});P.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"});function pd(e,t){const n=e.options.ticks,s=n.maxTicksLimit||md(e),i=n.major.enabled?_d(t):[],o=i.length,r=i[0],a=i[o-1],l=[];if(o>s)return xd(t,l,i,o/s),l;const c=bd(i,t,s);if(o>0){let h,d;const u=o>1?Math.round((a-r)/(o-1)):null;for(en(t,l,c,R(u)?0:r-u,r),h=0,d=o-1;h<d;h++)en(t,l,c,i[h],i[h+1]);return en(t,l,c,a,R(u)?t.length:a+u),l}return en(t,l,c),l}function md(e){const t=e.options.offset,n=e._tickSize(),s=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(s,i))}function bd(e,t,n){const s=yd(e),i=t.length/n;if(!s)return Math.max(i,1);const o=uc(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>i)return l}return Math.max(i,1)}function _d(e){const t=[];let n,s;for(n=0,s=e.length;n<s;n++)e[n].major&&t.push(n);return t}function xd(e,t,n,s){let i=0,o=n[0],r;for(s=Math.ceil(s),r=0;r<e.length;r++)r===o&&(t.push(e[r]),i++,o=n[i*s])}function en(e,t,n,s,i){const o=O(s,0),r=Math.min(O(i,e.length),e.length);let a=0,l,c,h;for(n=Math.ceil(n),i&&(l=i-s,n=l/Math.floor(l/n)),h=o;h<0;)a++,h=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(e[c]),a++,h=Math.round(o+a*n))}function yd(e){const t=e.length;let n,s;if(t<2)return!1;for(s=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==s)return!1;return s}const vd=e=>e==="left"?"right":e==="right"?"left":e,Pi=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n;function Oi(e,t){const n=[],s=e.length/t,i=e.length;let o=0;for(;o<i;o+=s)n.push(e[Math.floor(o)]);return n}function wd(e,t,n){const s=e.ticks.length,i=Math.min(t,s-1),o=e._startPixel,r=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(s===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>r+a)))return l}function Sd(e,t){T(e,n=>{const s=n.gc,i=s.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[s[o]];s.splice(0,i)}})}function Qt(e){return e.drawTicks?e.tickLength:0}function Di(e,t){if(!e.display)return 0;const n=J(e.font,t),s=ot(e.padding);return(V(e.text)?e.text.length:1)*n.lineHeight+s.height}function kd(e,t){return At(e,{scale:t,type:"scale"})}function Md(e,t,n){return At(e,{tick:n,index:t,type:"tick"})}function Cd(e,t,n){let s=yc(e);return(n&&t!=="right"||!n&&t==="right")&&(s=vd(s)),s}function Ad(e,t,n,s){const{top:i,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:h}=l;let d=0,u,f,g;const p=r-i,_=a-o;if(e.isHorizontal()){if(f=ei(s,o,a),D(n)){const b=Object.keys(n)[0],v=n[b];g=h[b].getPixelForValue(v)+p-t}else n==="center"?g=(c.bottom+c.top)/2+p-t:g=Pi(e,n,t);u=a-o}else{if(D(n)){const b=Object.keys(n)[0],v=n[b];f=h[b].getPixelForValue(v)-_+t}else n==="center"?f=(c.left+c.right)/2-_+t:f=Pi(e,n,t);g=ei(s,r,i),d=n==="left"?-H:H}return{titleX:f,titleY:g,maxWidth:u,rotation:d}}class zt extends xt{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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:s,_suggestedMax:i}=this;return t=et(t,Number.POSITIVE_INFINITY),n=et(n,Number.NEGATIVE_INFINITY),s=et(s,Number.POSITIVE_INFINITY),i=et(i,Number.NEGATIVE_INFINITY),{min:et(t,s),max:et(n,i),minDefined:U(t),maxDefined:U(n)}}getMinMax(t){let{min:n,max:s,minDefined:i,maxDefined:o}=this.getUserBounds(),r;if(i&&o)return{min:n,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,r.min)),o||(s=Math.max(s,r.max));return n=o&&n>s?s:n,s=i&&n>s?n:s,{min:et(n,et(s,n)),max:et(s,et(n,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){W(this.options.beforeUpdate,[this])}update(t,n,s){const{beginAtZero:i,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=eh(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Oi(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=pd(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,n,s;this.isHorizontal()?(n=this.left,s=this.right):(n=this.top,s=this.bottom,t=!t),this._startPixel=n,this._endPixel=s,this._reversePixels=t,this._length=s-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){W(this.options.afterUpdate,[this])}beforeSetDimensions(){W(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(){W(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),W(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){W(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let s,i,o;for(s=0,i=t.length;s<i;s++)o=t[s],o.label=W(n.callback,[o.value,s,t],this)}afterTickToLabelConversion(){W(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){W(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,s=this.ticks.length,i=n.minRotation||0,o=n.maxRotation;let r=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||s<=1||!this.isHorizontal()){this.labelRotation=i;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=K(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-Qt(t.grid)-n.padding-Di(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=ws(Math.min(Math.asin(K((h.highest.height+6)/a,-1,1)),Math.asin(K(l/c,-1,1))-Math.asin(K(u/c,-1,1)))),r=Math.max(i,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){W(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){W(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:s,title:i,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Di(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Qt(o)+l):(t.height=this.maxHeight,t.width=Qt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,g=at(this.labelRotation),p=Math.cos(g),_=Math.sin(g);if(a){const b=s.mirror?0:_*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:p*d.width+_*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,_,p)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,s,i){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,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=i*t.width,f=s*n.height):(u=s*t.height,f=i*n.width):o==="start"?f=n.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=n.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=n.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=n.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+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(){W(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,s;for(n=0,s=t.length;n<s;n++)R(t[n].label)&&(t.splice(n,1),s--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let s=this.ticks;n<s.length&&(s=Oi(s,n)),this._labelSizes=t=this._computeLabelSizes(s,s.length)}return t}_computeLabelSizes(t,n){const{ctx:s,_longestTextCache:i}=this,o=[],r=[];let a=0,l=0,c,h,d,u,f,g,p,_,b,v,y;for(c=0;c<n;++c){if(u=t[c].label,f=this._resolveTickFontOptions(c),s.font=g=f.string,p=i[g]=i[g]||{data:{},gc:[]},_=f.lineHeight,b=v=0,!R(u)&&!V(u))b=xn(s,p.data,p.gc,b,u),v=_;else if(V(u))for(h=0,d=u.length;h<d;++h)y=u[h],!R(y)&&!V(y)&&(b=xn(s,p.data,p.gc,b,y),v+=_);o.push(b),r.push(v),a=Math.max(b,a),l=Math.max(v,l)}Sd(i,n);const m=o.indexOf(a),x=r.indexOf(l),w=S=>({width:o[S]||0,height:r[S]||0});return{first:w(0),last:w(n-1),widest:w(m),highest:w(x),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return pc(this._alignToPixels?Ot(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const s=n[t];return s.$context||(s.$context=Md(this.getContext(),t,s))}return this.$context||(this.$context=kd(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=at(this.labelRotation),s=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),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*s>a*i?a/s:l/i:l*i<a*s?l/s:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,s=this.chart,i=this.options,{grid:o,position:r}=i,a=o.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),d=Qt(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,_=function(C){return Ot(s,C,g)};let b,v,y,m,x,w,S,k,M,A,L,E;if(r==="top")b=_(this.bottom),w=this.bottom-d,k=b-p,A=_(t.top)+p,E=t.bottom;else if(r==="bottom")b=_(this.top),A=t.top,E=_(t.bottom)-p,w=b+p,k=this.top+d;else if(r==="left")b=_(this.right),x=this.right-d,S=b-p,M=_(t.left)+p,L=t.right;else if(r==="right")b=_(this.left),M=t.left,L=_(t.right)-p,x=b+p,S=this.left+d;else if(n==="x"){if(r==="center")b=_((t.top+t.bottom)/2+.5);else if(D(r)){const C=Object.keys(r)[0],F=r[C];b=_(this.chart.scales[C].getPixelForValue(F))}A=t.top,E=t.bottom,w=b+p,k=w+d}else if(n==="y"){if(r==="center")b=_((t.left+t.right)/2);else if(D(r)){const C=Object.keys(r)[0],F=r[C];b=_(this.chart.scales[C].getPixelForValue(F))}x=b-p,S=x-d,M=t.left,L=t.right}const G=O(i.ticks.maxTicksLimit,h),B=Math.max(1,Math.ceil(h/G));for(v=0;v<h;v+=B){const C=o.setContext(this.getContext(v)),F=C.lineWidth,j=C.color,ft=C.borderDash||[],Pt=C.borderDashOffset,gt=C.tickWidth,Ue=C.tickColor,Nt=C.tickBorderDash||[],qt=C.tickBorderDashOffset;y=wd(this,v,a),y!==void 0&&(m=Ot(s,y,F),l?x=S=M=L=m:w=k=A=E=m,u.push({tx1:x,ty1:w,tx2:S,ty2:k,x1:M,y1:A,x2:L,y2:E,width:F,color:j,borderDash:ft,borderDashOffset:Pt,tickWidth:gt,tickColor:Ue,tickBorderDash:Nt,tickBorderDashOffset:qt}))}return this._ticksLength=h,this._borderValue=b,u}_computeLabelItems(t){const n=this.axis,s=this.options,{position:i,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=Qt(s.grid),f=u+h,g=d?-h:f,p=-at(this.labelRotation),_=[];let b,v,y,m,x,w,S,k,M,A,L,E,G="middle";if(i==="top")w=this.bottom-g,S=this._getXAxisLabelAlignment();else if(i==="bottom")w=this.top+g,S=this._getXAxisLabelAlignment();else if(i==="left"){const C=this._getYAxisLabelAlignment(u);S=C.textAlign,x=C.x}else if(i==="right"){const C=this._getYAxisLabelAlignment(u);S=C.textAlign,x=C.x}else if(n==="x"){if(i==="center")w=(t.top+t.bottom)/2+f;else if(D(i)){const C=Object.keys(i)[0],F=i[C];w=this.chart.scales[C].getPixelForValue(F)+f}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(t.left+t.right)/2-f;else if(D(i)){const C=Object.keys(i)[0],F=i[C];x=this.chart.scales[C].getPixelForValue(F)}S=this._getYAxisLabelAlignment(u).textAlign}n==="y"&&(l==="start"?G="top":l==="end"&&(G="bottom"));const B=this._getLabelSizes();for(b=0,v=a.length;b<v;++b){y=a[b],m=y.label;const C=o.setContext(this.getContext(b));k=this.getPixelForTick(b)+o.labelOffset,M=this._resolveTickFontOptions(b),A=M.lineHeight,L=V(m)?m.length:1;const F=L/2,j=C.color,ft=C.textStrokeColor,Pt=C.textStrokeWidth;let gt=S;r?(x=k,S==="inner"&&(b===v-1?gt=this.options.reverse?"left":"right":b===0?gt=this.options.reverse?"right":"left":gt="center"),i==="top"?c==="near"||p!==0?E=-L*A+A/2:c==="center"?E=-B.highest.height/2-F*A+A:E=-B.highest.height+A/2:c==="near"||p!==0?E=A/2:c==="center"?E=B.highest.height/2-F*A:E=B.highest.height-L*A,d&&(E*=-1)):(w=k,E=(1-L)*A/2);let Ue;if(C.showLabelBackdrop){const Nt=ot(C.backdropPadding),qt=B.heights[b],Bn=B.widths[b];let zn=w+E-Nt.top,Nn=x-Nt.left;switch(G){case"middle":zn-=qt/2;break;case"bottom":zn-=qt;break}switch(S){case"center":Nn-=Bn/2;break;case"right":Nn-=Bn;break}Ue={left:Nn,top:zn,width:Bn+Nt.width,height:qt+Nt.height,color:C.backdropColor}}_.push({rotation:p,label:m,font:M,color:j,strokeColor:ft,strokeWidth:Pt,textOffset:E,textAlign:gt,textBaseline:G,translation:[x,w],backdrop:Ue})}return _}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-at(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:s,mirror:i,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return n==="left"?i?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):n==="right"?i?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="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,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:s,top:i,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(s,i,o,r),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,s=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(n.display)for(o=0,r=i.length;o<r;++o){const l=i[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.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:n,options:{grid:s}}=this,i=s.setContext(this.getContext()),o=s.drawBorder?i.borderWidth:0;if(!o)return;const r=s.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,c,h,d;this.isHorizontal()?(l=Ot(t,this.left,o)-o/2,c=Ot(t,this.right,r)+r/2,h=d=a):(h=Ot(t,this.top,o)-o/2,d=Ot(t,this.bottom,r)+r/2,l=c=a),n.save(),n.lineWidth=i.borderWidth,n.strokeStyle=i.borderColor,n.beginPath(),n.moveTo(l,h),n.lineTo(c,d),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,i=this._computeLabelArea();i&&ua(s,i);const o=this._labelItems||(this._labelItems=this._computeLabelItems(t));let r,a;for(r=0,a=o.length;r<a;++r){const l=o[r],c=l.font,h=l.label;l.backdrop&&(s.fillStyle=l.backdrop.color,s.fillRect(l.backdrop.left,l.backdrop.top,l.backdrop.width,l.backdrop.height));let d=l.textOffset;yn(s,h,0,d,c,l)}i&&fa(s)}drawTitle(){const{ctx:t,options:{position:n,title:s,reverse:i}}=this;if(!s.display)return;const o=J(s.font),r=ot(s.padding),a=s.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||D(n)?(l+=r.bottom,V(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=Ad(this,l,n,a);yn(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:u,textAlign:Cd(a,n,i),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,n=t.ticks&&t.ticks.z||0,s=O(t.grid&&t.grid.z,-1);return!this._isVisible()||this.draw!==zt.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:s,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:s+1,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",i=[];let o,r;for(o=0,r=n.length;o<r;++o){const a=n[o];a[s]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return J(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class nn{constructor(t,n,s){this.type=t,this.scope=n,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let s;Dd(n)&&(s=this.register(n));const i=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,Pd(t,r,s),this.override&&P.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const n=this.items,s=t.id,i=this.scope;s in n&&delete n[s],i&&s in P[i]&&(delete P[i][s],this.override&&delete Bt[s])}}function Pd(e,t,n){const s=Ne(Object.create(null),[n?P.get(n):{},P.get(t),e.defaults]);P.set(t,s),e.defaultRoutes&&Od(t,e.defaultRoutes),e.descriptors&&P.describe(t,e.descriptors)}function Od(e,t){Object.keys(t).forEach(n=>{const s=n.split("."),i=s.pop(),o=[e].concat(s).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");P.route(o,i,l,a)})}function Dd(e){return"id"in e&&"defaults"in e}class Ld{constructor(){this.controllers=new nn(lt,"datasets",!0),this.elements=new nn(xt,"elements"),this.plugins=new nn(Object,"plugins"),this.scales=new nn(zt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,s){[...n].forEach(i=>{const o=s||this._getRegistryForType(i);s||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):T(i,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,s){const i=vs(t);W(s["before"+i],[],s),n[t](s),W(s["after"+i],[],s)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const s=this._typedRegistries[n];if(s.isForType(t))return s}return this.plugins}_get(t,n,s){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return i}}var dt=new Ld;class Bs extends lt{update(t){const n=this._cachedMeta,{data:s=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:r}=oa(n,s,i);if(this._drawStart=o,this._drawCount=r,ra(n)&&(o=0,r=s.length),this.options.showLine){const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=s;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}this.updateElements(s,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=dt.getElement("line")),super.addElements()}updateElements(t,n,s,i){const o=i==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(n,i),d=this.getSharedOptions(h),u=this.includeOptions(i,d),f=r.axis,g=a.axis,{spanGaps:p,segment:_}=this.options,b=Xt(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||o||i==="none";let y=n>0&&this.getParsed(n-1);for(let m=n;m<n+s;++m){const x=t[m],w=this.getParsed(m),S=v?x:{},k=R(w[g]),M=S[f]=r.getPixelForValue(w[f],m),A=S[g]=o||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,w,l):w[g],m);S.skip=isNaN(M)||isNaN(A)||k,S.stop=m>0&&Math.abs(w[f]-y[f])>b,_&&(S.parsed=w,S.raw=c.data[m]),u&&(S.options=d||this.resolveDataElementOptions(m,x.active?"active":i)),v||this.updateElement(x,m,S,i),y=w}this.updateSharedOptions(d,i,h)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const s=t.dataset,i=s.options&&s.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}}Bs.id="scatter";Bs.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Bs.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(e){return"("+e.label+", "+e.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Dt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class as{constructor(t){this.options=t||{}}init(t){}formats(){return Dt()}parse(t,n){return Dt()}format(t,n){return Dt()}add(t,n,s){return Dt()}diff(t,n,s){return Dt()}startOf(t,n,s){return Dt()}endOf(t,n){return Dt()}}as.override=function(e){Object.assign(as.prototype,e)};var Td={_date:as};function Rd(e,t,n,s){const{controller:i,data:o,_sorted:r}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?mc:It;if(s){if(i._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,n-h),u=l(o,t,n+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function Ln(e,t,n,s,i){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:u}=Rd(o[a],t,r,i);for(let f=d;f<=u;++f){const g=h[f];g.skip||s(g,c,f)}}}function Ed(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(s,i){const o=t?Math.abs(s.x-i.x):0,r=n?Math.abs(s.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Gn(e,t,n,s,i){const o=[];return!i&&!e.isPointInArea(t)||Ln(e,n,t,function(a,l,c){!i&&!Ve(a,e.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Id(e,t,n,s){let i=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=ta(r,{x:t.x,y:t.y});je(d,c,h)&&i.push({element:r,datasetIndex:a,index:l})}return Ln(e,n,t,o),i}function Fd(e,t,n,s,i,o){let r=[];const a=Ed(n);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,i);if(s&&!f)return;const g=h.getCenterPoint(i);if(!(!!o||e.isPointInArea(g))&&!f)return;const _=a(t,g);_<l?(r=[{element:h,datasetIndex:d,index:u}],l=_):_===l&&r.push({element:h,datasetIndex:d,index:u})}return Ln(e,n,t,c),r}function qn(e,t,n,s,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!s?Id(e,t,n,i):Fd(e,t,n,s,i,o)}function Li(e,t,n,s,i){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return Ln(e,n,t,(l,c,h)=>{l[r](t[n],i)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,i))}),s&&!a?[]:o}var Bd={modes:{index(e,t,n,s){const i=Tt(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Gn(e,i,o,s,r):qn(e,i,o,!1,s,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(e,t,n,s){const i=Tt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?Gn(e,i,o,s,r):qn(e,i,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(e,t,n,s){const i=Tt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Gn(e,i,o,s,r)},nearest(e,t,n,s){const i=Tt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return qn(e,i,o,n.intersect,s,r)},x(e,t,n,s){const i=Tt(t,e);return Li(e,i,"x",n.intersect,s)},y(e,t,n,s){const i=Tt(t,e);return Li(e,i,"y",n.intersect,s)}}};const Pa=["left","top","right","bottom"];function Jt(e,t){return e.filter(n=>n.pos===t)}function Ti(e,t){return e.filter(n=>Pa.indexOf(n.pos)===-1&&n.box.axis===t)}function te(e,t){return e.sort((n,s)=>{const i=t?s:n,o=t?n:s;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function zd(e){const t=[];let n,s,i,o,r,a;for(n=0,s=(e||[]).length;n<s;++n)i=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:r&&o+r,stackWeight:a});return t}function Nd(e){const t={};for(const n of e){const{stack:s,pos:i,stackWeight:o}=n;if(!s||!Pa.includes(i))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function jd(e,t){const n=Nd(e),{vBoxMaxWidth:s,hBoxMaxHeight:i}=t;let o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=i):(a.width=s,a.height=h?h*i:l&&t.availableHeight)}return n}function Vd(e){const t=zd(e),n=te(t.filter(c=>c.box.fullSize),!0),s=te(Jt(t,"left"),!0),i=te(Jt(t,"right")),o=te(Jt(t,"top"),!0),r=te(Jt(t,"bottom")),a=Ti(t,"x"),l=Ti(t,"y");return{fullSize:n,leftAndTop:s.concat(o),rightAndBottom:i.concat(l).concat(r).concat(a),chartArea:Jt(t,"chartArea"),vertical:s.concat(i).concat(l),horizontal:o.concat(r).concat(a)}}function Ri(e,t,n,s){return Math.max(e[n],t[n])+Math.max(e[s],t[s])}function Oa(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Wd(e,t,n,s){const{pos:i,box:o}=n,r=e.maxPadding;if(!D(i)){n.size&&(e[i]-=n.size);const d=s[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&Oa(r,o.getPadding());const a=Math.max(0,t.outerWidth-Ri(r,e,"left","right")),l=Math.max(0,t.outerHeight-Ri(r,e,"top","bottom")),c=a!==e.w,h=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:h}:{same:h,other:c}}function Hd(e){const t=e.maxPadding;function n(s){const i=Math.max(t[s]-e[s],0);return e[s]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function $d(e,t){const n=t.maxPadding;function s(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return s(e?["left","right"]:["top","bottom"])}function ie(e,t,n,s){const i=[];let o,r,a,l,c,h;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,$d(a.horizontal,t));const{same:d,other:u}=Wd(t,n,a,s);c|=d&&i.length,h=h||u,l.fullSize||i.push(a)}return c&&ie(i,t,n,s)||h}function sn(e,t,n,s,i){e.top=n,e.left=t,e.right=t+s,e.bottom=n+i,e.width=s,e.height=i}function Ei(e,t,n,s){const i=n.padding;let{x:o,y:r}=t;for(const a of e){const l=a.box,c=s[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,u=c.size||l.height;it(c.start)&&(r=c.start),l.fullSize?sn(l,i.left,r,n.outerWidth-i.right-i.left,u):sn(l,t.left+c.placed,r,d,u),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,u=c.size||l.width;it(c.start)&&(o=c.start),l.fullSize?sn(l,o,i.top,u,n.outerHeight-i.bottom-i.top):sn(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}P.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var on={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,s){if(!e)return;const i=ot(e.options.layout.padding),o=Math.max(t-i.width,0),r=Math.max(n-i.height,0),a=Vd(e.boxes),l=a.vertical,c=a.horizontal;T(e.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,_)=>_.box.options&&_.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},i);Oa(u,ot(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:i.left,y:i.top},i),g=jd(l.concat(c),d);ie(a.fullSize,f,d,g),ie(l,f,d,g),ie(c,f,d,g)&&ie(l,f,d,g),Hd(f),Ei(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Ei(a.rightAndBottom,f,d,g),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},T(a.chartArea,p=>{const _=p.box;Object.assign(_,e.chartArea),_.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Da{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,s){}removeEventListener(t,n,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,s,i){return n=Math.max(0,n||t.width),s=s||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):s)}}isAttached(t){return!0}updateConfig(t){}}class Yd extends Da{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const dn="$chartjs",Xd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ii=e=>e===null||e==="";function Ud(e,t){const n=e.style,s=e.getAttribute("height"),i=e.getAttribute("width");if(e[dn]={initial:{height:s,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ii(i)){const o=fi(e,"width");o!==void 0&&(e.width=o)}if(Ii(s))if(e.style.height==="")e.height=e.width/(t||2);else{const o=fi(e,"height");o!==void 0&&(e.height=o)}return e}const La=kh?{passive:!0}:!1;function Gd(e,t,n){e.addEventListener(t,n,La)}function qd(e,t,n){e.canvas.removeEventListener(t,n,La)}function Kd(e,t){const n=Xd[e.type]||e.type,{x:s,y:i}=Tt(e,t);return{type:n,chart:t,native:e,x:s!==void 0?s:null,y:i!==void 0?i:null}}function Sn(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Zd(e,t,n){const s=e.canvas,i=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Sn(a.addedNodes,s),r=r&&!Sn(a.removedNodes,s);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Qd(e,t,n){const s=e.canvas,i=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Sn(a.removedNodes,s),r=r&&!Sn(a.addedNodes,s);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const We=new Map;let Fi=0;function Ta(){const e=window.devicePixelRatio;e!==Fi&&(Fi=e,We.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Jd(e,t){We.size||window.addEventListener("resize",Ta),We.set(e,t)}function tu(e){We.delete(e),We.size||window.removeEventListener("resize",Ta)}function eu(e,t,n){const s=e.canvas,i=s&&Ls(s);if(!i)return;const o=ia((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},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(i),Jd(e,o),r}function Kn(e,t,n){n&&n.disconnect(),t==="resize"&&tu(e)}function nu(e,t,n){const s=e.canvas,i=ia(o=>{e.ctx!==null&&n(Kd(o,e))},e,o=>{const r=o[0];return[r,r.offsetX,r.offsetY]});return Gd(s,t,i),i}class su extends Da{acquireContext(t,n){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Ud(t,n),s):null}releaseContext(t){const n=t.canvas;if(!n[dn])return!1;const s=n[dn].initial;["height","width"].forEach(o=>{const r=s[o];R(r)?n.removeAttribute(o):n.setAttribute(o,r)});const i=s.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[dn],!0}addEventListener(t,n,s){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),r={attach:Zd,detach:Qd,resize:eu}[n]||nu;i[n]=r(t,n,s)}removeEventListener(t,n){const s=t.$proxies||(t.$proxies={}),i=s[n];if(!i)return;({attach:Kn,detach:Kn,resize:Kn}[n]||qd)(t,n,i),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,s,i){return Sh(t,n,s,i)}isAttached(t){const n=Ls(t);return!!(n&&n.isConnected)}}function iu(e){return!va()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Yd:su}class ou{constructor(){this._init=[]}notify(t,n,s,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),r=this._notify(o,t,n,s);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,n,s,i){i=i||{};for(const o of t){const r=o.plugin,a=r[s],l=[n,i,o.options];if(W(a,l,r)===!1&&i.cancelable)return!1}return!0}invalidate(){R(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const s=t&&t.config,i=O(s.options&&s.options.plugins,{}),o=ru(s);return i===!1&&!n?[]:lu(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],s=this._cache,i=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,s),t,"stop"),this._notify(i(s,n),t,"start")}}function ru(e){const t={},n=[],s=Object.keys(dt.plugins.items);for(let o=0;o<s.length;o++)n.push(dt.getPlugin(s[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const r=i[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function au(e,t){return!t&&e===!1?null:e===!0?{}:e}function lu(e,{plugins:t,localIds:n},s,i){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=au(s[l],i);c!==null&&o.push({plugin:a,options:cu(e.config,{plugin:a,local:n[l]},c,r)})}return o}function cu(e,{plugin:t,local:n},s,i){const o=e.pluginScopeKeys(t),r=e.getOptionScopes(s,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ls(e,t){const n=P.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function hu(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function du(e,t){return e===t?"_index_":"_value_"}function uu(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function cs(e,t){return e==="x"||e==="y"?e:t.axis||uu(t.position)||e.charAt(0).toLowerCase()}function fu(e,t){const n=Bt[e.type]||{scales:{}},s=t.scales||{},i=ls(e.type,t),o=Object.create(null),r=Object.create(null);return Object.keys(s).forEach(a=>{const l=s[a];if(!D(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=cs(a,l),h=du(c,i),d=n.scales||{};o[c]=o[c]||a,r[a]=Ie(Object.create(null),[{axis:c},l,d[c],d[h]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,c=a.indexAxis||ls(l,t),d=(Bt[l]||{}).scales||{};Object.keys(d).forEach(u=>{const f=hu(u,c),g=a[f+"AxisID"]||o[f]||f;r[g]=r[g]||Object.create(null),Ie(r[g],[{axis:f},s[g],d[u]])})}),Object.keys(r).forEach(a=>{const l=r[a];Ie(l,[P.scales[l.type],P.scale])}),r}function Ra(e){const t=e.options||(e.options={});t.plugins=O(t.plugins,{}),t.scales=fu(e,t)}function Ea(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function gu(e){return e=e||{},e.data=Ea(e.data),Ra(e),e}const Bi=new Map,Ia=new Set;function rn(e,t){let n=Bi.get(e);return n||(n=t(),Bi.set(e,n),Ia.add(n)),n}const ee=(e,t,n)=>{const s=Mt(t,n);s!==void 0&&e.add(s)};class pu{constructor(t){this._config=gu(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=Ea(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(),Ra(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return rn(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return rn(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,s=this.type;return rn(`${s}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const s=this._scopeCache;let i=s.get(t);return(!i||n)&&(i=new Map,s.set(t,i)),i}getOptionScopes(t,n,s){const{options:i,type:o}=this,r=this._cachedScopes(t,s),a=r.get(n);if(a)return a;const l=new Set;n.forEach(h=>{t&&(l.add(t),h.forEach(d=>ee(l,t,d))),h.forEach(d=>ee(l,i,d)),h.forEach(d=>ee(l,Bt[o]||{},d)),h.forEach(d=>ee(l,P,d)),h.forEach(d=>ee(l,os,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ia.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Bt[n]||{},P.datasets[n]||{},{type:n},P,os]}resolveNamedOptions(t,n,s,i=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=zi(this._resolverCache,t,i);let l=r;if(bu(r,n)){o.$shared=!1,s=Ct(s)?s():s;const c=this.createResolver(t,s,a);l=Ut(r,s,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,s=[""],i){const{resolver:o}=zi(this._resolverCache,t,s);return D(n)?Ut(o,n,void 0,i):o}}function zi(e,t,n){let s=e.get(t);s||(s=new Map,e.set(t,s));const i=n.join();let o=s.get(i);return o||(o={resolver:Ps(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},s.set(i,o)),o}const mu=e=>D(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||Ct(e[n]),!1);function bu(e,t){const{isScriptable:n,isIndexable:s}=pa(e);for(const i of t){const o=n(i),r=s(i),a=(r||o)&&e[i];if(o&&(Ct(a)||mu(a))||r&&V(a))return!0}return!1}var _u="3.9.1";const xu=["top","bottom","left","right","chartArea"];function Ni(e,t){return e==="top"||e==="bottom"||xu.indexOf(e)===-1&&t==="x"}function ji(e,t){return function(n,s){return n[e]===s[e]?n[t]-s[t]:n[e]-s[e]}}function Vi(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),W(n&&n.onComplete,[e],t)}function yu(e){const t=e.chart,n=t.options.animation;W(n&&n.onProgress,[e],t)}function Fa(e){return va()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const kn={},Ba=e=>{const t=Fa(e);return Object.values(kn).filter(n=>n.canvas===t).pop()};function vu(e,t,n){const s=Object.keys(e);for(const i of s){const o=+i;if(o>=t){const r=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=r)}}}function wu(e,t,n,s){return!n||e.type==="mouseout"?null:s?t:e}class zs{constructor(t,n){const s=this.config=new pu(n),i=Fa(t),o=Ba(i);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=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||iu(i)),this.platform.updateConfig(s);const a=this.platform.acquireContext(i,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=sc(),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 ou,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=xc(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],kn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}pt.listen(this,"complete",Vi),pt.listen(this,"progress",yu),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:s,height:i,_aspectRatio:o}=this;return R(t)?n&&o?o:i?s/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ui(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ci(this.canvas,this.ctx),this}stop(){return pt.stop(this),this}resize(t,n){pt.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const s=this.options,i=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(i,t,n,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ui(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),W(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};T(n,(s,i)=>{s.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,s=this.scales,i=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=cs(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),T(o,r=>{const a=r.options,l=a.id,c=cs(l,a),h=O(a.type,r.dtype);(a.position===void 0||Ni(a.position,c)!==Ni(r.dposition))&&(a.position=r.dposition),i[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=dt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),T(i,(r,a)=>{r||delete s[a]}),T(s,r=>{on.configure(this,r,r.options),on.addBox(this,r)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,s=t.length;if(t.sort((i,o)=>i.index-o.index),s>n){for(let i=n;i<s;++i)this._destroyDatasetMeta(i);t.splice(n,s-n)}this._sortedMetasets=t.slice(0).sort(ji("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((s,i)=>{n.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let s,i;for(this._removeUnreferencedMetasets(),s=0,i=n.length;s<i;s++){const o=n[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||ls(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=dt.getController(a),{datasetElementType:c,dataElementType:h}=P.datasets[a];Object.assign(l.prototype,{dataElementType:dt.getElement(h),datasetElementType:c&&dt.getElement(c)}),r.controller=new l(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){T(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!s.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:d}=this.getDatasetMeta(c),u=!i&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),i||T(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ji("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){T(this.scales,t=>{on.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Ks(n,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:s,start:i,count:o}of n){const r=s==="_removeElements"?-o:o;vu(t,i,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),i=s(0);for(let o=1;o<n;o++)if(!Ks(i,s(o)))return;return Array.from(i).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;on.update(this,this.width,this.height,t);const n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],T(this.boxes,i=>{s&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,s=this.data.datasets.length;n<s;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,s=this.data.datasets.length;n<s;++n)this._updateDataset(n,Ct(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const s=this.getDatasetMeta(t),i={meta:s,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(s.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(pt.has(this)?this.attached&&!pt.running(this)&&pt.start(this):(this.draw(),Vi({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:i}=this._resizeBeforeDraw;this._resize(s,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,s=[];let i,o;for(i=0,o=n.length;i<o;++i){const r=n[i];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,s=t._clip,i=!s.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&ua(n,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),i&&fa(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,s,i){const o=Bd.modes[n];return typeof o=="function"?o(this,t,s,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],s=this._metasets;let i=s.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},s.push(i)),i}getContext(){return this.$context||(this.$context=At(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden}setDatasetVisibility(t,n){const s=this.getDatasetMeta(t);s.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,s){const i=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,i);it(n)?(o.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),pt.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ci(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete kn[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,n=this.platform,s=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},i=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};T(this.options.events,o=>s(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,s=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{i("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),s("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){T(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},T(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,s){const i=s?"set":"remove";let o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[i+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],s=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}});!gn(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n))}notifyPlugins(t,n,s){return this._plugins.notify(this,t,n,s)}_updateHoverStyles(t,n,s){const i=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(n,t),a=s?t:o(t,n);r.length&&this.updateHoverStyle(r,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const s={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,i)===!1)return;const o=this._handleEvent(t,n,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,i),(o||s.changed)&&this.render(),this}_handleEvent(t,n,s){const{_active:i=[],options:o}=this,r=n,a=this._getActiveElements(t,i,s,r),l=cc(t),c=wu(t,this._lastEvent,s,l);s&&(this._lastEvent=null,W(o.onHover,[t,a,this],this),l&&W(o.onClick,[t,a,this],this));const h=!gn(a,i);return(h||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,h}_getActiveElements(t,n,s,i){if(t.type==="mouseout")return[];if(!s)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}const Wi=()=>T(zs.instances,e=>e._plugins.invalidate()),yt=!0;Object.defineProperties(zs,{defaults:{enumerable:yt,value:P},instances:{enumerable:yt,value:kn},overrides:{enumerable:yt,value:Bt},registry:{enumerable:yt,value:dt},version:{enumerable:yt,value:_u},getChart:{enumerable:yt,value:Ba},register:{enumerable:yt,value:(...e)=>{dt.add(...e),Wi()}},unregister:{enumerable:yt,value:(...e)=>{dt.remove(...e),Wi()}}});function za(e,t,n){const{startAngle:s,pixelMargin:i,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,r,a,s-c,n+c),l>i?(c=i/l,e.arc(o,r,l,n+c,s-c,!0)):e.arc(o,r,i,n+H,s-H),e.closePath(),e.clip()}function Su(e){return As(e,["outerStart","outerEnd","innerStart","innerEnd"])}function ku(e,t,n,s){const i=Su(e.options.borderRadius),o=(n-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(n-Math.min(o,l))*s/2;return K(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:K(i.innerStart,0,r),innerEnd:K(i.innerEnd,0,r)}}function Vt(e,t,n,s){return{x:n+e*Math.cos(t),y:s+e*Math.sin(t)}}function hs(e,t,n,s,i,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+n-c,0),u=h>0?h+s+n+c:0;let f=0;const g=i-l;if(s){const C=h>0?h-s:0,F=d>0?d-s:0,j=(C+F)/2,ft=j!==0?g*j/(j+s):g;f=(g-ft)/2}const p=Math.max(.001,g*d-n/$)/d,_=(g-p)/2,b=l+_+f,v=i-_-f,{outerStart:y,outerEnd:m,innerStart:x,innerEnd:w}=ku(t,u,d,v-b),S=d-y,k=d-m,M=b+y/S,A=v-m/k,L=u+x,E=u+w,G=b+x/L,B=v-w/E;if(e.beginPath(),o){if(e.arc(r,a,d,M,A),m>0){const j=Vt(k,A,r,a);e.arc(j.x,j.y,m,A,v+H)}const C=Vt(E,v,r,a);if(e.lineTo(C.x,C.y),w>0){const j=Vt(E,B,r,a);e.arc(j.x,j.y,w,v+H,B+Math.PI)}if(e.arc(r,a,u,v-w/u,b+x/u,!0),x>0){const j=Vt(L,G,r,a);e.arc(j.x,j.y,x,G+Math.PI,b-H)}const F=Vt(S,b,r,a);if(e.lineTo(F.x,F.y),y>0){const j=Vt(S,M,r,a);e.arc(j.x,j.y,y,b-H,M)}}else{e.moveTo(r,a);const C=Math.cos(M)*d+r,F=Math.sin(M)*d+a;e.lineTo(C,F);const j=Math.cos(A)*d+r,ft=Math.sin(A)*d+a;e.lineTo(j,ft)}e.closePath()}function Mu(e,t,n,s,i){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){hs(e,t,n,s,r+z,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=r+a%z,a%z===0&&(l+=z))}return hs(e,t,n,s,l,i),e.fill(),l}function Cu(e,t,n){const{x:s,y:i,startAngle:o,pixelMargin:r,fullCircles:a}=t,l=Math.max(t.outerRadius-r,0),c=t.innerRadius+r;let h;for(n&&za(e,t,o+z),e.beginPath(),e.arc(s,i,c,o+z,o,!0),h=0;h<a;++h)e.stroke();for(e.beginPath(),e.arc(s,i,l,o,o+z),h=0;h<a;++h)e.stroke()}function Au(e,t,n,s,i,o){const{options:r}=t,{borderWidth:a,borderJoinStyle:l}=r,c=r.borderAlign==="inner";a&&(c?(e.lineWidth=a*2,e.lineJoin=l||"round"):(e.lineWidth=a,e.lineJoin=l||"bevel"),t.fullCircles&&Cu(e,t,c),c&&za(e,t,i),hs(e,t,n,s,i,o),e.stroke())}class Ns extends xt{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,s){const i=this.getProps(["x","y"],s),{angle:o,distance:r}=ta(i,{x:t,y:n}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),u=this.options.spacing/2,g=O(d,l-a)>=z||je(o,a,l),p=bn(r,c+u,h+u);return g&&p}getCenterPoint(t){const{x:n,y:s,startAngle:i,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(i+o)/2,d=(r+a+c+l)/2;return{x:n+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:s}=this,i=(n.offset||0)/2,o=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>z?Math.floor(s/z):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(i){a=i/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=$&&(a=i)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor;const l=Mu(t,this,a,o,r);Au(t,this,a,o,l,r),t.restore()}}Ns.id="arc";Ns.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Ns.defaultRoutes={backgroundColor:"backgroundColor"};function Na(e,t,n=t){e.lineCap=O(n.borderCapStyle,t.borderCapStyle),e.setLineDash(O(n.borderDash,t.borderDash)),e.lineDashOffset=O(n.borderDashOffset,t.borderDashOffset),e.lineJoin=O(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=O(n.borderWidth,t.borderWidth),e.strokeStyle=O(n.borderColor,t.borderColor)}function Pu(e,t,n){e.lineTo(n.x,n.y)}function Ou(e){return e.stepped?Uc:e.tension||e.cubicInterpolationMode==="monotone"?Gc:Pu}function ja(e,t,n={}){const s=e.length,{start:i=0,end:o=s-1}=n,{start:r,end:a}=t,l=Math.max(i,r),c=Math.min(o,a),h=i<r&&o<r||i>a&&o>a;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function Du(e,t,n,s){const{points:i,options:o}=t,{count:r,start:a,loop:l,ilen:c}=ja(i,n,s),h=Ou(o);let{move:d=!0,reverse:u}=s||{},f,g,p;for(f=0;f<=c;++f)g=i[(a+(u?c-f:f))%r],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):h(e,p,g,u,o.stepped),p=g);return l&&(g=i[(a+(u?c:0))%r],h(e,p,g,u,o.stepped)),!!l}function Lu(e,t,n,s){const i=t.points,{count:o,start:r,ilen:a}=ja(i,n,s),{move:l=!0,reverse:c}=s||{};let h=0,d=0,u,f,g,p,_,b;const v=m=>(r+(c?a-m:m))%o,y=()=>{p!==_&&(e.lineTo(h,_),e.lineTo(h,p),e.lineTo(h,b))};for(l&&(f=i[v(0)],e.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=i[v(u)],f.skip)continue;const m=f.x,x=f.y,w=m|0;w===g?(x<p?p=x:x>_&&(_=x),h=(d*h+m)/++d):(y(),e.lineTo(m,x),g=w,d=0,p=_=x),b=x}y()}function ds(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Lu:Du}function Tu(e){return e.stepped?Mh:e.tension||e.cubicInterpolationMode==="monotone"?Ch:Rt}function Ru(e,t,n,s){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,s)&&i.closePath()),Na(e,t.options),e.stroke(i)}function Eu(e,t,n,s){const{segments:i,options:o}=t,r=ds(t);for(const a of i)Na(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+s-1})&&e.closePath(),e.stroke()}const Iu=typeof Path2D=="function";function Fu(e,t,n,s){Iu&&!t.options.segment?Ru(e,t,n,s):Eu(e,t,n,s)}class Tn extends xt{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,n){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const i=s.spanGaps?this._loop:this._fullLoop;bh(this._points,s,t,i,n),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=Bh(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,s=t.length;return s&&n[t[s-1].end]}interpolate(t,n){const s=this.options,i=t[n],o=this.points,r=Eh(this,{property:n,start:i,end:i});if(!r.length)return;const a=[],l=Tu(s);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:u}=r[c],f=o[d],g=o[u];if(f===g){a.push(f);continue}const p=Math.abs((i-f[n])/(g[n]-f[n])),_=l(f,g,p,s.stepped);_[n]=t[n],a.push(_)}return a.length===1?a[0]:a}pathSegment(t,n,s){return ds(this)(t,this,n,s)}path(t,n,s){const i=this.segments,o=ds(this);let r=this._loop;n=n||0,s=s||this.points.length-n;for(const a of i)r&=o(t,this,a,{start:n,end:n+s-1});return!!r}draw(t,n,s,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Fu(t,this,s,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Tn.id="line";Tn.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Tn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Tn.descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"};function Hi(e,t,n,s){const i=e.options,{[n]:o}=e.getProps([n],s);return Math.abs(t-o)<i.radius+i.hitRadius}class js extends xt{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,s){const i=this.options,{x:o,y:r}=this.getProps(["x","y"],s);return Math.pow(t-o,2)+Math.pow(n-r,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,n){return Hi(this,t,"x",n)}inYRange(t,n){return Hi(this,t,"y",n)}getCenterPoint(t){const{x:n,y:s}=this.getProps(["x","y"],t);return{x:n,y:s}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const s=n&&t.borderWidth||0;return(n+s)*2}draw(t,n){const s=this.options;this.skip||s.radius<.1||!Ve(this,n,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,rs(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}js.id="point";js.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};js.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function Va(e,t){const{x:n,y:s,base:i,width:o,height:r}=e.getProps(["x","y","base","width","height"],t);let a,l,c,h,d;return e.horizontal?(d=r/2,a=Math.min(n,i),l=Math.max(n,i),c=s-d,h=s+d):(d=o/2,a=n-d,l=n+d,c=Math.min(s,i),h=Math.max(s,i)),{left:a,top:c,right:l,bottom:h}}function St(e,t,n,s){return e?0:K(t,n,s)}function Bu(e,t,n){const s=e.options.borderWidth,i=e.borderSkipped,o=ga(s);return{t:St(i.top,o.top,0,n),r:St(i.right,o.right,0,t),b:St(i.bottom,o.bottom,0,n),l:St(i.left,o.left,0,t)}}function zu(e,t,n){const{enableBorderRadius:s}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=Yt(i),r=Math.min(t,n),a=e.borderSkipped,l=s||D(i);return{topLeft:St(!l||a.top||a.left,o.topLeft,0,r),topRight:St(!l||a.top||a.right,o.topRight,0,r),bottomLeft:St(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:St(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Nu(e){const t=Va(e),n=t.right-t.left,s=t.bottom-t.top,i=Bu(e,n/2,s/2),o=zu(e,n/2,s/2);return{outer:{x:t.left,y:t.top,w:n,h:s,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:s-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Zn(e,t,n,s){const i=t===null,o=n===null,a=e&&!(i&&o)&&Va(e,s);return a&&(i||bn(t,a.left,a.right))&&(o||bn(n,a.top,a.bottom))}function ju(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Vu(e,t){e.rect(t.x,t.y,t.w,t.h)}function Qn(e,t,n={}){const s=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-s,r=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+s,y:e.y+i,w:e.w+o,h:e.h+r,radius:e.radius}}class Vs extends xt{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:n,options:{borderColor:s,backgroundColor:i}}=this,{inner:o,outer:r}=Nu(this),a=ju(r.radius)?vn:Vu;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Qn(r,n,o)),t.clip(),a(t,Qn(o,-n,r)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,Qn(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,s){return Zn(this,t,n,s)}inXRange(t,n){return Zn(this,t,null,n)}inYRange(t,n){return Zn(this,null,t,n)}getCenterPoint(t){const{x:n,y:s,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?s:(s+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Vs.id="bar";Vs.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Vs.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};const un={average(e){if(!e.length)return!1;let t,n,s=0,i=0,o=0;for(t=0,n=e.length;t<n;++t){const r=e[t].element;if(r&&r.hasValue()){const a=r.tooltipPosition();s+=a.x,i+=a.y,++o}}return{x:s/o,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,s=t.y,i=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=ss(t,c);h<i&&(i=h,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,s=l.y}return{x:n,y:s}}};function ct(e,t){return t&&(V(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function mt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
17
|
-
`)>-1?e.split(`
|
|
18
|
-
`):e}function Wu(e,t){const{element:n,datasetIndex:s,index:i}=t,o=e.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(i);return{chart:e,label:r,parsed:o.getParsed(i),raw:e.data.datasets[s].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:s,element:n}}function $i(e,t){const n=e.chart.ctx,{body:s,footer:i,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=J(t.bodyFont),c=J(t.titleFont),h=J(t.footerFont),d=o.length,u=i.length,f=s.length,g=ot(t.padding);let p=g.height,_=0,b=s.reduce((m,x)=>m+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const m=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*m+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let v=0;const y=function(m){_=Math.max(_,n.measureText(m).width+v)};return n.save(),n.font=c.string,T(e.title,y),n.font=l.string,T(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?r+2+t.boxPadding:0,T(s,m=>{T(m.before,y),T(m.lines,y),T(m.after,y)}),v=0,n.font=h.string,T(e.footer,y),n.restore(),_+=g.width,{width:_,height:p}}function Hu(e,t){const{y:n,height:s}=t;return n<s/2?"top":n>e.height-s/2?"bottom":"center"}function $u(e,t,n,s){const{x:i,width:o}=s,r=n.caretSize+n.caretPadding;if(e==="left"&&i+o+r>t.width||e==="right"&&i-o-r<0)return!0}function Yu(e,t,n,s){const{x:i,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return s==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=r-o/2&&(c="right"),$u(c,e,t,n)&&(c="center"),c}function Yi(e,t,n){const s=n.yAlign||t.yAlign||Hu(e,n);return{xAlign:n.xAlign||t.xAlign||Yu(e,t,n,s),yAlign:s}}function Xu(e,t){let{x:n,width:s}=e;return t==="right"?n-=s:t==="center"&&(n-=s/2),n}function Uu(e,t,n){let{y:s,height:i}=e;return t==="top"?s+=n:t==="bottom"?s-=i+n:s-=i/2,s}function Xi(e,t,n,s){const{caretSize:i,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=i+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Yt(r);let g=Xu(t,a);const p=Uu(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+i:a==="right"&&(g+=Math.max(d,f)+i),{x:K(g,0,s.width-t.width),y:K(p,0,s.height-t.height)}}function an(e,t,n){const s=ot(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-s.right:e.x+s.left}function Ui(e){return ct([],mt(e))}function Gu(e,t,n){return At(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Gi(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}class qu extends xt{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||t._chart,this._chart=this.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 n=this.chart,s=this.options.setContext(this.getContext()),i=s.enabled&&n.options.animation&&s.animations,o=new Sa(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Gu(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:s}=n,i=s.beforeTitle.apply(this,[t]),o=s.title.apply(this,[t]),r=s.afterTitle.apply(this,[t]);let a=[];return a=ct(a,mt(i)),a=ct(a,mt(o)),a=ct(a,mt(r)),a}getBeforeBody(t,n){return Ui(n.callbacks.beforeBody.apply(this,[t]))}getBody(t,n){const{callbacks:s}=n,i=[];return T(t,o=>{const r={before:[],lines:[],after:[]},a=Gi(s,o);ct(r.before,mt(a.beforeLabel.call(this,o))),ct(r.lines,a.label.call(this,o)),ct(r.after,mt(a.afterLabel.call(this,o))),i.push(r)}),i}getAfterBody(t,n){return Ui(n.callbacks.afterBody.apply(this,[t]))}getFooter(t,n){const{callbacks:s}=n,i=s.beforeFooter.apply(this,[t]),o=s.footer.apply(this,[t]),r=s.afterFooter.apply(this,[t]);let a=[];return a=ct(a,mt(i)),a=ct(a,mt(o)),a=ct(a,mt(r)),a}_createItems(t){const n=this._active,s=this.chart.data,i=[],o=[],r=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(Wu(this.chart,n[l]));return t.filter&&(a=a.filter((h,d,u)=>t.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),T(a,h=>{const d=Gi(t.callbacks,h);i.push(d.labelColor.call(this,h)),o.push(d.labelPointStyle.call(this,h)),r.push(d.labelTextColor.call(this,h))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const s=this.options.setContext(this.getContext()),i=this._active;let o,r=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=un[s.position].call(this,i,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=$i(this,s),c=Object.assign({},a,l),h=Yi(this.chart,s,c),d=Xi(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.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&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,s,i){const o=this.getCaretPosition(t,s,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,s){const{xAlign:i,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Yt(a),{x:u,y:f}=t,{width:g,height:p}=n;let _,b,v,y,m,x;return o==="center"?(m=f+p/2,i==="left"?(_=u,b=_-r,y=m+r,x=m-r):(_=u+g,b=_+r,y=m-r,x=m+r),v=_):(i==="left"?b=u+Math.max(l,h)+r:i==="right"?b=u+g-Math.max(c,d)-r:b=this.caretX,o==="top"?(y=f,m=y-r,_=b-r,v=b+r):(y=f+p,m=y+r,_=b+r,v=b-r),x=y),{x1:_,x2:b,x3:v,y1:y,y2:m,y3:x}}drawTitle(t,n,s){const i=this.title,o=i.length;let r,a,l;if(o){const c=$n(s.rtl,this.x,this.width);for(t.x=an(this,s.titleAlign,s),n.textAlign=c.textAlign(s.titleAlign),n.textBaseline="middle",r=J(s.titleFont),a=s.titleSpacing,n.fillStyle=s.titleColor,n.font=r.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,n,s,i,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c,boxPadding:h}=o,d=J(o.bodyFont),u=an(this,"left",o),f=i.x(u),g=l<d.lineHeight?(d.lineHeight-l)/2:0,p=n.y+g;if(o.usePointStyle){const _={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=i.leftForLtr(f,c)+c/2,v=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,rs(t,_,b,v),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,rs(t,_,b,v)}else{t.lineWidth=D(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 _=i.leftForLtr(f,c-h),b=i.leftForLtr(i.xPlus(f,1),c-h-2),v=Yt(r.borderRadius);Object.values(v).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,vn(t,{x:_,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),vn(t,{x:b,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(_,p,c,l),t.strokeRect(_,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,n,s){const{body:i}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=J(s.bodyFont);let u=d.lineHeight,f=0;const g=$n(s.rtl,this.x,this.width),p=function(k){n.fillText(k,g.x(t.x+f),t.y+u/2),t.y+=u+o},_=g.textAlign(r);let b,v,y,m,x,w,S;for(n.textAlign=r,n.textBaseline="middle",n.font=d.string,t.x=an(this,_,s),n.fillStyle=s.bodyColor,T(this.beforeBody,p),f=a&&_!=="right"?r==="center"?c/2+h:c+2+h:0,m=0,w=i.length;m<w;++m){for(b=i[m],v=this.labelTextColors[m],n.fillStyle=v,T(b.before,p),y=b.lines,a&&y.length&&(this._drawColorBox(n,t,m,g,s),u=Math.max(d.lineHeight,l)),x=0,S=y.length;x<S;++x)p(y[x]),u=d.lineHeight;T(b.after,p)}f=0,u=d.lineHeight,T(this.afterBody,p),t.y-=o}drawFooter(t,n,s){const i=this.footer,o=i.length;let r,a;if(o){const l=$n(s.rtl,this.x,this.width);for(t.x=an(this,s.footerAlign,s),t.y+=s.footerMarginTop,n.textAlign=l.textAlign(s.footerAlign),n.textBaseline="middle",r=J(s.footerFont),n.fillStyle=s.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(i[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,n,s,i){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=Yt(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),r==="top"&&this.drawCaret(t,n,s,i),n.lineTo(a+c-u,l),n.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,n,s,i),n.lineTo(a+c,l+h-g),n.quadraticCurveTo(a+c,l+h,a+c-g,l+h),r==="bottom"&&this.drawCaret(t,n,s,i),n.lineTo(a+f,l+h),n.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,n,s,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,s=this.$animations,i=s&&s.x,o=s&&s.y;if(i||o){const r=un[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=$i(this,t),l=Object.assign({},r,this._size),c=Yi(n,t,l),h=Xi(t,l,c,n);(i._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 n=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=ot(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,i,n),Dh(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Lh(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const s=this._active,i=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=!gn(s,i),r=this._positionChanged(i,n);(o||r)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,s),a=this._positionChanged(r,t),l=n||!gn(r,o)||a;return l&&(this._active=r,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,s,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:s,caretY:i,options:o}=this,r=un[o.position].call(this,t,n);return r!==!1&&(s!==r.x||i!==r.y)}}qu.positioners=un;const Ku=(e,t,n,s)=>(typeof t=="string"?(n=e.push(t)-1,s.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Zu(e,t,n,s){const i=e.indexOf(t);if(i===-1)return Ku(e,t,n,s);const o=e.lastIndexOf(t);return i!==o?n:i}const Qu=(e,t)=>e===null?null:K(Math.round(e),0,t);class us extends zt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const s=this.getLabels();for(const{index:i,label:o}of n)s[i]===o&&s.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(R(t))return null;const s=this.getLabels();return n=isFinite(n)&&s[n]===t?n:Zu(s,t,O(n,t),this._addedLabels),Qu(n,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:s,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),n||(i=this.getLabels().length-1)),this.min=s,this.max=i}buildTicks(){const t=this.min,n=this.max,s=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=n;r++)i.push({value:r});return i}getLabelForValue(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]: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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}us.id="category";us.defaults={ticks:{callback:us.prototype.getLabelForValue}};function Ju(e,t){const n=[],{bounds:i,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=e,f=o||1,g=h-1,{min:p,max:_}=t,b=!R(r),v=!R(a),y=!R(c),m=(_-p)/(d+1);let x=Qs((_-p)/g/f)*f,w,S,k,M;if(x<1e-14&&!b&&!v)return[{value:p},{value:_}];M=Math.ceil(_/x)-Math.floor(p/x),M>g&&(x=Qs(M*x/g/f)*f),R(l)||(w=Math.pow(10,l),x=Math.ceil(x*w)/w),i==="ticks"?(S=Math.floor(p/x)*x,k=Math.ceil(_/x)*x):(S=p,k=_),b&&v&&o&&fc((a-r)/o,x/1e3)?(M=Math.round(Math.min((a-r)/x,h)),x=(a-r)/M,S=r,k=a):y?(S=b?r:S,k=v?a:k,M=c-1,x=(k-S)/M):(M=(k-S)/x,Fe(M,Math.round(M),x/1e3)?M=Math.round(M):M=Math.ceil(M));const A=Math.max(Js(x),Js(S));w=Math.pow(10,R(l)?A:l),S=Math.round(S*w)/w,k=Math.round(k*w)/w;let L=0;for(b&&(u&&S!==r?(n.push({value:r}),S<r&&L++,Fe(Math.round((S+L*x)*w)/w,r,qi(r,m,e))&&L++):S<r&&L++);L<M;++L)n.push({value:Math.round((S+L*x)*w)/w});return v&&u&&k!==a?n.length&&Fe(n[n.length-1].value,a,qi(a,m,e))?n[n.length-1].value=a:n.push({value:a}):(!v||k===a)&&n.push({value:k}),n}function qi(e,t,{horizontal:n,minRotation:s}){const i=at(s),o=(n?Math.sin(i):Math.cos(i))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class Mn extends zt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return R(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:s}=this.getUserBounds();let{min:i,max:o}=this;const r=l=>i=n?i:l,a=l=>o=s?o:l;if(t){const l=ut(i),c=ut(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(i===o){let l=1;(o>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(o*.05)),a(o+l),t||r(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:s}=t,i;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const i={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=Ju(i,o);return t.bounds==="ticks"&&Jr(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 n=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const i=(s-n)/Math.max(t.length-1,1)/2;n-=i,s+=i}this._startValue=n,this._endValue=s,this._valueRange=s-n}getLabelForValue(t){return $e(t,this.chart.options.locale,this.options.ticks.format)}}class Wa extends Mn{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=U(t)?t:0,this.max=U(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,s=at(this.options.ticks.minRotation),i=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Wa.id="linear";Wa.defaults={ticks:{callback:Dn.formatters.numeric}};function Ki(e){return e/Math.pow(10,Math.floor(st(e)))===1}function tf(e,t){const n=Math.floor(st(t.max)),s=Math.ceil(t.max/Math.pow(10,n)),i=[];let o=et(e.min,Math.pow(10,Math.floor(st(t.min)))),r=Math.floor(st(o)),a=Math.floor(o/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do i.push({value:o,major:Ki(o)}),++a,a===10&&(a=1,++r,l=r>=0?1:l),o=Math.round(a*Math.pow(10,r)*l)/l;while(r<n||r===n&&a<s);const c=et(e.max,o);return i.push({value:c,major:Ki(o)}),i}let Ha=class extends zt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const s=Mn.prototype.parse.apply(this,[t,n]);if(s===0){this._zero=!0;return}return U(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=U(t)?Math.max(0,t):null,this.max=U(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let s=this.min,i=this.max;const o=l=>s=t?s:l,r=l=>i=n?i:l,a=(l,c)=>Math.pow(10,Math.floor(st(l))+c);s===i&&(s<=0?(o(1),r(10)):(o(a(s,-1)),r(a(i,1)))),s<=0&&o(a(i,-1)),i<=0&&r(a(s,1)),this._zero&&this.min!==this._suggestedMin&&s===a(this.min,0)&&o(a(s,-1)),this.min=s,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},s=tf(n,this);return t.bounds==="ticks"&&Jr(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":$e(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=st(t),this._valueRange=st(this.max)-st(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(st(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}};Ha.id="logarithmic";Ha.defaults={ticks:{callback:Dn.formatters.logarithmic,major:{enabled:!0}}};function fs(e){const t=e.ticks;if(t.display&&e.display){const n=ot(t.backdropPadding);return O(t.font&&t.font.size,P.font.size)+n.height}return 0}function ef(e,t,n){return n=V(n)?n:[n],{w:Yc(e,t.string,n),h:n.length*t.lineHeight}}function Zi(e,t,n,s,i){return e===s||e===i?{start:t-n/2,end:t+n/2}:e<s||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function nf(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),s=[],i=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?$/o:0;for(let l=0;l<o;l++){const c=r.setContext(e.getPointLabelContext(l));i[l]=c.padding;const h=e.getPointPosition(l,e.drawingArea+i[l],a),d=J(c.font),u=ef(e.ctx,d,e._pointLabels[l]);s[l]=u;const f=rt(e.getIndexAngle(l)+a),g=Math.round(ws(f)),p=Zi(g,h.x,u.w,0,180),_=Zi(g,h.y,u.h,90,270);sf(n,t,f,p,_)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=of(e,s,i)}function sf(e,t,n,s,i){const o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n));let a=0,l=0;s.start<t.l?(a=(t.l-s.start)/o,e.l=Math.min(e.l,t.l-a)):s.end>t.r&&(a=(s.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/r,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function of(e,t,n){const s=[],i=e._pointLabels.length,o=e.options,r=fs(o)/2,a=e.drawingArea,l=o.pointLabels.centerPointLabels?$/i:0;for(let c=0;c<i;c++){const h=e.getPointPosition(c,a+r+n[c],l),d=Math.round(ws(rt(h.angle+H))),u=t[c],f=lf(h.y,u.h,d),g=rf(d),p=af(h.x,u.w,g);s.push({x:h.x,y:f,textAlign:g,left:p,top:f,right:p+u.w,bottom:f+u.h})}return s}function rf(e){return e===0||e===180?"center":e<180?"left":"right"}function af(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function lf(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function cf(e,t){const{ctx:n,options:{pointLabels:s}}=e;for(let i=t-1;i>=0;i--){const o=s.setContext(e.getPointLabelContext(i)),r=J(o.font),{x:a,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=e._pointLabelItems[i],{backdropColor:g}=o;if(!R(g)){const p=Yt(o.borderRadius),_=ot(o.backdropPadding);n.fillStyle=g;const b=h-_.left,v=d-_.top,y=u-h+_.width,m=f-d+_.height;Object.values(p).some(x=>x!==0)?(n.beginPath(),vn(n,{x:b,y:v,w:y,h:m,radius:p}),n.fill()):n.fillRect(b,v,y,m)}yn(n,e._pointLabels[i],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function $a(e,t,n,s){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,z);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let r=1;r<s;r++)o=e.getPointPosition(r,t),i.lineTo(o.x,o.y)}}function hf(e,t,n,s){const i=e.ctx,o=t.circular,{color:r,lineWidth:a}=t;!o&&!s||!r||!a||n<0||(i.save(),i.strokeStyle=r,i.lineWidth=a,i.setLineDash(t.borderDash),i.lineDashOffset=t.borderDashOffset,i.beginPath(),$a(e,n,o,s),i.closePath(),i.stroke(),i.restore())}function df(e,t,n){return At(e,{label:n,index:t,type:"pointLabel"})}class Rn extends Mn{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=ot(fs(this.options)/2),n=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(n,s)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=U(t)&&!isNaN(t)?t:0,this.max=U(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fs(this.options))}generateTickLabels(t){Mn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,s)=>{const i=W(this.options.pointLabels.callback,[n,s],this);return i||i===0?i:""}).filter((n,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?nf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,s,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((s-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,s,i))}getIndexAngle(t){const n=z/(this._pointLabels.length||1),s=this.options.startAngle||0;return rt(t*n+at(s))}getDistanceFromCenterForValue(t){if(R(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(R(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const s=n[t];return df(this.getContext(),t,s)}}getPointPosition(t,n,s=0){const i=this.getIndexAngle(t)-H+s;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:s,right:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:s,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),$a(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:s,grid:i}=n,o=this._pointLabels.length;let r,a,l;if(n.pointLabels.display&&cf(this,o),i.display&&this.ticks.forEach((c,h)=>{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);const d=i.setContext(this.getContext(h-1));hf(this,d,a,o)}}),s.display){for(t.save(),r=o-1;r>=0;r--){const c=s.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,s=n.ticks;if(!s.display)return;const i=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=s.setContext(this.getContext(l)),h=J(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 d=ot(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}yn(t,a.label,0,-o,h,{color:c.color})}),t.restore()}drawTitle(){}}Rn.id="radialLinear";Rn.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Dn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};Rn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Rn.descriptors={angleLines:{_fallback:"grid"}};const En={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}},Q=Object.keys(En);function uf(e,t){return e-t}function Qi(e,t){if(R(t))return null;const n=e._adapter,{parser:s,round:i,isoWeekday:o}=e._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),U(r)||(r=typeof s=="string"?n.parse(r,s):n.parse(r)),r===null?null:(i&&(r=i==="week"&&(Xt(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,i)),+r)}function Ji(e,t,n,s){const i=Q.length;for(let o=Q.indexOf(e);o<i-1;++o){const r=En[Q[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=s)return Q[o]}return Q[i-1]}function ff(e,t,n,s,i){for(let o=Q.length-1;o>=Q.indexOf(n);o--){const r=Q[o];if(En[r].common&&e._adapter.diff(i,s,r)>=t-1)return r}return Q[n?Q.indexOf(n):0]}function gf(e){for(let t=Q.indexOf(e)+1,n=Q.length;t<n;++t)if(En[Q[t]].common)return Q[t]}function to(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:s,hi:i}=Ss(n,t),o=n[s]>=t?n[s]:n[i];e[o]=!0}}function pf(e,t,n,s){const i=e._adapter,o=+i.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+i.add(a,1,s))l=n[a],l>=0&&(t[l].major=!0);return t}function eo(e,t,n){const s=[],i={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],i[a]=r,s.push({value:a,major:!1});return o===0||!n?s:pf(e,s,i,n)}class In extends zt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n){const s=t.time||(t.time={}),i=this._adapter=new Td._date(t.adapters.date);i.init(n),Ie(s.displayFormats,i.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Qi(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,s=t.time.unit||"day";let{min:i,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(i=Math.min(i,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))),i=U(i)&&!isNaN(i)?i:+n.startOf(Date.now(),s),o=U(o)&&!isNaN(o)?o:+n.endOf(Date.now(),s)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],s=t[t.length-1]),{min:n,max:s}}buildTicks(){const t=this.options,n=t.time,s=t.ticks,i=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,r=this.max,a=bc(i,o,r);return this._unit=n.unit||(s.autoSkip?Ji(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):ff(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:gf(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),eo(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t){let n=0,s=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;n=K(n,0,r),s=K(s,0,r),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,n=this.min,s=this.max,i=this.options,o=i.time,r=o.unit||Ji(o.minUnit,n,s,this._getLabelCapacity(n)),a=O(o.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Xt(l)||l===!0,h={};let d=n,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,n,r)>1e5*a)throw new Error(n+" and "+s+" are too far apart with stepSize of "+a+" "+r);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<s;u=+t.add(u,a,r),f++)to(h,u,g);return(u===s||i.bounds==="ticks"||f===1)&&to(h,u,g),Object.keys(h).sort((p,_)=>p-_).map(p=>+p)}getLabelForValue(t){const n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(t,s.tooltipFormat):n.format(t,s.displayFormats.datetime)}_tickFormatFunction(t,n,s,i){const o=this.options,r=o.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=s[n],u=l&&h&&d&&d.major,f=this._adapter.format(t,i||(u?h:c)),g=o.ticks.callback;return g?W(g,[f,n,s],this):f}generateTickLabels(t){let n,s,i;for(n=0,s=t.length;n<s;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+s)*n.factor)}getValueForPixel(t){const n=this._offsets,s=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,s=this.ctx.measureText(t).width,i=at(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),r=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const n=this.options.time,s=n.displayFormats,i=s[n.unit]||s.millisecond,o=this._tickFormatFunction(t,0,eo(this,[t],this._majorUnit),i),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||[],n,s;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,s=i.length;n<s;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,s;if(t.length)return t;const i=this.getLabels();for(n=0,s=i.length;n<s;++n)t.push(Qi(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return na(t.sort(uf))}}In.id="time";In.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function ln(e,t,n){let s=0,i=e.length-1,o,r,a,l;n?(t>=e[s].pos&&t<=e[i].pos&&({lo:s,hi:i}=It(e,"pos",t)),{pos:o,time:a}=e[s],{pos:r,time:l}=e[i]):(t>=e[s].time&&t<=e[i].time&&({lo:s,hi:i}=It(e,"time",t)),{time:o,pos:a}=e[s],{time:r,pos:l}=e[i]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Ya extends In{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ln(n,this.min),this._tableRange=ln(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:s}=this,i=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=n&&c<=s&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:s,pos:1}];for(r=0,a=i.length;r<a;++r)h=i[r+1],l=i[r-1],c=i[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),s=this.getLabelTimestamps();return n.length&&s.length?t=this.normalize(n.concat(s)):t=n.length?n:s,t=this._cache.all=t,t}getDecimalForValue(t){return(ln(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,s=this.getDecimalForPixel(t)/n.factor-n.end;return ln(this._table,s*this._tableRange+this._minPos,!0)}}Ya.id="timeseries";Ya.defaults=In.defaults;var mf={value:()=>{}};function Xa(){for(var e,t=0,n=arguments.length,s={};t<n;++t){if(!(e=arguments[t]+"")||e in s||/[\s.]/.test(e))throw new Error("illegal type: "+e);s[e]=[]}return new fn(s)}function fn(e){this._=e}function bf(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",i=n.indexOf(".");if(i>=0&&(s=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}function _f(e,t){for(var n,s=0,i=e.length;s<i;++s)if((n=e[s]).name===t)return n.value}function no(e,t,n){for(var s=0,i=e.length;s<i;++s)if(e[s].name===t){e[s]=mf,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}fn.prototype=Xa.prototype={constructor:fn,on:function(e,t){var n,s=this._,i=bf(e+"",s),o=-1,r=i.length;if(!(arguments.length<2)){if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<r;)if(n=(e=i[o]).type)s[n]=no(s[n],e.name,t);else if(t==null)for(n in s)s[n]=no(s[n],e.name,null);return this}for(;++o<r;)if((n=(e=i[o]).type)&&(n=_f(s[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new fn(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,s,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=0,n=(s=this._[e]).length;o<n;++o)s[o].value.apply(t,i)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],i=0,o=s.length;i<o;++i)s[i].value.apply(t,n)}};var gs="http://www.w3.org/1999/xhtml",so={svg:"http://www.w3.org/2000/svg",xhtml:gs,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ua(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),so.hasOwnProperty(t)?{space:so[t],local:e}:e}function xf(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===gs&&t.documentElement.namespaceURI===gs?t.createElement(e):t.createElementNS(n,e)}}function yf(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function io(e){var t=Ua(e);return(t.local?yf:xf)(t)}function vf(){}function oo(e){return e==null?vf:function(){return this.querySelector(e)}}function wf(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Sf(){return[]}function ro(e){return function(t){return t.matches(e)}}var kf=Array.prototype.find;function Mf(){return this.firstElementChild}var Cf=Array.prototype.filter;function Af(){return Array.from(this.children)}function ao(e){return new Array(e.length)}function Cn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Pf(e){return function(){return e}}function Of(e,t,n,s,i,o){for(var r,a=0,l=t.length,c=o.length;a<c;++a)(r=t[a])?(r.__data__=o[a],s[a]=r):n[a]=new Cn(e,o[a]);for(;a<l;++a)(r=t[a])&&(i[a]=r)}function Df(e,t,n,s,i,o,r){var a,l,c,h=new Map,d=t.length,u=o.length,f=new Array(d);for(a=0;a<d;++a)(l=t[a])&&(f[a]=c=r.call(l,l.__data__,a,t)+"",h.has(c)?i[a]=l:h.set(c,l));for(a=0;a<u;++a)c=r.call(e,o[a],a,o)+"",(l=h.get(c))?(s[a]=l,l.__data__=o[a],h.delete(c)):n[a]=new Cn(e,o[a]);for(a=0;a<d;++a)(l=t[a])&&h.get(f[a])===l&&(i[a]=l)}function Lf(e){return e.__data__}function Tf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Rf(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ef(e){return function(){this.removeAttribute(e)}}function If(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ff(e,t){return function(){this.setAttribute(e,t)}}function Bf(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function zf(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Nf(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ga(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function jf(e){return function(){this.style.removeProperty(e)}}function Vf(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Wf(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function Hf(e,t){return e.style.getPropertyValue(t)||Ga(e).getComputedStyle(e,null).getPropertyValue(t)}function $f(e){return function(){delete this[e]}}function Yf(e,t){return function(){this[e]=t}}function Xf(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function qa(e){return e.trim().split(/^|\s+/)}function Ws(e){return e.classList||new Ka(e)}function Ka(e){this._node=e,this._names=qa(e.getAttribute("class")||"")}function Za(e,t){for(var n=Ws(e),s=-1,i=t.length;++s<i;)n.add(t[s])}function Qa(e,t){for(var n=Ws(e),s=-1,i=t.length;++s<i;)n.remove(t[s])}function Uf(e){return function(){Za(this,e)}}function Gf(e){return function(){Qa(this,e)}}function qf(e,t){return function(){(t.apply(this,arguments)?Za:Qa)(this,e)}}function Kf(){this.textContent=""}function Zf(e){return function(){this.textContent=e}}function Qf(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Jf(){this.innerHTML=""}function tg(e){return function(){this.innerHTML=e}}function eg(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function ng(){this.nextSibling&&this.parentNode.appendChild(this)}function sg(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ig(){return null}function og(){var e=this.parentNode;e&&e.removeChild(this)}function rg(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ag(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function lg(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function cg(e){return function(){var t=this.__on;if(t){for(var n,s=0,i=-1,o=t.length;s<o;++s)n=t[s],e.type&&n.type!==e.type||n.name!==e.name?t[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?t.length=i:delete this.__on}}}function hg(e,t,n){return function(){var s,i=this.__on,o=function(l){return function(c){l.call(this,c,this.__data__)}}(t);if(i){for(var r=0,a=i.length;r<a;++r)if((s=i[r]).type===e.type&&s.name===e.name)return this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),void(s.value=t)}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},i?i.push(s):this.__on=[s]}}function Ja(e,t,n){var s=Ga(e),i=s.CustomEvent;typeof i=="function"?i=new i(t,n):(i=s.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function dg(e,t){return function(){return Ja(this,e,t)}}function ug(e,t){return function(){return Ja(this,e,t.apply(this,arguments))}}Cn.prototype={constructor:Cn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},Ka.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var fg=[null];function nt(e,t){this._groups=e,this._parents=t}function oe(e){return typeof e=="string"?new nt([[document.querySelector(e)]],[document.documentElement]):new nt([[e]],fg)}function lo(e,t){if(e=function(o){let r;for(;r=o.sourceEvent;)o=r;return o}(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,[(s=s.matrixTransform(t.getScreenCTM().inverse())).x,s.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}nt.prototype={constructor:nt,select:function(e){typeof e!="function"&&(e=oo(e));for(var t=this._groups,n=t.length,s=new Array(n),i=0;i<n;++i)for(var o,r,a=t[i],l=a.length,c=s[i]=new Array(l),h=0;h<l;++h)(o=a[h])&&(r=e.call(o,o.__data__,h,a))&&("__data__"in o&&(r.__data__=o.__data__),c[h]=r);return new nt(s,this._parents)},selectAll:function(e){e=typeof e=="function"?function(h){return function(){return wf(h.apply(this,arguments))}}(e):function(h){return h==null?Sf:function(){return this.querySelectorAll(h)}}(e);for(var t=this._groups,n=t.length,s=[],i=[],o=0;o<n;++o)for(var r,a=t[o],l=a.length,c=0;c<l;++c)(r=a[c])&&(s.push(e.call(r,r.__data__,c,a)),i.push(r));return new nt(s,i)},selectChild:function(e){return this.select(e==null?Mf:function(t){return function(){return kf.call(this.children,t)}}(typeof e=="function"?e:ro(e)))},selectChildren:function(e){return this.selectAll(e==null?Af:function(t){return function(){return Cf.call(this.children,t)}}(typeof e=="function"?e:ro(e)))},filter:function(e){typeof e!="function"&&(e=function(h){return function(){return this.matches(h)}}(e));for(var t=this._groups,n=t.length,s=new Array(n),i=0;i<n;++i)for(var o,r=t[i],a=r.length,l=s[i]=[],c=0;c<a;++c)(o=r[c])&&e.call(o,o.__data__,c,r)&&l.push(o);return new nt(s,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,Lf);var n=t?Df:Of,s=this._parents,i=this._groups;typeof e!="function"&&(e=Pf(e));for(var o=i.length,r=new Array(o),a=new Array(o),l=new Array(o),c=0;c<o;++c){var h=s[c],d=i[c],u=d.length,f=Tf(e.call(h,h&&h.__data__,c,s)),g=f.length,p=a[c]=new Array(g),_=r[c]=new Array(g),b=l[c]=new Array(u);n(h,d,p,_,b,f,t);for(var v,y,m=0,x=0;m<g;++m)if(v=p[m]){for(m>=x&&(x=m+1);!(y=_[x])&&++x<g;);v._next=y||null}}return(r=new nt(r,s))._enter=a,r._exit=l,r},enter:function(){return new nt(this._enter||this._groups.map(ao),this._parents)},exit:function(){return new nt(this._exit||this._groups.map(ao),this._parents)},join:function(e,t,n){var s=this.enter(),i=this,o=this.exit();return typeof e=="function"?(s=e(s))&&(s=s.selection()):s=s.append(e+""),t!=null&&(i=t(i))&&(i=i.selection()),n==null?o.remove():n(o),s&&i?s.merge(i).order():i},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,i=n.length,o=s.length,r=Math.min(i,o),a=new Array(i),l=0;l<r;++l)for(var c,h=n[l],d=s[l],u=h.length,f=a[l]=new Array(u),g=0;g<u;++g)(c=h[g]||d[g])&&(f[g]=c);for(;l<i;++l)a[l]=n[l];return new nt(a,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s,i=e[t],o=i.length-1,r=i[o];--o>=0;)(s=i[o])&&(r&&4^s.compareDocumentPosition(r)&&r.parentNode.insertBefore(s,r),r=s);return this},sort:function(e){function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}e||(e=Rf);for(var n=this._groups,s=n.length,i=new Array(s),o=0;o<s;++o){for(var r,a=n[o],l=a.length,c=i[o]=new Array(l),h=0;h<l;++h)(r=a[h])&&(c[h]=r);c.sort(t)}return new nt(i,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],i=0,o=s.length;i<o;++i){var r=s[i];if(r)return r}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var i,o=t[n],r=0,a=o.length;r<a;++r)(i=o[r])&&e.call(i,i.__data__,r,o);return this},attr:function(e,t){var n=Ua(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?If:Ef:typeof t=="function"?n.local?Nf:zf:n.local?Bf:Ff)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((t==null?jf:typeof t=="function"?Wf:Vf)(e,t,n??"")):Hf(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((t==null?$f:typeof t=="function"?Xf:Yf)(e,t)):this.node()[e]},classed:function(e,t){var n=qa(e+"");if(arguments.length<2){for(var s=Ws(this.node()),i=-1,o=n.length;++i<o;)if(!s.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?qf:t?Uf:Gf)(n,t))},text:function(e){return arguments.length?this.each(e==null?Kf:(typeof e=="function"?Qf:Zf)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(e==null?Jf:(typeof e=="function"?eg:tg)(e)):this.node().innerHTML},raise:function(){return this.each(ng)},lower:function(){return this.each(sg)},append:function(e){var t=typeof e=="function"?e:io(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n=typeof e=="function"?e:io(e),s=t==null?ig:typeof t=="function"?t:oo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})},remove:function(){return this.each(og)},clone:function(e){return this.select(e?ag:rg)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var s,i,o=lg(e+""),r=o.length;if(!(arguments.length<2)){for(a=t?hg:cg,s=0;s<r;++s)this.each(a(o[s],t,n));return this}var a=this.node().__on;if(a){for(var l,c=0,h=a.length;c<h;++c)for(s=0,l=a[c];s<r;++s)if((i=o[s]).type===l.type&&i.name===l.name)return l.value}},dispatch:function(e,t){return this.each((typeof t=="function"?ug:dg)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s,i=e[t],o=0,r=i.length;o<r;++o)(s=i[o])&&(yield s)}};const gg={passive:!1},ne={capture:!0,passive:!1};function Jn(e){e.stopImmediatePropagation()}function Wt(e){e.preventDefault(),e.stopImmediatePropagation()}var cn=e=>()=>e;function ps(e,{sourceEvent:t,subject:n,target:s,identifier:i,active:o,x:r,y:a,dx:l,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}function pg(e){return!e.ctrlKey&&!e.button}function mg(){return this.parentNode}function bg(e,t){return t??{x:e.x,y:e.y}}function _g(){return navigator.maxTouchPoints||"ontouchstart"in this}function xg(){var e,t,n,s,i=pg,o=mg,r=bg,a=_g,l={},c=Xa("start","drag","end"),h=0,d=0;function u(m){m.on("mousedown.drag",f).filter(a).on("touchstart.drag",_).on("touchmove.drag",b,gg).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(m,x){if(!s&&i.call(this,m,x)){var w=y(this,o.call(this,m,x),m,x,"mouse");w&&(oe(m.view).on("mousemove.drag",g,ne).on("mouseup.drag",p,ne),function(S){var k=S.document.documentElement,M=oe(S).on("dragstart.drag",Wt,ne);"onselectstart"in k?M.on("selectstart.drag",Wt,ne):(k.__noselect=k.style.MozUserSelect,k.style.MozUserSelect="none")}(m.view),Jn(m),n=!1,e=m.clientX,t=m.clientY,w("start",m))}}function g(m){if(Wt(m),!n){var x=m.clientX-e,w=m.clientY-t;n=x*x+w*w>d}l.mouse("drag",m)}function p(m){oe(m.view).on("mousemove.drag mouseup.drag",null),function(x,w){var S=x.document.documentElement,k=oe(x).on("dragstart.drag",null);w&&(k.on("click.drag",Wt,ne),setTimeout(function(){k.on("click.drag",null)},0)),"onselectstart"in S?k.on("selectstart.drag",null):(S.style.MozUserSelect=S.__noselect,delete S.__noselect)}(m.view,n),Wt(m),l.mouse("end",m)}function _(m,x){if(i.call(this,m,x)){var w,S,k=m.changedTouches,M=o.call(this,m,x),A=k.length;for(w=0;w<A;++w)(S=y(this,M,m,x,k[w].identifier,k[w]))&&(Jn(m),S("start",m,k[w]))}}function b(m){var x,w,S=m.changedTouches,k=S.length;for(x=0;x<k;++x)(w=l[S[x].identifier])&&(Wt(m),w("drag",m,S[x]))}function v(m){var x,w,S=m.changedTouches,k=S.length;for(s&&clearTimeout(s),s=setTimeout(function(){s=null},500),x=0;x<k;++x)(w=l[S[x].identifier])&&(Jn(m),w("end",m,S[x]))}function y(m,x,w,S,k,M){var A,L,E,G=c.copy(),B=lo(M||w,x);if((E=r.call(m,new ps("beforestart",{sourceEvent:w,target:u,identifier:k,active:h,x:B[0],y:B[1],dx:0,dy:0,dispatch:G}),S))!=null)return A=E.x-B[0]||0,L=E.y-B[1]||0,function C(F,j,ft){var Pt,gt=B;switch(F){case"start":l[k]=C,Pt=h++;break;case"end":delete l[k],--h;case"drag":B=lo(ft||j,x),Pt=h}G.call(F,m,new ps(F,{sourceEvent:j,subject:E,target:u,identifier:k,active:Pt,x:B[0]+A,y:B[1]+L,dx:B[0]-gt[0],dy:B[1]-gt[1],dispatch:G}),S)}}return u.filter=function(m){return arguments.length?(i=typeof m=="function"?m:cn(!!m),u):i},u.container=function(m){return arguments.length?(o=typeof m=="function"?m:cn(m),u):o},u.subject=function(m){return arguments.length?(r=typeof m=="function"?m:cn(m),u):r},u.touchable=function(m){return arguments.length?(a=typeof m=="function"?m:cn(!!m),u):a},u.on=function(){var m=c.on.apply(c,arguments);return m===c?u:m},u.clickDistance=function(m){return arguments.length?(d=(m=+m)*m,u):Math.sqrt(d)},u}let Z,_t,ht,vt,An,tl,el,nl,Ht,Et,co;ps.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let ms=!1;function Pn(e,t){return isNaN(t)?e:Math.round(e*Math.pow(10,t))/Math.pow(10,t)}function bs(e,t,n,s,i){let o,r;const a=t.data.datasets[n].data[s];if(e.touches?(o=t.scales[ht].getValueForPixel(e.touches[0].clientX-t.canvas.getBoundingClientRect().left),r=t.scales[_t].getValueForPixel(e.touches[0].clientY-t.canvas.getBoundingClientRect().top)):(o=t.scales[ht].getValueForPixel(e.clientX-t.canvas.getBoundingClientRect().left),r=t.scales[_t].getValueForPixel(e.clientY-t.canvas.getBoundingClientRect().top)),o=Pn(o,t.config.options.plugins.dragData.round),r=Pn(r,t.config.options.plugins.dragData.round),o=o>t.scales[ht].max?t.scales[ht].max:o,o=o<t.scales[ht].min?t.scales[ht].min:o,r=r>t.scales[_t].max?t.scales[_t].max:r,r=r<t.scales[_t].min?t.scales[_t].min:r,el){let l;return l=t.config.options.indexAxis==="y"?o:r,Math.abs(l-a[0])<=Math.abs(l-a[1])?[l,a[1]]:[a[0],l]}return a.x!==void 0&&t.config.options.plugins.dragData.dragX&&(a.x=o),a.y!==void 0?(t.config.options.plugins.dragData.dragY!==!1&&(a.y=r),a):t.config.options.indexAxis==="y"?o:r}const yg=(e,t,n,s)=>{if(Z){Ht=Z.datasetIndex,Et=Z.index,ms=!0;let i=t.data.datasets[Ht].data[Et];An==="radar"||An==="polarArea"?i=function(o,r){let a,l,c;o.touches?(a=o.touches[0].clientX-r.canvas.getBoundingClientRect().left,l=o.touches[0].clientY-r.canvas.getBoundingClientRect().top):(a=o.clientX-r.canvas.getBoundingClientRect().left,l=o.clientY-r.canvas.getBoundingClientRect().top);let h=r.scales[vt],d=Math.sqrt(Math.pow(a-h.xCenter,2)+Math.pow(l-h.yCenter,2)),u=h.drawingArea/(h.max-h.min);return c=h.options.ticks.reverse?h.max-d/u:h.min+d/u,c=Pn(c,r.config.options.plugins.dragData.round),c=c>r.scales[vt].max?r.scales[vt].max:c,c=c<r.scales[vt].min?r.scales[vt].min:c,c}(e,t):tl?i=Pn(bs(e,t,Ht,Et)-nl,n.round):i=bs(e,t,Ht,Et),(!s||typeof s=="function"&&s(e,Ht,Et,i)!==!1)&&(t.data.datasets[Ht].data[Et]=i,t.update("none"))}},sl={id:"dragdata",afterInit:function(e){if(e.config.options.plugins&&e.config.options.plugins.dragData){const t=e.config.options.plugins.dragData;oe(e.canvas).call(xg().container(e.canvas).on("start",n=>((s,i,o)=>{if(Z=i.getElementsAtEventForMode(s,"nearest",{intersect:!0},!1)[0],An=i.config.type,Z){let r=Z.datasetIndex,a=Z.index;co=function(d){try{return d()}catch{return""}}(()=>i.config.options.plugins.tooltip.animation);const l=i.data.datasets[r],c=i.getDatasetMeta(r);let h=l.data[a];if(ht=c.xAxisID,_t=c.yAxisID,vt=c.rAxisID,l.dragData===!1||i.config.options.scales[ht]&&i.config.options.scales[ht].dragData===!1||i.config.options.scales[_t]&&i.config.options.scales[_t].dragData===!1||i.config.options.scales[vt]&&i.config.options.scales[vt].rAxisID===!1||l.data[Z.index].dragData===!1)return void(Z=null);if(An==="bar"){tl=i.config.options.scales[ht].stacked;const d=i.data.datasets[0].data[0];el=d!==null&&Array.isArray(d)&&d.length==2,nl=bs(s,i,r,a)-h}(i.config.options.plugins.dragData.showTooltip===void 0||i.config.options.plugins.dragData.showTooltip)&&(i.config.options.plugins.tooltip||(i.config.options.plugins.tooltip={}),i.config.options.plugins.tooltip.animation=!1),typeof o=="function"&&Z&&o(s,r,a,h)===!1&&(Z=null)}})(n.sourceEvent,e,t.onDragStart)).on("drag",n=>yg(n.sourceEvent,e,t,t.onDrag)).on("end",n=>((s,i,o)=>{if(Et=void 0,ms=!1,i.config.options.plugins.tooltip&&(i.config.options.plugins.tooltip.animation=co,i.update("none")),typeof o=="function"&&Z){const r=Z.datasetIndex,a=Z.index;let l=function(c,h,d){const u=c.config.options.plugins.dragData;if(!u.magnet)return c.data.datasets[h].data[d];{const f=u.magnet;if(f.to&&typeof f.to=="function"){let g=c.data.datasets[h].data[d];return g=f.to(g),c.data.datasets[h].data[d]=g,c.update("none"),g}}}(i,r,a);return o(s,r,a,l)}})(n.sourceEvent,e,t.onDragEnd)))}},beforeEvent:function(e){if(ms)return e.tooltip&&e.tooltip.update(),!1}};zs.register(sl);const il=(e,t)=>{var h;const{options:n}=t??{},{interactions:s}=n??{},[i,o]=es.useState(!1),a=(({datasets:d,options:u})=>{const{annotations:{controlAnnotation:f,showAnnotations:g,annotationsData:p}={}}=u,_=f&&g&&(p!=null&&p.length)?p.map((y,m)=>({isAnnotation:!0,label:y==null?void 0:y.label,annotationIndex:m,backgroundColor:(y==null?void 0:y.color)||$t[m],borderColor:(y==null?void 0:y.color)||$t[m],data:[],type:ll.Bar})):[],b=[...d,..._];return(b==null?void 0:b.map((y,m)=>{var M;const x=$t,w=(M=y==null?void 0:y.data)==null?void 0:M.map(A=>{const L=(d==null?void 0:d.length)>1?m:0;return(x==null?void 0:x[L])||qr($t)}),S=(y==null?void 0:y.backgroundColor)||(w==null?void 0:w.map(A=>A+cl)),k="borderWidth"in b?{borderWidth:parseFloat(String(b==null?void 0:b.borderWidth))??1}:{};return{...y,...k,borderColor:(y==null?void 0:y.borderColor)||(w==null?void 0:w[m]),backgroundColor:S}}))||[]})({datasets:(h=t==null?void 0:t.data)==null?void 0:h.datasets,options:n}),l=(d,u,f)=>{f.resetZoom()},c=(d,u)=>{if(i&&!(u!=null&&u.length)&&(o(!1),s!=null&&s.onUnhover&&(s==null||s.onUnhover(d))),!i&&(u!=null&&u.length)&&(o(!0),s.onHover)){const{index:f,datasetIndex:g}=(u==null?void 0:u[0])??{},p=a;s==null||s.onHover(d,g,f,p)}};return es.useMemo(()=>({generatedDatasets:a,onClick:l,onHover:c}),[e,t])},vg=(e,{stacked:t,stackedX:n,stackedY:s})=>e===q.X?n??t:e===q.Y?s??t:t,_s=({chart:e,axisType:t=q.X,currentScale:n,i:s})=>{var f,g,p,_,b,v,y,m,x;const{data:i,options:o}=e??{},r=ys(o.direction),a=n||((g=(f=o==null?void 0:o.axes)==null?void 0:f[t])==null?void 0:g[0]),l=r&&t===q.Y||!r&&t===q.X,c=(a==null?void 0:a.gridLines)||{},h=()=>{var k;const w=i.labels?Ge.Category:Ge.Linear,S=r?q.X:q.Y;return t===S?w:(k=o==null?void 0:o.additionalAxesOptions)==null?void 0:k.chartScaleType},d=()=>{var S;const w=r?q.Y:q.X;return t===w?(S=o==null?void 0:o.additionalAxesOptions)==null?void 0:S.reverse:!1},u=()=>{var E,G;const w=o==null?void 0:o.additionalAxesOptions,S=(G=(E=o==null?void 0:o.scales)==null?void 0:E[`${s===0?t:t+s}`])==null?void 0:G.ticks,k=l&&(w==null?void 0:w.chartScaleType)===Ge.Logarithmic,M=(B,C,F)=>k?ul.includes(Number(B))?Gs(B,F):"":Gs(B,F),L={...k?{}:{stepSize:a.stepSize??(t===q.Y?w==null?void 0:w.stepSize:null)},includeBounds:!1,...S,font:{size:dl}};return(w==null?void 0:w.chartScaleType)===Ge.Logarithmic&&(L.callback=M),L};return{type:h(),position:a==null?void 0:a.position,beginAtZero:(p=o==null?void 0:o.additionalAxesOptions)==null?void 0:p.beginAtZero,reverse:d(),suggestedMax:(_=o==null?void 0:o.additionalAxesOptions)==null?void 0:_.suggestedMax,suggestedMin:(b=o==null?void 0:o.additionalAxesOptions)==null?void 0:b.suggestedMin,min:l?(v=o==null?void 0:o.additionalAxesOptions)==null?void 0:v.min:void 0,max:l?(y=o==null?void 0:o.additionalAxesOptions)==null?void 0:y.max:void 0,title:{display:((m=a==null?void 0:a.label)==null?void 0:m.length)||((x=a==null?void 0:a.unit)==null?void 0:x.length),text:(a==null?void 0:a.label)||(a==null?void 0:a.unit),padding:0},ticks:u(),grid:{...c},stacked:vg(t,o==null?void 0:o.additionalAxesOptions)}},ho=(e,t)=>{var i,o;return(((o=(i=e==null?void 0:e.options)==null?void 0:i.axes)==null?void 0:o[t])||[]).reduce((r,a,l)=>{const c=a,h=a.color||$t[l]||qr($t);c.color=h,c.position=a.position||hl(t,l);const d=_s({chart:e,axisType:t,currentScale:c}),u=l===0?t:`${t}${l+1}`;return{...r,[u]:d}},{})},wg=e=>{var o,r;const t=((o=e.options.axes.x)==null?void 0:o.length)>1,n=((r=e.options.axes.y)==null?void 0:r.length)>1,s=t?ho(e,q.X):{x:_s({chart:e,axisType:q.X})},i=n?ho(e,q.Y):{y:_s({chart:e,axisType:q.Y})};return{...s,...i}},Sg=e=>{var r;const{beginAtZero:t,reverse:n}=(e==null?void 0:e.additionalAxesOptions)||{},s=(a,l)=>{const{datasetIndex:c,dataIndex:h}=l,u=l.chart.data.datasets[c].data[h];let f="";if(typeof u=="number"&&(f=Number.isInteger(u)?u:u.toFixed(2)),Array.isArray(u))if(u.length===2){const g=u[1]-u[0];f=g<0?Ys(g,2):`+${Ys(g,2)}`}else f=u.reduce((g,p,_)=>_===0?`${g} ${p}`:`${g}, ${p}`,"");return f},i=n?Lt.End:Lt.Start,o=n?Lt.Start:Lt.End;return(r=e==null?void 0:e.graph)!=null&&r.showDataLabels?{display:ns,align:t?Lt.Center:i,anchor:t?Lt.Center:o,formatter:s}:{display:!1}},kg=e=>{var o;const t=r=>{var p,_;const a=ys(e.direction),l=Array.isArray((p=e.axes)==null?void 0:p.x)?e.axes.x:[],c=Array.isArray((_=e.axes)==null?void 0:_.y)?e.axes.y:[],h=b=>{if(!b)return 0;const v=b.match(/\d+$/);return v?parseInt(v[0],10)-1:0},d=h(r==null?void 0:r.xAxisID),u=h(r==null?void 0:r.yAxisID),f=a?l[d]:c[u],g=a?c[u]:l[d];return{titleAxisLabel:(f==null?void 0:f.label)||"",valueAxisLabel:(g==null?void 0:g.label)||"",titleLabel:Us.X,valueLabel:Us.Y,titleUnit:(f==null?void 0:f.unit)||"",valueUnit:(g==null?void 0:g.unit)||""}},n=(r,a)=>{var f,g;const l=((f=r==null?void 0:r[0])==null?void 0:f.label)||"",c=t((g=r==null?void 0:r[0])==null?void 0:g.dataset),{titleAxisLabel:h,titleUnit:d}=c;return(!h&&!d?"":`${h||d}: `)+l},s=r=>{var l;let a={};return(l=e==null?void 0:e.tooltip)!=null&&l.scientificNotation?(Math.abs(r)<ec||Math.abs(r)>nc)&&(a={roundScientificCoefficient:3}):a={scientific:!1},bl(_l(r),a)},i=r=>{var v;const{showLabelsInTooltips:a=!1}=(e==null?void 0:e.tooltip)||{};let l=((v=r.dataset)==null?void 0:v.label)||"";const c=t(r.dataset),{valueUnit:h,valueAxisLabel:d}=c,u=()=>{const y=r==null?void 0:r.raw,m=typeof y=="number"?s(y):"";let x="";return typeof r.raw=="number"&&(x=m),Array.isArray(r.raw)?x=r.raw.reduce((w,S,k)=>k===0?`${w} ${S}`:`${w}, ${S}`,""):typeof r.raw=="object"&&(x=m),x},f=l===d||d.includes(l),g=u(),p=h?`[${h}] `:"",_=f?"":d,b=ml(r,a);return`${l}: ${g} ${p}${_}${b}`};return{enabled:(o=e==null?void 0:e.tooltip)==null?void 0:o.tooltips,mode:Kr.Nearest,intersect:!0,padding:pl,boxWidth:Xs,boxHeight:Xs,boxPadding:gl,callbacks:{title:n,label:i,afterLabel:fl}}},Mg=({chart:e,chartRef:t})=>{const{options:n}=e,{chartStyling:s,dragData:i}=n,{state:o}=Vl(),{annotation:r}=o,{onClick:a,onHover:l}=il(t,e),{legend:c,customLegendPlugin:h}=Wl({chartRef:t,options:n});return{onClick:a,onHover:l,indexAxis:ys(n.direction)?q.X:q.Y,maintainAspectRatio:s.maintainAspectRatio,animation:s.performanceMode&&{duration:vl.FAST},hover:{mode:Kr.Nearest,intersect:!0},scales:wg(e),plugins:{title:yl(n),datalabels:Sg(n),annotation:Hl(r),tooltip:kg(n),legend:{...c,display:!1,events:[]},customLegendPlugin:h,chartAreaBorder:{borderColor:xl},dragData:(i==null?void 0:i.enableDragData)&&Zl(n)}}},Cg="_chart_x1sru_1",Ag="_canvas_x1sru_10",Pg="_fixedHeight_x1sru_19",Og="_stretchHeight_x1sru_25",Dg="_actions_x1sru_57",ts={chart:Cg,canvas:Ag,fixedHeight:Pg,stretchHeight:Og,actions:Dg},Lg=e=>({x:(e==null?void 0:e.x)||[{}],y:(e==null?void 0:e.y)||[{}]}),Tg=e=>({chartScaleType:(e==null?void 0:e.chartScaleType)||"linear",reverse:(e==null?void 0:e.reverse)||!1,stacked:(e==null?void 0:e.stacked)||!1,beginAtZero:(e==null?void 0:e.beginAtZero)??!0,stepSize:e==null?void 0:e.stepSize,suggestedMin:e==null?void 0:e.suggestedMin,suggestedMax:e==null?void 0:e.suggestedMax,min:e==null?void 0:e.min,max:e==null?void 0:e.max,stackedX:e==null?void 0:e.stackedX,stackedY:e==null?void 0:e.stackedY}),Rg=e=>({width:e==null?void 0:e.width,height:e==null?void 0:e.height,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)||!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)||!1,performanceMode:(e==null?void 0:e.performanceMode)??!0}),Eg=e=>({tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)||!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),Ig=e=>({showDataLabels:(e==null?void 0:e.showDataLabels)||!1,showMinorGridlines:(e==null?void 0:e.showMinorGridlines)||!1}),Fg=e=>e?e.map(t=>({...t,display:(t==null?void 0:t.display)??!0})):[],Bg=e=>({showAnnotations:(e==null?void 0:e.showAnnotations)??!0,controlAnnotation:(e==null?void 0:e.controlAnnotation)||!1,annotationsData:Fg(e==null?void 0:e.annotationsData)}),zg=e=>({display:(e==null?void 0:e.display)??!0,position:(e==null?void 0:e.position)||wl.TopLeft,align:(e==null?void 0:e.align)||Lt.Center,customLegend:(e==null?void 0:e.customLegend)||{customLegendPlugin:null,customLegendContainerID:""}}),Ng=e=>({enableZoom:(e==null?void 0:e.enableZoom)||!1,enablePan:(e==null?void 0:e.enablePan)||!1}),jg=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover}),Vg=e=>({enableDragData:(e==null?void 0:e.enableDragData)??!1,showTooltip:(e==null?void 0:e.showTooltip)??!0,roundPoints:(e==null?void 0:e.roundPoints)??!0,dragX:(e==null?void 0:e.dragX)??!0,dragY:(e==null?void 0:e.dragY)??!0,onDragStart:e==null?void 0:e.onDragStart,onDrag:e==null?void 0:e.onDrag,onDragEnd:e==null?void 0:e.onDragEnd}),ol=e=>{const t=(e==null?void 0:e.chart)||{},n=(t==null?void 0:t.options)||{};return{testId:(t==null?void 0:t.testId)??"",controlsPortalId:(t==null?void 0:t.controlsPortalId)??"",data:t==null?void 0:t.data,options:{title:(n==null?void 0:n.title)||"",direction:(n==null?void 0:n.direction)||"vertical",axes:Lg(n==null?void 0:n.axes),additionalAxesOptions:Tg(n==null?void 0:n.additionalAxesOptions),chartStyling:Rg(n==null?void 0:n.chartStyling),tooltip:Eg(n==null?void 0:n.tooltip),graph:Ig(n==null?void 0:n.graph),annotations:Bg(n==null?void 0:n.annotations),legend:zg(n==null?void 0:n.legend),chartOptions:Ng(n==null?void 0:n.chartOptions),interactions:jg(n==null?void 0:n.interactions),dragData:Vg(n==null?void 0:n.dragData)}}};Pl.register(Ol,Dl,Ll,Tl,Rl,El,Il,Fl,Bl,zl,Nl,jl,Kl,sl);const Wg=e=>{var f,g,p,_;kl();const t=es.useRef(null),n=ol(e),{translations:s,languageKey:i}=Ql(),{options:o,testId:r,controlsPortalId:a}=n,{chartStyling:l,graph:c}=o,{generatedDatasets:h}=il(t,n),d=Mg({chart:n,chartRef:t}),u=!((g=(f=o==null?void 0:o.legend)==null?void 0:f.customLegend)!=null&&g.customLegendContainerID);return Y.jsxs("div",{className:Ml(l,ts),style:{width:l.width||ns,height:l.height||ns},"data-testid":r,children:[Y.jsx(Jl,{controlsPortalId:a,children:Y.jsx("div",{className:ts.actions,children:Y.jsx($l,{text:s.downloadAsPNG,placement:"bottom-end",children:Y.jsx(Yl,{small:!0,basic:!0,colored:"muted",round:!0,icon:"download",onClick:()=>tc(t)})})})}),Y.jsx(Xl,{backend:Ul,context:window,children:Y.jsxs("div",{className:ts.canvas,id:"canvas",children:[Y.jsx(Cl,{ref:t,data:{labels:(_=(p=n==null?void 0:n.data)==null?void 0:p.labels)!=null&&_.length?n.data.labels:[""],datasets:h},options:d,plugins:Al(c,o.legend)}),u&&!!h.length&&Y.jsx(Gl,{chartRef:t,legendConfig:{options:o,generatedDatasets:h,chartType:ql.BAR}})]})})]},i)},Xe=e=>{const{options:t}=ol(e);return Y.jsx(Sl,{options:t,children:Y.jsx(Wg,{...e})})};Xe.__docgenInfo={description:"",methods:[],displayName:"BarChartWithLegend",props:{chart:{required:!0,tsType:{name:"IBarChartData"},description:""}}};const N=["United Kingdom","Norway","France"],X={label:"Cats",data:[3.12,8,7]},Hs={label:"Dogs",data:[1,2,3]},rl={label:"Parrots",data:[5,0,4]},Hg={label:"Cats",data:[3,8,7],yAxisID:"y"},$g={label:"Dogs",data:[1,2,3],yAxisID:"y2"},Yg={label:"Parrots",data:[5,0,4],yAxisID:"y2"},Xg={label:"Cats",data:[3,8,7],stack:1},Ug={label:"Dogs",data:[1,2,3],stack:1},Gg={label:"Parrots",data:[5,0,4],stack:2},uo={label:"Cats",data:[1e3,2e3,3e3],stack:1},qg={label:"Dogs",data:[4e3,5e3,6e3],stack:1},Fn={label:"Cats",data:[42,57,64]},Kg={label:"Cats",data:[210,333,248]},Zg={label:"Income",data:[100,[100,120],[120,130],[130,80],80],backgroundColor:["lightGray","lightGreen","lightGreen","pink","lightGray"]},$s={data:{labels:N,datasets:[X]}},Qg={data:{labels:N,datasets:[{...X,label:"Men",backgroundColor:"lightblue"},{...Hs,label:"Women",backgroundColor:"pink"}]}},Jg={data:{labels:N,datasets:[{...X,backgroundColor:["gray","red","gray"]}]}},tp={data:{labels:N,datasets:[X,Hs,rl]}},ep={data:{labels:N,datasets:[X,Hs,rl]},options:{title:"Stacked",additionalAxesOptions:{stacked:!0}}},np={data:{labels:N,datasets:[Hg,$g,Yg]},options:{title:"Multiple y axes",axes:{y:[{},{gridLines:{drawOnChartArea:!1}}]}}},sp={data:{labels:N,datasets:[Xg,Ug,Gg]},options:{title:"Grouped stacked",additionalAxesOptions:{stacked:!0}}},ip={data:{labels:N,datasets:[X]},options:{title:"reversed vertical",additionalAxesOptions:{reverse:!0}}},op={data:{labels:N,datasets:[X]},options:{title:"horizontal",direction:"horizontal"}},rp={data:{labels:N,datasets:[X]},options:{title:"reversed horizontal",direction:"horizontal",additionalAxesOptions:{reverse:!0}}},ap={data:{labels:N,datasets:[X]},options:{title:"With axes labels",axes:{x:[{label:"Country"}],y:[{label:"Number of pets"}]}}},lp={data:{labels:N,datasets:[X]},options:{title:["x axis on top","y axis on right"],axes:{x:[{position:"top"}],y:[{position:"right"}]}}},cp={data:{labels:N,datasets:[X]},options:{title:"Not beginning at zero",additionalAxesOptions:{beginAtZero:!1}}},hp={data:{labels:N,datasets:[X]},options:{title:"With step size of 2",additionalAxesOptions:{stepSize:2}}},dp={data:{labels:N,datasets:[X]},options:{title:"With suggested range",additionalAxesOptions:{beginAtZero:!1,suggestedMin:2,suggestedMax:12}}},up={data:{labels:N,datasets:[X]},options:{title:"With logarithmic scale",additionalAxesOptions:{chartScaleType:"logarithmic"}}},fp={data:{labels:N,datasets:[Kg]},options:{title:"With value as datalabels",graph:{showDataLabels:!0}}},gp={data:{labels:N,datasets:[{...X,backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"black",borderWidth:1}]}},pp={data:{labels:N,datasets:[Fn]},options:{title:"Annotation Y Axis",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"y",label:"Horizontal Annotation",value:53,color:"rgba(96, 32, 196, 0.5)"}]}}},mp={data:{labels:N,datasets:[Fn]},options:{title:"Annotation X Axis",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"x",label:"Vertical Annotation",value:.5,color:"green"}]}}},bp={data:{labels:N,datasets:[Fn]},options:{title:"Diagonal Annotation",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"y",label:"Diagonal Annotation",value:40,endValue:67,color:"rgba(123, 16, 32, 0.8)"}]}}},_p={data:{labels:N,datasets:[Fn]},options:{title:"Control annotations in legend",annotations:{showAnnotations:!0,controlAnnotation:!0,annotationsData:[{annotationAxis:"y",label:"Diagonal Annotation",value:40,endValue:67,color:"rgba(123, 16, 32, 0.8)"},{annotationAxis:"y",label:"Horizontal Annotation",value:53,color:"rgba(96, 32, 196, 0.5)"}]}}},xp={data:{labels:N,datasets:[X]},options:{title:"Legend to the right",legend:{position:"right"}}},yp={data:{labels:N,datasets:[X]},options:{chartStyling:{performanceMode:!1}}},vp={data:{labels:N,datasets:[X]},options:{dragData:{enableDragData:!0,showTooltip:!0,roundPoints:!0,onDragStart:(e,t)=>{},onDrag:(e,t,n,s)=>{},onDragEnd:(e,t,n,s)=>{}}}},wp={data:{labels:N,datasets:[uo,uo,qg]}},Sp={data:{labels:["Week 1","Week 2","Week 3","Week 4","Week 5","Week 6"],datasets:[{label:"Budget Sales",data:[200,1e3,800,700,900,1600],backgroundColor:"rgba(128, 128, 128, 0.5)",borderColor:"rgba(128, 128, 128, 1)",barThickness:40},{label:"Actual Sales",data:[300,600,400,500,700,1200],backgroundColor:"rgba(64, 64, 64, 0.5)",borderColor:"rgba(64, 64, 64, 1)",barThickness:60},{label:"Units",data:[20,40,30,50,70,90],type:"line",backgroundColor:"rgba(255, 165, 0, 0.5)",borderColor:"rgba(255, 165, 0, 1)",yAxisID:"y-axis-units"}]},options:{title:"Specific axis stacked",additionalAxesOptions:{stackedX:!0,stackedY:!1}}},kp={data:{labels:["original","change 1","change 2","change 3","result"],datasets:[Zg]},options:{title:"Waterfall chart",graph:{showDataLabels:!0}}},Bp={title:"BarChart",component:Xe,args:{chart:$s}},I=e=>Y.jsx(Xe,{...e}),xs="custom-legend-container",Mp=e=>Y.jsxs(Y.Fragment,{children:[Y.jsx(Xe,{...e}),Y.jsx("div",{id:xs})]}),hn=I.bind({}),re=I.bind({});re.args={chart:Qg};const ae=I.bind({});ae.args={chart:Jg};const le=I.bind({});le.args={chart:tp};const ce=I.bind({});ce.args={chart:ep};const he=I.bind({});he.args={chart:sp};const de=I.bind({});de.args={chart:np};const ue=I.bind({});ue.args={chart:op};const fe=I.bind({});fe.args={chart:ip};const ge=I.bind({});ge.args={chart:rp};const pe=I.bind({});pe.args={chart:ap};const me=I.bind({});me.args={chart:lp};const be=I.bind({});be.args={chart:cp};const _e=I.bind({});_e.args={chart:dp};const xe=I.bind({});xe.args={chart:hp};const ye=I.bind({});ye.args={chart:up};const ve=I.bind({});ve.args={chart:fp};const we=I.bind({});we.args={chart:xp};const Se=I.bind({});Se.args={chart:gp};const ke=I.bind({});ke.args={chart:pp};const Me=I.bind({});Me.args={chart:mp};const Ce=I.bind({});Ce.args={chart:bp};const Ae=I.bind({});Ae.args={chart:_p};const Pe=I.bind({});Pe.args={chart:yp};const Oe=Mp.bind({});Oe.args={chart:{...$s,options:{title:"Custom HTML legend",legend:{customLegend:{customLegendPlugin:al(xs),customLegendContainerID:xs}}}}};const De=I.bind({});De.args={chart:vp};const Le=I.bind({});Le.args={chart:wp};const Te=I.bind({});Te.args={chart:Sp};const Re=I.bind({});Re.args={chart:kp};const Ee=()=>{const e="controls-portal-container";return Y.jsxs(Y.Fragment,{children:[Y.jsxs("div",{style:{padding:20,border:"1px solid red"},children:["This div is outside the BarChart component",Y.jsx("div",{id:e})]}),Y.jsx(Xe,{chart:{...$s,controlsPortalId:e}})]})};Ee.__docgenInfo={description:"",methods:[],displayName:"ControlsPortal"};var fo,go,po;hn.parameters={...hn.parameters,docs:{...(fo=hn.parameters)==null?void 0:fo.docs,source:{originalSource:`args => {
|
|
19
|
-
return <BarChart
|
|
20
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
21
|
-
{...args} />;
|
|
22
|
-
}`,...(po=(go=hn.parameters)==null?void 0:go.docs)==null?void 0:po.source}}};var mo,bo,_o;re.parameters={...re.parameters,docs:{...(mo=re.parameters)==null?void 0:mo.docs,source:{originalSource:`args => {
|
|
23
|
-
return <BarChart
|
|
24
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
25
|
-
{...args} />;
|
|
26
|
-
}`,...(_o=(bo=re.parameters)==null?void 0:bo.docs)==null?void 0:_o.source}}};var xo,yo,vo;ae.parameters={...ae.parameters,docs:{...(xo=ae.parameters)==null?void 0:xo.docs,source:{originalSource:`args => {
|
|
27
|
-
return <BarChart
|
|
28
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
29
|
-
{...args} />;
|
|
30
|
-
}`,...(vo=(yo=ae.parameters)==null?void 0:yo.docs)==null?void 0:vo.source}}};var wo,So,ko;le.parameters={...le.parameters,docs:{...(wo=le.parameters)==null?void 0:wo.docs,source:{originalSource:`args => {
|
|
31
|
-
return <BarChart
|
|
32
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
33
|
-
{...args} />;
|
|
34
|
-
}`,...(ko=(So=le.parameters)==null?void 0:So.docs)==null?void 0:ko.source}}};var Mo,Co,Ao;ce.parameters={...ce.parameters,docs:{...(Mo=ce.parameters)==null?void 0:Mo.docs,source:{originalSource:`args => {
|
|
35
|
-
return <BarChart
|
|
36
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
37
|
-
{...args} />;
|
|
38
|
-
}`,...(Ao=(Co=ce.parameters)==null?void 0:Co.docs)==null?void 0:Ao.source}}};var Po,Oo,Do;he.parameters={...he.parameters,docs:{...(Po=he.parameters)==null?void 0:Po.docs,source:{originalSource:`args => {
|
|
39
|
-
return <BarChart
|
|
40
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
41
|
-
{...args} />;
|
|
42
|
-
}`,...(Do=(Oo=he.parameters)==null?void 0:Oo.docs)==null?void 0:Do.source}}};var Lo,To,Ro;de.parameters={...de.parameters,docs:{...(Lo=de.parameters)==null?void 0:Lo.docs,source:{originalSource:`args => {
|
|
43
|
-
return <BarChart
|
|
44
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
45
|
-
{...args} />;
|
|
46
|
-
}`,...(Ro=(To=de.parameters)==null?void 0:To.docs)==null?void 0:Ro.source}}};var Eo,Io,Fo;ue.parameters={...ue.parameters,docs:{...(Eo=ue.parameters)==null?void 0:Eo.docs,source:{originalSource:`args => {
|
|
47
|
-
return <BarChart
|
|
48
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
49
|
-
{...args} />;
|
|
50
|
-
}`,...(Fo=(Io=ue.parameters)==null?void 0:Io.docs)==null?void 0:Fo.source}}};var Bo,zo,No;fe.parameters={...fe.parameters,docs:{...(Bo=fe.parameters)==null?void 0:Bo.docs,source:{originalSource:`args => {
|
|
51
|
-
return <BarChart
|
|
52
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
53
|
-
{...args} />;
|
|
54
|
-
}`,...(No=(zo=fe.parameters)==null?void 0:zo.docs)==null?void 0:No.source}}};var jo,Vo,Wo;ge.parameters={...ge.parameters,docs:{...(jo=ge.parameters)==null?void 0:jo.docs,source:{originalSource:`args => {
|
|
55
|
-
return <BarChart
|
|
56
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
57
|
-
{...args} />;
|
|
58
|
-
}`,...(Wo=(Vo=ge.parameters)==null?void 0:Vo.docs)==null?void 0:Wo.source}}};var Ho,$o,Yo;pe.parameters={...pe.parameters,docs:{...(Ho=pe.parameters)==null?void 0:Ho.docs,source:{originalSource:`args => {
|
|
59
|
-
return <BarChart
|
|
60
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
61
|
-
{...args} />;
|
|
62
|
-
}`,...(Yo=($o=pe.parameters)==null?void 0:$o.docs)==null?void 0:Yo.source}}};var Xo,Uo,Go;me.parameters={...me.parameters,docs:{...(Xo=me.parameters)==null?void 0:Xo.docs,source:{originalSource:`args => {
|
|
63
|
-
return <BarChart
|
|
64
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
65
|
-
{...args} />;
|
|
66
|
-
}`,...(Go=(Uo=me.parameters)==null?void 0:Uo.docs)==null?void 0:Go.source}}};var qo,Ko,Zo;be.parameters={...be.parameters,docs:{...(qo=be.parameters)==null?void 0:qo.docs,source:{originalSource:`args => {
|
|
67
|
-
return <BarChart
|
|
68
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
69
|
-
{...args} />;
|
|
70
|
-
}`,...(Zo=(Ko=be.parameters)==null?void 0:Ko.docs)==null?void 0:Zo.source}}};var Qo,Jo,tr;_e.parameters={..._e.parameters,docs:{...(Qo=_e.parameters)==null?void 0:Qo.docs,source:{originalSource:`args => {
|
|
71
|
-
return <BarChart
|
|
72
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
73
|
-
{...args} />;
|
|
74
|
-
}`,...(tr=(Jo=_e.parameters)==null?void 0:Jo.docs)==null?void 0:tr.source}}};var er,nr,sr;xe.parameters={...xe.parameters,docs:{...(er=xe.parameters)==null?void 0:er.docs,source:{originalSource:`args => {
|
|
75
|
-
return <BarChart
|
|
76
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
77
|
-
{...args} />;
|
|
78
|
-
}`,...(sr=(nr=xe.parameters)==null?void 0:nr.docs)==null?void 0:sr.source}}};var ir,or,rr;ye.parameters={...ye.parameters,docs:{...(ir=ye.parameters)==null?void 0:ir.docs,source:{originalSource:`args => {
|
|
79
|
-
return <BarChart
|
|
80
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
81
|
-
{...args} />;
|
|
82
|
-
}`,...(rr=(or=ye.parameters)==null?void 0:or.docs)==null?void 0:rr.source}}};var ar,lr,cr;ve.parameters={...ve.parameters,docs:{...(ar=ve.parameters)==null?void 0:ar.docs,source:{originalSource:`args => {
|
|
83
|
-
return <BarChart
|
|
84
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
85
|
-
{...args} />;
|
|
86
|
-
}`,...(cr=(lr=ve.parameters)==null?void 0:lr.docs)==null?void 0:cr.source}}};var hr,dr,ur;we.parameters={...we.parameters,docs:{...(hr=we.parameters)==null?void 0:hr.docs,source:{originalSource:`args => {
|
|
87
|
-
return <BarChart
|
|
88
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
89
|
-
{...args} />;
|
|
90
|
-
}`,...(ur=(dr=we.parameters)==null?void 0:dr.docs)==null?void 0:ur.source}}};var fr,gr,pr;Se.parameters={...Se.parameters,docs:{...(fr=Se.parameters)==null?void 0:fr.docs,source:{originalSource:`args => {
|
|
91
|
-
return <BarChart
|
|
92
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
93
|
-
{...args} />;
|
|
94
|
-
}`,...(pr=(gr=Se.parameters)==null?void 0:gr.docs)==null?void 0:pr.source}}};var mr,br,_r;ke.parameters={...ke.parameters,docs:{...(mr=ke.parameters)==null?void 0:mr.docs,source:{originalSource:`args => {
|
|
95
|
-
return <BarChart
|
|
96
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
97
|
-
{...args} />;
|
|
98
|
-
}`,...(_r=(br=ke.parameters)==null?void 0:br.docs)==null?void 0:_r.source}}};var xr,yr,vr;Me.parameters={...Me.parameters,docs:{...(xr=Me.parameters)==null?void 0:xr.docs,source:{originalSource:`args => {
|
|
99
|
-
return <BarChart
|
|
100
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
101
|
-
{...args} />;
|
|
102
|
-
}`,...(vr=(yr=Me.parameters)==null?void 0:yr.docs)==null?void 0:vr.source}}};var wr,Sr,kr;Ce.parameters={...Ce.parameters,docs:{...(wr=Ce.parameters)==null?void 0:wr.docs,source:{originalSource:`args => {
|
|
103
|
-
return <BarChart
|
|
104
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
105
|
-
{...args} />;
|
|
106
|
-
}`,...(kr=(Sr=Ce.parameters)==null?void 0:Sr.docs)==null?void 0:kr.source}}};var Mr,Cr,Ar;Ae.parameters={...Ae.parameters,docs:{...(Mr=Ae.parameters)==null?void 0:Mr.docs,source:{originalSource:`args => {
|
|
107
|
-
return <BarChart
|
|
108
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
109
|
-
{...args} />;
|
|
110
|
-
}`,...(Ar=(Cr=Ae.parameters)==null?void 0:Cr.docs)==null?void 0:Ar.source}}};var Pr,Or,Dr;Pe.parameters={...Pe.parameters,docs:{...(Pr=Pe.parameters)==null?void 0:Pr.docs,source:{originalSource:`args => {
|
|
111
|
-
return <BarChart
|
|
112
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
113
|
-
{...args} />;
|
|
114
|
-
}`,...(Dr=(Or=Pe.parameters)==null?void 0:Or.docs)==null?void 0:Dr.source}}};var Lr,Tr,Rr;Oe.parameters={...Oe.parameters,docs:{...(Lr=Oe.parameters)==null?void 0:Lr.docs,source:{originalSource:`args => {
|
|
115
|
-
return <>
|
|
116
|
-
<BarChart
|
|
117
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
118
|
-
{...args} />
|
|
119
|
-
<div id={customLegendContainerID}></div>
|
|
120
|
-
</>;
|
|
121
|
-
}`,...(Rr=(Tr=Oe.parameters)==null?void 0:Tr.docs)==null?void 0:Rr.source}}};var Er,Ir,Fr;De.parameters={...De.parameters,docs:{...(Er=De.parameters)==null?void 0:Er.docs,source:{originalSource:`args => {
|
|
122
|
-
return <BarChart
|
|
123
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
124
|
-
{...args} />;
|
|
125
|
-
}`,...(Fr=(Ir=De.parameters)==null?void 0:Ir.docs)==null?void 0:Fr.source}}};var Br,zr,Nr;Le.parameters={...Le.parameters,docs:{...(Br=Le.parameters)==null?void 0:Br.docs,source:{originalSource:`args => {
|
|
126
|
-
return <BarChart
|
|
127
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
128
|
-
{...args} />;
|
|
129
|
-
}`,...(Nr=(zr=Le.parameters)==null?void 0:zr.docs)==null?void 0:Nr.source}}};var jr,Vr,Wr;Te.parameters={...Te.parameters,docs:{...(jr=Te.parameters)==null?void 0:jr.docs,source:{originalSource:`args => {
|
|
130
|
-
return <BarChart
|
|
131
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
132
|
-
{...args} />;
|
|
133
|
-
}`,...(Wr=(Vr=Te.parameters)==null?void 0:Vr.docs)==null?void 0:Wr.source}}};var Hr,$r,Yr;Re.parameters={...Re.parameters,docs:{...(Hr=Re.parameters)==null?void 0:Hr.docs,source:{originalSource:`args => {
|
|
134
|
-
return <BarChart
|
|
135
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
136
|
-
{...args} />;
|
|
137
|
-
}`,...(Yr=($r=Re.parameters)==null?void 0:$r.docs)==null?void 0:Yr.source}}};var Xr,Ur,Gr;Ee.parameters={...Ee.parameters,docs:{...(Xr=Ee.parameters)==null?void 0:Xr.docs,source:{originalSource:`() => {
|
|
138
|
-
const controlsPortalId = 'controls-portal-container';
|
|
139
|
-
return <>
|
|
140
|
-
<div style={{
|
|
141
|
-
padding: 20,
|
|
142
|
-
border: '1px solid red'
|
|
143
|
-
}}>
|
|
144
|
-
This div is outside the BarChart component
|
|
145
|
-
<div id={controlsPortalId} />
|
|
146
|
-
</div>
|
|
147
|
-
|
|
148
|
-
<BarChart chart={{
|
|
149
|
-
...singleChart,
|
|
150
|
-
controlsPortalId
|
|
151
|
-
}} />
|
|
152
|
-
</>;
|
|
153
|
-
}`,...(Gr=(Ur=Ee.parameters)==null?void 0:Ur.docs)==null?void 0:Gr.source}}};const zp=["Default","CustomColors","CustomColorsArray","MultipleSets","Stacked","StackedGrouped","MultipleYAxes","Horizontal","Reversed","HorizontalReversed","AxesLabels","AxesPositions","NonZeroStart","CustomRange","CustomStepSize","LogarithmicScale","Datalabels","LegendOnRight","Border","AnnotationYAxis","AnnotationXAxis","AnnotationDiagonal","AnnotationsInLegend","Animated","CustomLegend","DragDataChart","PrettyLabelsTooltips","StackedSelectedAxis","WaterfallChart","ControlsPortal"];export{Pe as Animated,Ce as AnnotationDiagonal,Me as AnnotationXAxis,ke as AnnotationYAxis,Ae as AnnotationsInLegend,pe as AxesLabels,me as AxesPositions,Se as Border,Ee as ControlsPortal,re as CustomColors,ae as CustomColorsArray,Oe as CustomLegend,_e as CustomRange,xe as CustomStepSize,ve as Datalabels,hn as Default,De as DragDataChart,ue as Horizontal,ge as HorizontalReversed,we as LegendOnRight,ye as LogarithmicScale,le as MultipleSets,de as MultipleYAxes,be as NonZeroStart,Le as PrettyLabelsTooltips,fe as Reversed,ce as Stacked,he as StackedGrouped,Te as StackedSelectedAxis,Re as WaterfallChart,zp as __namedExportsOrder,Bp as default};
|