PageSourceSearch

https://tochno.st/_nuxt/C1qi-XKH.js

js tochno.st collected 2026-09-25 08:27:35 UTC 182,297 bytes, 3 lines download raw bytes

1import{B as Li}from"./C9Ni6m5k.js";import{_ as Kn}from"./Dl2H62YF.js";import{_ as qn}from"./DKTOfJ8C.js";import{_ as Gn}from"./DLec1TvK.js";import Zn from"./Rcjl5DPr.js";import{e as $t,X as Zs,a9 as oi,aa as Jn,r as ri,j as Qn,K as to,k as Js,ab as ai,ac as Qs,H as eo,i as W,o as F,c as z,m as H,q as Te,x as Z,F as ht,n as Ct,C as io,a as I,t as pt,p as so,z as tn,b as Dt,d as pe,w as li,f as no,B as Ai,h as Ii,u as oo}from"./DgttN8Q_.js";import{_ as ro}from"./DK5s4G1t.js";import{u as ao}from"./jG_OYvwS.js";import{u as lo,a as Fi}from"./BawgSZT1.js";import"./Bg5nWhxQ.js";import"./BzEA7Oob.js";import"./BV26t87A.js";import"./CXXg9FCC.js";import"./JhHjMal8.js";import"./DLhWdRnk.js";import"./C-n1W3Gn.js";import"./D8m6L-wo.js";import"./BOInjHVb.js";import"./ZhWAdK_X.js";import"./Cy7uFtrf.js";import"./z6wUNT-H.js";import"./SxrpxHGF.js";import"./PtpH1yeK.js";import"./CLI367iC.js";import"./CNeT7pVu.js";import"./BDThqjE3.js";function ue(i){return i+.5|0}const mt=(i,t,e)=>Math.max(Math.min(i,e),t);function Jt(i){return mt(ue(i*2.55),0,255)}function bt(i){return mt(ue(i*255),0,255)}function gt(i){return mt(ue(i/2.55)/100,0,1)}function Ri(i){return mt(ue(i*100),0,100)}const tt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ci=[..."0123456789ABCDEF"],co=i=>ci[i&15],ho=i=>ci[(i&240)>>4]+ci[i&15],me=i=>(i&240)>>4===(i&15),uo=i=>me(i.r)&&me(i.g)&&me(i.b)&&me(i.a);function fo(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&tt[i[1]]*17,g:255&tt[i[2]]*17,b:255&tt[i[3]]*17,a:t===5?tt[i[4]]*17:255}:(t===7||t===9)&&(e={r:tt[i[1]]<<4|tt[i[2]],g:tt[i[3]]<<4|tt[i[4]],b:tt[i[5]]<<4|tt[i[6]],a:t===9?tt[i[7]]<<4|tt[i[8]]:255})),e}const go=(i,t)=>i<255?t(i):"";function po(i){var t=uo(i)?co:ho;return i?"#"+t(i.r)+t(i.g)+t(i.b)+go(i.a,t):void 0}const mo=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function en(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function bo(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function _o(i,t,e){const s=en(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function xo(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function _i(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),r=Math.min(e,s,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=xo(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function xi(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(bt)}function yi(i,t,e){return xi(en,i,t,e)}function yo(i,t,e){return xi(_o,i,t,e)}function vo(i,t,e){return xi(bo,i,t,e)}function sn(i){return(i%360+360)%360}function wo(i){const t=mo.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Jt(+t[5]):bt(+t[5]));const n=sn(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=yo(n,o,r):t[1]==="hsv"?s=vo(n,o,r):s=yi(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function ko(i,t){var e=_i(i);e[0]=sn(e[0]+t),e=yi(e),i.r=e[0],i.g=e[1],i.b=e[2]}function So(i){if(!i)return;const t=_i(i),e=t[0],s=Ri(t[1]),n=Ri(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${gt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Ei={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"},zi={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 Mo(){const i={},t=Object.keys(zi),e=Object.keys(Ei);let s,n,o,r,a;for(s=0;s<t.length;s++){for(r=a=t[s],n=0;n<e.length;n++)o=e[n],a=a.replace(o,Ei[o]);o=parseInt(zi[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let be;function Co(i){be||(be=Mo(),be.transparent=[0,0,0,0]);const t=be[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Do=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Po(i){const t=Do.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Jt(r):mt(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Jt(s):mt(s,0,255)),n=255&(t[4]?Jt(n):mt(n,0,255)),o=255&(t[6]?Jt(o):mt(o,0,255)),{r:s,g:n,b:o,a:e}}}function Oo(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${gt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ke=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Et=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function To(i,t,e){const s=Et(gt(i.r)),n=Et(gt(i.g)),o=Et(gt(i.b));return{r:bt(Ke(s+e*(Et(gt(t.r))-s))),g:bt(Ke(n+e*(Et(gt(t.g))-n))),b:bt(Ke(o+e*(Et(gt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function _e(i,t,e){if(i){let s=_i(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=yi(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function nn(i,t){return i&&Object.assign(t||{},i)}function Bi(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=bt(i[3]))):(t=nn(i,{r:0,g:0,b:0,a:1}),t.a=bt(t.a)),t}function Lo(i){return i.charAt(0)==="r"?Po(i):wo(i)}class re{constructor(t){if(t instanceof re)return t;const e=typeof t;let s;e==="object"?s=Bi(t):e==="string"&&(s=fo(t)||Co(t)||Lo(t)),this._rgb=s,this._val
1id=!!s}get valid(){return this._valid}get rgb(){var t=nn(this._rgb);return t&&(t.a=gt(t.a)),t}set rgb(t){this._rgb=Bi(t)}rgbString(){return this._valid?Oo(this._rgb):void 0}hexString(){return this._valid?po(this._rgb):void 0}hslString(){return this._valid?So(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=To(this._rgb,t._rgb,e)),this}clone(){return new re(this.rgb)}alpha(t){return this._rgb.a=bt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ue(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _e(this._rgb,2,t),this}darken(t){return _e(this._rgb,2,-t),this}saturate(t){return _e(this._rgb,1,t),this}desaturate(t){return _e(this._rgb,1,-t),this}rotate(t){return ko(this._rgb,t),this}}function dt(){}const Ao=(()=>{let i=0;return()=>i++})();function N(i){return i==null}function U(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function E(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function q(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function rt(i,t){return q(i)?i:t}function R(i,t){return typeof i>"u"?t:i}const Io=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function V(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function B(i,t,e,s){let n,o,r;if(U(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(E(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function Ie(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Fe(i){if(U(i))return i.map(Fe);if(E(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=Fe(i[e[n]]);return t}return i}function on(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Fo(i,t,e,s){if(!on(i))return;const n=t[i],o=e[i];E(n)&&E(o)?ae(n,o,s):t[i]=Fe(o)}function ae(i,t,e){const s=U(t)?t:[t],n=s.length;if(!E(i))return i;e=e||{};const o=e.merger||Fo;let r;for(let a=0;a<n;++a){if(r=s[a],!E(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function ee(i,t){return ae(i,t,{merger:Ro})}function Ro(i,t,e){if(!on(i))return;const s=t[i],n=e[i];E(s)&&E(n)?ee(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Fe(n))}const Hi={"":i=>i,x:i=>i.x,y:i=>i.y};function Eo(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function zo(i){const t=Eo(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Re(i,t){return(Hi[t]||(Hi[t]=zo(t)))(i)}function vi(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Ee=i=>typeof i<"u",_t=i=>typeof i=="function",Ni=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Bo(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const Y=Math.PI,ot=2*Y,Ho=ot+Y,ze=Number.POSITIVE_INFINITY,No=Y/180,nt=Y/2,vt=Y/4,Wi=Y*2/3,rn=Math.log10,Nt=Math.sign;function ie(i,t,e){return Math.abs(i-t)<e}function Vi(i){const t=Math.round(i);i=ie(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(rn(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Wo(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function Vo(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function le(i){return!Vo(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function $o(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function jo(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Pt(i){return i*(Y/180)}function Uo(i){return i*(180/Y)}function $i(i){if(!q(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Yo(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*Y&&(o+=ot),{angle:o,distance:n}}function hi(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Xo(i,t){return(i-t+Ho)%ot-Y}function ct(i){return(i%ot+ot)%ot}function an(i,t,e,s){const n=ct(i),o=ct(t),r=ct(e),a=ct(o-n),l=ct(r-n),c=ct(n-o),h=ct(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function et(i,t,e){return Math.max(t,Math.min(e,i))}function Ko(i){return et(i,-32768,32767)}function Bt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function wi(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Ot=(i,t,e,s)=>wi(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),qo=(i,t,e)=>wi(i,e,s=>i[s][t]>=e);function Go(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const ln=["push","pop","shift","splice","unshift"];function Zo(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}
1),ln.forEach(e=>{const s="_onData"+vi(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function ji(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(ln.forEach(o=>{delete i[o]}),delete i._chartjs)}function Jo(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const cn=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function hn(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,cn.call(window,()=>{s=!1,i.apply(t,e)}))}}function Qo(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const ki=i=>i==="start"?"left":i==="end"?"right":"center",X=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,tr=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function er(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(n=Math.min(Ot(l,h,d).lo,e?s:Ot(t,h,r.getPixelForValue(d)).lo),c){const g=l.slice(0,n+1).reverse().findIndex(m=>!N(m[a.axis]));n-=Math.max(0,g)}n=et(n,0,s-1)}if(p){let g=Math.max(Ot(l,r.axis,u,!0).hi+1,e?0:Ot(t,h,r.getPixelForValue(u),!0).hi+1);if(c){const m=l.slice(g-1).findIndex(_=>!N(_[a.axis]));g+=Math.max(0,m)}o=et(g,n,s)-n}else o=s-n}return{start:n,count:o}}function ir(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const xe=i=>i===0||i===1,Ui=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*ot/e)),Yi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*ot/e)+1,se={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*nt)+1,easeOutSine:i=>Math.sin(i*nt),easeInOutSine:i=>-.5*(Math.cos(Y*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>xe(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>xe(i)?i:Ui(i,.075,.3),easeOutElastic:i=>xe(i)?i:Yi(i,.075,.3),easeInOutElastic(i){return xe(i)?i:i<.5?.5*Ui(i*2,.1125,.45):.5+.5*Yi(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-se.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?se.easeInBounce(i*2)*.5:se.easeOutBounce(i*2-1)*.5+.5};function Si(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Xi(i){return Si(i)?i:new re(i)}function qe(i){return Si(i)?i:new re(i).saturate(.5).darken(.1).hexString()}const sr=["x","y","borderWidth","radius","tension"],nr=["color","borderColor","backgroundColor"];function or(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:nr},numbers:{type:"number",properties:sr}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function rr(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ki=new Map;function ar(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Ki.get(e);return s||(s=new Intl.NumberFormat(i,t),Ki.set(e,s)),s}function dn(i,t,e){return ar(t,e).format(i)}const lr={values(i){return U(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=cr(i,e)}const r=rn(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),dn(i,s,l)}};function cr(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var un={formatters:lr};function hr(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:un.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Lt=Object.create(null),di=Object.create(null);function ne(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Ge(i,t,e){return typeof t=="string"?ae(ne(i,t),e):ae(ne(i,""),t)}class dr{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.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={}
1,this.hoverBackgroundColor=(s,n)=>qe(n.backgroundColor),this.hoverBorderColor=(s,n)=>qe(n.borderColor),this.hoverColor=(s,n)=>qe(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Ge(this,t,e)}get(t){return ne(this,t)}describe(t,e){return Ge(di,t,e)}override(t,e){return Ge(Lt,t,e)}route(t,e,s,n){const o=ne(this,t),r=ne(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return E(l)?Object.assign({},c,l):R(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var j=new dr({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[or,rr,hr]);function ur(i){return!i||N(i.size)||N(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function qi(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function wt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function Gi(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function ui(i,t,e,s){fn(i,t,e,s,null)}function fn(i,t,e,s,n){let o,r,a,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*No;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,g,0,0,ot):i.arc(e,s,g,0,ot),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Wi,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Wi,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+vt)*l,d=Math.cos(m+vt)*(n?n/2-c:l),a=Math.sin(m+vt)*l,u=Math.sin(m+vt)*(n?n/2-c:l),i.arc(e-d,s-a,c,m-Y,m-nt),i.arc(e+u,s-r,c,m-nt,m),i.arc(e+d,s+a,c,m,m+nt),i.arc(e-u,s+r,c,m+nt,m+Y),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}m+=vt;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+u,s-r),i.lineTo(e+d,s+a),i.lineTo(e-u,s+r),i.closePath();break;case"crossRot":m+=vt;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r),m+=vt,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ce(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function Ne(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function We(i){i.restore()}function fr(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function gr(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function pr(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),N(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function mr(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function br(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function he(i,t,e,s,n,o={}){const r=U(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,pr(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&br(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),N(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),mr(i,e,s,c,o),s+=Number(n.lineHeight);
1i.restore()}function fi(i,t){const{x:e,y:s,w:n,h:o,radius:r}=t;i.arc(e+r.topLeft,s+r.topLeft,r.topLeft,1.5*Y,Y,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,Y,nt,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,nt,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-nt,!0),i.lineTo(e+r.topLeft,s)}const _r=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,xr=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yr(i,t){const e=(""+i).match(_r);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const vr=i=>+i||0;function gn(i,t){const e={},s=E(t),n=s?Object.keys(t):t,o=E(i)?s?r=>R(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=vr(o(r));return e}function wr(i){return gn(i,{top:"y",right:"x",bottom:"y",left:"x"})}function oe(i){return gn(i,["topLeft","topRight","bottomLeft","bottomRight"])}function st(i){const t=wr(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function K(i,t){i=i||{},t=t||j.font;let e=R(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=R(i.style,t.style);s&&!(""+s).match(xr)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:R(i.family,t.family),lineHeight:yr(R(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:R(i.weight,t.weight),string:""};return n.string=ur(n),n}function ye(i,t,e,s){let n,o,r;for(n=0,o=i.length;n<o;++n)if(r=i[n],r!==void 0&&r!==void 0)return r}function kr(i,t,e){const{min:s,max:n}=i,o=Io(t,(n-s)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function At(i,t){return Object.assign(Object.create(i),t)}function Mi(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=_n("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>Mi([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return mn(a,l,()=>Lr(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Ji(a).includes(l)},ownKeys(a){return Ji(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function Wt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:pn(i,s),setContext:o=>Wt(i,o,e,s),override:o=>Wt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return mn(o,r,()=>Mr(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function pn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:_t(e)?e:()=>e,isIndexable:_t(s)?s:()=>s}}const Sr=(i,t)=>i?i+vi(t):t,Ci=(i,t)=>E(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function mn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function Mr(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return _t(a)&&r.isScriptable(t)&&(a=Cr(t,a,i,e)),U(a)&&a.length&&(a=Dr(t,a,i,r.isIndexable)),Ci(t,a)&&(a=Wt(a,n,o&&o[t],r)),a}function Cr(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),Ci(i,l)&&(l=Di(n._scopes,n,i,l)),l}function Dr(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(E(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Di(c,n,i,h);t.push(Wt(d,o,r&&r[i],a))}}return t}function bn(i,t,e){return _t(i)?i(t,e):i}const Pr=(i,t)=>i===!0?t:typeof i=="string"?Re(t,i):void 0;function Or(i,t,e,s,n){for(const o of t){const r=Pr(e,o);if(r){i.add(r);const a=bn(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function Di(i,t,e,s){const n=t._rootScopes,o=bn(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Zi(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=Zi(a,r,o,l,s),l===null)?!1:Mi(Array.from(a),[""],n,o,()=>Tr(t,e,s))}function Zi(i,t,e,s,n){for(;e;)e=Or(i,t,e,s,n);return e}function Tr(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return U(n)&&E(e)?e:n||{}}function Lr(i,t,e,s){let n;for(const o of t)if(n=_n(Sr(o,i),e),typeof n<"u")return Ci(i,n)?Di(e,s,i,n):n}function _n(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Ji(i){let t=i._keys;return t||(t=i._keys=Ar(i._scopes)),t}function Ar(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const Ir=Number.EPSILON||1e-14,Vt=(i,t)=>t<i.length&&!i[t].skip&&i[t],xn=i=>i==="x"?"y":"x";function Fr(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=hi(o,n),l=hi(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function Rr(i,t,e){const s=i.length;let n,o,r,a,l,c=Vt(i,0);for(let h=0;h<s-1;++h)if(l=c,c=Vt(i,h+1),!(!l||!c)){if(ie(t[h],0,Ir)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=n*r*t[h],e[h+1]=o*r*t[h])}}function Er(i,t,e="x"){const s=xn(e),n=i.length;let o,r,a,l=Vt(i,0);for(let c=0;c<n;++c){if(r=a,a=l,l=Vt(i,c+1),!a)continue;const h=a[e],d=a[s];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${s}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${s}`]=d+o*t[c])}}function zr(i,t="x"){const e=xn(t),s=i.length,n=Array(s).fill(0),o=Array(s);let r,a,l,c=Vt(i,0);for(r=0;r<s;++r)if(a=l,l=c,c=Vt(i,r+1),!!l){if(c){const h=c[t]-l[t];n[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?Nt(n[r-1])!==Nt(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}Rr(i,n,o),Er(i,o,t)}function ve(i,t,e){return Math.max(Math.min(i,e),t)}function Br(i,t){let e,s,n,o,r,a=ce(i[0],t);for(e=0,s=i.length;e<s;
1++e)r=o,o=a,a=e<s-1&&ce(i[e+1],t),o&&(n=i[e],r&&(n.cp1x=ve(n.cp1x,t.left,t.right),n.cp1y=ve(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=ve(n.cp2x,t.left,t.right),n.cp2y=ve(n.cp2y,t.top,t.bottom)))}function Hr(i,t,e,s,n){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")zr(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=Fr(c,a,i[Math.min(o+1,r-(s?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Br(i,e)}function Pi(){return typeof window<"u"&&typeof document<"u"}function Oi(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Be(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const Ve=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Nr(i,t){return Ve(i).getPropertyValue(t)}const Wr=["top","right","bottom","left"];function Tt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Wr[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Vr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function $r(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(Vr(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function St(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Ve(e),o=n.boxSizing==="border-box",r=Tt(n,"padding"),a=Tt(n,"border","width"),{x:l,y:c,box:h}=$r(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/p*e.height/s)}}function jr(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&Oi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Ve(o),l=Tt(a,"border","width"),c=Tt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=Be(a.maxWidth,o,"clientWidth"),n=Be(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||ze,maxHeight:n||ze}}const we=i=>Math.round(i*10)/10;function Ur(i,t,e,s){const n=Ve(i),o=Tt(n,"margin"),r=Be(n.maxWidth,i,"clientWidth")||ze,a=Be(n.maxHeight,i,"clientHeight")||ze,l=jr(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=Tt(n,"border","width"),f=Tt(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=we(Math.min(c,r,l.maxWidth)),h=we(Math.min(h,a,l.maxHeight)),c&&!h&&(h=we(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=we(Math.floor(h*s))),{width:c,height:h}}function Qi(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Yr=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Pi()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function ts(i,t){const e=Nr(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Mt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Xr(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Kr(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Mt(i,n,e),a=Mt(n,o,e),l=Mt(o,t,e),c=Mt(r,a,e),h=Mt(a,l,e);return Mt(c,h,e)}const qr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Gr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Ht(i,t,e){return i?qr(t,e):Gr()}function yn(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function vn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function wn(i){return i==="angle"?{between:an,compare:Xo,normalize:ct}:{between:Bt,compare:(t,e)=>t-e,normalize:t=>t}}function es({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Zr(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=wn(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&r(a(t[c%l][s]),n,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function kn(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=wn(s),{start:h,end:d,loop:u,style:f}=Zr(i,t,e),p=[];let g=!1,m=null,_,w,M;const D=()=>l(n,M,_)&&a(n,M)!==0,y=()=>a(o,_)===0||l(o,M,_),O=()=>g||D(),P=()=>!g||y();for(let b=h,x=h;b<=d;++b)w=t[b%r],!w.skip&&(_=c(w[s]),_!==M&&(g=l(_,n,o),m===null&&O()&&(m=a(_,n)===0?b:x),m!==null&&P()&&(p.push(es({start:m,end:b,loop:u,count:r,style:f})),m=null),x=b,M=_));return m!==null&&p.push(es({start:m,end:d,loop:u,count:r,style:f})),p}function Sn(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=kn(s[n],i.points,t);o.length&&e.push(...o)}return e}function Jr(i,t,e,s){let n=0,o=t-1;
1if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Qr(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function ta(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=Jr(e,n,o,s);if(s===!0)return is(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,c=!!i._fullLoop&&r===0&&a===n-1;return is(i,Qr(e,r,l,c),e,t)}function is(i,t,e,s){return!s||!s.setContext||!e?t:ea(i,t,e,s)}function ea(i,t,e,s){const n=i._chart.getContext(),o=ss(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,d=t[0].start,u=d;function f(p,g,m,_){const w=a?-1:1;if(p!==g){for(p+=l;e[p%l].skip;)p-=w;for(;e[g%l].skip;)g+=w;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:_}),h=_,d=g%l)}}for(const p of t){d=a?d:p.start;let g=e[d%l],m;for(u=d+1;u<=p.end;u++){const _=e[u%l];m=ss(s.setContext(At(n,{type:"segment",p0:g,p1:_,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),ia(m,h)&&f(d,u-1,p.loop,h),g=_,h=m}d<u-1&&f(d,u-1,p.loop,h)}return c}function ss(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function ia(i,t){if(!t)return!1;const e=[],s=function(n,o){return Si(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}function ke(i,t,e){return i.options.clip?i[e]:t[e]}function sa(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:ke(e,t,"left"),right:ke(e,t,"right"),top:ke(s,t,"top"),bottom:ke(s,t,"bottom")}:t}function Mn(i,t){const e=t._clip;if(e.disabled)return!1;const s=sa(t,i.chartArea);return{left:e.left===!1?0:s.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:s.right+(e.right===!0?0:e.right),top:e.top===!1?0:s.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:s.bottom+(e.bottom===!0?0:e.bottom)}}class na{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=cn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ut=new na;const ns="transparent",oa={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Xi(i||ns),n=s.valid&&Xi(t||ns);
1return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class ra{constructor(t,e,s,n){const o=e[s];n=ye([t.to,n,o,t.from]);const r=ye([t.from,o,n]);this._active=!0,this._fn=t.fn||oa[t.type||typeof r],this._easing=se[t.easing]||se.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ye([t.to,e,n,t.from]),this._from=ye([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class Cn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!E(t))return;const e=Object.keys(j.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!E(o))return;const r={};for(const a of e)r[a]=o[a];(U(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=la(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&aa(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new ra(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return ut.add(this._chart,s),!0}}function aa(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function la(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function os(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function ca(i,t,e){if(e===!1)return!1;const s=os(i,e),n=os(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function ha(i){let t,e,s,n;return E(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Dn(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function rs(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(h=!0,s.all)continue;break}c=i.values[l],q(c)&&(o||t===0||Nt(t)===Nt(c))&&(t+=c)}return!h&&!s.all?0:t}function da(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[n]:h,[o]:i[h]};return a}function Ze(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function ua(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function fa(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function ga(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function as(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function ls(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=ua(o,r,s),d=t.length;let u;for(let f=0;f<d;++f){const p=t[f],{[l]:g,[c]:m}=p,_=p._stacks||(p._stacks={});u=_[c]=ga(n,h,g),u[a]=m,u._top=as(u,r,!0,s.type),u._bottom=as(u,r,!1,s.type);const w=u._visualValues||(u._visualValues={});w[a]=m}}function Je(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function pa(i,t){return At(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ma(i,t,e){return At(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Xt(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;
1if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const Qe=i=>i==="reset"||i==="none",cs=(i,t)=>t?i:Object.assign({},i),ba=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Dn(e,!0),values:null};class Pn{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ze(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&&Xt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=e.xAxisID=R(s.xAxisID,Je(t,"x")),r=e.yAxisID=R(s.yAxisID,Je(t,"y")),a=e.rAxisID=R(s.rAxisID,Je(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&ji(this._data,this),t._stacked&&Xt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(E(e)){const n=this._cachedMeta;this._data=da(e,n)}else if(s!==e){if(s){ji(s,this);const n=this._cachedMeta;Xt(n),n._parsed=[]}e&&Object.isExtensible(e)&&Zo(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Ze(e.vScale,e),e.stack!==s.stack&&(n=!0,Xt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(ls(this,e._parsed),e._stacked=Ze(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{U(n[t])?u=this.parseArrayData(s,n,t,e):E(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);s._sorted=l}r&&ls(this,u)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let u,f,p;for(u=0,f=n;u<f;++u)p=u+s,d[u]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,u,f;for(h=0,d=n;h<d;++h)u=h+s,f=e[u],c[h]={x:o.parse(Re(f,a),u),y:r.parse(Re(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Dn(n,!0),values:e._stacks[t.axis]._visualValues};return rs(a,r,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let r=o===null?NaN:o;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,r=rs(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,r=n.length,a=this._getOtherScale(t),l=ba(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=fa(a);let u,f;function p(){f=n[u];const g=f[a.axis];return!q(f[t.axis])||h>g||d<g}for(u=0;
vendor: 5,999 bytes, line 1
1u<r&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],q(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=ha(R(this.options.clip,ca(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=n[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,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=ma(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=pa(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&Ee(s);if(a)return cs(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(j.elements[t]),p=()=>this.getContext(s,n,e),g=c.resolveNamedOptions(u,f,p,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(cs(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new Cn(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Qe(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){Qe(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Qe(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&Xt(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class _a extends Pn{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=er(e,n,r);this._drawStart=a,this._drawCount=l,ir(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=r.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=le(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||n==="none",w=e+s,M=t.length;let D=e>0&&this.getParsed(e-1);for(let y=0;y<M;++y){const O=t[y],P=_?O:{};if(y<e||y>
1=w){P.skip=!0;continue}const b=this.getParsed(y),x=N(b[f]),S=P[u]=r.getPixelForValue(b[u],y),v=P[f]=o||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,b,l):b[f],y);P.skip=isNaN(S)||isNaN(v)||x,P.stop=y>0&&Math.abs(b[u]-D[u])>m,g&&(P.parsed=b,P.raw=c.data[y]),d&&(P.options=h||this.resolveDataElementOptions(y,O.active?"active":n)),_||this.updateElement(O,y,P,n),D=b}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function kt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ti{static override(t){Object.assign(Ti.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return kt()}parse(){return kt()}format(){return kt()}add(){return kt()}diff(){return kt()}startOf(){return kt()}endOf(){return kt()}}var xa={_date:Ti};function ya(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?qo:Ot;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const u=c(o,t,e-d),f=c(o,t,e+d);return{lo:u.lo,hi:f.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:u}=i,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!N(g[d.axis]));h.lo-=Math.max(0,f);const p=u.slice(h.hi).findIndex(g=>!N(g[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function $e(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:u}=ya(o[a],t,r,n);for(let f=d;f<=u;++f){const p=h[f];p.skip||s(p,c,f)}}}function va(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,r=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function ti(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||$e(i,e,t,function(a,l,c){!n&&!ce(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function wa(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=Yo(r,{x:t.x,y:t.y});an(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return $e(i,e,t,o),n}function ka(i,t,e,s,n,o){let r=[];const a=va(e);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,n);if(s&&!f)return;const p=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(p))&&!f)return;const m=a(t,p);m<l?(r=[{element:h,datasetIndex:d,index:u}],l=m):m===l&&r.push({element:h,datasetIndex:d,index:u})}return $e(i,e,t,c),r}function ei(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?wa(i,t,e,n):ka(i,t,e,s,n,o)}function hs(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return $e(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var Sa={modes:{index(i,t,e,s){const n=St(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?ti(i,n,o,s,r):ei(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=St(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?ti(i,n,o,s,r):ei(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,s){const n=St(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return ti(i,n,o,s,r)},nearest(i,t,e,s){const n=St(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return ei(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=St(t,i);return hs(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=St(t,i);return hs(i,n,"y",e.intersect,s)}}};const On=["left","top","right","bottom"];function Kt(i,t){return i.filter(e=>e.pos===t)}function ds(i,t){return i.filter(e=>On.indexOf(e.pos)===-1&&e.box.axis===t)}function qt(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Ma(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:r,stackWeight:a=1}}
1=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function Ca(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!On.includes(n))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Da(i,t){const e=Ca(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return e}function Pa(i){const t=Ma(i),e=qt(t.filter(c=>c.box.fullSize),!0),s=qt(Kt(t,"left"),!0),n=qt(Kt(t,"right")),o=qt(Kt(t,"top"),!0),r=qt(Kt(t,"bottom")),a=ds(t,"x"),l=ds(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:Kt(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function us(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Tn(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Oa(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!E(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Tn(r,o.getPadding());const a=Math.max(0,t.outerWidth-us(r,i,"left","right")),l=Math.max(0,t.outerHeight-us(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Ta(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function La(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Qt(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,La(a.horizontal,t));const{same:d,other:u}=Oa(t,e,a,s);c|=d&&n.length,h=h||u,l.fullSize||n.push(a)}return c&&Qt(n,t,e,s)||h}function Se(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function fs(i,t,e,s){const n=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=s[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,u=c.size||l.height;Ee(c.start)&&(r=c.start),l.fullSize?Se(l,n.left,r,e.outerWidth-n.right-n.left,u):Se(l,t.left+c.placed,r,d,u),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,u=c.size||l.width;Ee(c.start)&&(o=c.start),l.fullSize?Se(l,o,n.top,u,e.outerHeight-n.bottom-n.top):Se(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var it={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=st(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=Pa(i.boxes),l=a.vertical,c=a.horizontal;B(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Tn(u,st(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),p=Da(l.concat(c),d);Qt(a.fullSize,f,d,p),Qt(l,f,d,p),Qt(c,f,d,p)&&Qt(l,f,d,p),Ta(f),fs(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,fs(a.rightAndBottom,f,d,p),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},B(a.chartArea,g=>{const m=g.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Ln{acquireContext(t,e){}releaseContext(t){return!1}
1addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class Aa extends Ln{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Le="$chartjs",Ia={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},gs=i=>i===null||i==="";function Fa(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[Le]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",gs(n)){const o=ts(i,"width");o!==void 0&&(i.width=o)}if(gs(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=ts(i,"height");o!==void 0&&(i.height=o)}return i}const An=Yr?{passive:!0}:!1;function Ra(i,t,e){i&&i.addEventListener(t,e,An)}function Ea(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,An)}function za(i,t){const e=Ia[i.type]||i.type,{x:s,y:n}=St(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function He(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Ba(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||He(a.addedNodes,s),r=r&&!He(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Ha(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||He(a.removedNodes,s),r=r&&!He(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const de=new Map;let ps=0;function In(){const i=window.devicePixelRatio;i!==ps&&(ps=i,de.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Na(i,t){de.size||window.addEventListener("resize",In),de.set(i,t)}function Wa(i){de.delete(i),de.size||window.removeEventListener("resize",In)}function Va(i,t,e){const s=i.canvas,n=s&&Oi(s);if(!n)return;const o=hn((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),Na(i,o),r}function ii(i,t,e){e&&e.disconnect(),t==="resize"&&Wa(i)}function $a(i,t,e){const s=i.canvas,n=hn(o=>{i.ctx!==null&&e(za(o,i))},i);return Ra(s,t,n),n}class ja extends Ln{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Fa(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[Le])return!1;const s=e[Le].initial;["height","width"].forEach(o=>{const r=s[o];N(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Le],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Ba,detach:Ha,resize:Va}[e]||$a;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ii,detach:ii,resize:ii}[e]||Ea)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Ur(t,e,s,n)}isAttached(t){const e=t&&Oi(t);return!!(e&&e.isConnected)}}function Ua(i){return!Pi()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Aa:ja}class It{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return le(this.x)&&le(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}function Ya(i,t){const e=i.options.ticks,s=Xa(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?qa(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Ga(t,c,o,r/n),c;const h=Ka(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(Me(t,c,h,N(f)?0:a-f,a),d=0,u=r-1;d<u;d++)Me(t,c,h,o[d],o[d+1]);return Me(t,c,h,l,N(f)?t.length:l+f),c}return Me(t,c,h),c}function Xa(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Ka(i,t,e){const s=Za(i),n=t.length/e;if(!s)return Math.max(n,1);const o=Wo(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function qa(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Ga(i,t,e,s){let n=0,o=e[0],r;for(s=Math.ceil(s),r=0;r<i.length;r++)r===o&&(t.push(i[r]),n++,o=e[n*s])}function Me(i,t,e,s,n){const o=R(s,0),r=Math.min(R(n,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function Za(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const Ja=i=>
1i==="left"?"right":i==="right"?"left":i,ms=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,bs=(i,t)=>Math.min(t||i,i);function _s(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function Qa(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function tl(i,t){B(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Gt(i){return i.drawTicks?i.tickLength:0}function xs(i,t){if(!i.display)return 0;const e=K(i.font,t),s=st(i.padding);return(U(i.text)?i.text.length:1)*e.lineHeight+s.height}function el(i,t){return At(i,{scale:t,type:"scale"})}function il(i,t,e){return At(i,{tick:e,index:t,type:"tick"})}function sl(i,t,e){let s=ki(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Ja(s)),s}function nl(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,u,f,p;const g=r-n,m=a-o;if(i.isHorizontal()){if(f=X(s,o,a),E(e)){const _=Object.keys(e)[0],w=e[_];p=h[_].getPixelForValue(w)+g-t}else e==="center"?p=(c.bottom+c.top)/2+g-t:p=ms(i,e,t);u=a-o}else{if(E(e)){const _=Object.keys(e)[0],w=e[_];f=h[_].getPixelForValue(w)-m+t}else e==="center"?f=(c.left+c.right)/2-m+t:f=ms(i,e,t);p=X(s,r,n),d=e==="left"?-nt:nt}return{titleX:f,titleY:p,maxWidth:u,rotation:d}}class jt extends It{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=rt(t,Number.POSITIVE_INFINITY),e=rt(e,Number.NEGATIVE_INFINITY),s=rt(s,Number.POSITIVE_INFINITY),n=rt(n,Number.NEGATIVE_INFINITY),{min:rt(t,s),max:rt(e,n),minDefined:q(t),maxDefined:q(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(s=Math.max(s,r.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:rt(e,rt(s,e)),max:rt(s,rt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){V(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=kr(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?_s(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Ya(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){V(this.options.afterUpdate,[this])}beforeSetDimensions(){V(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(){V(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),V(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){V(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=V(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){V(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){V(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=bs(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxR
1otation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=et(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-Gt(t.grid)-e.padding-xs(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Uo(Math.min(Math.asin(et((h.highest.height+6)/a,-1,1)),Math.asin(et(l/c,-1,1))-Math.asin(et(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){V(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){V(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=xs(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Gt(o)+l):(t.height=this.maxHeight,t.width=Gt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,p=Pt(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const _=s.mirror?0:m*d.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+_+f)}else{const _=s.mirror?0:g*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+_+f)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.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(){V(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)N(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=_s(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/bs(e,s));let c=0,h=0,d,u,f,p,g,m,_,w,M,D,y;for(d=0;d<e;d+=l){if(p=t[d].label,g=this._resolveTickFontOptions(d),n.font=m=g.string,_=o[m]=o[m]||{data:{},gc:[]},w=g.lineHeight,M=D=0,!N(p)&&!U(p))M=qi(n,_.data,_.gc,M,p),D=w;else if(U(p))for(u=0,f=p.length;u<f;++u)y=p[u],!N(y)&&!U(y)&&(M=qi(n,_.data,_.gc,M,y),D+=w);r.push(M),a.push(D),c=Math.max(M,c),h=Math.max(D,h)}tl(o,e);const O=r.indexOf(c),P=a.indexOf(h),b=x=>({width:r[x]||0,height:a[x]||0});return{first:b(0),last:b(e-1),widest:b(O),highest:b(P),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Ko(this._alignToPixels?wt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=il(this.getContext(),t,s))}return this.$context||(this.$context=el(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Pt(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Gt(o),f=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,_=function(A){return wt(s,A,g)};let w,M,D,y,O,P,b,x,S,v,k,L;if(r==="top")w=_(this.bottom),P=this.bottom-u,x=w-m,v=_(t.top)+m,L=t.bottom;else if(r==="bottom")w=_(this.top),v=t.top,L=_(t.bottom)-m,P=w+m,x=this.top+u;else if(r==="left")w=_(this.right),O=this.right-u,b=w-m,S=_(t.left)+m,k=t.right;else if(r==="right")w=_(this.left),S=t.left,k=_(t.right)-m,O=w+m,b=this.left+u;else if(e==="x"){if(r==="center")w=_((t.top+t.bottom)/2+.5);else if(E(r)){const A=Object.keys(r)[0],$=r[A];w=_(this.chart.scales[A].getPixelForValue($))}v=t.top,L=t.bottom,P=w+m,x=P+u}else if(e==="y"){if(r==="center")w=_((t.left+t.right)/2);else if(E(r)){const A=Object.keys(r)[0],$=r[A];w=_(this.chart.scales[A].getPixelForValue($))}O=w-m,b=O-u,S=t.left,k=t.right}const C=R(n.ticks.maxTicksLimit,d),T=Math.max(1,Math.ceil(d/C));for(M=0;M<d;M+=T){const A=this.getContext(M),$=o.setContext(A),Q=a.setContext(A),fe=$.lineWidth,Ft=$.color,ge=Q.dash||[],Rt=Q.dashOffset,Ut=$.tickWidth,xt=$.tickColor,Yt=$.tickBorderDash||[],yt=$.tickBorderDashOffset;D=Qa(this,M,l),D!==void 0&&(y=wt(s,D,fe),c?O=b=S=k=y:P=x=v=L=y,f.push({tx1:O,ty1:P,tx2:b,ty2:x,x1:S,y1:v,x2:k,y2:L,width:fe,color:Ft,borderDash:ge,borderDashOffset:Rt,tickWidth:Ut,tickColor:xt,tickBorderDash:Yt,tickBorderDashOffset:yt}))}return this._ticksLength=d,this._borderValue=w,f}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=Gt(s.grid),f=u+h,p=d?-h:f,g=-Pt(this.labelRotation),m=[];let _,w,M,D,y,O,P,b,x,S,v,k,L="middle";if(n==="top")O=this.bottom-p,P=this._getXAxisLabelAlignment();else if(n==="bottom")O=this.top+p,P=this._getXAxisLabelAlignment();else if(n==="left"){const T=this._getYAxisLabelAlignment(u);P=T.textAlign,y=T.x}else if(n==="right"){const T=this._getYAxisLabelAlignment(u);P=T.textAlign,y=T.x}
1else if(e==="x"){if(n==="center")O=(t.top+t.bottom)/2+f;else if(E(n)){const T=Object.keys(n)[0],A=n[T];O=this.chart.scales[T].getPixelForValue(A)+f}P=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")y=(t.left+t.right)/2-f;else if(E(n)){const T=Object.keys(n)[0],A=n[T];y=this.chart.scales[T].getPixelForValue(A)}P=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?L="top":l==="end"&&(L="bottom"));const C=this._getLabelSizes();for(_=0,w=a.length;_<w;++_){M=a[_],D=M.label;const T=o.setContext(this.getContext(_));b=this.getPixelForTick(_)+o.labelOffset,x=this._resolveTickFontOptions(_),S=x.lineHeight,v=U(D)?D.length:1;const A=v/2,$=T.color,Q=T.textStrokeColor,fe=T.textStrokeWidth;let Ft=P;r?(y=b,P==="inner"&&(_===w-1?Ft=this.options.reverse?"left":"right":_===0?Ft=this.options.reverse?"right":"left":Ft="center"),n==="top"?c==="near"||g!==0?k=-v*S+S/2:c==="center"?k=-C.highest.height/2-A*S+S:k=-C.highest.height+S/2:c==="near"||g!==0?k=S/2:c==="center"?k=C.highest.height/2-A*S:k=C.highest.height-v*S,d&&(k*=-1),g!==0&&!T.showLabelBackdrop&&(y+=S/2*Math.sin(g))):(O=b,k=(1-v)*S/2);let ge;if(T.showLabelBackdrop){const Rt=st(T.backdropPadding),Ut=C.heights[_],xt=C.widths[_];let Yt=k-Rt.top,yt=0-Rt.left;switch(L){case"middle":Yt-=Ut/2;break;case"bottom":Yt-=Ut;break}switch(P){case"center":yt-=xt/2;break;case"right":yt-=xt;break;case"inner":_===w-1?yt-=xt:_>0&&(yt-=xt/2);break}ge={left:yt,top:Yt,width:xt+Rt.width,height:Ut+Rt.height,color:T.backdropColor}}m.push({label:D,font:x,textOffset:k,options:{rotation:g,color:$,strokeColor:Q,strokeWidth:fe,textAlign:Ft,textBaseline:L,translation:[y,O],backdrop:ge}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Pt(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};
1if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=wt(t,this.left,r)-r/2,h=wt(t,this.right,a)+a/2,d=u=l):(d=wt(t,this.top,r)-r/2,u=wt(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&Ne(s,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;he(s,c,0,h,l,a)}n&&We(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=K(s.font),r=st(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||E(e)?(l+=r.bottom,U(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=nl(this,l,e,a);he(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:u,textAlign:sl(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=R(t.grid&&t.grid.z,-1),n=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==jt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return K(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ce{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;al(e)&&(s=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,ol(t,r,s),this.override&&j.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in j[n]&&(delete j[n][s],this.override&&delete Lt[s])}}function ol(i,t,e){const s=ae(Object.create(null),[e?j.get(e):{},j.get(t),i.defaults]);j.set(t,s),i.defaultRoutes&&rl(t,i.defaultRoutes),i.descriptors&&j.describe(t,i.descriptors)}function rl(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");j.route(o,n,l,a)})}function al(i){return"id"in i&&"defaults"in i}class ll{constructor(){this.controllers=new Ce(Pn,"datasets",!0),this.elements=new Ce(It,"elements"),this.plugins=new Ce(Object,"plugins"),this.scales=new Ce(jt,"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")}
1removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):B(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=vi(t);V(s["before"+n],[],s),e[t](s),V(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var lt=new ll;class cl{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(V(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=R(s.options&&s.options.plugins,{}),o=hl(s);return n===!1&&!e?[]:ul(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function hl(i){const t={},e=[],s=Object.keys(lt.plugins.items);for(let o=0;o<s.length;o++)e.push(lt.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function dl(i,t){return!t&&i===!1?null:i===!0?{}:i}function ul(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=dl(s[l],n);c!==null&&o.push({plugin:a,options:fl(i.config,{plugin:a,local:e[l]},c,r)})}return o}function fl(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(s,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function gi(i,t){const e=j.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function gl(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function pl(i,t){return i===t?"_index_":"_value_"}function ys(i){if(i==="x"||i==="y"||i==="r")return i}function ml(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function pi(i,...t){if(ys(i))return i;for(const e of t){const s=e.axis||ml(e.position)||i.length>1&&ys(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function vs(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function bl(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return vs(i,"x",e[0])||vs(i,"y",e[0])}return{}}function _l(i,t){const e=Lt[i.type]||{scales:{}},s=t.scales||{},n=gi(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!E(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=pi(r,a,bl(r,i),j.scales[a.type]),c=pl(l,n),h=e.scales||{};o[r]=ee(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||gi(a,t),h=(Lt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=gl(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),ee(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];ee(a,[j.scales[a.type],j.scale])}),o}function Fn(i){const t=i.options||(i.options={});t.plugins=R(t.plugins,{}),t.scales=_l(i,t)}function Rn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function xl(i){return i=i||{},i.data=Rn(i.data),Fn(i),i}const ws=new Map,En=new Set;function De(i,t){let e=ws.get(i);return e||(e=t(),ws.set(i,e),En.add(e)),e}const Zt=(i,t,e)=>{const s=Re(t,e);s!==void 0&&i.add(s)};class yl{constructor(t){this._config=xl(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=Rn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Fn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return De(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return De(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return De(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return De(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Zt(l,t,d))),h.forEach(d=>Zt(l,n,d)),h.forEach(d=>Zt(l,Lt[o]||{},d)),h.forEach(d=>Zt(l,j,d)),h.forEach(d=>Zt(l,di,d))});const c=Array.from(l);
1return c.length===0&&c.push(Object.create(null)),En.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Lt[e]||{},j.datasets[e]||{},{type:e},j,di]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=ks(this._resolverCache,t,n);let l=r;if(wl(r,e)){o.$shared=!1,s=_t(s)?s():s;const c=this.createResolver(t,s,a);l=Wt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=ks(this._resolverCache,t,s);return E(e)?Wt(o,e,void 0,n):o}}function ks(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Mi(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const vl=i=>E(i)&&Object.getOwnPropertyNames(i).some(t=>_t(i[t]));function wl(i,t){const{isScriptable:e,isIndexable:s}=pn(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(_t(a)||vl(a))||r&&U(a))return!0}return!1}var kl="4.5.0";const Sl=["top","bottom","left","right","chartArea"];function Ss(i,t){return i==="top"||i==="bottom"||Sl.indexOf(i)===-1&&t==="x"}function Ms(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Cs(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),V(e&&e.onComplete,[i],t)}function Ml(i){const t=i.chart,e=t.options.animation;V(e&&e.onProgress,[i],t)}function zn(i){return Pi()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ae={},Ds=i=>{const t=zn(i);return Object.values(Ae).filter(e=>e.canvas===t).pop()};function Cl(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function Dl(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}let je=class{static defaults=j;static instances=Ae;static overrides=Lt;static registry=lt;static version=kl;static getChart=Ds;static register(...t){lt.add(...t),Ps()}static unregister(...t){lt.remove(...t),Ps()}constructor(t,e){const s=this.config=new yl(e),n=zn(t),o=Ds(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Ua(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Ao(),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 cl,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Qo(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Ae[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ut.listen(this,"complete",Cs),ut.listen(this,"progress",Ml),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return N(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return lt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Gi(this.canvas,this.ctx),this}stop(){return ut.stop(this),this}resize(t,e){ut.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Qi(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),V(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};B(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=pi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),B(o,r=>{const a=r.options,l=a.id,c=pi(l,a),h=R(a.type,r.dtype);(a.position===void 0||Ss(a.position,c)!==Ss(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=lt.getScale(h);
1d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),B(n,(r,a)=>{r||delete s[a]}),B(s,r=>{it.configure(this,r,r.options),it.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Ms("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||gi(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=lt.getController(a),{datasetElementType:c,dataElementType:h}=j.datasets[a];Object.assign(l,{dataElementType:lt.getElement(h),datasetElementType:c&&lt.getElement(c)}),r.controller=new l(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){B(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),u=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),n||B(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ms("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){B(this.scales,t=>{it.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Ni(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;Cl(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!Ni(n,s(o)))return;return Array.from(n).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;it.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],B(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,_t(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ut.has(this)?this.attached&&!ut.running(this)&&ut.start(this):(this.draw(),Cs({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s={meta:t,index:t.index,cancelable:!0},n=Mn(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&Ne(e,n),t.controller.draw(),n&&We(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ce(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Sa.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=At(null,{chart:this,type:"chart"}))}
1getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);Ee(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ut.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Gi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ae[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};B(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){B(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},B(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ie(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=Bo(t),c=Dl(t,this._lastEvent,s,l);s&&(this._lastEvent=null,V(o.onHover,[t,a,this],this),l&&V(o.onClick,[t,a,this],this));const h=!Ie(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};function Ps(){return B(je.instances,i=>i._plugins.invalidate())}function Bn(i,t,e=t){i.lineCap=R(e.borderCapStyle,t.borderCapStyle),i.setLineDash(R(e.borderDash,t.borderDash)),i.lineDashOffset=R(e.borderDashOffset,t.borderDashOffset),i.lineJoin=R(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=R(e.borderWidth,t.borderWidth),i.strokeStyle=R(e.borderColor,t.borderColor)}function Pl(i,t,e){i.lineTo(e.x,e.y)}function Ol(i){return i.stepped?fr:i.tension||i.cubicInterpolationMode==="monotone"?gr:Pl}function Hn(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;
1return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function Tl(i,t,e,s){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Hn(n,e,s),h=Ol(o);let{move:d=!0,reverse:u}=s||{},f,p,g;for(f=0;f<=c;++f)p=n[(a+(u?c-f:f))%r],!p.skip&&(d?(i.moveTo(p.x,p.y),d=!1):h(i,g,p,u,o.stepped),g=p);return l&&(p=n[(a+(u?c:0))%r],h(i,g,p,u,o.stepped)),!!l}function Ll(i,t,e,s){const n=t.points,{count:o,start:r,ilen:a}=Hn(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,d=0,u,f,p,g,m,_;const w=D=>(r+(c?a-D:D))%o,M=()=>{g!==m&&(i.lineTo(h,m),i.lineTo(h,g),i.lineTo(h,_))};for(l&&(f=n[w(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[w(u)],f.skip)continue;const D=f.x,y=f.y,O=D|0;O===p?(y<g?g=y:y>m&&(m=y),h=(d*h+D)/++d):(M(),i.lineTo(D,y),p=O,d=0,g=m=y),_=y}M()}function mi(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ll:Tl}function Al(i){return i.stepped?Xr:i.tension||i.cubicInterpolationMode==="monotone"?Kr:Mt}function Il(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Bn(i,t.options),i.stroke(n)}function Fl(i,t,e,s){const{segments:n,options:o}=t,r=mi(t);for(const a of n)Bn(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Rl=typeof Path2D=="function";function El(i,t,e,s){Rl&&!t.options.segment?Il(i,t,e,s):Fl(i,t,e,s)}class Ue extends It{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;Hr(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=ta(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Sn(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=Al(s);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:u}=r[c],f=o[d],p=o[u];if(f===p){a.push(f);continue}const g=Math.abs((n-f[e])/(p[e]-f[e])),m=l(f,p,g,s.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,s){return mi(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=mi(this);let r=this._loop;e=e||0,s=s||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+s-1});return!!r}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),El(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Os(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class zl extends It{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,s){const n=this.options,{x:o,y:r}=this.getProps(["x","y"],s);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Os(this,t,"x",e)}inYRange(t,e){return Os(this,t,"y",e)}getCenterPoint(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const s=e&&t.borderWidth||0;return(e+s)*2}draw(t,e){const s=this.options;this.skip||s.radius<.1||!ce(this,e,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,ui(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Bl(i,t,e){const s=i.segments,n=i.points,o=t.points,r=[];for(const a of s){let{start:l,end:c}=a;c=Ye(l,c,n);const h=bi(e,n[l],n[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:n[l],end:n[c]});continue}const d=Sn(t,h);for(const u of d){const f=bi(e,o[u.start],o[u.end],u.loop),p=kn(a,n,f);for(const g of p)r.push({source:g,target:u,start:{[e]:Ts(h,f,"start",Math.max)},end:{[e]:Ts(h,f,"end",Math.min)}})}}return r}function bi(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=ct(n),o=ct(o)),{property:i,start:n,end:o}}function Hl(i,t){const{x:e=null,y:s=null}=i||{},n=t.points,o=[];
1return t.segments.forEach(({start:r,end:a})=>{a=Ye(r,a,n);const l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Ye(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function Ts(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function Nn(i,t){let e=[],s=!1;return U(i)?(s=!0,e=i):e=Hl(i,t),e.length?new Ue({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Ls(i){return i&&i.fill!==!1}function Nl(i,t,e){let n=i[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!q(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function Wl(i,t,e){const s=Ul(i);if(E(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return q(n)&&Math.floor(n)===n?Vl(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Vl(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function $l(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:E(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function jl(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:E(i)?s=i.value:s=t.getBaseValue(),s}function Ul(i){const t=i.options,e=t.fill;let s=R(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Yl(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=Xl(t,e);a.push(Nn({x:null,y:t.bottom},s));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Kl(n,r[h],a)}return new Ue({points:n,options:{}})}function Xl(i,t){const e=[],s=i.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){const o=s[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Kl(i,t,e){const s=[];for(let n=0;n<e.length;n++){const o=e[n],{first:r,last:a,point:l}=ql(o,t,"x");if(!(!l||r&&a)){if(r)s.unshift(l);else if(i.push(l),!a)break}}i.push(...s)}function ql(i,t,e){const s=i.interpolate(t,e);if(!s)return{};const n=s[e],o=i.segments,r=i.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=r[h.start][e],u=r[h.end][e];if(Bt(n,d,u)){a=n===d,l=n===u;break}}return{first:a,last:l,point:s}}class Wn{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:n,y:o,radius:r}=this;return e=e||{start:0,end:ot},t.arc(n,o,r,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}}function Gl(i){const{chart:t,fill:e,line:s}=i;if(q(e))return Zl(t,e);if(e==="stack")return Yl(i);if(e==="shape")return!0;const n=Jl(i);return n instanceof Wn?n:Nn(n,s)}function Zl(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Jl(i){return(i.scale||{}).getPointPositionForValue?tc(i):Ql(i)}function Ql(i){const{scale:t={},fill:e}=i,s=$l(e,t);if(q(s)){const n=t.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function tc(i){const{scale:t,fill:e}=i,s=t.options,n=t.getLabels().length,o=s.reverse?t.max:t.min,r=jl(e,t,o),a=[];if(s.grid.circular){const l=t.getPointPositionForValue(0,o);return new Wn({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<n;++l)a.push(t.getPointPositionForValue(l,r));return a}function si(i,t,e){const s=Gl(t),{chart:n,index:o,line:r,scale:a,axis:l}=t,c=r.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},p=n.getDatasetMeta(o),g=Mn(n,p);s&&r.points.length&&(Ne(i,e),ec(i,{line:r,target:s,above:u,below:f,area:e,scale:a,axis:l,clip:g}),We(i))}function ec(i,t){const{line:e,target:s,above:n,below:o,area:r,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let h=o;o!==n&&(c==="x"?(As(i,s,r.top),ni(i,{line:e,target:s,color:n,scale:a,property:c,clip:l}),i.restore(),i.save(),As(i,s,r.bottom)):c==="y"&&(Is(i,s,r.left),ni(i,{line:e,target:s,color:o,scale:a,property:c,clip:l}),i.restore(),i.save(),Is(i,s,r.right),h=n)),ni(i,{line:e,target:s,color:h,scale:a,property:c,clip:l}),i.restore()}function As(i,t,e){const{segments:s,points:n}=t;let o=!0,r=!1;i.beginPath();for(const a of s){const{start:l,end:c}=a,h=n[l],d=n[Ye(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(d.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Is(i,t,e){const{segments:s,points:n}=t;let o=!0,r=!1;i.beginPath();for(const a of s){const{start:l,end:c}=a,h=n[l],d=n[Ye(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(e,h.y),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(e,d.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function ni(i,t){const{line:e,target:s,property:n,color:o,scale:r,clip:a}=t,l=Bl(e,s,n);for(const{source:c,target:h,start:d,end:u}of l){const{style:{backgroundColor:f=o}={}}=c,p=s!==!0;i.save(),i.fillStyle=f,ic(i,r,a,p&&bi(n,d,u)),i.beginPath();const g=!!e.pathSegment(i,c);let m;if(p){g?i.closePath():Fs(i,s,u,n);const _=!!s.pathSegment(i,h,{move:g,reverse:!0});m=g&&_,m||Fs(i,s,d,n)}
1i.closePath(),i.fill(m?"evenodd":"nonzero"),i.restore()}}function ic(i,t,e,s){const n=t.chart.chartArea,{property:o,start:r,end:a}=s||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=r,c=n.top,h=a,d=n.bottom):(l=n.left,c=r,h=n.right,d=a),i.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),i.rect(l,c,h-l,d-c),i.clip()}}function Fs(i,t,e,s){const n=t.interpolate(e,s);n&&i.lineTo(n.x,n.y)}var sc={id:"filler",afterDatasetsUpdate(i,t,e){const s=(i.data.datasets||[]).length,n=[];let o,r,a,l;for(r=0;r<s;++r)o=i.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Ue&&(l={visible:i.isDatasetVisible(r),index:r,fill:Wl(a,r,s),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<s;++r)l=n[r],!(!l||l.fill===!1)&&(l.fill=Nl(n,r,e.propagate))},beforeDraw(i,t,e){const s=e.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=n.length-1;r>=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),s&&a.fill&&si(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;Ls(o)&&si(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Ls(s)||e.drawTime!=="beforeDatasetDraw"||si(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Rs=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},nc=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Es extends It{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=V(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=K(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Rs(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,g)=>{const m=s+e/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>
1r)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,_)=>{const{itemWidth:w,itemHeight:M}=oc(s,e,o,m,n);_>0&&f+M+2*a>h&&(d+=u+a,c.push({width:u,height:f}),p+=u+a,g++,u=f=0),l[_]={left:p,top:f,col:g,width:w,height:M},u=Math.max(u,w),f+=M+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=Ht(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=X(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=X(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=X(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=X(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ne(t,this),this._draw(),We(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=j.color,l=Ht(t.rtl,this.left,this.width),c=K(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=Rs(r,d),_=function(O,P,b){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const x=R(b.lineWidth,1);if(n.fillStyle=R(b.fillStyle,a),n.lineCap=R(b.lineCap,"butt"),n.lineDashOffset=R(b.lineDashOffset,0),n.lineJoin=R(b.lineJoin,"miter"),n.lineWidth=x,n.strokeStyle=R(b.strokeStyle,a),n.setLineDash(R(b.lineDash,[])),r.usePointStyle){const S={radius:g*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:x},v=l.xPlus(O,p/2),k=P+u;fn(n,S,v,k,r.pointStyleWidth&&p)}else{const S=P+Math.max((d-g)/2,0),v=l.leftForLtr(O,p),k=oe(b.borderRadius);n.beginPath(),Object.values(k).some(L=>L!==0)?fi(n,{x:v,y:S,w:p,h:g,radius:k}):n.rect(v,S,p,g),n.fill(),x!==0&&n.stroke()}n.restore()},w=function(O,P,b){he(n,b.text,O,P+m/2,c,{strikethrough:b.hidden,textAlign:l.textAlign(b.textAlign)})},M=this.isHorizontal(),D=this._computeTitleHeight();M?f={x:X(o,this.left+h,this.right-s[0]),y:this.top+h+D,line:0}:f={x:this.left+h,y:X(o,this.top+D+h,this.bottom-e[0].height),line:0},yn(this.ctx,t.textDirection);const y=m+h;this.legendItems.forEach((O,P)=>{n.strokeStyle=O.fontColor,n.fillStyle=O.fontColor;const b=n.measureText(O.text).width,x=l.textAlign(O.textAlign||(O.textAlign=r.textAlign)),S=p+u+b;let v=f.x,k=f.y;l.setWidth(this.width),M?P>0&&v+S+h>this.right&&(k=f.y+=y,f.line++,v=f.x=X(o,this.left+h,this.right-s[f.line])):P>0&&k+y>this.bottom&&(v=f.x=v+e[f.line].width+h,f.line++,k=f.y=X(o,this.top+D+h,this.bottom-e[f.line].height));const L=l.x(v);if(_(L,k,O),v=tr(x,v+p+u,M?v+S:this.right,t.rtl),w(l.x(v),k,O),M)f.x+=S+h;else if(typeof O.text!="string"){const C=c.lineHeight;f.y+=Vn(O,C)+h}else f.y+=y}),vn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=K(e.font),n=st(e.padding);if(!e.display)return;const o=Ht(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=X(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+X(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=X(a,d,d+u);r.textAlign=o.textAlign(ki(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,he(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=K(t.font),s=st(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Bt(t,this.left,this.right)&&Bt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Bt(t,n.left,n.left+n.width)&&Bt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!lc(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=nc(n,s);n&&!o&&V(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&V(e.onHover,[t,s,this],this)}else s&&V(e.onClick,[t,s,this],this)}}function oc(i,t,e,s,n){const o=rc(s,i,t,e),r=ac(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function rc(i,t,e,s){let n=i.text;
1return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function ac(i,t,e){let s=i;return typeof t.text!="string"&&(s=Vn(t,e)),s}function Vn(i,t){const e=i.text?i.text.length:0;return t*e}function lc(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var cc={id:"legend",_element:Es,start(i,t,e){const s=i.legend=new Es({ctx:i.ctx,options:e,chart:i});it.configure(i,s,e),it.addBox(i,s)},stop(i){it.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;it.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;
1return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=st(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:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class $n extends It{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=U(s.text)?s.text.length:1;this._padding=st(s.padding);const o=n*K(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=X(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=X(a,n,e),l=Y*-.5):(h=o-t,d=X(a,e,n),l=Y*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=K(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);he(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:ki(e.align),textBaseline:"middle",translation:[r,a]})}}function hc(i,t){const e=new $n({ctx:i.ctx,options:t,chart:i});it.configure(i,e,t),it.addBox(i,e),i.titleBlock=e}var dc={id:"title",_element:$n,start(i,t,e){hc(i,e)},stop(i){const t=i.titleBlock;it.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;it.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const te={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=hi(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function at(i,t){return t&&(U(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function ft(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
2`)>-1?i.split(`
3`):i}function uc(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function zs(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=K(t.bodyFont),c=K(t.titleFont),h=K(t.footerFont),d=o.length,u=n.length,f=s.length,p=st(t.padding);let g=p.height,m=0,_=s.reduce((D,y)=>D+y.before.length+y.lines.length+y.after.length,0);if(_+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){const D=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*D+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let w=0;const M=function(D){m=Math.max(m,e.measureText(D).width+w)};return e.save(),e.font=c.string,B(i.title,M),e.font=l.string,B(i.beforeBody.concat(i.afterBody),M),w=t.displayColors?r+2+t.boxPadding:0,B(s,D=>{B(D.before,M),B(D.lines,M),B(D.after,M)}
3),w=0,e.font=h.string,B(i.footer,M),e.restore(),m+=p.width,{width:m,height:g}}function fc(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function gc(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function pc(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),gc(c,i,t,e)&&(c="center"),c}function Bs(i,t,e){const s=e.yAlign||t.yAlign||fc(i,e);return{xAlign:e.xAlign||t.xAlign||pc(i,t,e,s),yAlign:s}}function mc(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function bc(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Hs(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=oe(r);let p=mc(t,a);const g=bc(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,u)+n:a==="right"&&(p+=Math.max(d,f)+n),{x:et(p,0,s.width-t.width),y:et(g,0,s.height-t.height)}}function Pe(i,t,e){const s=st(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Ns(i){return at([],ft(i))}function _c(i,t,e){return At(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ws(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const jn={beforeTitle:dt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:dt,beforeBody:dt,beforeLabel:dt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return N(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:dt,afterBody:dt,beforeFooter:dt,footer:dt,afterFooter:dt};function G(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?jn[t].call(e,s):n}class Vs extends It{static positioners=te;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Cn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=_c(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=G(s,"beforeTitle",this,t),o=G(s,"title",this,t),r=G(s,"afterTitle",this,t);let a=[];return a=at(a,ft(n)),a=at(a,ft(o)),a=at(a,ft(r)),a}getBeforeBody(t,e){return Ns(G(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return B(t,o=>{const r={before:[],lines:[],after:[]},a=Ws(s,o);at(r.before,ft(G(a,"beforeLabel",this,o))),at(r.lines,G(a,"label",this,o)),at(r.after,ft(G(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Ns(G(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=G(s,"beforeFooter",this,t),o=G(s,"footer",this,t),r=G(s,"afterFooter",this,t);let a=[];
3return a=at(a,ft(n)),a=at(a,ft(o)),a=at(a,ft(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(uc(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,u)=>t.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),B(a,h=>{const d=Ws(t.callbacks,h);n.push(G(d,"labelColor",this,h)),o.push(G(d,"labelPointStyle",this,h)),r.push(G(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=te[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=zs(this,s),c=Object.assign({},a,l),h=Bs(this.chart,s,c),d=Hs(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=oe(a),{x:u,y:f}=t,{width:p,height:g}=e;let m,_,w,M,D,y;return o==="center"?(D=f+g/2,n==="left"?(m=u,_=m-r,M=D+r,y=D-r):(m=u+p,_=m+r,M=D-r,y=D+r),w=m):(n==="left"?_=u+Math.max(l,h)+r:n==="right"?_=u+p-Math.max(c,d)-r:_=this.caretX,o==="top"?(M=f,D=M-r,m=_-r,w=_+r):(M=f+g,D=M+r,m=_+r,w=_-r),y=M),{x1:m,x2:_,x3:w,y1:M,y2:D,y3:y}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Ht(s.rtl,this.x,this.width);for(t.x=Pe(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=K(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=K(o.bodyFont),d=Pe(this,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=n.leftForLtr(u,c)+c/2,_=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ui(t,g,m,_),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ui(t,g,m,_)}else{t.lineWidth=E(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const g=n.leftForLtr(u,c),m=n.leftForLtr(n.xPlus(u,1),c-2),_=oe(r.borderRadius);Object.values(_).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,fi(t,{x:g,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),fi(t,{x:m,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=K(s.bodyFont);let u=d.lineHeight,f=0;const p=Ht(s.rtl,this.x,this.width),g=function(b){e.fillText(b,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(r);let _,w,M,D,y,O,P;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Pe(this,m,s),e.fillStyle=s.bodyColor,B(this.beforeBody,g),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,D=0,O=n.length;D<O;++D){for(_=n[D],w=this.labelTextColors[D],e.fillStyle=w,B(_.before,g),M=_.lines,a&&M.length&&(this._drawColorBox(e,t,D,p,s),u=Math.max(d.lineHeight,l)),y=0,P=M.length;y<P;++y)g(M[y]),u=d.lineHeight;B(_.after,g)}f=0,u=d.lineHeight,B(this.afterBody,g),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;
3if(o){const l=Ht(s.rtl,this.x,this.width);for(t.x=Pe(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=K(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=oe(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-u,l),e.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=te[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=zs(this,t),l=Object.assign({},r,this._size),c=Bs(e,t,l),h=Hs(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=st(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),yn(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),vn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Ie(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!Ie(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=te[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}var xc={id:"tooltip",_element:Vs,positioners:te,afterInit(i,t,e){e&&(i.tooltip=new Vs({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>
3t.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:jn},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const yc=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function vc(i,t,e,s){const n=i.indexOf(t);if(n===-1)return yc(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const wc=(i,t)=>i===null?null:et(Math.round(i),0,t);function $s(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class kc extends jt{static id="category";static defaults={ticks:{callback:$s}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(N(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:vc(s,t,R(e,t),this._addedLabels),wc(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return $s.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Sc(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,p=h-1,{min:g,max:m}=t,_=!N(r),w=!N(a),M=!N(c),D=(m-g)/(d+1);let y=Vi((m-g)/p/f)*f,O,P,b,x;if(y<1e-14&&!_&&!w)return[{value:g},{value:m}];x=Math.ceil(m/y)-Math.floor(g/y),x>p&&(y=Vi(x*y/p/f)*f),N(l)||(O=Math.pow(10,l),y=Math.ceil(y*O)/O),n==="ticks"?(P=Math.floor(g/y)*y,b=Math.ceil(m/y)*y):(P=g,b=m),_&&w&&o&&$o((a-r)/o,y/1e3)?(x=Math.round(Math.min((a-r)/y,h)),y=(a-r)/x,P=r,b=a):M?(P=_?r:P,b=w?a:b,x=c-1,y=(b-P)/x):(x=(b-P)/y,ie(x,Math.round(x),y/1e3)?x=Math.round(x):x=Math.ceil(x));const S=Math.max($i(y),$i(P));O=Math.pow(10,N(l)?S:l),P=Math.round(P*O)/O,b=Math.round(b*O)/O;let v=0;for(_&&(u&&P!==r?(e.push({value:r}),P<r&&v++,ie(Math.round((P+v*y)*O)/O,r,js(r,D,i))&&v++):P<r&&v++);v<x;++v){const k=Math.round((P+v*y)*O)/O;if(w&&k>a)break;e.push({value:k})}return w&&u&&b!==a?e.length&&ie(e[e.length-1].value,a,js(a,D,i))?e[e.length-1].value=a:e.push({value:a}):(!w||b===a)&&e.push({value:b}),e}function js(i,t,{horizontal:e,minRotation:s}){const n=Pt(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Mc extends jt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return N(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=Nt(n),c=Nt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();
3s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Sc(n,o);return t.bounds==="ticks"&&jo(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return dn(t,this.chart.options.locale,this.options.ticks.format)}}class Cc extends Mc{static id="linear";static defaults={ticks:{callback:un.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=q(t)?t:0,this.max=q(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Pt(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Xe={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}},J=Object.keys(Xe);function Us(i,t){return i-t}function Ys(i,t){if(N(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),q(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(le(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Xs(i,t,e,s){const n=J.length;for(let o=J.indexOf(i);o<n-1;++o){const r=Xe[J[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return J[o]}return J[n-1]}function Dc(i,t,e,s,n){for(let o=J.length-1;o>=J.indexOf(e);o--){const r=J[o];if(Xe[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return J[e?J.indexOf(e):0]}function Pc(i){for(let t=J.indexOf(i)+1,e=J.length;t<e;++t)if(Xe[J[t]].common)return J[t]}function Ks(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=wi(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Oc(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function qs(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,s.push({value:a,major:!1});return o===0||!e?s:Oc(i,s,n,e)}class Gs extends jt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new xa._date(t.adapters.date);n.init(e),ee(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Ys(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,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))),n=q(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=q(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=Go(n,o,r);return this._unit=e.unit||(s.autoSkip?Xs(e.minUnit,this.min,this.max,this._getLabelCapacity(o)
3):Dc(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Pc(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),qs(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=et(e,0,r),s=et(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Xs(o.minUnit,e,s,this._getLabelCapacity(e)),a=R(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=le(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<s;u=+t.add(u,a,r),f++)Ks(h,u,p);return(u===s||n.bounds==="ticks"||f===1)&&Ks(h,u,p),Object.keys(h).sort(Us).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return V(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=s[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=Pt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,qs(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(Ys(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Jo(t.sort(Us))}}function Oe(i,t,e){let s=0,n=i.length-1,o,r,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Ot(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Ot(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class id extends Gs{static id="timeseries";static defaults=Gs.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Oe(e,this.min),this._tableRange=Oe(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Oe(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Oe(this._table,s*this._tableRange+this._minPos,!0)}}const Un={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Tc={ariaLabel:{type:String},ariaDescribedby:{type:String}},Lc={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Un,...Tc},Ac=Jn[0]==="2"?(i,t)=>Object.assign(i,{attrs:t}):(i,t)=>Object.assign(i,t);function zt(i){return Qs(i)?ai(i):i}function Ic(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return Qs(t)?new Proxy(i,{}):i}function Fc(i,t){const e=i.options;
3e&&t&&Object.assign(e,t)}function Yn(i,t){i.labels=t}function Xn(i,t,e){const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(r=>r[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function Rc(i,t){const e={labels:[],datasets:[]};return Yn(e,i.labels),Xn(e,i.datasets,t),e}const Ec=$t({props:Lc,setup(i,t){let{expose:e,slots:s}=t;const n=ri(null),o=Zs(null);e({chart:o});const r=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:u,datasetIdKey:f}=i,p=Rc(h,f),g=Ic(p,h);o.value=new je(n.value,{type:c,data:g,options:{...d},plugins:u})},a=()=>{const c=ai(o.value);c&&(i.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},i.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(i.updateMode)};return Qn(r),to(a),Js([()=>i.options,()=>i.data],(c,h)=>{let[d,u]=c,[f,p]=h;const g=ai(o.value);if(!g)return;let m=!1;if(d){const _=zt(d),w=zt(f);_&&_!==w&&(Fc(g,_),m=!0)}if(u){const _=zt(u.labels),w=zt(p.labels),M=zt(u.datasets),D=zt(p.datasets);_!==w&&(Yn(g.config.data,_),m=!0),M&&M!==D&&(Xn(g.config.data,M,i.datasetIdKey),m=!0)}m&&eo(()=>{l(g)})},{deep:!0}),()=>oi("canvas",{role:"img",ariaLabel:i.ariaLabel,ariaDescribedby:i.ariaDescribedby,ref:n},[oi("p",{},[s.default?s.default():""])])}});function zc(i,t){return je.register(t),$t({props:Un,setup(e,s){let{expose:n}=s;const o=Zs(null),r=a=>{o.value=a?.chart};return n({chart:o}),()=>oi(Ec,Ac({ref:r},{type:i,...e}))}})}const Bc=zc("line",_a),Hc={class:"line-multi-chart"},Nc=$t({__name:"LineMultiChart",props:{labels:{},datasets:{},yLabel:{}},setup(i){je.register(Ue,zl,Cc,kc,cc,xc,sc,dc);const t=(r,a=.2)=>{const l=r.replace("#",""),c=parseInt(l,16),h=c>>16&255,d=c>>8&255,u=c&255;return`rgba(${h}, ${d}, ${u}, ${a})`},e=r=>{const a=["rgb(224, 0, 50)","rgb(255, 81, 90)","rgb(255, 196, 131)","rgb(86, 185, 178)","rgb(50, 139, 121)","rgb(52, 152, 219)","rgb(155, 89, 182)"];return a[r%a.length]},s=W(()=>({labels:i.labels,datasets:i.datasets.map((r,a)=>({label:r.label,data:r.data,borderColor:r.color||e(a),backgroundColor:t(r.color||e(a),.15),tension:0,pointBackgroun
3dColor:"#ffffff",pointBorderColor:r.color||e(a),pointHoverBackgroundColor:"#ffffff",pointHoverBorderColor:r.color||e(a),pointRadius:2,pointHoverRadius:4,fill:!1,spanGaps:!0,hidden:r.hidden===!0}))})),n=W(()=>i.datasets.filter(r=>Array.isArray(r.data)&&r.data.length>0).length),o=W(()=>({responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",axis:"x",intersect:!1},plugins:{legend:{display:!1},title:{display:!1},tooltip:{enabled:n.value>0,intersect:!1,mode:"index",position:"average",cornerRadius:4,displayColors:!0,bodySpacing:4,titleSpacing:4,caretSize:0}},scales:{x:{display:!0,ticks:{maxRotation:0},grid:{display:!1},border:{display:!0,color:"var(--color-primary)"}},y:{display:!0,position:"right",title:{display:!!i.yLabel,text:i.yLabel||""},beginAtZero:!1,border:{display:!1},ticks:{crossAlign:"far"},grid:{color:function(r){return r.index===0?"var(--color-primary)":"#e5e5e5"}}}}}));return(r,a)=>(F(),z("div",Hc,[H(s)?(F(),Te(H(Bc),{key:0,data:H(s),options:H(o)},null,8,["data","options"])):Z("",!0)]))}}),Wc={key:0,class:"region-problem-charts"},Vc={class:"region-problem-charts__header"},$c={class:"region-problem-charts__group-title"},jc={key:0,class:"region-problem-charts__downloads"},Uc=["href"],Yc=["href"],Xc={class:"region-problem-charts__grid"},Kc={class:"region-problem-charts__card-header"},qc=["id"],Gc=["innerHTML"],Zc={key:0,class:"region-problem-charts__legend"},Jc=["onClick"],Qc={class:"region-problem-charts__legend-text"},th={key:1,class:"region-problem-charts__canvas"},eh={key:2,class:"region-problem-charts__digits"},ih={class:"region-problem-charts__digit-value"},sh={class:"region-problem-charts__digit-label"},nh=["innerHTML"],oh={key:4,class:"region-problem-charts__switchers"},rh={key:0,class:"region-problem-charts__switcher"},ah={class:"region-problem-charts__switcher-label"},lh=$t({__name:"RegionProblemCharts",props:{charts:{},problemSlug:{},regionSlug:{}},setup(i){const t=io(),e=W(()=>i.charts||{}),s=W(()=>Object.keys(e.value)),n=W(()=>s.value.length>0),o=W(()=>i.regionSlug==="all_russia"?`${t.public.apiUrl}/storage/problem_${i.problemSlug}_all`:`${t.public.apiUrl}/v4/download/singleRegionProblemCsv?region_path=${i.regionSlug}&problem_path=${i.problemSlug}`),r=W(()=>`${o.value}${i.regionSlug==="all_russia"?".xls":"&format=xls"}`),a=W(()=>`${o.value}${i.regionSlug==="all_russia"?".csv":"&format=csv"}`),l=ri({}),c=ri({}),h=(b,x)=>(c.value[x]||(c.value[x]={...b,id:x,switcher:b.switcher?JSON.parse(JSON.stringify(b.switcher)):null,switcherData2:b.switcherData2?JSON.parse(JSON.stringify(b.switcherData2)):null}),c.value[x]);Js(()=>i.charts,()=>{c.value={},l.value={}});const d=W(()=>{const b={};for(const x of Object.keys(e.value)){const S=e.value[x]||{},v=[];Object.keys(S).forEach((k,L)=>{const C=S[k],T=`${C.id}_${x}_${L}`,A=h(C,T);v.push(A)}),v.sort((k,L)=>(k.col||0)-(L.col||0)),b[x]=v}return b}),u=(b,x,S)=>{const v=x.params.indexOf(S);v!==-1&&(x.act=v)},f={root:{class:"region-problem-charts__switcher-group"},pcToggleButton:{root:({context:b})=>({class:b&&b.active?"region-problem-charts__switcher-segment region-problem-charts__switcher-segment--active":"region-problem-charts__switcher-segment"}),label:{class:"region-problem-charts__switcher-segment-label"}}},p=b=>{const x=["rgb(224, 0, 50)","rgb(255, 81, 90)","rgb(255, 196, 131)","rgb(86, 185, 178)","rgb(50, 139, 121)","rgb(52, 152, 219)","rgb(155, 89, 182)"];return x[b%x.length]},g=(b,x)=>l.value[b]?l.value[b].has(x):!1,m=(b,x)=>{l.value[b]||(l.value[b]=new Set),l.value[b].has(x)?l.value[b].delete(x):l.value[b].add(x)},_=b=>{if(b.switcher?.length===1&&b.switcher[0]?.name==="Сегмент")return[];if(Array.isArray(b.axisLabels)&&b.axisLabels.some(x=>typeof x=="string"&&x.trim()))return b.axisLabels;if(b.switcher&&b.switcher.length&&b.switcherData2){const x=w(b)||[],S=P(b,x);return S?x.map(v=>String(v[S]??"")).filter(v=>v.trim().length>0):[]}return[]},w=b=>{if(!b.switcher||!b.switcher.length||!b.switcherData2)return null;const x=[];for(let S=0;S<b.switcherData2.length;S++){let v=!0;for(let k=0;k<b.switcher.length;k++){const L=b.switcher[k];if(L.name==="Сегмент")continue;const C=L.params[L.act||0];if(b.switcherData2[S][L.name]!==C){v=!1;break}}v&&x.push(b.switcherData2[S])}return x},M=b=>{if(b.switcher&&b.switcher.length&&b.switcherData2){const S=w(b)||[],v=P(b,S);if(b.switcher.length===1&&b.switcher[0]?.name==="Сегмент"){const L=b.switcher[0].act||0,C=S[L];if(C&&v)return[{label:C[v]||"",data:(C.data||[]).map(T=>T===null?null:Number(T)),color:p(0),hidden:!1}]}return(v?S.map(L=>String(L[v]??"")):S.map(()=>"")).map((L,C)=>({label:L||"",data:(S[C]?.data||[]).map(T=>T===null?null:Number(T)),color:p(C),hidden:g(b.id,C)}))}return Array.isArray(b.plotData?.[0])?(b.plotData||[]).map((S,v)=>({label:Array.isArray(b.axisLabels)&&b.axisLabels[v]||`Серия ${v+1}`,data:S.map(k=>k===null?null:Number(k)),color:p(v),hidden:g(b.id,v)})):[{label:Array.isArray(b.axisLabels)&&b.axisLabels[0]||"Значение",data:(b.plotData||[]).map(S=>S===null?null:Number(S)),color:p(0),hidden:g(b.id,0)}]},D=b=>{const x=String(b.type||"").toLowerCase();return x!=="цифра"&&x!=="текст"},y=b=>{const x=[];if(Array.isArray(b.plotData?.[0]))for(let v=0;v<b.plotData.length;v++){const L=b.plotData[v].slice().reverse().find(C=>C!==null&&C!=="");x.push({label:Array.isArray(b.labels)&&b.labels[v]||"",value:L??""})}else{const v=(b.plotData||[]).slice().reverse().find(k=>k!==null&&k!=="");x.push({label:Array.isArray(b.axisLabels)&&b.axisLabels[0]||"",value:v??""})}return x},O=(b,x)=>{const S=String(x?.name||""),v=String(b?.type||"");return Array.isArray(x?.params)&&x.params.length<=1?!0:b.switcher?.length===1&&S==="Сегмент"?!1:S==="Сегмент"&&(v==="несколько червяков с выбором"||v==="несколько червяков")},P=(b,x)=>{const S=x&&x[0];if(!S)return null;const v=Object.keys(S).filter(T=>typeof S[T]=="string"),k=v.find(T=>{const A=T.toLowerCase();return A==="сегмент"||A==="segment"||A==="нозологии"||A==="нозология"});if(k)return k;if(Array.isArray(b.switcher)){const T=b.switcher.find(A=>{const $=String(A?.name||"").toLowerCase();return $==="сегмент"||$==="segment"||$==="нозологии"||$==="нозология"});if(T&&Array.isArray(T.params)){const A=new Set(T.params.map(Q=>String(Q))),$=v.find(Q=>A.has(String(S[Q])));if($)return $}}const L=new Set(["data","scaleName","txt","type"]);return v.find(T=>!L.has(T))||null};return(b,x)=>{const S=Zn;return H(n)?(F(),z("section",Wc,[(F(!0),z(ht,null,Ct(H(e),(v,k,L)=>(F(),z("div",{key:k,class:"region-problem-charts__group"},[I("div",Vc,[I("h2",$c,pt(k),1),L===0?(F(),z("div",jc,[I("a",{href:H(r),class:"region-problem-charts__download",download:""},[...x[0]||(x[0]=[I("span",{class:"region-problem-charts__download-icon"},[I("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[I("path",{d:"M8 1.33325V10.6666M8 10.6666L5.33333 7.99992M8 10.6666L10.6667 7.99992M13.3333 10.6666V13.3333C13.3333 13.6869 13.1928 14.02
36 12.9428 14.2761C12.6927 14.5261 12.3536 14.6666 12 14.6666H4C3.64638 14.6666 3.30724 14.5261 3.05719 14.2761C2.80714 14.026 2.66666 13.6869 2.66666 13.3333V10.6666",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1),I("span",{class:"region-problem-charts__download-text"},"XLS",-1)])],8,Uc),I("a",{href:H(a),class:"region-problem-charts__download"},[...x[1]||(x[1]=[I("span",{class:"region-problem-charts__download-icon"},[I("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[I("path",{d:"M8 1.33325V10.6666M8 10.6666L5.33333 7.99992M8 10.6666L10.6667 7.99992M13.3333 10.6666V13.3333C13.3333 13.6869 13.1928 14.026 12.9428 14.2761C12.6927 14.5261 12.3536 14.6666 12 14.6666H4C3.64638 14.6666 3.30724 14.5261 3.05719 14.2761C2.80714 14.026 2.66666 13.6869 2.66666 13.3333V10.6666",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1),I("span",{class:"region-problem-charts__download-text"},"CSV",-1)])],8,Yc)])):Z("",!0)]),I("div",Xc,[(F(!0),z(ht,null,Ct(H(d)[k],C=>(F(),z("article",{key:C.id,class:"region-problem-charts__card"},[I("header",Kc,[I("a",{id:`plot_${C.id}`},null,8,qc),I("h3",{class:"region-problem-charts__card-title",innerHTML:C.txt},null,8,Gc)]),D(C)&&_(C).length>1?(F(),z("div",Zc,[(F(!0),z(ht,null,Ct(_(C),(T,A)=>(F(),z("button",{key:`${C.id}-${A}`,type:"button",class:so(["region-problem-charts__legend-item",{"region-problem-charts__legend-item--passive":g(C.id,A)}]),onClick:$=>m(C.id,A)},[I("span",{class:"region-problem-charts__legend-color",style:tn({backgroundColor:p(A)})},null,4),I("span",Qc,pt(T),1)],10,Jc))),128))])):Z("",!0),D(C)?(F(),z("div",th,[Dt(Nc,{labels:C.labels,datasets:M(C),"y-label":C.scaleName?.left||""},null,8,["labels","datasets","y-label"])])):(F(),z("div",eh,[(F(!0),z(ht,null,Ct(y(C),T=>(F(),z("div",{key:T.label,class:"region-problem-charts__digit"},[I("div",ih,pt(T.value),1),I("div",sh,pt(T.label),1)]))),128))])),C.remark?(F(),z("div",{key:3,class:"region-problem-charts__remark",innerHTML:C.remark},null,8,nh)):Z("",!0),C.switcher&&C.switcher.length?(F(),z("div",oh,[(F(!0),z(ht,null,Ct(C.switcher,T=>(F(),z(ht,{key:`${C.id}-${T.name}`},[O(C,T)?Z("",!0):(F(),z("div",rh,[I("label",ah,pt(T.name),1),Dt(S,{"model-value":T.params[T.act||0],options:T.params,"allow-empty":!1,class:"region-problem-charts__switcher-button-group",pt:f,"onUpdate:modelValue":A=>u(C,T,A)},null,8,["model-value","options","onUpdate:modelValue"])]))],64))),128))])):Z("",!0)]))),128))])]))),128))])):Z("",!0)}}}),ch={class:"problem-region-metrics"},hh={class:"problem-region-metrics__content"},dh={class:"problem-region-metrics__header"},uh={class:"problem-region-metrics__letter-block"},fh={class:"problem-region-metrics__letter-wrapper"},gh={class:"problem-region-metrics__letter"},ph={class:"problem-region-metrics__data"},mh={class:"problem-region-metrics__metric-value"},bh={key:0},_h={key:0},xh={key:2},yh=["innerHTML"],vh={key:0,class:"problem-region-metrics__footer"},wh=$t({__name:"ProblemRegionMetrics",props:{letter:{},metricsData:{},problemSlug:{},showMethodology:{type:Boolean}},setup(i){const t=s=>{if(s===null)return"";if(typeof s=="string")return s;const n=Number(s);return isNaN(n)?String(s):n.toLocaleString("ru-RU")},e=s=>s?s.replace(/\b(\d+)\b/g,n=>{const o=Number(n);return o>1e4?(o/1e3).toFixed(1).replace(".0","")+"K":n}):"";return(s,n)=>{const o=ro;return F(),z("div",ch,[I("div",hh,[I("div",dh,[I("div",uh,[I("div",fh,[I("div",{class:"problem-region-metrics__letter-bg",style:tn({color:`var(--color-level-${s.letter.toLowerCase()})`})},null,4),I("div",gh,pt(s.letter==="-"?"–":s.letter),1)]),n[0]||(n[0]=I("div",{class:"problem-region-metrics__letter-desc"},[pe(" средняя"),I("br"),pe("выраженность"),I("br"),pe("проблемы ")],-1))])]),I("div",ph,[(F(!0),z(ht,null,Ct(s.metricsData,(r,a)=>(F(),z("div",{key:a,class:"problem-region-metrics__metric"},[I("div",mh,[r.measure_name==="%"?(F(),z("span",bh,pt(t(r.value))+"%",1)):(F(),z(ht,{key:1},[I("span",null,pt(t(r.value)),1),r.value!=="Недостаточно данных"?(F(),z("span",_h,pt(e(r.measure_name)),1)):Z("",!0)],64)),r.rouble?(F(),z("dfn",xh,"₽")):Z("",!0)]),I("div",{class:"problem-region-metrics__metric-desc",innerHTML:r.description},null,8,yh)]))),128))]),s.showMethodology?(F(),z("div",vh,[Dt(o,{to:`/methodology/${s.problemSlug}`,class:"problem-region-metrics__link"},{default:li(()=>[...n[1]||(n[1]=[pe(" Методология ",-1)])]),_:1},8,["to"])])):Z("",!0)])])}}}),kh={class:"problem-region-page"},Sh={class:"problem-region-page__selectors"},Mh={class:"problem-region-page__content-header"},Ch=["innerHTML"],Dh={class:"problem-region-page__content"},Ph={key:0,class:"problem-region-page__loading"},sd=$t({__name:"[slug_region]",async setup(i){let t,e;const s=no(),n=ao(),o=s.params.slug,r=s.params.slug_region;lo(()=>`/v4/meta/region/problem?problem_path=${o}&region_path=${r}`);const a=W(()=>n.getProblemBySlug(o)),l=W(()=>n.getRegionBySlug(r)),{data:c,pending:h,error:d}=([t,e]=Ai(()=>Fi(`/v4/problems/${o}/regions/${r}`,{default:()=>({chart:{data:{}},header:{data:{}},meta:{}})})),t=await t,e(),t);if(d.value)throw Ii({statusCode:404,statusMessage:"Проблема или регион не найдены"});const{data:u,pending:f}=([t,e]=Ai(()=>Fi(`/v4/methodology/${o}`,{default:()=>null})),t=await t,e(),t),p=W(()=>n.legend),g=W(()=>c.value?.header?.data||{}),m=W(()=>c.value?.chart?.data||{}),_=W(()=>Object.keys(g.value||{}).map(L=>parseInt(L,10)).filter(L=>!Number.isNaN(L)).sort((L,C)=>L-C)),w=W(()=>!!a.value?.limit),M=W(()=>!w.value&&!f.value&&!!u.value?.body?.trim()),D=k=>{let L=0;for(let C=k.length-1;C>=0;C--){const T=k[C],A=g.value?.[T];if(!(!A||!A.length)){if(w.value){if(A.some(Q=>Q.value!==""&&Q.value!==null))return T}else if((A[0]?.value||"").toString().toUpperCase()!==""){L=T;break}}}return L},y=W(()=>D(_.value)),O=W(()=>{const k=g.value?.[y.value],L=(k&&k[0]&&k[0].value?String(k[0].value):"").toUpperCase();return["A","B","C","D","E"].includes(L)?L:"-"}),P=W(()=>{const k=[],L=g.value||{};return Object.keys(L).map(C=>parseInt(C,10)).filter(C=>!Number.isNaN(C)).sort((C,T)=>C-T).forEach(C=>{const T=(L[C]?.[0]?.value??"").toString().toUpperCase();T&&k.push({year:C,level:T})}),k}),b=W(()=>O.value==="-"&&P.value.length===0),x=W(()=>{const k=g.value?.[y.value]||[];return k.length?k.slice(O.value==="-"?0:1).filter(L=>L.value!==""):[]}),S=W(()=>{const k=l.value?.slug;return k?k==="s_peterburg_i_leningradskaya_oblast"?"В&nbsp;связи с&nbsp;особенностями ведения статистического учета представлены объединенные данные по&nbsp;г.&nbsp;<nobr>Санкт-Петербургу</nobr> и&nbsp;Ленинградской области":k==="respublika_krym_i_sevastopol"?"В&nbsp;связи с&nbsp;особенностями ведения статистического учета представлены объединенные данные по&nbsp;г.&nbsp;Севастополю и&nbsp;Республике Крым":k==="moskva_i_moskovskaya_oblast"?"В&nbsp;связи с&nbsp;особенностями ведения статистического учета представлены объединенные данные по&nbsp;г.&nbsp;Москве и&nbsp;Московской области":"":""}),v=W(()=>!!h.value);if(!v.value&&b.value&&(!y.value||!x.value.length))throw Ii({statusCode:404,statusMessage:"Данные по этой проблеме в данном регионе отсутствуют"});return oo({bodyAttrs:{class:"gradient-background"}}),(k,L)=>(F(),z("div",kh,[Dt(Li,{class:"problem-region-page__header"},{default:li(()=>[I("h1",Sh,[Dt(Kn)]),H(O)!=="-"&&(H(v)||H(P)&&H(P).length>0)?(F(),Te(Gn,{key:0,class:"problem-region-page__step-chart",data:H(P),levels:H(p),problem:{
3isDisabled:!1}},null,8,["data","levels"])):Z("",!0)]),_:1}),Dt(Li,{class:"problem-region-page__container"},{default:li(()=>[I("header",Mh,[H(S)?(F(),z("p",{key:0,class:"problem-region-page__explanation",innerHTML:H(S)},null,8,Ch)):Z("",!0)]),I("section",Dh,[H(v)?(F(),z("div",Ph,[(F(),z(ht,null,Ct(6,C=>I("div",{key:C,class:"problem-region-page__loading-card"})),64))])):(F(),z(ht,{key:1},[H(y)&&H(x).length?(F(),Te(wh,{key:0,letter:H(O),"metrics-data":H(x),"problem-slug":H(o),"show-methodology":H(M)},null,8,["letter","metrics-data","problem-slug","show-methodology"])):Z("",!0),Object.keys(H(m)).length>0?(F(),Te(lh,{key:1,class:"problem-region-page__charts",charts:H(m),"problem-slug":H(o),"region-slug":H(r)},null,8,["charts","problem-slug","region-slug"])):Z("",!0)],64))]),Dt(qn,{class:"problem-region-page__support"})]),_:1})]))}});export{sd as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.