towerops/vendor/oban_web/priv/static/app.js
2026-01-26 17:07:42 -06:00

21 lines
215 KiB
JavaScript

(()=>{var Xl=Object.create;var ss=Object.defineProperty;var ql=Object.getOwnPropertyDescriptor;var Kl=Object.getOwnPropertyNames;var Gl=Object.getPrototypeOf,Jl=Object.prototype.hasOwnProperty;var Zl=(e,t,i)=>t in e?ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Ql=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var tc=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Kl(t))!Jl.call(e,s)&&s!==i&&ss(e,s,{get:()=>t[s],enumerable:!(n=ql(t,s))||n.enumerable});return e};var ec=(e,t,i)=>(i=e!=null?Xl(Gl(e)):{},tc(t||!e||!e.__esModule?ss(i,"default",{value:e,enumerable:!0}):i,e));var E=(e,t,i)=>(Zl(e,typeof t!="symbol"?t+"":t,i),i);var Do=Ql((Po,rn)=>{(function(e,t){"use strict";(function(){for(var h=0,d=["ms","moz","webkit","o"],f=0;f<d.length&&!e.requestAnimationFrame;++f)e.requestAnimationFrame=e[d[f]+"RequestAnimationFrame"],e.cancelAnimationFrame=e[d[f]+"CancelAnimationFrame"]||e[d[f]+"CancelRequestAnimationFrame"];e.requestAnimationFrame||(e.requestAnimationFrame=function(u,m){var g=new Date().getTime(),b=Math.max(0,16-(g-h)),v=e.setTimeout(function(){u(g+b)},b);return h=g+b,v}),e.cancelAnimationFrame||(e.cancelAnimationFrame=function(u){clearTimeout(u)})})();function i(){n.width=e.innerWidth,n.height=5*l.barThickness;var h=n.getContext("2d");h.shadowBlur=l.shadowBlur,h.shadowColor=l.shadowColor;var d,f=h.createLinearGradient(0,0,n.width,0);for(d in l.barColors)f.addColorStop(d,l.barColors[d]);h.lineWidth=l.barThickness,h.beginPath(),h.moveTo(0,l.barThickness/2),h.lineTo(Math.ceil(r*n.width),l.barThickness/2),h.strokeStyle=f,h.stroke()}var n,s,o,r,a,l={autoRun:!0,barThickness:3,barColors:{0:"rgba(26, 188, 156, .9)",".25":"rgba(52, 152, 219, .9)",".50":"rgba(241, 196, 15, .9)",".75":"rgba(230, 126, 34, .9)","1.0":"rgba(211, 84, 0, .9)"},shadowBlur:10,shadowColor:"rgba(0, 0, 0, .6)",className:null},c={config:function(h){for(var d in h)l.hasOwnProperty(d)&&(l[d]=h[d])},show:function(){var h,d,f;a||(a=!0,o!==null&&e.cancelAnimationFrame(o),n||((f=(n=t.createElement("canvas")).style).position="fixed",f.top=f.left=f.right=f.margin=f.padding=0,f.zIndex=100001,f.display="none",l.className&&n.classList.add(l.className),t.body.appendChild(n),h="resize",d=i,(f=e).addEventListener?f.addEventListener(h,d,!1):f.attachEvent?f.attachEvent("on"+h,d):f["on"+h]=d),n.style.opacity=1,n.style.display="block",c.progress(0),l.autoRun&&function u(){s=e.requestAnimationFrame(u),c.progress("+"+.05*Math.pow(1-Math.sqrt(r),2))}())},progress:function(h){return h===void 0||(typeof h=="string"&&(h=(0<=h.indexOf("+")||0<=h.indexOf("-")?r:0)+parseFloat(h)),r=1<h?1:h,i()),r},hide:function(){a&&(a=!1,s!=null&&(e.cancelAnimationFrame(s),s=null),function h(){return 1<=c.progress("+.1")&&(n.style.opacity-=.05,n.style.opacity<=.05)?(n.style.display="none",void(o=null)):void(o=e.requestAnimationFrame(h))}())}};typeof rn=="object"&&typeof rn.exports=="object"?rn.exports=c:typeof define=="function"&&define.amd?define(function(){return c}):this.topbar=c}).call(Po,window,document)});var es=ec(Do());var os="oban:";function To(){let e={};for(let[t,i]of Object.entries(localStorage))t.startsWith(os)&&(e[t]=JSON.parse(i));return e}function an(e){let t=localStorage.getItem(os+e);if(t)return JSON.parse(t)}function Bt(e,t){localStorage.setItem(os+e,JSON.stringify(t))}function _i(e){return e+.5|0}var se=(e,t,i)=>Math.max(Math.min(e,i),t);function yi(e){return se(_i(e*2.55),0,255)}function oe(e){return se(_i(e*255),0,255)}function Ut(e){return se(_i(e/2.55)/100,0,1)}function Co(e){return se(_i(e*100),0,100)}var Ot={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},as=[..."0123456789ABCDEF"],ic=e=>as[e&15],nc=e=>as[(e&240)>>4]+as[e&15],ln=e=>(e&240)>>4===(e&15),sc=e=>ln(e.r)&&ln(e.g)&&ln(e.b)&&ln(e.a);function oc(e){var t=e.length,i;return e[0]==="#"&&(t===4||t===5?i={r:255&Ot[e[1]]*17,g:255&Ot[e[2]]*17,b:255&Ot[e[3]]*17,a:t===5?Ot[e[4]]*17:255}:(t===7||t===9)&&(i={r:Ot[e[1]]<<4|Ot[e[2]],g:Ot[e[3]]<<4|Ot[e[4]],b:Ot[e[5]]<<4|Ot[e[6]],a:t===9?Ot[e[7]]<<4|Ot[e[8]]:255})),i}var rc=(e,t)=>e<255?t(e):"";function ac(e){var t=sc(e)?ic:nc;return e?"#"+t(e.r)+t(e.g)+t(e.b)+rc(e.a,t):void 0}var lc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ro(e,t,i){let n=t*Math.min(i,1-i),s=(o,r=(o+e/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function cc(e,t,i){let n=(s,o=(s+e/60)%6)=>i-i*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function hc(e,t,i){let n=Ro(e,1,.5),s;for(t+i>1&&(s=1/(t+i),t*=s,i*=s),s=0;s<3;s++)n[s]*=1-t-i,n[s]+=t;return n}function dc(e,t,i,n,s){return e===s?(t-i)/n+(t<i?6:0):t===s?(i-e)/n+2:(e-t)/n+4}function ls(e){let i=e.r/255,n=e.g/255,s=e.b/255,o=Math.max(i,n,s),r=Math.min(i,n,s),a=(o+r)/2,l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=dc(i,n,s,h,o),l=l*60+.5),[l|0,c||0,a]}function cs(e,t,i,n){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,n)).map(oe)}function hs(e,t,i){return cs(Ro,e,t,i)}function fc(e,t,i){return cs(hc,e,t,i)}function uc(e,t,i){return cs(cc,e,t,i)}function Io(e){return(e%360+360)%360}function pc(e){let t=lc.exec(e),i=255,n;if(!t)return;t[5]!==n&&(i=t[6]?yi(+t[5]):oe(+t[5]));let s=Io(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=fc(s,o,r):t[1]==="hsv"?n=uc(s,o,r):n=hs(s,o,r),{r:n[0],g:n[1],b:n[2],a:i}}function gc(e,t){var i=ls(e);i[0]=Io(i[0]+t),i=hs(i),e.r=i[0],e.g=i[1],e.b=i[2]}function mc(e){if(!e)return;let t=ls(e),i=t[0],n=Co(t[1]),s=Co(t[2]);return e.a<255?`hsla(${i}, ${n}%, ${s}%, ${Ut(e.a)})`:`hsl(${i}, ${n}%, ${s}%)`}var Ao={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"},Eo={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 bc(){let e={},t=Object.keys(Eo),i=Object.keys(Ao),n,s,o,r,a;for(n=0;n<t.length;n++){for(r=a=t[n],s=0;s<i.length;s++)o=i[s],a=a.replace(o,Ao[o]);o=parseInt(Eo[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}var cn;function vc(e){cn||(cn=bc(),cn.transparent=[0,0,0,0]);let t=cn[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var xc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function yc(e){let t=xc.exec(e),i=255,n,s,o;if(!!t){if(t[7]!==n){let r=+t[7];i=t[8]?yi(r):se(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?yi(n):se(n,0,255)),s=255&(t[4]?yi(s):se(s,0,255)),o=255&(t[6]?yi(o):se(o,0,255)),{r:n,g:s,b:o,a:i}}}function _c(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ut(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var rs=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,qe=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function wc(e,t,i){let n=qe(Ut(e.r)),s=qe(Ut(e.g)),o=qe(Ut(e.b));return{r:oe(rs(n+i*(qe(Ut(t.r))-n))),g:oe(rs(s+i*(qe(Ut(t.g))-s))),b:oe(rs(o+i*(qe(Ut(t.b))-o))),a:e.a+i*(t.a-e.a)}}function hn(e,t,i){if(e){let n=ls(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*i,t===0?360:1)),n=hs(n),e.r=n[0],e.g=n[1],e.b=n[2]}}function Fo(e,t){return e&&Object.assign(t||{},e)}function Lo(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=oe(e[3]))):(t=Fo(e,{r:0,g:0,b:0,a:1}),t.a=oe(t.a)),t}function Mc(e){return e.charAt(0)==="r"?yc(e):pc(e)}var re=class{constructor(t){if(t instanceof re)return t;let i=typeof t,n;i==="object"?n=Lo(t):i==="string"&&(n=oc(t)||vc(t)||Mc(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Fo(this._rgb);return t&&(t.a=Ut(t.a)),t}set rgb(t){this._rgb=Lo(t)}rgbString(){return this._valid?_c(this._rgb):void 0}hexString(){return this._valid?ac(this._rgb):void 0}hslString(){return this._valid?mc(this._rgb):void 0}mix(t,i){if(t){let n=this.rgb,s=t.rgb,o,r=i===o?.5:i,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,i){return t&&(this._rgb=wc(this._rgb,t._rgb,i)),this}clone(){return new re(this.rgb)}alpha(t){return this._rgb.a=oe(t),this}clearer(t){let i=this._rgb;return i.a*=1-t,this}greyscale(){let t=this._rgb,i=_i(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=i,this}opaquer(t){let i=this._rgb;return i.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return hn(this._rgb,2,t),this}darken(t){return hn(this._rgb,2,-t),this}saturate(t){return hn(this._rgb,1,t),this}desaturate(t){return hn(this._rgb,1,-t),this}rotate(t){return gc(this._rgb,t),this}};function zt(){}var Xo=(()=>{let e=0;return()=>e++})();function z(e){return e==null}function U(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function N(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Q(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function vt(e,t){return Q(e)?e:t}function R(e,t){return typeof e>"u"?t:e}var qo=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function j(e,t,i){if(e&&typeof e.call=="function")return e.apply(i,t)}function V(e,t,i,n){let s,o,r;if(U(e))if(o=e.length,n)for(s=o-1;s>=0;s--)t.call(i,e[s],s);else for(s=0;s<o;s++)t.call(i,e[s],s);else if(N(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(i,e[r[s]],r[s])}function Si(e,t){let i,n,s,o;if(!e||!t||e.length!==t.length)return!1;for(i=0,n=e.length;i<n;++i)if(s=e[i],o=t[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function pn(e){if(U(e))return e.map(pn);if(N(e)){let t=Object.create(null),i=Object.keys(e),n=i.length,s=0;for(;s<n;++s)t[i[s]]=pn(e[i[s]]);return t}return e}function Ko(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Sc(e,t,i,n){if(!Ko(e))return;let s=t[e],o=i[e];N(s)&&N(o)?Ge(s,o,n):t[e]=pn(o)}function Ge(e,t,i){let n=U(t)?t:[t],s=n.length;if(!N(e))return e;i=i||{};let o=i.merger||Sc,r;for(let a=0;a<s;++a){if(r=n[a],!N(r))continue;let l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],e,r,i)}return e}function Ze(e,t){return Ge(e,t,{merger:kc})}function kc(e,t,i){if(!Ko(e))return;let n=t[e],s=i[e];N(n)&&N(s)?Ze(n,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=pn(s))}var Bo={"":e=>e,x:e=>e.x,y:e=>e.y};function Oc(e){let t=e.split("."),i=[],n="";for(let s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}function Pc(e){let t=Oc(e);return i=>{for(let n of t){if(n==="")break;i=i&&i[n]}return i}}function ke(e,t){return(Bo[t]||(Bo[t]=Pc(t)))(e)}function vn(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Qe=e=>typeof e<"u",Yt=e=>typeof e=="function",ps=(e,t)=>{if(e.size!==t.size)return!1;for(let i of e)if(!t.has(i))return!1;return!0};function Go(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var Z=Math.PI,Mt=2*Z,Dc=Mt+Z,gn=Number.POSITIVE_INFINITY,Tc=Z/180,mt=Z/2,we=Z/4,No=Z*2/3,Xt=Math.log10,At=Math.sign;function ti(e,t,i){return Math.abs(e-t)<i}function gs(e){let t=Math.round(e);e=ti(e,t,e/1e3)?t:e;let i=Math.pow(10,Math.floor(Xt(e))),n=e/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function Jo(e){let t=[],i=Math.sqrt(e),n;for(n=1;n<i;n++)e%n===0&&(t.push(n),t.push(e/n));return i===(i|0)&&t.push(i),t.sort((s,o)=>s-o).pop(),t}function ei(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Zo(e,t){let i=Math.round(e);return i-t<=e&&i+t>=e}function ms(e,t,i){let n,s,o;for(n=0,s=e.length;n<s;n++)o=e[n][i],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function qt(e){return e*(Z/180)}function xn(e){return e*(180/Z)}function bs(e){if(!Q(e))return;let t=1,i=0;for(;Math.round(e*t)/t!==e;)t*=10,i++;return i}function Qo(e,t){let i=t.x-e.x,n=t.y-e.y,s=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*Z&&(o+=Mt),{angle:o,distance:s}}function mn(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Cc(e,t){return(e-t+Dc)%Mt-Z}function Pt(e){return(e%Mt+Mt)%Mt}function vs(e,t,i,n){let s=Pt(e),o=Pt(t),r=Pt(i),a=Pt(o-s),l=Pt(r-s),c=Pt(s-o),h=Pt(s-r);return s===o||s===r||n&&o===r||a>l&&c<h}function bt(e,t,i){return Math.max(t,Math.min(i,e))}function tr(e){return bt(e,-32768,32767)}function ce(e,t,i,n=1e-6){return e>=Math.min(t,i)-n&&e<=Math.max(t,i)+n}function yn(e,t,i){i=i||(r=>e[r]<t);let n=e.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,i(o)?s=o:n=o;return{lo:s,hi:n}}var le=(e,t,i,n)=>yn(e,i,n?s=>{let o=e[s][t];return o<i||o===i&&e[s+1][t]===i}:s=>e[s][t]<i),er=(e,t,i)=>yn(e,i,n=>e[n][t]>=i);function ir(e,t,i){let n=0,s=e.length;for(;n<s&&e[n]<t;)n++;for(;s>n&&e[s-1]>i;)s--;return n>0||s<e.length?e.slice(n,s):e}var nr=["push","pop","shift","splice","unshift"];function sr(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),nr.forEach(i=>{let n="_onData"+vn(i),s=e[i];Object.defineProperty(e,i,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function xs(e,t){let i=e._chartjs;if(!i)return;let n=i.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(nr.forEach(o=>{delete e[o]}),delete e._chartjs)}function ys(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var _s=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function ws(e,t){let i=[],n=!1;return function(...s){i=s,n||(n=!0,_s.call(window,()=>{n=!1,e.apply(t,i)}))}}function or(e,t){let i;return function(...n){return t?(clearTimeout(i),i=setTimeout(e,t,n)):e.apply(this,n),t}}var Ms=e=>e==="start"?"left":e==="end"?"right":"center",xt=(e,t,i)=>e==="start"?t:e==="end"?i:(t+i)/2,rr=(e,t,i,n)=>e===(n?"left":"right")?i:e==="center"?(t+i)/2:t;function ar(e,t,i){let n=t.length,s=0,o=n;if(e._sorted){let{iScale:r,_parsed:a}=e,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:f}=r.getUserBounds();d&&(s=bt(Math.min(le(a,l,c).lo,i?n:le(t,l,r.getPixelForValue(c)).lo),0,n-1)),f?o=bt(Math.max(le(a,r.axis,h,!0).hi+1,i?0:le(t,l,r.getPixelForValue(h),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function lr(e){let{xScale:t,yScale:i,_scaleRanges:n}=e,s={xmin:t.min,xmax:t.max,ymin:i.min,ymax:i.max};if(!n)return e._scaleRanges=s,!0;let o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}var dn=e=>e===0||e===1,zo=(e,t,i)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Mt/i)),Vo=(e,t,i)=>Math.pow(2,-10*e)*Math.sin((e-t)*Mt/i)+1,Ke={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*mt)+1,easeOutSine:e=>Math.sin(e*mt),easeInOutSine:e=>-.5*(Math.cos(Z*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=>dn(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=>dn(e)?e:zo(e,.075,.3),easeOutElastic:e=>dn(e)?e:Vo(e,.075,.3),easeInOutElastic(e){return dn(e)?e:e<.5?.5*zo(e*2,.1125,.45):.5+.5*Vo(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-Ke.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?Ke.easeInBounce(e*2)*.5:Ke.easeOutBounce(e*2-1)*.5+.5};function Ss(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ks(e){return Ss(e)?e:new re(e)}function ds(e){return Ss(e)?e:new re(e).saturate(.5).darken(.1).hexString()}var Ac=["x","y","borderWidth","radius","tension"],Ec=["color","borderColor","backgroundColor"];function Lc(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Ec},numbers:{type:"number",properties:Ac}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Rc(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Wo=new Map;function Ic(e,t){t=t||{};let i=e+JSON.stringify(t),n=Wo.get(i);return n||(n=new Intl.NumberFormat(e,t),Wo.set(i,n)),n}function _n(e,t,i){return Ic(t,i).format(e)}var cr={values(e){return U(e)?e:""+e},numeric(e,t,i){if(e===0)return"0";let n=this.chart.options.locale,s,o=e;if(i.length>1){let c=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Fc(e,i)}let r=Xt(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),_n(e,n,l)},logarithmic(e,t,i){if(e===0)return"0";let n=i[t].significand||e/Math.pow(10,Math.floor(Xt(e)));return[1,2,3,5,10,15].includes(n)||t>.8*i.length?cr.numeric.call(this,e,t,i):""}};function Fc(e,t){let i=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(i)>=1&&e!==Math.floor(e)&&(i=e-Math.floor(e)),i}var ki={formatters:cr};function Bc(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,i)=>i.lineWidth,tickColor:(t,i)=>i.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ki.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}var he=Object.create(null),wn=Object.create(null);function wi(e,t){if(!t)return e;let i=t.split(".");for(let n=0,s=i.length;n<s;++n){let o=i[n];e=e[o]||(e[o]=Object.create(null))}return e}function fs(e,t,i){return typeof t=="string"?Ge(wi(e,t),i):Ge(wi(e,""),t)}var us=class{constructor(t,i){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)=>ds(s.backgroundColor),this.hoverBorderColor=(n,s)=>ds(s.borderColor),this.hoverColor=(n,s)=>ds(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(i)}set(t,i){return fs(this,t,i)}get(t){return wi(this,t)}describe(t,i){return fs(wn,t,i)}override(t,i){return fs(he,t,i)}route(t,i,n,s){let o=wi(this,t),r=wi(this,n),a="_"+i;Object.defineProperties(o,{[a]:{value:o[i],writable:!0},[i]:{enumerable:!0,get(){let l=this[a],c=r[s];return N(l)?Object.assign({},c,l):R(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(i=>i(this))}},Y=new us({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Lc,Rc,Bc]);function Nc(e){return!e||z(e.size)||z(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Mi(e,t,i,n,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,i.push(s)),o>n&&(n=o),n}function hr(e,t,i,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),e.save(),e.font=t;let r=0,a=i.length,l,c,h,d,f;for(l=0;l<a;l++)if(d=i[l],d!=null&&!U(d))r=Mi(e,s,o,r,d);else if(U(d))for(c=0,h=d.length;c<h;c++)f=d[c],f!=null&&!U(f)&&(r=Mi(e,s,o,r,f));e.restore();let u=o.length/2;if(u>i.length){for(l=0;l<u;l++)delete s[o[l]];o.splice(0,u)}return r}function de(e,t,i){let n=e.currentDevicePixelRatio,s=i!==0?Math.max(i/2,.5):0;return Math.round((t-s)*n)/n+s}function Os(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Mn(e,t,i,n){Ps(e,t,i,n,null)}function Ps(e,t,i,n,s){let o,r,a,l,c,h,d,f,u=t.pointStyle,m=t.rotation,g=t.radius,b=(m||0)*Tc;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(i,n),e.rotate(b),e.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),u){default:s?e.ellipse(i,n,s/2,g,0,0,Mt):e.arc(i,n,g,0,Mt),e.closePath();break;case"triangle":h=s?s/2:g,e.moveTo(i+Math.sin(b)*h,n-Math.cos(b)*g),b+=No,e.lineTo(i+Math.sin(b)*h,n-Math.cos(b)*g),b+=No,e.lineTo(i+Math.sin(b)*h,n-Math.cos(b)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(b+we)*l,d=Math.cos(b+we)*(s?s/2-c:l),a=Math.sin(b+we)*l,f=Math.sin(b+we)*(s?s/2-c:l),e.arc(i-d,n-a,c,b-Z,b-mt),e.arc(i+f,n-r,c,b-mt,b),e.arc(i+d,n+a,c,b,b+mt),e.arc(i-f,n+r,c,b+mt,b+Z),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,h=s?s/2:l,e.rect(i-h,n-l,2*h,2*l);break}b+=we;case"rectRot":d=Math.cos(b)*(s?s/2:g),r=Math.cos(b)*g,a=Math.sin(b)*g,f=Math.sin(b)*(s?s/2:g),e.moveTo(i-d,n-a),e.lineTo(i+f,n-r),e.lineTo(i+d,n+a),e.lineTo(i-f,n+r),e.closePath();break;case"crossRot":b+=we;case"cross":d=Math.cos(b)*(s?s/2:g),r=Math.cos(b)*g,a=Math.sin(b)*g,f=Math.sin(b)*(s?s/2:g),e.moveTo(i-d,n-a),e.lineTo(i+d,n+a),e.moveTo(i+f,n-r),e.lineTo(i-f,n+r);break;case"star":d=Math.cos(b)*(s?s/2:g),r=Math.cos(b)*g,a=Math.sin(b)*g,f=Math.sin(b)*(s?s/2:g),e.moveTo(i-d,n-a),e.lineTo(i+d,n+a),e.moveTo(i+f,n-r),e.lineTo(i-f,n+r),b+=we,d=Math.cos(b)*(s?s/2:g),r=Math.cos(b)*g,a=Math.sin(b)*g,f=Math.sin(b)*(s?s/2:g),e.moveTo(i-d,n-a),e.lineTo(i+d,n+a),e.moveTo(i+f,n-r),e.lineTo(i-f,n+r);break;case"line":r=s?s/2:Math.cos(b)*g,a=Math.sin(b)*g,e.moveTo(i-r,n-a),e.lineTo(i+r,n+a);break;case"dash":e.moveTo(i,n),e.lineTo(i+Math.cos(b)*(s?s/2:g),n+Math.sin(b)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Nt(e,t,i){return i=i||.5,!t||e&&e.x>t.left-i&&e.x<t.right+i&&e.y>t.top-i&&e.y<t.bottom+i}function Sn(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function kn(e){e.restore()}function dr(e,t,i,n,s){if(!t)return e.lineTo(i.x,i.y);if(s==="middle"){let o=(t.x+i.x)/2;e.lineTo(o,t.y),e.lineTo(o,i.y)}else s==="after"!=!!n?e.lineTo(t.x,i.y):e.lineTo(i.x,t.y);e.lineTo(i.x,i.y)}function fr(e,t,i,n){if(!t)return e.lineTo(i.x,i.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function zc(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),z(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 Vc(e,t,i,n,s){if(s.strikethrough||s.underline){let o=e.measureText(n),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,c=i+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,h),e.lineTo(a,h),e.stroke()}}function Wc(e,t){let i=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=i}function Oe(e,t,i,n,s,o={}){let r=U(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,zc(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Wc(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),z(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,i,n,o.maxWidth)),e.fillText(c,i,n,o.maxWidth),Vc(e,i,n,c,o),n+=Number(s.lineHeight);e.restore()}function ii(e,t){let{x:i,y:n,w:s,h:o,radius:r}=t;e.arc(i+r.topLeft,n+r.topLeft,r.topLeft,1.5*Z,Z,!0),e.lineTo(i,n+o-r.bottomLeft),e.arc(i+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,Z,mt,!0),e.lineTo(i+s-r.bottomRight,n+o),e.arc(i+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,mt,0,!0),e.lineTo(i+s,n+r.topRight),e.arc(i+s-r.topRight,n+r.topRight,r.topRight,0,-mt,!0),e.lineTo(i+r.topLeft,n)}var Hc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,jc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function $c(e,t){let i=(""+e).match(Hc);if(!i||i[1]==="normal")return t*1.2;switch(e=+i[2],i[3]){case"px":return e;case"%":e/=100;break}return t*e}var Uc=e=>+e||0;function Ds(e,t){let i={},n=N(t),s=n?Object.keys(t):t,o=N(e)?n?r=>R(e[r],e[t[r]]):r=>e[r]:()=>e;for(let r of s)i[r]=Uc(o(r));return i}function Ts(e){return Ds(e,{top:"y",right:"x",bottom:"y",left:"x"})}function fe(e){return Ds(e,["topLeft","topRight","bottomLeft","bottomRight"])}function dt(e){let t=Ts(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function it(e,t){e=e||{},t=t||Y.font;let i=R(e.size,t.size);typeof i=="string"&&(i=parseInt(i,10));let n=R(e.style,t.style);n&&!(""+n).match(jc)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let s={family:R(e.family,t.family),lineHeight:$c(R(e.lineHeight,t.lineHeight),i),size:i,style:n,weight:R(e.weight,t.weight),string:""};return s.string=Nc(s),s}function Oi(e,t,i,n){let s=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),i!==void 0&&U(a)&&(a=a[i%a.length],s=!1),a!==void 0))return n&&!s&&(n.cacheable=!1),a}function ur(e,t,i){let{min:n,max:s}=e,o=qo(t,(s-n)/2),r=(a,l)=>i&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function Kt(e,t){return Object.assign(Object.create(e),t)}function On(e,t=[""],i,n,s=()=>e[0]){let o=i||e;typeof n>"u"&&(n=mr("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>On([a,...e],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return pr(a,l,()=>Qc(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return jo(a).includes(l)},ownKeys(a){return jo(a)},set(a,l,c){let h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function Se(e,t,i,n){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:i,_stack:new Set,_descriptors:Cs(e,n),setContext:o=>Se(e,o,i,n),override:o=>Se(e.override(o),t,i,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return pr(o,r,()=>Xc(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 Cs(e,t={scriptable:!0,indexable:!0}){let{_scriptable:i=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Yt(i)?i:()=>i,isIndexable:Yt(n)?n:()=>n}}var Yc=(e,t)=>e?e+vn(t):t,As=(e,t)=>N(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pr(e,t,i){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let n=i();return e[t]=n,n}function Xc(e,t,i){let{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=e,a=n[t];return Yt(a)&&r.isScriptable(t)&&(a=qc(t,a,e,i)),U(a)&&a.length&&(a=Kc(t,a,e,r.isIndexable)),As(t,a)&&(a=Se(a,s,o&&o[t],r)),a}function qc(e,t,i,n){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||n);return a.delete(e),As(e,l)&&(l=Es(s._scopes,s,e,l)),l}function Kc(e,t,i,n){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(typeof o.index<"u"&&n(e))return t[o.index%t.length];if(N(t[0])){let l=t,c=s._scopes.filter(h=>h!==l);t=[];for(let h of l){let d=Es(c,s,e,h);t.push(Se(d,o,r&&r[e],a))}}return t}function gr(e,t,i){return Yt(e)?e(t,i):e}var Gc=(e,t)=>e===!0?t:typeof e=="string"?ke(t,e):void 0;function Jc(e,t,i,n,s){for(let o of t){let r=Gc(i,o);if(r){e.add(r);let a=gr(r._fallback,i,s);if(typeof a<"u"&&a!==i&&a!==n)return a}else if(r===!1&&typeof n<"u"&&i!==n)return null}return!1}function Es(e,t,i,n){let s=t._rootScopes,o=gr(t._fallback,i,n),r=[...e,...s],a=new Set;a.add(n);let l=Ho(a,r,i,o||i,n);return l===null||typeof o<"u"&&o!==i&&(l=Ho(a,r,o,l,n),l===null)?!1:On(Array.from(a),[""],s,o,()=>Zc(t,i,n))}function Ho(e,t,i,n,s){for(;i;)i=Jc(e,t,i,n,s);return i}function Zc(e,t,i){let n=e._getTarget();t in n||(n[t]={});let s=n[t];return U(s)&&N(i)?i:s||{}}function Qc(e,t,i,n){let s;for(let o of t)if(s=mr(Yc(o,e),i),typeof s<"u")return As(e,s)?Es(i,n,e,s):s}function mr(e,t){for(let i of t){if(!i)continue;let n=i[e];if(typeof n<"u")return n}}function jo(e){let t=e._keys;return t||(t=e._keys=th(e._scopes)),t}function th(e){let t=new Set;for(let i of e)for(let n of Object.keys(i).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}var eh=Number.EPSILON||1e-14,Je=(e,t)=>t<e.length&&!e[t].skip&&e[t],br=e=>e==="x"?"y":"x";function ih(e,t,i,n){let s=e.skip?t:e,o=t,r=i.skip?t:i,a=mn(o,s),l=mn(r,o),c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let d=n*c,f=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function nh(e,t,i){let n=e.length,s,o,r,a,l,c=Je(e,0);for(let h=0;h<n-1;++h)if(l=c,c=Je(e,h+1),!(!l||!c)){if(ti(t[h],0,eh)){i[h]=i[h+1]=0;continue}s=i[h]/t[h],o=i[h+1]/t[h],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),i[h]=s*r*t[h],i[h+1]=o*r*t[h])}}function sh(e,t,i="x"){let n=br(i),s=e.length,o,r,a,l=Je(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Je(e,c+1),!a)continue;let h=a[i],d=a[n];r&&(o=(h-r[i])/3,a[`cp1${i}`]=h-o,a[`cp1${n}`]=d-o*t[c]),l&&(o=(l[i]-h)/3,a[`cp2${i}`]=h+o,a[`cp2${n}`]=d+o*t[c])}}function oh(e,t="x"){let i=br(t),n=e.length,s=Array(n).fill(0),o=Array(n),r,a,l,c=Je(e,0);for(r=0;r<n;++r)if(a=l,l=c,c=Je(e,r+1),!!l){if(c){let h=c[t]-l[t];s[r]=h!==0?(c[i]-l[i])/h:0}o[r]=a?c?At(s[r-1])!==At(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}nh(e,s,o),sh(e,o,t)}function fn(e,t,i){return Math.max(Math.min(e,i),t)}function rh(e,t){let i,n,s,o,r,a=Nt(e[0],t);for(i=0,n=e.length;i<n;++i)r=o,o=a,a=i<n-1&&Nt(e[i+1],t),o&&(s=e[i],r&&(s.cp1x=fn(s.cp1x,t.left,t.right),s.cp1y=fn(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=fn(s.cp2x,t.left,t.right),s.cp2y=fn(s.cp2y,t.top,t.bottom)))}function vr(e,t,i,n,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")oh(e,s);else{let c=n?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=ih(c,a,e[Math.min(o+1,r-(n?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&rh(e,i)}function Pn(){return typeof window<"u"&&typeof document<"u"}function Dn(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function bn(e,t,i){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*t.parentNode[i])):n=e,n}var Tn=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function ah(e,t){return Tn(e).getPropertyValue(t)}var lh=["top","right","bottom","left"];function Me(e,t,i){let n={};i=i?"-"+i:"";for(let s=0;s<4;s++){let o=lh[s];n[o]=parseFloat(e[t+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}var ch=(e,t,i)=>(e>0||t>0)&&(!i||!i.shadowRoot);function hh(e,t){let i=e.touches,n=i&&i.length?i[0]:e,{offsetX:s,offsetY:o}=n,r=!1,a,l;if(ch(s,o,e.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function ue(e,t){if("native"in e)return e;let{canvas:i,currentDevicePixelRatio:n}=t,s=Tn(i),o=s.boxSizing==="border-box",r=Me(s,"padding"),a=Me(s,"border","width"),{x:l,y:c,box:h}=hh(e,i),d=r.left+(h&&a.left),f=r.top+(h&&a.top),{width:u,height:m}=t;return o&&(u-=r.width+a.width,m-=r.height+a.height),{x:Math.round((l-d)/u*i.width/n),y:Math.round((c-f)/m*i.height/n)}}function dh(e,t,i){let n,s;if(t===void 0||i===void 0){let o=e&&Dn(e);if(!o)t=e.clientWidth,i=e.clientHeight;else{let r=o.getBoundingClientRect(),a=Tn(o),l=Me(a,"border","width"),c=Me(a,"padding");t=r.width-c.width-l.width,i=r.height-c.height-l.height,n=bn(a.maxWidth,o,"clientWidth"),s=bn(a.maxHeight,o,"clientHeight")}}return{width:t,height:i,maxWidth:n||gn,maxHeight:s||gn}}var un=e=>Math.round(e*10)/10;function xr(e,t,i,n){let s=Tn(e),o=Me(s,"margin"),r=bn(s.maxWidth,e,"clientWidth")||gn,a=bn(s.maxHeight,e,"clientHeight")||gn,l=dh(e,t,i),{width:c,height:h}=l;if(s.boxSizing==="content-box"){let f=Me(s,"border","width"),u=Me(s,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=un(Math.min(c,r,l.maxWidth)),h=un(Math.min(h,a,l.maxHeight)),c&&!h&&(h=un(c/2)),(t!==void 0||i!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=un(Math.floor(h*n))),{width:c,height:h}}function Ls(e,t,i){let n=t||1,s=Math.floor(e.height*n),o=Math.floor(e.width*n);e.height=Math.floor(e.height),e.width=Math.floor(e.width);let r=e.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=n,r.height=s,r.width=o,e.ctx.setTransform(n,0,0,n,0,0),!0):!1}var yr=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Pn()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function Rs(e,t){let i=ah(e,t),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ae(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}}function _r(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:n==="middle"?i<.5?e.y:t.y:n==="after"?i<1?e.y:t.y:i>0?t.y:e.y}}function wr(e,t,i,n){let s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=ae(e,s,i),a=ae(s,o,i),l=ae(o,t,i),c=ae(r,a,i),h=ae(a,l,i);return ae(c,h,i)}var fh=function(e,t){return{x(i){return e+e+t-i},setWidth(i){t=i},textAlign(i){return i==="center"?i:i==="right"?"left":"right"},xPlus(i,n){return i-n},leftForLtr(i,n){return i-n}}},uh=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Pe(e,t,i){return e?fh(t,i):uh()}function Is(e,t){let i,n;(t==="ltr"||t==="rtl")&&(i=e.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),e.prevTextDirection=n)}function Fs(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Mr(e){return e==="angle"?{between:vs,compare:Cc,normalize:Pt}:{between:ce,compare:(t,i)=>t-i,normalize:t=>t}}function $o({start:e,end:t,count:i,loop:n,style:s}){return{start:e%i,end:t%i,loop:n&&(t-e+1)%i===0,style:s}}function ph(e,t,i){let{property:n,start:s,end:o}=i,{between:r,normalize:a}=Mr(n),l=t.length,{start:c,end:h,loop:d}=e,f,u;if(d){for(c+=l,h+=l,f=0,u=l;f<u&&r(a(t[c%l][n]),s,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:e.style}}function Sr(e,t,i){if(!i)return[e];let{property:n,start:s,end:o}=i,r=t.length,{compare:a,between:l,normalize:c}=Mr(n),{start:h,end:d,loop:f,style:u}=ph(e,t,i),m=[],g=!1,b=null,v,w,M,p=()=>l(s,M,v)&&a(s,M)!==0,_=()=>a(o,v)===0||l(o,M,v),y=()=>g||p(),S=()=>!g||_();for(let k=h,P=h;k<=d;++k)w=t[k%r],!w.skip&&(v=c(w[n]),v!==M&&(g=l(v,s,o),b===null&&y()&&(b=a(v,s)===0?k:P),b!==null&&S()&&(m.push($o({start:b,end:k,loop:f,count:r,style:u})),b=null),P=k,M=v));return b!==null&&m.push($o({start:b,end:d,loop:f,count:r,style:u})),m}function kr(e,t){let i=[],n=e.segments;for(let s=0;s<n.length;s++){let o=Sr(n[s],e.points,t);o.length&&i.push(...o)}return i}function gh(e,t,i,n){let s=0,o=t-1;if(i&&!n)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,i&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function mh(e,t,i,n){let s=e.length,o=[],r=t,a=e[t],l;for(l=t+1;l<=i;++l){let c=e[l%s];c.skip||c.stop?a.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:n}),o}function Or(e,t){let i=e.points,n=e.options.spanGaps,s=i.length;if(!s)return[];let o=!!e._loop,{start:r,end:a}=gh(i,s,o,n);if(n===!0)return Uo(e,[{start:r,end:a,loop:o}],i,t);let l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Uo(e,mh(i,r,l,c),i,t)}function Uo(e,t,i,n){return!n||!n.setContext||!i?t:bh(e,t,i,n)}function bh(e,t,i,n){let s=e._chart.getContext(),o=Yo(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=i.length,c=[],h=o,d=t[0].start,f=d;function u(m,g,b,v){let w=a?-1:1;if(m!==g){for(m+=l;i[m%l].skip;)m-=w;for(;i[g%l].skip;)g+=w;m%l!==g%l&&(c.push({start:m%l,end:g%l,loop:b,style:v}),h=v,d=g%l)}}for(let m of t){d=a?d:m.start;let g=i[d%l],b;for(f=d+1;f<=m.end;f++){let v=i[f%l];b=Yo(n.setContext(Kt(s,{type:"segment",p0:g,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),vh(b,h)&&u(d,f-1,m.loop,h),g=v,h=b}d<f-1&&u(d,f-1,m.loop,h)}return c}function Yo(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function vh(e,t){if(!t)return!1;let i=[],n=function(s,o){return Ss(o)?(i.includes(o)||i.push(o),i.indexOf(o)):o};return JSON.stringify(e,n)!==JSON.stringify(t,n)}var Ys=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,n,s){let o=i.listeners[s],r=i.duration;o.forEach(a=>a({chart:t,initial:i.initial,numSteps:r,currentStep:Math.min(n-i.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=_s.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let i=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;let o=n.items,r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),i+=o.length}),this._lastDate=t,i===0&&(this._running=!1)}_getAnims(t){let i=this._charts,n=i.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,n)),n}listen(t,i,n){this._getAnims(t).listeners[i].push(n)}add(t,i){!i||!i.length||this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){let i=this._charts.get(t);!i||(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let i=this._charts.get(t);return!(!i||!i.running||!i.items.length)}stop(t){let i=this._charts.get(t);if(!i||!i.items.length)return;let n=i.items,s=n.length-1;for(;s>=0;--s)n[s].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Gt=new Ys,Pr="transparent",xh={boolean(e,t,i){return i>.5?t:e},color(e,t,i){let n=ks(e||Pr),s=n.valid&&ks(t||Pr);return s&&s.valid?s.mix(n,i).hexString():t},number(e,t,i){return e+(t-e)*i}},Xs=class{constructor(t,i,n,s){let o=i[n];s=Oi([t.to,s,o,t.from]);let r=Oi([t.from,o,s]);this._active=!0,this._fn=t.fn||xh[t.type||typeof r],this._easing=Ke[t.easing]||Ke.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,i,n){if(this._active){this._notify(!1);let s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Oi([t.to,i,s,t.from]),this._from=Oi([t.from,s,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let i=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||i<n),!this._active){this._target[s]=a,this._notify(!0);return}if(i<0){this._target[s]=o;return}l=i/n%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((i,n)=>{t.push({res:i,rej:n})})}_notify(t){let i=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][i]()}},Vn=class{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!N(t))return;let i=Object.keys(Y.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!N(o))return;let r={};for(let a of i)r[a]=o[a];(U(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,i){let n=i.options,s=_h(t,n);if(!s)return[];let o=this._createAnimations(s,n);return n.$shared&&yh(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,i){let n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(i),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,i));continue}let h=i[c],d=o[c],f=n.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new Xs(f,t,c,h),s.push(d)}return s}update(t,i){if(this._properties.size===0){Object.assign(t,i);return}let n=this._createAnimations(t,i);if(n.length)return Gt.add(this._chart,n),!0}};function yh(e,t){let i=[],n=Object.keys(t);for(let s=0;s<n.length;s++){let o=e[n[s]];o&&o.active()&&i.push(o.wait())}return Promise.all(i)}function _h(e,t){if(!t)return;let i=e.options;if(!i){e.options=t;return}return i.$shared&&(e.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}function Dr(e,t){let i=e&&e.options||{},n=i.reverse,s=i.min===void 0?t:0,o=i.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function wh(e,t,i){if(i===!1)return!1;let n=Dr(e,i),s=Dr(t,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Mh(e){let t,i,n,s;return N(e)?(t=e.top,i=e.right,n=e.bottom,s=e.left):t=i=n=s=e,{top:t,right:i,bottom:n,left:s,disabled:e===!1}}function va(e,t){let i=[],n=e._getSortedDatasetMetas(t),s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function Tr(e,t,i,n={}){let s=e.keys,o=n.mode==="single",r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===i){if(h=!0,n.all)continue;break}c=e.values[l],Q(c)&&(o||t===0||At(t)===At(c))&&(t+=c)}return!h&&!n.all?0:t}function Sh(e,t){let{iScale:i,vScale:n}=t,s=i.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:e[h]};return a}function Bs(e,t){let i=e&&e.options.stacked;return i||i===void 0&&t.stack!==void 0}function kh(e,t,i){return`${e.id}.${t.id}.${i.stack||i.type}`}function Oh(e){let{min:t,max:i,minDefined:n,maxDefined:s}=e.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}function Ph(e,t,i){let n=e[t]||(e[t]={});return n[i]||(n[i]={})}function Cr(e,t,i,n){for(let s of t.getMatchingVisibleMetas(n).reverse()){let o=e[s.index];if(i&&o>0||!i&&o<0)return s.index}return null}function Ar(e,t){let{chart:i,_cachedMeta:n}=e,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=kh(o,r,n),d=t.length,f;for(let u=0;u<d;++u){let m=t[u],{[l]:g,[c]:b}=m,v=m._stacks||(m._stacks={});f=v[c]=Ph(s,h,g),f[a]=b,f._top=Cr(f,r,!0,n.type),f._bottom=Cr(f,r,!1,n.type);let w=f._visualValues||(f._visualValues={});w[a]=b}}function Ns(e,t){let i=e.scales;return Object.keys(i).filter(n=>i[n].axis===t).shift()}function Dh(e,t){return Kt(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Th(e,t,i){return Kt(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:i,index:t,mode:"default",type:"data"})}function Pi(e,t){let i=e.controller.index,n=e.vScale&&e.vScale.axis;if(!!n){t=t||e._parsed;for(let s of t){let o=s._stacks;if(!o||o[n]===void 0||o[n][i]===void 0)return;delete o[n][i],o[n]._visualValues!==void 0&&o[n]._visualValues[i]!==void 0&&delete o[n]._visualValues[i]}}}var zs=e=>e==="reset"||e==="none",Er=(e,t)=>t?e:Object.assign({},e),Ch=(e,t,i)=>e&&!t.hidden&&t._stacked&&{keys:va(i,!0),values:null},ge=class{constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Bs(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Pi(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,i=this._cachedMeta,n=this.getDataset(),s=(d,f,u,m)=>d==="x"?f:d==="r"?m:u,o=i.xAxisID=R(n.xAxisID,Ns(t,"x")),r=i.yAxisID=R(n.yAxisID,Ns(t,"y")),a=i.rAxisID=R(n.rAxisID,Ns(t,"r")),l=i.indexAxis,c=i.iAxisID=s(l,o,r,a),h=i.vAxisID=s(l,r,o,a);i.xScale=this.getScaleForId(o),i.yScale=this.getScaleForId(r),i.rScale=this.getScaleForId(a),i.iScale=this.getScaleForId(c),i.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){let i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&xs(this._data,this),t._stacked&&Pi(t)}_dataCheck(){let t=this.getDataset(),i=t.data||(t.data=[]),n=this._data;if(N(i)){let s=this._cachedMeta;this._data=Sh(i,s)}else if(n!==i){if(n){xs(n,this);let s=this._cachedMeta;Pi(s),s._parsed=[]}i&&Object.isExtensible(i)&&sr(i,this),this._syncList=[],this._data=i}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let i=this._cachedMeta,n=this.getDataset(),s=!1;this._dataCheck();let o=i._stacked;i._stacked=Bs(i.vScale,i),i.stack!==n.stack&&(s=!0,Pi(i),i.stack=n.stack),this._resyncElements(t),(s||o!==i._stacked)&&(Ar(this,i._parsed),i._stacked=Bs(i.vScale,i))}configure(){let t=this.chart.config,i=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){let{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis,l=t===0&&i===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,d,f;if(this._parsing===!1)n._parsed=s,n._sorted=!0,f=s;else{U(s[t])?f=this.parseArrayData(n,s,t,i):N(s[t])?f=this.parseObjectData(n,s,t,i):f=this.parsePrimitiveData(n,s,t,i);let u=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<i;++h)n._parsed[h+t]=d=f[h],l&&(u()&&(l=!1),c=d);n._sorted=l}r&&Ar(this,f)}parsePrimitiveData(t,i,n,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(s),f,u,m;for(f=0,u=s;f<u;++f)m=f+n,d[f]={[a]:h||o.parse(c[m],m),[l]:r.parse(i[m],m)};return d}parseArrayData(t,i,n,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,h,d;for(l=0,c=s;l<c;++l)h=l+n,d=i[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,i,n,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),h,d,f,u;for(h=0,d=s;h<d;++h)f=h+n,u=i[f],c[h]={x:o.parse(ke(u,a),f),y:r.parse(ke(u,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,n){let s=this.chart,o=this._cachedMeta,r=i[t.axis],a={keys:va(s,!0),values:i._stacks[t.axis]._visualValues};return Tr(a,r,o.index,{mode:n})}updateRangeFromParsed(t,i,n,s){let o=n[i.axis],r=o===null?NaN:o,a=s&&n._stacks[i.axis];s&&a&&(s.values=a,r=Tr(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,i){let n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,a=this._getOtherScale(t),l=Ch(i,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Oh(a),f,u;function m(){u=s[f];let g=u[a.axis];return!Q(u[t.axis])||h>g||d<g}for(f=0;f<r&&!(!m()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){let i=this._cachedMeta._parsed,n=[],s,o,r;for(s=0,o=i.length;s<o;++s)r=i[s][t.axis],Q(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let i=this._cachedMeta,n=i.iScale,s=i.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let i=this._cachedMeta;this.update(t||"default"),i._clip=Mh(R(this.options.clip,wh(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,i=this.chart,n=this._cachedMeta,s=n.data||[],o=i.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,h;for(n.dataset&&n.dataset.draw(t,o,a,l),h=a;h<a+l;++h){let d=s[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,i){let n=i?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,i,n){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=Th(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Dh(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!i,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",n){let s=i==="active",o=this._cachedDataOpts,r=t+"-"+i,a=o[r],l=this.enableOptionSharing&&Qe(n);if(a)return Er(a,l);let c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),u=Object.keys(Y.elements[t]),m=()=>this.getContext(n,s,i),g=c.resolveNamedOptions(f,u,m,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(Er(g,l))),g}_resolveAnimations(t,i,n){let s=this.chart,o=this._cachedDataOpts,r=`animation-${i}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,i),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,n,i))}let c=new Vn(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(!!t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||zs(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){let n=this.resolveDataElementOptions(t,i),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(i,o)||o!==s;return this.updateSharedOptions(o,i,n),{sharedOptions:o,includeOptions:r}}updateElement(t,i,n,s){zs(s)?Object.assign(t,n):this._resolveAnimations(i,s).update(t,n)}updateSharedOptions(t,i,n){t&&!zs(i)&&this._resolveAnimations(void 0,i).update(t,n)}_setStyle(t,i,n,s){t.active=s;let o=this.getStyle(i,s);this._resolveAnimations(i,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,i,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,i,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let i=this._data,n=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=n.length,o=i.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,i,n=!0){let s=this._cachedMeta,o=s.data,r=t+i,a,l=c=>{for(c.length+=i,a=c.length-1;a>=r;a--)c[a]=c[a-i]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,i),n&&this.updateElements(o,t,i,"reset")}updateElements(t,i,n,s){}_removeElements(t,i){let n=this._cachedMeta;if(this._parsing){let s=n._parsed.splice(t,i);n._stacked&&Pi(n,s)}n.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[i,n,s]=t;this[i](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let 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,i){i&&this._sync(["_removeElements",t,i]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};E(ge,"defaults",{}),E(ge,"datasetElementType",null),E(ge,"dataElementType",null);function Ah(e,t){if(!e._cache.$bar){let i=e.getMatchingVisibleMetas(t),n=[];for(let s=0,o=i.length;s<o;s++)n=n.concat(i[s].controller.getAllParsedValues(e));e._cache.$bar=ys(n.sort((s,o)=>s-o))}return e._cache.$bar}function Eh(e){let t=e.iScale,i=Ah(t,e.type),n=t._length,s,o,r,a,l=()=>{r===32767||r===-32768||(Qe(a)&&(n=Math.min(n,Math.abs(r-a)||n)),a=r)};for(s=0,o=i.length;s<o;++s)r=t.getPixelForValue(i[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return n}function Lh(e,t,i,n){let s=i.barThickness,o,r;return z(s)?(o=t.min*i.categoryPercentage,r=i.barPercentage):(o=s*n,r=1),{chunk:o/n,ratio:r,start:t.pixels[e]-o/2}}function Rh(e,t,i,n){let s=t.pixels,o=s[e],r=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null,l=i.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);let c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/n,ratio:i.barPercentage,start:c}}function Ih(e,t,i,n){let s=i.parse(e[0],n),o=i.parse(e[1],n),r=Math.min(s,o),a=Math.max(s,o),l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[i.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function xa(e,t,i,n){return U(e)?Ih(e,t,i,n):t[i.axis]=i.parse(e,n),t}function Lr(e,t,i,n){let s=e.iScale,o=e.vScale,r=s.getLabels(),a=s===o,l=[],c,h,d,f;for(c=i,h=i+n;c<h;++c)f=t[c],d={},d[s.axis]=a||s.parse(r[c],c),l.push(xa(f,d,o,c));return l}function Vs(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Fh(e,t,i){return e!==0?At(e):(t.isHorizontal()?1:-1)*(t.min>=i?1:-1)}function Bh(e){let t,i,n,s,o;return e.horizontal?(t=e.base>e.x,i="left",n="right"):(t=e.base<e.y,i="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:i,end:n,reverse:t,top:s,bottom:o}}function Nh(e,t,i,n){let s=t.borderSkipped,o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:r,end:a,reverse:l,top:c,bottom:h}=Bh(e);s==="middle"&&i&&(e.enableBorderRadius=!0,(i._top||0)===n?s=c:(i._bottom||0)===n?s=h:(o[Rr(h,r,a,l)]=!0,s=c)),o[Rr(s,r,a,l)]=!0,e.borderSkipped=o}function Rr(e,t,i,n){return n?(e=zh(e,t,i),e=Ir(e,i,t)):e=Ir(e,t,i),e}function zh(e,t,i){return e===t?i:e===i?t:e}function Ir(e,t,i){return e==="start"?t:e==="end"?i:e}function Vh(e,{inflateAmount:t},i){e.inflateAmount=t==="auto"?i===1?.33:0:t}var Ce=class extends ge{parsePrimitiveData(t,i,n,s){return Lr(t,i,n,s)}parseArrayData(t,i,n,s){return Lr(t,i,n,s)}parseObjectData(t,i,n,s){let{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=[],f,u,m,g;for(f=n,u=n+s;f<u;++f)g=i[f],m={},m[o.axis]=o.parse(ke(g,c),f),d.push(xa(ke(g,h),m,r,f));return d}updateRangeFromParsed(t,i,n,s){super.updateRangeFromParsed(t,i,n,s);let o=n._custom;o&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let i=this._cachedMeta,{iScale:n,vScale:s}=i,o=this.getParsed(t),r=o._custom,a=Vs(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,n,s){let o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(i,s);for(let u=i;u<i+n;u++){let m=this.getParsed(u),g=o||z(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(u),b=this._calculateBarIndexPixels(u,h),v=(m._stacks||{})[a.axis],w={horizontal:c,base:g.base,enableBorderRadius:!v||Vs(m._custom)||r===v._top||r===v._bottom,x:c?g.head:b.center,y:c?b.center:g.head,height:c?b.size:Math.abs(g.size),width:c?Math.abs(g.size):b.size};f&&(w.options=d||this.resolveDataElementOptions(u,t[u].active?"active":s));let M=w.options||t[u].options;Nh(w,M,v,r),Vh(w,M,h.ratio),this.updateElement(t[u],u,w,s)}}_getStacks(t,i){let{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=n.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(i),l=a&&a[n.axis],c=h=>{let d=h._parsed.find(u=>u[n.axis]===l),f=d&&d[h.vScale.axis];if(z(f)||isNaN(f))return!0};for(let h of s)if(!(i!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,i,n){let s=this._getStacks(t,n),o=i!==void 0?s.indexOf(i):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,i=this._cachedMeta,n=i.iScale,s=[],o,r;for(o=0,r=i.data.length;o<r;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));let a=t.barThickness;return{min:a||Eh(i),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:i,_stacked:n,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=Vs(c),d=l[i.axis],f=0,u=n?this.applyStack(i,l,n):d,m,g;u!==d&&(f=u-d,u=d),h&&(d=c.barStart,u=c.barEnd-c.barStart,d!==0&&At(d)!==At(c.barEnd)&&(f=0),f+=d);let b=!z(o)&&!h?o:f,v=i.getPixelForValue(b);if(this.chart.getDataVisibility(t)?m=i.getPixelForValue(f+u):m=v,g=m-v,Math.abs(g)<r){g=Fh(g,i,a)*r,d===a&&(v-=g/2);let w=i.getPixelForDecimal(0),M=i.getPixelForDecimal(1),p=Math.min(w,M),_=Math.max(w,M);v=Math.max(Math.min(v,_),p),m=v+g,n&&!h&&(l._stacks[i.axis]._visualValues[s]=i.getValueForPixel(m)-i.getValueForPixel(v))}if(v===i.getPixelForValue(a)){let w=At(g)*i.getLineWidthForValue(a)/2;v+=w,g-=w}return{size:g,base:v,head:m,center:m+g/2}}_calculateBarIndexPixels(t,i){let n=i.scale,s=this.options,o=s.skipNull,r=R(s.maxBarThickness,1/0),a,l;if(i.grouped){let c=o?this._getStackCount(t):i.stackCount,h=s.barThickness==="flex"?Rh(t,i,s,c):Lh(t,i,s,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=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(r,i.min*i.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){let t=this._cachedMeta,i=t.vScale,n=t.data,s=n.length,o=0;for(;o<s;++o)this.getParsed(o)[i.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}};E(Ce,"id","bar"),E(Ce,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),E(Ce,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});var Ae=class extends ge{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let i=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=i,r=this.chart._animationsDisabled,{start:a,count:l}=ar(i,s,r);this._drawStart=a,this._drawCount=l,lr(i)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,i,n,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(i,s),f=r.axis,u=a.axis,{spanGaps:m,segment:g}=this.options,b=ei(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||o||s==="none",w=i+n,M=t.length,p=i>0&&this.getParsed(i-1);for(let _=0;_<M;++_){let y=t[_],S=v?y:{};if(_<i||_>=w){S.skip=!0;continue}let k=this.getParsed(_),P=z(k[u]),C=S[f]=r.getPixelForValue(k[f],_),O=S[u]=o||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[u],_);S.skip=isNaN(C)||isNaN(O)||P,S.stop=_>0&&Math.abs(k[f]-p[f])>b,g&&(S.parsed=k,S.raw=c.data[_]),d&&(S.options=h||this.resolveDataElementOptions(_,y.active?"active":s)),v||this.updateElement(y,_,S,s),p=k}}getMaxOverflow(){let t=this._cachedMeta,i=t.dataset,n=i.options&&i.options.borderWidth||0,s=t.data||[];if(!s.length)return n;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};E(Ae,"id","line"),E(Ae,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),E(Ae,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function De(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Ii=class{static override(t){Object.assign(Ii.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return De()}parse(){return De()}format(){return De()}add(){return De()}diff(){return De()}startOf(){return De()}endOf(){return De()}},Wh={_date:Ii};function Hh(e,t,i,n){let{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let l=a._reversePixels?er:le;if(n){if(s._sharedOptions){let c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){let d=l(o,t,i-h),f=l(o,t,i+h);return{lo:d.lo,hi:f.hi}}}}else return l(o,t,i)}return{lo:0,hi:o.length-1}}function Ni(e,t,i,n,s){let o=e.getSortedVisibleDatasetMetas(),r=i[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:h}=o[a],{lo:d,hi:f}=Hh(o[a],t,r,s);for(let u=d;u<=f;++u){let m=h[u];m.skip||n(m,c,u)}}}function jh(e){let t=e.indexOf("x")!==-1,i=e.indexOf("y")!==-1;return function(n,s){let o=t?Math.abs(n.x-s.x):0,r=i?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Ws(e,t,i,n,s){let o=[];return!s&&!e.isPointInArea(t)||Ni(e,i,t,function(a,l,c){!s&&!Nt(a,e.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function $h(e,t,i,n){let s=[];function o(r,a,l){let{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],n),{angle:d}=Qo(r,{x:t.x,y:t.y});vs(d,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return Ni(e,i,t,o),s}function Uh(e,t,i,n,s,o){let r=[],a=jh(i),l=Number.POSITIVE_INFINITY;function c(h,d,f){let u=h.inRange(t.x,t.y,s);if(n&&!u)return;let m=h.getCenterPoint(s);if(!(!!o||e.isPointInArea(m))&&!u)return;let b=a(t,m);b<l?(r=[{element:h,datasetIndex:d,index:f}],l=b):b===l&&r.push({element:h,datasetIndex:d,index:f})}return Ni(e,i,t,c),r}function Hs(e,t,i,n,s,o){return!o&&!e.isPointInArea(t)?[]:i==="r"&&!n?$h(e,t,i,s):Uh(e,t,i,n,s,o)}function Fr(e,t,i,n,s){let o=[],r=i==="x"?"inXRange":"inYRange",a=!1;return Ni(e,i,t,(l,c,h)=>{l[r]&&l[r](t[i],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}var Yh={evaluateInteractionItems:Ni,modes:{index(e,t,i,n){let s=ue(t,e),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?Ws(e,s,o,n,r):Hs(e,s,o,!1,n,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(e,t,i,n){let s=ue(t,e),o=i.axis||"xy",r=i.includeInvisible||!1,a=i.intersect?Ws(e,s,o,n,r):Hs(e,s,o,!1,n,r);if(a.length>0){let 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,i,n){let s=ue(t,e),o=i.axis||"xy",r=i.includeInvisible||!1;return Ws(e,s,o,n,r)},nearest(e,t,i,n){let s=ue(t,e),o=i.axis||"xy",r=i.includeInvisible||!1;return Hs(e,s,o,i.intersect,n,r)},x(e,t,i,n){let s=ue(t,e);return Fr(e,s,"x",i.intersect,n)},y(e,t,i,n){let s=ue(t,e);return Fr(e,s,"y",i.intersect,n)}}},ya=["left","top","right","bottom"];function Di(e,t){return e.filter(i=>i.pos===t)}function Br(e,t){return e.filter(i=>ya.indexOf(i.pos)===-1&&i.box.axis===t)}function Ti(e,t){return e.sort((i,n)=>{let s=t?n:i,o=t?i:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Xh(e){let t=[],i,n,s,o,r,a;for(i=0,n=(e||[]).length;i<n;++i)s=e[i],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:i,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function qh(e){let t={};for(let i of e){let{stack:n,pos:s,stackWeight:o}=i;if(!n||!ya.includes(s))continue;let r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Kh(e,t){let i=qh(e),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=i[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=h?h*s:l&&t.availableHeight)}return i}function Gh(e){let t=Xh(e),i=Ti(t.filter(c=>c.box.fullSize),!0),n=Ti(Di(t,"left"),!0),s=Ti(Di(t,"right")),o=Ti(Di(t,"top"),!0),r=Ti(Di(t,"bottom")),a=Br(t,"x"),l=Br(t,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Di(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Nr(e,t,i,n){return Math.max(e[i],t[i])+Math.max(e[n],t[n])}function _a(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 Jh(e,t,i,n){let{pos:s,box:o}=i,r=e.maxPadding;if(!N(s)){i.size&&(e[s]-=i.size);let d=n[i.stack]||{size:0,count:1};d.size=Math.max(d.size,i.horizontal?o.height:o.width),i.size=d.size/d.count,e[s]+=i.size}o.getPadding&&_a(r,o.getPadding());let a=Math.max(0,t.outerWidth-Nr(r,e,"left","right")),l=Math.max(0,t.outerHeight-Nr(r,e,"top","bottom")),c=a!==e.w,h=l!==e.h;return e.w=a,e.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function Zh(e){let t=e.maxPadding;function i(n){let s=Math.max(t[n]-e[n],0);return e[n]+=s,s}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}function Qh(e,t){let i=t.maxPadding;function n(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],i[r])}),o}return n(e?["left","right"]:["top","bottom"])}function Ei(e,t,i,n){let s=[],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,Qh(a.horizontal,t));let{same:d,other:f}=Jh(t,i,a,n);c|=d&&s.length,h=h||f,l.fullSize||s.push(a)}return c&&Ei(s,t,i,n)||h}function Cn(e,t,i,n,s){e.top=i,e.left=t,e.right=t+n,e.bottom=i+s,e.width=n,e.height=s}function zr(e,t,i,n){let s=i.padding,{x:o,y:r}=t;for(let a of e){let l=a.box,c=n[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){let d=t.w*h,f=c.size||l.height;Qe(c.start)&&(r=c.start),l.fullSize?Cn(l,s.left,r,i.outerWidth-s.right-s.left,f):Cn(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{let d=t.h*h,f=c.size||l.width;Qe(c.start)&&(o=c.start),l.fullSize?Cn(l,o,s.top,f,i.outerHeight-s.bottom-s.top):Cn(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var me={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(i){t.draw(i)}}]},e.boxes.push(t)},removeBox(e,t){let i=e.boxes?e.boxes.indexOf(t):-1;i!==-1&&e.boxes.splice(i,1)},configure(e,t,i){t.fullSize=i.fullSize,t.position=i.position,t.weight=i.weight},update(e,t,i,n){if(!e)return;let s=dt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(i-s.height,0),a=Gh(e.boxes),l=a.vertical,c=a.horizontal;V(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});let h=l.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},s);_a(f,dt(n));let u=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),m=Kh(l.concat(c),d);Ei(a.fullSize,u,d,m),Ei(l,u,d,m),Ei(c,u,d,m)&&Ei(l,u,d,m),Zh(u),zr(a.leftAndTop,u,d,m),u.x+=u.w,u.y+=u.h,zr(a.rightAndBottom,u,d,m),e.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},V(a.chartArea,g=>{let b=g.box;Object.assign(b,e.chartArea),b.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}},Wn=class{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,n){}removeEventListener(t,i,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,n,s){return i=Math.max(0,i||t.width),n=n||t.height,{width:i,height:Math.max(0,s?Math.floor(i/s):n)}}isAttached(t){return!0}updateConfig(t){}},qs=class extends Wn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Nn="$chartjs",td={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vr=e=>e===null||e==="";function ed(e,t){let i=e.style,n=e.getAttribute("height"),s=e.getAttribute("width");if(e[Nn]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Vr(s)){let o=Rs(e,"width");o!==void 0&&(e.width=o)}if(Vr(n))if(e.style.height==="")e.height=e.width/(t||2);else{let o=Rs(e,"height");o!==void 0&&(e.height=o)}return e}var wa=yr?{passive:!0}:!1;function id(e,t,i){e&&e.addEventListener(t,i,wa)}function nd(e,t,i){e&&e.canvas&&e.canvas.removeEventListener(t,i,wa)}function sd(e,t){let i=td[e.type]||e.type,{x:n,y:s}=ue(e,t);return{type:i,chart:t,native:e,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Hn(e,t){for(let i of e)if(i===t||i.contains(t))return!0}function od(e,t,i){let n=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||Hn(a.addedNodes,n),r=r&&!Hn(a.removedNodes,n);r&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function rd(e,t,i){let n=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||Hn(a.removedNodes,n),r=r&&!Hn(a.addedNodes,n);r&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}var Fi=new Map,Wr=0;function Ma(){let e=window.devicePixelRatio;e!==Wr&&(Wr=e,Fi.forEach((t,i)=>{i.currentDevicePixelRatio!==e&&t()}))}function ad(e,t){Fi.size||window.addEventListener("resize",Ma),Fi.set(e,t)}function ld(e){Fi.delete(e),Fi.size||window.removeEventListener("resize",Ma)}function cd(e,t,i){let n=e.canvas,s=n&&Dn(n);if(!s)return;let o=ws((a,l)=>{let c=s.clientWidth;i(a,l),c<s.clientWidth&&i()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),ad(e,o),r}function js(e,t,i){i&&i.disconnect(),t==="resize"&&ld(e)}function hd(e,t,i){let n=e.canvas,s=ws(o=>{e.ctx!==null&&i(sd(o,e))},e);return id(n,t,s),s}var Ks=class extends Wn{acquireContext(t,i){let n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(ed(t,i),n):null}releaseContext(t){let i=t.canvas;if(!i[Nn])return!1;let n=i[Nn].initial;["height","width"].forEach(o=>{let r=n[o];z(r)?i.removeAttribute(o):i.setAttribute(o,r)});let s=n.style||{};return Object.keys(s).forEach(o=>{i.style[o]=s[o]}),i.width=i.width,delete i[Nn],!0}addEventListener(t,i,n){this.removeEventListener(t,i);let s=t.$proxies||(t.$proxies={}),r={attach:od,detach:rd,resize:cd}[i]||hd;s[i]=r(t,i,n)}removeEventListener(t,i){let n=t.$proxies||(t.$proxies={}),s=n[i];if(!s)return;({attach:js,detach:js,resize:js}[i]||nd)(t,i,s),n[i]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,n,s){return xr(t,i,n,s)}isAttached(t){let i=t&&Dn(t);return!!(i&&i.isConnected)}};function dd(e){return!Pn()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?qs:Ks}var Et=class{x;y;active=!1;options;$animations;tooltipPosition(t){let{x:i,y:n}=this.getProps(["x","y"],t);return{x:i,y:n}}hasValue(){return ei(this.x)&&ei(this.y)}getProps(t,i){let n=this.$animations;if(!i||!n)return this;let s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}};E(Et,"defaults",{}),E(Et,"defaultRoutes");function fd(e,t){let i=e.options.ticks,n=ud(e),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?gd(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return md(t,c,o,r/s),c;let h=pd(o,t,s);if(r>0){let d,f,u=r>1?Math.round((l-a)/(r-1)):null;for(An(t,c,h,z(u)?0:a-u,a),d=0,f=r-1;d<f;d++)An(t,c,h,o[d],o[d+1]);return An(t,c,h,l,z(u)?t.length:l+u),c}return An(t,c,h),c}function ud(e){let t=e.options.offset,i=e._tickSize(),n=e._length/i+(t?0:1),s=e._maxLength/i;return Math.floor(Math.min(n,s))}function pd(e,t,i){let n=bd(e),s=t.length/i;if(!n)return Math.max(s,1);let o=Jo(n);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function gd(e){let t=[],i,n;for(i=0,n=e.length;i<n;i++)e[i].major&&t.push(i);return t}function md(e,t,i,n){let s=0,o=i[0],r;for(n=Math.ceil(n),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=i[s*n])}function An(e,t,i,n,s){let o=R(n,0),r=Math.min(R(s,e.length),e.length),a=0,l,c,h;for(i=Math.ceil(i),s&&(l=s-n,i=l/Math.floor(l/i)),h=o;h<0;)a++,h=Math.round(o+a*i);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(e[c]),a++,h=Math.round(o+a*i))}function bd(e){let t=e.length,i,n;if(t<2)return!1;for(n=e[0],i=1;i<t;++i)if(e[i]-e[i-1]!==n)return!1;return n}var vd=e=>e==="left"?"right":e==="right"?"left":e,Hr=(e,t,i)=>t==="top"||t==="left"?e[t]+i:e[t]-i,jr=(e,t)=>Math.min(t||e,e);function $r(e,t){let i=[],n=e.length/t,s=e.length,o=0;for(;o<s;o+=n)i.push(e[Math.floor(o)]);return i}function xd(e,t,i){let n=e.ticks.length,s=Math.min(t,n-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(i&&(n===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function yd(e,t){V(e,i=>{let n=i.gc,s=n.length/2,o;if(s>t){for(o=0;o<s;++o)delete i.data[n[o]];n.splice(0,s)}})}function Ci(e){return e.drawTicks?e.tickLength:0}function Ur(e,t){if(!e.display)return 0;let i=it(e.font,t),n=dt(e.padding);return(U(e.text)?e.text.length:1)*i.lineHeight+n.height}function _d(e,t){return Kt(e,{scale:t,type:"scale"})}function wd(e,t,i){return Kt(e,{tick:i,index:t,type:"tick"})}function Md(e,t,i){let n=Ms(e);return(i&&t!=="right"||!i&&t==="right")&&(n=vd(n)),n}function Sd(e,t,i,n){let{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:h}=l,d=0,f,u,m,g=r-s,b=a-o;if(e.isHorizontal()){if(u=xt(n,o,a),N(i)){let v=Object.keys(i)[0],w=i[v];m=h[v].getPixelForValue(w)+g-t}else i==="center"?m=(c.bottom+c.top)/2+g-t:m=Hr(e,i,t);f=a-o}else{if(N(i)){let v=Object.keys(i)[0],w=i[v];u=h[v].getPixelForValue(w)-b+t}else i==="center"?u=(c.left+c.right)/2-b+t:u=Hr(e,i,t);m=xt(n,r,s),d=i==="left"?-mt:mt}return{titleX:u,titleY:m,maxWidth:f,rotation:d}}var Zt=class extends Et{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,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:n,_suggestedMax:s}=this;return t=vt(t,Number.POSITIVE_INFINITY),i=vt(i,Number.NEGATIVE_INFINITY),n=vt(n,Number.POSITIVE_INFINITY),s=vt(s,Number.NEGATIVE_INFINITY),{min:vt(t,n),max:vt(i,s),minDefined:Q(t),maxDefined:Q(i)}}getMinMax(t){let{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:i,max:n};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(i=Math.min(i,r.min)),o||(n=Math.max(n,r.max));return i=o&&i>n?n:i,n=s&&i>n?i:n,{min:vt(i,vt(n,i)),max:vt(n,vt(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){j(this.options.beforeUpdate,[this])}update(t,i,n){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ur(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?$r(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=fd(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,i,n;this.isHorizontal()?(i=this.left,n=this.right):(i=this.top,n=this.bottom,t=!t),this._startPixel=i,this._endPixel=n,this._reversePixels=t,this._length=n-i,this._alignToPixels=this.options.alignToPixels}afterUpdate(){j(this.options.afterUpdate,[this])}beforeSetDimensions(){j(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(){j(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),j(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){j(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let i=this.options.ticks,n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=j(i.callback,[o.value,n,t],this)}afterTickToLabelConversion(){j(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){j(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,i=t.ticks,n=jr(this.ticks.length,t.ticks.maxTicksLimit),s=i.minRotation||0,o=i.maxRotation,r=s,a,l,c;if(!this._isVisible()||!i.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}let h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=bt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/n:u/(n-1),d+6>a&&(a=u/(n-(t.offset?.5:1)),l=this.maxHeight-Ci(t.grid)-i.padding-Ur(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=xn(Math.min(Math.asin(bt((h.highest.height+6)/a,-1,1)),Math.asin(bt(l/c,-1,1))-Math.asin(bt(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){j(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){j(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:i,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Ur(s,i.options.font);if(a?(t.width=this.maxWidth,t.height=Ci(o)+l):(t.height=this.maxHeight,t.width=Ci(o)+l),n.display&&this.ticks.length){let{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=n.padding*2,m=qt(this.labelRotation),g=Math.cos(m),b=Math.sin(m);if(a){let v=n.mirror?0:b*d.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+v+u)}else{let v=n.mirror?0:g*d.width+b*f.height;t.width=Math.min(this.maxWidth,t.width+v+u)}this._calculatePadding(c,h,b,g)}}this._handleMargins(),a?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,n,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),f=0,u=0;l?c?(f=s*t.width,u=n*i.height):(f=n*t.height,u=s*i.width):o==="start"?u=i.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=i.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+r)*this.width/(this.width-d),0)}else{let h=i.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=i.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(){j(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:i}=this.options;return i==="top"||i==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let i,n;for(i=0,n=t.length;i<n;i++)z(t[i].label)&&(t.splice(i,1),n--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let i=this.options.ticks.sampleSize,n=this.ticks;i<n.length&&(n=$r(n,i)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,n){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(i/jr(i,n)),c=0,h=0,d,f,u,m,g,b,v,w,M,p,_;for(d=0;d<i;d+=l){if(m=t[d].label,g=this._resolveTickFontOptions(d),s.font=b=g.string,v=o[b]=o[b]||{data:{},gc:[]},w=g.lineHeight,M=p=0,!z(m)&&!U(m))M=Mi(s,v.data,v.gc,M,m),p=w;else if(U(m))for(f=0,u=m.length;f<u;++f)_=m[f],!z(_)&&!U(_)&&(M=Mi(s,v.data,v.gc,M,_),p+=w);r.push(M),a.push(p),c=Math.max(M,c),h=Math.max(p,h)}yd(o,i);let y=r.indexOf(c),S=a.indexOf(h),k=P=>({width:r[P]||0,height:a[P]||0});return{first:k(0),last:k(i-1),widest:k(y),highest:k(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){let i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let i=this._startPixel+t*this._length;return tr(this._alignToPixels?de(this.chart,i,0):i)}getDecimalForPixel(t){let i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){let i=this.ticks||[];if(t>=0&&t<i.length){let n=i[t];return n.$context||(n.$context=wd(this.getContext(),t,n))}return this.$context||(this.$context=_d(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,i=qt(this.labelRotation),n=Math.abs(Math.cos(i)),s=Math.abs(Math.sin(i)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let i=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ci(o),u=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,b=g/2,v=function(F){return de(n,F,g)},w,M,p,_,y,S,k,P,C,O,T,L;if(r==="top")w=v(this.bottom),S=this.bottom-f,P=w-b,O=v(t.top)+b,L=t.bottom;else if(r==="bottom")w=v(this.top),O=t.top,L=v(t.bottom)-b,S=w+b,P=this.top+f;else if(r==="left")w=v(this.right),y=this.right-f,k=w-b,C=v(t.left)+b,T=t.right;else if(r==="right")w=v(this.left),C=t.left,T=v(t.right)-b,y=w+b,k=this.left+f;else if(i==="x"){if(r==="center")w=v((t.top+t.bottom)/2+.5);else if(N(r)){let F=Object.keys(r)[0],W=r[F];w=v(this.chart.scales[F].getPixelForValue(W))}O=t.top,L=t.bottom,S=w+b,P=S+f}else if(i==="y"){if(r==="center")w=v((t.left+t.right)/2);else if(N(r)){let F=Object.keys(r)[0],W=r[F];w=v(this.chart.scales[F].getPixelForValue(W))}y=w-b,k=y-f,C=t.left,T=t.right}let $=R(s.ticks.maxTicksLimit,d),I=Math.max(1,Math.ceil(d/$));for(M=0;M<d;M+=I){let F=this.getContext(M),W=o.setContext(F),q=a.setContext(F),ft=W.lineWidth,ot=W.color,St=q.dash||[],rt=q.dashOffset,wt=W.tickWidth,at=W.tickColor,lt=W.tickBorderDash||[],ct=W.tickBorderDashOffset;p=xd(this,M,l),p!==void 0&&(_=de(n,p,ft),c?y=k=C=T=_:S=P=O=L=_,u.push({tx1:y,ty1:S,tx2:k,ty2:P,x1:C,y1:O,x2:T,y2:L,width:ft,color:ot,borderDash:St,borderDashOffset:rt,tickWidth:wt,tickColor:at,tickBorderDash:lt,tickBorderDashOffset:ct}))}return this._ticksLength=d,this._borderValue=w,u}_computeLabelItems(t){let i=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Ci(n.grid),u=f+h,m=d?-h:u,g=-qt(this.labelRotation),b=[],v,w,M,p,_,y,S,k,P,C,O,T,L="middle";if(s==="top")y=this.bottom-m,S=this._getXAxisLabelAlignment();else if(s==="bottom")y=this.top+m,S=this._getXAxisLabelAlignment();else if(s==="left"){let I=this._getYAxisLabelAlignment(f);S=I.textAlign,_=I.x}else if(s==="right"){let I=this._getYAxisLabelAlignment(f);S=I.textAlign,_=I.x}else if(i==="x"){if(s==="center")y=(t.top+t.bottom)/2+u;else if(N(s)){let I=Object.keys(s)[0],F=s[I];y=this.chart.scales[I].getPixelForValue(F)+u}S=this._getXAxisLabelAlignment()}else if(i==="y"){if(s==="center")_=(t.left+t.right)/2-u;else if(N(s)){let I=Object.keys(s)[0],F=s[I];_=this.chart.scales[I].getPixelForValue(F)}S=this._getYAxisLabelAlignment(f).textAlign}i==="y"&&(l==="start"?L="top":l==="end"&&(L="bottom"));let $=this._getLabelSizes();for(v=0,w=a.length;v<w;++v){M=a[v],p=M.label;let I=o.setContext(this.getContext(v));k=this.getPixelForTick(v)+o.labelOffset,P=this._resolveTickFontOptions(v),C=P.lineHeight,O=U(p)?p.length:1;let F=O/2,W=I.color,q=I.textStrokeColor,ft=I.textStrokeWidth,ot=S;r?(_=k,S==="inner"&&(v===w-1?ot=this.options.reverse?"left":"right":v===0?ot=this.options.reverse?"right":"left":ot="center"),s==="top"?c==="near"||g!==0?T=-O*C+C/2:c==="center"?T=-$.highest.height/2-F*C+C:T=-$.highest.height+C/2:c==="near"||g!==0?T=C/2:c==="center"?T=$.highest.height/2-F*C:T=$.highest.height-O*C,d&&(T*=-1),g!==0&&!I.showLabelBackdrop&&(_+=C/2*Math.sin(g))):(y=k,T=(1-O)*C/2);let St;if(I.showLabelBackdrop){let rt=dt(I.backdropPadding),wt=$.heights[v],at=$.widths[v],lt=T-rt.top,ct=0-rt.left;switch(L){case"middle":lt-=wt/2;break;case"bottom":lt-=wt;break}switch(S){case"center":ct-=at/2;break;case"right":ct-=at;break;case"inner":v===w-1?ct-=at:v>0&&(ct-=at/2);break}St={left:ct,top:lt,width:at+rt.width,height:wt+rt.height,color:I.backdropColor}}b.push({label:p,font:P,textOffset:T,options:{rotation:g,color:W,strokeColor:q,strokeWidth:ft,textAlign:ot,textBaseline:L,translation:[_,y],backdrop:St}})}return b}_getXAxisLabelAlignment(){let{position:t,ticks:i}=this.options;if(-qt(this.labelRotation))return t==="top"?"left":"right";let s="center";return i.align==="start"?s="left":i.align==="end"?s="right":i.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:i,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,h;return i==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):i==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,i=this.options.position;if(i==="left"||i==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(i==="top"||i==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:i},left:n,top:s,width:o,height:r}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){let i=this.options.grid;if(!this._isVisible()||!i.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?i.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let i=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(i.display)for(o=0,r=s.length;o<r;++o){let l=s[o];i.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),i.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(){let{chart:t,ctx:i,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),r=n.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,h,d,f;this.isHorizontal()?(c=de(t,this.left,r)-r/2,h=de(t,this.right,a)+a/2,d=f=l):(d=de(t,this.top,r)-r/2,f=de(t,this.bottom,a)+a/2,c=h=l),i.save(),i.lineWidth=o.width,i.strokeStyle=o.color,i.beginPath(),i.moveTo(c,d),i.lineTo(h,f),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;let n=this.ctx,s=this._computeLabelArea();s&&Sn(n,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,h=r.textOffset;Oe(n,c,0,h,l,a)}s&&kn(n)}drawTitle(){let{ctx:t,options:{position:i,title:n,reverse:s}}=this;if(!n.display)return;let o=it(n.font),r=dt(n.padding),a=n.align,l=o.lineHeight/2;i==="bottom"||i==="center"||N(i)?(l+=r.bottom,U(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;let{titleX:c,titleY:h,maxWidth:d,rotation:f}=Sd(this,l,i,a);Oe(t,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:f,textAlign:Md(a,i,s),textBaseline:"middle",translation:[c,h]})}draw(t){!this._isVisible()||(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,i=t.ticks&&t.ticks.z||0,n=R(t.grid&&t.grid.z,-1),s=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Zt.prototype.draw?[{z:i,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:i,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let i=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[],o,r;for(o=0,r=i.length;o<r;++o){let a=i[o];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let i=this.options.ticks.setContext(this.getContext(t));return it(i.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},si=class{constructor(t,i,n){this.type=t,this.scope=i,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let i=Object.getPrototypeOf(t),n;Pd(i)&&(n=this.register(i));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,kd(t,r,n),this.override&&Y.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let i=this.items,n=t.id,s=this.scope;n in i&&delete i[n],s&&n in Y[s]&&(delete Y[s][n],this.override&&delete he[n])}};function kd(e,t,i){let n=Ge(Object.create(null),[i?Y.get(i):{},Y.get(t),e.defaults]);Y.set(t,n),e.defaultRoutes&&Od(t,e.defaultRoutes),e.descriptors&&Y.describe(t,e.descriptors)}function Od(e,t){Object.keys(t).forEach(i=>{let n=i.split("."),s=n.pop(),o=[e].concat(n).join("."),r=t[i].split("."),a=r.pop(),l=r.join(".");Y.route(o,s,l,a)})}function Pd(e){return"id"in e&&"defaults"in e}var Gs=class{constructor(){this.controllers=new si(ge,"datasets",!0),this.elements=new si(Et,"elements"),this.plugins=new si(Object,"plugins"),this.scales=new si(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,i,n){[...i].forEach(s=>{let o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):V(s,r=>{let a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,i,n){let s=vn(t);j(n["before"+s],[],n),i[t](n),j(n["after"+s],[],n)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){let n=this._typedRegistries[i];if(n.isForType(t))return n}return this.plugins}_get(t,i,n){let s=i.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}},Wt=new Gs,Js=class{constructor(){this._init=[]}notify(t,i,n,s){i==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,i,n);return i==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,i,n,s){s=s||{};for(let o of t){let r=o.plugin,a=r[n],l=[i,s,o.options];if(j(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){let n=t&&t.config,s=R(n.options&&n.options.plugins,{}),o=Dd(n);return s===!1&&!i?[]:Cd(t,o,s,i)}_notifyStateChanges(t){let i=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(i,n),t,"stop"),this._notify(s(n,i),t,"start")}};function Dd(e){let t={},i=[],n=Object.keys(Wt.plugins.items);for(let o=0;o<n.length;o++)i.push(Wt.getPlugin(n[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];i.indexOf(r)===-1&&(i.push(r),t[r.id]=!0)}return{plugins:i,localIds:t}}function Td(e,t){return!t&&e===!1?null:e===!0?{}:e}function Cd(e,{plugins:t,localIds:i},n,s){let o=[],r=e.getContext();for(let a of t){let l=a.id,c=Td(n[l],s);c!==null&&o.push({plugin:a,options:Ad(e.config,{plugin:a,local:i[l]},c,r)})}return o}function Ad(e,{plugin:t,local:i},n,s){let o=e.pluginScopeKeys(t),r=e.getOptionScopes(n,o);return i&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zs(e,t){let i=Y.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||i.indexAxis||"x"}function Ed(e,t){let i=e;return e==="_index_"?i=t:e==="_value_"&&(i=t==="x"?"y":"x"),i}function Ld(e,t){return e===t?"_index_":"_value_"}function Yr(e){if(e==="x"||e==="y"||e==="r")return e}function Rd(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Qs(e,...t){if(Yr(e))return e;for(let i of t){let n=i.axis||Rd(i.position)||e.length>1&&Yr(e[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Xr(e,t,i){if(i[t+"AxisID"]===e)return{axis:t}}function Id(e,t){if(t.data&&t.data.datasets){let i=t.data.datasets.filter(n=>n.xAxisID===e||n.yAxisID===e);if(i.length)return Xr(e,"x",i[0])||Xr(e,"y",i[0])}return{}}function Fd(e,t){let i=he[e.type]||{scales:{}},n=t.scales||{},s=Zs(e.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{let a=n[r];if(!N(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let l=Qs(r,a,Id(r,e),Y.scales[a.type]),c=Ld(l,s),h=i.scales||{};o[r]=Ze(Object.create(null),[{axis:l},a,h[l],h[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||Zs(a,t),h=(he[a]||{}).scales||{};Object.keys(h).forEach(d=>{let f=Ed(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Ze(o[u],[{axis:f},n[u],h[d]])})}),Object.keys(o).forEach(r=>{let a=o[r];Ze(a,[Y.scales[a.type],Y.scale])}),o}function Sa(e){let t=e.options||(e.options={});t.plugins=R(t.plugins,{}),t.scales=Fd(e,t)}function ka(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Bd(e){return e=e||{},e.data=ka(e.data),Sa(e),e}var qr=new Map,Oa=new Set;function En(e,t){let i=qr.get(e);return i||(i=t(),qr.set(e,i),Oa.add(i)),i}var Ai=(e,t,i)=>{let n=ke(t,i);n!==void 0&&e.add(n)},to=class{constructor(t){this._config=Bd(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=ka(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Sa(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return En(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,i){return En(`${t}.transition.${i}`,()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,i){return En(`${t}-${i}`,()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]])}pluginScopeKeys(t){let i=t.id,n=this.type;return En(`${n}-plugin-${i}`,()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,i){let n=this._scopeCache,s=n.get(t);return(!s||i)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,i,n){let{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(i);if(a)return a;let l=new Set;i.forEach(h=>{t&&(l.add(t),h.forEach(d=>Ai(l,t,d))),h.forEach(d=>Ai(l,s,d)),h.forEach(d=>Ai(l,he[o]||{},d)),h.forEach(d=>Ai(l,Y,d)),h.forEach(d=>Ai(l,wn,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Oa.has(i)&&r.set(i,c),c}chartOptionScopes(){let{options:t,type:i}=this;return[t,he[i]||{},Y.datasets[i]||{},{type:i},Y,wn]}resolveNamedOptions(t,i,n,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=Kr(this._resolverCache,t,s),l=r;if(zd(r,i)){o.$shared=!1,n=Yt(n)?n():n;let c=this.createResolver(t,n,a);l=Se(r,n,c)}for(let c of i)o[c]=l[c];return o}createResolver(t,i,n=[""],s){let{resolver:o}=Kr(this._resolverCache,t,n);return N(i)?Se(o,i,void 0,s):o}};function Kr(e,t,i){let n=e.get(t);n||(n=new Map,e.set(t,n));let s=i.join(),o=n.get(s);return o||(o={resolver:On(t,i),subPrefixes:i.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}var Nd=e=>N(e)&&Object.getOwnPropertyNames(e).some(t=>Yt(e[t]));function zd(e,t){let{isScriptable:i,isIndexable:n}=Cs(e);for(let s of t){let o=i(s),r=n(s),a=(r||o)&&e[s];if(o&&(Yt(a)||Nd(a))||r&&U(a))return!0}return!1}var Vd="4.4.7",Wd=["top","bottom","left","right","chartArea"];function Gr(e,t){return e==="top"||e==="bottom"||Wd.indexOf(e)===-1&&t==="x"}function Jr(e,t){return function(i,n){return i[e]===n[e]?i[t]-n[t]:i[e]-n[e]}}function Zr(e){let t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),j(i&&i.onComplete,[e],t)}function Hd(e){let t=e.chart,i=t.options.animation;j(i&&i.onProgress,[e],t)}function Pa(e){return Pn()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var zn={},Qr=e=>{let t=Pa(e);return Object.values(zn).filter(i=>i.canvas===t).pop()};function jd(e,t,i){let n=Object.keys(e);for(let s of n){let o=+s;if(o>=t){let r=e[s];delete e[s],(i>0||o>t)&&(e[o+i]=r)}}}function $d(e,t,i,n){return!i||e.type==="mouseout"?null:n?t:e}function Ln(e,t,i){return e.options.clip?e[i]:t[i]}function Ud(e,t){let{xScale:i,yScale:n}=e;return i&&n?{left:Ln(i,t,"left"),right:Ln(i,t,"right"),top:Ln(n,t,"top"),bottom:Ln(n,t,"bottom")}:t}var pt=class{static register(...t){Wt.add(...t),ta()}static unregister(...t){Wt.remove(...t),ta()}constructor(t,i){let n=this.config=new to(i),s=Pa(t),o=Qr(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||dd(s)),this.platform.updateConfig(n);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Xo(),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 Js,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=or(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],zn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Gt.listen(this,"complete",Zr),Gt.listen(this,"progress",Hd),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:i},width:n,height:s,_aspectRatio:o}=this;return z(t)?i&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Wt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ls(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Os(this.canvas,this.ctx),this}stop(){return Gt.stop(this),this}resize(t,i){Gt.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){let n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,i,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ls(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),j(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let i=this.options.scales||{};V(i,(n,s)=>{n.id=s})}buildOrUpdateScales(){let t=this.options,i=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{}),o=[];i&&(o=o.concat(Object.keys(i).map(r=>{let a=i[r],l=Qs(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),V(o,r=>{let a=r.options,l=a.id,c=Qs(l,a),h=R(a.type,r.dtype);(a.position===void 0||Gr(a.position,c)!==Gr(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in n&&n[l].type===h)d=n[l];else{let f=Wt.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(a,t)}),V(s,(r,a)=>{r||delete n[a]}),V(n,r=>{me.configure(this,r,r.options),me.addBox(this,r)})}_updateMetasets(){let t=this._metasets,i=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>i){for(let s=i;s<n;++s)this._destroyDatasetMeta(s);t.splice(i,n-i)}this._sortedMetasets=t.slice(0).sort(Jr("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach((n,s)=>{i.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],i=this.data.datasets,n,s;for(this._removeUnreferencedMetasets(),n=0,s=i.length;n<s;n++){let o=i[n],r=this.getDatasetMeta(n),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=a,r.indexAxis=o.indexAxis||Zs(a,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{let l=Wt.getController(a),{datasetElementType:c,dataElementType:h}=Y.datasets[a];Object.assign(l,{dataElementType:Wt.getElement(h),datasetElementType:c&&Wt.getElement(c)}),r.controller=new l(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){V(this.data.datasets,(t,i)=>{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let i=this.config;i.update();let n=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){let{controller:d}=this.getDatasetMeta(c),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||V(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Jr("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){V(this.scales,t=>{me.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,i=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!ps(i,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(let{method:n,start:s,count:o}of i){let r=n==="_removeElements"?-o:o;jd(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let i=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;o<i;o++)if(!ps(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;me.update(this,this.width,this.height,t);let i=this.chartArea,n=i.width<=0||i.height<=0;this._layers=[],V(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let i=0,n=this.data.datasets.length;i<n;++i)this.getDatasetMeta(i).controller.configure();for(let i=0,n=this.data.datasets.length;i<n;++i)this._updateDataset(i,Yt(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){let n=this.getDatasetMeta(t),s={meta:n,index:t,mode:i,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(i),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Gt.has(this)?this.attached&&!Gt.running(this)&&Gt.start(this):(this.draw(),Zr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let i=this._sortedMetasets,n=[],s,o;for(s=0,o=i.length;s<o;++s){let r=i[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let i=this.ctx,n=t._clip,s=!n.disabled,o=Ud(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&Sn(i,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&kn(i),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Nt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,n,s){let o=Yh.modes[i];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){let i=this.data.datasets[t],n=this._metasets,s=n.filter(o=>o&&o._dataset===i).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Kt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let i=this.data.datasets[t];if(!i)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!i.hidden}setDatasetVisibility(t,i){let n=this.getDatasetMeta(t);n.hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,n){let s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Qe(i)?(o.data[i].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){let i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),Gt.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Os(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete zn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,i=this.platform,n=(o,r)=>{i.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};V(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,i=this.platform,n=(l,c)=>{i.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(i.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},r,a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",a)},i.isAttached(this.canvas)?a():r()}unbindEvents(){V(this._listeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._listeners={},V(this._responsiveListeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,i,n){let s=n?"set":"remove",o,r,a,l;for(i==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let i=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Si(n,i)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,i))}notifyPlugins(t,i,n){return this._plugins.notify(this,t,i,n)}isPluginEnabled(t){return this._plugins._cache.filter(i=>i.plugin.id===t).length===1}_updateHoverStyles(t,i,n){let s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(i,t),a=n?t:o(t,i);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,i){let n={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;let o=this._handleEvent(t,i,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,i,n){let{_active:s=[],options:o}=this,r=i,a=this._getActiveElements(t,s,n,r),l=Go(t),c=$d(t,this._lastEvent,n,l);n&&(this._lastEvent=null,j(o.onHover,[t,a,this],this),l&&j(o.onClick,[t,a,this],this));let h=!Si(a,s);return(h||i)&&(this._active=a,this._updateHoverStyles(a,s,i)),this._lastEvent=c,h}_getActiveElements(t,i,n,s){if(t.type==="mouseout")return[];if(!n)return i;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};E(pt,"defaults",Y),E(pt,"instances",zn),E(pt,"overrides",he),E(pt,"registry",Wt),E(pt,"version",Vd),E(pt,"getChart",Qr);function ta(){return V(pt.instances,e=>e._plugins.invalidate())}function Da(e,t,i=t){e.lineCap=R(i.borderCapStyle,t.borderCapStyle),e.setLineDash(R(i.borderDash,t.borderDash)),e.lineDashOffset=R(i.borderDashOffset,t.borderDashOffset),e.lineJoin=R(i.borderJoinStyle,t.borderJoinStyle),e.lineWidth=R(i.borderWidth,t.borderWidth),e.strokeStyle=R(i.borderColor,t.borderColor)}function Yd(e,t,i){e.lineTo(i.x,i.y)}function Xd(e){return e.stepped?dr:e.tension||e.cubicInterpolationMode==="monotone"?fr:Yd}function Ta(e,t,i={}){let n=e.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function qd(e,t,i,n){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Ta(s,i,n),h=Xd(o),{move:d=!0,reverse:f}=n||{},u,m,g;for(u=0;u<=c;++u)m=s[(a+(f?c-u:u))%r],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):h(e,g,m,f,o.stepped),g=m);return l&&(m=s[(a+(f?c:0))%r],h(e,g,m,f,o.stepped)),!!l}function Kd(e,t,i,n){let s=t.points,{count:o,start:r,ilen:a}=Ta(s,i,n),{move:l=!0,reverse:c}=n||{},h=0,d=0,f,u,m,g,b,v,w=p=>(r+(c?a-p:p))%o,M=()=>{g!==b&&(e.lineTo(h,b),e.lineTo(h,g),e.lineTo(h,v))};for(l&&(u=s[w(0)],e.moveTo(u.x,u.y)),f=0;f<=a;++f){if(u=s[w(f)],u.skip)continue;let p=u.x,_=u.y,y=p|0;y===m?(_<g?g=_:_>b&&(b=_),h=(d*h+p)/++d):(M(),e.lineTo(p,_),m=y,d=0,g=b=_),v=_}M()}function eo(e){let t=e.options,i=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!i?Kd:qd}function Gd(e){return e.stepped?_r:e.tension||e.cubicInterpolationMode==="monotone"?wr:ae}function Jd(e,t,i,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,i,n)&&s.closePath()),Da(e,t.options),e.stroke(s)}function Zd(e,t,i,n){let{segments:s,options:o}=t,r=eo(t);for(let a of s)Da(e,o,a.style),e.beginPath(),r(e,t,a,{start:i,end:i+n-1})&&e.closePath(),e.stroke()}var Qd=typeof Path2D=="function";function tf(e,t,i,n){Qd&&!t.options.segment?Jd(e,t,i,n):Zd(e,t,i,n)}var pe=class extends Et{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,i){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let s=n.spanGaps?this._loop:this._fullLoop;vr(this._points,n,t,s,i),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=Or(this,this.options.segment))}first(){let t=this.segments,i=this.points;return t.length&&i[t[0].start]}last(){let t=this.segments,i=this.points,n=t.length;return n&&i[t[n-1].end]}interpolate(t,i){let n=this.options,s=t[i],o=this.points,r=kr(this,{property:i,start:s,end:s});if(!r.length)return;let a=[],l=Gd(n),c,h;for(c=0,h=r.length;c<h;++c){let{start:d,end:f}=r[c],u=o[d],m=o[f];if(u===m){a.push(u);continue}let g=Math.abs((s-u[i])/(m[i]-u[i])),b=l(u,m,g,n.stepped);b[i]=t[i],a.push(b)}return a.length===1?a[0]:a}pathSegment(t,i,n){return eo(this)(t,this,i,n)}path(t,i,n){let s=this.segments,o=eo(this),r=this._loop;i=i||0,n=n||this.points.length-i;for(let a of s)r&=o(t,this,a,{start:i,end:i+n-1});return!!r}draw(t,i,n,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),tf(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};E(pe,"id","line"),E(pe,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),E(pe,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),E(pe,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ea(e,t,i,n){let s=e.options,{[i]:o}=e.getProps([i],n);return Math.abs(t-o)<s.radius+s.hitRadius}var Ee=class extends Et{parsed;skip;stop;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,i,n){let s=this.options,{x:o,y:r}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(i-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,i){return ea(this,t,"x",i)}inYRange(t,i){return ea(this,t,"y",i)}getCenterPoint(t){let{x:i,y:n}=this.getProps(["x","y"],t);return{x:i,y:n}}size(t){t=t||this.options||{};let i=t.radius||0;i=Math.max(i,i&&t.hoverRadius||0);let n=i&&t.borderWidth||0;return(i+n)*2}draw(t,i){let n=this.options;this.skip||n.radius<.1||!Nt(this,i,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Mn(t,n,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};E(Ee,"id","point"),E(Ee,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),E(Ee,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ca(e,t){let{x:i,y:n,base:s,width:o,height:r}=e.getProps(["x","y","base","width","height"],t),a,l,c,h,d;return e.horizontal?(d=r/2,a=Math.min(i,s),l=Math.max(i,s),c=n-d,h=n+d):(d=o/2,a=i-d,l=i+d,c=Math.min(n,s),h=Math.max(n,s)),{left:a,top:c,right:l,bottom:h}}function be(e,t,i,n){return e?0:bt(t,i,n)}function ef(e,t,i){let n=e.options.borderWidth,s=e.borderSkipped,o=Ts(n);return{t:be(s.top,o.top,0,i),r:be(s.right,o.right,0,t),b:be(s.bottom,o.bottom,0,i),l:be(s.left,o.left,0,t)}}function nf(e,t,i){let{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=fe(s),r=Math.min(t,i),a=e.borderSkipped,l=n||N(s);return{topLeft:be(!l||a.top||a.left,o.topLeft,0,r),topRight:be(!l||a.top||a.right,o.topRight,0,r),bottomLeft:be(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:be(!l||a.bottom||a.right,o.bottomRight,0,r)}}function sf(e){let t=Ca(e),i=t.right-t.left,n=t.bottom-t.top,s=ef(e,i/2,n/2),o=nf(e,i/2,n/2);return{outer:{x:t.left,y:t.top,w:i,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:i-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function $s(e,t,i,n){let s=t===null,o=i===null,a=e&&!(s&&o)&&Ca(e,n);return a&&(s||ce(t,a.left,a.right))&&(o||ce(i,a.top,a.bottom))}function of(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function rf(e,t){e.rect(t.x,t.y,t.w,t.h)}function Us(e,t,i={}){let n=e.x!==i.x?-t:0,s=e.y!==i.y?-t:0,o=(e.x+e.w!==i.x+i.w?t:0)-n,r=(e.y+e.h!==i.y+i.h?t:0)-s;return{x:e.x+n,y:e.y+s,w:e.w+o,h:e.h+r,radius:e.radius}}var Le=class extends Et{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){let{inflateAmount:i,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:r}=sf(this),a=of(r.radius)?ii:rf;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Us(r,i,o)),t.clip(),a(t,Us(o,-i,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,Us(o,i)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,i,n){return $s(this,t,i,n)}inXRange(t,i){return $s(this,t,null,i)}inYRange(t,i){return $s(this,null,t,i)}getCenterPoint(t){let{x:i,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(i+s)/2:i,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};E(Le,"id","bar"),E(Le,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),E(Le,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ia=(e,t)=>{let{boxHeight:i=t,boxWidth:n=t}=e;return e.usePointStyle&&(i=Math.min(i,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(t,i)}},af=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,jn=class extends Et{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i,n){this.maxWidth=t,this.maxHeight=i,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},i=j(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter(n=>t.filter(n,this.chart.data))),t.sort&&(i=i.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){let{options:t,ctx:i}=this;if(!t.display){this.width=this.height=0;return}let n=t.labels,s=it(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ia(n,o),c,h;i.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,i,n,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a,d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((m,g)=>{let b=n+i/2+o.measureText(m.text).width;(g===0||c[c.length-1]+b+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,u+=h,f++),l[g]={left:0,top:u,row:f,width:b,height:s},c[c.length-1]+=b+a}),d}_fitCols(t,i,n,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t,d=a,f=0,u=0,m=0,g=0;return this.legendItems.forEach((b,v)=>{let{itemWidth:w,itemHeight:M}=lf(n,i,o,b,s);v>0&&u+M+2*a>h&&(d+=f+a,c.push({width:f,height:u}),m+=f+a,g++,f=u=0),l[v]={left:m,top:u,col:g,width:w,height:M},f=Math.max(f,w),u+=M+a}),d+=f,c.push({width:f,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:n,labels:{padding:s},rtl:o}}=this,r=Pe(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=xt(n,this.left+s,this.right-this.lineWidths[a]);for(let c of i)a!==c.row&&(a=c.row,l=xt(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=xt(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of i)c.col!==a&&(a=c.col,l=xt(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;Sn(t,this),this._draw(),kn(t)}}_draw(){let{options:t,columnSizes:i,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=Y.color,l=Pe(t.rtl,this.left,this.width),c=it(r.font),{padding:h}=r,d=c.size,f=d/2,u;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:m,boxHeight:g,itemHeight:b}=ia(r,d),v=function(y,S,k){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;s.save();let P=R(k.lineWidth,1);if(s.fillStyle=R(k.fillStyle,a),s.lineCap=R(k.lineCap,"butt"),s.lineDashOffset=R(k.lineDashOffset,0),s.lineJoin=R(k.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=R(k.strokeStyle,a),s.setLineDash(R(k.lineDash,[])),r.usePointStyle){let C={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:P},O=l.xPlus(y,m/2),T=S+f;Ps(s,C,O,T,r.pointStyleWidth&&m)}else{let C=S+Math.max((d-g)/2,0),O=l.leftForLtr(y,m),T=fe(k.borderRadius);s.beginPath(),Object.values(T).some(L=>L!==0)?ii(s,{x:O,y:C,w:m,h:g,radius:T}):s.rect(O,C,m,g),s.fill(),P!==0&&s.stroke()}s.restore()},w=function(y,S,k){Oe(s,k.text,y,S+b/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},M=this.isHorizontal(),p=this._computeTitleHeight();M?u={x:xt(o,this.left+h,this.right-n[0]),y:this.top+h+p,line:0}:u={x:this.left+h,y:xt(o,this.top+p+h,this.bottom-i[0].height),line:0},Is(this.ctx,t.textDirection);let _=b+h;this.legendItems.forEach((y,S)=>{s.strokeStyle=y.fontColor,s.fillStyle=y.fontColor;let k=s.measureText(y.text).width,P=l.textAlign(y.textAlign||(y.textAlign=r.textAlign)),C=m+f+k,O=u.x,T=u.y;l.setWidth(this.width),M?S>0&&O+C+h>this.right&&(T=u.y+=_,u.line++,O=u.x=xt(o,this.left+h,this.right-n[u.line])):S>0&&T+_>this.bottom&&(O=u.x=O+i[u.line].width+h,u.line++,T=u.y=xt(o,this.top+p+h,this.bottom-i[u.line].height));let L=l.x(O);if(v(L,T,y),O=rr(P,O+m+f,M?O+C:this.right,t.rtl),w(l.x(O),T,y),M)u.x+=C+h;else if(typeof y.text!="string"){let $=c.lineHeight;u.y+=Aa(y,$)+h}else u.y+=_}),Fs(this.ctx,t.textDirection)}drawTitle(){let t=this.options,i=t.title,n=it(i.font),s=dt(i.padding);if(!i.display)return;let o=Pe(t.rtl,this.left,this.width),r=this.ctx,a=i.position,l=n.size/2,c=s.top+l,h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=xt(t.align,d,this.right-f);else{let m=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);h=c+xt(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}let u=xt(a,d,d+f);r.textAlign=o.textAlign(Ms(a)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=n.string,Oe(r,i.text,u,h,n)}_computeTitleHeight(){let t=this.options.title,i=it(t.font),n=dt(t.padding);return t.display?i.lineHeight+n.height:0}_getLegendItemAt(t,i){let n,s,o;if(ce(t,this.left,this.right)&&ce(i,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],ce(t,s.left,s.left+s.width)&&ce(i,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){let i=this.options;if(!df(t.type,i))return;let n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=af(s,n);s&&!o&&j(i.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&j(i.onHover,[t,n,this],this)}else n&&j(i.onClick,[t,n,this],this)}};function lf(e,t,i,n,s){let o=cf(n,e,t,i),r=hf(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function cf(e,t,i,n){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+i.size/2+n.measureText(s).width}function hf(e,t,i){let n=e;return typeof t.text!="string"&&(n=Aa(t,i)),n}function Aa(e,t){let i=e.text?e.text.length:0;return t*i}function df(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Ea={id:"legend",_element:jn,start(e,t,i){let n=e.legend=new jn({ctx:e.ctx,options:i,chart:e});me.configure(e,n,i),me.addBox(e,n)},stop(e){me.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,i){let n=e.legend;me.configure(e,n,i),n.options=i},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,i){let n=t.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(i?0:void 0),h=dt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};var Li={average(e){if(!e.length)return!1;let t,i,n=new Set,s=0,o=0;for(t=0,i=e.length;t<i;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let i=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=mn(t,c);h<s&&(s=h,a=l)}}if(a){let l=a.tooltipPosition();i=l.x,n=l.y}return{x:i,y:n}}};function Vt(e,t){return t&&(U(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Jt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
`)>-1?e.split(`
`):e}function ff(e,t){let{element:i,datasetIndex:n,index:s}=t,o=e.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function na(e,t){let i=e.chart.ctx,{body:n,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=it(t.bodyFont),c=it(t.titleFont),h=it(t.footerFont),d=o.length,f=s.length,u=n.length,m=dt(t.padding),g=m.height,b=0,v=n.reduce((p,_)=>p+_.before.length+_.lines.length+_.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){let p=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=u*p+(v-u)*l.lineHeight+(v-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let w=0,M=function(p){b=Math.max(b,i.measureText(p).width+w)};return i.save(),i.font=c.string,V(e.title,M),i.font=l.string,V(e.beforeBody.concat(e.afterBody),M),w=t.displayColors?r+2+t.boxPadding:0,V(n,p=>{V(p.before,M),V(p.lines,M),V(p.after,M)}),w=0,i.font=h.string,V(e.footer,M),i.restore(),b+=m.width,{width:b,height:g}}function uf(e,t){let{y:i,height:n}=t;return i<n/2?"top":i>e.height-n/2?"bottom":"center"}function pf(e,t,i,n){let{x:s,width:o}=n,r=i.caretSize+i.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function gf(e,t,i,n){let{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=e,c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),pf(c,e,t,i)&&(c="center"),c}function sa(e,t,i){let n=i.yAlign||t.yAlign||uf(e,i);return{xAlign:i.xAlign||t.xAlign||gf(e,t,i,n),yAlign:n}}function mf(e,t){let{x:i,width:n}=e;return t==="right"?i-=n:t==="center"&&(i-=n/2),i}function bf(e,t,i){let{y:n,height:s}=e;return t==="top"?n+=i:t==="bottom"?n-=s+i:n-=s/2,n}function oa(e,t,i,n){let{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=fe(r),m=mf(t,a),g=bf(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(h,f)+s:a==="right"&&(m+=Math.max(d,u)+s),{x:bt(m,0,n.width-t.width),y:bt(g,0,n.height-t.height)}}function Rn(e,t,i){let n=dt(i.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function ra(e){return Vt([],Jt(e))}function vf(e,t,i){return Kt(e,{tooltip:t,tooltipItems:i,type:"tooltip"})}function aa(e,t){let i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}var La={beforeTitle:zt,title(e){if(e.length>0){let t=e[0],i=t.chart.data.labels,n=i?i.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return i[t.dataIndex]}return""},afterTitle:zt,beforeBody:zt,beforeLabel:zt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let i=e.formattedValue;return z(i)||(t+=i),t},labelColor(e){let i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:zt,afterBody:zt,beforeFooter:zt,footer:zt,afterFooter:zt};function yt(e,t,i,n){let s=e[t].call(i,n);return typeof s>"u"?La[t].call(i,n):s}var Ri=class extends Et{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let i=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&i.options.animation&&n.animations,o=new Vn(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=vf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,i){let{callbacks:n}=i,s=yt(n,"beforeTitle",this,t),o=yt(n,"title",this,t),r=yt(n,"afterTitle",this,t),a=[];return a=Vt(a,Jt(s)),a=Vt(a,Jt(o)),a=Vt(a,Jt(r)),a}getBeforeBody(t,i){return ra(yt(i.callbacks,"beforeBody",this,t))}getBody(t,i){let{callbacks:n}=i,s=[];return V(t,o=>{let r={before:[],lines:[],after:[]},a=aa(n,o);Vt(r.before,Jt(yt(a,"beforeLabel",this,o))),Vt(r.lines,yt(a,"label",this,o)),Vt(r.after,Jt(yt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,i){return ra(yt(i.callbacks,"afterBody",this,t))}getFooter(t,i){let{callbacks:n}=i,s=yt(n,"beforeFooter",this,t),o=yt(n,"footer",this,t),r=yt(n,"afterFooter",this,t),a=[];return a=Vt(a,Jt(s)),a=Vt(a,Jt(o)),a=Vt(a,Jt(r)),a}_createItems(t){let i=this._active,n=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=i.length;l<c;++l)a.push(ff(this.chart,i[l]));return t.filter&&(a=a.filter((h,d,f)=>t.filter(h,d,f,n))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,n))),V(a,h=>{let d=aa(t.callbacks,h);s.push(yt(d,"labelColor",this,h)),o.push(yt(d,"labelPointStyle",this,h)),r.push(yt(d,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,i){let n=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=Li[n.position].call(this,s,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);let l=this._size=na(this,n),c=Object.assign({},a,l),h=sa(this.chart,n,c),d=oa(n,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&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,n,s){let o=this.getCaretPosition(t,n,s);i.lineTo(o.x1,o.y1),i.lineTo(o.x2,o.y2),i.lineTo(o.x3,o.y3)}getCaretPosition(t,i,n){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=fe(a),{x:f,y:u}=t,{width:m,height:g}=i,b,v,w,M,p,_;return o==="center"?(p=u+g/2,s==="left"?(b=f,v=b-r,M=p+r,_=p-r):(b=f+m,v=b+r,M=p-r,_=p+r),w=b):(s==="left"?v=f+Math.max(l,h)+r:s==="right"?v=f+m-Math.max(c,d)-r:v=this.caretX,o==="top"?(M=u,p=M-r,b=v-r,w=v+r):(M=u+g,p=M+r,b=v+r,w=v-r),_=M),{x1:b,x2:v,x3:w,y1:M,y2:p,y3:_}}drawTitle(t,i,n){let s=this.title,o=s.length,r,a,l;if(o){let c=Pe(n.rtl,this.x,this.width);for(t.x=Rn(this,n.titleAlign,n),i.textAlign=c.textAlign(n.titleAlign),i.textBaseline="middle",r=it(n.titleFont),a=n.titleSpacing,i.fillStyle=n.titleColor,i.font=r.string,l=0;l<o;++l)i.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,i,n,s,o){let r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,h=it(o.bodyFont),d=Rn(this,"left",o),f=s.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,m=i.y+u;if(o.usePointStyle){let g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,v=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Mn(t,g,b,v),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Mn(t,g,b,v)}else{t.lineWidth=N(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let g=s.leftForLtr(f,c),b=s.leftForLtr(s.xPlus(f,1),c-2),v=fe(r.borderRadius);Object.values(v).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ii(t,{x:g,y:m,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ii(t,{x:b,y:m+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,c,l),t.strokeRect(g,m,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,i,n){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,d=it(n.bodyFont),f=d.lineHeight,u=0,m=Pe(n.rtl,this.x,this.width),g=function(k){i.fillText(k,m.x(t.x+u),t.y+f/2),t.y+=f+o},b=m.textAlign(r),v,w,M,p,_,y,S;for(i.textAlign=r,i.textBaseline="middle",i.font=d.string,t.x=Rn(this,b,n),i.fillStyle=n.bodyColor,V(this.beforeBody,g),u=a&&b!=="right"?r==="center"?c/2+h:c+2+h:0,p=0,y=s.length;p<y;++p){for(v=s[p],w=this.labelTextColors[p],i.fillStyle=w,V(v.before,g),M=v.lines,a&&M.length&&(this._drawColorBox(i,t,p,m,n),f=Math.max(d.lineHeight,l)),_=0,S=M.length;_<S;++_)g(M[_]),f=d.lineHeight;V(v.after,g)}u=0,f=d.lineHeight,V(this.afterBody,g),t.y-=o}drawFooter(t,i,n){let s=this.footer,o=s.length,r,a;if(o){let l=Pe(n.rtl,this.x,this.width);for(t.x=Rn(this,n.footerAlign,n),t.y+=n.footerMarginTop,i.textAlign=l.textAlign(n.footerAlign),i.textBaseline="middle",r=it(n.footerFont),i.fillStyle=n.footerColor,i.font=r.string,a=0;a<o;++a)i.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,i,n,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=n,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:m}=fe(s.cornerRadius);i.fillStyle=s.backgroundColor,i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.beginPath(),i.moveTo(a+d,l),r==="top"&&this.drawCaret(t,i,n,s),i.lineTo(a+c-f,l),i.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,i,n,s),i.lineTo(a+c,l+h-m),i.quadraticCurveTo(a+c,l+h,a+c-m,l+h),r==="bottom"&&this.drawCaret(t,i,n,s),i.lineTo(a+u,l+h),i.quadraticCurveTo(a,l+h,a,l+h-u),r==="center"&&o==="left"&&this.drawCaret(t,i,n,s),i.lineTo(a,l+d),i.quadraticCurveTo(a,l,a+d,l),i.closePath(),i.fill(),s.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){let i=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){let r=Li[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=na(this,t),l=Object.assign({},r,this._size),c=sa(i,t,l),h=oa(t,l,c,i);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let i=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(i);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let r=dt(i.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,i),Is(t,i.textDirection),o.y+=r.top,this.drawTitle(o,t,i),this.drawBody(o,t,i),this.drawFooter(o,t,i),Fs(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){let n=this._active,s=t.map(({datasetIndex:a,index:l})=>{let 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=!Si(n,s),r=this._positionChanged(s,i);(o||r)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,n=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,i,n),a=this._positionChanged(r,t),l=i||!Si(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),l}_getActiveElements(t,i,n,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return i.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,i){let{caretX:n,caretY:s,options:o}=this,r=Li[o.position].call(this,t,i);return r!==!1&&(n!==r.x||s!==r.y)}};E(Ri,"positioners",Li);var Ra={id:"tooltip",_element:Ri,positioners:Li,afterInit(e,t,i){i&&(e.tooltip=new Ri({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let i={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){let i=t.replay;e.tooltip.handleEvent(t.event,i,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:La},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};var xf=(e,t,i,n)=>(typeof t=="string"?(i=e.push(t)-1,n.unshift({index:i,label:t})):isNaN(t)&&(i=null),i);function yf(e,t,i,n){let s=e.indexOf(t);if(s===-1)return xf(e,t,i,n);let o=e.lastIndexOf(t);return s!==o?i:s}var _f=(e,t)=>e===null?null:bt(Math.round(e),0,t);function la(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var oi=class extends Zt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let i=this._addedLabels;if(i.length){let n=this.getLabels();for(let{index:s,label:o}of i)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(z(t))return null;let n=this.getLabels();return i=isFinite(i)&&n[i]===t?i:yf(n,t,R(i,t),this._addedLabels),_f(i,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),i||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){let t=this.min,i=this.max,n=this.options.offset,s=[],o=this.getLabels();o=t===0&&i===o.length-1?o:o.slice(t,i+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=i;r++)s.push({value:r});return s}getLabelForValue(t){return la.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};E(oi,"id","category"),E(oi,"defaults",{ticks:{callback:la}});function wf(e,t){let i=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=e,u=o||1,m=h-1,{min:g,max:b}=t,v=!z(r),w=!z(a),M=!z(c),p=(b-g)/(d+1),_=gs((b-g)/m/u)*u,y,S,k,P;if(_<1e-14&&!v&&!w)return[{value:g},{value:b}];P=Math.ceil(b/_)-Math.floor(g/_),P>m&&(_=gs(P*_/m/u)*u),z(l)||(y=Math.pow(10,l),_=Math.ceil(_*y)/y),s==="ticks"?(S=Math.floor(g/_)*_,k=Math.ceil(b/_)*_):(S=g,k=b),v&&w&&o&&Zo((a-r)/o,_/1e3)?(P=Math.round(Math.min((a-r)/_,h)),_=(a-r)/P,S=r,k=a):M?(S=v?r:S,k=w?a:k,P=c-1,_=(k-S)/P):(P=(k-S)/_,ti(P,Math.round(P),_/1e3)?P=Math.round(P):P=Math.ceil(P));let C=Math.max(bs(_),bs(S));y=Math.pow(10,z(l)?C:l),S=Math.round(S*y)/y,k=Math.round(k*y)/y;let O=0;for(v&&(f&&S!==r?(i.push({value:r}),S<r&&O++,ti(Math.round((S+O*_)*y)/y,r,ca(r,p,e))&&O++):S<r&&O++);O<P;++O){let T=Math.round((S+O*_)*y)/y;if(w&&T>a)break;i.push({value:T})}return w&&f&&k!==a?i.length&&ti(i[i.length-1].value,a,ca(a,p,e))?i[i.length-1].value=a:i.push({value:a}):(!w||k===a)&&i.push({value:k}),i}function ca(e,t,{horizontal:i,minRotation:n}){let s=qt(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}var li=class 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,i){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:i,maxDefined:n}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=i?s:l,a=l=>o=n?o:l;if(t){let l=At(s),c=At(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:i,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),i=i||11),i&&(s=Math.min(i,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,i=t.ticks,n=this.getTickLimit();n=Math.max(2,n);let s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:i.includeBounds!==!1},o=this._range||this,r=wf(s,o);return t.bounds==="ticks"&&ms(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(){let t=this.ticks,i=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){let s=(n-i)/Math.max(t.length-1,1)/2;i-=s,n+=s}this._startValue=i,this._endValue=n,this._valueRange=n-i}getLabelForValue(t){return _n(t,this.chart.options.locale,this.options.ticks.format)}},ri=class extends li{determineDataLimits(){let{min:t,max:i}=this.getMinMax(!0);this.min=Q(t)?t:0,this.max=Q(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),i=t?this.width:this.height,n=qt(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};E(ri,"id","linear"),E(ri,"defaults",{ticks:{callback:ki.formatters.numeric}});var Bi=e=>Math.floor(Xt(e)),Te=(e,t)=>Math.pow(10,Bi(e)+t);function ha(e){return e/Math.pow(10,Bi(e))===1}function da(e,t,i){let n=Math.pow(10,i),s=Math.floor(e/n);return Math.ceil(t/n)-s}function Mf(e,t){let i=t-e,n=Bi(i);for(;da(e,t,n)>10;)n++;for(;da(e,t,n)<10;)n--;return Math.min(n,Bi(e))}function Sf(e,{min:t,max:i}){t=vt(e.min,t);let n=[],s=Bi(t),o=Mf(t,i),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10,d=Math.floor((c-h)/Math.pow(10,o)),f=vt(e.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;f<i;)n.push({value:f,major:ha(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),f=Math.round((l+h+d*Math.pow(10,o))*r)/r;let u=vt(e.max,f);return n.push({value:u,major:ha(u),significand:d}),n}var In=class extends Zt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,i){let n=li.prototype.parse.apply(this,[t,i]);if(n===0){this._zero=!0;return}return Q(n)&&n>0?n:null}determineDataLimits(){let{min:t,max:i}=this.getMinMax(!0);this.min=Q(t)?Math.max(0,t):null,this.max=Q(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Q(this._userMin)&&(this.min=t===Te(this.min,0)?Te(this.min,-1):Te(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),n=this.min,s=this.max,o=a=>n=t?n:a,r=a=>s=i?s:a;n===s&&(n<=0?(o(1),r(10)):(o(Te(n,-1)),r(Te(s,1)))),n<=0&&o(Te(s,-1)),s<=0&&r(Te(n,1)),this.min=n,this.max=s}buildTicks(){let t=this.options,i={min:this._userMin,max:this._userMax},n=Sf(i,this);return t.bounds==="ticks"&&ms(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":_n(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=Xt(t),this._valueRange=Xt(this.max)-Xt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Xt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let i=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+i*this._valueRange)}};E(In,"id","logarithmic"),E(In,"defaults",{ticks:{callback:ki.formatters.logarithmic,major:{enabled:!0}}});function io(e){let t=e.ticks;if(t.display&&e.display){let i=dt(t.backdropPadding);return R(t.font&&t.font.size,Y.font.size)+i.height}return 0}function kf(e,t,i){return i=U(i)?i:[i],{w:hr(e,t.string,i),h:i.length*t.lineHeight}}function fa(e,t,i,n,s){return e===n||e===s?{start:t-i/2,end:t+i/2}:e<n||e>s?{start:t-i,end:t}:{start:t,end:t+i}}function Of(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},i=Object.assign({},t),n=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?Z/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;let h=e.getPointPosition(l,e.drawingArea+s[l],a),d=it(c.font),f=kf(e.ctx,d,e._pointLabels[l]);n[l]=f;let u=Pt(e.getIndexAngle(l)+a),m=Math.round(xn(u)),g=fa(m,h.x,f.w,0,180),b=fa(m,h.y,f.h,90,270);Pf(i,t,u,g,b)}e.setCenterPoint(t.l-i.l,i.r-t.r,t.t-i.t,i.b-t.b),e._pointLabelItems=Cf(e,n,s)}function Pf(e,t,i,n,s){let o=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i)),a=0,l=0;n.start<t.l?(a=(t.l-n.start)/o,e.l=Math.min(e.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function Df(e,t,i){let n=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=e.getPointPosition(t,n+s+r,o),c=Math.round(xn(Pt(l.angle+mt))),h=Lf(l.y,a.h,c),d=Af(c),f=Ef(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:f,top:h,right:f+a.w,bottom:h+a.h}}function Tf(e,t){if(!t)return!0;let{left:i,top:n,right:s,bottom:o}=e;return!(Nt({x:i,y:n},t)||Nt({x:i,y:o},t)||Nt({x:s,y:n},t)||Nt({x:s,y:o},t))}function Cf(e,t,i){let n=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:io(o)/2,additionalAngle:r?Z/s:0},c;for(let h=0;h<s;h++){l.padding=i[h],l.size=t[h];let d=Df(e,h,l);n.push(d),a==="auto"&&(d.visible=Tf(d,c),d.visible&&(c=d))}return n}function Af(e){return e===0||e===180?"center":e<180?"left":"right"}function Ef(e,t,i){return i==="right"?e-=t:i==="center"&&(e-=t/2),e}function Lf(e,t,i){return i===90||i===270?e-=t/2:(i>270||i<90)&&(e-=t),e}function Rf(e,t,i){let{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=t;if(!z(a)){let l=fe(t.borderRadius),c=dt(t.backdropPadding);e.fillStyle=a;let h=n-c.left,d=s-c.top,f=o-n+c.width,u=r-s+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),ii(e,{x:h,y:d,w:f,h:u,radius:l}),e.fill()):e.fillRect(h,d,f,u)}}function If(e,t){let{ctx:i,options:{pointLabels:n}}=e;for(let s=t-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let r=n.setContext(e.getPointLabelContext(s));Rf(i,r,o);let a=it(r.font),{x:l,y:c,textAlign:h}=o;Oe(i,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Ia(e,t,i,n){let{ctx:s}=e;if(i)s.arc(e.xCenter,e.yCenter,t,0,Mt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<n;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function Ff(e,t,i,n,s){let o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Ia(e,i,r,n),o.closePath(),o.stroke(),o.restore())}function Bf(e,t,i){return Kt(e,{label:i,index:t,type:"pointLabel"})}var ni=class extends li{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=dt(io(this.options)/2),i=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+i/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(i,n)/2)}determineDataLimits(){let{min:t,max:i}=this.getMinMax(!1);this.min=Q(t)&&!isNaN(t)?t:0,this.max=Q(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/io(this.options))}generateTickLabels(t){li.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((i,n)=>{let s=j(this.options.pointLabels.callback,[i,n],this);return s||s===0?s:""}).filter((i,n)=>this.chart.getDataVisibility(n))}fit(){let t=this.options;t.display&&t.pointLabels.display?Of(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,i,n,s){this.xCenter+=Math.floor((t-i)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,i,n,s))}getIndexAngle(t){let i=Mt/(this._pointLabels.length||1),n=this.options.startAngle||0;return Pt(t*i+qt(n))}getDistanceFromCenterForValue(t){if(z(t))return NaN;let i=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*i:(t-this.min)*i}getValueForDistanceFromCenter(t){if(z(t))return NaN;let i=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-i:this.min+i}getPointLabelContext(t){let i=this._pointLabels||[];if(t>=0&&t<i.length){let n=i[t];return Bf(this.getContext(),t,n)}}getPointPosition(t,i,n=0){let s=this.getIndexAngle(t)-mt+n;return{x:Math.cos(s)*i+this.xCenter,y:Math.sin(s)*i+this.yCenter,angle:s}}getPointPositionForValue(t,i){return this.getPointPosition(t,this.getDistanceFromCenterForValue(i))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:i,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:i,top:n,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:i}}=this.options;if(t){let n=this.ctx;n.save(),n.beginPath(),Ia(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){let t=this.ctx,i=this.options,{angleLines:n,grid:s,border:o}=i,r=this._pointLabels.length,a,l,c;if(i.pointLabels.display&&If(this,r),s.display&&this.ticks.forEach((h,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);let f=this.getContext(d),u=s.setContext(f),m=o.setContext(f);Ff(this,u,l,r,m)}}),n.display){for(t.save(),a=r-1;a>=0;a--){let h=n.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=h;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(i.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,i=this.options,n=i.ticks;if(!n.display)return;let s=this.getIndexAngle(0),o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!i.reverse)return;let c=n.setContext(this.getContext(l)),h=it(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;let d=dt(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}Oe(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};E(ni,"id","radialLinear"),E(ni,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ki.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),E(ni,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),E(ni,"descriptors",{angleLines:{_fallback:"grid"}});var $n={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}},_t=Object.keys($n);function ua(e,t){return e-t}function pa(e,t){if(z(t))return null;let i=e._adapter,{parser:n,round:s,isoWeekday:o}=e._parseOpts,r=t;return typeof n=="function"&&(r=n(r)),Q(r)||(r=typeof n=="string"?i.parse(r,n):i.parse(r)),r===null?null:(s&&(r=s==="week"&&(ei(o)||o===!0)?i.startOf(r,"isoWeek",o):i.startOf(r,s)),+r)}function ga(e,t,i,n){let s=_t.length;for(let o=_t.indexOf(e);o<s-1;++o){let r=$n[_t[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((i-t)/(a*r.size))<=n)return _t[o]}return _t[s-1]}function Nf(e,t,i,n,s){for(let o=_t.length-1;o>=_t.indexOf(i);o--){let r=_t[o];if($n[r].common&&e._adapter.diff(s,n,r)>=t-1)return r}return _t[i?_t.indexOf(i):0]}function zf(e){for(let t=_t.indexOf(e)+1,i=_t.length;t<i;++t)if($n[_t[t]].common)return _t[t]}function ma(e,t,i){if(!i)e[t]=!0;else if(i.length){let{lo:n,hi:s}=yn(i,t),o=i[n]>=t?i[n]:i[s];e[o]=!0}}function Vf(e,t,i,n){let s=e._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=i[a],l>=0&&(t[l].major=!0);return t}function ba(e,t,i){let n=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,n.push({value:a,major:!1});return o===0||!i?n:Vf(e,n,s,i)}var ai=class 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,i={}){let n=t.time||(t.time={}),s=this._adapter=new Wh._date(t.adapters.date);s.init(i),Ze(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=i.normalized}parse(t,i){return t===void 0?null:pa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,i=this._adapter,n=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Q(s)&&!isNaN(s)?s:+i.startOf(Date.now(),n),o=Q(o)&&!isNaN(o)?o:+i.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(i=t[0],n=t[t.length-1]),{min:i,max:n}}buildTicks(){let t=this.options,i=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=ir(s,o,r);return this._unit=i.unit||(n.autoSkip?ga(i.minUnit,this.min,this.max,this._getLabelCapacity(o)):Nf(this,a.length,i.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:zf(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ba(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let i=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?i=1-s:i=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;i=bt(i,0,r),n=bt(n,0,r),this._offsets={start:i,end:n,factor:1/(i+1+n)}}_generate(){let t=this._adapter,i=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||ga(o.minUnit,i,n,this._getLabelCapacity(i)),a=R(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=ei(l)||l===!0,h={},d=i,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(n,i,r)>1e5*a)throw new Error(i+" and "+n+" are too far apart with stepSize of "+a+" "+r);let m=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<n;f=+t.add(f,a,r),u++)ma(h,f,m);return(f===n||s.bounds==="ticks"||u===1)&&ma(h,f,m),Object.keys(h).sort(ua).map(g=>+g)}getLabelForValue(t){let i=this._adapter,n=this.options.time;return n.tooltipFormat?i.format(t,n.tooltipFormat):i.format(t,n.displayFormats.datetime)}format(t,i){let s=this.options.time.displayFormats,o=this._unit,r=i||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,i,n,s){let o=this.options,r=o.ticks.callback;if(r)return j(r,[t,i,n],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=n[i],u=c&&d&&f&&f.major;return this._adapter.format(t,s||(u?d:h))}generateTickLabels(t){let i,n,s;for(i=0,n=t.length;i<n;++i)s=t[i],s.label=this._tickFormatFunction(s.value,i,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let i=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((i.start+n)*i.factor)}getValueForPixel(t){let i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let i=this.options.ticks,n=this.ctx.measureText(t).width,s=qt(this.isHorizontal()?i.maxRotation:i.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){let i=this.options.time,n=i.displayFormats,s=n[i.unit]||n.millisecond,o=this._tickFormatFunction(t,0,ba(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],i,n;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(i=0,n=s.length;i<n;++i)t=t.concat(s[i].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],i,n;if(t.length)return t;let s=this.getLabels();for(i=0,n=s.length;i<n;++i)t.push(pa(this,s[i]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ys(t.sort(ua))}};E(ai,"id","time"),E(ai,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Fn(e,t,i){let n=0,s=e.length-1,o,r,a,l;i?(t>=e[n].pos&&t<=e[s].pos&&({lo:n,hi:s}=le(e,"pos",t)),{pos:o,time:a}=e[n],{pos:r,time:l}=e[s]):(t>=e[n].time&&t<=e[s].time&&({lo:n,hi:s}=le(e,"time",t)),{time:o,pos:a}=e[n],{time:r,pos:l}=e[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var Bn=class extends ai{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=Fn(i,this.min),this._tableRange=Fn(i,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:i,max:n}=this,s=[],o=[],r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=i&&c<=n&&s.push(c);if(s.length<2)return[{time:i,pos:0},{time:n,pos:1}];for(r=0,a=s.length;r<a;++r)h=s[r+1],l=s[r-1],c=s[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,i=this.max,n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(i)||n.length===1)&&n.push(i),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let i=this.getDataTimestamps(),n=this.getLabelTimestamps();return i.length&&n.length?t=this.normalize(i.concat(n)):t=i.length?i:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Fn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return Fn(this._table,n*this._tableRange+this._minPos,!0)}};E(Bn,"id","timeseries"),E(Bn,"defaults",ai.defaults);pt.register(Ce,Le,oi,Ea,Ae,pe,ri,Ee,Ra);pt.defaults.font.size=12;pt.defaults.font.family="Inter var";var Fa="#22d3ee",Ba="#34d399",Na="#fb923c",za="#fb7185",Va="#2dd4bf",Wa="#a78bfa",Ha="#facc15",Wf=[Fa,Wa,Ha,Ba,Na,Va,za],Hf={available:Va,completed:Fa,cancelled:Wa,discarded:za,executing:Na,retryable:Ha,scheduled:Ba},jf=["group","ntile","period","series","visible"],$f=e=>{for(let[t,i]of Object.entries(e))jf.includes(t)&&i!==void 0&&Bt(`chart-${t}`,i)},ja=function(e){let t,i,n,s;return e<1e3?e:e<1e4?(i=Math.pow(10,3),t=Math.floor(e/i),part=Math.round(e%i/Math.pow(10,2)),part===0?`${t}k`:part===10?`${t+1}k`:`${t}.${part}k`):(e<1e6?(n=3,s="k"):e<1e9?(n=6,s="m"):(n=9,s="b"),t=Math.round(e/Math.pow(10,n)),`${t}${s}`)},$a=function(e){let t=e/1e6,i=e/1e9,n=e/6e10,s=e/36e11;return s>=1?`${s.toFixed(1)}h`:n>=1?`${n.toFixed(1)}m`:i>=1?`${i.toFixed(1)}s`:t>=1e3?`${t.toFixed(1)}ms`:`${t.toFixed(0)}ms`},Uf={id:"verticalLiner",afterInit:(e,t,i)=>{e.verticalLiner={}},afterEvent:(e,t,i)=>{let{inChartArea:n}=t;e.verticalLiner={draw:n}},beforeTooltipDraw:(e,t,i)=>{let{draw:n}=e.verticalLiner;if(!n)return;let{ctx:s}=e,{top:o,bottom:r}=e.chartArea,{tooltip:a}=t,l=a?.caretX;!l||(s.save(),s.beginPath(),s.moveTo(l,o),s.lineTo(l,r),s.strokeStyle="#d1d5db",s.globalCompositeOperation="destination-over",s.stroke(),s.restore())}},Ua={animation:!1,maintainAspectRatio:!1,normalized:!0,responsive:!0,resizeDelay:100,interaction:{mode:"index",intersect:!1},layout:{padding:{bottom:4}},plugins:{legend:{display:!1},verticalLiner:{},tooltip:{callbacks:{title:function(e){return new Date(parseInt(e[0].label)*1e3).toLocaleTimeString("en-US",{hour12:!1,timeStyle:"long"})},label:function(e){let t=e.chart.options.type,i=e.dataset.label,n=e.parsed.y||0;return t==="line"?`${i}: ${$a(n)}`:`${i}: ${ja(n)}`}}}}},Yf={...Ua,scales:{x:{stacked:!0,grid:{display:!1,drawTicks:!0},ticks:{maxRotation:0,minRotation:0,padding:3,callback:function(e,t){if(t%4===0)return new Date(parseInt(this.getLabelForValue(e))*1e3).toLocaleTimeString("en-US",{hour12:!1,timeStyle:"medium"})}}},y:{stacked:!0,ticks:{callback:function(e,t,i){if(t%2===0)return ja(e)}}}}},Xf={...Ua,borderWidth:2,borderJoinStyle:"round",radius:2,spanGaps:!0,scales:{x:{grid:{display:!1},ticks:{maxRotation:0,minRotation:0,padding:3,callback:function(e,t){if(t%4===0)return new Date(parseInt(this.getLabelForValue(e))*1e3).toLocaleTimeString("en-US",{hour12:!1,timeStyle:"medium"})}}},y:{ticks:{callback:function(e,t,i){if(t%2===0)return $a(e)}}}}},qf={mounted(){let e=null;this.handleEvent("chart-change",t=>{let{group:i,points:n,series:s}=t;$f(t);let[o,r]=/_count/.test(s)?["bar",Yf]:["line",Xf],a=o==="line"?[Uf]:[];e===null?e=new pt(this.el,{type:o,options:r,plugins:a}):e.config.type!==o&&(e.destroy(),e=new pt(this.el,{type:o,options:r,plugins:a}));let l=Object.entries(n).map(([c,h],d)=>{let f=i==="state"?Hf[c]:Wf[d];return{backgroundColor:f,barPercentage:1,barThickness:"flex",borderColor:f,data:h.reverse(),label:c}});e.data.datasets=l,e.update()})}},Ya=qf;var Kf={mounted(){let e=document.querySelector("#search-input");e.addEventListener("keydown",t=>{if(t.key==="Tab"&&(t.preventDefault(),this.pushEventTo("#search","complete",{})),t.key==="Escape"){e.blur();let i=document.querySelector("#search-suggest"),n=i.getAttribute("phx-click-away");this.liveSocket.execJS(i,n,"click")}}),this.handleEvent("completed",({buffer:t})=>{e.value=t})}},Xa=Kf;var Gf={mounted(){this.el.addEventListener("click",e=>{e.preventDefault(),window.history.back()})}},qa=Gf;var Jf={mounted(){this.handleEvent("select-instance",({name:e})=>{Bt("instance",e)})}},Ka=Jf;var Zf={mounted(){let e="#refresh-selector";document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?this.pushEventTo(e,"resume-refresh",{}):this.pushEventTo(e,"pause-refresh",{})}),this.handleEvent("update-refresh",({refresh:t})=>{Bt("refresh",t)})}},Ga=Zf;function no(e){return e<10?`0${e}`:e}function Qf(e){let t=Math.floor(Math.abs(Date.now()-e)/1e3),i=t%60,n=Math.floor(t%3600/60),s=Math.floor(t/3600),o=[no(n),no(i)];return s>0&&o.unshift(no(s)),o.join(":")}function tu(e){let t=Date.now()-e,i=Math.floor(Math.abs(t)/1e3);if(i===0)return"now";let n="";return i<=59?n=`${i}s`:i<=3599?n=`${Math.floor(i/60)}m`:i<=86399?n=`${Math.floor(i/3600)}h`:i<=2591999?n=`${Math.floor(i/86400)}d`:i<=31535999?n=`${Math.floor(i/2592e3)}mo`:n=`${Math.floor(i/31536e3)}yr`,t>0?`${n} ago`:t<0?`in ${n}`:n}var eu={destroyed(){clearInterval(this.interval)},mounted(){let e=this.el.getAttribute("data-timestamp"),t=this.el.getAttribute("data-relative-mode")||"words",i=()=>{this.el.textContent=t==="words"?tu(e):Qf(e)};i(),this.interval=window.setInterval(()=>{an("refresh")>0&&i()},1e3)}},Ja=eu;var iu={"/":"#search","?":"#shortcuts",J:"#nav-jobs",Q:"#nav-queues",r:"#refresh-selector",t:"#theme-selector"},nu={mounted(){window.addEventListener("keydown",e=>{if(e.target.nodeName!=="BODY"||e.metaKey)return;let t=iu[e.key];if(t){e.preventDefault();let i=document.querySelector(t),n=i.getAttribute("data-shortcut");this.liveSocket.execJS(i,n,"click")}})}},Za=nu;var su="sidebar_width",ou=256,ru=512,au={mounted(){this.sidebar=this.el,this.isResizing=!1,this.startX=0,this.startWidth=0,this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.attachHandle(),document.documentElement.style.removeProperty("--sidebar-width")},updated(){this.attachHandle()},destroyed(){this.detachHandle(),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)},attachHandle(){this.handle&&this.handle.removeEventListener("mousedown",this.handleMouseDown),this.handle=this.sidebar.querySelector("[data-resize-handle]"),this.handle&&this.handle.addEventListener("mousedown",this.handleMouseDown)},detachHandle(){this.handle&&this.handle.removeEventListener("mousedown",this.handleMouseDown)},handleMouseDown(e){e.preventDefault(),this.isResizing=!0,this.startX=e.clientX,this.startWidth=this.sidebar.offsetWidth,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),document.body.style.cursor="col-resize",document.body.style.userSelect="none",this.handle.classList.add("resizing"),this.pushEventTo("#refresh-selector","pause-refresh",{})},handleMouseMove(e){if(!this.isResizing)return;let t=e.clientX-this.startX;this.setWidth(this.startWidth+t)},handleMouseUp(){if(!this.isResizing)return;this.isResizing=!1,document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.body.style.cursor="",document.body.style.userSelect="",this.handle.classList.remove("resizing");let e=this.sidebar.offsetWidth;Bt(su,e),this.pushEvent("sidebar_resize",{width:e}),this.pushEventTo("#refresh-selector","resume-refresh",{})},setWidth(e){let t=Math.max(ou,Math.min(ru,e));this.sidebar.style.width=`${t}px`}},Qa=au;var lu={applyTheme(){let e=window.matchMedia("(prefers-color-scheme: dark)").matches,t=an("theme");t==="dark"||t==="system"&&e||!t&&e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},mounted(){this.handleEvent("update-theme",({theme:e})=>{Bt("theme",e),this.applyTheme()})}},tl=lu;var K="top",tt="bottom",J="right",G="left",Un="auto",ve=[K,tt,J,G],Qt="start",Re="end",el="clippingParents",Yn="viewport",ci="popper",il="reference",so=ve.reduce(function(e,t){return e.concat([t+"-"+Qt,t+"-"+Re])},[]),Xn=[].concat(ve,[Un]).reduce(function(e,t){return e.concat([t,t+"-"+Qt,t+"-"+Re])},[]),cu="beforeRead",hu="read",du="afterRead",fu="beforeMain",uu="main",pu="afterMain",gu="beforeWrite",mu="write",bu="afterWrite",nl=[cu,hu,du,fu,uu,pu,gu,mu,bu];function nt(e){return e?(e.nodeName||"").toLowerCase():null}function X(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Dt(e){var t=X(e).Element;return e instanceof t||e instanceof Element}function et(e){var t=X(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function hi(e){if(typeof ShadowRoot>"u")return!1;var t=X(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function vu(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var n=t.styles[i]||{},s=t.attributes[i]||{},o=t.elements[i];!et(o)||!nt(o)||(Object.assign(o.style,n),Object.keys(s).forEach(function(r){var a=s[r];a===!1?o.removeAttribute(r):o.setAttribute(r,a===!0?"":a)}))})}function xu(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(n){var s=t.elements[n],o=t.attributes[n]||{},r=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:i[n]),a=r.reduce(function(l,c){return l[c]="",l},{});!et(s)||!nt(s)||(Object.assign(s.style,a),Object.keys(o).forEach(function(l){s.removeAttribute(l)}))})}}var zi={name:"applyStyles",enabled:!0,phase:"write",fn:vu,effect:xu,requires:["computeStyles"]};function st(e){return e.split("-")[0]}var Lt=Math.max,Ie=Math.min,te=Math.round;function di(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Vi(){return!/^((?!chrome|android).)*safari/i.test(di())}function Tt(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var n=e.getBoundingClientRect(),s=1,o=1;t&&et(e)&&(s=e.offsetWidth>0&&te(n.width)/e.offsetWidth||1,o=e.offsetHeight>0&&te(n.height)/e.offsetHeight||1);var r=Dt(e)?X(e):window,a=r.visualViewport,l=!Vi()&&i,c=(n.left+(l&&a?a.offsetLeft:0))/s,h=(n.top+(l&&a?a.offsetTop:0))/o,d=n.width/s,f=n.height/o;return{width:d,height:f,top:h,right:c+d,bottom:h+f,left:c,x:c,y:h}}function Fe(e){var t=Tt(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function Wi(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&hi(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function gt(e){return X(e).getComputedStyle(e)}function oo(e){return["table","td","th"].indexOf(nt(e))>=0}function ht(e){return((Dt(e)?e.ownerDocument:e.document)||window.document).documentElement}function ee(e){return nt(e)==="html"?e:e.assignedSlot||e.parentNode||(hi(e)?e.host:null)||ht(e)}function sl(e){return!et(e)||gt(e).position==="fixed"?null:e.offsetParent}function yu(e){var t=/firefox/i.test(di()),i=/Trident/i.test(di());if(i&&et(e)){var n=gt(e);if(n.position==="fixed")return null}var s=ee(e);for(hi(s)&&(s=s.host);et(s)&&["html","body"].indexOf(nt(s))<0;){var o=gt(s);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return s;s=s.parentNode}return null}function Rt(e){for(var t=X(e),i=sl(e);i&&oo(i)&&gt(i).position==="static";)i=sl(i);return i&&(nt(i)==="html"||nt(i)==="body"&&gt(i).position==="static")?t:i||yu(e)||t}function Be(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ne(e,t,i){return Lt(e,Ie(t,i))}function ol(e,t,i){var n=Ne(e,t,i);return n>i?i:n}function Hi(){return{top:0,right:0,bottom:0,left:0}}function ji(e){return Object.assign({},Hi(),e)}function $i(e,t){return t.reduce(function(i,n){return i[n]=e,i},{})}var _u=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,ji(typeof t!="number"?t:$i(t,ve))};function wu(e){var t,i=e.state,n=e.name,s=e.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=st(i.placement),l=Be(a),c=[G,J].indexOf(a)>=0,h=c?"height":"width";if(!(!o||!r)){var d=_u(s.padding,i),f=Fe(o),u=l==="y"?K:G,m=l==="y"?tt:J,g=i.rects.reference[h]+i.rects.reference[l]-r[l]-i.rects.popper[h],b=r[l]-i.rects.reference[l],v=Rt(o),w=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,M=g/2-b/2,p=d[u],_=w-f[h]-d[m],y=w/2-f[h]/2+M,S=Ne(p,y,_),k=l;i.modifiersData[n]=(t={},t[k]=S,t.centerOffset=S-y,t)}}function Mu(e){var t=e.state,i=e.options,n=i.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||!Wi(t.elements.popper,s)||(t.elements.arrow=s))}var rl={name:"arrow",enabled:!0,phase:"main",fn:wu,effect:Mu,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ct(e){return e.split("-")[1]}var Su={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ku(e){var t=e.x,i=e.y,n=window,s=n.devicePixelRatio||1;return{x:te(t*s)/s||0,y:te(i*s)/s||0}}function al(e){var t,i=e.popper,n=e.popperRect,s=e.placement,o=e.variation,r=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,h=e.roundOffsets,d=e.isFixed,f=r.x,u=f===void 0?0:f,m=r.y,g=m===void 0?0:m,b=typeof h=="function"?h({x:u,y:g}):{x:u,y:g};u=b.x,g=b.y;var v=r.hasOwnProperty("x"),w=r.hasOwnProperty("y"),M=G,p=K,_=window;if(c){var y=Rt(i),S="clientHeight",k="clientWidth";if(y===X(i)&&(y=ht(i),gt(y).position!=="static"&&a==="absolute"&&(S="scrollHeight",k="scrollWidth")),y=y,s===K||(s===G||s===J)&&o===Re){p=tt;var P=d&&y===_&&_.visualViewport?_.visualViewport.height:y[S];g-=P-n.height,g*=l?1:-1}if(s===G||(s===K||s===tt)&&o===Re){M=J;var C=d&&y===_&&_.visualViewport?_.visualViewport.width:y[k];u-=C-n.width,u*=l?1:-1}}var O=Object.assign({position:a},c&&Su),T=h===!0?ku({x:u,y:g}):{x:u,y:g};if(u=T.x,g=T.y,l){var L;return Object.assign({},O,(L={},L[p]=w?"0":"",L[M]=v?"0":"",L.transform=(_.devicePixelRatio||1)<=1?"translate("+u+"px, "+g+"px)":"translate3d("+u+"px, "+g+"px, 0)",L))}return Object.assign({},O,(t={},t[p]=w?g+"px":"",t[M]=v?u+"px":"",t.transform="",t))}function Ou(e){var t=e.state,i=e.options,n=i.gpuAcceleration,s=n===void 0?!0:n,o=i.adaptive,r=o===void 0?!0:o,a=i.roundOffsets,l=a===void 0?!0:a;if(!1)var c;var h={placement:st(t.placement),variation:Ct(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,al(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,al(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var ll={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ou,data:{}};var qn={passive:!0};function Pu(e){var t=e.state,i=e.instance,n=e.options,s=n.scroll,o=s===void 0?!0:s,r=n.resize,a=r===void 0?!0:r,l=X(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(h){h.addEventListener("scroll",i.update,qn)}),a&&l.addEventListener("resize",i.update,qn),function(){o&&c.forEach(function(h){h.removeEventListener("scroll",i.update,qn)}),a&&l.removeEventListener("resize",i.update,qn)}}var cl={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Pu,data:{}};var Du={left:"right",right:"left",bottom:"top",top:"bottom"};function fi(e){return e.replace(/left|right|bottom|top/g,function(t){return Du[t]})}var Tu={start:"end",end:"start"};function Kn(e){return e.replace(/start|end/g,function(t){return Tu[t]})}function ze(e){var t=X(e),i=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:i,scrollTop:n}}function Ve(e){return Tt(ht(e)).left+ze(e).scrollLeft}function ro(e,t){var i=X(e),n=ht(e),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Vi();(c||!c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Ve(e),y:l}}function ao(e){var t,i=ht(e),n=ze(e),s=(t=e.ownerDocument)==null?void 0:t.body,o=Lt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=Lt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Ve(e),l=-n.scrollTop;return gt(s||i).direction==="rtl"&&(a+=Lt(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}function We(e){var t=gt(e),i=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Gn(e){return["html","body","#document"].indexOf(nt(e))>=0?e.ownerDocument.body:et(e)&&We(e)?e:Gn(ee(e))}function xe(e,t){var i;t===void 0&&(t=[]);var n=Gn(e),s=n===((i=e.ownerDocument)==null?void 0:i.body),o=X(n),r=s?[o].concat(o.visualViewport||[],We(n)?n:[]):n,a=t.concat(r);return s?a:a.concat(xe(ee(r)))}function ui(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Cu(e,t){var i=Tt(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function hl(e,t,i){return t===Yn?ui(ro(e,i)):Dt(t)?Cu(t,i):ui(ao(ht(e)))}function Au(e){var t=xe(ee(e)),i=["absolute","fixed"].indexOf(gt(e).position)>=0,n=i&&et(e)?Rt(e):e;return Dt(n)?t.filter(function(s){return Dt(s)&&Wi(s,n)&&nt(s)!=="body"}):[]}function lo(e,t,i,n){var s=t==="clippingParents"?Au(e):[].concat(t),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(l,c){var h=hl(e,c,n);return l.top=Lt(h.top,l.top),l.right=Ie(h.right,l.right),l.bottom=Ie(h.bottom,l.bottom),l.left=Lt(h.left,l.left),l},hl(e,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ui(e){var t=e.reference,i=e.element,n=e.placement,s=n?st(n):null,o=n?Ct(n):null,r=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(s){case K:l={x:r,y:t.y-i.height};break;case tt:l={x:r,y:t.y+t.height};break;case J:l={x:t.x+t.width,y:a};break;case G:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var c=s?Be(s):null;if(c!=null){var h=c==="y"?"height":"width";switch(o){case Qt:l[c]=l[c]-(t[h]/2-i[h]/2);break;case Re:l[c]=l[c]+(t[h]/2-i[h]/2);break;default:}}return l}function It(e,t){t===void 0&&(t={});var i=t,n=i.placement,s=n===void 0?e.placement:n,o=i.strategy,r=o===void 0?e.strategy:o,a=i.boundary,l=a===void 0?el:a,c=i.rootBoundary,h=c===void 0?Yn:c,d=i.elementContext,f=d===void 0?ci:d,u=i.altBoundary,m=u===void 0?!1:u,g=i.padding,b=g===void 0?0:g,v=ji(typeof b!="number"?b:$i(b,ve)),w=f===ci?il:ci,M=e.rects.popper,p=e.elements[m?w:f],_=lo(Dt(p)?p:p.contextElement||ht(e.elements.popper),l,h,r),y=Tt(e.elements.reference),S=Ui({reference:y,element:M,strategy:"absolute",placement:s}),k=ui(Object.assign({},M,S)),P=f===ci?k:y,C={top:_.top-P.top+v.top,bottom:P.bottom-_.bottom+v.bottom,left:_.left-P.left+v.left,right:P.right-_.right+v.right},O=e.modifiersData.offset;if(f===ci&&O){var T=O[s];Object.keys(C).forEach(function(L){var $=[J,tt].indexOf(L)>=0?1:-1,I=[K,tt].indexOf(L)>=0?"y":"x";C[L]+=T[I]*$})}return C}function co(e,t){t===void 0&&(t={});var i=t,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?Xn:l,h=Ct(n),d=h?a?so:so.filter(function(m){return Ct(m)===h}):ve,f=d.filter(function(m){return c.indexOf(m)>=0});f.length===0&&(f=d);var u=f.reduce(function(m,g){return m[g]=It(e,{placement:g,boundary:s,rootBoundary:o,padding:r})[st(g)],m},{});return Object.keys(u).sort(function(m,g){return u[m]-u[g]})}function Eu(e){if(st(e)===Un)return[];var t=fi(e);return[Kn(e),t,Kn(t)]}function Lu(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=i.mainAxis,o=s===void 0?!0:s,r=i.altAxis,a=r===void 0?!0:r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,m=u===void 0?!0:u,g=i.allowedAutoPlacements,b=t.options.placement,v=st(b),w=v===b,M=l||(w||!m?[fi(b)]:Eu(b)),p=[b].concat(M).reduce(function(at,lt){return at.concat(st(lt)===Un?co(t,{placement:lt,boundary:h,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:g}):lt)},[]),_=t.rects.reference,y=t.rects.popper,S=new Map,k=!0,P=p[0],C=0;C<p.length;C++){var O=p[C],T=st(O),L=Ct(O)===Qt,$=[K,tt].indexOf(T)>=0,I=$?"width":"height",F=It(t,{placement:O,boundary:h,rootBoundary:d,altBoundary:f,padding:c}),W=$?L?J:G:L?tt:K;_[I]>y[I]&&(W=fi(W));var q=fi(W),ft=[];if(o&&ft.push(F[T]<=0),a&&ft.push(F[W]<=0,F[q]<=0),ft.every(function(at){return at})){P=O,k=!1;break}S.set(O,ft)}if(k)for(var ot=m?3:1,St=function(lt){var ct=p.find(function(je){var jt=S.get(je);if(jt)return jt.slice(0,lt).every(function($e){return $e})});if(ct)return P=ct,"break"},rt=ot;rt>0;rt--){var wt=St(rt);if(wt==="break")break}t.placement!==P&&(t.modifiersData[n]._skip=!0,t.placement=P,t.reset=!0)}}var dl={name:"flip",enabled:!0,phase:"main",fn:Lu,requiresIfExists:["offset"],data:{_skip:!1}};function fl(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function ul(e){return[K,J,tt,G].some(function(t){return e[t]>=0})}function Ru(e){var t=e.state,i=e.name,n=t.rects.reference,s=t.rects.popper,o=t.modifiersData.preventOverflow,r=It(t,{elementContext:"reference"}),a=It(t,{altBoundary:!0}),l=fl(r,n),c=fl(a,s,o),h=ul(l),d=ul(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}var pl={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ru};function Iu(e,t,i){var n=st(e),s=[G,K].indexOf(n)>=0?-1:1,o=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[G,J].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}function Fu(e){var t=e.state,i=e.options,n=e.name,s=i.offset,o=s===void 0?[0,0]:s,r=Xn.reduce(function(h,d){return h[d]=Iu(d,t.rects,o),h},{}),a=r[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=r}var gl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Fu};function Bu(e){var t=e.state,i=e.name;t.modifiersData[i]=Ui({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var ml={name:"popperOffsets",enabled:!0,phase:"read",fn:Bu,data:{}};function ho(e){return e==="x"?"y":"x"}function Nu(e){var t=e.state,i=e.options,n=e.name,s=i.mainAxis,o=s===void 0?!0:s,r=i.altAxis,a=r===void 0?!1:r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,f=i.tether,u=f===void 0?!0:f,m=i.tetherOffset,g=m===void 0?0:m,b=It(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),v=st(t.placement),w=Ct(t.placement),M=!w,p=Be(v),_=ho(p),y=t.modifiersData.popperOffsets,S=t.rects.reference,k=t.rects.popper,P=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,C=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,T={x:0,y:0};if(!!y){if(o){var L,$=p==="y"?K:G,I=p==="y"?tt:J,F=p==="y"?"height":"width",W=y[p],q=W+b[$],ft=W-b[I],ot=u?-k[F]/2:0,St=w===Qt?S[F]:k[F],rt=w===Qt?-k[F]:-S[F],wt=t.elements.arrow,at=u&&wt?Fe(wt):{width:0,height:0},lt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Hi(),ct=lt[$],je=lt[I],jt=Ne(0,S[F],at[F]),$e=M?S[F]/2-ot-jt-ct-C.mainAxis:St-jt-ct-C.mainAxis,ie=M?-S[F]/2+ot+jt+je+C.mainAxis:rt+jt+je+C.mainAxis,Ue=t.elements.arrow&&Rt(t.elements.arrow),qi=Ue?p==="y"?Ue.clientTop||0:Ue.clientLeft||0:0,gi=(L=O?.[p])!=null?L:0,Ki=W+$e-gi-qi,Gi=W+ie-gi,mi=Ne(u?Ie(q,Ki):q,W,u?Lt(ft,Gi):ft);y[p]=mi,T[p]=mi-W}if(a){var bi,Ji=p==="x"?K:G,Zi=p==="x"?tt:J,$t=y[_],ne=_==="y"?"height":"width",vi=$t+b[Ji],ye=$t-b[Zi],xi=[K,G].indexOf(v)!==-1,Qi=(bi=O?.[_])!=null?bi:0,tn=xi?vi:$t-S[ne]-k[ne]-Qi+C.altAxis,en=xi?$t+S[ne]+k[ne]-Qi-C.altAxis:ye,nn=u&&xi?ol(tn,$t,en):Ne(u?tn:vi,$t,u?en:ye);y[_]=nn,T[_]=nn-$t}t.modifiersData[n]=T}}var bl={name:"preventOverflow",enabled:!0,phase:"main",fn:Nu,requiresIfExists:["offset"]};function fo(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function uo(e){return e===X(e)||!et(e)?ze(e):fo(e)}function zu(e){var t=e.getBoundingClientRect(),i=te(t.width)/e.offsetWidth||1,n=te(t.height)/e.offsetHeight||1;return i!==1||n!==1}function po(e,t,i){i===void 0&&(i=!1);var n=et(t),s=et(t)&&zu(t),o=ht(t),r=Tt(e,s,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((nt(t)!=="body"||We(o))&&(a=uo(t)),et(t)?(l=Tt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Ve(o))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function Vu(e){var t=new Map,i=new Set,n=[];e.forEach(function(o){t.set(o.name,o)});function s(o){i.add(o.name);var r=[].concat(o.requires||[],o.requiresIfExists||[]);r.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&s(l)}}),n.push(o)}return e.forEach(function(o){i.has(o.name)||s(o)}),n}function go(e){var t=Vu(e);return nl.reduce(function(i,n){return i.concat(t.filter(function(s){return s.phase===n}))},[])}function mo(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function bo(e){var t=e.reduce(function(i,n){var s=i[n.name];return i[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,i},{});return Object.keys(t).map(function(i){return t[i]})}var vl={placement:"bottom",modifiers:[],strategy:"absolute"};function xl(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function yl(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,n=i===void 0?[]:i,s=t.defaultOptions,o=s===void 0?vl:s;return function(a,l,c){c===void 0&&(c=o);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},vl,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],f=!1,u={state:h,setOptions:function(v){var w=typeof v=="function"?v(h.options):v;g(),h.options=Object.assign({},o,h.options,w),h.scrollParents={reference:Dt(a)?xe(a):a.contextElement?xe(a.contextElement):[],popper:xe(l)};var M=go(bo([].concat(n,h.options.modifiers)));if(h.orderedModifiers=M.filter(function(O){return O.enabled}),!1){var p;if(getBasePlacement(h.options.placement)===auto)var _;var y,S,k,P,C}return m(),u.update()},forceUpdate:function(){if(!f){var v=h.elements,w=v.reference,M=v.popper;if(!!xl(w,M)){h.rects={reference:po(w,Rt(M),h.options.strategy==="fixed"),popper:Fe(M)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(O){return h.modifiersData[O.name]=Object.assign({},O.data)});for(var p=0,_=0;_<h.orderedModifiers.length;_++){if(h.reset===!0){h.reset=!1,_=-1;continue}var y=h.orderedModifiers[_],S=y.fn,k=y.options,P=k===void 0?{}:k,C=y.name;typeof S=="function"&&(h=S({state:h,options:P,name:C,instance:u})||h)}}}},update:mo(function(){return new Promise(function(b){u.forceUpdate(),b(h)})}),destroy:function(){g(),f=!0}};if(!xl(a,l))return u;u.setOptions(c).then(function(b){!f&&c.onFirstUpdate&&c.onFirstUpdate(b)});function m(){h.orderedModifiers.forEach(function(b){var v=b.name,w=b.options,M=w===void 0?{}:w,p=b.effect;if(typeof p=="function"){var _=p({state:h,name:v,instance:u,options:M}),y=function(){};d.push(_||y)}})}function g(){d.forEach(function(b){return b()}),d=[]}return u}}var Wu=[cl,ml,ll,zi,gl,dl,bl,rl,pl],vo=yl({defaultModifiers:Wu});var Cl='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',Hu="tippy-box",Al="tippy-content",ju="tippy-backdrop",El="tippy-arrow",Ll="tippy-svg-arrow",He={passive:!0,capture:!0},Rl=function(){return document.body};function xo(e,t,i){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(i)?i[t]:i)}return e}function ko(e,t){var i={}.toString.call(e);return i.indexOf("[object")===0&&i.indexOf(t+"]")>-1}function Il(e,t){return typeof e=="function"?e.apply(void 0,t):e}function _l(e,t){if(t===0)return e;var i;return function(n){clearTimeout(i),i=setTimeout(function(){e(n)},t)}}function $u(e){return e.split(/\s+/).filter(Boolean)}function pi(e){return[].concat(e)}function wl(e,t){e.indexOf(t)===-1&&e.push(t)}function Uu(e){return e.filter(function(t,i){return e.indexOf(t)===i})}function Yu(e){return e.split("-")[0]}function Zn(e){return[].slice.call(e)}function Ml(e){return Object.keys(e).reduce(function(t,i){return e[i]!==void 0&&(t[i]=e[i]),t},{})}function Yi(){return document.createElement("div")}function Qn(e){return["Element","Fragment"].some(function(t){return ko(e,t)})}function Xu(e){return ko(e,"NodeList")}function qu(e){return ko(e,"MouseEvent")}function Ku(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Gu(e){return Qn(e)?[e]:Xu(e)?Zn(e):Array.isArray(e)?e:Zn(document.querySelectorAll(e))}function yo(e,t){e.forEach(function(i){i&&(i.style.transitionDuration=t+"ms")})}function Sl(e,t){e.forEach(function(i){i&&i.setAttribute("data-state",t)})}function Ju(e){var t,i=pi(e),n=i[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function Zu(e,t){var i=t.clientX,n=t.clientY;return e.every(function(s){var o=s.popperRect,r=s.popperState,a=s.props,l=a.interactiveBorder,c=Yu(r.placement),h=r.modifiersData.offset;if(!h)return!0;var d=c==="bottom"?h.top.y:0,f=c==="top"?h.bottom.y:0,u=c==="right"?h.left.x:0,m=c==="left"?h.right.x:0,g=o.top-n+d>l,b=n-o.bottom-f>l,v=o.left-i+u>l,w=i-o.right-m>l;return g||b||v||w})}function _o(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(s){e[n](s,i)})}function kl(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=i.getRootNode==null||(n=i.getRootNode())==null?void 0:n.host}return!1}var Ht={isTouch:!1},Ol=0;function Qu(){Ht.isTouch||(Ht.isTouch=!0,window.performance&&document.addEventListener("mousemove",Fl))}function Fl(){var e=performance.now();e-Ol<20&&(Ht.isTouch=!1,document.removeEventListener("mousemove",Fl)),Ol=e}function tp(){var e=document.activeElement;if(Ku(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function ep(){document.addEventListener("touchstart",Qu,He),window.addEventListener("blur",tp)}var ip=typeof window<"u"&&typeof document<"u",np=ip?!!window.msCrypto:!1;var sp={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},op={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ft=Object.assign({appendTo:Rl,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},sp,op),rp=Object.keys(Ft),ap=function(t){var i=Object.keys(t);i.forEach(function(n){Ft[n]=t[n]})};function Bl(e){var t=e.plugins||[],i=t.reduce(function(n,s){var o=s.name,r=s.defaultValue;if(o){var a;n[o]=e[o]!==void 0?e[o]:(a=Ft[o])!=null?a:r}return n},{});return Object.assign({},e,i)}function lp(e,t){var i=t?Object.keys(Bl(Object.assign({},Ft,{plugins:t}))):rp,n=i.reduce(function(s,o){var r=(e.getAttribute("data-tippy-"+o)||"").trim();if(!r)return s;if(o==="content")s[o]=r;else try{s[o]=JSON.parse(r)}catch{s[o]=r}return s},{});return n}function Pl(e,t){var i=Object.assign({},t,{content:Il(t.content,[e])},t.ignoreAttributes?{}:lp(e,t.plugins));return i.aria=Object.assign({},Ft.aria,i.aria),i.aria={expanded:i.aria.expanded==="auto"?t.interactive:i.aria.expanded,content:i.aria.content==="auto"?t.interactive?null:"describedby":i.aria.content},i}var cp=function(){return"innerHTML"};function Mo(e,t){e[cp()]=t}function Dl(e){var t=Yi();return e===!0?t.className=El:(t.className=Ll,Qn(e)?t.appendChild(e):Mo(t,e)),t}function Tl(e,t){Qn(t.content)?(Mo(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Mo(e,t.content):e.textContent=t.content)}function So(e){var t=e.firstElementChild,i=Zn(t.children);return{box:t,content:i.find(function(n){return n.classList.contains(Al)}),arrow:i.find(function(n){return n.classList.contains(El)||n.classList.contains(Ll)}),backdrop:i.find(function(n){return n.classList.contains(ju)})}}function Nl(e){var t=Yi(),i=Yi();i.className=Hu,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=Yi();n.className=Al,n.setAttribute("data-state","hidden"),Tl(n,e.props),t.appendChild(i),i.appendChild(n),s(e.props,e.props);function s(o,r){var a=So(t),l=a.box,c=a.content,h=a.arrow;r.theme?l.setAttribute("data-theme",r.theme):l.removeAttribute("data-theme"),typeof r.animation=="string"?l.setAttribute("data-animation",r.animation):l.removeAttribute("data-animation"),r.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof r.maxWidth=="number"?r.maxWidth+"px":r.maxWidth,r.role?l.setAttribute("role",r.role):l.removeAttribute("role"),(o.content!==r.content||o.allowHTML!==r.allowHTML)&&Tl(c,e.props),r.arrow?h?o.arrow!==r.arrow&&(l.removeChild(h),l.appendChild(Dl(r.arrow))):l.appendChild(Dl(r.arrow)):h&&l.removeChild(h)}return{popper:t,onUpdate:s}}Nl.$$tippy=!0;var hp=1,Jn=[],wo=[];function dp(e,t){var i=Pl(e,Object.assign({},Ft,Bl(Ml(t)))),n,s,o,r=!1,a=!1,l=!1,c=!1,h,d,f,u=[],m=_l(Ki,i.interactiveDebounce),g,b=hp++,v=null,w=Uu(i.plugins),M={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},p={id:b,reference:e,popper:Yi(),popperInstance:v,props:i,state:M,plugins:w,clearDelayTimeouts:tn,setProps:en,setContent:nn,show:Wl,hide:Hl,hideWithInteractivity:jl,enable:xi,disable:Qi,unmount:$l,destroy:Ul};if(!i.render)return p;var _=i.render(p),y=_.popper,S=_.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+p.id,p.popper=y,e._tippy=p,y._tippy=p;var k=w.map(function(x){return x.fn(p)}),P=e.hasAttribute("aria-expanded");return Ue(),ot(),W(),q("onCreate",[p]),i.showOnCreate&&vi(),y.addEventListener("mouseenter",function(){p.props.interactive&&p.state.isVisible&&p.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){p.props.interactive&&p.props.trigger.indexOf("mouseenter")>=0&&$().addEventListener("mousemove",m)}),p;function C(){var x=p.props.touch;return Array.isArray(x)?x:[x,0]}function O(){return C()[0]==="hold"}function T(){var x;return!!((x=p.props.render)!=null&&x.$$tippy)}function L(){return g||e}function $(){var x=L().parentNode;return x?Ju(x):document}function I(){return So(y)}function F(x){return p.state.isMounted&&!p.state.isVisible||Ht.isTouch||h&&h.type==="focus"?0:xo(p.props.delay,x?0:1,Ft.delay)}function W(x){x===void 0&&(x=!1),y.style.pointerEvents=p.props.interactive&&!x?"":"none",y.style.zIndex=""+p.props.zIndex}function q(x,D,A){if(A===void 0&&(A=!0),k.forEach(function(B){B[x]&&B[x].apply(B,D)}),A){var H;(H=p.props)[x].apply(H,D)}}function ft(){var x=p.props.aria;if(!!x.content){var D="aria-"+x.content,A=y.id,H=pi(p.props.triggerTarget||e);H.forEach(function(B){var ut=B.getAttribute(D);if(p.state.isVisible)B.setAttribute(D,ut?ut+" "+A:A);else{var kt=ut&&ut.replace(A,"").trim();kt?B.setAttribute(D,kt):B.removeAttribute(D)}})}}function ot(){if(!(P||!p.props.aria.expanded)){var x=pi(p.props.triggerTarget||e);x.forEach(function(D){p.props.interactive?D.setAttribute("aria-expanded",p.state.isVisible&&D===L()?"true":"false"):D.removeAttribute("aria-expanded")})}}function St(){$().removeEventListener("mousemove",m),Jn=Jn.filter(function(x){return x!==m})}function rt(x){if(!(Ht.isTouch&&(l||x.type==="mousedown"))){var D=x.composedPath&&x.composedPath()[0]||x.target;if(!(p.props.interactive&&kl(y,D))){if(pi(p.props.triggerTarget||e).some(function(A){return kl(A,D)})){if(Ht.isTouch||p.state.isVisible&&p.props.trigger.indexOf("click")>=0)return}else q("onClickOutside",[p,x]);p.props.hideOnClick===!0&&(p.clearDelayTimeouts(),p.hide(),a=!0,setTimeout(function(){a=!1}),p.state.isMounted||ct())}}}function wt(){l=!0}function at(){l=!1}function lt(){var x=$();x.addEventListener("mousedown",rt,!0),x.addEventListener("touchend",rt,He),x.addEventListener("touchstart",at,He),x.addEventListener("touchmove",wt,He)}function ct(){var x=$();x.removeEventListener("mousedown",rt,!0),x.removeEventListener("touchend",rt,He),x.removeEventListener("touchstart",at,He),x.removeEventListener("touchmove",wt,He)}function je(x,D){$e(x,function(){!p.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&D()})}function jt(x,D){$e(x,D)}function $e(x,D){var A=I().box;function H(B){B.target===A&&(_o(A,"remove",H),D())}if(x===0)return D();_o(A,"remove",d),_o(A,"add",H),d=H}function ie(x,D,A){A===void 0&&(A=!1);var H=pi(p.props.triggerTarget||e);H.forEach(function(B){B.addEventListener(x,D,A),u.push({node:B,eventType:x,handler:D,options:A})})}function Ue(){O()&&(ie("touchstart",gi,{passive:!0}),ie("touchend",Gi,{passive:!0})),$u(p.props.trigger).forEach(function(x){if(x!=="manual")switch(ie(x,gi),x){case"mouseenter":ie("mouseleave",Gi);break;case"focus":ie(np?"focusout":"blur",mi);break;case"focusin":ie("focusout",mi);break}})}function qi(){u.forEach(function(x){var D=x.node,A=x.eventType,H=x.handler,B=x.options;D.removeEventListener(A,H,B)}),u=[]}function gi(x){var D,A=!1;if(!(!p.state.isEnabled||bi(x)||a)){var H=((D=h)==null?void 0:D.type)==="focus";h=x,g=x.currentTarget,ot(),!p.state.isVisible&&qu(x)&&Jn.forEach(function(B){return B(x)}),x.type==="click"&&(p.props.trigger.indexOf("mouseenter")<0||r)&&p.props.hideOnClick!==!1&&p.state.isVisible?A=!0:vi(x),x.type==="click"&&(r=!A),A&&!H&&ye(x)}}function Ki(x){var D=x.target,A=L().contains(D)||y.contains(D);if(!(x.type==="mousemove"&&A)){var H=ne().concat(y).map(function(B){var ut,kt=B._tippy,Ye=(ut=kt.popperInstance)==null?void 0:ut.state;return Ye?{popperRect:B.getBoundingClientRect(),popperState:Ye,props:i}:null}).filter(Boolean);Zu(H,x)&&(St(),ye(x))}}function Gi(x){var D=bi(x)||p.props.trigger.indexOf("click")>=0&&r;if(!D){if(p.props.interactive){p.hideWithInteractivity(x);return}ye(x)}}function mi(x){p.props.trigger.indexOf("focusin")<0&&x.target!==L()||p.props.interactive&&x.relatedTarget&&y.contains(x.relatedTarget)||ye(x)}function bi(x){return Ht.isTouch?O()!==x.type.indexOf("touch")>=0:!1}function Ji(){Zi();var x=p.props,D=x.popperOptions,A=x.placement,H=x.offset,B=x.getReferenceClientRect,ut=x.moveTransition,kt=T()?So(y).arrow:null,Ye=B?{getBoundingClientRect:B,contextElement:B.contextElement||L()}:e,Oo={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(sn){var Xe=sn.state;if(T()){var Yl=I(),ns=Yl.box;["placement","reference-hidden","escaped"].forEach(function(on){on==="placement"?ns.setAttribute("data-placement",Xe.placement):Xe.attributes.popper["data-popper-"+on]?ns.setAttribute("data-"+on,""):ns.removeAttribute("data-"+on)}),Xe.attributes.popper={}}}},_e=[{name:"offset",options:{offset:H}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ut}},Oo];T()&&kt&&_e.push({name:"arrow",options:{element:kt,padding:3}}),_e.push.apply(_e,D?.modifiers||[]),p.popperInstance=vo(Ye,y,Object.assign({},D,{placement:A,onFirstUpdate:f,modifiers:_e}))}function Zi(){p.popperInstance&&(p.popperInstance.destroy(),p.popperInstance=null)}function $t(){var x=p.props.appendTo,D,A=L();p.props.interactive&&x===Rl||x==="parent"?D=A.parentNode:D=Il(x,[A]),D.contains(y)||D.appendChild(y),p.state.isMounted=!0,Ji()}function ne(){return Zn(y.querySelectorAll("[data-tippy-root]"))}function vi(x){p.clearDelayTimeouts(),x&&q("onTrigger",[p,x]),lt();var D=F(!0),A=C(),H=A[0],B=A[1];Ht.isTouch&&H==="hold"&&B&&(D=B),D?n=setTimeout(function(){p.show()},D):p.show()}function ye(x){if(p.clearDelayTimeouts(),q("onUntrigger",[p,x]),!p.state.isVisible){ct();return}if(!(p.props.trigger.indexOf("mouseenter")>=0&&p.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(x.type)>=0&&r)){var D=F(!1);D?s=setTimeout(function(){p.state.isVisible&&p.hide()},D):o=requestAnimationFrame(function(){p.hide()})}}function xi(){p.state.isEnabled=!0}function Qi(){p.hide(),p.state.isEnabled=!1}function tn(){clearTimeout(n),clearTimeout(s),cancelAnimationFrame(o)}function en(x){if(!p.state.isDestroyed){q("onBeforeUpdate",[p,x]),qi();var D=p.props,A=Pl(e,Object.assign({},D,Ml(x),{ignoreAttributes:!0}));p.props=A,Ue(),D.interactiveDebounce!==A.interactiveDebounce&&(St(),m=_l(Ki,A.interactiveDebounce)),D.triggerTarget&&!A.triggerTarget?pi(D.triggerTarget).forEach(function(H){H.removeAttribute("aria-expanded")}):A.triggerTarget&&e.removeAttribute("aria-expanded"),ot(),W(),S&&S(D,A),p.popperInstance&&(Ji(),ne().forEach(function(H){requestAnimationFrame(H._tippy.popperInstance.forceUpdate)})),q("onAfterUpdate",[p,x])}}function nn(x){p.setProps({content:x})}function Wl(){var x=p.state.isVisible,D=p.state.isDestroyed,A=!p.state.isEnabled,H=Ht.isTouch&&!p.props.touch,B=xo(p.props.duration,0,Ft.duration);if(!(x||D||A||H)&&!L().hasAttribute("disabled")&&(q("onShow",[p],!1),p.props.onShow(p)!==!1)){if(p.state.isVisible=!0,T()&&(y.style.visibility="visible"),W(),lt(),p.state.isMounted||(y.style.transition="none"),T()){var ut=I(),kt=ut.box,Ye=ut.content;yo([kt,Ye],0)}f=function(){var _e;if(!(!p.state.isVisible||c)){if(c=!0,y.offsetHeight,y.style.transition=p.props.moveTransition,T()&&p.props.animation){var is=I(),sn=is.box,Xe=is.content;yo([sn,Xe],B),Sl([sn,Xe],"visible")}ft(),ot(),wl(wo,p),(_e=p.popperInstance)==null||_e.forceUpdate(),q("onMount",[p]),p.props.animation&&T()&&jt(B,function(){p.state.isShown=!0,q("onShown",[p])})}},$t()}}function Hl(){var x=!p.state.isVisible,D=p.state.isDestroyed,A=!p.state.isEnabled,H=xo(p.props.duration,1,Ft.duration);if(!(x||D||A)&&(q("onHide",[p],!1),p.props.onHide(p)!==!1)){if(p.state.isVisible=!1,p.state.isShown=!1,c=!1,r=!1,T()&&(y.style.visibility="hidden"),St(),ct(),W(!0),T()){var B=I(),ut=B.box,kt=B.content;p.props.animation&&(yo([ut,kt],H),Sl([ut,kt],"hidden"))}ft(),ot(),p.props.animation?T()&&je(H,p.unmount):p.unmount()}}function jl(x){$().addEventListener("mousemove",m),wl(Jn,m),m(x)}function $l(){p.state.isVisible&&p.hide(),p.state.isMounted&&(Zi(),ne().forEach(function(x){x._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),wo=wo.filter(function(x){return x!==p}),p.state.isMounted=!1,q("onHidden",[p]))}function Ul(){p.state.isDestroyed||(p.clearDelayTimeouts(),p.unmount(),qi(),delete e._tippy,p.state.isDestroyed=!0,q("onDestroy",[p]))}}function Xi(e,t){t===void 0&&(t={});var i=Ft.plugins.concat(t.plugins||[]);ep();var n=Object.assign({},t,{plugins:i}),s=Gu(e);if(!1)var o,r;var a=s.reduce(function(l,c){var h=c&&dp(c,n);return h&&l.push(h),l},[]);return Qn(e)?a[0]:a}Xi.defaultProps=Ft;Xi.setDefaultProps=ap;Xi.currentInput=Ht;var jv=Object.assign({},zi,{effect:function(t){var i=t.state,n={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(i.elements.popper.style,n.popper),i.styles=n,i.elements.arrow&&Object.assign(i.elements.arrow.style,n.arrow)}});Xi.setDefaultProps({render:Nl});var zl=Xi;var fp={destroyed(){this.tippy.destroy()},mounted(){let e=this.el.getAttribute("data-title");this.tippy=zl(this.el,{arrow:Cl,content:e,delay:[250,null]})},updated(){let e=this.el.getAttribute("data-title");this.tippy.setContent(e)}},Vl=fp;var up={Charter:Ya,Completer:Xa,HistoryBack:qa,Instantiator:Ka,Refresher:Ga,Relativize:Ja,Shortcuts:Za,SidebarResizer:Qa,Themer:tl,Tippy:Vl},ts;es.default.config({barColors:{0:"#0284c7"},shadowColor:"rgba(0, 0, 0, .3)"});window.addEventListener("phx:page-loading-start",e=>{ts||(ts=setTimeout(()=>es.default.show(),500))});window.addEventListener("phx:page-loading-stop",e=>{clearTimeout(ts),ts=void 0,es.default.hide()});var pp=document.querySelector("meta[name='csrf-token']").getAttribute("content"),gp=document.querySelector("meta[name='live-transport']").getAttribute("content"),mp=document.querySelector("meta[name='live-path']").getAttribute("content"),bp=new LiveView.LiveSocket(mp,Phoenix.Socket,{transport:gp==="longpoll"?Phoenix.LongPoll:WebSocket,params:{_csrf_token:pp,init_state:To()},hooks:up});bp.connect();})();
/*!
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/
/*!
* Chart.js v4.4.7
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/
/**
* @license MIT
* topbar 1.0.0, 2021-01-06
* http://buunguyen.github.io/topbar
* Copyright (c) 2021 Buu Nguyen
*/